Skip to content

Commit

Permalink
Merge branch 'main' into SITES-26591-chat-completions
Browse files Browse the repository at this point in the history
  • Loading branch information
atopper committed Nov 11, 2024
2 parents fdd5d77 + 120974a commit 095d6f9
Show file tree
Hide file tree
Showing 47 changed files with 20,490 additions and 26,614 deletions.
45,867 changes: 19,397 additions & 26,470 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"description": "Shared modules of the Spacecat Services - monorepo",
"type": "module",
"engines": {
"node": "^20.0.0 <23.0.0",
"npm": "^10.0.0 <11.0.0"
"node": ">=20.0.0 <23.0.0",
"npm": ">=10.0.0 <11.0.0"
},
"scripts": {
"docs:api": "jsdoc2md -c .jsdoc.json --files packages/*/src/*.js > docs/API.md",
Expand Down Expand Up @@ -36,8 +36,8 @@
"@semantic-release/changelog": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/npm": "12.0.1",
"@typescript-eslint/eslint-plugin": "8.12.2",
"@typescript-eslint/parser": "8.12.2",
"@typescript-eslint/eslint-plugin": "8.13.0",
"@typescript-eslint/parser": "8.13.0",
"ajv": "8.17.1",
"c8": "10.1.2",
"eslint": "8.57.1",
Expand All @@ -46,7 +46,7 @@
"lint-staged": "15.2.10",
"mocha": "10.8.2",
"mocha-multi-reporters": "1.5.1",
"nock": "13.5.5",
"nock": "13.5.6",
"semantic-release": "24.2.0",
"semantic-release-monorepo": "8.0.2",
"typescript": "5.6.3"
Expand Down
21 changes: 21 additions & 0 deletions packages/spacecat-shared-ahrefs-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# [@adobe/spacecat-shared-ahrefs-client-v1.5.11](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.5.10...@adobe/spacecat-shared-ahrefs-client-v1.5.11) (2024-11-11)


### Bug Fixes

* **deps:** update external fixes ([#434](https://github.com/adobe/spacecat-shared/issues/434)) ([b71b615](https://github.com/adobe/spacecat-shared/commit/b71b61528513821f9e34c50a095d47cb4e14f8db))

# [@adobe/spacecat-shared-ahrefs-client-v1.5.10](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.5.9...@adobe/spacecat-shared-ahrefs-client-v1.5.10) (2024-11-08)


### Bug Fixes

* engine spec ([#431](https://github.com/adobe/spacecat-shared/issues/431)) ([f19600e](https://github.com/adobe/spacecat-shared/commit/f19600e74ae7ee42a97c08d5b1c30db79c8ec13d))

# [@adobe/spacecat-shared-ahrefs-client-v1.5.9](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.5.8...@adobe/spacecat-shared-ahrefs-client-v1.5.9) (2024-11-07)


### Bug Fixes

* set correct node engine spec ([#423](https://github.com/adobe/spacecat-shared/issues/423)) ([5086ce7](https://github.com/adobe/spacecat-shared/commit/5086ce7d41bebb502cadf092e5b9a7b84b5bf103))

# [@adobe/spacecat-shared-ahrefs-client-v1.5.8](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-ahrefs-client-v1.5.7...@adobe/spacecat-shared-ahrefs-client-v1.5.8) (2024-10-26)


Expand Down
10 changes: 5 additions & 5 deletions packages/spacecat-shared-ahrefs-client/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@adobe/spacecat-shared-ahrefs-client",
"version": "1.5.8",
"version": "1.5.11",
"description": "Shared modules of the Spacecat Services - Ahrefs Client",
"type": "module",
"engines": {
"node": "^20.0.0 <23.0.0",
"npm": "^10.0.0 <11.0.0"
"node": ">=20.0.0 <23.0.0",
"npm": ">=10.0.0 <11.0.0"
},
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down Expand Up @@ -36,12 +36,12 @@
"dependencies": {
"@adobe/fetch": "4.1.9",
"@adobe/helix-universal": "5.0.6",
"@adobe/spacecat-shared-utils": "1.20.8"
"@adobe/spacecat-shared-utils": "1.22.4"
},
"devDependencies": {
"chai": "5.1.2",
"chai-as-promised": "8.0.0",
"nock": "13.5.5",
"nock": "13.5.6",
"sinon": "19.0.2",
"sinon-chai": "4.0.0",
"typescript": "5.6.3"
Expand Down
35 changes: 35 additions & 0 deletions packages/spacecat-shared-content-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# [@adobe/spacecat-shared-content-client-v1.1.22](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.21...@adobe/spacecat-shared-content-client-v1.1.22) (2024-11-11)


### Bug Fixes

* **deps:** update dependency @adobe/spacecat-helix-content-sdk to v1.2.7 ([#430](https://github.com/adobe/spacecat-shared/issues/430)) ([a7de0ee](https://github.com/adobe/spacecat-shared/commit/a7de0eeda9eda2f3460deb4df3a12b2894fba455))

# [@adobe/spacecat-shared-content-client-v1.1.21](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.20...@adobe/spacecat-shared-content-client-v1.1.21) (2024-11-11)


### Bug Fixes

* **deps:** update external fixes ([#434](https://github.com/adobe/spacecat-shared/issues/434)) ([b71b615](https://github.com/adobe/spacecat-shared/commit/b71b61528513821f9e34c50a095d47cb4e14f8db))

# [@adobe/spacecat-shared-content-client-v1.1.20](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.19...@adobe/spacecat-shared-content-client-v1.1.20) (2024-11-08)


### Bug Fixes

* engine spec ([#433](https://github.com/adobe/spacecat-shared/issues/433)) ([19dd309](https://github.com/adobe/spacecat-shared/commit/19dd30956c0a9d35ea343c580e589205bfdbdfd8))

# [@adobe/spacecat-shared-content-client-v1.1.19](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.18...@adobe/spacecat-shared-content-client-v1.1.19) (2024-11-08)


### Bug Fixes

* engine spec ([#431](https://github.com/adobe/spacecat-shared/issues/431)) ([f19600e](https://github.com/adobe/spacecat-shared/commit/f19600e74ae7ee42a97c08d5b1c30db79c8ec13d))

# [@adobe/spacecat-shared-content-client-v1.1.18](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.17...@adobe/spacecat-shared-content-client-v1.1.18) (2024-11-07)


### Bug Fixes

* set correct node engine spec ([#423](https://github.com/adobe/spacecat-shared/issues/423)) ([5086ce7](https://github.com/adobe/spacecat-shared/commit/5086ce7d41bebb502cadf092e5b9a7b84b5bf103))

# [@adobe/spacecat-shared-content-client-v1.1.17](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-content-client-v1.1.16...@adobe/spacecat-shared-content-client-v1.1.17) (2024-11-03)


Expand Down
14 changes: 7 additions & 7 deletions packages/spacecat-shared-content-client/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@adobe/spacecat-shared-content-client",
"version": "1.1.17",
"version": "1.1.22",
"description": "Shared modules of the Spacecat Services - Content Client",
"type": "module",
"engines": {
"node": "^20.0.0 <23.0.0",
"npm": "^10.0.0 <11.0.0"
"node": ">=20.0.0 <23.0.0",
"npm": ">=10.0.0 <11.0.0"
},
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down Expand Up @@ -35,16 +35,16 @@
},
"dependencies": {
"@adobe/helix-universal": "5.0.6",
"@adobe/spacecat-helix-content-sdk": "1.2.4",
"@adobe/spacecat-shared-utils": "1.19.6",
"@adobe/spacecat-helix-content-sdk": "1.2.7",
"@adobe/spacecat-shared-utils": "1.22.4",
"graph-data-structure": "4.1.0"
},
"devDependencies": {
"@adobe/spacecat-shared-data-access": "1.45.5",
"@adobe/spacecat-shared-data-access": "1.50.0",
"chai": "5.1.2",
"chai-as-promised": "8.0.0",
"esmock": "2.6.9",
"nock": "13.5.4",
"nock": "13.5.6",
"sinon": "19.0.2",
"sinon-chai": "4.0.0",
"typescript": "5.6.3"
Expand Down
42 changes: 42 additions & 0 deletions packages/spacecat-shared-data-access/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# [@adobe/spacecat-shared-data-access-v1.50.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.50.0...@adobe/spacecat-shared-data-access-v1.50.1) (2024-11-11)


### Bug Fixes

* **deps:** update external fixes ([#434](https://github.com/adobe/spacecat-shared/issues/434)) ([b71b615](https://github.com/adobe/spacecat-shared/commit/b71b61528513821f9e34c50a095d47cb4e14f8db))

# [@adobe/spacecat-shared-data-access-v1.50.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.8...@adobe/spacecat-shared-data-access-v1.50.0) (2024-11-08)


### Features

* support queries to generate self-service api-keys ([#428](https://github.com/adobe/spacecat-shared/issues/428)) ([90a46c2](https://github.com/adobe/spacecat-shared/commit/90a46c2f095e07d77636189c04f52ba31a626c7b))

# [@adobe/spacecat-shared-data-access-v1.49.8](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.7...@adobe/spacecat-shared-data-access-v1.49.8) (2024-11-08)


### Bug Fixes

* engine spec ([#433](https://github.com/adobe/spacecat-shared/issues/433)) ([19dd309](https://github.com/adobe/spacecat-shared/commit/19dd30956c0a9d35ea343c580e589205bfdbdfd8))

# [@adobe/spacecat-shared-data-access-v1.49.7](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.6...@adobe/spacecat-shared-data-access-v1.49.7) (2024-11-08)


### Bug Fixes

* engine spec ([#431](https://github.com/adobe/spacecat-shared/issues/431)) ([f19600e](https://github.com/adobe/spacecat-shared/commit/f19600e74ae7ee42a97c08d5b1c30db79c8ec13d))

# [@adobe/spacecat-shared-data-access-v1.49.6](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.5...@adobe/spacecat-shared-data-access-v1.49.6) (2024-11-07)


### Bug Fixes

* handle missing 'sites' and 'orgs' in enabled/disabled configuraions safely ([#424](https://github.com/adobe/spacecat-shared/issues/424)) ([5a1468f](https://github.com/adobe/spacecat-shared/commit/5a1468f92fb2b0b288cebb44576dea3f4948b462)), closes [/github.com/adobe/spacecat-shared/blob/main/packages/spacecat-shared-data-access/src/models/configuration.js#L39-L45](https://github.com//github.com/adobe/spacecat-shared/blob/main/packages/spacecat-shared-data-access/src/models/configuration.js/issues/L39-L45)

# [@adobe/spacecat-shared-data-access-v1.49.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.4...@adobe/spacecat-shared-data-access-v1.49.5) (2024-11-07)


### Bug Fixes

* set correct node engine spec ([#423](https://github.com/adobe/spacecat-shared/issues/423)) ([5086ce7](https://github.com/adobe/spacecat-shared/commit/5086ce7d41bebb502cadf092e5b9a7b84b5bf103))

# [@adobe/spacecat-shared-data-access-v1.49.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.49.3...@adobe/spacecat-shared-data-access-v1.49.4) (2024-11-02)


Expand Down
34 changes: 34 additions & 0 deletions packages/spacecat-shared-data-access/docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1209,11 +1209,45 @@
"AttributeName": "revokedAt",
"AttributeType": "S"
},
{
"AttributeName": "deletedAt",
"AttributeType": "S"
},
{
"AttributeName": "scopes",
"AttributeType": "M"
}
],
"GlobalSecondaryIndexes": [
{
"IndexName": "spacecat-services-api-key-by-ims-user-id-and-ims-org-id",
"KeyAttributes": {
"PartitionKey": {
"AttributeName": "imsUserId",
"AttributeType": "S"
},
"SortKey": {
"AttributeName": "imsOrgId",
"AttributeType": "S"
}
},
"Projection": {
"ProjectionType": "ALL"
}
},
{
"IndexName": "spacecat-services-api-key-by-hashed-api-key",
"KeyAttributes": {
"PartitionKey": {
"AttributeName": "hashedApiKey",
"AttributeType": "S"
}
},
"Projection": {
"ProjectionType": "ALL"
}
}
],
"DataAccess": {
"MySql": {}
},
Expand Down
16 changes: 8 additions & 8 deletions packages/spacecat-shared-data-access/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@adobe/spacecat-shared-data-access",
"version": "1.49.4",
"version": "1.50.1",
"description": "Shared modules of the Spacecat Services - Data Access",
"type": "module",
"engines": {
"node": "^20.0.0 <23.0.0",
"npm": "^10.0.0 <11.0.0"
"node": ">=20.0.0 <23.0.0",
"npm": ">=10.0.0 <11.0.0"
},
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down Expand Up @@ -33,13 +33,13 @@
"access": "public"
},
"dependencies": {
"@adobe/spacecat-shared-dynamo": "1.3.42",
"@adobe/spacecat-shared-utils": "1.20.8",
"@aws-sdk/client-dynamodb": "3.682.0",
"@aws-sdk/lib-dynamodb": "3.685.0",
"@adobe/spacecat-shared-dynamo": "1.3.47",
"@adobe/spacecat-shared-utils": "1.22.4",
"@aws-sdk/client-dynamodb": "3.687.0",
"@aws-sdk/lib-dynamodb": "3.687.0",
"@types/joi": "17.2.3",
"joi": "17.13.3",
"uuid": "11.0.2"
"uuid": "11.0.3"
},
"devDependencies": {
"chai": "5.1.2",
Expand Down
9 changes: 6 additions & 3 deletions packages/spacecat-shared-data-access/src/dto/api-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
* governing permissions and limitations under the License.
*/

import { createApiKey } from '../models/api-key.js';
import { createApiKey } from '../models/api-key/api-key.js';

export const ApiKeyDto = {

/**
* Converts an ApiKey object into a DynamoDB item.
* @param apiKey
* @returns {{createdAt: *, name: *, imsUserId, scopes, revokedAt, key: *,
* imsOrgId: *, expiresAt: *}}
* @returns {{createdAt: string, name: string, imsUserId: string,
* scopes: array<object>, revokedAt: string, deletedAt: string,
* hashedApiKey: string, imsOrgId: string, expiresAt: string}}
*/
toDynamoItem: (apiKey) => ({
id: apiKey.getId(),
Expand All @@ -29,6 +30,7 @@ export const ApiKeyDto = {
createdAt: apiKey.getCreatedAt(),
expiresAt: apiKey.getExpiresAt(),
revokedAt: apiKey.getRevokedAt(),
deletedAt: apiKey.getDeletedAt(),
scopes: apiKey.getScopes(),
}),

Expand All @@ -47,6 +49,7 @@ export const ApiKeyDto = {
createdAt: dynamoItem.createdAt,
expiresAt: dynamoItem.expiresAt,
revokedAt: dynamoItem.revokedAt,
deletedAt: dynamoItem.deletedAt,
scopes: dynamoItem.scopes,
};

Expand Down
26 changes: 26 additions & 0 deletions packages/spacecat-shared-data-access/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,26 @@ export interface ApiKey {
*/
getRevokedAt: () => string;

/**
* Retrieves the deletedAt of the API Key.
*/
getDeletedAt: () => string;

/**
* Retrieves the scopes of the API Key.
*/
getScopes: () => Array<string>;

/**
* Updates the deletedAt attribute of the API Key.
*/
updateDeletedAt: (deletedAt: string) => ApiKey;

/**
* Indicates whether the API Key is valid.
*/
isValid: () => boolean;

}

/**
Expand Down Expand Up @@ -839,6 +854,16 @@ export interface DataAccess {
createNewApiKey: (
apiKeyData: object,
) => Promise<ApiKey>;
updateApiKey: (
apiKey: ApiKey,
) => Promise<ApiKey>;
getApiKeysByImsUserIdAndImsOrgId: (
imsUserId: string,
imsOrgId: string,
) => Promise<ApiKey[] | null>;
getApiKeyById: (
id: string,
) => Promise<ApiKey | null>;

// site candidate functions
getSiteCandidateByBaseURL: (baseURL: string) => Promise<SiteCandidate>;
Expand Down Expand Up @@ -893,6 +918,7 @@ interface DataAccessConfig {
indexNameAllImportJobsByDateRange: string,
indexNameImportUrlsByJobIdAndStatus: string,
indexNameApiKeyByHashedApiKey: string,
indexNameApiKeyByImsUserIdAndImsOrgId: string,
pkAllSites: string;
pkAllLatestAudits: string;
pkAllOrganizations: string;
Expand Down
Loading

0 comments on commit 095d6f9

Please sign in to comment.