@squiz/db-lib 1.34.1-alpha.0 → 1.34.1-alpha.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
1
  0 verbose cli /usr/local/bin/node /usr/local/bin/npm
2
2
  1 info using npm@9.5.0
3
3
  2 info using node@v18.15.0
4
- 3 timing npm:load:whichnode Completed in 1ms
4
+ 3 timing npm:load:whichnode Completed in 2ms
5
5
  4 timing config:load:defaults Completed in 3ms
6
- 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms
7
- 6 timing config:load:builtin Completed in 0ms
6
+ 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 1ms
7
+ 6 timing config:load:builtin Completed in 1ms
8
8
  7 timing config:load:cli Completed in 2ms
9
9
  8 timing config:load:env Completed in 1ms
10
10
  9 info found workspace root at /builds/developer-experience/cmp
@@ -12,26 +12,26 @@
12
12
  11 timing config:load:project Completed in 22ms
13
13
  12 timing config:load:file:/root/.npmrc Completed in 1ms
14
14
  13 timing config:load:user Completed in 1ms
15
- 14 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms
15
+ 14 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
16
16
  15 timing config:load:global Completed in 1ms
17
17
  16 timing config:load:setEnvs Completed in 1ms
18
- 17 timing config:load Completed in 32ms
19
- 18 timing npm:load:configload Completed in 32ms
18
+ 17 timing config:load Completed in 34ms
19
+ 18 timing npm:load:configload Completed in 34ms
20
20
  19 timing npm:load:mkdirpcache Completed in 0ms
21
- 20 timing npm:load:mkdirplogs Completed in 1ms
21
+ 20 timing npm:load:mkdirplogs Completed in 0ms
22
22
  21 verbose title npm run compile
23
23
  22 verbose argv "run" "compile" "--"
24
24
  23 timing npm:load:setTitle Completed in 2ms
25
- 24 timing config:load:flatten Completed in 4ms
26
- 25 timing npm:load:display Completed in 5ms
27
- 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-05-17T04_23_28_564Z-
28
- 27 verbose logfile /builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-05-17T04_23_28_564Z-debug-0.log
25
+ 24 timing config:load:flatten Completed in 5ms
26
+ 25 timing npm:load:display Completed in 6ms
27
+ 26 verbose logfile logs-max:10 dir:/builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-05-31T03_00_56_114Z-
28
+ 27 verbose logfile /builds/developer-experience/cmp/packages/db-lib/.npm/_logs/2023-05-31T03_00_56_114Z-debug-0.log
29
29
  28 timing npm:load:logFile Completed in 4ms
30
30
  29 timing npm:load:timers Completed in 0ms
31
31
  30 timing npm:load:configScope Completed in 0ms
32
- 31 timing npm:load Completed in 46ms
32
+ 31 timing npm:load Completed in 49ms
33
33
  32 silly logfile done cleaning log files
34
- 33 timing command:run Completed in 4750ms
34
+ 33 timing command:run Completed in 3379ms
35
35
  34 verbose exit 0
36
- 35 timing npm Completed in 4809ms
36
+ 35 timing npm Completed in 3441ms
37
37
  36 info ok
package/lib/index.js CHANGED
@@ -54286,6 +54286,139 @@ var require_Draft_07 = __commonJS({
54286
54286
  }
54287
54287
  });
54288
54288
 
