@steamsets/client-ts 0.1.2
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/.devcontainer/README.md +35 -0
- package/README.md +389 -0
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/account/README.md +97 -0
- package/docs/sdks/liveness/README.md +51 -0
- package/docs/sdks/steamsets/README.md +7 -0
- package/funcs/accountAccountV1Apps.d.ts +13 -0
- package/funcs/accountAccountV1Apps.d.ts.map +1 -0
- package/funcs/accountAccountV1Apps.js +82 -0
- package/funcs/accountAccountV1Apps.js.map +1 -0
- package/funcs/accountAccountV1Badge.d.ts +13 -0
- package/funcs/accountAccountV1Badge.d.ts.map +1 -0
- package/funcs/accountAccountV1Badge.js +82 -0
- package/funcs/accountAccountV1Badge.js.map +1 -0
- package/funcs/livenessLiveness.d.ts +16 -0
- package/funcs/livenessLiveness.d.ts.map +1 -0
- package/funcs/livenessLiveness.js +83 -0
- package/funcs/livenessLiveness.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +66 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/types.d.ts +72 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +22 -0
- package/index.js.map +1 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +61 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +36 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +34 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +51 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +343 -0
- package/lib/encodings.js.map +1 -0
- package/lib/http.d.ts +66 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +217 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +209 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +16 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +29 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +18 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +130 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +19 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +59 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +57 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +159 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +60 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +130 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/errordetail.d.ts +38 -0
- package/models/components/errordetail.d.ts.map +1 -0
- package/models/components/errordetail.js +54 -0
- package/models/components/errordetail.js.map +1 -0
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +27 -0
- package/models/components/index.js.map +1 -0
- package/models/components/security.d.ts +27 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +52 -0
- package/models/components/security.js.map +1 -0
- package/models/components/v1accountsappsresponsebody.d.ts +31 -0
- package/models/components/v1accountsappsresponsebody.d.ts.map +1 -0
- package/models/components/v1accountsappsresponsebody.js +66 -0
- package/models/components/v1accountsappsresponsebody.js.map +1 -0
- package/models/components/v1app.d.ts +53 -0
- package/models/components/v1app.d.ts.map +1 -0
- package/models/components/v1app.js +60 -0
- package/models/components/v1app.js.map +1 -0
- package/models/components/v1badge.d.ts +51 -0
- package/models/components/v1badge.d.ts.map +1 -0
- package/models/components/v1badge.js +79 -0
- package/models/components/v1badge.js.map +1 -0
- package/models/components/v1badgesappsresponsebody.d.ts +31 -0
- package/models/components/v1badgesappsresponsebody.d.ts.map +1 -0
- package/models/components/v1badgesappsresponsebody.js +66 -0
- package/models/components/v1badgesappsresponsebody.js.map +1 -0
- package/models/components/v1livenessresponsebody.d.ts +33 -0
- package/models/components/v1livenessresponsebody.d.ts.map +1 -0
- package/models/components/v1livenessresponsebody.js +65 -0
- package/models/components/v1livenessresponsebody.js.map +1 -0
- package/models/errors/errormodel.d.ts +98 -0
- package/models/errors/errormodel.d.ts.map +1 -0
- package/models/errors/errormodel.js +113 -0
- package/models/errors/errormodel.js.map +1 -0
- package/models/errors/httpclienterrors.d.ts +44 -0
- package/models/errors/httpclienterrors.d.ts.map +1 -0
- package/models/errors/httpclienterrors.js +78 -0
- package/models/errors/httpclienterrors.js.map +1 -0
- package/models/errors/index.d.ts +4 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +23 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkerror.d.ts +8 -0
- package/models/errors/sdkerror.d.ts.map +1 -0
- package/models/errors/sdkerror.js +21 -0
- package/models/errors/sdkerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +17 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +107 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/ns/LICENSE +201 -0
- package/ns/README.md +1 -0
- package/package.json +31 -0
- package/sdk/account.d.ts +13 -0
- package/sdk/account.d.ts.map +1 -0
- package/sdk/account.js +26 -0
- package/sdk/account.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/liveness.d.ts +12 -0
- package/sdk/liveness.d.ts.map +1 -0
- package/sdk/liveness.js +22 -0
- package/sdk/liveness.js.map +1 -0
- package/sdk/sdk.d.ts +10 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +21 -0
- package/sdk/sdk.js.map +1 -0
- package/src/core.ts +13 -0
- package/src/funcs/accountAccountV1Apps.ts +109 -0
- package/src/funcs/accountAccountV1Badge.ts +109 -0
- package/src/funcs/livenessLiveness.ts +110 -0
- package/src/hooks/hooks.ts +99 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +89 -0
- package/src/index.ts +6 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +60 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +449 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/matchers.ts +308 -0
- package/src/lib/primitives.ts +40 -0
- package/src/lib/retries.ts +187 -0
- package/src/lib/schemas.ts +74 -0
- package/src/lib/sdks.ts +261 -0
- package/src/lib/security.ts +198 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/errordetail.ts +58 -0
- package/src/models/components/index.ts +11 -0
- package/src/models/components/security.ts +42 -0
- package/src/models/components/v1accountsappsresponsebody.ts +66 -0
- package/src/models/components/v1app.ts +75 -0
- package/src/models/components/v1badge.ts +92 -0
- package/src/models/components/v1badgesappsresponsebody.ts +71 -0
- package/src/models/components/v1livenessresponsebody.ts +68 -0
- package/src/models/errors/errormodel.ts +174 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +7 -0
- package/src/models/errors/sdkerror.ts +25 -0
- package/src/models/errors/sdkvalidationerror.ts +95 -0
- package/src/sdk/account.ts +25 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/liveness.ts +20 -0
- package/src/sdk/sdk.ts +19 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +99 -0
- package/src/types/rfcdate.ts +54 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +52 -0
- package/types/blobs.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/fp.d.ts +31 -0
- package/types/fp.d.ts.map +1 -0
- package/types/fp.js +37 -0
- package/types/fp.js.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +25 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +80 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
|
|
8
|
+
export type V1LivenessResponseBody = {
|
|
9
|
+
/**
|
|
10
|
+
* A URL to the JSON Schema for this object.
|
|
11
|
+
*/
|
|
12
|
+
dollarSchema?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Whether we're alive or not
|
|
15
|
+
*/
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const V1LivenessResponseBody$inboundSchema: z.ZodType<
|
|
21
|
+
V1LivenessResponseBody,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z
|
|
25
|
+
.object({
|
|
26
|
+
$schema: z.string().optional(),
|
|
27
|
+
message: z.string(),
|
|
28
|
+
})
|
|
29
|
+
.transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
$schema: "dollarSchema",
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export type V1LivenessResponseBody$Outbound = {
|
|
37
|
+
$schema?: string | undefined;
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const V1LivenessResponseBody$outboundSchema: z.ZodType<
|
|
43
|
+
V1LivenessResponseBody$Outbound,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
V1LivenessResponseBody
|
|
46
|
+
> = z
|
|
47
|
+
.object({
|
|
48
|
+
dollarSchema: z.string().optional(),
|
|
49
|
+
message: z.string(),
|
|
50
|
+
})
|
|
51
|
+
.transform((v) => {
|
|
52
|
+
return remap$(v, {
|
|
53
|
+
dollarSchema: "$schema",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
60
|
+
*/
|
|
61
|
+
export namespace V1LivenessResponseBody$ {
|
|
62
|
+
/** @deprecated use `V1LivenessResponseBody$inboundSchema` instead. */
|
|
63
|
+
export const inboundSchema = V1LivenessResponseBody$inboundSchema;
|
|
64
|
+
/** @deprecated use `V1LivenessResponseBody$outboundSchema` instead. */
|
|
65
|
+
export const outboundSchema = V1LivenessResponseBody$outboundSchema;
|
|
66
|
+
/** @deprecated use `V1LivenessResponseBody$Outbound` instead. */
|
|
67
|
+
export type Outbound = V1LivenessResponseBody$Outbound;
|
|
68
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import * as components from "../components/index.js";
|
|
7
|
+
import * as z from "zod";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Bad Request
|
|
11
|
+
*/
|
|
12
|
+
export type ErrorModelData = {
|
|
13
|
+
/**
|
|
14
|
+
* A URL to the JSON Schema for this object.
|
|
15
|
+
*/
|
|
16
|
+
dollarSchema?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
19
|
+
*/
|
|
20
|
+
detail?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Optional list of individual error details
|
|
23
|
+
*/
|
|
24
|
+
errors?: Array<components.ErrorDetail> | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* A URI reference that identifies the specific occurrence of the problem.
|
|
27
|
+
*/
|
|
28
|
+
instance?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* HTTP status code
|
|
31
|
+
*/
|
|
32
|
+
status?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
35
|
+
*/
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* A URI reference to human-readable documentation for the error.
|
|
39
|
+
*/
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Bad Request
|
|
45
|
+
*/
|
|
46
|
+
export class ErrorModel extends Error {
|
|
47
|
+
/**
|
|
48
|
+
* A URL to the JSON Schema for this object.
|
|
49
|
+
*/
|
|
50
|
+
dollarSchema?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* A human-readable explanation specific to this occurrence of the problem.
|
|
53
|
+
*/
|
|
54
|
+
detail?: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Optional list of individual error details
|
|
57
|
+
*/
|
|
58
|
+
errors?: Array<components.ErrorDetail> | null | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* A URI reference that identifies the specific occurrence of the problem.
|
|
61
|
+
*/
|
|
62
|
+
instance?: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* HTTP status code
|
|
65
|
+
*/
|
|
66
|
+
status?: number | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
69
|
+
*/
|
|
70
|
+
title?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* A URI reference to human-readable documentation for the error.
|
|
73
|
+
*/
|
|
74
|
+
type: string;
|
|
75
|
+
|
|
76
|
+
/** The original data that was passed to this error instance. */
|
|
77
|
+
data$: ErrorModelData;
|
|
78
|
+
|
|
79
|
+
constructor(err: ErrorModelData) {
|
|
80
|
+
const message =
|
|
81
|
+
"message" in err && typeof err.message === "string"
|
|
82
|
+
? err.message
|
|
83
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
84
|
+
super(message);
|
|
85
|
+
this.data$ = err;
|
|
86
|
+
|
|
87
|
+
if (err.dollarSchema != null) {
|
|
88
|
+
this.dollarSchema = err.dollarSchema;
|
|
89
|
+
}
|
|
90
|
+
if (err.detail != null) {
|
|
91
|
+
this.detail = err.detail;
|
|
92
|
+
}
|
|
93
|
+
if (err.errors != null) {
|
|
94
|
+
this.errors = err.errors;
|
|
95
|
+
}
|
|
96
|
+
if (err.instance != null) {
|
|
97
|
+
this.instance = err.instance;
|
|
98
|
+
}
|
|
99
|
+
if (err.status != null) {
|
|
100
|
+
this.status = err.status;
|
|
101
|
+
}
|
|
102
|
+
if (err.title != null) {
|
|
103
|
+
this.title = err.title;
|
|
104
|
+
}
|
|
105
|
+
this.type = err.type;
|
|
106
|
+
|
|
107
|
+
this.name = "ErrorModel";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
112
|
+
export const ErrorModel$inboundSchema: z.ZodType<ErrorModel, z.ZodTypeDef, unknown> = z
|
|
113
|
+
.object({
|
|
114
|
+
$schema: z.string().optional(),
|
|
115
|
+
detail: z.string().optional(),
|
|
116
|
+
errors: z.nullable(z.array(components.ErrorDetail$inboundSchema)).optional(),
|
|
117
|
+
instance: z.string().optional(),
|
|
118
|
+
status: z.number().int().optional(),
|
|
119
|
+
title: z.string().optional(),
|
|
120
|
+
type: z.string().default("about:blank"),
|
|
121
|
+
})
|
|
122
|
+
.transform((v) => {
|
|
123
|
+
const remapped = remap$(v, {
|
|
124
|
+
$schema: "dollarSchema",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return new ErrorModel(remapped);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export type ErrorModel$Outbound = {
|
|
132
|
+
$schema?: string | undefined;
|
|
133
|
+
detail?: string | undefined;
|
|
134
|
+
errors?: Array<components.ErrorDetail$Outbound> | null | undefined;
|
|
135
|
+
instance?: string | undefined;
|
|
136
|
+
status?: number | undefined;
|
|
137
|
+
title?: string | undefined;
|
|
138
|
+
type: string;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/** @internal */
|
|
142
|
+
export const ErrorModel$outboundSchema: z.ZodType<ErrorModel$Outbound, z.ZodTypeDef, ErrorModel> = z
|
|
143
|
+
.instanceof(ErrorModel)
|
|
144
|
+
.transform((v) => v.data$)
|
|
145
|
+
.pipe(
|
|
146
|
+
z
|
|
147
|
+
.object({
|
|
148
|
+
dollarSchema: z.string().optional(),
|
|
149
|
+
detail: z.string().optional(),
|
|
150
|
+
errors: z.nullable(z.array(components.ErrorDetail$outboundSchema)).optional(),
|
|
151
|
+
instance: z.string().optional(),
|
|
152
|
+
status: z.number().int().optional(),
|
|
153
|
+
title: z.string().optional(),
|
|
154
|
+
type: z.string().default("about:blank"),
|
|
155
|
+
})
|
|
156
|
+
.transform((v) => {
|
|
157
|
+
return remap$(v, {
|
|
158
|
+
dollarSchema: "$schema",
|
|
159
|
+
});
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
166
|
+
*/
|
|
167
|
+
export namespace ErrorModel$ {
|
|
168
|
+
/** @deprecated use `ErrorModel$inboundSchema` instead. */
|
|
169
|
+
export const inboundSchema = ErrorModel$inboundSchema;
|
|
170
|
+
/** @deprecated use `ErrorModel$outboundSchema` instead. */
|
|
171
|
+
export const outboundSchema = ErrorModel$outboundSchema;
|
|
172
|
+
/** @deprecated use `ErrorModel$Outbound` instead. */
|
|
173
|
+
export type Outbound = ErrorModel$Outbound;
|
|
174
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all HTTP errors.
|
|
7
|
+
*/
|
|
8
|
+
export class HTTPClientError extends Error {
|
|
9
|
+
/** The underlying cause of the error. */
|
|
10
|
+
override readonly cause: unknown;
|
|
11
|
+
override name = "HTTPClientError";
|
|
12
|
+
constructor(message: string, opts?: { cause?: unknown }) {
|
|
13
|
+
let msg = message;
|
|
14
|
+
if (opts?.cause) {
|
|
15
|
+
msg += `: ${opts.cause}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
super(msg, opts);
|
|
19
|
+
// In older runtimes, the cause field would not have been assigned through
|
|
20
|
+
// the super() call.
|
|
21
|
+
if (typeof this.cause === "undefined") {
|
|
22
|
+
this.cause = opts?.cause;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An error to capture unrecognised or unexpected errors when making HTTP calls.
|
|
29
|
+
*/
|
|
30
|
+
export class UnexpectedClientError extends HTTPClientError {
|
|
31
|
+
override name = "UnexpectedClientError";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* An error that is raised when any inputs used to create a request are invalid.
|
|
36
|
+
*/
|
|
37
|
+
export class InvalidRequestError extends HTTPClientError {
|
|
38
|
+
override name = "InvalidRequestError";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* An error that is raised when a HTTP request was aborted by the client error.
|
|
43
|
+
*/
|
|
44
|
+
export class RequestAbortedError extends HTTPClientError {
|
|
45
|
+
override readonly name = "RequestAbortedError";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* An error that is raised when a HTTP request timed out due to an AbortSignal
|
|
50
|
+
* signal timeout.
|
|
51
|
+
*/
|
|
52
|
+
export class RequestTimeoutError extends HTTPClientError {
|
|
53
|
+
override readonly name = "RequestTimeoutError";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* An error that is raised when a HTTP client is unable to make a request to
|
|
58
|
+
* a server.
|
|
59
|
+
*/
|
|
60
|
+
export class ConnectionError extends HTTPClientError {
|
|
61
|
+
override readonly name = "ConnectionError";
|
|
62
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export class SDKError extends Error {
|
|
6
|
+
public readonly statusCode: number;
|
|
7
|
+
public readonly contentType: string;
|
|
8
|
+
|
|
9
|
+
constructor(
|
|
10
|
+
message: string,
|
|
11
|
+
public readonly rawResponse: Response,
|
|
12
|
+
public readonly body: string = ""
|
|
13
|
+
) {
|
|
14
|
+
const statusCode = rawResponse.status;
|
|
15
|
+
const contentType = rawResponse.headers.get("content-type") || "";
|
|
16
|
+
const bodyString = body.length > 0 ? `\n${body}` : "";
|
|
17
|
+
|
|
18
|
+
super(`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`);
|
|
19
|
+
|
|
20
|
+
this.statusCode = statusCode;
|
|
21
|
+
this.contentType = contentType;
|
|
22
|
+
|
|
23
|
+
this.name = "SDKError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export class SDKValidationError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* The raw value that failed validation.
|
|
10
|
+
*/
|
|
11
|
+
public readonly rawValue: unknown;
|
|
12
|
+
|
|
13
|
+
constructor(message: string, cause: unknown, rawValue: unknown) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "SDKValidationError";
|
|
16
|
+
this.cause = cause;
|
|
17
|
+
this.rawValue = rawValue;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public override toString(): string {
|
|
21
|
+
return `${this.message}: ${this.cause}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Return a pretty-formatted error message if the underlying validation error
|
|
26
|
+
* is a ZodError or some other recognized error type, otherwise return the
|
|
27
|
+
* default error message.
|
|
28
|
+
*/
|
|
29
|
+
public pretty(): string {
|
|
30
|
+
if (this.cause instanceof z.ZodError) {
|
|
31
|
+
return `${this.message}\n${formatZodError(this.cause)}`;
|
|
32
|
+
} else {
|
|
33
|
+
return this.toString();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function formatZodError(err: z.ZodError, level = 0): string {
|
|
39
|
+
let pre = " ".repeat(level);
|
|
40
|
+
pre = level > 0 ? `│${pre}` : pre;
|
|
41
|
+
pre += " ".repeat(level);
|
|
42
|
+
|
|
43
|
+
let message = "";
|
|
44
|
+
const append = (str: string) => (message += `\n${pre}${str}`);
|
|
45
|
+
|
|
46
|
+
const len = err.issues.length;
|
|
47
|
+
const headline = len === 1 ? `${len} issue found` : `${len} issues found`;
|
|
48
|
+
|
|
49
|
+
if (len) {
|
|
50
|
+
append(`┌ ${headline}:`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (const issue of err.issues) {
|
|
54
|
+
let path = issue.path.join(".");
|
|
55
|
+
path = path ? `<root>.${path}` : "<root>";
|
|
56
|
+
append(`│ • [${path}]: ${issue.message} (${issue.code})`);
|
|
57
|
+
switch (issue.code) {
|
|
58
|
+
case "invalid_literal":
|
|
59
|
+
case "invalid_type": {
|
|
60
|
+
append(`│ Want: ${issue.expected}`);
|
|
61
|
+
append(`│ Got: ${issue.received}`);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case "unrecognized_keys": {
|
|
65
|
+
append(`│ Keys: ${issue.keys.join(", ")}`);
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case "invalid_enum_value": {
|
|
69
|
+
append(`│ Allowed: ${issue.options.join(", ")}`);
|
|
70
|
+
append(`│ Got: ${issue.received}`);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case "invalid_union_discriminator": {
|
|
74
|
+
append(`│ Allowed: ${issue.options.join(", ")}`);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
case "invalid_union": {
|
|
78
|
+
const len = issue.unionErrors.length;
|
|
79
|
+
append(
|
|
80
|
+
`│ ✖︎ Attemped to deserialize into one of ${len} union members:`,
|
|
81
|
+
);
|
|
82
|
+
issue.unionErrors.forEach((err, i) => {
|
|
83
|
+
append(`│ ✖︎ Member ${i + 1} of ${len}`);
|
|
84
|
+
append(`${formatZodError(err, level + 1)}`);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (err.issues.length) {
|
|
91
|
+
append(`└─*`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return message.slice(1);
|
|
95
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { accountAccountV1Apps } from "../funcs/accountAccountV1Apps.js";
|
|
6
|
+
import { accountAccountV1Badge } from "../funcs/accountAccountV1Badge.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as components from "../models/components/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Account extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* Get Account Apps
|
|
14
|
+
*/
|
|
15
|
+
async accountV1Apps(options?: RequestOptions): Promise<components.V1AccountsAppsResponseBody> {
|
|
16
|
+
return unwrapAsync(accountAccountV1Apps(this, options));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get Account Badges
|
|
21
|
+
*/
|
|
22
|
+
async accountV1Badge(options?: RequestOptions): Promise<components.V1BadgesAppsResponseBody> {
|
|
23
|
+
return unwrapAsync(accountAccountV1Badge(this, options));
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/sdk/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { livenessLiveness } from "../funcs/livenessLiveness.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as components from "../models/components/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class Liveness extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Liveness check
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This endpoint checks if the service is alive.
|
|
16
|
+
*/
|
|
17
|
+
async liveness(options?: RequestOptions): Promise<components.V1LivenessResponseBody> {
|
|
18
|
+
return unwrapAsync(livenessLiveness(this, options));
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/sdk/sdk.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
+
import { Account } from "./account.js";
|
|
7
|
+
import { Liveness } from "./liveness.js";
|
|
8
|
+
|
|
9
|
+
export class SteamSets extends ClientSDK {
|
|
10
|
+
private _account?: Account;
|
|
11
|
+
get account(): Account {
|
|
12
|
+
return (this._account ??= new Account(this.options$));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
private _liveness?: Liveness;
|
|
16
|
+
get liveness(): Liveness {
|
|
17
|
+
return (this._liveness ??= new Liveness(this.options$));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
|
|
8
|
+
z.custom<Blob>(isBlobLike, {
|
|
9
|
+
message: "expected a Blob, File or Blob-like object",
|
|
10
|
+
fatal: true,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export function isBlobLike(val: unknown): val is Blob {
|
|
14
|
+
if (val instanceof Blob) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const name = val[Symbol.toStringTag];
|
|
23
|
+
if (typeof name !== "string") {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (name !== "Blob" && name !== "File") {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return "stream" in val && typeof val.stream === "function";
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
7
|
+
|
|
8
|
+
export function catchUnrecognizedEnum<T>(value: T): Unrecognized<T> {
|
|
9
|
+
return value as Unrecognized<T>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
13
|
+
export type ClosedEnum<T> = T[keyof T];
|
|
14
|
+
export type OpenEnum<T> =
|
|
15
|
+
| Prettify<T[keyof T]>
|
|
16
|
+
| Unrecognized<T[keyof T] extends number ? number : string>;
|
package/src/types/fp.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A monad that captures the result of a function call or an error if it was not
|
|
7
|
+
* successful. Railway programming, enabled by this type, can be a nicer
|
|
8
|
+
* alternative to traditional exception throwing because it allows functions to
|
|
9
|
+
* declare all _known_ errors with static types and then check for them
|
|
10
|
+
* exhaustively in application code. Thrown exception have a type of `unknown`
|
|
11
|
+
* and break out of regular control flow of programs making them harder to
|
|
12
|
+
* inspect and more verbose work with due to try-catch blocks.
|
|
13
|
+
*/
|
|
14
|
+
export type Result<T, E = unknown> =
|
|
15
|
+
| { ok: true; value: T; error?: never }
|
|
16
|
+
| { ok: false; value?: never; error: E };
|
|
17
|
+
|
|
18
|
+
export function OK<V>(value: V): Result<V, never> {
|
|
19
|
+
return { ok: true, value };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function ERR<E>(error: E): Result<never, E> {
|
|
23
|
+
return { ok: false, error };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* unwrap is a convenience function for extracting a value from a result or
|
|
28
|
+
* throwing if there was an error.
|
|
29
|
+
*/
|
|
30
|
+
export function unwrap<T>(r: Result<T, unknown>): T {
|
|
31
|
+
if (!r.ok) {
|
|
32
|
+
throw r.error;
|
|
33
|
+
}
|
|
34
|
+
return r.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* unwrapAsync is a convenience function for resolving a value from a Promise
|
|
39
|
+
* of a result or rejecting if an error occurred.
|
|
40
|
+
*/
|
|
41
|
+
export async function unwrapAsync<T>(
|
|
42
|
+
pr: Promise<Result<T, unknown>>,
|
|
43
|
+
): Promise<T> {
|
|
44
|
+
const r = await pr;
|
|
45
|
+
if (!r.ok) {
|
|
46
|
+
throw r.error;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return r.value;
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { RFCDate } from "./rfcdate.js";
|
|
6
|
+
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
7
|
+
export type { Paginator, PageIterator } from "./operations.js";
|
|
8
|
+
export { createPageIterator } from "./operations.js";
|
|
9
|
+
export { catchUnrecognizedEnum } from "./enums.js";
|
|
10
|
+
export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums.js";
|
|
11
|
+
export type { Result } from "./fp.js";
|