@gusnips/sdkgen 0.2.2 → 0.2.3
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/dist/transport.d.ts +2 -3
- package/dist/transport.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/transport.ts +5 -5
package/dist/transport.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
2
1
|
/** What a generated method tells the transport about its operation. */
|
|
3
2
|
export interface RequestSpec {
|
|
4
|
-
method:
|
|
3
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
5
4
|
/** `/numbers/:numberId/pair`. Each `:name` is filled from the params field of that name. */
|
|
6
5
|
path: string;
|
|
7
6
|
/** The operation reads an `Idempotency-Key`, so the server answers a repeat from the first run. */
|
|
@@ -36,7 +35,7 @@ export interface EnvelopeError {
|
|
|
36
35
|
}
|
|
37
36
|
/** A call that did not work, as `error` gets it to build the SDK's own error. */
|
|
38
37
|
export interface Failure {
|
|
39
|
-
method:
|
|
38
|
+
method: RequestSpec["method"];
|
|
40
39
|
/** The path with its values filled in: `/numbers/n_1/pair`. */
|
|
41
40
|
path: string;
|
|
42
41
|
/** The HTTP status, or 0 when no answer came back: offline, a dropped connection, a timeout. */
|
package/dist/transport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAsBA,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAG1B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpD,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,mGA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6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9D,8FAA8F;IAC9F,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1D,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4FAA4F;IAC5F,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,KAAK,CAAC;CACpC;AAED,qFAAqF;AACrF,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC;CACrB;AAKD;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EACjD,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,WAAW,EACjB,MAAM,GAAE,MAAW,EACnB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA0CvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gusnips/sdkgen",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "The pieces of an SDK generator: copy your API's types with their comments, write a schema as a TypeScript type, and keep the output current.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/transport.ts
CHANGED
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { parseRetryAfter, retryDelayMs, shouldRetry } from "@gusnips/http/retry";
|
|
22
22
|
|
|
23
|
-
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
24
|
-
|
|
25
23
|
/** What a generated method tells the transport about its operation. */
|
|
26
24
|
export interface RequestSpec {
|
|
27
|
-
|
|
25
|
+
// Spelled out rather than named: an SDK re-exports these types, not the transport, so a named
|
|
26
|
+
// alias would leave its public types naming something nobody can import.
|
|
27
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
28
28
|
/** `/numbers/:numberId/pair`. Each `:name` is filled from the params field of that name. */
|
|
29
29
|
path: string;
|
|
30
30
|
/** The operation reads an `Idempotency-Key`, so the server answers a repeat from the first run. */
|
|
@@ -62,7 +62,7 @@ export interface EnvelopeError {
|
|
|
62
62
|
|
|
63
63
|
/** A call that did not work, as `error` gets it to build the SDK's own error. */
|
|
64
64
|
export interface Failure {
|
|
65
|
-
method:
|
|
65
|
+
method: RequestSpec["method"];
|
|
66
66
|
/** The path with its values filled in: `/numbers/n_1/pair`. */
|
|
67
67
|
path: string;
|
|
68
68
|
/** The HTTP status, or 0 when no answer came back: offline, a dropped connection, a timeout. */
|
|
@@ -189,7 +189,7 @@ function sleep(ms: number, signal: AbortSignal | undefined): Promise<void> {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
interface Prepared {
|
|
192
|
-
method:
|
|
192
|
+
method: RequestSpec["method"];
|
|
193
193
|
path: string;
|
|
194
194
|
url: string;
|
|
195
195
|
headers: Headers;
|