Skip to content

Commit 6305de3

Browse files
Merge branch 'main' into urlStore_tud
- Resolved conflicts in src/index.js and src/routes/index.js - Kept both URL Store Controller and PTA2 Controller features
2 parents 34bc52c + 2f686ec commit 6305de3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+41170
-21328
lines changed

.github/workflows/ci.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,41 @@ jobs:
8888
AWS_REGION: us-east-1
8989
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_STAGE}}
9090

91+
upload-build-artifacts:
92+
runs-on: ubuntu-latest
93+
needs: build
94+
if: github.ref == 'refs/heads/main'
95+
steps:
96+
- name: Check out
97+
uses: actions/checkout@v5
98+
with:
99+
persist-credentials: 'false'
100+
101+
- name: Setup Node & NPM
102+
uses: ./.github/actions/setup-node-npm
103+
104+
- name: Configure AWS for DEV
105+
uses: ./.github/actions/configure-aws
106+
with:
107+
aws_role_to_assume: 'arn:aws:iam::${{secrets.AWS_ACCOUNT_ID_DEV}}:role/spacecat-role-github-actions'
108+
109+
- name: Create Build Artifacts
110+
run: npm run build
111+
env:
112+
AWS_REGION: us-east-1
113+
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}}
114+
115+
- name: Copy Build Artifact
116+
run: cp dist/spacecat-services/api-service@*.zip spacecat-services--api-service-latest.zip
117+
env:
118+
AWS_REGION: us-east-1
119+
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}}
120+
121+
- name: Upload ZIP File
122+
run: aws s3 cp spacecat-services--api-service-latest.zip s3://spacecat-artifacts-dev/spacecat-services--api-service-latest.zip
123+
env:
124+
AWS_REGION: us-east-1
125+
AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}}
91126

92127
branch-deploy:
93128
runs-on: ubuntu-latest

.nycrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"src/agents/org-detector/instructions.js",
1717
"src/controllers/demo.js"
1818
]
19-
}
19+
}

CHANGELOG.md

Lines changed: 483 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 463 additions & 171 deletions
Large diffs are not rendered by default.

docs/openapi/api.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ info:
77
The SpaceCat API is used to manage edge delivery site directory and obtain audit information.
88
99
## Authentication
10-
<SecurityDefinitions />
10+
<SecurityDefinitions></SecurityDefinitions>
1111
1212
termsOfService: 'https://www.adobe.com/go/experiencecloudterms'
1313
contact:
@@ -152,6 +152,8 @@ paths:
152152
$ref: './scrape-api.yaml#/get-scrape-jobs-by-base-url'
153153
/tools/scrape/jobs/by-base-url/{base64BaseUrl}/by-processingtype/{processingType}:
154154
$ref: './scrape-api.yaml#/get-scrape-jobs-by-base-url-and-processing-type'
155+
/tools/scrape/jobs/by-url/{base64Url}/{processingType}:
156+
$ref: './scrape-api.yaml#/get-scrape-urls-by-url-and-processing-type'
155157
/consent-banner:
156158
$ref: './consent-banner-api.yaml#/consent-banner'
157159
/sites:
@@ -190,8 +192,16 @@ paths:
190192
$ref: './site-opportunities.yaml#/site-opportunity'
191193
/sites/{siteId}/opportunities/{opportunityId}/suggestions:
192194
$ref: './site-opportunities.yaml#/site-opportunity-suggestions'
195+
/sites/{siteId}/opportunities/{opportunityId}/suggestions/paged/{limit}:
196+
$ref: './site-opportunities.yaml#/site-opportunity-suggestions-paged'
197+
/sites/{siteId}/opportunities/{opportunityId}/suggestions/paged/{limit}/{cursor}:
198+
$ref: './site-opportunities.yaml#/site-opportunity-suggestions-paged-with-cursor'
193199
/sites/{siteId}/opportunities/{opportunityId}/suggestions/by-status/{status}:
194200
$ref: './site-opportunities.yaml#/site-opportunity-suggestions-by-status'
201+
/sites/{siteId}/opportunities/{opportunityId}/suggestions/by-status/{status}/paged/{limit}:
202+
$ref: './site-opportunities.yaml#/site-opportunity-suggestions-by-status-paged'
203+
/sites/{siteId}/opportunities/{opportunityId}/suggestions/by-status/{status}/paged/{limit}/{cursor}:
204+
$ref: './site-opportunities.yaml#/site-opportunity-suggestions-by-status-paged-with-cursor'
195205
/sites/{siteId}/opportunities/{opportunityId}/suggestions/{suggestionId}:
196206
$ref: './site-opportunities.yaml#/site-opportunity-suggestion'
197207
/sites/{siteId}/opportunities/{opportunityId}/suggestions/status:
@@ -248,6 +258,8 @@ paths:
248258
$ref: './site-paid.yaml#/site-traffic-paid-type-campaign'
249259
/sites/{siteId}/traffic/paid/type:
250260
$ref: './site-paid.yaml#/site-traffic-paid-type'
261+
/sites/{siteId}/traffic/paid/pta2/weekly-summary:
262+
$ref: './site-paid.yaml#/site-traffic-paid-pta2-weekly-summary'
251263
/sites/{siteId}/metrics/{metric}/{source}:
252264
$ref: './site-metrics-api.yaml#/site-metrics-by-source'
253265
/sites/{siteId}/metrics/{metric}/{source}/by-url/{base64PageUrl}:
@@ -284,6 +296,8 @@ paths:
284296
$ref: './llmo-api.yaml#/llmo-sheet-data'
285297
/sites/{siteId}/llmo/sheet-data/{sheetType}/{dataSource}:
286298
$ref: './llmo-api.yaml#/llmo-sheet-data-with-type'
299+
/sites/{siteId}/llmo/sheet-data/{sheetType}/{week}/{dataSource}:
300+
$ref: './llmo-api.yaml#/llmo-sheet-data-with-type-and-week'
287301
/sites/{siteId}/llmo/global-sheet-data/{configName}:
288302
$ref: './llmo-api.yaml#/llmo-global-sheet-data'
289303
/sites/{siteId}/llmo/config:

