@adobe/helix-config-storage 1.3.1 → 1.4.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,17 @@
1
+ # [1.4.0](https://github.com/adobe/helix-config-storage/compare/v1.3.2...v1.4.0) (2024-08-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * allow adding several users ([cc0722d](https://github.com/adobe/helix-config-storage/commit/cc0722d35b7dc75e78926922c9e9b1a55bbc8377))
7
+
8
+ ## [1.3.2](https://github.com/adobe/helix-config-storage/compare/v1.3.1...v1.3.2) (2024-08-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([99c0299](https://github.com/adobe/helix-config-storage/commit/99c0299c724c6574f7656559a86ad5a2073916f6))
14
+
1
15
  ## [1.3.1](https://github.com/adobe/helix-config-storage/compare/v1.3.0...v1.3.1) (2024-08-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-config-storage",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Helix Config Storage",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "c8": "10.1.2",
45
45
  "eslint": "8.57.0",
46
46
  "husky": "9.1.5",
47
- "json-schema-to-typescript": "15.0.1",
47
+ "json-schema-to-typescript": "15.0.2",
48
48
  "junit-report-builder": "5.0.0",
49
49
  "lint-staged": "15.2.9",
50
50
  "mocha": "10.7.3",
@@ -66,6 +66,6 @@
66
66
  "@adobe/helix-shared-utils": "3.0.2",
67
67
  "ajv": "8.17.1",
68
68
  "ajv-formats": "3.0.1",
69
- "jose": "5.7.0"
69
+ "jose": "5.8.0"
70
70
  }
71
71
  }
@@ -68,6 +68,13 @@ const FRAGMENTS = {
68
68
  },
69
69
  profiles: FRAGMENTS_COMMON,
70
70
  org: {
71
+ tokens: {
72
+ '.': 'tokens',
73
+ '.param': {
74
+ name: 'id',
75
+ '.': 'token',
76
+ },
77
+ },
71
78
  users: {
72
79
  '.': 'users',
73
80
  '.param': {
@@ -353,17 +360,28 @@ export class ConfigStore {
353
360
  // don't expose hash in return value
354
361
  delete ret.hash;
355
362
  } else if (frag.type === 'users') {
356
- const user = createUser();
357
- data = {
358
- ...data,
359
- ...user,
360
- };
361
- relPath = ['users', user.id];
362
- frag.type = 'user';
363
363
  // todo: define via "schema"
364
364
  if (!old.users) {
365
365
  old.users = [];
366
366
  }
367
+ if (Array.isArray(data)) {
368
+ const users = [...old.users];
369
+ for (const userData of data) {
370
+ users.push({
371
+ ...createUser(),
372
+ ...userData,
373
+ });
374
+ }
375
+ data = users;
376
+ } else {
377
+ const user = createUser();
378
+ data = {
379
+ ...data,
380
+ ...user,
381
+ };
382
+ relPath = ['users', user.id];
383
+ frag.type = 'user';
384
+ }
367
385
  } else if (frag.type === 'user') {
368
386
  const user = deepGetOrCreate(old, relPath);
369
387
  if (!user) {
@@ -17,6 +17,9 @@
17
17
  },
18
18
  "groups": {
19
19
  "$ref": "https://ns.adobe.com/helix/config/groups"
20
+ },
21
+ "tokens": {
22
+ "$ref": "https://ns.adobe.com/helix/config/tokens"
20
23
  }
21
24
  },
22
25
  "required": [
@@ -26,6 +26,7 @@ export interface HelixOrgConfig {
26
26
  description?: string;
27
27
  users?: Users;
28
28
  groups?: Groups;
29
+ tokens?: Tokens;
29
30
  }
30
31
  export interface User {
31
32
  id: string;
@@ -49,3 +50,14 @@ export interface Group {
49
50
  [k: string]: unknown;
50
51
  }[];
51
52
  }
53
+ export interface Tokens {
54
+ /**
55
+ * This interface was referenced by `Tokens`'s JSON-Schema definition
56
+ * via the `patternProperty` "^[a-zA-Z0-9-_=]+$".
57
+ */
58
+ [k: string]: {
59
+ id?: string;
60
+ hash?: string;
61
+ created?: string;
62
+ };
63
+ }
@@ -49,6 +49,7 @@ export interface ContentSource {
49
49
  description?: string;
50
50
  contentBusId: string;
51
51
  source: GoogleContentSource | OnedriveContentSource | MarkupContentSource;
52
+ overlay?: MarkupContentSource;
52
53
  }
53
54
  export interface GoogleContentSource {
54
55
  type: 'google';
@@ -56,6 +56,7 @@ export interface ContentSource {
56
56
  description?: string;
57
57
  contentBusId: string;
58
58
  source: GoogleContentSource | OnedriveContentSource | MarkupContentSource;
59
+ overlay?: MarkupContentSource;
59
60
  }
60
61
  export interface GoogleContentSource {
61
62
  type: 'google';
@@ -21,8 +21,8 @@ npx ajv-cli --spec=draft2019 -c ajv-formats compile \
21
21
  -s src/schemas/metadata-source.schema.json \
22
22
  -s src/schemas/user.schema.json \
23
23
  -s src/schemas/users.schema.json \
24
- -s src/schemas/org.schema.json \
25
24
  -s src/schemas/tokens.schema.json \
25
+ -s src/schemas/org.schema.json \
26
26
  -s src/schemas/sidekick.schema.json \
27
27
  -s src/schemas/robots.schema.json \
28
28
  -s src/schemas/public.schema.json \