@ms-cloudpack/common-types 0.13.4 → 0.14.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.
Files changed (40) hide show
  1. package/lib/ImportMap.d.ts +8 -0
  2. package/lib/ImportMap.d.ts.map +1 -0
  3. package/lib/ImportMap.js +2 -0
  4. package/lib/ImportMap.js.map +1 -0
  5. package/lib/LinkedPath.d.ts +28 -0
  6. package/lib/LinkedPath.d.ts.map +1 -0
  7. package/lib/LinkedPath.js +2 -0
  8. package/lib/LinkedPath.js.map +1 -0
  9. package/lib/RenderFunction.d.ts +7 -0
  10. package/lib/RenderFunction.d.ts.map +1 -0
  11. package/lib/RenderFunction.js +2 -0
  12. package/lib/RenderFunction.js.map +1 -0
  13. package/lib/RenderFunctionOptions.d.ts +21 -0
  14. package/lib/RenderFunctionOptions.d.ts.map +1 -0
  15. package/lib/RenderFunctionOptions.js +2 -0
  16. package/lib/RenderFunctionOptions.js.map +1 -0
  17. package/lib/RenderFunctionResult.d.ts +22 -0
  18. package/lib/RenderFunctionResult.d.ts.map +1 -0
  19. package/lib/RenderFunctionResult.js +2 -0
  20. package/lib/RenderFunctionResult.js.map +1 -0
  21. package/lib/RenderFunctionScript.d.ts +8 -0
  22. package/lib/RenderFunctionScript.d.ts.map +1 -0
  23. package/lib/RenderFunctionScript.js +2 -0
  24. package/lib/RenderFunctionScript.js.map +1 -0
  25. package/lib/ResolveMap.d.ts +6 -0
  26. package/lib/ResolveMap.d.ts.map +1 -0
  27. package/lib/ResolveMap.js +2 -0
  28. package/lib/ResolveMap.js.map +1 -0
  29. package/lib/ResolveMapEntry.d.ts +59 -0
  30. package/lib/ResolveMapEntry.d.ts.map +1 -0
  31. package/lib/ResolveMapEntry.js +2 -0
  32. package/lib/ResolveMapEntry.js.map +1 -0
  33. package/lib/Session.d.ts +77 -0
  34. package/lib/Session.d.ts.map +1 -0
  35. package/lib/Session.js +2 -0
  36. package/lib/Session.js.map +1 -0
  37. package/lib/index.d.ts +10 -0
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js.map +1 -1
  40. package/package.json +4 -1
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ImportMap is a JSON object that describes the mapping of bare module specifiers to URLs.
3
+ */
4
+ export interface ImportMap {
5
+ imports: Record<string, string>;
6
+ scopes?: Record<string, Record<string, string>>;
7
+ }
8
+ //# sourceMappingURL=ImportMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportMap.d.ts","sourceRoot":"","sources":["../src/ImportMap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ImportMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../src/ImportMap.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * ImportMap is a JSON object that describes the mapping of bare module specifiers to URLs.\n */\nexport interface ImportMap {\n imports: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Represents a path linked to the resolve map.
3
+ */
4
+ export interface LinkedPath {
5
+ /**
6
+ * Path to where the link originates.
7
+ */
8
+ path: string;
9
+ /**
10
+ * Optional git root to limit package resolution discovery.
11
+ */
12
+ rootPath?: string;
13
+ /**
14
+ * If true, transitive internal packages will be linked rather than only the matched packages.
15
+ */
16
+ includeAll?: boolean;
17
+ /**
18
+ * Package matches to ignore when linking.
19
+ */
20
+ ignoredPackages?: string[];
21
+ /**
22
+ * If true, ignores resolutions from the host repo definition to the linked packages.
23
+ */
24
+ ignoreResolutions?: boolean;
25
+ /** The strategy to use when resolving linked packages. Defaults to "dedupe". */
26
+ resolveStrategy?: 'dedupe' | 'duplicate';
27
+ }
28
+ //# sourceMappingURL=LinkedPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkedPath.d.ts","sourceRoot":"","sources":["../src/LinkedPath.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,gFAAgF;IAChF,eAAe,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LinkedPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkedPath.js","sourceRoot":"","sources":["../src/LinkedPath.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a path linked to the resolve map.\n */\nexport interface LinkedPath {\n /**\n * Path to where the link originates.\n */\n path: string;\n\n /**\n * Optional git root to limit package resolution discovery.\n */\n rootPath?: string;\n\n /**\n * If true, transitive internal packages will be linked rather than only the matched packages.\n */\n includeAll?: boolean;\n\n /**\n * Package matches to ignore when linking.\n */\n ignoredPackages?: string[];\n\n /**\n * If true, ignores resolutions from the host repo definition to the linked packages.\n */\n ignoreResolutions?: boolean;\n\n /** The strategy to use when resolving linked packages. Defaults to \"dedupe\". */\n resolveStrategy?: 'dedupe' | 'duplicate';\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { RenderFunctionOptions } from './RenderFunctionOptions.js';
2
+ import type { RenderFunctionResult } from './RenderFunctionResult.js';
3
+ /**
4
+ * A custom server render function that can be used to override the default HTML response.
5
+ */
6
+ export type RenderFunction = (options: RenderFunctionOptions) => Promise<RenderFunctionResult> | RenderFunctionResult;
7
+ //# sourceMappingURL=RenderFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunction.d.ts","sourceRoot":"","sources":["../src/RenderFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunction.js","sourceRoot":"","sources":["../src/RenderFunction.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nimport type { RenderFunctionResult } from './RenderFunctionResult.js';\n\n/**\n * A custom server render function that can be used to override the default HTML response.\n */\nexport type RenderFunction = (options: RenderFunctionOptions) => Promise<RenderFunctionResult> | RenderFunctionResult;\n"]}
@@ -0,0 +1,21 @@
1
+ import type { Request, Response } from 'express';
2
+ import type { ImportMap } from './ImportMap.js';
3
+ import type { PackageJson } from './PackageJson.js';
4
+ import type { RenderedRoute } from './Route.js';
5
+ import type { Session } from './Session.js';
6
+ /**
7
+ * The input options for a `renderScript` custom server render function.
8
+ */
9
+ export interface RenderFunctionOptions {
10
+ session: Session;
11
+ route: RenderedRoute;
12
+ baseUrl: string;
13
+ definition: PackageJson;
14
+ importMap: ImportMap;
15
+ overlayScript: string | undefined;
16
+ entryScript: string | undefined;
17
+ inlineScripts: string[];
18
+ req: Request;
19
+ res: Response;
20
+ }
21
+ //# sourceMappingURL=RenderFunctionOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionOptions.d.ts","sourceRoot":"","sources":["../src/RenderFunctionOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionOptions.js","sourceRoot":"","sources":["../src/RenderFunctionOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { Request, Response } from 'express';\nimport type { ImportMap } from './ImportMap.js';\nimport type { PackageJson } from './PackageJson.js';\nimport type { RenderedRoute } from './Route.js';\nimport type { Session } from './Session.js';\n\n/**\n * The input options for a `renderScript` custom server render function.\n */\nexport interface RenderFunctionOptions {\n session: Session;\n route: RenderedRoute;\n baseUrl: string;\n definition: PackageJson;\n importMap: ImportMap;\n overlayScript: string | undefined;\n entryScript: string | undefined;\n inlineScripts: string[];\n req: Request;\n res: Response;\n}\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The complete expected result of the `renderScript` custom server render function.
3
+ */
4
+ export interface ExpandedRenderFunctionResult {
5
+ /** Response body */
6
+ content: string;
7
+ /** Standard HTTP status code - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */
8
+ statusCode: number;
9
+ /** MIME type for the response - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types */
10
+ contentType: string;
11
+ }
12
+ /**
13
+ * The expected result of the `renderScript` custom server render function.
14
+ *
15
+ * If the result is a string, it's assumed to be the HTML content.
16
+ *
17
+ * If an object and the `content` is non-HTML, `contentType` must be set.
18
+ */
19
+ export type RenderFunctionResult = string | ({
20
+ content: string;
21
+ } & Partial<ExpandedRenderFunctionResult>);
22
+ //# sourceMappingURL=RenderFunctionResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionResult.d.ts","sourceRoot":"","sources":["../src/RenderFunctionResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB,4HAA4H;IAC5H,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionResult.js","sourceRoot":"","sources":["../src/RenderFunctionResult.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The complete expected result of the `renderScript` custom server render function.\n */\nexport interface ExpandedRenderFunctionResult {\n /** Response body */\n content: string;\n /** Standard HTTP status code - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */\n statusCode: number;\n /** MIME type for the response - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types */\n contentType: string;\n}\n\n/**\n * The expected result of the `renderScript` custom server render function.\n *\n * If the result is a string, it's assumed to be the HTML content.\n *\n * If an object and the `content` is non-HTML, `contentType` must be set.\n */\nexport type RenderFunctionResult = string | ({ content: string } & Partial<ExpandedRenderFunctionResult>);\n"]}
@@ -0,0 +1,8 @@
1
+ import type { RenderFunction } from './RenderFunction.js';
2
+ /**
3
+ * The expected shape of the `renderScript` custom server render function script.
4
+ */
5
+ export type RenderFunctionScript = {
6
+ default: RenderFunction;
7
+ };
8
+ //# sourceMappingURL=RenderFunctionScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionScript.d.ts","sourceRoot":"","sources":["../src/RenderFunctionScript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionScript.js","sourceRoot":"","sources":["../src/RenderFunctionScript.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderFunction } from './RenderFunction.js';\n\n/**\n * The expected shape of the `renderScript` custom server render function script.\n */\nexport type RenderFunctionScript = { default: RenderFunction };\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ResolveMapEntry } from './ResolveMapEntry.js';
2
+ /**
3
+ * A map of package names to ResolveMapEntry objects.
4
+ */
5
+ export type ResolveMap = Record<string, ResolveMapEntry>;
6
+ //# sourceMappingURL=ResolveMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMap.d.ts","sourceRoot":"","sources":["../src/ResolveMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResolveMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMap.js","sourceRoot":"","sources":["../src/ResolveMap.ts"],"names":[],"mappings":"","sourcesContent":["import type { ResolveMapEntry } from './ResolveMapEntry.js';\n\n/**\n * A map of package names to ResolveMapEntry objects.\n */\nexport type ResolveMap = Record<string, ResolveMapEntry>;\n"]}
@@ -0,0 +1,59 @@
1
+ export type ResolveMapEntry = {
2
+ /**
3
+ * Package name.
4
+ *
5
+ * If the package was pulled in as a renamed non-semver dep, this will be the name specified in
6
+ * the parent's dependencies (not the actual name).
7
+ */
8
+ name: string;
9
+ /**
10
+ * Resolved/installed package version. For a linked internal package, this will end in `-linked`.
11
+ * (The docs for `isExternal` explain what "internal" means.)
12
+ *
13
+ * If the package was pulled in as a non-semver dep, this will be the transformed version
14
+ * (e.g. `0.0.0-npm-foo-1-0-0`) based on the parent's dependencies.
15
+ */
16
+ version: string;
17
+ /** Path to the resolved/installed package. */
18
+ path: string;
19
+ /**
20
+ * Map from dependency name to resolved/installed version.
21
+ *
22
+ * For any non-semver deps, the key (name) is as specified in package.json dependencies,
23
+ * mapped to the transformed version (e.g. `0.0.0-npm-foo-1-0-0`).
24
+ */
25
+ dependencies: Record<string, string>;
26
+ /**
27
+ * Map from requesting/parent package name `@` the actual version of that package to
28
+ * the original semver range of this package that it requested.
29
+ *
30
+ * Example: if this entry is for package `bar`, and `foo@1.0.0` depends on `"bar": "^2.0.0"`,
31
+ * this will be `{ "foo@1.0.0": "^2.0.0" }`.
32
+ *
33
+ * If the parent package was pulled in by its parent (the grandparent) as a non-semver dep,
34
+ * the key will use the name as specified by the grandparent and the transformed version.
35
+ */
36
+ requiredBy: Record<`${string}@${string}`, string>;
37
+ /**
38
+ * A package is considered "external" if it was installed from a package manager (its realpath
39
+ * contains `node_modules`). This is the opposite of "internal", which means that the package
40
+ * is defined in a local folder/repo.
41
+ */
42
+ isExternal?: boolean;
43
+ /**
44
+ * Whether this package is linked **AND** is internal to its actual folder/repo.
45
+ * (The docs for `isExternal` explain what "internal" means.)
46
+ */
47
+ isLinked?: boolean;
48
+ /**
49
+ * Additional installed versions of this package, which are required per semver by some other
50
+ * package in the map.
51
+ *
52
+ * For any version that was pulled in as a non-semver dep, the key will be the transformed
53
+ * version (e.g. `0.0.0-npm-foo-1-0-0`).
54
+ */
55
+ scopedVersions?: {
56
+ [version: string]: ResolveMapEntry;
57
+ };
58
+ };
59
+ //# sourceMappingURL=ResolveMapEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMapEntry.d.ts","sourceRoot":"","sources":["../src/ResolveMapEntry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC;;;;;;;;;OASG;IACH,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IAElD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAC;KACpC,CAAC;CACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResolveMapEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMapEntry.js","sourceRoot":"","sources":["../src/ResolveMapEntry.ts"],"names":[],"mappings":"","sourcesContent":["export type ResolveMapEntry = {\n /**\n * Package name.\n *\n * If the package was pulled in as a renamed non-semver dep, this will be the name specified in\n * the parent's dependencies (not the actual name).\n */\n name: string;\n\n /**\n * Resolved/installed package version. For a linked internal package, this will end in `-linked`.\n * (The docs for `isExternal` explain what \"internal\" means.)\n *\n * If the package was pulled in as a non-semver dep, this will be the transformed version\n * (e.g. `0.0.0-npm-foo-1-0-0`) based on the parent's dependencies.\n */\n version: string;\n\n /** Path to the resolved/installed package. */\n path: string;\n\n /**\n * Map from dependency name to resolved/installed version.\n *\n * For any non-semver deps, the key (name) is as specified in package.json dependencies,\n * mapped to the transformed version (e.g. `0.0.0-npm-foo-1-0-0`).\n */\n dependencies: Record<string, string>;\n\n /**\n * Map from requesting/parent package name `@` the actual version of that package to\n * the original semver range of this package that it requested.\n *\n * Example: if this entry is for package `bar`, and `foo@1.0.0` depends on `\"bar\": \"^2.0.0\"`,\n * this will be `{ \"foo@1.0.0\": \"^2.0.0\" }`.\n *\n * If the parent package was pulled in by its parent (the grandparent) as a non-semver dep,\n * the key will use the name as specified by the grandparent and the transformed version.\n */\n requiredBy: Record<`${string}@${string}`, string>;\n\n /**\n * A package is considered \"external\" if it was installed from a package manager (its realpath\n * contains `node_modules`). This is the opposite of \"internal\", which means that the package\n * is defined in a local folder/repo.\n */\n isExternal?: boolean;\n\n /**\n * Whether this package is linked **AND** is internal to its actual folder/repo.\n * (The docs for `isExternal` explain what \"internal\" means.)\n */\n isLinked?: boolean;\n\n /**\n * Additional installed versions of this package, which are required per semver by some other\n * package in the map.\n *\n * For any version that was pulled in as a non-semver dep, the key will be the transformed\n * version (e.g. `0.0.0-npm-foo-1-0-0`).\n */\n scopedVersions?: {\n [version: string]: ResolveMapEntry;\n };\n};\n"]}
@@ -0,0 +1,77 @@
1
+ import type { ImportMap } from './ImportMap.js';
2
+ import type { LinkedPath } from './LinkedPath.js';
3
+ import type { ResolveMap } from './ResolveMap.js';
4
+ import type { CloudpackConfig } from './CloudpackConfig.js';
5
+ export interface Session {
6
+ /**
7
+ * The session id, used for identifying
8
+ */
9
+ id: string;
10
+ /**
11
+ * The config used by the session.
12
+ */
13
+ config: CloudpackConfig;
14
+ /**
15
+ * Used to resolve packages in the dependency graph.
16
+ */
17
+ resolveMap: ResolveMap;
18
+ /**
19
+ * Reload sequence to ensure that the client is always up to date with the latest changes.
20
+ */
21
+ sequence: number;
22
+ /**
23
+ * URLs of the active servers hosting this session.
24
+ * Each URL will only be set after the server is started.
25
+ */
26
+ urls: {
27
+ appServer?: string;
28
+ /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */
29
+ bundleServer?: string;
30
+ apiServer?: string;
31
+ };
32
+ /**
33
+ * Used to force a hard refresh on the client.
34
+ */
35
+ sessionVersion: number;
36
+ /**
37
+ * Used to increment the session version by 1.
38
+ */
39
+ incrementSessionVersion: () => void;
40
+ /**
41
+ * The name of the project folder.
42
+ * Used to differentiate between multiple projects.
43
+ */
44
+ projectName: string;
45
+ /**
46
+ * The version of each target.
47
+ * Used to force a client cache refresh on a single target.
48
+ */
49
+ targetVersions: Record<string, number>;
50
+ /**
51
+ * Increments the version for the given target.
52
+ */
53
+ incrementTargetVersion: (inputPath: string) => void;
54
+ /**
55
+ * The import map for the session.
56
+ */
57
+ importMap: ImportMap | undefined;
58
+ /**
59
+ * Linked paths that are used to resolve packages from other repos.
60
+ */
61
+ linkedPaths: LinkedPath[];
62
+ /**
63
+ * Add the linked path and regenerates the resolve map.
64
+ */
65
+ addLinkedPath: (linkedPath: LinkedPath) => Promise<{
66
+ resolveMap: ResolveMap;
67
+ linkedPaths: LinkedPath[];
68
+ }>;
69
+ /**
70
+ * Remove the linked path and regenerates the resolve map.
71
+ */
72
+ removeLinkedPath: (linkedPath: LinkedPath) => Promise<{
73
+ resolveMap: ResolveMap;
74
+ linkedPaths: Linked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AAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;IAE1G;;OAEG;IACH,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9G"}
package/lib/Session.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from './ImportMap.js';\nimport type { LinkedPath } from './LinkedPath.js';\nimport type { ResolveMap } from './ResolveMap.js';\nimport type { CloudpackConfig } from './CloudpackConfig.js';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n\n /**\n * Linked paths that are used to resolve packages from other repos.\n */\n linkedPaths: LinkedPath[];\n\n /**\n * Add the linked path and regenerates the resolve map.\n */\n addLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * Remove the linked path and regenerates the resolve map.\n */\n removeLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -25,4 +25,14 @@ export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } fro
25
25
  export type { TelemetryConfig } from './TelemetryConfig.js';
26
26
  export type { AppConfig } from './AppConfig.js';
27
27
  export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
28
+ export type { RenderFunction } from './RenderFunction.js';
29
+ export type { RenderFunctionOptions } from './RenderFunctionOptions.js';
30
+ export type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';
31
+ export type { RenderFunctionScript } from './RenderFunctionScript.js';
32
+ export type { Request, Response } from 'express';
33
+ export type { Session } from './Session.js';
34
+ export type { ResolveMap } from './ResolveMap.js';
35
+ export type { ResolveMapEntry } from './ResolveMapEntry.js';
36
+ export type { LinkedPath } from './LinkedPath.js';
37
+ export type { ImportMap } from './ImportMap.js';
28
38
  //# 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;A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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, PackageSettingsMatch } 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"]}
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, PackageSettingsMatch } 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';\nexport type { RenderFunction } from './RenderFunction.js';\nexport type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nexport type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';\nexport type { RenderFunctionScript } from './RenderFunctionScript.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.13.4",
3
+ "version": "0.14.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,6 +13,9 @@
13
13
  "import": "./lib/index.js"
14
14
  }
15
15
  },
16
+ "dependencies": {
17
+ "@types/express": "^4.17.16"
18
+ },
16
19
  "devDependencies": {
17
20
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
18
21
  "@ms-cloudpack/scripts": "^0.0.1"