@adobe/spacecat-shared-data-access 4.13.0 → 4.15.0
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
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@adobe/spacecat-shared-data-access-v4.15.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v4.14.0...@adobe/spacecat-shared-data-access-v4.15.0) (2026-07-29)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **site-config:** add showWww flag to llmo config ([#1850](https://github.com/adobe/spacecat-shared/issues/1850)) ([e87b454](https://github.com/adobe/spacecat-shared/commit/e87b45481d2b34cdb9f86e569f7598dea967ed6e))
|
|
6
|
+
|
|
7
|
+
## [@adobe/spacecat-shared-data-access-v4.14.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v4.13.0...@adobe/spacecat-shared-data-access-v4.14.0) (2026-07-27)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **data-access:** derive portable JSON Schema artifact for changeDetails v2 (SITES-47997) ([#1830](https://github.com/adobe/spacecat-shared/issues/1830)) ([02163de](https://github.com/adobe/spacecat-shared/commit/02163dea72d007678777b8341d0ded2b97fb56cf)), closes [#1828](https://github.com/adobe/spacecat-shared/issues/1828) [blocking-#4](https://github.com/adobe/blocking-/issues/4)
|
|
12
|
+
|
|
1
13
|
## [@adobe/spacecat-shared-data-access-v4.13.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v4.12.0...@adobe/spacecat-shared-data-access-v4.13.0) (2026-07-23)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/CLAUDE.md
CHANGED
|
@@ -277,6 +277,17 @@ validated "deploy action" record (who/when/what/which-pages/result) from ADR
|
|
|
277
277
|
`CALL_STATUSES`, `APPLIED`, `CHANGE_RESULT_STATUSES`, `VERIFY_VERDICTS`,
|
|
278
278
|
`SCHEMA_VERSION`, `DEPLOY_RESPONSE_PAYLOAD_MAX_BYTES`). Kept on the model
|
|
279
279
|
(not the barrel) to avoid collisions on these generic names.
|
|
280
|
+
- **Portable JSON Schema artifact** (for the Python runtime, mystique). The Joi
|
|
281
|
+
schema is the single source of truth; a **JSON Schema is derived from it** and
|
|
282
|
+
shipped at `schemas/fix-entity-change-details.v2.schema.json` (draft-2019-09).
|
|
283
|
+
Regenerate with `npm run generate:schemas` (script:
|
|
284
|
+
`scripts/generate-change-details-schema.js`, uses `joi-to-json`); a unit test
|
|
285
|
+
fails CI if the committed artifact drifts from the Joi schema. mystique vendors
|
|
286
|
+
this file and validates against it. **Caveat:** JSON Schema captures
|
|
287
|
+
structure/enums/required/patterns only — the cross-field invariants
|
|
288
|
+
(`changeResults`↔`target.changes` key-match, `applied:ALL` completeness,
|
|
289
|
+
`deployResponsePayload` 4 KB cap) are Joi `.custom()` rules and are NOT in the
|
|
290
|
+
artifact; a consumer needing them must port those checks.
|
|
280
291
|
- **Not yet done** (tracked on SITES-47997): the `publishedBy` column +
|
|
281
292
|
`executedBy/At` → `deployedBy/At` rename (dual-write, needs a companion
|
|
282
293
|
mysticat-data-service migration), and gating the `DEPLOYED`/`PUBLISHED`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-data-access",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - Data Access",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"test:debug:grep": "mocha --inspect-brk --require ./test/setup-env.js --grep",
|
|
20
20
|
"lint": "eslint .",
|
|
21
21
|
"lint:fix": "eslint --fix .",
|
|
22
|
-
"clean": "rm -rf package-lock.json node_modules"
|
|
22
|
+
"clean": "rm -rf package-lock.json node_modules",
|
|
23
|
+
"generate:schemas": "node scripts/generate-change-details-schema.js"
|
|
23
24
|
},
|
|
24
25
|
"mocha": {
|
|
25
26
|
"require": "test/setup-env.js",
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@adobe/fetch": "^4.2.3",
|
|
44
45
|
"@adobe/spacecat-shared-utils": "1.105.0",
|
|
45
|
-
"@supabase/postgrest-js": "2.106.2",
|
|
46
46
|
"@aws-sdk/client-s3": "^3.940.0",
|
|
47
47
|
"@smithy/util-retry": "^4.0.0",
|
|
48
|
+
"@supabase/postgrest-js": "2.106.2",
|
|
48
49
|
"@types/joi": "17.2.3",
|
|
49
50
|
"aws-xray-sdk": "3.12.0",
|
|
50
51
|
"joi": "18.2.1",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"chai": "6.2.2",
|
|
55
56
|
"chai-as-promised": "8.0.2",
|
|
56
57
|
"electrodb": "3.9.0",
|
|
58
|
+
"joi-to-json": "^5.0.5",
|
|
57
59
|
"nock": "14.0.15",
|
|
58
60
|
"sinon": "22.0.0",
|
|
59
61
|
"sinon-chai": "4.0.1"
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
3
|
+
"$id": "https://ns.adobe.com/spacecat/fix-entity/change-details/v2",
|
|
4
|
+
"title": "FixEntity changeDetails v2",
|
|
5
|
+
"description": "Canonical v2 deploy-action record for FixEntity.changeDetails (SITES-47997, ADR adobe/mysticat-architecture#200). GENERATED from the Joi source of truth (changeDetailsV2Schema in spacecat-shared-data-access) — DO NOT EDIT BY HAND; run `npm run generate:schemas -w packages/spacecat-shared-data-access`. Structure/enums/required/patterns only: the cross-field invariants (changeResults<->target.changes key-match, applied:ALL completeness, deployResponsePayload 4KB cap) are Joi-enforced and NOT expressible in JSON Schema.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": {
|
|
9
|
+
"const": 2
|
|
10
|
+
},
|
|
11
|
+
"surface": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": [
|
|
14
|
+
"ASO",
|
|
15
|
+
"AUTHOR_PUBLISH",
|
|
16
|
+
"GIT_MERGE",
|
|
17
|
+
"SYSTEM"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"actorType": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": [
|
|
23
|
+
"IMS_USER",
|
|
24
|
+
"SERVICE",
|
|
25
|
+
"GITHUB",
|
|
26
|
+
"DETECTOR",
|
|
27
|
+
"UNKNOWN"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"target": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"system": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"changeType": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"siteId": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"pageId": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"documentPath": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"detectedPageAuthorUrl": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"changes": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"targetPath": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"property": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"intendedValue": {
|
|
64
|
+
"type": [
|
|
65
|
+
"array",
|
|
66
|
+
"boolean",
|
|
67
|
+
"number",
|
|
68
|
+
"object",
|
|
69
|
+
"string",
|
|
70
|
+
"null"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"required": [
|
|
75
|
+
"targetPath",
|
|
76
|
+
"property",
|
|
77
|
+
"intendedValue"
|
|
78
|
+
],
|
|
79
|
+
"additionalProperties": false
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"required": [
|
|
84
|
+
"changeType",
|
|
85
|
+
"changes"
|
|
86
|
+
],
|
|
87
|
+
"additionalProperties": false
|
|
88
|
+
},
|
|
89
|
+
"result": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"callStatus": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"success",
|
|
96
|
+
"no_op",
|
|
97
|
+
"client_error",
|
|
98
|
+
"server_error",
|
|
99
|
+
"timeout"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"applied": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"enum": [
|
|
105
|
+
"ALL",
|
|
106
|
+
"PARTIAL",
|
|
107
|
+
"NONE"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"deployResponsePayload": {
|
|
111
|
+
"type": [
|
|
112
|
+
"array",
|
|
113
|
+
"boolean",
|
|
114
|
+
"number",
|
|
115
|
+
"object",
|
|
116
|
+
"string",
|
|
117
|
+
"null"
|
|
118
|
+
],
|
|
119
|
+
"description": "Raw deploy/apply API response (body + status + relevant headers). MUST be <= 4096 bytes at the write chokepoint; larger payloads must be hashed into deployResponseSha256 and truncated. Size cap enforced by the Joi validator, not by this JSON Schema."
|
|
120
|
+
},
|
|
121
|
+
"deployResponseSha256": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"pattern": "^[a-fA-F0-9]{64}$"
|
|
124
|
+
},
|
|
125
|
+
"changeResults": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"items": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"properties": {
|
|
130
|
+
"targetPath": {
|
|
131
|
+
"type": "string"
|
|
132
|
+
},
|
|
133
|
+
"property": {
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
"previousValue": {
|
|
137
|
+
"type": [
|
|
138
|
+
"array",
|
|
139
|
+
"boolean",
|
|
140
|
+
"number",
|
|
141
|
+
"object",
|
|
142
|
+
"string",
|
|
143
|
+
"null"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"appliedValue": {
|
|
147
|
+
"type": [
|
|
148
|
+
"array",
|
|
149
|
+
"boolean",
|
|
150
|
+
"number",
|
|
151
|
+
"object",
|
|
152
|
+
"string",
|
|
153
|
+
"null"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"status": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"enum": [
|
|
159
|
+
"applied",
|
|
160
|
+
"unchanged",
|
|
161
|
+
"failed"
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"required": [
|
|
166
|
+
"targetPath",
|
|
167
|
+
"property",
|
|
168
|
+
"status"
|
|
169
|
+
],
|
|
170
|
+
"additionalProperties": false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"preVerify": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"properties": {
|
|
176
|
+
"verdict": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"enum": [
|
|
179
|
+
"verified",
|
|
180
|
+
"rejected",
|
|
181
|
+
"inconclusive",
|
|
182
|
+
"verify_failed"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"reasonCode": {
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"evidence": {
|
|
189
|
+
"type": [
|
|
190
|
+
"array",
|
|
191
|
+
"boolean",
|
|
192
|
+
"number",
|
|
193
|
+
"object",
|
|
194
|
+
"string",
|
|
195
|
+
"null"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"preVerifiedAt": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"format": "date-time"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": [
|
|
204
|
+
"verdict"
|
|
205
|
+
],
|
|
206
|
+
"additionalProperties": false
|
|
207
|
+
},
|
|
208
|
+
"postVerify": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": {
|
|
211
|
+
"verdict": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"enum": [
|
|
214
|
+
"verified",
|
|
215
|
+
"rejected",
|
|
216
|
+
"inconclusive",
|
|
217
|
+
"verify_failed"
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
"reasonCode": {
|
|
221
|
+
"type": "string"
|
|
222
|
+
},
|
|
223
|
+
"evidence": {
|
|
224
|
+
"type": [
|
|
225
|
+
"array",
|
|
226
|
+
"boolean",
|
|
227
|
+
"number",
|
|
228
|
+
"object",
|
|
229
|
+
"string",
|
|
230
|
+
"null"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"revert": {
|
|
234
|
+
"type": [
|
|
235
|
+
"array",
|
|
236
|
+
"boolean",
|
|
237
|
+
"number",
|
|
238
|
+
"object",
|
|
239
|
+
"string",
|
|
240
|
+
"null"
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"postVerifiedAt": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"format": "date-time"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"required": [
|
|
249
|
+
"verdict"
|
|
250
|
+
],
|
|
251
|
+
"additionalProperties": false
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"required": [
|
|
255
|
+
"callStatus",
|
|
256
|
+
"applied"
|
|
257
|
+
],
|
|
258
|
+
"additionalProperties": false
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"required": [
|
|
262
|
+
"schemaVersion",
|
|
263
|
+
"surface",
|
|
264
|
+
"actorType",
|
|
265
|
+
"target"
|
|
266
|
+
],
|
|
267
|
+
"additionalProperties": false
|
|
268
|
+
}
|
|
@@ -157,10 +157,17 @@ const resultSchema = Joi.object({
|
|
|
157
157
|
return helpers.error('any.invalid');
|
|
158
158
|
}
|
|
159
159
|
return value;
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
})
|
|
161
|
+
// Carried into the derived JSON Schema so the size-cap caveat travels with
|
|
162
|
+
// the field for JSON-Schema-only (mystique) consumers — the cap itself is a
|
|
163
|
+
// Joi `.custom()` rule and is NOT expressible/enforced in JSON Schema.
|
|
164
|
+
.description(`Raw deploy/apply API response (body + status + relevant headers). MUST be <= ${DEPLOY_RESPONSE_PAYLOAD_MAX_BYTES} bytes at the write chokepoint; larger payloads must be hashed into deployResponseSha256 and truncated. Size cap enforced by the Joi validator, not by this JSON Schema.`)
|
|
165
|
+
.messages({
|
|
166
|
+
'any.invalid': `result.deployResponsePayload exceeds ${DEPLOY_RESPONSE_PAYLOAD_MAX_BYTES} bytes; hash it into deployResponseSha256 and truncate at the write chokepoint`,
|
|
167
|
+
}),
|
|
168
|
+
// Explicit case ranges (not the /i flag) so the derived JSON Schema `pattern`
|
|
169
|
+
// stays flag-free and portable to Python's re-based validators.
|
|
170
|
+
deployResponseSha256: Joi.string().pattern(/^[a-fA-F0-9]{64}$/),
|
|
164
171
|
changeResults: Joi.array().items(changeResultSchema),
|
|
165
172
|
preVerify: preVerifySchema,
|
|
166
173
|
postVerify: postVerifySchema,
|
|
@@ -389,6 +389,7 @@ export const configSchema = Joi.object({
|
|
|
389
389
|
'ams-frontdoor',
|
|
390
390
|
'other',
|
|
391
391
|
).optional(),
|
|
392
|
+
showWww: Joi.boolean().optional(),
|
|
392
393
|
}).optional(),
|
|
393
394
|
cdnLogsConfig: Joi.object({
|
|
394
395
|
bucketName: Joi.string().required(),
|
|
@@ -721,6 +722,11 @@ export const Config = (data = {}) => {
|
|
|
721
722
|
state.llmo.brand = brand;
|
|
722
723
|
};
|
|
723
724
|
|
|
725
|
+
self.updateLlmoShowWww = (showWww) => {
|
|
726
|
+
state.llmo = state.llmo || {};
|
|
727
|
+
state.llmo.showWww = showWww;
|
|
728
|
+
};
|
|
729
|
+
|
|
724
730
|
self.addLlmoHumanQuestions = (questions) => {
|
|
725
731
|
state.llmo = state.llmo || {};
|
|
726
732
|
state.llmo.questions = state.llmo.questions || {};
|