@ms-cloudpack/common-types 0.5.4 → 0.6.0
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/Route.d.ts +36 -6
- package/lib/Route.d.ts.map +1 -1
- package/lib/Route.js +18 -1
- package/lib/Route.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/AppConfig.json +57 -5
- package/schema/UserConfig.json +57 -5
package/lib/Route.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SharedRouteOptions {
|
|
2
2
|
/**
|
|
3
3
|
* The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also
|
|
4
4
|
* use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.
|
|
5
5
|
*/
|
|
6
6
|
match: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A server-rendered route. The route is rendered by a custom server script in Cloudpack.
|
|
10
|
+
*/
|
|
11
|
+
export interface RenderedRoute extends SharedRouteOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Path to a .js or .html file used for rendering the route. If a script is provided, it must
|
|
14
14
|
* export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`.
|
|
@@ -20,4 +20,34 @@ export interface Route {
|
|
|
20
20
|
*/
|
|
21
21
|
exportEntry?: string;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* A route with a staticPath property serves static files from the specified path.
|
|
25
|
+
*/
|
|
26
|
+
export interface StaticRoute extends SharedRouteOptions {
|
|
27
|
+
/**
|
|
28
|
+
* The path relative to the app root to static assets.
|
|
29
|
+
*/
|
|
30
|
+
staticPath: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A route that serves a bootstrap script.
|
|
34
|
+
*/
|
|
35
|
+
export interface BootstrapRoute extends SharedRouteOptions {
|
|
36
|
+
type: 'bootstrap';
|
|
37
|
+
/**
|
|
38
|
+
* The key in the exports map which represents the entry point app script for this route.
|
|
39
|
+
* Default is '.', meaning the main package export key.
|
|
40
|
+
*/
|
|
41
|
+
exportEntry?: string;
|
|
42
|
+
}
|
|
43
|
+
export type Route = RenderedRoute | StaticRoute | BootstrapRoute;
|
|
44
|
+
/**
|
|
45
|
+
* User defined type guard to check if a route is a static route.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isStaticRoute(route: Route): route is StaticRoute;
|
|
48
|
+
/**
|
|
49
|
+
* User defined type guard to check if a route is a bootstrap route.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isBootstrapRoute(route: Route): route is BootstrapRoute;
|
|
52
|
+
export declare function isRenderedRoute(route: Route): route is RenderedRoute;
|
|
23
53
|
//# sourceMappingURL=Route.d.ts.map
|
package/lib/Route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,IAAI,EAAE,WAAW,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CAAC;AAEjE;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAEhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAEtE;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEpE"}
|
package/lib/Route.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* User defined type guard to check if a route is a static route.
|
|
3
|
+
*/
|
|
4
|
+
export function isStaticRoute(route) {
|
|
5
|
+
return 'staticPath' in route;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* User defined type guard to check if a route is a bootstrap route.
|
|
9
|
+
*/
|
|
10
|
+
export function isBootstrapRoute(route) {
|
|
11
|
+
return 'type' in route && route.type === 'bootstrap';
|
|
12
|
+
}
|
|
13
|
+
/*
|
|
14
|
+
* User defined type guard to check if a route is a rendered route.
|
|
15
|
+
*/
|
|
16
|
+
export function isRenderedRoute(route) {
|
|
17
|
+
return !isStaticRoute(route) && !isBootstrapRoute(route);
|
|
18
|
+
}
|
|
2
19
|
//# sourceMappingURL=Route.js.map
|
package/lib/Route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"","sourcesContent":["export interface
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAiDA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY;IACxC,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,OAAO,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["export interface SharedRouteOptions {\n /**\n * The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also\n * use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n */\n match: string;\n}\n\n/**\n * A server-rendered route. The route is rendered by a custom server script in Cloudpack.\n */\nexport interface RenderedRoute extends SharedRouteOptions {\n /**\n * Path to a .js or .html file used for rendering the route. If a script is provided, it must\n * export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`.\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * Default is '.', meaning the main package export key.\n */\n exportEntry?: string;\n}\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute extends SharedRouteOptions {\n type: 'bootstrap';\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * Default is '.', meaning the main package export key.\n */\n exportEntry?: string;\n}\n\nexport type Route = RenderedRoute | StaticRoute | BootstrapRoute;\n\n/**\n * User defined type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * User defined type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/*\n * User defined type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n return !isStaticRoute(route) && !isBootstrapRoute(route);\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -18,7 +18,8 @@ export type { GeneratedConfig } from './GeneratedConfig.js';
|
|
|
18
18
|
export type { HttpsConfig } from './HttpsConfig.js';
|
|
19
19
|
export type { PackageOverride } from './PackageOverride.js';
|
|
20
20
|
export type { PackageSettings } from './PackageSettings.js';
|
|
21
|
-
export type { Route } from './Route.js';
|
|
21
|
+
export type { Route, RenderedRoute, BootstrapRoute, StaticRoute } from './Route.js';
|
|
22
|
+
export { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';
|
|
22
23
|
export type { TelemetryConfig } from './TelemetryConfig.js';
|
|
23
24
|
export type { AppConfig } from './AppConfig.js';
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAmC/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route, RenderedRoute, BootstrapRoute, StaticRoute } from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\n"]}
|
package/package.json
CHANGED
package/schema/AppConfig.json
CHANGED
|
@@ -431,16 +431,25 @@
|
|
|
431
431
|
"additionalProperties": false
|
|
432
432
|
},
|
|
433
433
|
"Route": {
|
|
434
|
+
"anyOf": [
|
|
435
|
+
{
|
|
436
|
+
"$ref": "#/definitions/RenderedRoute"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"$ref": "#/definitions/StaticRoute"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"$ref": "#/definitions/BootstrapRoute"
|
|
443
|
+
}
|
|
444
|
+
]
|
|
445
|
+
},
|
|
446
|
+
"RenderedRoute": {
|
|
434
447
|
"type": "object",
|
|
435
448
|
"properties": {
|
|
436
449
|
"match": {
|
|
437
450
|
"type": "string",
|
|
438
451
|
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
439
452
|
},
|
|
440
|
-
"staticPath": {
|
|
441
|
-
"type": "string",
|
|
442
|
-
"description": "The path relative to the app root to static assets. If this is provided, renderScript/exportEntry will be ignored."
|
|
443
|
-
},
|
|
444
453
|
"renderScript": {
|
|
445
454
|
"type": "string",
|
|
446
455
|
"description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`."
|
|
@@ -450,10 +459,53 @@
|
|
|
450
459
|
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
451
460
|
}
|
|
452
461
|
},
|
|
462
|
+
"additionalProperties": false,
|
|
453
463
|
"required": [
|
|
454
464
|
"match"
|
|
455
465
|
],
|
|
456
|
-
"
|
|
466
|
+
"description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
|
|
467
|
+
},
|
|
468
|
+
"StaticRoute": {
|
|
469
|
+
"type": "object",
|
|
470
|
+
"properties": {
|
|
471
|
+
"match": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
474
|
+
},
|
|
475
|
+
"staticPath": {
|
|
476
|
+
"type": "string",
|
|
477
|
+
"description": "The path relative to the app root to static assets."
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"required": [
|
|
481
|
+
"match",
|
|
482
|
+
"staticPath"
|
|
483
|
+
],
|
|
484
|
+
"additionalProperties": false,
|
|
485
|
+
"description": "A route with a staticPath property serves static files from the specified path."
|
|
486
|
+
},
|
|
487
|
+
"BootstrapRoute": {
|
|
488
|
+
"type": "object",
|
|
489
|
+
"properties": {
|
|
490
|
+
"match": {
|
|
491
|
+
"type": "string",
|
|
492
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
493
|
+
},
|
|
494
|
+
"type": {
|
|
495
|
+
"type": "string",
|
|
496
|
+
"const": "bootstrap"
|
|
497
|
+
},
|
|
498
|
+
"exportEntry": {
|
|
499
|
+
"type": "string",
|
|
500
|
+
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"required": [
|
|
504
|
+
"match",
|
|
505
|
+
"type"
|
|
506
|
+
],
|
|
507
|
+
"additionalProperties": false,
|
|
508
|
+
"description": "A route that serves a bootstrap script."
|
|
457
509
|
},
|
|
458
510
|
"TelemetryConfig": {
|
|
459
511
|
"type": "object",
|
package/schema/UserConfig.json
CHANGED
|
@@ -432,16 +432,25 @@
|
|
|
432
432
|
"additionalProperties": false
|
|
433
433
|
},
|
|
434
434
|
"Route": {
|
|
435
|
+
"anyOf": [
|
|
436
|
+
{
|
|
437
|
+
"$ref": "#/definitions/RenderedRoute"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"$ref": "#/definitions/StaticRoute"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"$ref": "#/definitions/BootstrapRoute"
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
"RenderedRoute": {
|
|
435
448
|
"type": "object",
|
|
436
449
|
"properties": {
|
|
437
450
|
"match": {
|
|
438
451
|
"type": "string",
|
|
439
452
|
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
440
453
|
},
|
|
441
|
-
"staticPath": {
|
|
442
|
-
"type": "string",
|
|
443
|
-
"description": "The path relative to the app root to static assets. If this is provided, renderScript/exportEntry will be ignored."
|
|
444
|
-
},
|
|
445
454
|
"renderScript": {
|
|
446
455
|
"type": "string",
|
|
447
456
|
"description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`."
|
|
@@ -451,10 +460,53 @@
|
|
|
451
460
|
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
452
461
|
}
|
|
453
462
|
},
|
|
463
|
+
"additionalProperties": false,
|
|
454
464
|
"required": [
|
|
455
465
|
"match"
|
|
456
466
|
],
|
|
457
|
-
"
|
|
467
|
+
"description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
|
|
468
|
+
},
|
|
469
|
+
"StaticRoute": {
|
|
470
|
+
"type": "object",
|
|
471
|
+
"properties": {
|
|
472
|
+
"match": {
|
|
473
|
+
"type": "string",
|
|
474
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
475
|
+
},
|
|
476
|
+
"staticPath": {
|
|
477
|
+
"type": "string",
|
|
478
|
+
"description": "The path relative to the app root to static assets."
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"required": [
|
|
482
|
+
"match",
|
|
483
|
+
"staticPath"
|
|
484
|
+
],
|
|
485
|
+
"additionalProperties": false,
|
|
486
|
+
"description": "A route with a staticPath property serves static files from the specified path."
|
|
487
|
+
},
|
|
488
|
+
"BootstrapRoute": {
|
|
489
|
+
"type": "object",
|
|
490
|
+
"properties": {
|
|
491
|
+
"match": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`."
|
|
494
|
+
},
|
|
495
|
+
"type": {
|
|
496
|
+
"type": "string",
|
|
497
|
+
"const": "bootstrap"
|
|
498
|
+
},
|
|
499
|
+
"exportEntry": {
|
|
500
|
+
"type": "string",
|
|
501
|
+
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"required": [
|
|
505
|
+
"match",
|
|
506
|
+
"type"
|
|
507
|
+
],
|
|
508
|
+
"additionalProperties": false,
|
|
509
|
+
"description": "A route that serves a bootstrap script."
|
|
458
510
|
},
|
|
459
511
|
"TelemetryConfig": {
|
|
460
512
|
"type": "object",
|