@typespec/http-server-js 0.58.0-alpha.13-dev.8 → 0.58.0-alpha.13-dev.10

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 (70) hide show
  1. package/.testignore +0 -1
  2. package/README.md +13 -0
  3. package/build-helpers.ts +22 -9
  4. package/dist/generated-defs/helpers/index.d.ts.map +1 -1
  5. package/dist/generated-defs/helpers/index.js +1 -0
  6. package/dist/generated-defs/helpers/index.js.map +1 -1
  7. package/dist/generated-defs/helpers/temporal/index.d.ts +4 -0
  8. package/dist/generated-defs/helpers/temporal/index.d.ts.map +1 -0
  9. package/dist/generated-defs/helpers/temporal/index.js +19 -0
  10. package/dist/generated-defs/helpers/temporal/index.js.map +1 -0
  11. package/dist/generated-defs/helpers/temporal/native.d.ts +4 -0
  12. package/dist/generated-defs/helpers/temporal/native.d.ts.map +1 -0
  13. package/dist/generated-defs/helpers/temporal/native.js +125 -0
  14. package/dist/generated-defs/helpers/temporal/native.js.map +1 -0
  15. package/dist/generated-defs/helpers/temporal/polyfill.d.ts +4 -0
  16. package/dist/generated-defs/helpers/temporal/polyfill.d.ts.map +1 -0
  17. package/dist/generated-defs/helpers/temporal/polyfill.js +124 -0
  18. package/dist/generated-defs/helpers/temporal/polyfill.js.map +1 -0
  19. package/dist/generated-defs/package.json.d.ts.map +1 -1
  20. package/dist/generated-defs/package.json.js +1 -0
  21. package/dist/generated-defs/package.json.js.map +1 -1
  22. package/dist/src/common/declaration.js +1 -1
  23. package/dist/src/common/declaration.js.map +1 -1
  24. package/dist/src/common/scalar.d.ts +1 -1
  25. package/dist/src/common/scalar.d.ts.map +1 -1
  26. package/dist/src/common/scalar.js +341 -49
  27. package/dist/src/common/scalar.js.map +1 -1
  28. package/dist/src/common/serialization/index.d.ts +2 -2
  29. package/dist/src/common/serialization/index.d.ts.map +1 -1
  30. package/dist/src/common/serialization/index.js +3 -9
  31. package/dist/src/common/serialization/index.js.map +1 -1
  32. package/dist/src/common/serialization/json.d.ts +2 -0
  33. package/dist/src/common/serialization/json.d.ts.map +1 -1
  34. package/dist/src/common/serialization/json.js +10 -19
  35. package/dist/src/common/serialization/json.js.map +1 -1
  36. package/dist/src/helpers/temporal/native.d.ts +40 -0
  37. package/dist/src/helpers/temporal/native.d.ts.map +1 -0
  38. package/dist/src/helpers/temporal/native.js +81 -0
  39. package/dist/src/helpers/temporal/native.js.map +1 -0
  40. package/dist/src/helpers/temporal/polyfill.d.ts +41 -0
  41. package/dist/src/helpers/temporal/polyfill.d.ts.map +1 -0
  42. package/dist/src/helpers/temporal/polyfill.js +80 -0
  43. package/dist/src/helpers/temporal/polyfill.js.map +1 -0
  44. package/dist/src/http/server/index.d.ts.map +1 -1
  45. package/dist/src/http/server/index.js +4 -1
  46. package/dist/src/http/server/index.js.map +1 -1
  47. package/dist/src/lib.d.ts +9 -0
  48. package/dist/src/lib.d.ts.map +1 -1
  49. package/dist/src/lib.js +7 -0
  50. package/dist/src/lib.js.map +1 -1
  51. package/dist/src/scripts/scaffold/data-mocks.d.ts.map +1 -1
  52. package/dist/src/scripts/scaffold/data-mocks.js +91 -32
  53. package/dist/src/scripts/scaffold/data-mocks.js.map +1 -1
  54. package/generated-defs/helpers/index.ts +1 -0
  55. package/generated-defs/helpers/temporal/index.ts +25 -0
  56. package/generated-defs/helpers/temporal/native.ts +132 -0
  57. package/generated-defs/helpers/temporal/polyfill.ts +131 -0
  58. package/generated-defs/package.json.ts +1 -0
  59. package/package.json +6 -5
  60. package/src/common/declaration.ts +1 -1
  61. package/src/common/scalar.ts +390 -62
  62. package/src/common/serialization/index.ts +4 -13
  63. package/src/common/serialization/json.ts +22 -25
  64. package/src/helpers/temporal/native.ts +104 -0
  65. package/src/helpers/temporal/polyfill.ts +103 -0
  66. package/src/http/server/index.ts +6 -1
  67. package/src/lib.ts +17 -0
  68. package/src/scripts/scaffold/data-mocks.ts +97 -32
  69. package/temp/tsconfig.tsbuildinfo +1 -1
  70. package/test/scalar.test.ts +547 -97
