@squiz/edge-dev-render-runtime-lib 2.4.1 → 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/index.js +246 -82
- package/lib/index.js.map +4 -4
- package/lib/public/docs.json +102 -233
- 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],
|
|
@@ -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,7 +261,7 @@ 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 = {
|
|
@@ -277,10 +278,12 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
277
278
|
responseHeaders["content-type"] = "application/json";
|
|
278
279
|
break;
|
|
279
280
|
}
|
|
280
|
-
const defaultPreviewKey = Object.keys(componentManifest.getModel()?.previews ?? {}).at(0) ?? void 0;
|
|
281
281
|
if (defaultPreviewKey) {
|
|
282
282
|
result = await this.componentPreviewService.dressRenderedOutputForPreview(
|
|
283
|
-
|
|
283
|
+
new import_component_lib.ManifestV1(
|
|
284
|
+
this.componentFunctionService.prepareManifestForPreview(componentManifest, defaultPreviewKey, rootUrl),
|
|
285
|
+
await componentManifest.getManifestPath()
|
|
286
|
+
),
|
|
284
287
|
componentFunction,
|
|
285
288
|
defaultPreviewKey,
|
|
286
289
|
result
|
|
@@ -303,10 +306,10 @@ var DevelopmentController = class extends import_tsoa3.Controller {
|
|
|
303
306
|
async getGivenFunctionRendering(expressRequest, componentId, functionName, componentSet, previewKey, contextMatrixAssetId, contextMatrixUrl) {
|
|
304
307
|
const response = expressRequest.res;
|
|
305
308
|
(0, import_dx_common_lib2.assertIsDefined)(response);
|
|
306
|
-
const { path:
|
|
307
|
-
if (UPPERCASE_REGEX.test(
|
|
309
|
+
const { path: path7, query } = expressRequest;
|
|
310
|
+
if (UPPERCASE_REGEX.test(path7) || componentSet && UPPERCASE_REGEX.test(componentSet)) {
|
|
308
311
|
const url = (0, import_query_string.stringifyUrl)({
|
|
309
|
-
url:
|
|
312
|
+
url: path7.toLowerCase(),
|
|
310
313
|
query: {
|
|
311
314
|
...query,
|
|
312
315
|
_componentSet: componentSet?.toLowerCase()
|
|
@@ -449,14 +452,146 @@ DevelopmentController = __decorateClass([
|
|
|
449
452
|
__decorateParam(5, (0, import_inversify2.inject)("ComponentFunctionService"))
|
|
450
453
|
], DevelopmentController);
|
|
451
454
|
|
|
452
|
-
// src/
|
|
453
|
-
var
|
|
455
|
+
// src/webserver/controllers/StaticController.ts
|
|
456
|
+
var import_tsoa4 = require("tsoa");
|
|
454
457
|
var import_inversify_binding_decorators3 = require("inversify-binding-decorators");
|
|
455
|
-
|
|
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);
|
|
456
591
|
var iocContainer;
|
|
457
592
|
var initIocContainer = (services, config) => {
|
|
458
|
-
const container = new
|
|
459
|
-
container.load((0,
|
|
593
|
+
const container = new import_inversify4.Container({ skipBaseClassChecks: true });
|
|
594
|
+
container.load((0, import_inversify_binding_decorators4.buildProviderModule)());
|
|
460
595
|
container.bind("Config").toConstantValue(config);
|
|
461
596
|
container.bind("Logger").toConstantValue(services.logger);
|
|
462
597
|
container.bind("ComponentFunctionService").toConstantValue(services.componentFunctionService);
|
|
@@ -506,7 +641,7 @@ var models = {
|
|
|
506
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
|
|
507
642
|
"CoreSchemaMetaSchema2": {
|
|
508
643
|
"dataType": "refAlias",
|
|
509
|
-
"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": {} }
|
|
510
645
|
},
|
|
511
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
|
|
512
647
|
"SchemaArray": {
|
|
@@ -529,26 +664,26 @@ var models = {
|
|
|
529
664
|
"$comment": { "dataType": "string" },
|
|
530
665
|
"title": { "dataType": "string" },
|
|
531
666
|
"description": { "dataType": "string" },
|
|
532
|
-
"default": { "dataType": "
|
|
667
|
+
"default": { "dataType": "any" },
|
|
533
668
|
"readOnly": { "dataType": "boolean" },
|
|
534
669
|
"writeOnly": { "dataType": "boolean" },
|
|
535
|
-
"examples": { "dataType": "array", "array": { "dataType": "
|
|
670
|
+
"examples": { "dataType": "array", "array": { "dataType": "any" } },
|
|
536
671
|
"multipleOf": { "dataType": "double" },
|
|
537
672
|
"maximum": { "dataType": "double" },
|
|
538
673
|
"exclusiveMaximum": { "dataType": "double" },
|
|
539
674
|
"minimum": { "dataType": "double" },
|
|
540
675
|
"exclusiveMinimum": { "dataType": "double" },
|
|
541
676
|
"maxLength": { "dataType": "double" },
|
|
542
|
-
"minLength": { "dataType": "
|
|
677
|
+
"minLength": { "dataType": "double" },
|
|
543
678
|
"pattern": { "dataType": "string" },
|
|
544
679
|
"additionalItems": { "ref": "CoreSchemaMetaSchema2" },
|
|
545
680
|
"items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "SchemaArray" }] },
|
|
546
681
|
"maxItems": { "dataType": "double" },
|
|
547
|
-
"minItems": { "dataType": "
|
|
682
|
+
"minItems": { "dataType": "double" },
|
|
548
683
|
"uniqueItems": { "dataType": "boolean" },
|
|
549
684
|
"contains": { "ref": "CoreSchemaMetaSchema2" },
|
|
550
685
|
"maxProperties": { "dataType": "double" },
|
|
551
|
-
"minProperties": { "dataType": "
|
|
686
|
+
"minProperties": { "dataType": "double" },
|
|
552
687
|
"required": { "ref": "StringArray" },
|
|
553
688
|
"additionalProperties": { "ref": "CoreSchemaMetaSchema2" },
|
|
554
689
|
"definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } },
|
|
@@ -556,8 +691,8 @@ var models = {
|
|
|
556
691
|
"patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema2" } },
|
|
557
692
|
"dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "StringArray" }] } },
|
|
558
693
|
"propertyNames": { "ref": "CoreSchemaMetaSchema2" },
|
|
559
|
-
"const": { "dataType": "
|
|
560
|
-
"enum": { "dataType": "array", "array": { "dataType": "
|
|
694
|
+
"const": { "dataType": "any" },
|
|
695
|
+
"enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } },
|
|
561
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"] }] } }] },
|
|
562
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"] }] },
|
|
563
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"] }] } },
|
|
@@ -637,7 +772,7 @@ var models = {
|
|
|
637
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
|
|
638
773
|
"CoreSchemaMetaSchema5": {
|
|
639
774
|
"dataType": "refAlias",
|
|
640
|
-
"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": {} }
|
|
641
776
|
},
|
|
642
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
|
|
643
778
|
"SchemaArray1": {
|
|
@@ -659,26 +794,26 @@ var models = {
|
|
|
659
794
|
"$comment": { "dataType": "string" },
|
|
660
795
|
"title": { "dataType": "string" },
|
|
661
796
|
"description": { "dataType": "string" },
|
|
662
|
-
"default": { "dataType": "
|
|
797
|
+
"default": { "dataType": "any" },
|
|
663
798
|
"readOnly": { "dataType": "boolean" },
|
|
664
799
|
"writeOnly": { "dataType": "boolean" },
|
|
665
|
-
"examples": { "dataType": "array", "array": { "dataType": "
|
|
800
|
+
"examples": { "dataType": "array", "array": { "dataType": "any" } },
|
|
666
801
|
"multipleOf": { "dataType": "double" },
|
|
667
802
|
"maximum": { "dataType": "double" },
|
|
668
803
|
"exclusiveMaximum": { "dataType": "double" },
|
|
669
804
|
"minimum": { "dataType": "double" },
|
|
670
805
|
"exclusiveMinimum": { "dataType": "double" },
|
|
671
806
|
"maxLength": { "dataType": "double" },
|
|
672
|
-
"minLength": { "dataType": "
|
|
807
|
+
"minLength": { "dataType": "double" },
|
|
673
808
|
"pattern": { "dataType": "string" },
|
|
674
809
|
"additionalItems": { "ref": "CoreSchemaMetaSchema5" },
|
|
675
810
|
"items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "SchemaArray1" }] },
|
|
676
811
|
"maxItems": { "dataType": "double" },
|
|
677
|
-
"minItems": { "dataType": "
|
|
812
|
+
"minItems": { "dataType": "double" },
|
|
678
813
|
"uniqueItems": { "dataType": "boolean" },
|
|
679
814
|
"contains": { "ref": "CoreSchemaMetaSchema5" },
|
|
680
815
|
"maxProperties": { "dataType": "double" },
|
|
681
|
-
"minProperties": { "dataType": "
|
|
816
|
+
"minProperties": { "dataType": "double" },
|
|
682
817
|
"required": { "ref": "StringArray1" },
|
|
683
818
|
"additionalProperties": { "ref": "CoreSchemaMetaSchema5" },
|
|
684
819
|
"definitions": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } },
|
|
@@ -686,8 +821,8 @@ var models = {
|
|
|
686
821
|
"patternProperties": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "ref": "CoreSchemaMetaSchema5" } },
|
|
687
822
|
"dependencies": { "dataType": "nestedObjectLiteral", "nestedProperties": {}, "additionalProperties": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema5" }, { "ref": "StringArray1" }] } },
|
|
688
823
|
"propertyNames": { "ref": "CoreSchemaMetaSchema5" },
|
|
689
|
-
"const": { "dataType": "
|
|
690
|
-
"enum": { "dataType": "array", "array": { "dataType": "
|
|
824
|
+
"const": { "dataType": "any" },
|
|
825
|
+
"enum": { "dataType": "array", "array": { "dataType": "any" }, "validators": { "minItems": { "value": 1 } } },
|
|
691
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"] }] } }] },
|
|
692
827
|
"format": { "dataType": "string" },
|
|
693
828
|
"contentMediaType": { "dataType": "string" },
|
|
@@ -896,12 +1031,12 @@ var models = {
|
|
|
896
1031
|
}
|
|
897
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
|
|
898
1033
|
};
|
|
899
|
-
var validationService = new
|
|
1034
|
+
var validationService = new import_runtime4.ValidationService(models);
|
|
900
1035
|
function RegisterRoutes(app) {
|
|
901
1036
|
app.get(
|
|
902
1037
|
"/schemas/:version.json",
|
|
903
|
-
...(0,
|
|
904
|
-
...(0,
|
|
1038
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController),
|
|
1039
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController.prototype.getSchemaVersion),
|
|
905
1040
|
async function CoreController_getSchemaVersion(request, response, next) {
|
|
906
1041
|
const args = {
|
|
907
1042
|
version: { "in": "path", "name": "version", "required": true, "dataType": "string" }
|
|
@@ -923,8 +1058,8 @@ function RegisterRoutes(app) {
|
|
|
923
1058
|
);
|
|
924
1059
|
app.get(
|
|
925
1060
|
"/",
|
|
926
|
-
...(0,
|
|
927
|
-
...(0,
|
|
1061
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController),
|
|
1062
|
+
...(0, import_runtime4.fetchMiddlewares)(CoreController.prototype.getComponents),
|
|
928
1063
|
async function CoreController_getComponents(request, response, next) {
|
|
929
1064
|
const args = {
|
|
930
1065
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" }
|
|
@@ -946,8 +1081,8 @@ function RegisterRoutes(app) {
|
|
|
946
1081
|
);
|
|
947
1082
|
app.get(
|
|
948
1083
|
"/dev/all",
|
|
949
|
-
...(0,
|
|
950
|
-
...(0,
|
|
1084
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1085
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getComponents),
|
|
951
1086
|
async function DevelopmentController_getComponents(request, response, next) {
|
|
952
1087
|
const args = {};
|
|
953
1088
|
let validatedArgs = [];
|
|
@@ -967,8 +1102,8 @@ function RegisterRoutes(app) {
|
|
|
967
1102
|
);
|
|
968
1103
|
app.get(
|
|
969
1104
|
"/dev/manifest/:componentId",
|
|
970
|
-
...(0,
|
|
971
|
-
...(0,
|
|
1105
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1106
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.Manifest),
|
|
972
1107
|
async function DevelopmentController_Manifest(request, response, next) {
|
|
973
1108
|
const args = {
|
|
974
1109
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" }
|
|
@@ -990,8 +1125,8 @@ function RegisterRoutes(app) {
|
|
|
990
1125
|
);
|
|
991
1126
|
app.get(
|
|
992
1127
|
"/dev/schemas/:componentId",
|
|
993
|
-
...(0,
|
|
994
|
-
...(0,
|
|
1128
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1129
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getContentSchema),
|
|
995
1130
|
async function DevelopmentController_getContentSchema(request, response, next) {
|
|
996
1131
|
const args = {
|
|
997
1132
|
componentId: { "in": "path", "name": "componentId", "required": true, "dataType": "string" }
|
|
@@ -1013,8 +1148,8 @@ function RegisterRoutes(app) {
|
|
|
1013
1148
|
);
|
|
1014
1149
|
app.get(
|
|
1015
1150
|
"/dev/temp-preview/:componentId/:functionName",
|
|
1016
|
-
...(0,
|
|
1017
|
-
...(0,
|
|
1151
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1152
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.TemporaryPreview),
|
|
1018
1153
|
async function DevelopmentController_TemporaryPreview(request, response, next) {
|
|
1019
1154
|
const args = {
|
|
1020
1155
|
req: { "in": "request", "name": "req", "required": true, "dataType": "object" },
|
|
@@ -1043,8 +1178,8 @@ function RegisterRoutes(app) {
|
|
|
1043
1178
|
);
|
|
1044
1179
|
app.get(
|
|
1045
1180
|
"/dev/render/:componentId",
|
|
1046
|
-
...(0,
|
|
1047
|
-
...(0,
|
|
1181
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1182
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getDefaultFunctionRendering),
|
|
1048
1183
|
async function DevelopmentController_getDefaultFunctionRendering(request, response, next) {
|
|
1049
1184
|
const args = {
|
|
1050
1185
|
expressRequest: { "in": "request", "name": "expressRequest", "required": true, "dataType": "object" },
|
|
@@ -1071,8 +1206,8 @@ function RegisterRoutes(app) {
|
|
|
1071
1206
|
);
|
|
1072
1207
|
app.get(
|
|
1073
1208
|
"/dev/render/:componentId/:functionName",
|
|
1074
|
-
...(0,
|
|
1075
|
-
...(0,
|
|
1209
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController),
|
|
1210
|
+
...(0, import_runtime4.fetchMiddlewares)(DevelopmentController.prototype.getGivenFunctionRendering),
|
|
1076
1211
|
async function DevelopmentController_getGivenFunctionRendering(request, response, next) {
|
|
1077
1212
|
const args = {
|
|
1078
1213
|
expressRequest: { "in": "request", "name": "expressRequest", "required": true, "dataType": "object" },
|
|
@@ -1098,6 +1233,35 @@ function RegisterRoutes(app) {
|
|
|
1098
1233
|
}
|
|
1099
1234
|
}
|
|
1100
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
|
+
);
|
|
1101
1265
|
function isController(object) {
|
|
1102
1266
|
return "getHeaders" in object && "getStatus" in object && "setStatus" in object;
|
|
1103
1267
|
}
|
|
@@ -1166,14 +1330,14 @@ function RegisterRoutes(app) {
|
|
|
1166
1330
|
}
|
|
1167
1331
|
});
|
|
1168
1332
|
if (Object.keys(fieldErrors).length > 0) {
|
|
1169
|
-
throw new
|
|
1333
|
+
throw new import_runtime4.ValidateError(fieldErrors, "");
|
|
1170
1334
|
}
|
|
1171
1335
|
return values;
|
|
1172
1336
|
}
|
|
1173
1337
|
}
|
|
1174
1338
|
|
|
1175
1339
|
// src/webserver/app.ts
|
|
1176
|
-
var
|
|
1340
|
+
var import_path2 = __toESM(require("path"));
|
|
1177
1341
|
var import_swagger_ui_express = __toESM(require("swagger-ui-express"));
|
|
1178
1342
|
function setupApp(services, config = {}) {
|
|
1179
1343
|
initIocContainer(services, config);
|
|
@@ -1216,7 +1380,7 @@ function setupApp(services, config = {}) {
|
|
|
1216
1380
|
app.use((req, res, next) => {
|
|
1217
1381
|
req.accepts("json");
|
|
1218
1382
|
if (["POST", "PUT", "PATCH"].includes(req.method) && req.header("content-type") !== "application/json") {
|
|
1219
|
-
next(new
|
|
1383
|
+
next(new import_dx_common_lib4.BadRequestError("content-type must be application/json"));
|
|
1220
1384
|
return;
|
|
1221
1385
|
}
|
|
1222
1386
|
const id = (0, import_crypto.randomUUID)();
|
|
@@ -1224,7 +1388,7 @@ function setupApp(services, config = {}) {
|
|
|
1224
1388
|
req.id = id;
|
|
1225
1389
|
next();
|
|
1226
1390
|
});
|
|
1227
|
-
const docsJsonFile =
|
|
1391
|
+
const docsJsonFile = import_path2.default.join(__dirname, "public", "docs.json");
|
|
1228
1392
|
app.use("/docs.json", import_express.default.static(docsJsonFile));
|
|
1229
1393
|
app.use("/docs", import_swagger_ui_express.default.serve);
|
|
1230
1394
|
app.get(
|
|
@@ -1237,7 +1401,7 @@ function setupApp(services, config = {}) {
|
|
|
1237
1401
|
})
|
|
1238
1402
|
);
|
|
1239
1403
|
RegisterRoutes(app);
|
|
1240
|
-
app.use(
|
|
1404
|
+
app.use(import_dx_common_lib4.errorMiddleware);
|
|
1241
1405
|
return app;
|
|
1242
1406
|
}
|
|
1243
1407
|
|
|
@@ -1454,7 +1618,7 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1454
1618
|
};
|
|
1455
1619
|
|
|
1456
1620
|
// src/PreviewComponentService.ts
|
|
1457
|
-
var
|
|
1621
|
+
var import_path3 = __toESM(require("path"));
|
|
1458
1622
|
var import_promises = __toESM(require("fs/promises"));
|
|
1459
1623
|
var import_fs_extra = require("fs-extra");
|
|
1460
1624
|
|
|
@@ -1519,7 +1683,7 @@ function cssIncludeTagHtml(file) {
|
|
|
1519
1683
|
}
|
|
1520
1684
|
|
|
1521
1685
|
// src/PreviewComponentService.ts
|
|
1522
|
-
var
|
|
1686
|
+
var import_dx_common_lib5 = require("@squiz/dx-common-lib");
|
|
1523
1687
|
var PREVIEW_COMPONENT_SET = "unknown";
|
|
1524
1688
|
var ComponentPreviewService = class {
|
|
1525
1689
|
async dressRenderedOutputForPreview(componentManifest, functionDefinition, previewKey, componentOutput) {
|
|
@@ -1537,9 +1701,9 @@ var ComponentPreviewService = class {
|
|
|
1537
1701
|
return body;
|
|
1538
1702
|
}
|
|
1539
1703
|
async embedComponentIntoWrapper(componentDirectory, wrapper, functionDefinition, componentOutput) {
|
|
1540
|
-
const wrapperFilePath =
|
|
1704
|
+
const wrapperFilePath = import_path3.default.resolve(componentDirectory, wrapper.path);
|
|
1541
1705
|
if (await (0, import_fs_extra.pathExists)(wrapperFilePath) === false) {
|
|
1542
|
-
throw new
|
|
1706
|
+
throw new import_dx_common_lib5.BadRequestError(`Preview wrapper file "${wrapper.path}" does not exist`);
|
|
1543
1707
|
}
|
|
1544
1708
|
const wrapperContent = await import_promises.default.readFile(wrapperFilePath, {
|
|
1545
1709
|
encoding: "utf-8"
|
|
@@ -1555,14 +1719,14 @@ var ComponentPreviewService = class {
|
|
|
1555
1719
|
case "json":
|
|
1556
1720
|
return componentOutput;
|
|
1557
1721
|
default:
|
|
1558
|
-
return (0,
|
|
1722
|
+
return (0, import_dx_common_lib5.never)(type);
|
|
1559
1723
|
}
|
|
1560
1724
|
}
|
|
1561
1725
|
};
|
|
1562
1726
|
|
|
1563
1727
|
// src/RenderInputService.ts
|
|
1564
1728
|
var import_strict = __toESM(require("assert/strict"));
|
|
1565
|
-
var
|
|
1729
|
+
var import_dx_common_lib6 = require("@squiz/dx-common-lib");
|
|
1566
1730
|
var PREVIEW_COMPONENT_SET2 = "unknown";
|
|
1567
1731
|
var RenderInputService = class {
|
|
1568
1732
|
constructor(componentSetService, manifestService, componentFunctionService, rootUrlResolver) {
|
|
@@ -1591,7 +1755,7 @@ var RenderInputService = class {
|
|
|
1591
1755
|
let webManifest;
|
|
1592
1756
|
let input = {};
|
|
1593
1757
|
if (request.previewKey && request.componentSet) {
|
|
1594
|
-
throw new
|
|
1758
|
+
throw new import_dx_common_lib6.BadRequestError("You cannot provide a previewKey and a componentSet as input");
|
|
1595
1759
|
}
|
|
1596
1760
|
if (request.previewKey) {
|
|
1597
1761
|
input = await this.getInputForPreview(request, manifest);
|
|
@@ -1606,7 +1770,7 @@ var RenderInputService = class {
|
|
|
1606
1770
|
}
|
|
1607
1771
|
} else {
|
|
1608
1772
|
if (!request.componentSet) {
|
|
1609
|
-
throw new
|
|
1773
|
+
throw new import_dx_common_lib6.BadRequestError("You must provide either previewKey or a componentSet as input");
|
|
1610
1774
|
}
|
|
1611
1775
|
const set = await this.componentSetService.getComponentSet(request.componentSet);
|
|
1612
1776
|
headers = this.componentSetService.getComponentRuntimeHeaders(set, componentFunction);
|
|
@@ -1641,13 +1805,13 @@ var RenderInputService = class {
|
|
|
1641
1805
|
const queryParameters = {};
|
|
1642
1806
|
for (const parameter of Object.keys(componentFunction.queryParameters)) {
|
|
1643
1807
|
if (componentFunction.queryParameters[parameter].required && request.expressRequest.query[parameter] === void 0) {
|
|
1644
|
-
throw new
|
|
1808
|
+
throw new import_dx_common_lib6.BadRequestError(`Required query parameter '${parameter}' is missing`);
|
|
1645
1809
|
}
|
|
1646
1810
|
if (request.expressRequest.query[parameter] === void 0) {
|
|
1647
1811
|
continue;
|
|
1648
1812
|
}
|
|
1649
1813
|
if (typeof request.expressRequest.query[parameter] !== "string") {
|
|
1650
|
-
throw new
|
|
1814
|
+
throw new import_dx_common_lib6.BadRequestError(`Value for query parameter '${parameter}' must be a string`);
|
|
1651
1815
|
}
|
|
1652
1816
|
queryParameters[parameter] = request.expressRequest.query[parameter];
|
|
1653
1817
|
}
|
|
@@ -1665,7 +1829,7 @@ var RenderInputService = class {
|
|
|
1665
1829
|
this.componentFunctionService.assertInputValidForComponentFunction(input, componentFunction);
|
|
1666
1830
|
} catch (e) {
|
|
1667
1831
|
if (e instanceof Error) {
|
|
1668
|
-
const error = new
|
|
1832
|
+
const error = new import_dx_common_lib6.BadRequestError(e.message);
|
|
1669
1833
|
error.stack = e.stack;
|
|
1670
1834
|
throw error;
|
|
1671
1835
|
}
|
|
@@ -1677,7 +1841,7 @@ var RenderInputService = class {
|
|
|
1677
1841
|
this.componentFunctionService.assertRenderInputValidForComponentFunction(input, componentFunction);
|
|
1678
1842
|
} catch (e) {
|
|
1679
1843
|
if (e instanceof Error) {
|
|
1680
|
-
const error = new
|
|
1844
|
+
const error = new import_dx_common_lib6.BadRequestError(e.message);
|
|
1681
1845
|
error.stack = e.stack;
|
|
1682
1846
|
throw error;
|
|
1683
1847
|
}
|
|
@@ -1730,7 +1894,7 @@ var testComponentLogger = new import_component_logger_lib.ComponentLogger({
|
|
|
1730
1894
|
});
|
|
1731
1895
|
function getTestComponentFolder() {
|
|
1732
1896
|
const rootDir = (0, import_child_process.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).replace(/\n$/, "");
|
|
1733
|
-
return
|
|
1897
|
+
return import_path4.default.resolve(rootDir, "packages/edge-dev-render-runtime-lib/test-components");
|
|
1734
1898
|
}
|
|
1735
1899
|
function setupTestApp(services = {}, config = {}) {
|
|
1736
1900
|
const dataMount = getTestComponentFolder();
|
|
@@ -1802,7 +1966,7 @@ var TestServer = class {
|
|
|
1802
1966
|
|
|
1803
1967
|
// src/test/helpers/fixtures.ts
|
|
1804
1968
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
1805
|
-
var
|
|
1969
|
+
var import_path5 = __toESM(require("path"));
|
|
1806
1970
|
var import_strict2 = __toESM(require("assert/strict"));
|
|
1807
1971
|
var import_crypto3 = require("crypto");
|
|
1808
1972
|
var FIXTURE_NAMESPACE = "some-namespace";
|
|
@@ -1815,7 +1979,7 @@ var ComponentFixture = class {
|
|
|
1815
1979
|
}
|
|
1816
1980
|
static getFixtureRootDirectory() {
|
|
1817
1981
|
if (this.fixtureRootDirectory === void 0) {
|
|
1818
|
-
this.fixtureRootDirectory =
|
|
1982
|
+
this.fixtureRootDirectory = import_path5.default.join(getTestComponentFolder(), "fixtures");
|
|
1819
1983
|
}
|
|
1820
1984
|
return this.fixtureRootDirectory;
|
|
1821
1985
|
}
|
|
@@ -1823,23 +1987,23 @@ var ComponentFixture = class {
|
|
|
1823
1987
|
const fixtureDirectory = await this.createFixtureDirectory();
|
|
1824
1988
|
const { directory: componentDirectory, version } = await this.createVersionDirectory(fixtureDirectory);
|
|
1825
1989
|
const manifest = await this.createManifest(componentDirectory, { version, staticFilesRoot: "static" });
|
|
1826
|
-
await import_promises2.default.writeFile(
|
|
1827
|
-
await import_promises2.default.mkdir(
|
|
1828
|
-
await import_promises2.default.writeFile(
|
|
1829
|
-
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) };
|
|
1830
1994
|
}
|
|
1831
1995
|
static async new(returnObj, { raw = false, environment = [], set = getTestSet() } = {}) {
|
|
1832
1996
|
const fixtureDirectory = await this.createFixtureDirectory();
|
|
1833
|
-
const componentPath =
|
|
1997
|
+
const componentPath = import_path5.default.join(fixtureDirectory, "main.js");
|
|
1834
1998
|
const data = jsFileData(returnObj, { raw });
|
|
1835
1999
|
await import_promises2.default.writeFile(componentPath, data);
|
|
1836
2000
|
return {
|
|
1837
|
-
requestId:
|
|
2001
|
+
requestId: import_path5.default.basename(fixtureDirectory),
|
|
1838
2002
|
functionEntryFilePath: componentPath,
|
|
1839
2003
|
args: [{}],
|
|
1840
2004
|
environment: set.environment,
|
|
1841
2005
|
manifest: {
|
|
1842
|
-
name:
|
|
2006
|
+
name: import_path5.default.basename(fixtureDirectory),
|
|
1843
2007
|
namespace: this.namespace,
|
|
1844
2008
|
displayName: "some-display-name",
|
|
1845
2009
|
description: "some-description",
|
|
@@ -1858,7 +2022,7 @@ var ComponentFixture = class {
|
|
|
1858
2022
|
}
|
|
1859
2023
|
]
|
|
1860
2024
|
},
|
|
1861
|
-
componentFullName:
|
|
2025
|
+
componentFullName: import_path5.default.basename(fixtureDirectory),
|
|
1862
2026
|
runtimeSet: set,
|
|
1863
2027
|
componentRootUrl: "http://localhost:3000",
|
|
1864
2028
|
previewKey: void 0,
|
|
@@ -1879,18 +2043,18 @@ var ComponentFixture = class {
|
|
|
1879
2043
|
}
|
|
1880
2044
|
static async createFixtureDirectory() {
|
|
1881
2045
|
const fixtureName = generateRandomName();
|
|
1882
|
-
const fixturePath =
|
|
2046
|
+
const fixturePath = import_path5.default.join(this.getFixtureRootDirectory(), fixtureName);
|
|
1883
2047
|
await import_promises2.default.mkdir(fixturePath, { recursive: true });
|
|
1884
2048
|
return fixturePath;
|
|
1885
2049
|
}
|
|
1886
2050
|
static async createVersionDirectory(fixtureDirectory) {
|
|
1887
2051
|
const version = "1.0.1";
|
|
1888
|
-
const directory =
|
|
2052
|
+
const directory = import_path5.default.join(fixtureDirectory, version);
|
|
1889
2053
|
await import_promises2.default.mkdir(directory);
|
|
1890
2054
|
return { directory, version };
|
|
1891
2055
|
}
|
|
1892
2056
|
static async createManifest(componentDirectory, options = {}) {
|
|
1893
|
-
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);
|
|
1894
2058
|
const manifest = {
|
|
1895
2059
|
$schema: "http://localhost:3000/schemas/v1.json#",
|
|
1896
2060
|
name,
|
|
@@ -1915,7 +2079,7 @@ var ComponentFixture = class {
|
|
|
1915
2079
|
locationRoot: options.staticFilesRoot
|
|
1916
2080
|
};
|
|
1917
2081
|
}
|
|
1918
|
-
await import_promises2.default.writeFile(
|
|
2082
|
+
await import_promises2.default.writeFile(import_path5.default.join(componentDirectory, "manifest.json"), JSON.stringify(manifest));
|
|
1919
2083
|
return manifest;
|
|
1920
2084
|
}
|
|
1921
2085
|
};
|