@ms-cloudpack/common-types 0.12.0 → 0.13.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.
@@ -52,7 +52,7 @@ export type InternalBundlerCapabilitiesMetaData = {
52
52
  * This is a bundler specific implementation of the internal bundler capabilities.
53
53
  * It's a mapping from the capability name to the capability function.
54
54
  */
55
- export type InternalBundlerCapabilitiesBundlerSpecificImplementations<TConfig> = {
55
+ export type InternalBundlerCapabilityImplementations<TConfig> = {
56
56
  [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;
57
57
  };
58
58
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,mBAAmB,CAAC,OAAO,EAAE,QAAQ,SAAS,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;AAE7G;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,IAAI;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3D,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,QAAQ,SAAS,MAAM,IAAI,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAEtH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;OAGG;IACH,cAAc,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG;KACtC,GAAG,IAAI,MAAM,2BAA2B,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AAC,GAAG,KAAK;CACtF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,mCAAmC,GAAG;KAC/C,GAAG,IAAI,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;CACxG,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,wCAAwC,CAAC,OAAO,IAAI;KAC7D,GAAG,IAAI,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,OAAO,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CAC3G,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n */\ntype BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n */\nexport type BundlerCapability<TOptions extends object> = {\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFn<unknown, TOptions>;\n };\n};\n\n/**\n * The metadata for a bundler capability.\n * It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.\n */\nexport type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * key: The name of the capability which will be used in the cloudpack config to enable the capability\n * value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n};\n\n/**\n * This is the type that's being used PackageSettings to enable/disable bundler capabilities.\n * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type BundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\n/**\n * This is the metadata for the bundler capabilities that cloudpack provides.\n * It's a mapping from the capability name to the metadata object.\n * The metadata object contains the description of the capability and the list of implementations for each bundler.\n * This is used to generate the documentation for the bundler capabilities.\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;\n};\n\n/**\n * This is a bundler specific implementation of the internal bundler capabilities.\n * It's a mapping from the capability name to the capability function.\n */\nexport type InternalBundlerCapabilitiesBundlerSpecificImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;\n};\n"]}
1
+ {"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n */\ntype BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n */\nexport type BundlerCapability<TOptions extends object> = {\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFn<unknown, TOptions>;\n };\n};\n\n/**\n * The metadata for a bundler capability.\n * It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.\n */\nexport type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * key: The name of the capability which will be used in the cloudpack config to enable the capability\n * value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n};\n\n/**\n * This is the type that's being used PackageSettings to enable/disable bundler capabilities.\n * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type BundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\n/**\n * This is the metadata for the bundler capabilities that cloudpack provides.\n * It's a mapping from the capability name to the metadata object.\n * The metadata object contains the description of the capability and the list of implementations for each bundler.\n * This is used to generate the documentation for the bundler capabilities.\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;\n};\n\n/**\n * This is a bundler specific implementation of the internal bundler capabilities.\n * It's a mapping from the capability name to the capability function.\n */\nexport type InternalBundlerCapabilityImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;\n};\n"]}
@@ -23,6 +23,10 @@ export type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {
23
23
  * Generated config settings.
24
24
  */
25
25
  generated: GeneratedConfig;
26
+ /**
27
+ * An immutable snapshot of the generated config as it is when start or init commands first begin
28
+ */
29
+ generatedSnapshot?: Readonly<GeneratedConfig>;
26
30
  /**
27
31
  * Routes which have been expanded from shorthand entries.
28
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CloudpackConfig.d.ts","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IACtE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEtC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC"}
1
+ {"version":3,"file":"CloudpackConfig.d.ts","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;IACtE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEtC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { DevServer } from './DevServer.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n devServer?: Omit<DevServer, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n};\n"]}
1
+ {"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { DevServer } from './DevServer.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n devServer?: Omit<DevServer, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * An immutable snapshot of the generated config as it is when start or init commands first begin\n */\n generatedSnapshot?: Readonly<GeneratedConfig>;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n};\n"]}
@@ -31,7 +31,7 @@ export interface DevServer {
31
31
  */
32
32
  https?: HttpsConfig;
33
33
  /**
34
- * @deprecated - Routes has moved to the root of the config.
34
+ * @deprecated Moved to the root of the config.
35
35
  */
36
36
  routes?: ShorthandRoute[];
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server.\n */\n domain?: string;\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: HttpsConfig;\n\n /**\n * @deprecated - Routes has moved to the root of the config.\n */\n routes?: ShorthandRoute[];\n}\n"]}
1
+ {"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server.\n */\n domain?: string;\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: HttpsConfig;\n\n /**\n * @deprecated Moved to the root of the config.\n */\n routes?: ShorthandRoute[];\n}\n"]}
package/lib/Route.d.ts CHANGED
@@ -9,7 +9,8 @@ export interface SharedRouteOptions {
9
9
  match: string | string[];
10
10
  }
