@adobe/spacecat-shared-data-access 2.70.0 → 2.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +4 -1
- package/src/models/site/config.js +1 -0
- package/src/models/site/index.d.ts +11 -0
- package/src/models/site/site.schema.js +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-data-access-v2.71.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.71.0...@adobe/spacecat-shared-data-access-v2.71.1) (2025-10-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add interface for code config ([#1023](https://github.com/adobe/spacecat-shared/issues/1023)) ([74138b9](https://github.com/adobe/spacecat-shared/commit/74138b9adf135b536059a860315d89af67128601))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-data-access-v2.71.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.70.0...@adobe/spacecat-shared-data-access-v2.71.0) (2025-10-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* adding a new code config in Site ([#980](https://github.com/adobe/spacecat-shared/issues/980)) ([67aed42](https://github.com/adobe/spacecat-shared/commit/67aed425c43f2fdb9c7c51053b7ee4a726f545d9))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-data-access-v2.70.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v2.69.2...@adobe/spacecat-shared-data-access-v2.70.0) (2025-10-10)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-data-access",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.71.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Data Access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test:it": "mocha --require ./test/it/fixtures.js --spec \"test/it/**/*.test.js\"",
|
|
14
14
|
"test": "c8 mocha --spec \"test/unit/**/*.test.js\"",
|
|
15
|
+
"test:debug": "mocha --inspect-brk --require ./test/setup-env.js --spec \"test/unit/**/*.test.js\"",
|
|
16
|
+
"test:debug:config": "mocha --inspect-brk --require ./test/setup-env.js --spec \"test/unit/models/site/config.test.js\"",
|
|
17
|
+
"test:debug:grep": "mocha --inspect-brk --require ./test/setup-env.js --grep",
|
|
15
18
|
"lint": "eslint .",
|
|
16
19
|
"lint:fix": "eslint --fix .",
|
|
17
20
|
"clean": "rm -rf package-lock.json node_modules"
|
|
@@ -34,6 +34,15 @@ export interface HlxConfig {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
export interface CodeConfig {
|
|
38
|
+
type: string;
|
|
39
|
+
owner: string;
|
|
40
|
+
repo: string;
|
|
41
|
+
ref: string;
|
|
42
|
+
installationId?: string;
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
export type IMPORT_TYPES = {
|
|
38
47
|
readonly ORGANIC_KEYWORDS: 'organic-keywords';
|
|
39
48
|
readonly ORGANIC_TRAFFIC: 'organic-traffic';
|
|
@@ -201,6 +210,7 @@ export interface Site extends BaseModel {
|
|
|
201
210
|
): Promise<Experiment[]>;
|
|
202
211
|
getGitHubURL(): string;
|
|
203
212
|
getHlxConfig(): HlxConfig;
|
|
213
|
+
getCode(): CodeConfig;
|
|
204
214
|
getDeliveryConfig(): object;
|
|
205
215
|
getIsLive(): boolean;
|
|
206
216
|
getIsSandbox(): boolean;
|
|
@@ -235,6 +245,7 @@ export interface Site extends BaseModel {
|
|
|
235
245
|
setAuthoringType(authoringType: string): Site;
|
|
236
246
|
setGitHubURL(gitHubURL: string): Site;
|
|
237
247
|
setHlxConfig(hlxConfig: HlxConfig): Site;
|
|
248
|
+
setCode(code: CodeConfig): Site;
|
|
238
249
|
setDeliveryConfig(deliveryConfig: object): Site;
|
|
239
250
|
setIsLive(isLive: boolean): Site;
|
|
240
251
|
setIsSandbox(isSandbox: boolean): Site;
|
|
@@ -76,6 +76,20 @@ const schema = new SchemaBuilder(Site, SiteCollection)
|
|
|
76
76
|
validate: (value) => isNonEmptyObject(validateConfiguration(value)),
|
|
77
77
|
get: (value) => Config(value),
|
|
78
78
|
})
|
|
79
|
+
.addAttribute('code', {
|
|
80
|
+
type: 'any',
|
|
81
|
+
required: false,
|
|
82
|
+
default: {},
|
|
83
|
+
validate: (value) => isObject(value),
|
|
84
|
+
properties: {
|
|
85
|
+
type: { type: 'string', required: true },
|
|
86
|
+
owner: { type: 'string', required: true },
|
|
87
|
+
repo: { type: 'string', required: true },
|
|
88
|
+
ref: { type: 'string', required: true },
|
|
89
|
+
installationId: { type: 'string', required: false },
|
|
90
|
+
url: { type: 'string', required: true, validate: (value) => isValidUrl(value) },
|
|
91
|
+
},
|
|
92
|
+
})
|
|
79
93
|
.addAttribute('deliveryType', {
|
|
80
94
|
type: Object.values(Site.DELIVERY_TYPES),
|
|
81
95
|
default: Site.DEFAULT_DELIVERY_TYPE,
|