54289
+ // ../dx-json-schema-lib/lib/pageContents/v1/pageContents.json
54290
+ var require_pageContents = __commonJS({
54291
+ "../dx-json-schema-lib/lib/pageContents/v1/pageContents.json"(exports2, module2) {
54292
+ module2.exports = {
54293
+ $schema: "http://json-schema.org/draft-07/schema#",
54294
+ type: "object",
54295
+ properties: {
54296
+ rule: {
54297
+ $ref: "#/definitions/rule"
54298
+ },
54299
+ containers: {
54300
+ type: "array",
54301
+ items: {
54302
+ type: "object",
54303
+ properties: {
54304
+ layout: {
54305
+ $ref: "#/definitions/layout"
54306
+ },
54307
+ rule: {
54308
+ $ref: "#/definitions/rule"
54309
+ },
54310
+ items: {
54311
+ $ref: "#/definitions/items"
54312
+ }
54313
+ }
54314
+ },
54315
+ additionalProperties: false
54316
+ }
54317
+ },
54318
+ required: ["containers"],
54319
+ definitions: {
54320
+ rule: {
54321
+ type: "object",
54322
+ properties: {
54323
+ type: {
54324
+ type: "string",
54325
+ enum: ["language", "segment", "split"]
54326
+ },
54327
+ values: {
54328
+ type: "array",
54329
+ items: {
54330
+ type: "string"
54331
+ }
54332
+ }
54333
+ },
54334
+ required: ["type", "values"]
54335
+ },
54336
+ layout: {
54337
+ type: "object",
54338
+ properties: {
54339
+ name: {
54340
+ type: "string"
54341
+ },
54342
+ type: {
54343
+ type: "string",
54344
+ enum: ["inline", "external-reference"]
54345
+ },
54346
+ value: {
54347
+ type: "string"
54348
+ }
54349
+ },
54350
+ required: ["name", "type", "value"]
54351
+ },
54352
+ items: {
54353
+ type: "array",
54354
+ items: {
54355
+ properties: {
54356
+ rule: {
54357
+ $ref: "#/definitions/rule"
54358
+ },
54359
+ type: {
54360
+ type: "string",
54361
+ enum: ["component", "rich-text"]
54362
+ },
54363
+ component: {
54364
+ type: "string"
54365
+ },
54366
+ "layout-area": {
54367
+ type: "number"
54368
+ },
54369
+ content: {
54370
+ oneOf: [
54371
+ {
54372
+ type: "object",
54373
+ patternProperties: {
54374
+ "^.*$": {
54375
+ oneOf: [
54376
+ {
54377
+ type: "object",
54378
+ properties: {
54379
+ html: {
54380
+ type: "array",
54381
+ items: {
54382
+ type: "object",
54383
+ properties: {
54384
+ tag: {
54385
+ type: "string"
54386
+ },
54387
+ content: {
54388
+ type: "string"
54389
+ }
54390
+ }
54391
+ }
54392
+ }
54393
+ },
54394
+ description: "NOTE : This is a temp object, will be a reference to FT schema",
54395
+ additionalProperties: false
54396
+ },
54397
+ {
54398
+ type: "string",
54399
+ additionalProperties: {
54400
+ type: "string"
54401
+ }
54402
+ }
54403
+ ]
54404
+ }
54405
+ }
54406
+ },
54407
+ {
54408
+ type: "string"
54409
+ }
54410
+ ]
54411
+ }
54412
+ },
54413
+ required: ["type", "content", "layout_area"]
54414
+ }
54415
+ }
54416
+ },
54417
+ additionalProperties: false
54418
+ };
54419
+ }
54420
+ });
54421
+
54289
54422
  // ../dx-json-schema-lib/lib/errors/SchemaValidationError.js
