@squiz/edge-dev-render-runtime-lib 2.4.0 → 2.4.2
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/lib/component-runner/ComponentRunnerService.d.ts +5 -1
- package/lib/index.js +366 -104
- package/lib/index.js.map +4 -4
- package/lib/public/docs.json +159 -254
- package/lib/webserver/controllers/DevelopmentController.d.ts +5 -4
- package/lib/webserver/controllers/StaticController.d.ts +14 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -65,7 +65,7 @@ __export(test_exports, {
|
|
|
65
65
|
var import_http = __toESM(require("http"));
|
|
66
66
|
var import_supertest = __toESM(require("supertest"));
|
|
67
67
|
var import_child_process = require("child_process");
|
|
68
|
-
var
|
|
68
|
+
var import_path4 = __toESM(require("path"));
|
|
69
69
|
var import_os2 = __toESM(require("os"));
|
|
70
70
|
var import_dx_logger_lib = require("@squiz/dx-logger-lib");
|
|
71
71
|
|
|
@@ -75,10 +75,10 @@ var import_cors = __toESM(require("cors"));
|
|
|
75
75
|
var import_compression = __toESM(require("compression"));
|
|
76
76
|
var import_crypto = require("crypto");
|
|
77
77
|
var import_helmet = __toESM(require("helmet"));
|
|
78
|
-
var
|
|
78
|
+
var import_dx_common_lib4 = require("@squiz/dx-common-lib");
|
|
79
79
|
|
|
80
80
|
// src/webserver/routes/routes.ts
|
|
81
|
-
var
|
|
81
|
+
var import_runtime4 = require("@tsoa/runtime");
|
|
82
82
|
|
|
83
83
|
// src/webserver/controllers/CoreController.ts
|
|
84
84
|
var import_tsoa2 = require("tsoa");
|
|
@@ -96,10 +96,10 @@ var import_dx_json_schema_lib = require("@squiz/dx-json-schema-lib");
|
|
|
96
96
|
|
|
97
97
|
// src/utils/getComponentInfoFromComponentId.ts
|
|
98
98
|
var SEPARATOR = "__";
|
|
99
|
-
function getComponentInfoFromComponentId(
|
|
100
|
-
const parts =
|
|
99
|
+
function getComponentInfoFromComponentId(path7) {
|
|
100
|
+
const parts = path7.split(SEPARATOR);
|
|
101
101
|
if (parts.length !== 3) {
|
|
102
|
-
throw Error(`Invalid component identifier path: ${
|
|
102
|
+
throw Error(`Invalid component identifier path: ${path7}`);
|
|
103
103
|
}
|
|
104
104
|
return {
|
|
105
105
|
namespace: parts[0],
|
|
@@ -237,7 +237,7 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
237
237
|
});
|
|
238
238
|
return schemaResult;
|
|
239
239
|
}
|
|
240
|
-
async TemporaryPreview(req, componentId, functionName, headers, envVars, data) {
|
|
240
|
+
async TemporaryPreview(req, componentId, functionName, headers, envVars, data, contextMatrixAssetId, contextMatrixUrl) {
|
|
241
241
|
this.checkDevMode();
|
|
242
242
|
const { namespace, componentName, version } = getComponentInfoFromComponentId(componentId);
|
|
243
243
|
const res = req.res;
|
|
@@ -249,6 +249,7 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
249
249
|
const rootUrl = `http://${req.headers.host}`.replace(/\/+$/, "");
|
|
250
250
|
const componentManifest = await this.manifestService.loadManifest(namespace, componentName, version);
|
|
251
251
|
const componentFunction = componentManifest.getComponentFunctionByName(functionName);
|
|
252
|
+
const defaultPreviewKey = Object.keys(componentManifest.getModel()?.previews ?? {}).at(0) ?? void 0;
|
|
252
253
|
const componentTask = {
|
|
253
254
|
requestId: Date.now().toString(),
|
|
254
255
|
args: [data],
|
|
@@ -260,10 +261,14 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
260
261
|
manifest: componentManifest.getModel(),
|
|
261
262
|
runtimeSet: componentSet,
|
|
262
263
|
manifestPath: await componentManifest.getManifestPath(),
|
|
263
|
-
previewKey:
|
|
264
|
+
previewKey: defaultPreviewKey,
|
|
264
265
|
queryParameters: void 0
|
|
265
266
|
};
|
|
266
|
-
|
|
267
|
+
const ctx = {
|
|
268
|
+
matrixAssetId: contextMatrixAssetId,
|
|
269
|
+
matrixUrl: contextMatrixUrl
|
|
270
|
+
};
|
|
271
|
+
let result = componentManifest.type === "edge" ? await this.componentRunnerService.executeEdgeComponentFunction(componentTask, ctx) : await this.componentRunnerService.executeServerComponentFunction(componentTask);
|
|
267
272
|
const responseHeaders = headers ?? {};
|
|
268
273
|
switch (componentFunction.output.responseType) {
|
|
269
274
|
case "html":
|
|
@@ -273,10 +278,12 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
273
278
|
responseHeaders["content-type"] = "application/json";
|
|
274
279
|
break;
|
|
275
280
|
}
|
|
276
|
-
const defaultPreviewKey = Object.keys(componentManifest.getModel()?.previews ?? {}).at(0) ?? void 0;
|
|
277
281
|
if (defaultPreviewKey) {
|
|
278
282
|
result = await this.componentPreviewService.dressRenderedOutputForPreview(
|
|
279
|
-
|
|
283
|
+
new import_component_lib.ManifestV1(
|
|
284
|
+
this.componentFunctionService.prepareManifestForPreview(componentManifest, defaultPreviewKey, rootUrl),
|
|
285
|
+
await componentManifest.getManifestPath()
|
|
286
|
+
),
|
|
280
287
|
componentFunction,
|
|
281
288
|
defaultPreviewKey,
|
|
282
289
|
result
|
|
@@ -285,16 +292,24 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
285
292
|
setHeadersOnExpressResponse(responseHeaders ?? {}, res);
|
|
286
293
|
res.send(result);
|
|
287
294
|
}
|
|
288
|
-
async getDefaultFunctionRendering(expressRequest, componentId, componentSet, previewKey) {
|
|
289
|
-
await this.getGivenFunctionRendering(
|
|
295
|
+
async getDefaultFunctionRendering(expressRequest, componentId, componentSet, previewKey, contextMatrixAssetId, contextMatrixUrl) {
|
|
296
|
+
await this.getGivenFunctionRendering(
|
|
297
|
+
expressRequest,
|
|
298
|
+
componentId,
|
|
299
|
+
"",
|
|
300
|
+
componentSet,
|
|
301
|
+
previewKey,
|
|
302
|
+
contextMatrixAssetId,
|
|
303
|
+
contextMatrixUrl
|
|
304
|
+
);
|
|
290
305
|
}
|
|
291
|
-
async getGivenFunctionRendering(expressRequest, componentId, functionName, componentSet, previewKey) {
|
|
306
|
+
async getGivenFunctionRendering(expressRequest, componentId, functionName, componentSet, previewKey, contextMatrixAssetId, contextMatrixUrl) {
|
|
292
307
|
const response = expressRequest.res;
|
|
293
308
|
(0, import_dx_common_lib2.assertIsDefined)(response);
|
|
294
|
-
const { path:
|
|
295
|
-
if (UPPERCASE_REGEX.test(
|
|
309
|
+
const { path: path7, query } = expressRequest;
|
|
310
|
+
if (UPPERCASE_REGEX.test(path7) || componentSet && UPPERCASE_REGEX.test(componentSet)) {
|
|
296
311
|
const url = (0, import_query_string.stringifyUrl)({
|
|
297
|
-
url:
|
|
312
|
+
url: path7.toLowerCase(),
|
|
298
313
|
query: {
|
|
299
314
|
...query,
|
|
300
315
|
_componentSet: componentSet?.toLowerCase()
|
|
@@ -303,6 +318,10 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
303
318
|
response.redirect(url);
|
|
304
319
|
return;
|
|
305
320
|
}
|
|
321
|
+
const ctx = {
|
|
322
|
+
matrixAssetId: contextMatrixAssetId,
|
|
323
|
+
matrixUrl: contextMatrixUrl
|
|
324
|
+
};
|
|
306
325
|
const { namespace, componentName, version } = getComponentInfoFromComponentId(componentId);
|
|
307
326
|
const renderInput = await this.renderInputService.resolveInput({
|
|
308
327
|
componentSet,
|
|
@@ -313,15 +332,15 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
313
332
|
expressRequest,
|
|
314
333
|
functionName
|
|
315
334
|
});
|
|
316
|
-
const renderedOutput = await this.doFunctionRender(renderInput);
|
|
335
|
+
const renderedOutput = await this.doFunctionRender(renderInput, ctx);
|
|
317
336
|
this.handleResponse(renderInput, renderedOutput, response);
|
|
318
337
|
}
|
|
319
338
|
handleResponse(input, output, response) {
|
|
320
339
|
this.setHeadersOnResponse(input, response);
|
|
321
340
|
response.send(output);
|
|
322
341
|
}
|
|
323
|
-
async doFunctionRender(renderInput) {
|
|
324
|
-
let result = await this.renderAndValidateOutput(renderInput, renderInput.manifest.type ?? "server");
|
|
342
|
+
async doFunctionRender(renderInput, ctx) {
|
|
343
|
+
let result = await this.renderAndValidateOutput(renderInput, renderInput.manifest.type ?? "server", ctx);
|
|
325
344
|
if (renderInput.previewKey !== void 0) {
|
|
326
345
|
result = await this.componentPreviewService.dressRenderedOutputForPreview(
|
|
327
346
|
renderInput.manifest,
|
|
@@ -332,14 +351,14 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
332
351
|
}
|
|
333
352
|
return result;
|
|
334
353
|
}
|
|
335
|
-
async renderAndValidateOutput(renderInput, componentType) {
|
|
354
|
+
async renderAndValidateOutput(renderInput, componentType, ctx) {
|
|
336
355
|
const executeComponentTask = {
|
|
337
356
|
...renderInput,
|
|
338
357
|
args: [renderInput.input],
|
|
339
358
|
manifest: renderInput.manifestForWeb,
|
|
340
359
|
environment: renderInput.runtimeSet.environment
|
|
341
360
|
};
|
|
342
|
-
const result = componentType === "edge" ? await this.componentRunnerService.executeEdgeComponentFunction(executeComponentTask) : await this.componentRunnerService.executeServerComponentFunction(executeComponentTask);
|
|
361
|
+
const result = componentType === "edge" ? await this.componentRunnerService.executeEdgeComponentFunction(executeComponentTask, ctx) : await this.componentRunnerService.executeServerComponentFunction(executeComponentTask);
|
|
343
362
|
try {
|
|
344
363
|
this.componentFunctionService.assertOutputValidForComponentFunction(result, renderInput.componentFunction);
|
|
345
364
|
} catch (e) {
|
|
@@ -398,14 +417,18 @@ __decorateClass([
|
|
|
398
417
|
__decorateParam(2, (0, import_tsoa3.Path)()),
|
|
399
418
|
__decorateParam(3, (0, import_tsoa3.Query)()),
|
|
400
419
|
__decorateParam(4, (0, import_tsoa3.Query)()),
|
|
401
|
-
__decorateParam(5, (0, import_tsoa3.Query)())
|
|
420
|
+
__decorateParam(5, (0, import_tsoa3.Query)()),
|
|
421
|
+
__decorateParam(6, (0, import_tsoa3.Query)()),
|
|
422
|
+
__decorateParam(7, (0, import_tsoa3.Query)())
|
|
402
423
|
], DevelopmentController.prototype, "TemporaryPreview", 1);
|
|
403
424
|
__decorateClass([
|
|
404
425
|
(0, import_tsoa3.Get)("/render/:componentId"),
|
|
405
426
|
__decorateParam(0, (0, import_tsoa3.Request)()),
|
|
406
427
|
__decorateParam(1, (0, import_tsoa3.Path)()),
|
|
407
428
|
__decorateParam(2, (0, import_tsoa3.Query)("_componentSet")),
|
|
408
|
-
__decorateParam(3, (0, import_tsoa3.Query)("_previewKey"))
|
|
429
|
+
__decorateParam(3, (0, import_tsoa3.Query)("_previewKey")),
|
|
430
|
+
__decorateParam(4, (0, import_tsoa3.Query)()),
|
|
431
|
+
__decorateParam(5, (0, import_tsoa3.Query)())
|
|
409
432
|
], DevelopmentController.prototype, "getDefaultFunctionRendering", 1);
|
|
410
433
|
__decorateClass([
|
|
411
434
|
(0, import_tsoa3.Get)("/render/:componentId/:functionName"),
|
|
@@ -413,7 +436,9 @@ __decorateClass([
|
|
|
413
436
|
__decorateParam(1, (0, import_tsoa3.Path)()),
|
|
414
437
|
__decorateParam(2, (0, import_tsoa3.Path)()),
|
|
415
438
|
__decorateParam(3, (0, import_tsoa3.Query)("_componentSet")),
|
|
416
|
-
__decorateParam(4, (0, import_tsoa3.Query)("_previewKey"))
|
|
439
|
+
__decorateParam(4, (0, import_tsoa3.Query)("_previewKey")),
|
|
440
|
+
__decorateParam(5, (0, import_tsoa3.Query)()),
|
|
441
|
+
__decorateParam(6, (0, import_tsoa3.Query)())
|
|
417
442
|
], DevelopmentController.prototype, "getGivenFunctionRendering", 1);
|
|
418
443
|
DevelopmentController = __decorateClass([
|
|
419
444
|
(0, import_inversify_binding_decorators2.provide)(DevelopmentController),
|
|
@@ -427,14 +452,146 @@ DevelopmentController = __decorateClass([
|
|
|
427
452
|
__decorateParam(5, (0, import_inversify2.inject)("ComponentFunctionService"))
|
|
428
453
|
], DevelopmentController);
|
|
429
454
|
|
|
430
|
-
// src/
|
|
431
|
-
var
|
|
455
|
+
// src/webserver/controllers/StaticController.ts
|
|
456
|
+
var import_tsoa4 = require("tsoa");
|
|
432
457
|
var import_inversify_binding_decorators3 = require("inversify-binding-decorators");
|
|
433
|
-
|
|
458
|
+
var import_dx_common_lib3 = require("@squiz/dx-common-lib");
|
|
459
|
+
var import_path = __toESM(require("path"));
|
|
460
|
+
var import_inversify3 = require("inversify");
|
|
461
|
+
var import_assert = __toESM(require("assert"));
|
|
462
|
+
var StaticController = class extends import_tsoa4.Controller {
|
|
463
|
+
constructor(manifestService, componentSetService, componentFunctionService) {
|
|
464
|
+
super();
|
|
465
|
+
this.manifestService = manifestService;
|
|
466
|
+
this.componentSetService = componentSetService;
|
|
467
|
+
this.componentFunctionService = componentFunctionService;
|
|
468
|
+
}
|
|
469
|
+
async getPreview(namespace, componentName, version, staticFile, req, _componentSet, _previewKey) {
|
|
470
|
+
if (_componentSet !== void 0 && _previewKey !== void 0) {
|
|
471
|
+
throw new import_dx_common_lib3.BadRequestError("You can not have both _componentSet and _previewKey");
|
|
472
|
+
}
|
|
473
|
+
const manifest = await this.manifestService.loadManifest(namespace, componentName, version);
|
|
474
|
+
const manifestModel = manifest.getModel();
|
|
475
|
+
const response = req.res;
|
|
476
|
+
(0, import_assert.default)(response);
|
|
477
|
+
staticFile = import_path.default.join(staticFile, req.params[0]);
|
|
478
|
+
if (manifestModel.staticFiles) {
|
|
479
|
+
const componentStaticFileRoot = manifestModel.staticFiles.locationRoot;
|
|
480
|
+
const manifestPath = await this.manifestService.getManifestPath(namespace, componentName, version);
|
|
481
|
+
const staticFilePathRoot = import_path.default.join(import_path.default.dirname(manifestPath), componentStaticFileRoot);
|
|
482
|
+
const headers = await this.getHeadersForInputType(_componentSet, _previewKey, manifest);
|
|
483
|
+
this.setResponseHeaders(headers, response);
|
|
484
|
+
response.sendFile(
|
|
485
|
+
staticFile,
|
|
486
|
+
{
|
|
487
|
+
root: staticFilePathRoot,
|
|
488
|
+
dotfiles: "deny",
|
|
489
|
+
lastModified: false
|
|
490
|
+
// handle in DEVX-386
|
|
491
|
+
//
|
|
492
|
+
// maxAge: "1y",
|
|
493
|
+
// immutable: true,
|
|
494
|
+
// cacheControl: true
|
|
495
|
+
},
|
|
496
|
+
(e) => {
|
|
497
|
+
if (req.next) {
|
|
498
|
+
if (e?.code == "ENOENT") {
|
|
499
|
+
req.next(
|
|
500
|
+
new import_dx_common_lib3.ResourceNotFoundError(
|
|
501
|
+
`could not find ${e?.path.substr(
|
|
502
|
+
e?.path.indexOf(componentStaticFileRoot) + componentStaticFileRoot.length
|
|
503
|
+
)}`
|
|
504
|
+
)
|
|
505
|
+
);
|
|
506
|
+
} else if (e) {
|
|
507
|
+
req.next(e);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
);
|
|
512
|
+
await new Promise((resolve, _reject) => {
|
|
513
|
+
response.on("finish", () => {
|
|
514
|
+
response.end();
|
|
515
|
+
resolve();
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
} else {
|
|
519
|
+
throw new import_dx_common_lib3.ResourceNotFoundError(`${componentName} ${version} doesn't expose any static resources`);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
setResponseHeaders(headers, response) {
|
|
523
|
+
setHeadersOnExpressResponse(headers, response);
|
|
524
|
+
let cacheControl = response.getHeader("cache-control");
|
|
525
|
+
if (typeof cacheControl != "string") {
|
|
526
|
+
cacheControl = import_dx_common_lib3.DEFAULT_CACHE_CONTROL_HEADER;
|
|
527
|
+
}
|
|
528
|
+
let cacheControlObj = (0, import_dx_common_lib3.parseCacheControl)(cacheControl);
|
|
529
|
+
cacheControlObj = (0, import_dx_common_lib3.applyDefaultRulesToCacheControlObject)(cacheControlObj);
|
|
530
|
+
cacheControlObj.immutable = true;
|
|
531
|
+
cacheControlObj["max-age"] = 604800;
|
|
532
|
+
response.setHeader("cache-control", (0, import_dx_common_lib3.cacheControlToString)(cacheControlObj));
|
|
533
|
+
}
|
|
534
|
+
async getHeadersForInputType(_componentSet, _previewKey, manifest) {
|
|
535
|
+
if (_componentSet) {
|
|
536
|
+
const set = await this.getValidatedSet(_componentSet, manifest);
|
|
537
|
+
return set.headers;
|
|
538
|
+
}
|
|
539
|
+
if (_previewKey) {
|
|
540
|
+
const previewDefinition = await this.getValidatedPreviewDefinition(_previewKey, manifest.getModel());
|
|
541
|
+
const functionPreview = previewDefinition.functionData[manifest.getModel().mainFunction];
|
|
542
|
+
const headers = functionPreview?.headers ? functionPreview.headers : {};
|
|
543
|
+
return headers;
|
|
544
|
+
}
|
|
545
|
+
throw new import_dx_common_lib3.BadRequestError(`neither componentSet or previewKey set`);
|
|
546
|
+
}
|
|
547
|
+
async getValidatedSet(_componentSet, manifest) {
|
|
548
|
+
const set = await this.componentSetService.getComponentSet(_componentSet);
|
|
549
|
+
const isCompVersionInSet = this.componentSetService.componentVersionInSet(manifest, set.webPath);
|
|
550
|
+
if (!isCompVersionInSet) {
|
|
551
|
+
throw new import_dx_common_lib3.ResourceNotFoundError(`${manifest.getName()} ${manifest.getVersion()} not in set ${set.webPath}`);
|
|
552
|
+
}
|
|
553
|
+
return set;
|
|
554
|
+
}
|
|
555
|
+
async getValidatedPreviewDefinition(_previewKey, manifestModel) {
|
|
556
|
+
const { previews = {} } = manifestModel;
|
|
557
|
+
const previewDefinition = previews[_previewKey];
|
|
558
|
+
if (previewDefinition === void 0) {
|
|
559
|
+
const validPreviewKeys = Object.keys(previews);
|
|
560
|
+
throw new Error(
|
|
561
|
+
`Component has not defined preview with key "${_previewKey}", the defined preview keys for this component are "${validPreviewKeys.join(
|
|
562
|
+
", "
|
|
563
|
+
)}"`
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
return previewDefinition;
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
__decorateClass([
|
|
570
|
+
(0, import_tsoa4.Get)("/:namespace/:componentName/:version/:staticFile*"),
|
|
571
|
+
__decorateParam(0, (0, import_tsoa4.Path)()),
|
|
572
|
+
__decorateParam(1, (0, import_tsoa4.Path)()),
|
|
573
|
+
__decorateParam(2, (0, import_tsoa4.Path)()),
|
|
574
|
+
__decorateParam(3, (0, import_tsoa4.Path)()),
|
|
575
|
+
__decorateParam(4, (0, import_tsoa4.Request)()),
|
|
576
|
+
__decorateParam(5, (0, import_tsoa4.Query)()),
|
|
577
|
+
__decorateParam(6, (0, import_tsoa4.Query)())
|
|
578
|
+
], StaticController.prototype, "getPreview", 1);
|
|
579
|
+
StaticController = __decorateClass([
|
|
580
|
+
(0, import_inversify_binding_decorators3.provide)(StaticController),
|
|
581
|
+
(0, import_tsoa4.Route)("/s"),
|
|
582
|
+
__decorateParam(0, (0, import_inversify3.inject)("ManifestService")),
|
|
583
|
+
__decorateParam(1, (0, import_inversify3.inject)("ComponentSetService")),
|
|
584
|
+
__decorateParam(2, (0, import_inversify3.inject)("ComponentFunctionService"))
|
|
585
|
+
], StaticController);
|
|
586
|
+
|
|
587
|
+
// src/ioc.ts
|
|
588
|
+
var import_inversify4 = require("inversify");
|
|
589
|
+
var import_inversify_binding_decorators4 = require("inversify-binding-decorators");
|
|
590
|
+
(0, import_inversify4.decorate)((0, import_inversify4.injectable)(), BaseController);
|
|
434
591
|
var iocContainer;
|
|
435
592
|
var initIocContainer = (services, config) => {
|
|
436
|
-
const container = new
|
|
437
|
-
container.load((0,
|
|
593
|
+
const container = new import_inversify4.Container({ skipBaseClassChecks: true });
|
|
594
|
+
container.load((0, import_inversify_binding_decorators4.buildProviderModule)());
|
|
438
595
|
container.bind("Config").toConstantValue(config);
|
|
439
596
|
container.bind("Logger").toConstantValue(services.logger);
|
|
440
597
|
container.bind("ComponentFunctionService").toConstantValue(services.componentFunctionService);
|
|
@@ -477,9 +634,14 @@ var models = {
|
|
|
477
634
|
"additionalProperties": false
|
|
478
635
|
},
|
|
479
636
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
637
|
+
"UiMetadata": {
|
|
638
|
+
"dataType": "refAlias",
|
|
639
|
+
"type": { "dataType": "intersection", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "autoReload": { "dataType": "boolean" } }, "additionalProperties": { "dataType": "any" } }, { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "collapsedByDefault": { "dataType": "boolean" } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "quickOption": { "dataType": "boolean" }, "inlineEditable": { "dataType": "boolean" } } }] }], "validators": {} }
|
|
640
|
+
},
|
|
641
|
+
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
480
642
|
"CoreSchemaMetaSchema2": {
|
|
481
643
|
"dataType": "refAlias",
|
|
482
|
-
"type": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "not": { "ref": "CoreSchemaMetaSchema2" }, "oneOf": { "ref": "SchemaArray" }, "anyOf": { "ref": "SchemaArray" }, "allOf": { "ref": "SchemaArray" }, "else": { "ref": "CoreSchemaMetaSchema2" }, "then": { "ref": "CoreSchemaMetaSchema2" }, "if": { "ref": "CoreSchemaMetaSchema2" }, "contentEncoding": { "dataType": "string" }, "contentMediaType": { "dataType": "string" }, "matrixAssetTypes": { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["audioFile"] }, { "dataType": "enum", "enums": ["bodycopyContainer"] }, { "dataType": "enum", "enums": ["bodycopyDiv"] }, { "dataType": "enum", "enums": ["calendarEventsSearchPage"] }, { "dataType": "enum", "enums": ["contentContainerTemplate"] }, { "dataType": "enum", "enums": ["contentTypeMarkdown"] }, { "dataType": "enum", "enums": ["contentTypeNestContent"] }, { "dataType": "enum", "enums": ["contentTypeRawHtml"] }, { "dataType": "enum", "enums": ["contentTypeSnippet"] }, { "dataType": "enum", "enums": ["contentTypeWysiwyg"] }, { "dataType": "enum", "enums": ["cssFileFolder"] }, { "dataType": "enum", "enums": ["cssFile"] }, { "dataType": "enum", "enums": ["customForm"] }, { "dataType": "enum", "enums": ["dataRecord"] }, { "dataType": "enum", "enums": ["designAreaAssetLineage"] }, { "dataType": "enum", "enums": ["designAreaBody"] }, { "dataType": "enum", "enums": ["designAreaMenuNormal"] }, { "dataType": "enum", "enums": ["designAreaNestContent"] }, { "dataType": "enum", "enums": ["designCssCustomisation"] }, { "dataType": "enum", "enums": ["designCss"] }, { "dataType": "enum", "enums": ["designCustomisation"] }, { "dataType": "enum", "enums": ["designScss"] }, { "dataType": "enum", "enums": ["design"] }, { "dataType": "enum", "enums": ["docx"] }, { "dataType": "enum", "enums": ["excelDoc"] }, { "dataType": "enum", "enums": ["file"] }, { "dataType": "enum", "enums": ["folder"] }, { "dataType": "enum", "enums": ["gitBridge"] }, { "dataType": "enum", "enums": ["googleAnalyticsConnector"] }, { "dataType": "enum", "enums": ["googleAnalyticsView"] }, { "dataType": "enum", "enums": ["image"] }, { "dataType": "enum", "enums": ["jsFileFolder"] }, { "dataType": "enum", "enums": ["jsFile"] }, { "dataType": "enum", "enums": ["jsonWebToken"] }, { "dataType": "enum", "enums": ["layoutManager"] }, { "dataType": "enum", "enums": ["layout"] }, { "dataType": "enum", "enums": ["link"] }, { "dataType": "enum", "enums": ["metadataFieldDate"] }, { "dataType": "enum", "enums": ["metadataFieldRelatedAsset"] }, { "dataType": "enum", "enums": ["metadataFieldSelect"] }, { "dataType": "enum", "enums": ["metadataFieldText"] }, { "dataType": "enum", "enums": ["metadataFieldWysiwyg"] }, { "dataType": "enum", "enums": ["metadataSchema"] }, { "dataType": "enum", "enums": ["metadataSection"] }, { "dataType": "enum", "enums": ["newsItem"] }, { "dataType": "enum", "enums": ["oauthAccountManager"] }, { "dataType": "enum", "enums": ["pageAccountManager"] }, { "dataType": "enum", "enums": ["pageAssetListing"] }, { "dataType": "enum", "enums": ["pageCalendarEventsSearch"] }, { "dataType": "enum", "enums": ["pageCalendar"] }, { "dataType": "enum", "enums": ["pagePasswordReset"] }, { "dataType": "enum", "enums": ["pageRemoteContent"] }, { "dataType": "enum", "enums": ["pageRestResourceJs"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthSession"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthTwoLegged"] }, { "dataType": "enum", "enums": ["pageRestResource"] }, { "dataType": "enum", "enums": ["pageSiteMap"] }, { "dataType": "enum", "enums": ["pageStandard"] }, { "dataType": "enum", "enums": ["paintLayoutBodycopy"] }, { "dataType": "enum", "enums": ["paintLayoutPage"] }, { "dataType": "enum", "enums": ["pdfFile"] }, { "dataType": "enum", "enums": ["pdf"] }, { "dataType": "enum", "enums": ["persona"] }, { "dataType": "enum", "enums": ["powerpointDoc"] }, { "dataType": "enum", "enums": ["pptx"] }, { "dataType": "enum", "enums": ["redirectPage"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["regularExpression"] }, { "dataType": "enum", "enums": ["rtfFile"] }, { "dataType": "enum", "enums": ["samlAccountManager"] }, { "dataType": "enum", "enums": ["saml2Acs"] }, { "dataType": "enum", "enums": ["saml2Sls"] }, { "dataType": "enum", "enums": ["searchPage"] }, { "dataType": "enum", "enums": ["site"] }, { "dataType": "enum", "enums": ["textFile"] }, { "dataType": "enum", "enums": ["TriggerTypes?"] }, { "dataType": "enum", "enums": ["userGroup"] }, { "dataType": "enum", "enums": ["wordDoc"] }, { "dataType": "enum", "enums": ["workflowSchema"] }, { "dataType": "enum", "enums": ["workflowStepCondition"] }, { "dataType": "enum", "enums": ["workflowStep"] }, { "dataType": "enum", "enums": ["workflowStream"] }, { "dataType": "enum", "enums": ["xlsx"] }, { "dataType": "enum", "enums": ["xmlFile"] }] } }, "format": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["date-time"] }, { "dataType": "enum", "enums": ["email"] }, { "dataType": "enum", "enums": ["hostname"] }, { "dataType": "enum", "enums": ["ipv4"] }, { "dataType": "enum", "enums": ["ipv6"] }, { "dataType": "enum", "enums": ["json-pointer"] }, { "dataType": "enum", "enums": ["matrix-asset-uri"] }, { "dataType": "enum", "enums": ["multi-line"] }, { "dataType": "enum", "enums": ["password"] }, { "dataType": "enum", "enums": ["phone"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["relative-json-pointer"] }, { "dataType": "enum", "enums": ["uri-reference"] }, { "dataType": "enum", "enums": ["uri-template"] }, { "dataType": "enum", "enums": ["uri"] }, { "dataType": "enum", "enums": ["uuid"] }] }, "type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] } }] }, "enum": { "dataType": "array", "array": { "dataType": "
|
|
644
|
+
"type": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "not": { "ref": "CoreSchemaMetaSchema2" }, "oneOf": { "ref": "SchemaArray" }, "anyOf": { "ref": "SchemaArray" }, "allOf": { "ref": "SchemaArray" }, "else": { "ref": "CoreSchemaMetaSchema2" }, "then": { "ref": "CoreSchemaMetaSchema2" }, "if": { "ref": "CoreSchemaMetaSchema2" }, "contentEncoding": { "dataType": "string" }, "contentMediaType": { "dataType": "string" }, "matrixAssetTypes": { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["audioFile"] }, { "dataType": "enum", "enums": ["bodycopyContainer"] }, { "dataType": "enum", "enums": ["bodycopyDiv"] }, { "dataType": "enum", "enums": ["calendarEventsSearchPage"] }, { "dataType": "enum", "enums": ["contentContainerTemplate"] }, { "dataType": "enum", "enums": ["contentTypeMarkdown"] }, { "dataType": "enum", "enums": ["contentTypeNestContent"] }, { "dataType": "enum", "enums": ["contentTypeRawHtml"] }, { "dataType": "enum", "enums": ["contentTypeSnippet"] }, { "dataType": "enum", "enums": ["contentTypeWysiwyg"] }, { "dataType": "enum", "enums": ["cssFileFolder"] }, { "dataType": "enum", "enums": ["cssFile"] }, { "dataType": "enum", "enums": ["customForm"] }, { "dataType": "enum", "enums": ["dataRecord"] }, { "dataType": "enum", "enums": ["designAreaAssetLineage"] }, { "dataType": "enum", "enums": ["designAreaBody"] }, { "dataType": "enum", "enums": ["designAreaMenuNormal"] }, { "dataType": "enum", "enums": ["designAreaNestContent"] }, { "dataType": "enum", "enums": ["designCssCustomisation"] }, { "dataType": "enum", "enums": ["designCss"] }, { "dataType": "enum", "enums": ["designCustomisation"] }, { "dataType": "enum", "enums": ["designScss"] }, { "dataType": "enum", "enums": ["design"] }, { "dataType": "enum", "enums": ["docx"] }, { "dataType": "enum", "enums": ["excelDoc"] }, { "dataType": "enum", "enums": ["file"] }, { "dataType": "enum", "enums": ["folder"] }, { "dataType": "enum", "enums": ["gitBridge"] }, { "dataType": "enum", "enums": ["googleAnalyticsConnector"] }, { "dataType": "enum", "enums": ["googleAnalyticsView"] }, { "dataType": "enum", "enums": ["image"] }, { "dataType": "enum", "enums": ["jsFileFolder"] }, { "dataType": "enum", "enums": ["jsFile"] }, { "dataType": "enum", "enums": ["jsonWebToken"] }, { "dataType": "enum", "enums": ["layoutManager"] }, { "dataType": "enum", "enums": ["layout"] }, { "dataType": "enum", "enums": ["link"] }, { "dataType": "enum", "enums": ["metadataFieldDate"] }, { "dataType": "enum", "enums": ["metadataFieldRelatedAsset"] }, { "dataType": "enum", "enums": ["metadataFieldSelect"] }, { "dataType": "enum", "enums": ["metadataFieldText"] }, { "dataType": "enum", "enums": ["metadataFieldWysiwyg"] }, { "dataType": "enum", "enums": ["metadataSchema"] }, { "dataType": "enum", "enums": ["metadataSection"] }, { "dataType": "enum", "enums": ["newsItem"] }, { "dataType": "enum", "enums": ["oauthAccountManager"] }, { "dataType": "enum", "enums": ["pageAccountManager"] }, { "dataType": "enum", "enums": ["pageAssetListing"] }, { "dataType": "enum", "enums": ["pageCalendarEventsSearch"] }, { "dataType": "enum", "enums": ["pageCalendar"] }, { "dataType": "enum", "enums": ["pagePasswordReset"] }, { "dataType": "enum", "enums": ["pageRemoteContent"] }, { "dataType": "enum", "enums": ["pageRestResourceJs"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthSession"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthTwoLegged"] }, { "dataType": "enum", "enums": ["pageRestResource"] }, { "dataType": "enum", "enums": ["pageSiteMap"] }, { "dataType": "enum", "enums": ["pageStandard"] }, { "dataType": "enum", "enums": ["paintLayoutBodycopy"] }, { "dataType": "enum", "enums": ["paintLayoutPage"] }, { "dataType": "enum", "enums": ["pdfFile"] }, { "dataType": "enum", "enums": ["pdf"] }, { "dataType": "enum", "enums": ["persona"] }, { "dataType": "enum", "enums": ["powerpointDoc"] }, { "dataType": "enum", "enums": ["pptx"] }, { "dataType": "enum", "enums": ["redirectPage"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["regularExpression"] }, { "dataType": "enum", "enums": ["rtfFile"] }, { "dataType": "enum", "enums": ["samlAccountManager"] }, { "dataType": "enum", "enums": ["saml2Acs"] }, { "dataType": "enum", "enums": ["saml2Sls"] }, { "dataType": "enum", "enums": ["searchPage"] }, { "dataType": "enum", "enums": ["site"] }, { "dataType": "enum", "enums": ["textFile"] }, { "dataType": "enum", "enums": ["TriggerTypes?"] }, { "dataType": "enum", "enums": ["userGroup"] }, { "dataType": "enum", "enums": ["wordDoc"] }, { "dataType": "enum", "enums": ["workflowSchema"] }, { "dataType": "enum", "enums": ["workflowStepCondition"] }, { "dataType": "enum", "enums": ["workflowStep"] }, { "dataType": "enum", "enums": ["workflowStream"] }, { "dataType": "enum", "enums": ["xlsx"] }, { "dataType": "enum", "enums": ["xmlFile"] }] } }, "format": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["date-time"] }, { "dataType": "enum", "enums": ["email"] }, { "dataType": "enum", "enums": ["hostname"] }, { "dataType": "enum", "enums": ["ipv4"] }, { "dataType": "enum", "enums": ["ipv6"] }, { "dataType": "enum", "enums": ["json-pointer"] }, { "dataType": "enum", "enums": ["matrix-asset-uri"] }, { "dataType": "enum", "enums": ["multi-line"] }, { "dataType": "enum", "enums": ["password"] }, { "dataType": "enum", "enums": ["phone"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["relative-json-pointer"] }, { "dataType": "enum", "enums": ["uri-reference"] }, { "dataType": "enum", "enums": ["uri-template"] }, { "dataType": "enum", "enums": ["uri"] }, { "dataType": "enum", "enums": ["uuid"] }] }, "type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] } }] }, "enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } }, "const": { "dataType": "any" }, "propertyNames": { "ref": "CoreSchemaMetaSchema2" }, "dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "StringArray" }] } }, "patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } }, "properties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } }, "definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } }, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" }, "required": { "ref": "StringArray" }, "minProperties": { "dataType": "double" }, "maxProperties": { "dataType": "double" }, "contains": { "ref": "CoreSchemaMetaSchema2" }, "uniqueItems": { "dataType": "boolean" }, "minItems": { "dataType": "double" }, "maxItems": { "dataType": "double" }, "items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "SchemaArray" }] }, "additionalItems": { "ref": "CoreSchemaMetaSchema2" }, "pattern": { "dataType": "string" }, "minLength": { "dataType": "double" }, "maxLength": { "dataType": "double" }, "exclusiveMinimum": { "dataType": "double" }, "minimum": { "dataType": "double" }, "exclusiveMaximum": { "dataType": "double" }, "maximum": { "dataType": "double" }, "multipleOf": { "dataType": "double" }, "examples": { "dataType": "array", "array": { "dataType": "any" } }, "writeOnly": { "dataType": "boolean" }, "readOnly": { "dataType": "boolean" }, "default": { "dataType": "any" }, "description": { "dataType": "string" }, "title": { "dataType": "string" }, "$comment": { "dataType": "string" }, "$ref": { "dataType": "string" }, "$schema": { "dataType": "string" }, "ui:metadata": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "collapsedByDefault": { "dataType": "boolean" } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "quickOption": { "dataType": "boolean" }, "inlineEditable": { "dataType": "boolean" } } }] }, "$id": { "dataType": "string" } } }, { "dataType": "boolean" }], "validators": {} }
|
|
483
645
|
},
|
|
484
646
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
485
647
|
"SchemaArray": {
|
|
@@ -496,32 +658,32 @@ var models = {
|
|
|
496
658
|
"dataType": "refObject",
|
|
497
659
|
"properties": {
|
|
498
660
|
"$id": { "dataType": "string" },
|
|
499
|
-
"ui:metadata": { "
|
|
661
|
+
"ui:metadata": { "ref": "UiMetadata" },
|
|
500
662
|
"$schema": { "dataType": "string" },
|
|
501
663
|
"$ref": { "dataType": "string" },
|
|
502
664
|
"$comment": { "dataType": "string" },
|
|
503
665
|
"title": { "dataType": "string" },
|
|
504
666
|
"description": { "dataType": "string" },
|
|
505
|
-
"default": { "dataType": "
|
|
667
|
+
"default": { "dataType": "any" },
|
|
506
668
|
"readOnly": { "dataType": "boolean" },
|
|
507
669
|
"writeOnly": { "dataType": "boolean" },
|
|
508
|
-
"examples": { "dataType": "array", "array": { "dataType": "
|
|
670
|
+
"examples": { "dataType": "array", "array": { "dataType": "any" } },
|
|
509
671
|
"multipleOf": { "dataType": "double" },
|
|
510
672
|
"maximum": { "dataType": "double" },
|
|
511
673
|
"exclusiveMaximum": { "dataType": "double" },
|
|
512
674
|
"minimum": { "dataType": "double" },
|
|
513
675
|
"exclusiveMinimum": { "dataType": "double" },
|
|
514
676
|
"maxLength": { "dataType": "double" },
|
|
515
|
-
"minLength": { "dataType": "
|
|
677
|
+
"minLength": { "dataType": "double" },
|
|
516
678
|
"pattern": { "dataType": "string" },
|
|
517
679
|
"additionalItems": { "ref": "CoreSchemaMetaSchema2" },
|
|
518
680
|
"items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "SchemaArray" }] },
|
|
519
681
|
"maxItems": { "dataType": "double" },
|
|
520
|
-
"minItems": { "dataType": "
|
|
682
|
+
"minItems": { "dataType": "double" },
|
|
521
683
|
"uniqueItems": { "dataType": "boolean" },
|
|
522
684
|
"contains": { "ref": "CoreSchemaMetaSchema2" },
|
|
523
685
|
"maxProperties": { "dataType": "double" },
|
|
524
|
-
"minProperties": { "dataType": "
|
|
686
|
+
"minProperties": { "dataType": "double" },
|
|
525
687
|
"required": { "ref": "StringArray" },
|
|
526
688
|
"additionalProperties": { "ref": "CoreSchemaMetaSchema2" },
|
|
527
689
|
"definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } },
|
|
@@ -529,8 +691,8 @@ var models = {
|
|
|
529
691
|
"patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } },
|
|
530
692
|
"dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "StringArray" }] } },
|
|
531
693
|
"propertyNames": { "ref": "CoreSchemaMetaSchema2" },
|
|
532
|
-
"const": { "dataType": "
|
|
533
|
-
"enum": { "dataType": "array", "array": { "dataType": "
|
|
694
|
+
"const": { "dataType": "any" },
|
|
695
|
+
"enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } },
|
|
534
696
|
"type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }, { "dataType": "enum", "enums": ["FormattedText"] }, { "dataType": "enum", "enums": ["SquizImage"] }, { "dataType": "enum", "enums": ["SquizLink"] }] } }] },
|
|
535
697
|
"format": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["date-time"] }, { "dataType": "enum", "enums": ["email"] }, { "dataType": "enum", "enums": ["hostname"] }, { "dataType": "enum", "enums": ["ipv4"] }, { "dataType": "enum", "enums": ["ipv6"] }, { "dataType": "enum", "enums": ["json-pointer"] }, { "dataType": "enum", "enums": ["matrix-asset-uri"] }, { "dataType": "enum", "enums": ["multi-line"] }, { "dataType": "enum", "enums": ["password"] }, { "dataType": "enum", "enums": ["phone"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["relative-json-pointer"] }, { "dataType": "enum", "enums": ["uri-reference"] }, { "dataType": "enum", "enums": ["uri-template"] }, { "dataType": "enum", "enums": ["uri"] }, { "dataType": "enum", "enums": ["uuid"] }] },
|
|
536
698
|
"matrixAssetTypes": { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["audioFile"] }, { "dataType": "enum", "enums": ["bodycopyContainer"] }, { "dataType": "enum", "enums": ["bodycopyDiv"] }, { "dataType": "enum", "enums": ["calendarEventsSearchPage"] }, { "dataType": "enum", "enums": ["contentContainerTemplate"] }, { "dataType": "enum", "enums": ["contentTypeMarkdown"] }, { "dataType": "enum", "enums": ["contentTypeNestContent"] }, { "dataType": "enum", "enums": ["contentTypeRawHtml"] }, { "dataType": "enum", "enums": ["contentTypeSnippet"] }, { "dataType": "enum", "enums": ["contentTypeWysiwyg"] }, { "dataType": "enum", "enums": ["cssFileFolder"] }, { "dataType": "enum", "enums": ["cssFile"] }, { "dataType": "enum", "enums": ["customForm"] }, { "dataType": "enum", "enums": ["dataRecord"] }, { "dataType": "enum", "enums": ["designAreaAssetLineage"] }, { "dataType": "enum", "enums": ["designAreaBody"] }, { "dataType": "enum", "enums": ["designAreaMenuNormal"] }, { "dataType": "enum", "enums": ["designAreaNestContent"] }, { "dataType": "enum", "enums": ["designCssCustomisation"] }, { "dataType": "enum", "enums": ["designCss"] }, { "dataType": "enum", "enums": ["designCustomisation"] }, { "dataType": "enum", "enums": ["designScss"] }, { "dataType": "enum", "enums": ["design"] }, { "dataType": "enum", "enums": ["docx"] }, { "dataType": "enum", "enums": ["excelDoc"] }, { "dataType": "enum", "enums": ["file"] }, { "dataType": "enum", "enums": ["folder"] }, { "dataType": "enum", "enums": ["gitBridge"] }, { "dataType": "enum", "enums": ["googleAnalyticsConnector"] }, { "dataType": "enum", "enums": ["googleAnalyticsView"] }, { "dataType": "enum", "enums": ["image"] }, { "dataType": "enum", "enums": ["jsFileFolder"] }, { "dataType": "enum", "enums": ["jsFile"] }, { "dataType": "enum", "enums": ["jsonWebToken"] }, { "dataType": "enum", "enums": ["layoutManager"] }, { "dataType": "enum", "enums": ["layout"] }, { "dataType": "enum", "enums": ["link"] }, { "dataType": "enum", "enums": ["metadataFieldDate"] }, { "dataType": "enum", "enums": ["metadataFieldRelatedAsset"] }, { "dataType": "enum", "enums": ["metadataFieldSelect"] }, { "dataType": "enum", "enums": ["metadataFieldText"] }, { "dataType": "enum", "enums": ["metadataFieldWysiwyg"] }, { "dataType": "enum", "enums": ["metadataSchema"] }, { "dataType": "enum", "enums": ["metadataSection"] }, { "dataType": "enum", "enums": ["newsItem"] }, { "dataType": "enum", "enums": ["oauthAccountManager"] }, { "dataType": "enum", "enums": ["pageAccountManager"] }, { "dataType": "enum", "enums": ["pageAssetListing"] }, { "dataType": "enum", "enums": ["pageCalendarEventsSearch"] }, { "dataType": "enum", "enums": ["pageCalendar"] }, { "dataType": "enum", "enums": ["pagePasswordReset"] }, { "dataType": "enum", "enums": ["pageRemoteContent"] }, { "dataType": "enum", "enums": ["pageRestResourceJs"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthSession"] }, { "dataType": "enum", "enums": ["pageRestResourceOauthTwoLegged"] }, { "dataType": "enum", "enums": ["pageRestResource"] }, { "dataType": "enum", "enums": ["pageSiteMap"] }, { "dataType": "enum", "enums": ["pageStandard"] }, { "dataType": "enum", "enums": ["paintLayoutBodycopy"] }, { "dataType": "enum", "enums": ["paintLayoutPage"] }, { "dataType": "enum", "enums": ["pdfFile"] }, { "dataType": "enum", "enums": ["pdf"] }, { "dataType": "enum", "enums": ["persona"] }, { "dataType": "enum", "enums": ["powerpointDoc"] }, { "dataType": "enum", "enums": ["pptx"] }, { "dataType": "enum", "enums": ["redirectPage"] }, { "dataType": "enum", "enums": ["regex"] }, { "dataType": "enum", "enums": ["regularExpression"] }, { "dataType": "enum", "enums": ["rtfFile"] }, { "dataType": "enum", "enums": ["samlAccountManager"] }, { "dataType": "enum", "enums": ["saml2Acs"] }, { "dataType": "enum", "enums": ["saml2Sls"] }, { "dataType": "enum", "enums": ["searchPage"] }, { "dataType": "enum", "enums": ["site"] }, { "dataType": "enum", "enums": ["textFile"] }, { "dataType": "enum", "enums": ["TriggerTypes?"] }, { "dataType": "enum", "enums": ["userGroup"] }, { "dataType": "enum", "enums": ["wordDoc"] }, { "dataType": "enum", "enums": ["workflowSchema"] }, { "dataType": "enum", "enums": ["workflowStepCondition"] }, { "dataType": "enum", "enums": ["workflowStep"] }, { "dataType": "enum", "enums": ["workflowStream"] }, { "dataType": "enum", "enums": ["xlsx"] }, { "dataType": "enum", "enums": ["xmlFile"] }] } },
|
|
@@ -610,7 +772,7 @@ var models = {
|
|
|
610
772
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
611
773
|
"CoreSchemaMetaSchema5": {
|
|
612
774
|
"dataType": "refAlias",
|
|
613
|
-
"type": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "not": { "ref": "CoreSchemaMetaSchema5" }, "oneOf": { "ref": "SchemaArray1" }, "anyOf": { "ref": "SchemaArray1" }, "allOf": { "ref": "SchemaArray1" }, "else": { "ref": "CoreSchemaMetaSchema5" }, "then": { "ref": "CoreSchemaMetaSchema5" }, "if": { "ref": "CoreSchemaMetaSchema5" }, "contentEncoding": { "dataType": "string" }, "contentMediaType": { "dataType": "string" }, "format": { "dataType": "string" }, "type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] } }] }, "enum": { "dataType": "array", "array": { "dataType": "
|
|
775
|
+
"type": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "not": { "ref": "CoreSchemaMetaSchema5" }, "oneOf": { "ref": "SchemaArray1" }, "anyOf": { "ref": "SchemaArray1" }, "allOf": { "ref": "SchemaArray1" }, "else": { "ref": "CoreSchemaMetaSchema5" }, "then": { "ref": "CoreSchemaMetaSchema5" }, "if": { "ref": "CoreSchemaMetaSchema5" }, "contentEncoding": { "dataType": "string" }, "contentMediaType": { "dataType": "string" }, "format": { "dataType": "string" }, "type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] } }] }, "enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } }, "const": { "dataType": "any" }, "propertyNames": { "ref": "CoreSchemaMetaSchema5" }, "dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "StringArray1" }] } }, "patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } }, "properties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } }, "definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } }, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" }, "required": { "ref": "StringArray1" }, "minProperties": { "dataType": "double" }, "maxProperties": { "dataType": "double" }, "contains": { "ref": "CoreSchemaMetaSchema5" }, "uniqueItems": { "dataType": "boolean" }, "minItems": { "dataType": "double" }, "maxItems": { "dataType": "double" }, "items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "SchemaArray1" }] }, "additionalItems": { "ref": "CoreSchemaMetaSchema5" }, "pattern": { "dataType": "string" }, "minLength": { "dataType": "double" }, "maxLength": { "dataType": "double" }, "exclusiveMinimum": { "dataType": "double" }, "minimum": { "dataType": "double" }, "exclusiveMaximum": { "dataType": "double" }, "maximum": { "dataType": "double" }, "multipleOf": { "dataType": "double" }, "examples": { "dataType": "array", "array": { "dataType": "any" } }, "writeOnly": { "dataType": "boolean" }, "readOnly": { "dataType": "boolean" }, "default": { "dataType": "any" }, "description": { "dataType": "string" }, "title": { "dataType": "string" }, "$comment": { "dataType": "string" }, "$ref": { "dataType": "string" }, "$schema": { "dataType": "string" }, "$id": { "dataType": "string" } }, "additionalProperties": { "dataType": "any" } }, { "dataType": "boolean" }], "validators": {} }
|
|
614
776
|
},
|
|
615
777
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
616
778
|
"SchemaArray1": {
|
|
@@ -632,26 +794,26 @@ var models = {
|
|
|
632
794
|
"$comment": { "dataType": "string" },
|
|
633
795
|
"title": { "dataType": "string" },
|
|
634
796
|
"description": { "dataType": "string" },
|
|
635
|
-
"default": { "dataType": "
|
|
797
|
+
"default": { "dataType": "any" },
|
|
636
798
|
"readOnly": { "dataType": "boolean" },
|
|
637
799
|
"writeOnly": { "dataType": "boolean" },
|
|
638
|
-
"examples": { "dataType": "array", "array": { "dataType": "
|
|
800
|
+
"examples": { "dataType": "array", "array": { "dataType": "any" } },
|
|
639
801
|
"multipleOf": { "dataType": "double" },
|
|
640
802
|
"maximum": { "dataType": "double" },
|
|
641
803
|
"exclusiveMaximum": { "dataType": "double" },
|
|
642
804
|
"minimum": { "dataType": "double" },
|
|
643
805
|
"exclusiveMinimum": { "dataType": "double" },
|
|
644
806
|
"maxLength": { "dataType": "double" },
|
|
645
|
-
"minLength": { "dataType": "
|
|
807
|
+
"minLength": { "dataType": "double" },
|
|
646
808
|
"pattern": { "dataType": "string" },
|
|
647
809
|
"additionalItems": { "ref": "CoreSchemaMetaSchema5" },
|
|
648
810
|
"items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "SchemaArray1" }] },
|
|
649
811
|
"maxItems": { "dataType": "double" },
|
|
650
|
-
"minItems": { "dataType": "
|
|
812
|
+
"minItems": { "dataType": "double" },
|
|
651
813
|
"uniqueItems": { "dataType": "boolean" },
|
|
652
814
|
"contains": { "ref": "CoreSchemaMetaSchema5" },
|
|
653
815
|
"maxProperties": { "dataType": "double" },
|
|
654
|
-
"minProperties": { "dataType": "
|
|
816
|
+
"minProperties": { "dataType": "double" },
|
|
655
817
|
"required": { "ref": "StringArray1" },
|
|
656
818
|
"additionalProperties": { "ref": "CoreSchemaMetaSchema5" },
|
|
657
819
|
"definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } },
|
|
@@ -659,8 +821,8 @@ var models = {
|
|
|
659
821
|
"patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } },
|
|
660
822
|
"dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "StringArray1" }] } },
|
|
661
823
|
"propertyNames": { "ref": "CoreSchemaMetaSchema5" },
|
|
662
|
-
"const": { "dataType": "
|
|
663
|
-
"enum": { "dataType": "array", "array": { "dataType": "
|
|
824
|
+
"const": { "dataType": "any" },
|
|
825
|
+
"enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } },
|
|
664
826
|
"type": { "dataType": "union", "subSchemas": [{ "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] }, { "dataType": "array", "array": { "dataType": "union", "subSchemas": [{ "dataType": "enum", "enums": ["array"] }, { "dataType": "enum", "enums": ["boolean"] }, { "dataType": "enum", "enums": ["integer"] }, { "dataType": "enum", "enums": ["null"] }, { "dataType": "enum", "enums": ["number"] }, { "dataType": "enum", "enums": ["object"] }, { "dataType": "enum", "enums": ["string"] }] } }] },
|
|
665
827
|
"format": { "dataType": "string" },
|
|
666
828
|
"contentMediaType": { "dataType": "string" },
|
|
@@ -852,7 +1014,8 @@ var models = {
|
|
|
852
1014
|
"staticFiles": { "dataType": "nestedObjectLiteral", "nestedProperties": { "locationRoot": { "dataType": "string", "required": true } }, "additionalProperties": { "dataType": "any" } },
|
|
853
1015
|
"functions": { "dataType": "array", "array": { "dataType": "refObject", "ref": "ComponentFunction" }, "required": true, "validators": { "minItems": { "value": 0 } } },
|
|
854
1016
|
"previews": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "PreviewDefinition" } },
|
|
855
|
-
"mockedUris": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "path": { "dataType": "string", "required": true }, "type": { "dataType": "enum", "enums": ["file"], "required": true } }, "additionalProperties": { "dataType": "any" } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "value": { "ref": "MatrixAssetSchema", "required": true }, "type": { "dataType": "enum", "enums": ["inline"], "required": true } }, "additionalProperties": { "dataType": "any" } }] } }
|
|
1017
|
+
"mockedUris": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "path": { "dataType": "string", "required": true }, "type": { "dataType": "enum", "enums": ["file"], "required": true } }, "additionalProperties": { "dataType": "any" } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "value": { "ref": "MatrixAssetSchema", "required": true }, "type": { "dataType": "enum", "enums": ["inline"], "required": true } }, "additionalProperties": { "dataType": "any" } }] } },
|
|
1018
|
+
"ui:metadata": { "dataType": "nestedObjectLiteral", "nestedProperties": { "autoReload": { "dataType": "intersection", "subSchemas": [{ "dataType": "boolean" }, { "dataType": "string" }], "required": true } }, "additionalProperties": { "dataType": "any" } }
|
|
856
1019
|
},
|
|
857
1020
|
"additionalProperties": false
|
|
858
1021
|
},
|
|
@@ -868,12 +1031,12 @@ var models = {
|
|
|
868
1031
|
}
|
|
869
1032
|
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
|
|
870
1033
|
};
|
|
871
|
-
var validationService = new
|
|
1034
|
+
var validationService = new import_runtime4.ValidationService(models);
|
|
872
1035
|
function RegisterRoutes(app) {
|
|
873
1036
|
app.get(
|
|
874
1037
|
"/schemas/:version.json",
|
|
875
|
-
...(0,
|
|
876
|
-
...(0,
|
|
1038
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController),
|
|
1039
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController.prototype.getSchemaVersion),
|
|
877
1040
|
async function CoreController_getSchemaVersion(request, response, next) {
|
|
878
1041
|
const args = {
|
|
879
1042
|
version: { "in": "path", "name": "version", "required": true, "dataType": "string" }
|
|
@@ -895,8 +1058,8 @@ function RegisterRoutes(app) {
|
|
|
895
1058
|
);
|
|
896
1059
|
app.get(
|
|
897
1060
|
"/",
|
|
898
|
-
...(0,
|
|
899
|
-
...(0,
|
|
1061
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController),
|
|
1062
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController.prototype.getComponents),
|
|
900
1063
|
async function CoreController_getComponents(request, response, next) {
|
|
901
1064
|
const args = {
|
|
902
1065
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" }
|
|
@@ -918,8 +1081,8 @@ function RegisterRoutes(app) {
|
|
|
918
1081
|
);
|
|
919
1082
|
app.get(
|
|
920
1083
|
"/dev/all",
|
|
921
|
-
...(0,
|
|
922
|
-
...(0,
|
|
1084
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1085
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getComponents),
|
|
923
1086
|
async function DevelopmentController_getComponents(request, response, next) {
|
|
924
1087
|
const args = {};
|
|
925
1088
|
let validatedArgs = [];
|
|
@@ -939,8 +1102,8 @@ function RegisterRoutes(app) {
|
|
|
939
1102
|
);
|
|
940
1103
|
app.get(
|
|
941
1104
|
"/dev/manifest/:componentId",
|
|
942
|
-
...(0,
|
|
943
|
-
...(0,
|
|
1105
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1106
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.Manifest),
|
|
944
1107
|
async function DevelopmentController_Manifest(request, response, next) {
|
|
945
1108
|
const args = {
|
|
946
1109
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" }
|
|
@@ -962,8 +1125,8 @@ function RegisterRoutes(app) {
|
|
|
962
1125
|
);
|
|
963
1126
|
app.get(
|
|
964
1127
|
"/dev/schemas/:componentId",
|
|
965
|
-
...(0,
|
|
966
|
-
...(0,
|
|
1128
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1129
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getContentSchema),
|
|
967
1130
|
async function DevelopmentController_getContentSchema(request, response, next) {
|
|
968
1131
|
const args = {
|
|
969
1132
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" }
|
|
@@ -985,8 +1148,8 @@ function RegisterRoutes(app) {
|
|
|
985
1148
|
);
|
|
986
1149
|
app.get(
|
|
987
1150
|
"/dev/temp-preview/:componentId/:functionName",
|
|
988
|
-
...(0,
|
|
989
|
-
...(0,
|
|
1151
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1152
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.TemporaryPreview),
|
|
990
1153
|
async function DevelopmentController_TemporaryPreview(request, response, next) {
|
|
991
1154
|
const args = {
|
|
992
1155
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
@@ -994,7 +1157,9 @@ function RegisterRoutes(app) {
|
|
|
994
1157
|
functionName: { "in": "path", "name": "functionName", "required": true, "dataType": "string" },
|
|
995
1158
|
headers: { "in": "query", "name": "headers", "dataType": "any" },
|
|
996
1159
|
envVars: { "in": "query", "name": "envVars", "dataType": "any" },
|
|
997
|
-
data: { "in": "query", "name": "data", "dataType": "any" }
|
|
1160
|
+
data: { "in": "query", "name": "data", "dataType": "any" },
|
|
1161
|
+
contextMatrixAssetId: { "in": "query", "name": "contextMatrixAssetId", "dataType": "string" },
|
|
1162
|
+
contextMatrixUrl: { "in": "query", "name": "contextMatrixUrl", "dataType": "string" }
|
|
998
1163
|
};
|
|
999
1164
|
let validatedArgs = [];
|
|
1000
1165
|
try {
|
|
@@ -1013,14 +1178,16 @@ function RegisterRoutes(app) {
|
|
|
1013
1178
|
);
|
|
1014
1179
|
app.get(
|
|
1015
1180
|
"/dev/render/:componentId",
|
|
1016
|
-
...(0,
|
|
1017
|
-
...(0,
|
|
1181
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1182
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getDefaultFunctionRendering),
|
|
1018
1183
|
async function DevelopmentController_getDefaultFunctionRendering(request, response, next) {
|
|
1019
1184
|
const args = {
|
|
1020
1185
|
expressRequest: { "in": "request", "name": "expressRequest", "required": true, "dataType": "object" },
|
|
1021
1186
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" },
|
|
1022
1187
|
componentSet: { "in": "query", "name": "_componentSet", "dataType": "string" },
|
|
1023
|
-
previewKey: { "in": "query", "name": "_previewKey", "dataType": "string" }
|
|
1188
|
+
previewKey: { "in": "query", "name": "_previewKey", "dataType": "string" },
|
|
1189
|
+
contextMatrixAssetId: { "in": "query", "name": "contextMatrixAssetId", "dataType": "string" },
|
|
1190
|
+
contextMatrixUrl: { "in": "query", "name": "contextMatrixUrl", "dataType": "string" }
|
|
1024
1191
|
};
|
|
1025
1192
|
let validatedArgs = [];
|
|
1026
1193
|
try {
|
|
@@ -1039,15 +1206,17 @@ function RegisterRoutes(app) {
|
|
|
1039
1206
|
);
|
|
1040
1207
|
app.get(
|
|
1041
1208
|
"/dev/render/:componentId/:functionName",
|
|
1042
|
-
...(0,
|
|
1043
|
-
...(0,
|
|
1209
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1210
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getGivenFunctionRendering),
|
|
1044
1211
|
async function DevelopmentController_getGivenFunctionRendering(request, response, next) {
|
|
1045
1212
|
const args = {
|
|
1046
1213
|
expressRequest: { "in": "request", "name": "expressRequest", "required": true, "dataType": "object" },
|
|
1047
1214
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" },
|
|
1048
1215
|
functionName: { "in": "path", "name": "functionName", "required": true, "dataType": "string" },
|
|
1049
1216
|
componentSet: { "in": "query", "name": "_componentSet", "dataType": "string" },
|
|
1050
|
-
previewKey: { "in": "query", "name": "_previewKey", "dataType": "string" }
|
|
1217
|
+
previewKey: { "in": "query", "name": "_previewKey", "dataType": "string" },
|
|
1218
|
+
contextMatrixAssetId: { "in": "query", "name": "contextMatrixAssetId", "dataType": "string" },
|
|
1219
|
+
contextMatrixUrl: { "in": "query", "name": "contextMatrixUrl", "dataType": "string" }
|
|
1051
1220
|
};
|
|
1052
1221
|
let validatedArgs = [];
|
|
1053
1222
|
try {
|
|
@@ -1064,6 +1233,35 @@ function RegisterRoutes(app) {
|
|
|
1064
1233
|
}
|
|
1065
1234
|
}
|
|
1066
1235
|
);
|
|
1236
|
+
app.get(
|
|
1237
|
+
"/s/:namespace/:componentName/:version/:staticFile*",
|
|
1238
|
+
...(0, import_runtime4.fetchMiddlewares)(StaticController),
|
|
1239
|
+
...(0, import_runtime4.fetchMiddlewares)(StaticController.prototype.getPreview),
|
|
1240
|
+
async function StaticController_getPreview(request, response, next) {
|
|
1241
|
+
const args = {
|
|
1242
|
+
namespace: { "in": "path", "name": "namespace", "required": true, "dataType": "string" },
|
|
1243
|
+
componentName: { "in": "path", "name": "componentName", "required": true, "dataType": "string" },
|
|
1244
|
+
version: { "in": "path", "name": "version", "required": true, "dataType": "string" },
|
|
1245
|
+
staticFile: { "in": "path", "name": "staticFile", "required": true, "dataType": "string" },
|
|
1246
|
+
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
1247
|
+
_componentSet: { "in": "query", "name": "_componentSet", "dataType": "string" },
|
|
1248
|
+
_previewKey: { "in": "query", "name": "_previewKey", "dataType": "string" }
|
|
1249
|
+
};
|
|
1250
|
+
let validatedArgs = [];
|
|
1251
|
+
try {
|
|
1252
|
+
validatedArgs = getValidatedArgs(args, request, response);
|
|
1253
|
+
const container = typeof iocContainer === "function" ? iocContainer(request) : iocContainer;
|
|
1254
|
+
const controller = await container.get(StaticController);
|
|
1255
|
+
if (typeof controller["setStatus"] === "function") {
|
|
1256
|
+
controller.setStatus(void 0);
|
|
1257
|
+
}
|
|
1258
|
+
const promise = controller.getPreview.apply(controller, validatedArgs);
|
|
1259
|
+
promiseHandler(controller, promise, response, void 0, next);
|
|
1260
|
+
} catch (err) {
|
|
1261
|
+
return next(err);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1067
1265
|
function isController(object) {
|
|
1068
1266
|
return "getHeaders" in object && "getStatus" in object && "setStatus" in object;
|
|
1069
1267
|
}
|
|
@@ -1132,14 +1330,14 @@ function RegisterRoutes(app) {
|
|
|
1132
1330
|
}
|
|
1133
1331
|
});
|
|
1134
1332
|
if (Object.keys(fieldErrors).length > 0) {
|
|
1135
|
-
throw new
|
|
1333
|
+
throw new import_runtime4.ValidateError(fieldErrors, "");
|
|
1136
1334
|
}
|
|
1137
1335
|
return values;
|
|
1138
1336
|
}
|
|
1139
1337
|
}
|
|
1140
1338
|
|
|
1141
1339
|
// src/webserver/app.ts
|
|
1142
|
-
var
|
|
1340
|
+
var import_path2 = __toESM(require("path"));
|
|
1143
1341
|
var import_swagger_ui_express = __toESM(require("swagger-ui-express"));
|
|
1144
1342
|
function setupApp(services, config = {}) {
|
|
1145
1343
|
initIocContainer(services, config);
|
|
@@ -1182,7 +1380,7 @@ function setupApp(services, config = {}) {
|
|
|
1182
1380
|
app.use((req, res, next) => {
|
|
1183
1381
|
req.accepts("json");
|
|
1184
1382
|
if (["POST", "PUT", "PATCH"].includes(req.method) && req.header("content-type") !== "application/json") {
|
|
1185
|
-
next(new
|
|
1383
|
+
next(new import_dx_common_lib4.BadRequestError("content-type must be application/json"));
|
|
1186
1384
|
return;
|
|
1187
1385
|
}
|
|
1188
1386
|
const id = (0, import_crypto.randomUUID)();
|
|
@@ -1190,7 +1388,7 @@ function setupApp(services, config = {}) {
|
|
|
1190
1388
|
req.id = id;
|
|
1191
1389
|
next();
|
|
1192
1390
|
});
|
|
1193
|
-
const docsJsonFile =
|
|
1391
|
+
const docsJsonFile = import_path2.default.join(__dirname, "public", "docs.json");
|
|
1194
1392
|
app.use("/docs.json", import_express.default.static(docsJsonFile));
|
|
1195
1393
|
app.use("/docs", import_swagger_ui_express.default.serve);
|
|
1196
1394
|
app.get(
|
|
@@ -1203,7 +1401,7 @@ function setupApp(services, config = {}) {
|
|
|
1203
1401
|
})
|
|
1204
1402
|
);
|
|
1205
1403
|
RegisterRoutes(app);
|
|
1206
|
-
app.use(
|
|
1404
|
+
app.use(import_dx_common_lib4.errorMiddleware);
|
|
1207
1405
|
return app;
|
|
1208
1406
|
}
|
|
1209
1407
|
|
|
@@ -1236,7 +1434,7 @@ var import_node_vm = __toESM(require("node:vm"));
|
|
|
1236
1434
|
var import_os = require("os");
|
|
1237
1435
|
var import_module = require("module");
|
|
1238
1436
|
var DevelopmentComponentRunnerService = class {
|
|
1239
|
-
async executeEdgeComponentFunction(task) {
|
|
1437
|
+
async executeEdgeComponentFunction(task, contextAwareness) {
|
|
1240
1438
|
const webRequestEvents = await this.setUpWebRequestEventForResolveUri(task);
|
|
1241
1439
|
const builtComponent = await esbuild.build({
|
|
1242
1440
|
entryPoints: [task.functionEntryFilePath],
|
|
@@ -1254,7 +1452,7 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1254
1452
|
}
|
|
1255
1453
|
throw new Error("Failed to build component");
|
|
1256
1454
|
}
|
|
1257
|
-
const componentContext = this.getComponentContext(task, webRequestEvents);
|
|
1455
|
+
const componentContext = this.getComponentContext(task, webRequestEvents, contextAwareness);
|
|
1258
1456
|
const vmContext = import_node_vm.default.createContext({
|
|
1259
1457
|
...globalThis,
|
|
1260
1458
|
module: {},
|
|
@@ -1323,7 +1521,7 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1323
1521
|
console.error("Error during esbuild transformation:", error);
|
|
1324
1522
|
}
|
|
1325
1523
|
}
|
|
1326
|
-
getComponentContext(task, webRequestEvents) {
|
|
1524
|
+
getComponentContext(task, webRequestEvents, contextAwareness) {
|
|
1327
1525
|
const ctxInput = {
|
|
1328
1526
|
componentName: task.componentFullName,
|
|
1329
1527
|
manifest: task.manifest,
|
|
@@ -1343,7 +1541,71 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1343
1541
|
previewKey: task.previewKey,
|
|
1344
1542
|
queryParameters: task.queryParameters,
|
|
1345
1543
|
ctx: (0, import_component_lib3.createComponentContextualFunctions)(ctxInput),
|
|
1346
|
-
fns:
|
|
1544
|
+
fns: {
|
|
1545
|
+
...(0, import_component_lib3.createComponentContextualFunctions)(ctxInput),
|
|
1546
|
+
resolveMatrixAssetById: function(assetId, attributes) {
|
|
1547
|
+
const mockAsset = {
|
|
1548
|
+
id: contextAwareness?.matrixAssetId ?? assetId,
|
|
1549
|
+
type: "page",
|
|
1550
|
+
type_name: "page",
|
|
1551
|
+
version: "1.0.0",
|
|
1552
|
+
name: "Mock Asset",
|
|
1553
|
+
short_name: "page",
|
|
1554
|
+
status: {
|
|
1555
|
+
code: "archived",
|
|
1556
|
+
id: 1
|
|
1557
|
+
},
|
|
1558
|
+
created: {
|
|
1559
|
+
user_id: "123",
|
|
1560
|
+
date: "2019-08-24T14:15:22Z"
|
|
1561
|
+
},
|
|
1562
|
+
updated: {
|
|
1563
|
+
user_id: "123",
|
|
1564
|
+
date: "2019-08-24T14:15:22Z"
|
|
1565
|
+
},
|
|
1566
|
+
published: {
|
|
1567
|
+
user_id: "123",
|
|
1568
|
+
date: "2019-08-24T14:15:22Z"
|
|
1569
|
+
},
|
|
1570
|
+
url: "",
|
|
1571
|
+
urls: [],
|
|
1572
|
+
attributes,
|
|
1573
|
+
additional: []
|
|
1574
|
+
};
|
|
1575
|
+
return mockAsset;
|
|
1576
|
+
},
|
|
1577
|
+
resolveMatrixAssetByUrl: function(url, attributes) {
|
|
1578
|
+
const mockAsset = {
|
|
1579
|
+
id: contextAwareness?.matrixUrl ?? url,
|
|
1580
|
+
type: "page",
|
|
1581
|
+
type_name: "page",
|
|
1582
|
+
version: "1.0.0",
|
|
1583
|
+
name: "Mock Asset",
|
|
1584
|
+
short_name: "page",
|
|
1585
|
+
status: {
|
|
1586
|
+
code: "archived",
|
|
1587
|
+
id: 1
|
|
1588
|
+
},
|
|
1589
|
+
created: {
|
|
1590
|
+
user_id: "123",
|
|
1591
|
+
date: "2019-08-24T14:15:22Z"
|
|
1592
|
+
},
|
|
1593
|
+
updated: {
|
|
1594
|
+
user_id: "123",
|
|
1595
|
+
date: "2019-08-24T14:15:22Z"
|
|
1596
|
+
},
|
|
1597
|
+
published: {
|
|
1598
|
+
user_id: "123",
|
|
1599
|
+
date: "2019-08-24T14:15:22Z"
|
|
1600
|
+
},
|
|
1601
|
+
url,
|
|
1602
|
+
urls: [],
|
|
1603
|
+
attributes,
|
|
1604
|
+
additional: {}
|
|
1605
|
+
};
|
|
1606
|
+
return mockAsset;
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1347
1609
|
env: task.runtimeSet.environment
|
|
1348
1610
|
};
|
|
1349
1611
|
return componentContext;
|
|
@@ -1356,7 +1618,7 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1356
1618
|
};
|
|
1357
1619
|
|
|
1358
1620
|
// src/PreviewComponentService.ts
|
|
1359
|
-
var
|
|
1621
|
+
var import_path3 = __toESM(require("path"));
|
|
1360
1622
|
var import_promises = __toESM(require("fs/promises"));
|
|
1361
1623
|
var import_fs_extra = require("fs-extra");
|
|
1362
1624
|
|
|
@@ -1421,7 +1683,7 @@ function cssIncludeTagHtml(file) {
|
|
|
1421
1683
|
}
|
|
1422
1684
|
|
|
1423
1685
|
// src/PreviewComponentService.ts
|
|
1424
|
-
var
|
|
1686
|
+
var import_dx_common_lib5 = require("@squiz/dx-common-lib");
|
|
1425
1687
|
var PREVIEW_COMPONENT_SET = "unknown";
|
|
1426
1688
|
var ComponentPreviewService = class {
|
|
1427
1689
|
async dressRenderedOutputForPreview(componentManifest, functionDefinition, previewKey, componentOutput) {
|
|
@@ -1439,9 +1701,9 @@ var ComponentPreviewService = class {
|
|
|
1439
1701
|
return body;
|
|
1440
1702
|
}
|
|
1441
1703
|
async embedComponentIntoWrapper(componentDirectory, wrapper, functionDefinition, componentOutput) {
|
|
1442
|
-
const wrapperFilePath =
|
|
1704
|
+
const wrapperFilePath = import_path3.default.resolve(componentDirectory, wrapper.path);
|
|
1443
1705
|
if (await (0, import_fs_extra.pathExists)(wrapperFilePath) === false) {
|
|
1444
|
-
throw new
|
|
1706
|
+
throw new import_dx_common_lib5.BadRequestError(`Preview wrapper file "${wrapper.path}" does not exist`);
|
|
1445
1707
|
}
|
|
1446
1708
|
const wrapperContent = await import_promises.default.readFile(wrapperFilePath, {
|
|
1447
1709
|
encoding: "utf-8"
|
|
@@ -1457,14 +1719,14 @@ var ComponentPreviewService = class {
|
|
|
1457
1719
|
case "json":
|
|
1458
1720
|
return componentOutput;
|
|
1459
1721
|
default:
|
|
1460
|
-
return (0,
|
|
1722
|
+
return (0, import_dx_common_lib5.never)(type);
|
|
1461
1723
|
}
|
|
1462
1724
|
}
|
|
1463
1725
|
};
|
|
1464
1726
|
|
|
1465
1727
|
// src/RenderInputService.ts
|
|
1466
1728
|
var import_strict = __toESM(require("assert/strict"));
|
|
1467
|
-
var
|
|
1729
|
+
var import_dx_common_lib6 = require("@squiz/dx-common-lib");
|
|
1468
1730
|
var PREVIEW_COMPONENT_SET2 = "unknown";
|
|
1469
1731
|
var RenderInputService = class {
|
|
1470
1732
|
constructor(componentSetService, manifestService, componentFunctionService, rootUrlResolver) {
|
|
@@ -1493,7 +1755,7 @@ var RenderInputService = class {
|
|
|
1493
1755
|
let webManifest;
|
|
1494
1756
|
let input = {};
|
|
1495
1757
|
if (request.previewKey && request.componentSet) {
|
|
1496
|
-
throw new
|
|
1758
|
+
throw new import_dx_common_lib6.BadRequestError("You cannot provide a previewKey and a componentSet as input");
|
|
1497
1759
|
}
|
|
1498
1760
|
if (request.previewKey) {
|
|
1499
1761
|
input = await this.getInputForPreview(request, manifest);
|
|
@@ -1508,7 +1770,7 @@ var RenderInputService = class {
|
|
|
1508
1770
|
}
|
|
1509
1771
|
} else {
|
|
1510
1772
|
if (!request.componentSet) {
|
|
1511
|
-
throw new
|
|
1773
|
+
throw new import_dx_common_lib6.BadRequestError("You must provide either previewKey or a componentSet as input");
|
|
1512
1774
|
}
|
|
1513
1775
|
const set = await this.componentSetService.getComponentSet(request.componentSet);
|
|
1514
1776
|
headers = this.componentSetService.getComponentRuntimeHeaders(set, componentFunction);
|
|
@@ -1543,13 +1805,13 @@ var RenderInputService = class {
|
|
|
1543
1805
|
const queryParameters = {};
|
|
1544
1806
|
for (const parameter of Object.keys(componentFunction.queryParameters)) {
|
|
1545
1807
|
if (componentFunction.queryParameters[parameter].required && request.expressRequest.query[parameter] === void 0) {
|
|
1546
|
-
throw new
|
|
1808
|
+
throw new import_dx_common_lib6.BadRequestError(`Required query parameter '${parameter}' is missing`);
|
|
1547
1809
|
}
|
|
1548
1810
|
if (request.expressRequest.query[parameter] === void 0) {
|
|
1549
1811
|
continue;
|
|
1550
1812
|
}
|
|
1551
1813
|
if (typeof request.expressRequest.query[parameter] !== "string") {
|
|
1552
|
-
throw new
|
|
1814
|
+
throw new import_dx_common_lib6.BadRequestError(`Value for query parameter '${parameter}' must be a string`);
|
|
1553
1815
|
}
|
|
1554
1816
|
queryParameters[parameter] = request.expressRequest.query[parameter];
|
|
1555
1817
|
}
|
|
@@ -1567,7 +1829,7 @@ var RenderInputService = class {
|
|
|
1567
1829
|
this.componentFunctionService.assertInputValidForComponentFunction(input, componentFunction);
|
|
1568
1830
|
} catch (e) {
|
|
1569
1831
|
if (e instanceof Error) {
|
|
1570
|
-
const error = new
|
|
1832
|
+
const error = new import_dx_common_lib6.BadRequestError(e.message);
|
|
1571
1833
|
error.stack = e.stack;
|
|
1572
1834
|
throw error;
|
|
1573
1835
|
}
|
|
@@ -1579,7 +1841,7 @@ var RenderInputService = class {
|
|
|
1579
1841
|
this.componentFunctionService.assertRenderInputValidForComponentFunction(input, componentFunction);
|
|
1580
1842
|
} catch (e) {
|
|
1581
1843
|
if (e instanceof Error) {
|
|
1582
|
-
const error = new
|
|
1844
|
+
const error = new import_dx_common_lib6.BadRequestError(e.message);
|
|
1583
1845
|
error.stack = e.stack;
|
|
1584
1846
|
throw error;
|
|
1585
1847
|
}
|
|
@@ -1632,7 +1894,7 @@ var testComponentLogger = new import_component_logger_lib.ComponentLogger({
|
|
|
1632
1894
|
});
|
|
1633
1895
|
function getTestComponentFolder() {
|
|
1634
1896
|
const rootDir = (0, import_child_process.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).replace(/\n$/, "");
|
|
1635
|
-
return
|
|
1897
|
+
return import_path4.default.resolve(rootDir, "packages/edge-dev-render-runtime-lib/test-components");
|
|
1636
1898
|
}
|
|
1637
1899
|
function setupTestApp(services = {}, config = {}) {
|
|
1638
1900
|
const dataMount = getTestComponentFolder();
|
|
@@ -1704,7 +1966,7 @@ var TestServer = class {
|
|
|
1704
1966
|
|
|
1705
1967
|
// src/test/helpers/fixtures.ts
|
|
1706
1968
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
1707
|
-
var
|
|
1969
|
+
var import_path5 = __toESM(require("path"));
|
|
1708
1970
|
var import_strict2 = __toESM(require("assert/strict"));
|
|
1709
1971
|
var import_crypto3 = require("crypto");
|
|
1710
1972
|
var FIXTURE_NAMESPACE = "some-namespace";
|
|
@@ -1717,7 +1979,7 @@ var ComponentFixture = class {
|
|
|
1717
1979
|
}
|
|
1718
1980
|
static getFixtureRootDirectory() {
|
|
1719
1981
|
if (this.fixtureRootDirectory === void 0) {
|
|
1720
|
-
this.fixtureRootDirectory =
|
|
1982
|
+
this.fixtureRootDirectory = import_path5.default.join(getTestComponentFolder(), "fixtures");
|
|
1721
1983
|
}
|
|
1722
1984
|
return this.fixtureRootDirectory;
|
|
1723
1985
|
}
|
|
@@ -1725,23 +1987,23 @@ var ComponentFixture = class {
|
|
|
1725
1987
|
const fixtureDirectory = await this.createFixtureDirectory();
|
|
1726
1988
|
const { directory: componentDirectory, version } = await this.createVersionDirectory(fixtureDirectory);
|
|
1727
1989
|
const manifest = await this.createManifest(componentDirectory, { version, staticFilesRoot: "static" });
|
|
1728
|
-
await import_promises2.default.writeFile(
|
|
1729
|
-
await import_promises2.default.mkdir(
|
|
1730
|
-
await import_promises2.default.writeFile(
|
|
1731
|
-
return { fixtureDirectory, componentDirectory, version, manifest, componentName:
|
|
1990
|
+
await import_promises2.default.writeFile(import_path5.default.join(componentDirectory, "main.js"), jsFileData(returnObj, { raw }));
|
|
1991
|
+
await import_promises2.default.mkdir(import_path5.default.join(componentDirectory, "static"));
|
|
1992
|
+
await import_promises2.default.writeFile(import_path5.default.join(componentDirectory, "static", "static.txt"), "hello");
|
|
1993
|
+
return { fixtureDirectory, componentDirectory, version, manifest, componentName: import_path5.default.basename(fixtureDirectory) };
|
|
1732
1994
|
}
|
|
1733
1995
|
static async new(returnObj, { raw = false, environment = [], set = getTestSet() } = {}) {
|
|
1734
1996
|
const fixtureDirectory = await this.createFixtureDirectory();
|
|
1735
|
-
const componentPath =
|
|
1997
|
+
const componentPath = import_path5.default.join(fixtureDirectory, "main.js");
|
|
1736
1998
|
const data = jsFileData(returnObj, { raw });
|
|
1737
1999
|
await import_promises2.default.writeFile(componentPath, data);
|
|
1738
2000
|
return {
|
|
1739
|
-
requestId:
|
|
2001
|
+
requestId: import_path5.default.basename(fixtureDirectory),
|
|
1740
2002
|
functionEntryFilePath: componentPath,
|
|
1741
2003
|
args: [{}],
|
|
1742
2004
|
environment: set.environment,
|
|
1743
2005
|
manifest: {
|
|
1744
|
-
name:
|
|
2006
|
+
name: import_path5.default.basename(fixtureDirectory),
|
|
1745
2007
|
namespace: this.namespace,
|
|
1746
2008
|
displayName: "some-display-name",
|
|
1747
2009
|
description: "some-description",
|
|
@@ -1760,7 +2022,7 @@ var ComponentFixture = class {
|
|
|
1760
2022
|
}
|
|
1761
2023
|
]
|
|
1762
2024
|
},
|
|
1763
|
-
componentFullName:
|
|
2025
|
+
componentFullName: import_path5.default.basename(fixtureDirectory),
|
|
1764
2026
|
runtimeSet: set,
|
|
1765
2027
|
componentRootUrl: "http://localhost:3000",
|
|
1766
2028
|
previewKey: void 0,
|
|
@@ -1781,18 +2043,18 @@ var ComponentFixture = class {
|
|
|
1781
2043
|
}
|
|
1782
2044
|
static async createFixtureDirectory() {
|
|
1783
2045
|
const fixtureName = generateRandomName();
|
|
1784
|
-
const fixturePath =
|
|
2046
|
+
const fixturePath = import_path5.default.join(this.getFixtureRootDirectory(), fixtureName);
|
|
1785
2047
|
await import_promises2.default.mkdir(fixturePath, { recursive: true });
|
|
1786
2048
|
return fixturePath;
|
|
1787
2049
|
}
|
|
1788
2050
|
static async createVersionDirectory(fixtureDirectory) {
|
|
1789
2051
|
const version = "1.0.1";
|
|
1790
|
-
const directory =
|
|
2052
|
+
const directory = import_path5.default.join(fixtureDirectory, version);
|
|
1791
2053
|
await import_promises2.default.mkdir(directory);
|
|
1792
2054
|
return { directory, version };
|
|
1793
2055
|
}
|
|
1794
2056
|
static async createManifest(componentDirectory, options = {}) {
|
|
1795
|
-
const name =
|
|
2057
|
+
const name = import_path5.default.basename(componentDirectory) === options.version ? import_path5.default.basename(import_path5.default.dirname(componentDirectory)) : import_path5.default.basename(componentDirectory);
|
|
1796
2058
|
const manifest = {
|
|
1797
2059
|
$schema: "http://localhost:3000/schemas/v1.json#",
|
|
1798
2060
|
name,
|
|
@@ -1817,7 +2079,7 @@ var ComponentFixture = class {
|
|
|
1817
2079
|
locationRoot: options.staticFilesRoot
|
|
1818
2080
|
};
|
|
1819
2081
|
}
|
|
1820
|
-
await import_promises2.default.writeFile(
|
|
2082
|
+
await import_promises2.default.writeFile(import_path5.default.join(componentDirectory, "manifest.json"), JSON.stringify(manifest));
|
|
1821
2083
|
return manifest;
|
|
1822
2084
|
}
|
|
1823
2085
|
};
|