@typespec/http-server-js 0.58.0-alpha.13-dev.7 → 0.58.0-alpha.13-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.testignore +0 -2
- package/README.md +6 -0
- package/build-helpers.ts +57 -12
- package/dist/generated-defs/helpers/index.d.ts.map +1 -1
- package/dist/generated-defs/helpers/index.js +1 -0
- package/dist/generated-defs/helpers/index.js.map +1 -1
- package/dist/generated-defs/helpers/temporal/index.d.ts +4 -0
- package/dist/generated-defs/helpers/temporal/index.d.ts.map +1 -0
- package/dist/generated-defs/helpers/temporal/index.js +19 -0
- package/dist/generated-defs/helpers/temporal/index.js.map +1 -0
- package/dist/generated-defs/helpers/temporal/native.d.ts +4 -0
- package/dist/generated-defs/helpers/temporal/native.d.ts.map +1 -0
- package/dist/generated-defs/helpers/temporal/native.js +125 -0
- package/dist/generated-defs/helpers/temporal/native.js.map +1 -0
- package/dist/generated-defs/helpers/temporal/polyfill.d.ts +4 -0
- package/dist/generated-defs/helpers/temporal/polyfill.d.ts.map +1 -0
- package/dist/generated-defs/helpers/temporal/polyfill.js +124 -0
- package/dist/generated-defs/helpers/temporal/polyfill.js.map +1 -0
- package/dist/generated-defs/package.json.d.ts +2 -0
- package/dist/generated-defs/package.json.d.ts.map +1 -0
- package/dist/generated-defs/package.json.js +37 -0
- package/dist/generated-defs/package.json.js.map +1 -0
- package/dist/src/common/declaration.js +1 -1
- package/dist/src/common/declaration.js.map +1 -1
- package/dist/src/common/scalar.d.ts +1 -1
- package/dist/src/common/scalar.d.ts.map +1 -1
- package/dist/src/common/scalar.js +373 -48
- package/dist/src/common/scalar.js.map +1 -1
- package/dist/src/common/serialization/index.d.ts +2 -2
- package/dist/src/common/serialization/index.d.ts.map +1 -1
- package/dist/src/common/serialization/index.js +3 -9
- package/dist/src/common/serialization/index.js.map +1 -1
- package/dist/src/common/serialization/json.d.ts +2 -0
- package/dist/src/common/serialization/json.d.ts.map +1 -1
- package/dist/src/common/serialization/json.js +10 -19
- package/dist/src/common/serialization/json.js.map +1 -1
- package/dist/src/helpers/temporal/native.d.ts +40 -0
- package/dist/src/helpers/temporal/native.d.ts.map +1 -0
- package/dist/src/helpers/temporal/native.js +81 -0
- package/dist/src/helpers/temporal/native.js.map +1 -0
- package/dist/src/helpers/temporal/polyfill.d.ts +41 -0
- package/dist/src/helpers/temporal/polyfill.d.ts.map +1 -0
- package/dist/src/helpers/temporal/polyfill.js +80 -0
- package/dist/src/helpers/temporal/polyfill.js.map +1 -0
- package/dist/src/http/server/index.d.ts.map +1 -1
- package/dist/src/http/server/index.js +4 -1
- package/dist/src/http/server/index.js.map +1 -1
- package/dist/src/lib.d.ts +9 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +7 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/scripts/scaffold/bin.d.mts.map +1 -1
- package/dist/src/scripts/scaffold/bin.mjs +91 -53
- package/dist/src/scripts/scaffold/bin.mjs.map +1 -1
- package/dist/src/scripts/scaffold/data-mocks.d.ts.map +1 -1
- package/dist/src/scripts/scaffold/data-mocks.js +74 -15
- package/dist/src/scripts/scaffold/data-mocks.js.map +1 -1
- package/generated-defs/helpers/index.ts +1 -0
- package/generated-defs/helpers/temporal/index.ts +25 -0
- package/generated-defs/helpers/temporal/native.ts +132 -0
- package/generated-defs/helpers/temporal/polyfill.ts +131 -0
- package/generated-defs/package.json.ts +38 -0
- package/package.json +11 -3
- package/src/common/declaration.ts +1 -1
- package/src/common/scalar.ts +430 -61
- package/src/common/serialization/index.ts +4 -13
- package/src/common/serialization/json.ts +22 -25
- package/src/helpers/temporal/native.ts +104 -0
- package/src/helpers/temporal/polyfill.ts +103 -0
- package/src/http/server/index.ts +6 -1
- package/src/lib.ts +17 -0
- package/src/scripts/scaffold/bin.mts +106 -53
- package/src/scripts/scaffold/data-mocks.ts +81 -16
- package/temp/tsconfig.tsbuildinfo +1 -1
- package/test/scalar.test.ts +547 -97
package/.testignore
CHANGED
package/README.md
CHANGED
|
@@ -45,6 +45,12 @@ If set to `true`, the emitter will generate a router that exposes an Express.js
|
|
|
45
45
|
|
|
46
46
|
If this option is not set to `true`, the `expressMiddleware` property will not be present on the generated router.
|
|
47
47
|
|
|
48
|
+
### `datetime`
|
|
49
|
+
|
|
50
|
+
**Type:** `"temporal-polyfill" | "temporal" | "date-duration"`
|
|
51
|
+
|
|
52
|
+
The type of datetime models to use for TypeSpecs DateTime and Duration types.
|
|
53
|
+
|
|
48
54
|
### `omit-unreachable-types`
|
|
49
55
|
|
|
50
56
|
**Type:** `boolean`
|
package/build-helpers.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const HELPER_SRC_PATH = path.resolve("src", "helpers");
|
|
9
|
+
const GENERATED_DEFS = path.resolve("generated-defs");
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
const HELPER_DECLARATION_PATH = path.resolve(GENERATED_DEFS, "helpers");
|
|
12
|
+
const HELPER_SRC_PATH = path.resolve("src", "helpers");
|
|
13
13
|
|
|
14
14
|
async function* visitAllFiles(base: string): AsyncIterable<string> {
|
|
15
15
|
const contents = await fs.readdir(base, { withFileTypes: true });
|
|
@@ -23,7 +23,39 @@ async function* visitAllFiles(base: string): AsyncIterable<string> {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
async function buildPackageJsonTs() {
|
|
27
|
+
console.log("Building package.json.ts");
|
|
28
|
+
const packageJson = await fs.readFile(path.resolve("package.json"), "utf-8");
|
|
29
|
+
|
|
30
|
+
const parsed = JSON.parse(packageJson);
|
|
31
|
+
|
|
32
|
+
const mergedDependencies: Record<string, string> = {
|
|
33
|
+
...parsed.devDependencies,
|
|
34
|
+
...parsed.dependencies,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const fileText = [
|
|
38
|
+
"// Copyright (c) Microsoft Corporation",
|
|
39
|
+
"// Licensed under the MIT license.",
|
|
40
|
+
"",
|
|
41
|
+
"// prettier-ignore",
|
|
42
|
+
"",
|
|
43
|
+
`export const hsjsDependencies: Record<string, string> = {`,
|
|
44
|
+
...Object.entries(mergedDependencies).map(([name, version]) => {
|
|
45
|
+
return ` ${JSON.stringify(name)}: ${JSON.stringify(version)},`;
|
|
46
|
+
}),
|
|
47
|
+
"};",
|
|
48
|
+
"",
|
|
49
|
+
].join("\n");
|
|
50
|
+
|
|
51
|
+
await fs.writeFile(path.resolve(GENERATED_DEFS, "package.json.ts"), fileText);
|
|
52
|
+
}
|
|
53
|
+
|
|
26
54
|
async function main() {
|
|
55
|
+
console.log("Building JS server generator helpers.");
|
|
56
|
+
|
|
57
|
+
await buildPackageJsonTs();
|
|
58
|
+
|
|
27
59
|
const allFiles: string[] = [];
|
|
28
60
|
const indices = new Map<string, string[]>();
|
|
29
61
|
|
|
@@ -72,12 +104,10 @@ async function main() {
|
|
|
72
104
|
const contents = await fs.readFile(file, "utf-8");
|
|
73
105
|
|
|
74
106
|
let childModuleLines =
|
|
75
|
-
childModules
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
return ` await import("./${childBase}.js").then((m) => m.createModule(module));`;
|
|
80
|
-
}) ?? [];
|
|
107
|
+
childModules?.map((child) => {
|
|
108
|
+
const childBase = path.basename(child, ".ts");
|
|
109
|
+
return ` await import("./${childBase}.js").then((m) => m.createModule(module));`;
|
|
110
|
+
}) ?? [];
|
|
81
111
|
|
|
82
112
|
if (childModuleLines.length > 0) {
|
|
83
113
|
childModuleLines = [" // Child modules", ...childModuleLines, ""];
|
|
@@ -128,9 +158,24 @@ async function main() {
|
|
|
128
158
|
|
|
129
159
|
const targetPath = path.resolve(HELPER_DECLARATION_PATH, relativePath, "index.ts");
|
|
130
160
|
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
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
|
+
];
|
|
134
179
|
|
|
135
180
|
const transformed = [
|
|
136
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,
|
|
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.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,SAAS;QACf,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;KACjB,CAAC;IAEF,gBAAgB;IAChB,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,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,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC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,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -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 @@
|
|
|
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,oCAAoC;IACpC,EAAE;IACF,sHAAsH;IACtH,2GAA2G;IAC3G,EAAE;IACF,KAAK;IACL,iGAAiG;IACjG,iEAAiE;IACjE,IAAI;IACJ,qDAAqD;IACrD,4EAA4E;IAC5E,4CAA4C;IAC5C,KAAK;IACL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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 @@
|
|
|
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,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,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 @@
|
|
|
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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
// prettier-ignore
|
|
4
|
+
export const hsjsDependencies = {
|
|
5
|
+
"@types/express": "^5.0.1",
|
|
6
|
+
"@types/morgan": "^1.9.9",
|
|
7
|
+
"@types/node": "~22.13.11",
|
|
8
|
+
"@types/swagger-ui-express": "^4.1.8",
|
|
9
|
+
"@typespec/compiler": "workspace:^",
|
|
10
|
+
"@typespec/http": "workspace:^",
|
|
11
|
+
"@typespec/http-specs": "workspace:^",
|
|
12
|
+
"@typespec/internal-build-utils": "workspace:^",
|
|
13
|
+
"@typespec/openapi3": "workspace:^",
|
|
14
|
+
"@typespec/spector": "workspace:^",
|
|
15
|
+
"@typespec/tspd": "workspace:^",
|
|
16
|
+
"@vitest/coverage-v8": "^3.0.9",
|
|
17
|
+
"@vitest/ui": "^3.0.9",
|
|
18
|
+
"decimal.js": "^10.5.0",
|
|
19
|
+
"express": "^5.1.0",
|
|
20
|
+
"fs-extra": "^11.2.0",
|
|
21
|
+
"globby": "~14.1.0",
|
|
22
|
+
"inquirer": "^12.5.0",
|
|
23
|
+
"morgan": "^1.10.0",
|
|
24
|
+
"ora": "^8.1.1",
|
|
25
|
+
"p-limit": "^6.2.0",
|
|
26
|
+
"pathe": "^2.0.3",
|
|
27
|
+
"picocolors": "~1.1.1",
|
|
28
|
+
"swagger-ui-express": "^5.0.1",
|
|
29
|
+
"temporal-polyfill": "^0.3.0",
|
|
30
|
+
"tsx": "^4.19.3",
|
|
31
|
+
"typescript": "~5.8.2",
|
|
32
|
+
"vitest": "^3.0.9",
|
|
33
|
+
"yargs": "~17.7.2",
|
|
34
|
+
"prettier": "~3.5.3",
|
|
35
|
+
"yaml": "~2.7.0",
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=package.json.js.map
|
|
@@ -0,0 +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,mBAAmB,EAAE,QAAQ;IAC7B,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,QAAQ;IACtB,QAAQ,EAAE,QAAQ;IAClB,O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C,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;
|
|
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;AAQxD;;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;YA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