54290
54423
  var require_SchemaValidationError = __commonJS({
54291
54424
  "../dx-json-schema-lib/lib/errors/SchemaValidationError.js"(exports2) {
@@ -56350,18 +56483,33 @@ var require_customFormatValidators = __commonJS({
56350
56483
  "use strict";
56351
56484
  Object.defineProperty(exports2, "__esModule", { value: true });
56352
56485
  exports2.customFormatValidators = void 0;
56353
- var SchemaValidationError_1 = require_SchemaValidationError();
56354
56486
  var matrixAssetValidator_1 = require_matrixAssetValidator();
56355
56487
  var getValidationDataForMatrixUri_1 = require_getValidationDataForMatrixUri();
56356
56488
  exports2.customFormatValidators = {
56357
56489
  "matrix-asset-uri": (core, schema, value, pointer) => {
56490
+ const errors = [];
56358
56491
  if ((0, matrixAssetValidator_1.isMatrixAssetUri)(value) === false) {
56359
- if (typeof value !== "string")
56360
- throw new SchemaValidationError_1.SchemaValidationError(`matrix asset uri "${value}" isn't a string`);
56361
- const validationData = { [pointer]: (0, getValidationDataForMatrixUri_1.getValidationDataForMatrixUri)(value) };
56362
- throw new SchemaValidationError_1.SchemaValidationError(`matrix asset uri "${value}" isn't a valid matrix asset uri`, void 0, validationData);
56492
+ if (typeof value !== "string") {
56493
+ const error2 = {
56494
+ name: "typeError",
56495
+ code: "type-error",
56496
+ type: "error",
56497
+ message: `Expected matrix-asset-uri (${value}) in \`${pointer}\` to be of type string`,
56498
+ data: { expected: "string", pointer, received: typeof value, value }
56499
+ };
56500
+ return [error2];
56501
+ }
56502
+ const validationData = (0, getValidationDataForMatrixUri_1.getValidationDataForMatrixUri)(value);
56503
+ const error = {
56504
+ name: "matrixAssetUriError",
56505
+ code: "format-error",
56506
+ type: "error",
56507
+ message: `Value matrix-asset-uri (${value}) in \`${pointer}\` is not a valid matrix asset uri`,
56508
+ data: { pointer, value, errors: validationData }
56509
+ };
56510
+ return [error];
56363
56511
  }
56364
- return;
56512
+ return errors.length > 0 ? errors : void 0;
56365
56513
  }
56366
56514
  };
56367
56515
  }
@@ -56392,7 +56540,7 @@ var require_JsonValidationService = __commonJS({
56392
56540
  return mod && mod.__esModule ? mod : { "default": mod };
56393
56541
  };
56394
56542
  Object.defineProperty(exports2, "__esModule", { value: true });
56395
- exports2.JsonValidationService = exports2.JSONSchemaService = exports2.ManifestV1MetaSchema = exports2.RenderInputMetaSchema = exports2.ComponentInputMetaSchema = exports2.RenderInputSchema = exports2.ComponentInputSchema = void 0;
56543
+ exports2.JsonValidationService = exports2.JSONSchemaService = exports2.ManifestV1MetaSchema = exports2.PageContentsMetaSchema = exports2.RenderInputMetaSchema = exports2.ComponentInputMetaSchema = exports2.RenderInputSchema = exports2.ComponentInputSchema = void 0;
56396
56544
  var json_query_1 = __importDefault2(require_jsonQuery());
56397
56545
  var DxComponentInputSchema_json_1 = __importDefault2(require_DxComponentInputSchema());
56398
56546
  var DxComponentIcons_json_1 = __importDefault2(require_DxComponentIcons());
@@ -56400,6 +56548,7 @@ var require_JsonValidationService = __commonJS({
56400
56548
  var MatrixAssetSchema_json_1 = __importDefault2(require_MatrixAssetSchema());
56401
56549
  var Draft_07_json_1 = __importDefault2(require_Draft_07());
56402
56550
  var formattedText_json_1 = __importDefault2(require_formattedText2());
56551
+ var pageContents_json_1 = __importDefault2(require_pageContents());
56403
56552
  var v1_json_1 = __importDefault2(require_v12());
56404
56553
  var SchemaValidationError_1 = require_SchemaValidationError();
56405
56554
  var json_schema_library_1 = require_jsonSchemaLibrary();
@@ -56524,6 +56673,7 @@ var require_JsonValidationService = __commonJS({
56524
56673
  exports2.RenderInputMetaSchema = {
56525
56674
  root: Draft_07_json_1.default
56526
56675
  };
56676
+ exports2.PageContentsMetaSchema = new json_schema_library_1.Draft07(pageContents_json_1.default, defaultConfig);
56527
56677
  exports2.ManifestV1MetaSchema = {
56528
56678
  root: v1_json_1.default,
56529
56679
  remotes: {
@@ -56635,6 +56785,9 @@ ${potentialResolutionErrors.join("\n")}`);
56635
56785
  const errors = exports2.RenderInputSchema.validate(inputValue, inputSchema);
56636
56786
  return processValidationResult(errors);
56637
56787
  }
56788
+ validatePageContents(pageContents) {
56789
+ return processValidationResult(exports2.PageContentsMetaSchema.validate(pageContents));
56790
+ }
56638
56791
  };
56639
56792
  exports2.JsonValidationService = JsonValidationService;
56640
56793
  function processValidationResult(errors) {
@@ -57064,9 +57217,11 @@ var require_lib5 = __commonJS({
57064
57217
  __createBinding2(exports3, m, p);
57065
57218
  };
57066
57219
  Object.defineProperty(exports2, "__esModule", { value: true });
57067
- exports2.SUB_SCHEMAS = exports2.FORMATTED_TEXT_SCHEMAS = exports2.FORMATTED_TEXT_MODELS = exports2.MANIFEST_SCHEMAS = exports2.MANIFEST_MODELS = void 0;
57220
+ exports2.SUB_SCHEMAS = exports2.FORMATTED_TEXT_SCHEMAS = exports2.FORMATTED_TEXT_MODELS = exports2.PAGE_CONTENT_SCHEMAS = exports2.PAGE_CONTENTS_MODELS = exports2.MANIFEST_SCHEMAS = exports2.MANIFEST_MODELS = void 0;
57068
57221
  exports2.MANIFEST_MODELS = __importStar2(require_manifestModels());
57069
57222
  exports2.MANIFEST_SCHEMAS = __importStar2(require_manifestSchemas());
57223
+ exports2.PAGE_CONTENTS_MODELS = __importStar2(require_manifestModels());
57224
+ exports2.PAGE_CONTENT_SCHEMAS = __importStar2(require_manifestSchemas());
57070
57225
  exports2.FORMATTED_TEXT_MODELS = __importStar2(require_formattedTextModels());
57071
57226
  exports2.FORMATTED_TEXT_SCHEMAS = __importStar2(require_formattedTextSchemas());
57072
57227
  __exportStar2(require_resolveFormattedTextNodes(), exports2);