11
11
  /**
12
- * A server-rendered route. The route is rendered by a custom server script in Cloudpack.
12
+ * A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).
13
+ * The route is rendered by a custom server script in Cloudpack.
13
14
  */
14
15
  export interface ShorthandRenderedRoute extends SharedRouteOptions {
15
16
  /**
@@ -27,7 +28,14 @@ export interface ShorthandRenderedRoute extends SharedRouteOptions {
27
28
  */
28
29
  entry?: (string | ExpandedSourcePath)[];
29
30
  }
31
+ /**
32
+ * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).
33
+ * The route is rendered by a custom server script in Cloudpack.
34
+ */
30
35
  export type RenderedRoute = Omit<ShorthandRenderedRoute, 'entry'> & {
36
+ /**
37
+ * To be implemented. The source entry or entries to be included on the page for this route.
38
+ */
31
39
  entry?: ExpandedSourcePath[];
32
40
  };
33
41
  /**
@@ -42,22 +50,31 @@ export interface StaticRoute extends SharedRouteOptions {
42
50
  /**
43
51
  * A route that serves a bootstrap script.
44
52
  */
45
- export interface BootstrapRoute extends SharedRouteOptions {
53
+ export interface BootstrapRoute extends SharedRouteOptions, Pick<ShorthandRenderedRoute, 'exportEntry'> {
46
54
  type: 'bootstrap';
47
- /**
48
- * The key in the exports map which represents the entry point app script for this route.
49
- * Default is '.', meaning the main package export key.
50
- */
51
- exportEntry?: string;
52
55
  }
56
+ /**
57
+ * A route that redirects to another url.
58
+ */
53
59
  export interface RedirectRoute extends SharedRouteOptions {
54
60
  /**
55
61
  * The url to redirect to.
56
62
  */
57
63
  redirectTo: string;
58
64
  }
59
- export type ShorthandRoute = ShorthandRenderedRoute | StaticRoute | BootstrapRoute;
60
- export type Route = RenderedRoute | StaticRoute | BootstrapRoute | RedirectRoute;
65
+ /**
66
+ * Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute`
67
+ * (to ensure any new route types are included in both `Route` and `ShorthandRoute`).
68
+ */
69
+ type OtherRoute = StaticRoute | BootstrapRoute | RedirectRoute;
70
+ /**
71
+ * Route as specified in `AppConfig` (`cloudpack.config.json`).
72
+ */
73
+ export type ShorthandRoute = ShorthandRenderedRoute | OtherRoute;
74
+ /**
75
+ * Processed route as used in the processed `CloudpackConfig`.
76
+ */
77
+ export type Route = RenderedRoute | OtherRoute;
61
78
  /**
62
79
  * Type guard to check if a route is a static route.
63
80
  */
@@ -71,4 +88,5 @@ export declare function isRenderedRoute(route: Route): route is RenderedRoute;
71
88
  * Type guard to check if a route is a redirect route.
72
89
  */
73
90
  export declare function isRedirectRoute(route: Route): route is RedirectRoute;
91
+ export {};
74
92
  //# sourceMappingURL=Route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG;IAClE,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cA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IAClE;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,aAAa,CAAC;IACrG,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,KAAK,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,UAAU,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,aAAa,GAAG,UAAU,CAAC;AAE/C;;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,CAMpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEpE"}
package/lib/Route.js CHANGED
@@ -14,7 +14,9 @@ export function isBootstrapRoute(route) {
14
14
  * Type guard to check if a route is a rendered route.
15
15
  */
16
16
  export function isRenderedRoute(route) {
17
- return !isStaticRoute(route) && !isBootstrapRoute(route);
17
+ const maybeRenderedRoute = route;
18
+ return (!isBootstrapRoute(route) &&
19
+ !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.exportEntry));
18
20
  }
19
21
  /**
20
22
  * Type guard to check if a route is a redirect route.
package/lib/Route.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAuEA;;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;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\nexport 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 * Use an array to handle multiple paths with the same route handler.\n */\n match: string | string[];\n}\n\n/**\n * A server-rendered route. The route is rendered by a custom server script in Cloudpack.\n */\nexport interface ShorthandRenderedRoute 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 * To be implemented. The source entry or entries to be included on the page for this route.\n */\n entry?: (string | ExpandedSourcePath)[];\n}\n\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'entry'> & {\n entry?: ExpandedSourcePath[];\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 interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\nexport type ShorthandRoute = ShorthandRenderedRoute | StaticRoute | BootstrapRoute;\n\nexport type Route = RenderedRoute | StaticRoute | BootstrapRoute | RedirectRoute;\n\n/**\n * 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 * 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 * 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\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n"]}
1
+ {"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAyFA;;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,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAClG,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\nexport 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 * Use an array to handle multiple paths with the same route handler.\n */\n match: string | string[];\n}\n\n/**\n * A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport interface ShorthandRenderedRoute 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 * To be implemented. The source entry or entries to be included on the page for this route.\n */\n entry?: (string | ExpandedSourcePath)[];\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'entry'> & {\n /**\n * To be implemented. The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\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, Pick<ShorthandRenderedRoute, 'exportEntry'> {\n type: 'bootstrap';\n}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute`\n * (to ensure any new route types are included in both `Route` and `ShorthandRoute`).\n */\ntype OtherRoute = StaticRoute | BootstrapRoute | RedirectRoute;\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\nexport type ShorthandRoute = ShorthandRenderedRoute | OtherRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\nexport type Route = RenderedRoute | OtherRoute;\n\n/**\n * 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 * 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 * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return (\n !isBootstrapRoute(route) &&\n !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.exportEntry)\n );\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -24,5 +24,5 @@ export type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute }
24
24
  export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';
25
25
  export type { TelemetryConfig } from './TelemetryConfig.js';
26
26
  export type { AppConfig } from './AppConfig.js';
27
- export type { InternalBundlerCapabilitiesBundlerSpecificImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
27
+ export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
28
28
  //# sourceMappingURL=index.d.ts.map
@@ -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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,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;AAC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,EAAE,aAAa,EAAE,eAAe,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 { BundleMode } from './BundleMode.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 { ModuleType } from './ModuleType.js';\nexport type { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute } from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilitiesBundlerSpecificImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n} from './BundlerCapability.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAqC/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,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 { BundleMode } from './BundleMode.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 { ModuleType } from './ModuleType.js';\nexport type { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute } from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n} from './BundlerCapability.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -149,7 +149,7 @@
149
149
  "items": {
150
150
  "$ref": "#/definitions/ShorthandRoute"
151
151
  },
152
- "deprecated": "- Routes has moved to the root of the config."
152
+ "deprecated": "Moved to the root of the config."
153
153
  }
154
154
  },
155
155
  "additionalProperties": false
@@ -157,6 +157,10 @@
157
157
  "HttpsConfig": {
158
158
  "type": "object",
159
159
  "properties": {
160
+ "ALPNCallback": {
161
+ "not": {},
162
+ "description": "If set, this will be called when a client opens a connection using the ALPN extension. One argument will be passed to the callback: an object containing `servername` and `protocols` fields, respectively containing the server name from the SNI extension (if any) and an array of ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, which will be returned to the client as the selected ALPN protocol, or `undefined`, to reject the connection with a fatal alert. If a string is returned that does not match one of the client's ALPN protocols, an error will be thrown. This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error."
163
+ },
160
164
  "ca": {
161
165
  "anyOf": [
162
166
  {
@@ -213,7 +217,7 @@
213
217
  },
214
218
  "dhparam": {
215
219
  "type": "string",
216
- "description": "Diffie Hellman parameters, required for Perfect Forward Secrecy. Use openssl dhparam to create the parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger for stronger security. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available."
220
+ "description": "`'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. ECDHE-based perfect forward secrecy will still be available."
217
221
  },
218
222
  "ecdhCurve": {
219
223
  "type": "string",
@@ -231,7 +235,14 @@
231
235
  {
232
236
  "type": "array",
233
237
  "items": {
234
- "$ref": "#/definitions/KeyObject"
238
+ "anyOf": [
239
+ {
240
+ "type": "string"
241
+ },
242
+ {
243
+ "$ref": "#/definitions/KeyObject"
244
+ }
245
+ ]
235
246
  }
236
247
  }
237
248
  ],
@@ -370,15 +381,56 @@
370
381
  "description": "If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.",
371
382
  "default": 0
372
383
  },
373
- "maxHeaderSize": {
384
+ "requestTimeout": {
374
385
  "type": "number",
375
- "description": "Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes.",
376
- "default": 8192
386
+ "description": "Sets the timeout value in milliseconds for receiving the entire request from the client.",
387
+ "default": 300000
388
+ },
389
+ "joinDuplicateHeaders": {
390
+ "type": "boolean",
391
+ "description": "It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.",
392
+ "default": false
393
+ },
394
+ "keepAliveTimeout": {
395
+ "type": "number",
396
+ "description": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed.",
397
+ "default": 5000
398
+ },
399
+ "connectionsCheckingInterval": {
400
+ "type": "number",
401
+ "description": "Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.",
402
+ "default": 30000
403
+ },
404
+ "highWaterMark": {
405
+ "type": "number",
406
+ "description": "Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. Default:"
377
407
  },
378
408
  "insecureHTTPParser": {
379
409
  "type": "boolean",
380
- "description": "Use an insecure HTTP parser that accepts invalid HTTP headers when true. Using the insecure parser should be avoided. See --insecure-http-parser for more information.",
410
+ "description": "Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See --insecure-http-parser for more information.",
381
411
  "default": false
412
+ },
413
+ "maxHeaderSize": {
414
+ "type": "number",
415
+ "description": "Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes.",
416
+ "default": 16384
417
+ },
418
+ "uniqueHeaders": {
419
+ "type": "array",
420
+ "items": {
421
+ "anyOf": [
422
+ {
423
+ "type": "string"
424
+ },
425
+ {
426
+ "type": "array",
427
+ "items": {
428
+ "type": "string"
429
+ }
430
+ }
431
+ ]
432
+ },
433
+ "description": "A list of response headers that should be sent only once. If the header's value is an array, the items will be joined using `; `."
382
434
  }
383
435
  },
384
436
  "additionalProperties": false,
@@ -443,12 +495,21 @@
443
495
  "$ref": "#/definitions/ShorthandRenderedRoute"
444
496
  },
445
497
  {
446
- "$ref": "#/definitions/StaticRoute"
447
- },
448
- {
449
- "$ref": "#/definitions/BootstrapRoute"
498
+ "anyOf": [
499
+ {
500
+ "$ref": "#/definitions/StaticRoute"
501
+ },
502
+ {
503
+ "$ref": "#/definitions/BootstrapRoute"
504
+ },
505
+ {
506
+ "$ref": "#/definitions/RedirectRoute"
507
+ }
508
+ ],
509
+ "description": "Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute` (to ensure any new route types are included in both `Route` and `ShorthandRoute`)."
450
510
  }
451
- ]
511
+ ],
512
+ "description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
452
513
  },
453
514
  "ShorthandRenderedRoute": {
454
515
  "type": "object",
@@ -494,7 +555,7 @@
494
555
  "required": [
495
556
  "match"
496
557
  ],
497
- "description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
558
+ "description": "A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`). The route is rendered by a custom server script in Cloudpack."
498
559
  },
499
560
  "ExpandedSourcePath": {
500
561
  "type": "object",
@@ -551,6 +612,10 @@
551
612
  "BootstrapRoute": {
552
613
  "type": "object",
553
614
  "properties": {
615
+ "exportEntry": {
616
+ "type": "string",
617
+ "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."
618
+ },
554
619
  "match": {
555
620
  "anyOf": [
556
621
  {
@@ -568,10 +633,6 @@
568
633
  "type": {
569
634
  "type": "string",
570
635
  "const": "bootstrap"
571
- },
572
- "exportEntry": {
573
- "type": "string",
574
- "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."
575
636
  }
576
637
  },
577
638
  "required": [
@@ -581,6 +642,35 @@
581
642
  "additionalProperties": false,
582
643
  "description": "A route that serves a bootstrap script."
583
644
  },
645
+ "RedirectRoute": {
646
+ "type": "object",
647
+ "properties": {
648
+ "match": {
649
+ "anyOf": [
650
+ {
651
+ "type": "string"
652
+ },
653
+ {
654
+ "type": "array",
655
+ "items": {
656
+ "type": "string"
657
+ }
658
+ }
659
+ ],
660
+ "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'`.\n\nUse an array to handle multiple paths with the same route handler."
661
+ },
662
+ "redirectTo": {
663
+ "type": "string",
664
+ "description": "The url to redirect to."
665
+ }
666
+ },
667
+ "required": [
668
+ "match",
669
+ "redirectTo"
670
+ ],
671
+ "additionalProperties": false,
672
+ "description": "A route that redirects to another url."
673
+ },
584
674
  "TelemetryConfig": {
585
675
  "type": "object",
586
676
  "properties": {
@@ -150,7 +150,7 @@
150
150
  "items": {
151
151
  "$ref": "#/definitions/ShorthandRoute"
152
152
  },
153
- "deprecated": "- Routes has moved to the root of the config."
153
+ "deprecated": "Moved to the root of the config."
154
154
  }
155
155
  },
156
156
  "additionalProperties": false
@@ -158,6 +158,10 @@
158
158
  "HttpsConfig": {
159
159
  "type": "object",
160
160
  "properties": {
161
+ "ALPNCallback": {
162
+ "not": {},
163
+ "description": "If set, this will be called when a client opens a connection using the ALPN extension. One argument will be passed to the callback: an object containing `servername` and `protocols` fields, respectively containing the server name from the SNI extension (if any) and an array of ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, which will be returned to the client as the selected ALPN protocol, or `undefined`, to reject the connection with a fatal alert. If a string is returned that does not match one of the client's ALPN protocols, an error will be thrown. This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error."
164
+ },
161
165
  "ca": {
162
166
  "anyOf": [
163
167
  {
@@ -214,7 +218,7 @@
214
218
  },
215
219
  "dhparam": {
216
220
  "type": "string",
217
- "description": "Diffie Hellman parameters, required for Perfect Forward Secrecy. Use openssl dhparam to create the parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger for stronger security. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available."
221
+ "description": "`'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. ECDHE-based perfect forward secrecy will still be available."
218
222
  },
219
223
  "ecdhCurve": {
220
224
  "type": "string",
@@ -232,7 +236,14 @@
232
236
  {
233
237
  "type": "array",
234
238
  "items": {
235
- "$ref": "#/definitions/KeyObject"
239
+ "anyOf": [
240
+ {
241
+ "type": "string"
242
+ },
243
+ {
244
+ "$ref": "#/definitions/KeyObject"
245
+ }
246
+ ]
236
247
  }
237
248
  }
238
249
  ],
@@ -371,15 +382,56 @@
371
382
  "description": "If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.",
372
383
  "default": 0
373
384
  },
374
- "maxHeaderSize": {
385
+ "requestTimeout": {
375
386
  "type": "number",
376
- "description": "Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes.",
377
- "default": 8192
387
+ "description": "Sets the timeout value in milliseconds for receiving the entire request from the client.",
388
+ "default": 300000
389
+ },
390
+ "joinDuplicateHeaders": {
391
+ "type": "boolean",
392
+ "description": "It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.",
393
+ "default": false
394
+ },
395
+ "keepAliveTimeout": {
396
+ "type": "number",
397
+ "description": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed.",
398
+ "default": 5000
399
+ },
400
+ "connectionsCheckingInterval": {
401
+ "type": "number",
402
+ "description": "Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.",
403
+ "default": 30000
404
+ },
405
+ "highWaterMark": {
406
+ "type": "number",
407
+ "description": "Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. Default:"
378
408
  },
379
409
  "insecureHTTPParser": {
380
410
  "type": "boolean",
381
- "description": "Use an insecure HTTP parser that accepts invalid HTTP headers when true. Using the insecure parser should be avoided. See --insecure-http-parser for more information.",
411
+ "description": "Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. Using the insecure parser should be avoided. See --insecure-http-parser for more information.",
382
412
  "default": false
413
+ },
414
+ "maxHeaderSize": {
415
+ "type": "number",
416
+ "description": "Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes.",
417
+ "default": 16384
418
+ },
419
+ "uniqueHeaders": {
420
+ "type": "array",
421
+ "items": {
422
+ "anyOf": [
423
+ {
424
+ "type": "string"
425
+ },
426
+ {
427
+ "type": "array",
428
+ "items": {
429
+ "type": "string"
430
+ }
431
+ }
432
+ ]
433
+ },
434
+ "description": "A list of response headers that should be sent only once. If the header's value is an array, the items will be joined using `; `."
383
435
  }
384
436
  },
385
437
  "additionalProperties": false,
@@ -444,12 +496,21 @@
444
496
  "$ref": "#/definitions/ShorthandRenderedRoute"
445
497
  },
446
498
  {
447
- "$ref": "#/definitions/StaticRoute"
448
- },
449
- {
450
- "$ref": "#/definitions/BootstrapRoute"
499
+ "anyOf": [
500
+ {
501
+ "$ref": "#/definitions/StaticRoute"
502
+ },
503
+ {
504
+ "$ref": "#/definitions/BootstrapRoute"
505
+ },
506
+ {
507
+ "$ref": "#/definitions/RedirectRoute"
508
+ }
509
+ ],
510
+ "description": "Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute` (to ensure any new route types are included in both `Route` and `ShorthandRoute`)."
451
511
  }
452
- ]
512
+ ],
513
+ "description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
453
514
  },
454
515
  "ShorthandRenderedRoute": {
455
516
  "type": "object",
@@ -495,7 +556,7 @@
495
556
  "required": [
496
557
  "match"
497
558
  ],
498
- "description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
559
+ "description": "A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`). The route is rendered by a custom server script in Cloudpack."
499
560
  },
500
561
  "ExpandedSourcePath": {
501
562
  "type": "object",
@@ -552,6 +613,10 @@
552
613
  "BootstrapRoute": {
553
614
  "type": "object",
554
615
  "properties": {
616
+ "exportEntry": {
617
+ "type": "string",
618
+ "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."
619
+ },
555
620
  "match": {
556
621
  "anyOf": [
557
622
  {
@@ -569,10 +634,6 @@
569
634
  "type": {
570
635
  "type": "string",
571
636
  "const": "bootstrap"
572
- },
573
- "exportEntry": {
574
- "type": "string",
575
- "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."
576
637
  }
577
638
  },
578
639
  "required": [
@@ -582,6 +643,35 @@
582
643
  "additionalProperties": false,
583
644
  "description": "A route that serves a bootstrap script."
584
645
  },
646
+ "RedirectRoute": {
647
+ "type": "object",
648
+ "properties": {
649
+ "match": {
650
+ "anyOf": [
651
+ {
652
+ "type": "string"
653
+ },
654
+ {
655
+ "type": "array",
656
+ "items": {
657
+ "type": "string"
658
+ }
659
+ }
660
+ ],
661
+ "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'`.\n\nUse an array to handle multiple paths with the same route handler."
662
+ },
663
+ "redirectTo": {
664
+ "type": "string",
665
+ "description": "The url to redirect to."
666
+ }
667
+ },
668
+ "required": [
669
+ "match",
670
+ "redirectTo"
671
+ ],
672
+ "additionalProperties": false,
673
+ "description": "A route that redirects to another url."
674
+ },
585
675
  "TelemetryConfig": {
586
676
  "type": "object",
587
677
  "properties": {