@forge/manifest 4.7.0 → 4.7.1-next.0-experimental-58938ba

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,5 +1,17 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 4.7.1-next.0-experimental-58938ba
4
+
5
+ ### Patch Changes
6
+
7
+ - 23a89df6: Update manifest definitions
8
+
9
+ ## 4.7.1-next.0
10
+
11
+ ### Patch Changes
12
+
13
+ - 23a89df: Update manifest definitions
14
+
3
15
  ## 4.7.0
4
16
 
5
17
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"full-validation-processor.d.ts","sourceRoot":"","sources":["../../src/processor/full-validation-processor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,qBAAa,uBAAwB,SAAQ,2BAA2B,CAAC,cAAc,CAAC;;CAiBvF"}
1
+ {"version":3,"file":"full-validation-processor.d.ts","sourceRoot":"","sources":["../../src/processor/full-validation-processor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,qBAAa,uBAAwB,SAAQ,2BAA2B,CAAC,cAAc,CAAC;;CAkBvF"}
@@ -6,6 +6,7 @@ const validators_1 = require("../validators");
6
6
  const FULL_SCHEMA = tslib_1.__importStar(require("../schema/manifest-schema.json"));
7
7
  const DISPLAY_CONDITIONS_SCHEMA = tslib_1.__importStar(require("../schema/display-conditions-schema.json"));
8
8
  const abstract_validation_processor_1 = require("./abstract-validation-processor");
9
+ const storage_validator_1 = require("../validators/storage-validator");
9
10
  class FullValidationProcessor extends abstract_validation_processor_1.AbstractValidationProcessor {
10
11
  constructor() {
11
12
  super([
@@ -18,6 +19,7 @@ class FullValidationProcessor extends abstract_validation_processor_1.AbstractVa
18
19
  new validators_1.ConnectRemoteValidator(),
19
20
  new validators_1.ConnectAuthenticationValidator(),
20
21
  new validators_1.PermissionsValidator(),
22
+ new storage_validator_1.StorageValidator(),
21
23
  new validators_1.DisplayConditionsValidator(DISPLAY_CONDITIONS_SCHEMA),
22
24
  new validators_1.ProvidersValidator(),
23
25
  new validators_1.EntityPropertyValidator()
@@ -82,11 +82,8 @@
82
82
  }
83
83
  },
84
84
  "storage": {
85
- "description": "Options related to hosted storage",
86
85
  "type": "object",
87
- "required": [
88
- "classifications"
89
- ],
86
+ "description": "Options related to hosted storage",
90
87
  "additionalProperties": false,
91
88
  "properties": {
92
89
  "classifications": {
@@ -101,6 +98,95 @@
101
98
  ]
102
99
  },
103
100
  "minItems": 1
101
+ },
102
+ "entities": {
103
+ "description": "Custom schemas for app stored entities.",
104
+ "type": "array",
105
+ "items": {
106
+ "type": "object",
107
+ "required": [
108
+ "name",
109
+ "attributes"
110
+ ],
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "name": {
114
+ "description": "A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.",
115
+ "type": "string",
116
+ "pattern": "^[a-z]+$",
117
+ "minLength": 3,
118
+ "maxLength": 60
119
+ },
120
+ "attributes": {
121
+ "description": "Attributes of the entity.",
122
+ "type": "object",
123
+ "patternProperties": {
124
+ "^[a-zA-Z][a-zA-Z0-9_]*$": {
125
+ "description": "An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.",
126
+ "type": "object",
127
+ "required": [
128
+ "type"
129
+ ],
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "type": {
133
+ "description": "The data type for the given attribute.",
134
+ "type": "string",
135
+ "enum": [
136
+ "string",
137
+ "boolean",
138
+ "float",
139
+ "integer",
140
+ "any"
141
+ ]
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "indexes": {
149
+ "description": "Indexes on attributes of the schema.",
150
+ "type": "array",
151
+ "items": {
152
+ "oneOf": [
153
+ {
154
+ "type": "string"
155
+ },
156
+ {
157
+ "type": "object",
158
+ "required": [
159
+ "name",
160
+ "range"
161
+ ],
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "name": {
165
+ "type": "string"
166
+ },
167
+ "range": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ },
172
+ "minItems": 1
173
+ },
174
+ "partition": {
175
+ "type": "array",
176
+ "items": {
177
+ "type": "string"
178
+ },
179
+ "minItems": 1
180
+ }
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ "minItems": 1
186
+ }
187
+ }
188
+ },
189
+ "minItems": 1
104
190
  }
105
191
  }
106
192
  }
@@ -43,7 +43,100 @@ export interface App {
43
43
  /**
44
44
  * Labels to classify the type of data stored
45
45
  */
46
- classifications: ['ugc' | 'pii' | 'other', ...('ugc' | 'pii' | 'other')[]];
46
+ classifications?: ['ugc' | 'pii' | 'other', ...('ugc' | 'pii' | 'other')[]];
47
+ /**
48
+ * Custom schemas for app stored entities.
49
+ */
50
+ entities?: [
51
+ {
52
+ /**
53
+ * A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.
54
+ */
55
+ name: string;
56
+ /**
57
+ * Attributes of the entity.
58
+ */
59
+ attributes: {
60
+ /**
61
+ * An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.
62
+ *
63
+ * This interface was referenced by `undefined`'s JSON-Schema definition
64
+ * via the `patternProperty` "^[a-zA-Z][a-zA-Z0-9_]*$".
65
+ */
66
+ [k: string]: {
67
+ /**
68
+ * The data type for the given attribute.
69
+ */
70
+ type: 'string' | 'boolean' | 'float' | 'integer' | 'any';
71
+ };
72
+ };
73
+ /**
74
+ * Indexes on attributes of the schema.
75
+ */
76
+ indexes?: [
77
+ (
78
+ | string
79
+ | {
80
+ name: string;
81
+ range: [string, ...string[]];
82
+ partition?: [string, ...string[]];
83
+ }
84
+ ),
85
+ ...(
86
+ | string
87
+ | {
88
+ name: string;
89
+ range: [string, ...string[]];
90
+ partition?: [string, ...string[]];
91
+ }
92
+ )[]
93
+ ];
94
+ },
95
+ ...{
96
+ /**
97
+ * A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.
98
+ */
99
+ name: string;
100
+ /**
101
+ * Attributes of the entity.
102
+ */
103
+ attributes: {
104
+ /**
105
+ * An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.
106
+ *
107
+ * This interface was referenced by `undefined`'s JSON-Schema definition
108
+ * via the `patternProperty` "^[a-zA-Z][a-zA-Z0-9_]*$".
109
+ */
110
+ [k: string]: {
111
+ /**
112
+ * The data type for the given attribute.
113
+ */
114
+ type: 'string' | 'boolean' | 'float' | 'integer' | 'any';
115
+ };
116
+ };
117
+ /**
118
+ * Indexes on attributes of the schema.
119
+ */
120
+ indexes?: [
121
+ (
122
+ | string
123
+ | {
124
+ name: string;
125
+ range: [string, ...string[]];
126
+ partition?: [string, ...string[]];
127
+ }
128
+ ),
129
+ ...(
130
+ | string
131
+ | {
132
+ name: string;
133
+ range: [string, ...string[]];
134
+ partition?: [string, ...string[]];
135
+ }
136
+ )[]
137
+ ];
138
+ }[]
139
+ ];
47
140
  };
48
141
  }
49
142
  /**
@@ -82,11 +82,8 @@
82
82
  }
83
83
  },
84
84
  "storage": {
85
- "description": "Options related to hosted storage",
86
85
  "type": "object",
87
- "required": [
88
- "classifications"
89
- ],
86
+ "description": "Options related to hosted storage",
90
87
  "additionalProperties": false,
91
88
  "properties": {
92
89
  "classifications": {
@@ -101,6 +98,95 @@
101
98
  ]
102
99
  },
103
100
  "minItems": 1
101
+ },
102
+ "entities": {
103
+ "description": "Custom schemas for app stored entities.",
104
+ "type": "array",
105
+ "items": {
106
+ "type": "object",
107
+ "required": [
108
+ "name",
109
+ "attributes"
110
+ ],
111
+ "additionalProperties": false,
112
+ "properties": {
113
+ "name": {
114
+ "description": "A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.",
115
+ "type": "string",
116
+ "pattern": "^[a-z]+$",
117
+ "minLength": 3,
118
+ "maxLength": 60
119
+ },
120
+ "attributes": {
121
+ "description": "Attributes of the entity.",
122
+ "type": "object",
123
+ "patternProperties": {
124
+ "^[a-zA-Z][a-zA-Z0-9_]*$": {
125
+ "description": "An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.",
126
+ "type": "object",
127
+ "required": [
128
+ "type"
129
+ ],
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "type": {
133
+ "description": "The data type for the given attribute.",
134
+ "type": "string",
135
+ "enum": [
136
+ "string",
137
+ "boolean",
138
+ "float",
139
+ "integer",
140
+ "any"
141
+ ]
142
+ }
143
+ }
144
+ }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "indexes": {
149
+ "description": "Indexes on attributes of the schema.",
150
+ "type": "array",
151
+ "items": {
152
+ "oneOf": [
153
+ {
154
+ "type": "string"
155
+ },
156
+ {
157
+ "type": "object",
158
+ "required": [
159
+ "name",
160
+ "range"
161
+ ],
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "name": {
165
+ "type": "string"
166
+ },
167
+ "range": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ },
172
+ "minItems": 1
173
+ },
174
+ "partition": {
175
+ "type": "array",
176
+ "items": {
177
+ "type": "string"
178
+ },
179
+ "minItems": 1
180
+ }
181
+ }
182
+ }
183
+ ]
184
+ },
185
+ "minItems": 1
186
+ }
187
+ }
188
+ },
189
+ "minItems": 1
104
190
  }
105
191
  }
106
192
  }
@@ -6515,11 +6601,6 @@
6515
6601
  "key": {
6516
6602
  "$ref": "#/definitions/ModuleKeySchema"
6517
6603
  }
6518
- },
6519
- "not": {
6520
- "required": [
6521
- "unlicensedAccess"
6522
- ]
6523
6604
  }
6524
6605
  },
6525
6606
  {
@@ -6586,11 +6667,6 @@
6586
6667
  "key": {
6587
6668
  "$ref": "#/definitions/ModuleKeySchema"
6588
6669
  }
6589
- },
6590
- "not": {
6591
- "required": [
6592
- "unlicensedAccess"
6593
- ]
6594
6670
  }
6595
6671
  }
6596
6672
  ]
@@ -6648,11 +6724,6 @@
6648
6724
  "key": {
6649
6725
  "$ref": "#/definitions/ModuleKeySchema"
6650
6726
  }
6651
- },
6652
- "not": {
6653
- "required": [
6654
- "unlicensedAccess"
6655
- ]
6656
6727
  }
6657
6728
  },
6658
6729
  {
@@ -6719,11 +6790,6 @@
6719
6790
  "key": {
6720
6791
  "$ref": "#/definitions/ModuleKeySchema"
6721
6792
  }
6722
- },
6723
- "not": {
6724
- "required": [
6725
- "unlicensedAccess"
6726
- ]
6727
6793
  }
6728
6794
  }
6729
6795
  ]
@@ -6919,11 +6985,6 @@
6919
6985
  "key": {
6920
6986
  "$ref": "#/definitions/ModuleKeySchema"
6921
6987
  }
6922
- },
6923
- "not": {
6924
- "required": [
6925
- "unlicensedAccess"
6926
- ]
6927
6988
  }
6928
6989
  },
6929
6990
  {
@@ -6997,11 +7058,6 @@
6997
7058
  "key": {
6998
7059
  "$ref": "#/definitions/ModuleKeySchema"
6999
7060
  }
7000
- },
7001
- "not": {
7002
- "required": [
7003
- "unlicensedAccess"
7004
- ]
7005
7061
  }
7006
7062
  }
7007
7063
  ]
@@ -7055,11 +7111,6 @@
7055
7111
  "key": {
7056
7112
  "$ref": "#/definitions/ModuleKeySchema"
7057
7113
  }
7058
- },
7059
- "not": {
7060
- "required": [
7061
- "unlicensedAccess"
7062
- ]
7063
7114
  }
7064
7115
  },
7065
7116
  {
@@ -7133,11 +7184,6 @@
7133
7184
  "key": {
7134
7185
  "$ref": "#/definitions/ModuleKeySchema"
7135
7186
  }
7136
- },
7137
- "not": {
7138
- "required": [
7139
- "unlicensedAccess"
7140
- ]
7141
7187
  }
7142
7188
  }
7143
7189
  ]
@@ -7191,11 +7237,6 @@
7191
7237
  "key": {
7192
7238
  "$ref": "#/definitions/ModuleKeySchema"
7193
7239
  }
7194
- },
7195
- "not": {
7196
- "required": [
7197
- "unlicensedAccess"
7198
- ]
7199
7240
  }
7200
7241
  },
7201
7242
  {
@@ -7269,11 +7310,6 @@
7269
7310
  "key": {
7270
7311
  "$ref": "#/definitions/ModuleKeySchema"
7271
7312
  }
7272
- },
7273
- "not": {
7274
- "required": [
7275
- "unlicensedAccess"
7276
- ]
7277
7313
  }
7278
7314
  }
7279
7315
  ]
@@ -7320,11 +7356,6 @@
7320
7356
  "key": {
7321
7357
  "$ref": "#/definitions/ModuleKeySchema"
7322
7358
  }
7323
- },
7324
- "not": {
7325
- "required": [
7326
- "unlicensedAccess"
7327
- ]
7328
7359
  }
7329
7360
  },
7330
7361
  {
@@ -7402,11 +7433,6 @@
7402
7433
  "key": {
7403
7434
  "$ref": "#/definitions/ModuleKeySchema"
7404
7435
  }
7405
- },
7406
- "not": {
7407
- "required": [
7408
- "unlicensedAccess"
7409
- ]
7410
7436
  }
7411
7437
  }
7412
7438
  ]
@@ -7443,12 +7469,7 @@
7443
7469
  "title",
7444
7470
  "function",
7445
7471
  "key"
7446
- ],
7447
- "not": {
7448
- "required": [
7449
- "unlicensedAccess"
7450
- ]
7451
- }
7472
+ ]
7452
7473
  },
7453
7474
  {
7454
7475
  "type": "object",
@@ -7515,12 +7536,7 @@
7515
7536
  "title",
7516
7537
  "resource",
7517
7538
  "key"
7518
- ],
7519
- "not": {
7520
- "required": [
7521
- "unlicensedAccess"
7522
- ]
7523
- }
7539
+ ]
7524
7540
  }
7525
7541
  ]
7526
7542
  },
@@ -7552,12 +7568,7 @@
7552
7568
  "title",
7553
7569
  "function",
7554
7570
  "key"
7555
- ],
7556
- "not": {
7557
- "required": [
7558
- "unlicensedAccess"
7559
- ]
7560
- }
7571
+ ]
7561
7572
  },
7562
7573
  {
7563
7574
  "type": "object",
@@ -7620,12 +7631,7 @@
7620
7631
  "title",
7621
7632
  "resource",
7622
7633
  "key"
7623
- ],
7624
- "not": {
7625
- "required": [
7626
- "unlicensedAccess"
7627
- ]
7628
- }
7634
+ ]
7629
7635
  }
7630
7636
  ]
7631
7637
  },
@@ -7681,11 +7687,6 @@
7681
7687
  "key": {
7682
7688
  "$ref": "#/definitions/ModuleKeySchema"
7683
7689
  }
7684
- },
7685
- "not": {
7686
- "required": [
7687
- "unlicensedAccess"
7688
- ]
7689
7690
  }
7690
7691
  },
7691
7692
  {
@@ -7763,11 +7764,6 @@
7763
7764
  "key": {
7764
7765
  "$ref": "#/definitions/ModuleKeySchema"
7765
7766
  }
7766
- },
7767
- "not": {
7768
- "required": [
7769
- "unlicensedAccess"
7770
- ]
7771
7767
  }
7772
7768
  }
7773
7769
  ]
@@ -223,7 +223,100 @@ export interface App {
223
223
  /**
224
224
  * Labels to classify the type of data stored
225
225
  */
226
- classifications: ['ugc' | 'pii' | 'other', ...('ugc' | 'pii' | 'other')[]];
226
+ classifications?: ['ugc' | 'pii' | 'other', ...('ugc' | 'pii' | 'other')[]];
227
+ /**
228
+ * Custom schemas for app stored entities.
229
+ */
230
+ entities?: [
231
+ {
232
+ /**
233
+ * A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.
234
+ */
235
+ name: string;
236
+ /**
237
+ * Attributes of the entity.
238
+ */
239
+ attributes: {
240
+ /**
241
+ * An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.
242
+ *
243
+ * This interface was referenced by `undefined`'s JSON-Schema definition
244
+ * via the `patternProperty` "^[a-zA-Z][a-zA-Z0-9_]*$".
245
+ */
246
+ [k: string]: {
247
+ /**
248
+ * The data type for the given attribute.
249
+ */
250
+ type: 'string' | 'boolean' | 'float' | 'integer' | 'any';
251
+ };
252
+ };
253
+ /**
254
+ * Indexes on attributes of the schema.
255
+ */
256
+ indexes?: [
257
+ (
258
+ | string
259
+ | {
260
+ name: string;
261
+ range: [string, ...string[]];
262
+ partition?: [string, ...string[]];
263
+ }
264
+ ),
265
+ ...(
266
+ | string
267
+ | {
268
+ name: string;
269
+ range: [string, ...string[]];
270
+ partition?: [string, ...string[]];
271
+ }
272
+ )[]
273
+ ];
274
+ },
275
+ ...{
276
+ /**
277
+ * A name for the entity. Must be unique within the manifest and have a maximum of 60 characters.
278
+ */
279
+ name: string;
280
+ /**
281
+ * Attributes of the entity.
282
+ */
283
+ attributes: {
284
+ /**
285
+ * An attribute of the entity. Must be unique within the entity and have a maximum of 30 characters.
286
+ *
287
+ * This interface was referenced by `undefined`'s JSON-Schema definition
288
+ * via the `patternProperty` "^[a-zA-Z][a-zA-Z0-9_]*$".
289
+ */
290
+ [k: string]: {
291
+ /**
292
+ * The data type for the given attribute.
293
+ */
294
+ type: 'string' | 'boolean' | 'float' | 'integer' | 'any';
295
+ };
296
+ };
297
+ /**
298
+ * Indexes on attributes of the schema.
299
+ */
300
+ indexes?: [
301
+ (
302
+ | string
303
+ | {
304
+ name: string;
305
+ range: [string, ...string[]];
306
+ partition?: [string, ...string[]];
307
+ }
308
+ ),
309
+ ...(
310
+ | string
311
+ | {
312
+ name: string;
313
+ range: [string, ...string[]];
314
+ partition?: [string, ...string[]];
315
+ }
316
+ )[]
317
+ ];
318
+ }[]
319
+ ];
227
320
  };
228
321
  }
229
322
  /**
@@ -104,6 +104,19 @@ export declare const errors: {
104
104
  missingAppConnectRemote: () => string;
105
105
  missingRemoteForConnect: (key: string) => string;
106
106
  missingConnectModules: () => string;
107
+ storage: {
108
+ missingStorageInformation: () => string;
109
+ entities: {
110
+ entityNameTooLong: (entity: string, limit: number) => string;
111
+ missingAttributes: (entity: string) => string;
112
+ tooManyAttributes: (entity: string, limit: number) => string;
113
+ attributeNameTooLong: (entity: string, attribute: string, limit: number) => string;
114
+ tooManyIndexes: (entity: string, limit: number) => string;
115
+ invalidIndexRange: (entity: string, index: string) => string;
116
+ invalidIndexPartition: (entity: string, partition: string) => string;
117
+ reservedIndexName: (entity: string, index: string) => string;
118
+ };
119
+ };
107
120
  };
108
121
  };
109
122
  export declare enum References {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/text/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;8BACS,MAAM,KAAG,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AEF,oBAAY,UAAU;IACpB,eAAe,2BAA2B;IAC1C,eAAe,wBAAwB;IACvC,WAAW,4BAA4B;IACvC,WAAW,+BAA+B;IAC1C,aAAa,8BAA8B;IAC3C,OAAO,0BAA0B;IACjC,cAAc,kCAAkC;IAChD,mBAAmB,0BAA0B;IAC7C,SAAS,4BAA4B;IACrC,SAAS,4BAA4B;IACrC,UAAU,wBAAwB;IAClC,GAAG,8BAA8B;CAClC"}
@@ -117,7 +117,20 @@ exports.errors = {
117
117
  app: {
118
118
  missingAppConnectRemote: () => `missing app.connect.remote. app.connect.remote is required if connectModules are present.`,
119
119
  missingRemoteForConnect: (key) => `no remote found with key '${key}' matching app.connect.remote value.`,
120
- missingConnectModules: () => 'Missing connectModules. When app.connect.authentication is present, connectModules is required.'
120
+ missingConnectModules: () => 'Missing connectModules. When app.connect.authentication is present, connectModules is required.',
121
+ storage: {
122
+ missingStorageInformation: () => 'Missing storage configuration. When app.storage is present, either entities or classifications is required.',
123
+ entities: {
124
+ entityNameTooLong: (entity, limit) => `Entity name '${entity}' exceeds maximum allowed length of ${limit} characters.`,
125
+ missingAttributes: (entity) => `Entity '${entity}' must contain at least one attribute`,
126
+ tooManyAttributes: (entity, limit) => `Entity '${entity}' contains more attributes than the allowed limit of ${limit}`,
127
+ attributeNameTooLong: (entity, attribute, limit) => `Entity '${entity}' attribute name '${attribute}' exceeds maximum allowed length of ${limit}.`,
128
+ tooManyIndexes: (entity, limit) => `Entity '${entity}' contains more indexes than the allowed limit of ${limit}`,
129
+ invalidIndexRange: (entity, index) => `Entity '${entity}' index '${index}' must refer to a valid attribute of the entity`,
130
+ invalidIndexPartition: (entity, partition) => `Entity '${entity}' index partition '${partition}' must refer to a valid attribute of the entity`,
131
+ reservedIndexName: (entity, index) => `Entity '${entity}' cannot use reserved index name '${index}'`
132
+ }
133
+ }
121
134
  }
122
135
  };
123
136
  var References;
@@ -0,0 +1,11 @@
1
+ import { ValidatorInterface } from './validator-interface';
2
+ import { ManifestObject, ManifestValidationResult } from '../types';
3
+ import { ManifestSchema } from '../schema/manifest';
4
+ export declare class StorageValidator implements ValidatorInterface<ManifestObject<ManifestSchema> | undefined, ManifestSchema> {
5
+ private entityAttributeMaxLength;
6
+ private entityAttributesMaxCount;
7
+ private entityIndexesMaxCount;
8
+ private reservedIndexName;
9
+ validate(manifest: ManifestObject<ManifestSchema> | undefined): Promise<ManifestValidationResult<ManifestSchema>>;
10
+ }
11
+ //# sourceMappingURL=storage-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-validator.d.ts","sourceRoot":"","sources":["../../src/validators/storage-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,gBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,wBAAwB,CAAM;IACtC,OAAO,CAAC,qBAAqB,CAAK;IAClC,OAAO,CAAC,iBAAiB,CAAY;IAE/B,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CA+IrD"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StorageValidator = void 0;
4
+ const text_1 = require("../text");
5
+ const utils_1 = require("../utils");
6
+ class StorageValidator {
7
+ constructor() {
8
+ this.entityAttributeMaxLength = 30;
9
+ this.entityAttributesMaxCount = 50;
10
+ this.entityIndexesMaxCount = 5;
11
+ this.reservedIndexName = 'by-key';
12
+ }
13
+ async validate(manifest) {
14
+ var _a, _b;
15
+ if (!((_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.app) === null || _b === void 0 ? void 0 : _b.storage)) {
16
+ return {
17
+ success: true,
18
+ manifestObject: manifest
19
+ };
20
+ }
21
+ const validationErrors = [];
22
+ if (!manifest.typedContent.app.storage.classifications && !manifest.typedContent.app.storage.entities) {
23
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.missingStorageInformation(), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('storage', manifest.yamlContentByLine)));
24
+ }
25
+ if (!manifest.typedContent.app.storage.entities) {
26
+ return {
27
+ success: true,
28
+ manifestObject: manifest
29
+ };
30
+ }
31
+ const entities = manifest.typedContent.app.storage.entities;
32
+ entities.forEach((entity) => {
33
+ const { name, attributes } = entity;
34
+ if (!Object.keys(attributes).length) {
35
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.missingAttributes(name), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
36
+ }
37
+ else {
38
+ if (Object.keys(attributes).length > this.entityAttributesMaxCount) {
39
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.tooManyAttributes(name, this.entityAttributesMaxCount), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
40
+ }
41
+ Object.keys(attributes).forEach((attributeKey) => {
42
+ if (attributeKey.length > this.entityAttributeMaxLength) {
43
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.attributeNameTooLong(name, attributeKey, this.entityAttributeMaxLength), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
44
+ }
45
+ });
46
+ }
47
+ if (entity.indexes) {
48
+ const { indexes } = entity;
49
+ if (indexes.length > this.entityIndexesMaxCount) {
50
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.tooManyIndexes(name, this.entityIndexesMaxCount), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
51
+ }
52
+ const indexName = [];
53
+ const indexRange = [];
54
+ const indexPartition = [];
55
+ indexes.forEach((index) => {
56
+ if (typeof index === 'string') {
57
+ indexRange.push(index);
58
+ }
59
+ else if (typeof index === 'object') {
60
+ indexName.push(index.name);
61
+ indexRange.push(...index.range);
62
+ if (index.partition) {
63
+ indexPartition.push(...index.partition);
64
+ }
65
+ }
66
+ });
67
+ if (indexName.find((name) => name === this.reservedIndexName)) {
68
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.reservedIndexName(name, this.reservedIndexName), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
69
+ }
70
+ indexRange.forEach((range) => {
71
+ if (!Object.keys(attributes).length || !attributes[range]) {
72
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.invalidIndexRange(name, range), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
73
+ }
74
+ });
75
+ indexPartition.forEach((partition) => {
76
+ if (!Object.keys(attributes).length || !attributes[partition]) {
77
+ validationErrors.push(Object.assign({ message: text_1.errors.app.storage.entities.invalidIndexPartition(name, partition), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('entities', manifest.yamlContentByLine)));
78
+ }
79
+ });
80
+ }
81
+ });
82
+ return {
83
+ success: validationErrors.length === 0,
84
+ manifestObject: manifest,
85
+ errors: validationErrors
86
+ };
87
+ }
88
+ }
89
+ exports.StorageValidator = StorageValidator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "4.7.0",
3
+ "version": "4.7.1-next.0-experimental-58938ba",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {