@squiz/edge-dev-render-runtime-lib 2.3.0 → 2.3.1
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
CHANGED
|
@@ -158,9 +158,9 @@ var CoreController = class extends BaseController {
|
|
|
158
158
|
name,
|
|
159
159
|
entry.components.map((component) => {
|
|
160
160
|
if (component.previewKey !== void 0) {
|
|
161
|
-
return `<a href="/
|
|
161
|
+
return `<a href="/dev/render/${component.id}?_previewKey=${component.previewKey}">${component.version}</a>`;
|
|
162
162
|
}
|
|
163
|
-
return `<a href="/
|
|
163
|
+
return `<a href="/dev/render/${component.id}?_componentSet=local-development-only">${component.version}</a>`;
|
|
164
164
|
})
|
|
165
165
|
]
|
|
166
166
|
).map(([name, versionLinks]) => `${name}: ${versionLinks.join(", ")}`);
|
|
@@ -470,7 +470,7 @@ var models = {
|
|
|
470
470
|
// 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
|
|
471
471
|
"CoreSchemaMetaSchema2": {
|
|
472
472
|
"dataType": "refAlias",
|
|
473
|
-
"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": "enum", "enums": [true] }, "validators": { "minItems": { "value": 1 } } }, "const": { "dataType": "enum", "enums": [true] }, "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": "intersection", "subSchemas": [{ "dataType": "double" }, { "dataType": "double" }] }, "maxProperties": { "dataType": "double" }, "contains": { "ref": "CoreSchemaMetaSchema2" }, "uniqueItems": { "dataType": "boolean" }, "minItems": { "dataType": "intersection", "subSchemas": [{ "dataType": "double" }, { "dataType": "double" }] }, "maxItems": { "dataType": "double" }, "items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "SchemaArray" }] }, "additionalItems": { "ref": "CoreSchemaMetaSchema2" }, "pattern": { "dataType": "string" }, "minLength": { "dataType": "intersection", "subSchemas": [{ "dataType": "double" }, { "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": "enum", "enums": [true] } }, "writeOnly": { "dataType": "boolean" }, "readOnly": { "dataType": "boolean" }, "default": { "dataType": "enum", "enums": [true] }, "description": { "dataType": "string" }, "title": { "dataType": "string" }, "$comment": { "dataType": "string" }, "$ref": { "dataType": "string" }, "$schema": { "dataType": "string" }, "$id": { "dataType": "string" } } }, { "dataType": "boolean" }], "validators": {} }
|
|
473
|
+
"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": "enum", "enums": [true] }, "validators": { "minItems": { "value": 1 } } }, "const": { "dataType": "enum", "enums": [true] }, "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": "intersection", "subSchemas": [{ "dataType": "double" }, { "dataType": "double" }] }, "maxProperties": { "dataType": "double" }, "contains": { "ref": "CoreSchemaMetaSchema2" }, "uniqueItems": { "dataType": "boolean" }, "minItems": { "dataType": "intersection", "subSchemas": [{ "dataType": "double" }, { "dataType": "double" }] }, "maxItems": { "dataType": "double" }, "items": { "dataType": "union", "subSchemas": [{ "ref": "CoreSchemaMetaSchema2" }, { "ref": "SchemaArray" }] }, "additionalItems": { "ref": "CoreSchemaMetaSchema2" }, "pattern": { "dataType": "string" }, "minLength": { "dataType": "intersection", "subSchemas": [{ "dataType": "double" }, { "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": "enum", "enums": [true] } }, "writeOnly": { "dataType": "boolean" }, "readOnly": { "dataType": "boolean" }, "default": { "dataType": "enum", "enums": [true] }, "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": {} }
|
|
474
474
|
},
|
|
475
475
|
// 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
|
|
476
476
|
"SchemaArray": {
|
|
@@ -487,6 +487,7 @@ var models = {
|
|
|
487
487
|
"dataType": "refObject",
|
|
488
488
|
"properties": {
|
|
489
489
|
"$id": { "dataType": "string" },
|
|
490
|
+
"ui:metadata": { "dataType": "union", "subSchemas": [{ "dataType": "nestedObjectLiteral", "nestedProperties": { "collapsedByDefault": { "dataType": "boolean" } } }, { "dataType": "nestedObjectLiteral", "nestedProperties": { "quickOption": { "dataType": "boolean" }, "inlineEditable": { "dataType": "boolean" } } }] },
|
|
490
491
|
"$schema": { "dataType": "string" },
|
|
491
492
|
"$ref": { "dataType": "string" },
|
|
492
493
|
"$comment": { "dataType": "string" },
|
|
@@ -1224,36 +1225,38 @@ var import_crypto2 = __toESM(require("crypto"));
|
|
|
1224
1225
|
var import_node_path = __toESM(require("node:path"));
|
|
1225
1226
|
var import_node_vm = __toESM(require("node:vm"));
|
|
1226
1227
|
var import_os = require("os");
|
|
1228
|
+
var import_module = require("module");
|
|
1227
1229
|
var DevelopmentComponentRunnerService = class {
|
|
1228
1230
|
async executeEdgeComponentFunction(task) {
|
|
1229
|
-
const outputFile = this.getOutputLocation(task.functionEntryFilePath);
|
|
1230
1231
|
const webRequestEvents = await this.setUpWebRequestEventForResolveUri(task);
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
fns: serverComponentContext.ctx
|
|
1247
|
-
};
|
|
1248
|
-
const script = await import(outputFile);
|
|
1249
|
-
let f;
|
|
1250
|
-
if (script.default[task.componentFunction.name]) {
|
|
1251
|
-
f = script.default[task.componentFunction.name];
|
|
1252
|
-
} else if (script.default && script.default.default[task.componentFunction.name]) {
|
|
1253
|
-
f = script.default.default[task.componentFunction.name];
|
|
1232
|
+
const builtComponent = await esbuild.build({
|
|
1233
|
+
entryPoints: [task.functionEntryFilePath],
|
|
1234
|
+
write: false,
|
|
1235
|
+
format: "cjs",
|
|
1236
|
+
bundle: true,
|
|
1237
|
+
loader: {
|
|
1238
|
+
".js": "jsx"
|
|
1239
|
+
},
|
|
1240
|
+
platform: "node"
|
|
1241
|
+
});
|
|
1242
|
+
if (builtComponent.errors.length > 0) {
|
|
1243
|
+
for (const e of builtComponent.errors) {
|
|
1244
|
+
console.error(e.text);
|
|
1245
|
+
}
|
|
1246
|
+
throw new Error("Failed to build component");
|
|
1254
1247
|
}
|
|
1248
|
+
const componentContext = this.getComponentContext(task, webRequestEvents);
|
|
1249
|
+
const vmContext = import_node_vm.default.createContext({
|
|
1250
|
+
...globalThis,
|
|
1251
|
+
module: {},
|
|
1252
|
+
exports: {},
|
|
1253
|
+
require: (0, import_module.createRequire)(task.functionEntryFilePath)
|
|
1254
|
+
});
|
|
1255
|
+
const script = new import_node_vm.default.Script(builtComponent.outputFiles[0].text, { filename: task.functionEntryFilePath });
|
|
1256
|
+
script.runInContext(vmContext);
|
|
1257
|
+
const f = vmContext.module.exports.default[task.componentFunction.name];
|
|
1255
1258
|
if (typeof f === "function") {
|
|
1256
|
-
return await Promise.resolve(f(task.args[0] ?? {},
|
|
1259
|
+
return await Promise.resolve(f(task.args[0] ?? {}, componentContext));
|
|
1257
1260
|
}
|
|
1258
1261
|
throw Error(
|
|
1259
1262
|
`Function "${task.componentFunction.name}" not defined in the fn entry js file ${task.functionEntryFilePath}!`
|
|
@@ -1268,7 +1271,12 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1268
1271
|
);
|
|
1269
1272
|
}
|
|
1270
1273
|
const script = new import_node_vm.default.Script(transformedCode, { filename: import_node_path.default.basename(task.functionEntryFilePath) });
|
|
1271
|
-
const context = import_node_vm.default.createContext({
|
|
1274
|
+
const context = import_node_vm.default.createContext({
|
|
1275
|
+
...globalThis,
|
|
1276
|
+
module: {},
|
|
1277
|
+
exports: {},
|
|
1278
|
+
require: (0, import_module.createRequire)(task.functionEntryFilePath)
|
|
1279
|
+
});
|
|
1272
1280
|
const componentContext = this.getComponentContext(task, webRequestEvents);
|
|
1273
1281
|
script.runInContext(context);
|
|
1274
1282
|
const func = context.module.exports;
|
|
@@ -1325,14 +1333,16 @@ var DevelopmentComponentRunnerService = class {
|
|
|
1325
1333
|
version: task.manifest.version,
|
|
1326
1334
|
previewKey: task.previewKey,
|
|
1327
1335
|
queryParameters: task.queryParameters,
|
|
1328
|
-
ctx: (0, import_component_lib3.createComponentContextualFunctions)(ctxInput)
|
|
1336
|
+
ctx: (0, import_component_lib3.createComponentContextualFunctions)(ctxInput),
|
|
1337
|
+
fns: (0, import_component_lib3.createComponentContextualFunctions)(ctxInput),
|
|
1338
|
+
env: task.runtimeSet.environment
|
|
1329
1339
|
};
|
|
1330
1340
|
return componentContext;
|
|
1331
1341
|
}
|
|
1332
1342
|
getOutputLocation(sourceJsFile) {
|
|
1333
1343
|
const fileInfo = import_fs.default.statSync(sourceJsFile);
|
|
1334
1344
|
const filenameHash = import_crypto2.default.createHash("md5").update(sourceJsFile).digest("hex");
|
|
1335
|
-
return import_node_path.default.join((0, import_os.tmpdir)(), "components", `${filenameHash}_${fileInfo.mtime.getMilliseconds()}`);
|
|
1345
|
+
return import_node_path.default.join((0, import_os.tmpdir)(), "components", `${filenameHash}_${fileInfo.mtime.getMilliseconds()}.mjs`);
|
|
1336
1346
|
}
|
|
1337
1347
|
};
|
|
1338
1348
|
|
|
@@ -2054,12 +2064,6 @@ Expected given value \`N\` in #/my-object/a-nested-object/an-enum\` to be one of
|
|
|
2054
2064
|
});
|
|
2055
2065
|
});
|
|
2056
2066
|
describe("GET /dev/render/unit-test-components__test-npm-modules__3.1.0", () => {
|
|
2057
|
-
it("should render a component with axios", async () => {
|
|
2058
|
-
const response = await request().get(
|
|
2059
|
-
"/dev/render/unit-test-components__test-npm-modules__3.1.0/axios?_componentSet=set"
|
|
2060
|
-
);
|
|
2061
|
-
expect(response.statusCode).toEqual(200);
|
|
2062
|
-
});
|
|
2063
2067
|
it("should render a component with uuid", async () => {
|
|
2064
2068
|
const response = await request().get(
|
|
2065
2069
|
"/dev/render/unit-test-components__test-npm-modules__3.1.0/uuid?_componentSet=set"
|