package/.testignore CHANGED
@@ -1,4 +1,3 @@
1
- encode/datetime
2
1
  payload/multipart
3
2
  payload/xml
4
3
  response/status-code-range
package/README.md CHANGED
@@ -37,6 +37,13 @@ options:
37
37
 
38
38
  ## Emitter options
39
39
 
40
+ ### `emitter-output-dir`
41
+
42
+ **Type:** `absolutePath`
43
+
44
+ Defines the emitter output directory. Defaults to `{output-dir}/@typespec/http-server-js`
45
+ See [Configuring output directory for more info](https://typespec.io/docs/handbook/configuration/configuration/#configuring-output-directory)
46
+
40
47
  ### `express`
41
48
 
42
49
  **Type:** `boolean`
@@ -45,6 +52,12 @@ If set to `true`, the emitter will generate a router that exposes an Express.js
45
52
 
46
53
  If this option is not set to `true`, the `expressMiddleware` property will not be present on the generated router.
47
54
 
55
+ ### `datetime`
56
+
57
+ **Type:** `"temporal-polyfill" | "temporal" | "date-duration"`
58
+
59
+ The type of datetime models to use for TypeSpecs DateTime and Duration types.
60
+
48
61
  ### `omit-unreachable-types`
49
62
 
50
63
  **Type:** `boolean`
package/build-helpers.ts CHANGED
@@ -104,12 +104,10 @@ async function main() {
104
104
  const contents = await fs.readFile(file, "utf-8");
105
105
 
106
106
  let childModuleLines =
107
- childModules
108
- ?.filter((m) => path.basename(m, ".ts") !== "index")
109
- .map((child) => {
110
- const childBase = path.basename(child, ".ts");
111
- return ` await import("./${childBase}.js").then((m) => m.createModule(module));`;
112
- }) ?? [];
107
+ childModules?.map((child) => {
108
+ const childBase = path.basename(child, ".ts");
109
+ return ` await import("./${childBase}.js").then((m) => m.createModule(module));`;
110
+ }) ?? [];
113
111
 
114
112
  if (childModuleLines.length > 0) {
115
113
  childModuleLines = [" // Child modules", ...childModuleLines, ""];
@@ -160,9 +158,24 @@ async function main() {
160
158
 
161
159
  const targetPath = path.resolve(HELPER_DECLARATION_PATH, relativePath, "index.ts");
162
160
 
163
- const children = files.map((file) => {
164
- return ` await import("./${path.basename(file, ".ts")}.js").then((m) => m.createModule(module));`;
165
- });
161
+ const childIndices = new Set(
162
+ allFiles
163
+ .filter((f) => f.startsWith(dir))
164
+ // Remove the directory prefix and then check if it's a nested directory lower.
165
+ .map((f) => /^[/\\]([a-zA-Z_-]+)[/\\]/.exec(f.replace(dir, "")))
166
+ .filter((match) => !!match)
167
+ .map((match) => match[1]),
168
+ );
169
+
170
+ const children = [
171
+ ...[...childIndices].map((dir) => {
172
+ return ` await import("./${dir}/index.js").then((m) => m.createModule(module));`;
173
+ }),
174
+
175
+ ...files.map((file) => {
176
+ return ` await import("./${path.basename(file, ".ts")}.js").then((m) => m.createModule(module));`;
177
+ }),
178
+ ];
166
179
 
167
180
  const transformed = [
168
181
  "// Copyright (c) Microsoft Corporation",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../generated-defs/helpers/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,eAAO,IAAI,MAAM,EAAE,MAAyB,CAAC;AAE7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBlE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../generated-defs/helpers/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,eAAO,IAAI,MAAM,EAAE,MAAyB,CAAC;AAE7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBlE"}
@@ -11,6 +11,7 @@ export async function createModule(parent) {
11
11
  declarations: [],
12
12
  };
13
13
  // Child modules
14
+ await import("./temporal/index.js").then((m) => m.createModule(module));
14
15
  await import("./datetime.js").then((m) => m.createModule(module));
15
16
  await import("./header.js").then((m) => m.createModule(module));
16
17
  await import("./http.js").then((m) => m.createModule(module));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../generated-defs/helpers/index.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@@ -0,0 +1,4 @@
1
+ import { Module } from "../../../src/ctx.js";
2
+ export declare let module: Module;
3
+ export declare function createModule(parent: Module): Promise<Module>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,eAAO,IAAI,MAAM,EAAE,MAAyB,CAAC;AAE7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlE"}
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Microsoft Corporation
2
+ // Licensed under the MIT license.
3
+ export let module = undefined;
4
+ export async function createModule(parent) {
5
+ if (module)
6
+ return module;
7
+ module = {
8
+ name: "temporal",
9
+ cursor: parent.cursor.enter("temporal"),
10
+ imports: [],
11
+ declarations: [],
12
+ };
13
+ // Child modules
14
+ await import("./native.js").then((m) => m.createModule(module));
15
+ await import("./polyfill.js").then((m) => m.createModule(module));
16
+ parent.declarations.push(module);
17
+ return module;
18
+ }
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAIlC,MAAM,CAAC,IAAI,MAAM,GAAW,SAAgB,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAc;IAC/C,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,GAAG;QACP,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;QACvC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,gBAAgB;IAChB,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAElE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Module } from "../../../src/ctx.js";
2
+ export declare let module: Module;
3
+ export declare function createModule(parent: Module): Promise<Module>;
4
+ //# sourceMappingURL=native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/native.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,eAAO,IAAI,MAAM,EAAE,MAAyB,CAAC;AA+G7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAelE"}
@@ -0,0 +1,125 @@
1
+ // Copyright (c) Microsoft Corporation
2
+ // Licensed under the MIT license.
3
+ export let module = undefined;
4
+ // prettier-ignore
5
+ const lines = [
6
+ "// Copyright (c) Microsoft Corporation",
7
+ "// Licensed under the MIT license.",
8
+ "",
9
+ "// Due to the lack of generally-available global type definitions for Temporal, we use `any` throughout this module.",
10
+ "// When global.d.ts eventually has definitions for Temporal, we can unify this module with `polyfill.ts`.",
11
+ "",
12
+ "/**",
13
+ " * Parses an HTTP date string (e.g. `Wed, 21 Oct 2015 07:28:00 GMT`) into a `Temporal.Instant`.",
14
+ " * The date string must be in the format specified by RFC 7231.",
15
+ " *",
16
+ " * @param httpDate - The HTTP date string to parse.",
17
+ " * @throws {RangeError} If the date string is invalid or cannot be parsed.",
18
+ " * @returns The parsed `Temporal.Instant`.",
19
+ " */",
20
+ "export function parseHttpDate(httpDate: string): any {",
21
+ " const timestamp = globalThis.Date.parse(httpDate);",
22
+ "",
23
+ " if (isNaN(timestamp)) {",
24
+ " throw new RangeError(`Invalid HTTP date: ${httpDate}`);",
25
+ " }",
26
+ "",
27
+ " return (globalThis as any).Temporal.Instant.fromEpochMilliseconds(timestamp);",
28
+ "}",
29
+ "",
30
+ "/**",
31
+ " * Formats a `Temporal.Instant` into an HTTP date string (e.g. `Wed, 21 Oct 2015 07:28:00 GMT`).",
32
+ " * The date string is formatted according to RFC 7231.",
33
+ " *",
34
+ " * @param instant - The `Temporal.Instant` to format.",
35
+ " * @returns The formatted HTTP date string.",
36
+ " */",
37
+ "export function formatHttpDate(instant: any) {",
38
+ " const date = new Date(instant.epochMilliseconds);",
39
+ " return date.toUTCString();",
40
+ "}",
41
+ "",
42
+ "/**",
43
+ " * Converts a `Temporal.Duration` to a number of seconds.",
44
+ " * This method will throw an Error if the duration contains any years, months, weeks, or days, as those require a reference",
45
+ " * point to calculate the total number of seconds.",
46
+ " *",
47
+ " * WARNING: If the total number of seconds is larger than the maximum safe integer in JavaScript, this method will",
48
+ " * lose precision. @see durationTotalSecondsBigInt for a BigInt alternative.",
49
+ " *",
50
+ " * @param duration - the duration to calculate the total number of seconds for",
51
+ " * @returns the total number of seconds in the duration",
52
+ " */",
53
+ "export function durationTotalSeconds(duration: any): number {",
54
+ " if (",
55
+ " duration.years !== 0 ||",
56
+ " duration.months !== 0 ||",
57
+ " duration.weeks !== 0 ||",
58
+ " duration.days !== 0",
59
+ " ) {",
60
+ " throw new Error(",
61
+ " \"Cannot calculate total seconds for a duration with years, months, weeks, or days.\",",
62
+ " );",
63
+ " }",
64
+ "",
65
+ " return (",
66
+ " duration.seconds +",
67
+ " duration.minutes * 60 +",
68
+ " duration.hours * 60 * 60 +",
69
+ " duration.days * 24 * 60 * 60",
70
+ " );",
71
+ "}",
72
+ "",
73
+ "/**",
74
+ " * Gets the total number of seconds in a duration.",
75
+ " *",
76
+ " * This method will throw an Error if the duration contains any years, months, weeks, or days, as those require a reference",
77
+ " * point to calculate the total number of seconds. It will also throw an error if any of the components are not integers.",
78
+ " *",
79
+ " * @param duration - the duration to calculate the total number of seconds for",
80
+ " * @returns the total number of seconds in the duration",
81
+ " */",
82
+ "export function durationTotalSecondsBigInt(duration: any): bigint {",
83
+ " if (",
84
+ " duration.years !== 0 ||",
85
+ " duration.months !== 0 ||",
86
+ " duration.weeks !== 0 ||",
87
+ " duration.days !== 0",
88
+ " ) {",
89
+ " throw new Error(",
90
+ " \"Cannot calculate total seconds for a duration with years, months, weeks, or days.\",",
91
+ " );",
92
+ " }",
93
+ "",
94
+ " if (",
95
+ " !Number.isInteger(duration.seconds) ||",
96
+ " !Number.isInteger(duration.minutes) ||",
97
+ " !Number.isInteger(duration.hours) ||",
98
+ " !Number.isInteger(duration.days)",
99
+ " ) {",
100
+ " throw new Error(\"Duration components must be integers.\");",
101
+ " }",
102
+ "",
103
+ " return (",
104
+ " BigInt(duration.seconds) +",
105
+ " BigInt(duration.minutes) * 60n +",
106
+ " BigInt(duration.hours) * 60n * 60n +",
107
+ " BigInt(duration.days) * 24n * 60n * 60n",
108
+ " );",
109
+ "}",
110
+ "",
111
+ ];
112
+ export async function createModule(parent) {
113
+ if (module)
114
+ return module;
115
+ module = {
116
+ name: "native",
117
+ cursor: parent.cursor.enter("native"),
118
+ imports: [],
119
+ declarations: [],
120
+ };
121
+ module.declarations.push(lines);
122
+ parent.declarations.push(module);
123
+ return module;
124
+ }
125
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/native.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAIlC,MAAM,CAAC,IAAI,MAAM,GAAW,SAAgB,CAAC;AAE7C,kBAAkB;AAClB,MAAM,KAAK,GAAG;IACZ,wCAAwC;IACxC,oCAAo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AO;IACP,iEAAiE;IACjE,KAAK;IACL,EAAE;IACF,YAAY;IACZ,gCAAgC;IAChC,sCAAsC;IACtC,0CAA0C;IAC1C,6CAA6C;IAC7C,MAAM;IACN,GAAG;IACH,EAAE;CACH,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAc;IAC/C,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,GAAG;QACP,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;QACrC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Module } from "../../../src/ctx.js";
2
+ export declare let module: Module;
3
+ export declare function createModule(parent: Module): Promise<Module>;
4
+ //# sourceMappingURL=polyfill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/polyfill.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,eAAO,IAAI,MAAM,EAAE,MAAyB,CAAC;AA8G7C,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAelE"}
@@ -0,0 +1,124 @@
1
+ // Copyright (c) Microsoft Corporation
2
+ // Licensed under the MIT license.
3
+ export let module = undefined;
4
+ // prettier-ignore
5
+ const lines = [
6
+ "// Copyright (c) Microsoft Corporation",
7
+ "// Licensed under the MIT license.",
8
+ "",
9
+ "import { Temporal } from \"temporal-polyfill\";",
10
+ "",
11
+ "/**",
12
+ " * Parses an HTTP date string (e.g. `Wed, 21 Oct 2015 07:28:00 GMT`) into a `Temporal.Instant`.",
13
+ " * The date string must be in the format specified by RFC 7231.",
14
+ " *",
15
+ " * @param httpDate - The HTTP date string to parse.",
16
+ " * @throws {RangeError} If the date string is invalid or cannot be parsed.",
17
+ " * @returns The parsed `Temporal.Instant`.",
18
+ " */",
19
+ "export function parseHttpDate(httpDate: string): Temporal.Instant {",
20
+ " const timestamp = globalThis.Date.parse(httpDate);",
21
+ "",
22
+ " if (isNaN(timestamp)) {",
23
+ " throw new RangeError(`Invalid HTTP date: ${httpDate}`);",
24
+ " }",
25
+ "",
26
+ " return Temporal.Instant.fromEpochMilliseconds(timestamp);",
27
+ "}",
28
+ "",
29
+ "/**",
30
+ " * Formats a `Temporal.Instant` into an HTTP date string (e.g. `Wed, 21 Oct 2015 07:28:00 GMT`).",
31
+ " * The date string is formatted according to RFC 7231.",
32
+ " *",
33
+ " * @param instant - The `Temporal.Instant` to format.",
34
+ " * @returns The formatted HTTP date string.",
35
+ " */",
36
+ "export function formatHttpDate(instant: Temporal.Instant) {",
37
+ " const date = new Date(instant.epochMilliseconds);",
38
+ " return date.toUTCString();",
39
+ "}",
40
+ "",
41
+ "/**",
42
+ " * Converts a `Temporal.Duration` to a number of seconds.",
43
+ " * This method will throw an Error if the duration contains any years, months, weeks, or days, as those require a reference",
44
+ " * point to calculate the total number of seconds.",
45
+ " *",
46
+ " * WARNING: If the total number of seconds is larger than the maximum safe integer in JavaScript, this method will",
47
+ " * lose precision. @see durationTotalSecondsBigInt for a BigInt alternative.",
48
+ " *",
49
+ " * @param duration - the duration to calculate the total number of seconds for",
50
+ " * @returns the total number of seconds in the duration",
51
+ " */",
52
+ "export function durationTotalSeconds(duration: Temporal.Duration): number {",
53
+ " if (",
54
+ " duration.years !== 0 ||",
55
+ " duration.months !== 0 ||",
56
+ " duration.weeks !== 0 ||",
57
+ " duration.days !== 0",
58
+ " ) {",
59
+ " throw new Error(",
60
+ " \"Cannot calculate total seconds for a duration with years, months, weeks, or days.\",",
61
+ " );",
62
+ " }",
63
+ "",
64
+ " return (",
65
+ " duration.seconds +",
66
+ " duration.minutes * 60 +",
67
+ " duration.hours * 60 * 60 +",
68
+ " duration.days * 24 * 60 * 60",
69
+ " );",
70
+ "}",
71
+ "",
72
+ "/**",
73
+ " * Gets the total number of seconds in a duration.",
74
+ " *",
75
+ " * This method will throw an Error if the duration contains any years, months, weeks, or days, as those require a reference",
76
+ " * point to calculate the total number of seconds. It will also throw an error if any of the components are not integers.",
77
+ " *",
78
+ " * @param duration - the duration to calculate the total number of seconds for",
79
+ " * @returns the total number of seconds in the duration",
80
+ " */",
81
+ "export function durationTotalSecondsBigInt(duration: Temporal.Duration): bigint {",
82
+ " if (",
83
+ " duration.years !== 0 ||",
84
+ " duration.months !== 0 ||",
85
+ " duration.weeks !== 0 ||",
86
+ " duration.days !== 0",
87
+ " ) {",
88
+ " throw new Error(",
89
+ " \"Cannot calculate total seconds for a duration with years, months, weeks, or days.\",",
90
+ " );",
91
+ " }",
92
+ "",
93
+ " if (",
94
+ " !Number.isInteger(duration.seconds) ||",
95
+ " !Number.isInteger(duration.minutes) ||",
96
+ " !Number.isInteger(duration.hours) ||",
97
+ " !Number.isInteger(duration.days)",
98
+ " ) {",
99
+ " throw new Error(\"Duration components must be integers.\");",
100
+ " }",
101
+ "",
102
+ " return (",
103
+ " BigInt(duration.seconds) +",
104
+ " BigInt(duration.minutes) * 60n +",
105
+ " BigInt(duration.hours) * 60n * 60n +",
106
+ " BigInt(duration.days) * 24n * 60n * 60n",
107
+ " );",
108
+ "}",
109
+ "",
110
+ ];
111
+ export async function createModule(parent) {
112
+ if (module)
113
+ return module;
114
+ module = {
115
+ name: "polyfill",
116
+ cursor: parent.cursor.enter("polyfill"),
117
+ imports: [],
118
+ declarations: [],
119
+ };
120
+ module.declarations.push(lines);
121
+ parent.declarations.push(module);
122
+ return module;
123
+ }
124
+ //# sourceMappingURL=polyfill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill.js","sourceRoot":"","sources":["../../../../generated-defs/helpers/temporal/polyfill.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAIlC,MAAM,CAAC,IAAI,MAAM,GAAW,SAAgB,CAAC;AAE7C,kBAAkB;AAClB,MAAM,KAAK,GAAG;IACZ,wCAAwC;IACxC,oCAAoC;IACpC,EAAE;IACF,iDAAiD;IACjD,EAAE;IACF,KAAK;IACL,iGAAiG;IACjG,iEAAiE;IACjE,IAAI;IACJ,qDAAqD;IACrD,4EAA4E;IAC5E,4CAA4C;IAC5C,KAAK;IACL,qEAAqE;IACrE,sDAAsD;IACtD,EAAE;IACF,2BAA2B;IAC3B,6DAA6D;IAC7D,KAAK;IACL,EAAE;IACF,6DAA6D;IAC7D,GAAG;IACH,EAAE;IACF,KAAK;IACL,kGAAkG;IAClG,wDAAwD;IACxD,IAAI;IACJ,uDAAuD;IACvD,6CAA6C;IAC7C,KAAK;IACL,6DAA6D;IAC7D,qDAAqD;IACrD,8BAA8B;IAC9B,GAAG;IACH,EAAE;IACF,KAAK;IACL,2DAA2D;IAC3D,6HAA6H;IAC7H,oDAAoD;IACpD,IAAI;IACJ,oHAAoH;IACpH,8EAA8E;IAC9E,IAAI;IACJ,gFAAgF;IAChF,yDAAyD;IACzD,KAAK;IACL,6EAA6E;IAC7E,QAAQ;IACR,6BAA6B;IAC7B,8BAA8B;IAC9B,6BAA6B;IAC7B,yBAAyB;IACzB,OAAO;IACP,sBAAsB;IACtB,8FAA8F;IAC9F,QAAQ;IACR,KAAK;IACL,EAAE;IACF,YAAY;IACZ,wBAAwB;IACxB,6BAA6B;IAC7B,gCAAgC;IAChC,kCAAkC;IAClC,MAAM;IACN,GAAG;IACH,EAAE;IACF,KAAK;IACL,oDAAoD;IACpD,IAAI;IACJ,6HAA6H;IAC7H,2HAA2H;IAC3H,IAAI;IACJ,gFAAgF;IAChF,yDAAyD;IACzD,KAAK;IACL,mFAAmF;IACnF,QAAQ;IACR,6BAA6B;IAC7B,8BAA8B;IAC9B,6BAA6B;IAC7B,yBAAyB;IACzB,OAAO;IACP,sBAAsB;IACtB,8FAA8F;IAC9F,QAAQ;IACR,KAAK;IACL,EAAE;IACF,QAAQ;IACR,4CAA4C;IAC5C,4CAA4C;IAC5C,0CAA0C;IAC1C,sCAAsC;IACtC,OAAO;IACP,iEAAiE;IACjE,KAAK;IACL,EAAE;IACF,YAAY;IACZ,gCAAgC;IAChC,sCAAsC;IACtC,0CAA0C;IAC1C,6CAA6C;IAC7C,MAAM;IACN,GAAG;IACH,EAAE;CACH,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAc;IAC/C,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAE1B,MAAM,GAAG;QACP,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;QACvC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.d.ts","sourceRoot":"","sources":["../../generated-defs/package.json.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+BnD,CAAC"}
1
+ {"version":3,"file":"package.json.d.ts","sourceRoot":"","sources":["../../generated-defs/package.json.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgCnD,CAAC"}
@@ -26,6 +26,7 @@ export const hsjsDependencies = {
26
26
  "pathe": "^2.0.3",
27
27
  "picocolors": "~1.1.1",
28
28
  "swagger-ui-express": "^5.0.1",
29
+ "temporal-polyfill": "^0.3.0",
29
30
  "tsx": "^4.19.3",
30
31
  "typescript": "~5.8.2",
31
32
  "vitest": "^3.0.9",
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.js","sourceRoot":"","sources":["../../generated-defs/package.json.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAElC,kBAAkB;AAElB,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,gBAAgB,EAAE,QAAQ;IAC1B,eAAe,EAAE,QAAQ;IACzB,aAAa,EAAE,WAAW;IAC1B,2BAA2B,EAAE,QAAQ;IACrC,oBAAoB,EAAE,aAAa;IACnC,gBAAgB,EAAE,aAAa;IAC/B,sBAAsB,EAAE,aAAa;IACrC,gCAAgC,EAAE,aAAa;IAC/C,oBAAoB,EAAE,aAAa;IACnC,mBAAmB,EAAE,aAAa;IAClC,gBAAgB,EAAE,aAAa;IAC/B,qBAAqB,EAAE,QAAQ;IAC/B,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,QAAQ;IACjB,YAAY,EAAE,QAAQ;IACtB,oBAAoB,EAAE,QAAQ;IAC9B,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,QAAQ;CACjB,CAAC"}
1
+ {"version":3,"file":"package.json.js","sourceRoot":"","sources":["../../generated-defs/package.json.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAElC,kBAAkB;AAElB,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,gBAAgB,EAAE,QAAQ;IAC1B,eAAe,EAAE,QAAQ;IACzB,aAAa,EAAE,WAAW;IAC1B,2BAA2B,EAAE,QAAQ;IACrC,oBAAoB,EAAE,aAAa;IACnC,gBAAgB,EAAE,aAAa;IAC/B,sBAAsB,EAAE,aAAa;IACrC,gCAAgC,EAAE,aAAa;IAC/C,oBAAoB,EAAE,aAAa;IACnC,mBAAmB,EAAE,aAAa;IAClC,gBAAgB,EAAE,aAAa;IAC/B,qBAAqB,EAAE,QAAQ;IAC/B,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,QAAQ;IACjB,YAAY,EAAE,QAAQ;IACtB,oBAAoB,EAAE,QAAQ;IAC9B,mBAAmB,EAAE,QAAQ;IAC7B,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,QAAQ;CACjB,CAAC"}
@@ -34,7 +34,7 @@ export function* emitDeclaration(ctx, type, module, altName) {
34
34
  break;
35
35
  }
36
36
  case "Scalar": {
37
- yield emitScalar(ctx, type, module);
37
+ yield* emitScalar(ctx, type, module);
38
38
  break;
39
39
  }
40
40
  default: {
@@ -1 +1 @@
1
- {"version":3,"file":"declaration.js","sourceRoot":"","sources":["../../../src/common/declaration.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAGlC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,U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MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,SAAS,CAAC,CAAC,eAAe,CAC9B,GAAc,EACd,IAAqB,EACrB,MAAc,EACd,OAAgB;IAEhB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,KAAK,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM;QACR,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC3B,MAAM;QACR,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,KAAK,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM;QACR,CAAC;QACD,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,KAAK,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACxC,MAAM;QACR,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACrC,MAAM;QACR,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,qCAAsC,IAA4B,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -108,7 +108,7 @@ export interface ScalarEncodingVia {
108
108
  * @param scalar - The scalar to emit.
109
109
  * @returns a string that declares an alias to the scalar type in TypeScript.
110
110
  */
111
- export declare function emitScalar(ctx: JsContext, scalar: Scalar, module: Module): string;
111
+ export declare function emitScalar(ctx: JsContext, scalar: Scalar, module: Module): Iterable<string>;
112
112
  /**
113
113
  * Reports a scalar as unrecognized, so that the spec author knows it is treated as `unknown`.
114
114
  *
@@ -1 +1 @@
1
- {"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../../src/common/scalar.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAW,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAK9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAIxD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE;QACV,CAAC,MAAM,EAAE,MAAM,GAAG;YAChB;;eAEG;YACH,OAAO,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;YAEzC;;eAEG;YACH,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;SAChE,CAAC;KACH,CAAC;IAEF;;OAEG;IACH,gBAAgB,CAAC,EAAE;QACjB;;WAEG;QACH,UAAU,CAAC,EAAE;YAAE,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAAE,CAAC;QACzD;;WAEG;QACH,IAAI,CAAC,EAAE;aACJ,CAAC,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;SACzD,CAAC;KACH,CAAC;IAEF;;;;;OAKG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS,C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