docs/openapi/llmo-api.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,94 @@ llmo-sheet-data-with-type:
145145
security:
146146
- api_key: [ ]
147147

148+
llmo-sheet-data-with-type-and-week:
149+
parameters:
150+
- $ref: './parameters.yaml#/siteId'
151+
- name: sheetType
152+
in: path
153+
required: true
154+
description: The sheet type identifier to fetch from the external endpoint
155+
schema:
156+
type: string
157+
example: 'analytics'
158+
- name: week
159+
in: path
160+
required: true
161+
description: The week identifier (e.g., w01, w02) to fetch time-series data
162+
schema:
163+
type: string
164+
pattern: '^w\d{2}$'
165+
example: 'w01'
166+
- name: dataSource
167+
in: path
168+
required: true
169+
description: The data source identifier to fetch from the external endpoint
170+
schema:
171+
type: string
172+
example: 'questions'
173+
get:
174+
tags:
175+
- llmo
176+
summary: Get LLMO sheet data with sheet type and week
177+
description: |
178+
Retrieves data from the external LLMO data endpoint for a specific site with a specified sheet type and week.
179+
This endpoint proxies data from the external HLX API based on the site's LLMO configuration.
180+
The data is fetched from the path: {dataFolder}/{sheetType}/{week}/{dataSource}.json
181+
This is useful for fetching time-series data organized by week.
182+
operationId: getLlmoSheetDataWithTypeAndWeek
183+
responses:
184+
'200':
185+
description: LLMO sheet data retrieved successfully
186+
content:
187+
application/json:
188+
schema:
189+
type: object
190+
description: The data returned from the external LLMO endpoint
191+
additionalProperties: true
192+
'400':
193+
$ref: './responses.yaml#/400'
194+
'401':
195+
$ref: './responses.yaml#/401'
196+
'500':
197+
$ref: './responses.yaml#/500'
198+
security:
199+
- api_key: [ ]
200+
post:
201+
tags:
202+
- llmo
203+
summary: Query LLMO sheet data with sheet type and week using filters, exclusions, and grouping
204+
description: |
205+
Retrieves and processes data from the external LLMO data endpoint for a specific site with a specified sheet type,
206+
week, and advanced querying capabilities. This endpoint allows filtering data with case-insensitive exact matching,
207+
excluding specific fields from the response, and grouping data by specified attributes.
208+
The data is fetched from the path: {dataFolder}/{sheetType}/{week}/{dataSource}.json
209+
The endpoint fetches all available data (up to 1M records) to apply the query operations effectively.
210+
This is useful for fetching and analyzing time-series data organized by week.
211+
operationId: queryLlmoSheetDataWithTypeAndWeek
212+
requestBody:
213+
required: false
214+
content:
215+
application/json:
216+
schema:
217+
$ref: './schemas.yaml#/LlmoSheetDataQuery'
218+
responses:
219+
'200':
220+
description: LLMO sheet data queried and processed successfully
221+
content:
222+
application/json:
223+
schema:
224+
type: object
225+
description: The processed data returned from the external LLMO endpoint after applying filters, exclusions, and grouping
226+
additionalProperties: true
227+
'400':
228+
$ref: './responses.yaml#/400'
229+
'401':
230+
$ref: './responses.yaml#/401'
231+
'500':
232+
$ref: './responses.yaml#/500'
233+
security:
234+
- api_key: [ ]
235+
148236
llmo-global-sheet-data:
149237
parameters:
150238
- $ref: './parameters.yaml#/siteId'
@@ -194,6 +282,7 @@ llmo-config:
194282
Retrieves the LLMO (Large Language Model Optimizer) configuration for a specific site.
195283
This endpoint retrieves the configuration directly from S3 storage. The configuration
196284
includes entities (categories, topics), brand aliases, and competitor information.
285+
Categories may include optional URLs for content matching.
197286
198287
If a version parameter is provided, the specific version of the configuration will be
199288
retrieved. If the version does not exist, a 404 error will be returned. If no version
@@ -238,6 +327,9 @@ llmo-config:
238327
This operation completely overwrites the existing configuration with the provided payload.
239328
The payload is validated against the LLMO configuration schema before being stored in S3.
240329
The configuration must include entities, brands, and competitors sections.
330+
331+
Categories can optionally include URLs that can be either exact URLs or URL prefixes
332+
(ending with /*) to match against specific content areas.
241333
operationId: postLlmoConfig
242334
requestBody:
243335
required: true

docs/openapi/parameters.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ base64PageUrl:
4949
schema:
5050
type: string
5151
format: base64url
52+
base64Url:
53+
name: base64Url
54+
description: Base64-encoded URL
55+
in: path
56+
required: true
57+
schema:
58+
type: string
59+
format: base64url
5260
ascending:
5361
name: ascending
5462
description: Whether to sort ascending or descending
@@ -216,6 +224,13 @@ processingType:
216224
required: true
217225
schema:
218226
type: string
227+
processingTypeOptional:
228+
name: processingType
229+
description: Optional, The processing type/handler used by the scrape job, will use "default" if not provided
230+
in: path
231+
required: false
232+
schema:
233+
type: string
219234
weekNumber:
220235
name: weekNumber
221236
description: The ISO week number (1-53)
@@ -317,7 +332,7 @@ externalId:
317332
sandboxAuditType:
318333
name: auditType
319334
description: |
320-
Comma-separated list of audit types to run on sandbox sites.
335+
Comma-separated list of audit types to run on sandbox sites.
321336
Use 'product-metatags' for specialized Product Detail Page (PDP) analysis of commerce sites.
322337
in: query
323338
required: false
@@ -343,3 +358,24 @@ llmoConfigVersion:
343358
type: string
344359
description: S3 object version ID
345360
example: "abc123def456"
361+
362+
limit:
363+
name: limit
364+
description: The maximum number of items to return per page
365+
in: path
366+
required: true
367+
schema:
368+
type: integer
369+
minimum: 1
370+
maximum: 1000
371+
default: 100
372+
example: 100
373+
374+
cursor:
375+
name: cursor
376+
description: The cursor for pagination to fetch the next page of results
377+
in: path
378+
required: false
379+
schema:
380+
type: string
381+
example: "eyJzayI6IjIwMjQtMDEtMTVUMTI6MzA6MDBaIiwiaWQiOiIxMjNlNDU2Ny1lODliLTEyZDMtYTQ1Ni00MjY2MTQxNzQwMDAifQ=="

0 commit comments

Comments
 (0)