@unkey/api 2.0.0-alpha.1 → 2.0.0-alpha.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/README.md +15 -34
- package/dist/commonjs/funcs/livenessCheck.d.ts +1 -1
- package/dist/commonjs/funcs/livenessCheck.d.ts.map +1 -1
- package/dist/commonjs/funcs/livenessCheck.js +5 -9
- package/dist/commonjs/funcs/livenessCheck.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitDeleteOverride.d.ts +1 -1
- package/dist/commonjs/funcs/ratelimitDeleteOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitDeleteOverride.js +5 -13
- package/dist/commonjs/funcs/ratelimitDeleteOverride.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitGetOverride.d.ts +1 -1
- package/dist/commonjs/funcs/ratelimitGetOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitGetOverride.js +5 -13
- package/dist/commonjs/funcs/ratelimitGetOverride.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.d.ts +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.js +5 -13
- package/dist/commonjs/funcs/ratelimitLimit.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitSetOverride.d.ts +1 -1
- package/dist/commonjs/funcs/ratelimitSetOverride.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitSetOverride.js +5 -13
- package/dist/commonjs/funcs/ratelimitSetOverride.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/matchers.d.ts +1 -1
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +9 -6
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/models/components/httpmetadata.d.ts +37 -0
- package/dist/commonjs/models/components/httpmetadata.d.ts.map +1 -0
- package/dist/commonjs/models/components/httpmetadata.js +86 -0
- package/dist/commonjs/models/components/httpmetadata.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +1 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +1 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/errors/apierror.d.ts +8 -5
- package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/apierror.js +3 -9
- package/dist/commonjs/models/errors/apierror.js.map +1 -1
- package/dist/{esm/models/errors/notfounderror.d.ts → commonjs/models/errors/baseerror.d.ts} +15 -15
- package/dist/commonjs/models/errors/baseerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/{notfounderror.js → baseerror.js} +15 -15
- package/dist/commonjs/models/errors/baseerror.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +1 -5
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -5
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/operations/liveness.d.ts +2 -15
- package/dist/commonjs/models/operations/liveness.d.ts.map +1 -1
- package/dist/commonjs/models/operations/liveness.js +4 -14
- package/dist/commonjs/models/operations/liveness.js.map +1 -1
- package/dist/commonjs/models/operations/ratelimitdeleteoverride.d.ts +2 -15
- package/dist/commonjs/models/operations/ratelimitdeleteoverride.d.ts.map +1 -1
- package/dist/commonjs/models/operations/ratelimitdeleteoverride.js +4 -14
- package/dist/commonjs/models/operations/ratelimitdeleteoverride.js.map +1 -1
- package/dist/commonjs/models/operations/ratelimitgetoverride.d.ts +2 -15
- package/dist/commonjs/models/operations/ratelimitgetoverride.d.ts.map +1 -1
- package/dist/commonjs/models/operations/ratelimitgetoverride.js +4 -14
- package/dist/commonjs/models/operations/ratelimitgetoverride.js.map +1 -1
- package/dist/commonjs/models/operations/ratelimitsetoverride.d.ts +2 -15
- package/dist/commonjs/models/operations/ratelimitsetoverride.d.ts.map +1 -1
- package/dist/commonjs/models/operations/ratelimitsetoverride.js +4 -14
- package/dist/commonjs/models/operations/ratelimitsetoverride.js.map +1 -1
- package/dist/commonjs/models/operations/v1ratelimitlimit.d.ts +2 -15
- package/dist/commonjs/models/operations/v1ratelimitlimit.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v1ratelimitlimit.js +4 -14
- package/dist/commonjs/models/operations/v1ratelimitlimit.js.map +1 -1
- package/dist/esm/funcs/livenessCheck.d.ts +1 -1
- package/dist/esm/funcs/livenessCheck.d.ts.map +1 -1
- package/dist/esm/funcs/livenessCheck.js +5 -9
- package/dist/esm/funcs/livenessCheck.js.map +1 -1
- package/dist/esm/funcs/ratelimitDeleteOverride.d.ts +1 -1
- package/dist/esm/funcs/ratelimitDeleteOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitDeleteOverride.js +5 -13
- package/dist/esm/funcs/ratelimitDeleteOverride.js.map +1 -1
- package/dist/esm/funcs/ratelimitGetOverride.d.ts +1 -1
- package/dist/esm/funcs/ratelimitGetOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitGetOverride.js +5 -13
- package/dist/esm/funcs/ratelimitGetOverride.js.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.d.ts +1 -1
- package/dist/esm/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.js +5 -13
- package/dist/esm/funcs/ratelimitLimit.js.map +1 -1
- package/dist/esm/funcs/ratelimitSetOverride.d.ts +1 -1
- package/dist/esm/funcs/ratelimitSetOverride.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitSetOverride.js +5 -13
- package/dist/esm/funcs/ratelimitSetOverride.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/matchers.d.ts +1 -1
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +9 -6
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/models/components/httpmetadata.d.ts +37 -0
- package/dist/esm/models/components/httpmetadata.d.ts.map +1 -0
- package/dist/esm/models/components/httpmetadata.js +48 -0
- package/dist/esm/models/components/httpmetadata.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +1 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +1 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/errors/apierror.d.ts +8 -5
- package/dist/esm/models/errors/apierror.d.ts.map +1 -1
- package/dist/esm/models/errors/apierror.js +3 -9
- package/dist/esm/models/errors/apierror.js.map +1 -1
- package/dist/{commonjs/models/errors/notfounderror.d.ts → esm/models/errors/baseerror.d.ts} +15 -15
- package/dist/esm/models/errors/baseerror.d.ts.map +1 -0
- package/dist/esm/models/errors/{notfounderror.js → baseerror.js} +13 -13
- package/dist/esm/models/errors/baseerror.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +1 -5
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -5
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/operations/liveness.d.ts +2 -15
- package/dist/esm/models/operations/liveness.d.ts.map +1 -1
- package/dist/esm/models/operations/liveness.js +4 -14
- package/dist/esm/models/operations/liveness.js.map +1 -1
- package/dist/esm/models/operations/ratelimitdeleteoverride.d.ts +2 -15
- package/dist/esm/models/operations/ratelimitdeleteoverride.d.ts.map +1 -1
- package/dist/esm/models/operations/ratelimitdeleteoverride.js +4 -14
- package/dist/esm/models/operations/ratelimitdeleteoverride.js.map +1 -1
- package/dist/esm/models/operations/ratelimitgetoverride.d.ts +2 -15
- package/dist/esm/models/operations/ratelimitgetoverride.d.ts.map +1 -1
- package/dist/esm/models/operations/ratelimitgetoverride.js +4 -14
- package/dist/esm/models/operations/ratelimitgetoverride.js.map +1 -1
- package/dist/esm/models/operations/ratelimitsetoverride.d.ts +2 -15
- package/dist/esm/models/operations/ratelimitsetoverride.d.ts.map +1 -1
- package/dist/esm/models/operations/ratelimitsetoverride.js +4 -14
- package/dist/esm/models/operations/ratelimitsetoverride.js.map +1 -1
- package/dist/esm/models/operations/v1ratelimitlimit.d.ts +2 -15
- package/dist/esm/models/operations/v1ratelimitlimit.d.ts.map +1 -1
- package/dist/esm/models/operations/v1ratelimitlimit.js +4 -14
- package/dist/esm/models/operations/v1ratelimitlimit.js.map +1 -1
- package/docs/sdks/liveness/README.md +5 -5
- package/docs/sdks/ratelimit/README.md +24 -32
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/livenessCheck.ts +11 -15
- package/src/funcs/ratelimitDeleteOverride.ts +11 -27
- package/src/funcs/ratelimitGetOverride.ts +11 -27
- package/src/funcs/ratelimitLimit.ts +11 -27
- package/src/funcs/ratelimitSetOverride.ts +11 -27
- package/src/lib/config.ts +3 -3
- package/src/lib/matchers.ts +9 -12
- package/src/models/components/httpmetadata.ts +87 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/errors/apierror.ts +7 -13
- package/src/models/errors/{notfounderror.ts → baseerror.ts} +20 -20
- package/src/models/errors/index.ts +1 -5
- package/src/models/operations/liveness.ts +6 -29
- package/src/models/operations/ratelimitdeleteoverride.ts +6 -29
- package/src/models/operations/ratelimitgetoverride.ts +6 -29
- package/src/models/operations/ratelimitsetoverride.ts +6 -29
- package/src/models/operations/v1ratelimitlimit.ts +6 -29
- package/dist/commonjs/models/errors/forbiddenerror.d.ts +0 -82
- package/dist/commonjs/models/errors/forbiddenerror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/forbiddenerror.js +0 -93
- package/dist/commonjs/models/errors/forbiddenerror.js.map +0 -1
- package/dist/commonjs/models/errors/internalservererror.d.ts +0 -82
- package/dist/commonjs/models/errors/internalservererror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/internalservererror.js +0 -93
- package/dist/commonjs/models/errors/internalservererror.js.map +0 -1
- package/dist/commonjs/models/errors/notfounderror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/notfounderror.js.map +0 -1
- package/dist/commonjs/models/errors/preconditionfailederror.d.ts +0 -82
- package/dist/commonjs/models/errors/preconditionfailederror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/preconditionfailederror.js +0 -93
- package/dist/commonjs/models/errors/preconditionfailederror.js.map +0 -1
- package/dist/commonjs/models/errors/unauthorizederror.d.ts +0 -82
- package/dist/commonjs/models/errors/unauthorizederror.d.ts.map +0 -1
- package/dist/commonjs/models/errors/unauthorizederror.js +0 -93
- package/dist/commonjs/models/errors/unauthorizederror.js.map +0 -1
- package/dist/esm/models/errors/forbiddenerror.d.ts +0 -82
- package/dist/esm/models/errors/forbiddenerror.d.ts.map +0 -1
- package/dist/esm/models/errors/forbiddenerror.js +0 -56
- package/dist/esm/models/errors/forbiddenerror.js.map +0 -1
- package/dist/esm/models/errors/internalservererror.d.ts +0 -82
- package/dist/esm/models/errors/internalservererror.d.ts.map +0 -1
- package/dist/esm/models/errors/internalservererror.js +0 -56
- package/dist/esm/models/errors/internalservererror.js.map +0 -1
- package/dist/esm/models/errors/notfounderror.d.ts.map +0 -1
- package/dist/esm/models/errors/notfounderror.js.map +0 -1
- package/dist/esm/models/errors/preconditionfailederror.d.ts +0 -82
- package/dist/esm/models/errors/preconditionfailederror.d.ts.map +0 -1
- package/dist/esm/models/errors/preconditionfailederror.js +0 -56
- package/dist/esm/models/errors/preconditionfailederror.js.map +0 -1
- package/dist/esm/models/errors/unauthorizederror.d.ts +0 -82
- package/dist/esm/models/errors/unauthorizederror.d.ts.map +0 -1
- package/dist/esm/models/errors/unauthorizederror.js +0 -56
- package/dist/esm/models/errors/unauthorizederror.js.map +0 -1
- package/src/models/errors/forbiddenerror.ts +0 -135
- package/src/models/errors/internalservererror.ts +0 -135
- package/src/models/errors/preconditionfailederror.ts +0 -135
- package/src/models/errors/unauthorizederror.ts +0 -135
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
|
|
7
|
-
export type InternalServerErrorData = {
|
|
8
|
-
/**
|
|
9
|
-
* A unique id for this request. Please always provide this to support.
|
|
10
|
-
*/
|
|
11
|
-
requestId: string;
|
|
12
|
-
/**
|
|
13
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
14
|
-
*/
|
|
15
|
-
detail: string;
|
|
16
|
-
/**
|
|
17
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
18
|
-
*/
|
|
19
|
-
instance?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* HTTP status code
|
|
22
|
-
*/
|
|
23
|
-
status: number;
|
|
24
|
-
/**
|
|
25
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
26
|
-
*/
|
|
27
|
-
title: string;
|
|
28
|
-
/**
|
|
29
|
-
* A URI reference to human-readable documentation for the error.
|
|
30
|
-
*/
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export class InternalServerError extends Error {
|
|
35
|
-
/**
|
|
36
|
-
* A unique id for this request. Please always provide this to support.
|
|
37
|
-
*/
|
|
38
|
-
requestId: string;
|
|
39
|
-
/**
|
|
40
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
41
|
-
*/
|
|
42
|
-
detail: string;
|
|
43
|
-
/**
|
|
44
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
45
|
-
*/
|
|
46
|
-
instance?: string | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* HTTP status code
|
|
49
|
-
*/
|
|
50
|
-
status: number;
|
|
51
|
-
/**
|
|
52
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
53
|
-
*/
|
|
54
|
-
title: string;
|
|
55
|
-
/**
|
|
56
|
-
* A URI reference to human-readable documentation for the error.
|
|
57
|
-
*/
|
|
58
|
-
type: string;
|
|
59
|
-
|
|
60
|
-
/** The original data that was passed to this error instance. */
|
|
61
|
-
data$: InternalServerErrorData;
|
|
62
|
-
|
|
63
|
-
constructor(err: InternalServerErrorData) {
|
|
64
|
-
const message = "message" in err && typeof err.message === "string"
|
|
65
|
-
? err.message
|
|
66
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
67
|
-
super(message);
|
|
68
|
-
this.data$ = err;
|
|
69
|
-
|
|
70
|
-
this.requestId = err.requestId;
|
|
71
|
-
this.detail = err.detail;
|
|
72
|
-
if (err.instance != null) this.instance = err.instance;
|
|
73
|
-
this.status = err.status;
|
|
74
|
-
this.title = err.title;
|
|
75
|
-
this.type = err.type;
|
|
76
|
-
|
|
77
|
-
this.name = "InternalServerError";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export const InternalServerError$inboundSchema: z.ZodType<
|
|
83
|
-
InternalServerError,
|
|
84
|
-
z.ZodTypeDef,
|
|
85
|
-
unknown
|
|
86
|
-
> = z.object({
|
|
87
|
-
requestId: z.string(),
|
|
88
|
-
detail: z.string(),
|
|
89
|
-
instance: z.string().optional(),
|
|
90
|
-
status: z.number().int(),
|
|
91
|
-
title: z.string(),
|
|
92
|
-
type: z.string(),
|
|
93
|
-
})
|
|
94
|
-
.transform((v) => {
|
|
95
|
-
return new InternalServerError(v);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
export type InternalServerError$Outbound = {
|
|
100
|
-
requestId: string;
|
|
101
|
-
detail: string;
|
|
102
|
-
instance?: string | undefined;
|
|
103
|
-
status: number;
|
|
104
|
-
title: string;
|
|
105
|
-
type: string;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/** @internal */
|
|
109
|
-
export const InternalServerError$outboundSchema: z.ZodType<
|
|
110
|
-
InternalServerError$Outbound,
|
|
111
|
-
z.ZodTypeDef,
|
|
112
|
-
InternalServerError
|
|
113
|
-
> = z.instanceof(InternalServerError)
|
|
114
|
-
.transform(v => v.data$)
|
|
115
|
-
.pipe(z.object({
|
|
116
|
-
requestId: z.string(),
|
|
117
|
-
detail: z.string(),
|
|
118
|
-
instance: z.string().optional(),
|
|
119
|
-
status: z.number().int(),
|
|
120
|
-
title: z.string(),
|
|
121
|
-
type: z.string(),
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @internal
|
|
126
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
127
|
-
*/
|
|
128
|
-
export namespace InternalServerError$ {
|
|
129
|
-
/** @deprecated use `InternalServerError$inboundSchema` instead. */
|
|
130
|
-
export const inboundSchema = InternalServerError$inboundSchema;
|
|
131
|
-
/** @deprecated use `InternalServerError$outboundSchema` instead. */
|
|
132
|
-
export const outboundSchema = InternalServerError$outboundSchema;
|
|
133
|
-
/** @deprecated use `InternalServerError$Outbound` instead. */
|
|
134
|
-
export type Outbound = InternalServerError$Outbound;
|
|
135
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
|
|
7
|
-
export type PreconditionFailedErrorData = {
|
|
8
|
-
/**
|
|
9
|
-
* A unique id for this request. Please always provide this to support.
|
|
10
|
-
*/
|
|
11
|
-
requestId: string;
|
|
12
|
-
/**
|
|
13
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
14
|
-
*/
|
|
15
|
-
detail: string;
|
|
16
|
-
/**
|
|
17
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
18
|
-
*/
|
|
19
|
-
instance?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* HTTP status code
|
|
22
|
-
*/
|
|
23
|
-
status: number;
|
|
24
|
-
/**
|
|
25
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
26
|
-
*/
|
|
27
|
-
title: string;
|
|
28
|
-
/**
|
|
29
|
-
* A URI reference to human-readable documentation for the error.
|
|
30
|
-
*/
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export class PreconditionFailedError extends Error {
|
|
35
|
-
/**
|
|
36
|
-
* A unique id for this request. Please always provide this to support.
|
|
37
|
-
*/
|
|
38
|
-
requestId: string;
|
|
39
|
-
/**
|
|
40
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
41
|
-
*/
|
|
42
|
-
detail: string;
|
|
43
|
-
/**
|
|
44
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
45
|
-
*/
|
|
46
|
-
instance?: string | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* HTTP status code
|
|
49
|
-
*/
|
|
50
|
-
status: number;
|
|
51
|
-
/**
|
|
52
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
53
|
-
*/
|
|
54
|
-
title: string;
|
|
55
|
-
/**
|
|
56
|
-
* A URI reference to human-readable documentation for the error.
|
|
57
|
-
*/
|
|
58
|
-
type: string;
|
|
59
|
-
|
|
60
|
-
/** The original data that was passed to this error instance. */
|
|
61
|
-
data$: PreconditionFailedErrorData;
|
|
62
|
-
|
|
63
|
-
constructor(err: PreconditionFailedErrorData) {
|
|
64
|
-
const message = "message" in err && typeof err.message === "string"
|
|
65
|
-
? err.message
|
|
66
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
67
|
-
super(message);
|
|
68
|
-
this.data$ = err;
|
|
69
|
-
|
|
70
|
-
this.requestId = err.requestId;
|
|
71
|
-
this.detail = err.detail;
|
|
72
|
-
if (err.instance != null) this.instance = err.instance;
|
|
73
|
-
this.status = err.status;
|
|
74
|
-
this.title = err.title;
|
|
75
|
-
this.type = err.type;
|
|
76
|
-
|
|
77
|
-
this.name = "PreconditionFailedError";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export const PreconditionFailedError$inboundSchema: z.ZodType<
|
|
83
|
-
PreconditionFailedError,
|
|
84
|
-
z.ZodTypeDef,
|
|
85
|
-
unknown
|
|
86
|
-
> = z.object({
|
|
87
|
-
requestId: z.string(),
|
|
88
|
-
detail: z.string(),
|
|
89
|
-
instance: z.string().optional(),
|
|
90
|
-
status: z.number().int(),
|
|
91
|
-
title: z.string(),
|
|
92
|
-
type: z.string(),
|
|
93
|
-
})
|
|
94
|
-
.transform((v) => {
|
|
95
|
-
return new PreconditionFailedError(v);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
export type PreconditionFailedError$Outbound = {
|
|
100
|
-
requestId: string;
|
|
101
|
-
detail: string;
|
|
102
|
-
instance?: string | undefined;
|
|
103
|
-
status: number;
|
|
104
|
-
title: string;
|
|
105
|
-
type: string;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/** @internal */
|
|
109
|
-
export const PreconditionFailedError$outboundSchema: z.ZodType<
|
|
110
|
-
PreconditionFailedError$Outbound,
|
|
111
|
-
z.ZodTypeDef,
|
|
112
|
-
PreconditionFailedError
|
|
113
|
-
> = z.instanceof(PreconditionFailedError)
|
|
114
|
-
.transform(v => v.data$)
|
|
115
|
-
.pipe(z.object({
|
|
116
|
-
requestId: z.string(),
|
|
117
|
-
detail: z.string(),
|
|
118
|
-
instance: z.string().optional(),
|
|
119
|
-
status: z.number().int(),
|
|
120
|
-
title: z.string(),
|
|
121
|
-
type: z.string(),
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @internal
|
|
126
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
127
|
-
*/
|
|
128
|
-
export namespace PreconditionFailedError$ {
|
|
129
|
-
/** @deprecated use `PreconditionFailedError$inboundSchema` instead. */
|
|
130
|
-
export const inboundSchema = PreconditionFailedError$inboundSchema;
|
|
131
|
-
/** @deprecated use `PreconditionFailedError$outboundSchema` instead. */
|
|
132
|
-
export const outboundSchema = PreconditionFailedError$outboundSchema;
|
|
133
|
-
/** @deprecated use `PreconditionFailedError$Outbound` instead. */
|
|
134
|
-
export type Outbound = PreconditionFailedError$Outbound;
|
|
135
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
|
|
7
|
-
export type UnauthorizedErrorData = {
|
|
8
|
-
/**
|
|
9
|
-
* A unique id for this request. Please always provide this to support.
|
|
10
|
-
*/
|
|
11
|
-
requestId: string;
|
|
12
|
-
/**
|
|
13
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
14
|
-
*/
|
|
15
|
-
detail: string;
|
|
16
|
-
/**
|
|
17
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
18
|
-
*/
|
|
19
|
-
instance?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* HTTP status code
|
|
22
|
-
*/
|
|
23
|
-
status: number;
|
|
24
|
-
/**
|
|
25
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
26
|
-
*/
|
|
27
|
-
title: string;
|
|
28
|
-
/**
|
|
29
|
-
* A URI reference to human-readable documentation for the error.
|
|
30
|
-
*/
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export class UnauthorizedError extends Error {
|
|
35
|
-
/**
|
|
36
|
-
* A unique id for this request. Please always provide this to support.
|
|
37
|
-
*/
|
|
38
|
-
requestId: string;
|
|
39
|
-
/**
|
|
40
|
-
* A human-readable explanation specific to this occurrence of the problem.
|
|
41
|
-
*/
|
|
42
|
-
detail: string;
|
|
43
|
-
/**
|
|
44
|
-
* A URI reference that identifies the specific occurrence of the problem.
|
|
45
|
-
*/
|
|
46
|
-
instance?: string | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* HTTP status code
|
|
49
|
-
*/
|
|
50
|
-
status: number;
|
|
51
|
-
/**
|
|
52
|
-
* A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
|
|
53
|
-
*/
|
|
54
|
-
title: string;
|
|
55
|
-
/**
|
|
56
|
-
* A URI reference to human-readable documentation for the error.
|
|
57
|
-
*/
|
|
58
|
-
type: string;
|
|
59
|
-
|
|
60
|
-
/** The original data that was passed to this error instance. */
|
|
61
|
-
data$: UnauthorizedErrorData;
|
|
62
|
-
|
|
63
|
-
constructor(err: UnauthorizedErrorData) {
|
|
64
|
-
const message = "message" in err && typeof err.message === "string"
|
|
65
|
-
? err.message
|
|
66
|
-
: `API error occurred: ${JSON.stringify(err)}`;
|
|
67
|
-
super(message);
|
|
68
|
-
this.data$ = err;
|
|
69
|
-
|
|
70
|
-
this.requestId = err.requestId;
|
|
71
|
-
this.detail = err.detail;
|
|
72
|
-
if (err.instance != null) this.instance = err.instance;
|
|
73
|
-
this.status = err.status;
|
|
74
|
-
this.title = err.title;
|
|
75
|
-
this.type = err.type;
|
|
76
|
-
|
|
77
|
-
this.name = "UnauthorizedError";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export const UnauthorizedError$inboundSchema: z.ZodType<
|
|
83
|
-
UnauthorizedError,
|
|
84
|
-
z.ZodTypeDef,
|
|
85
|
-
unknown
|
|
86
|
-
> = z.object({
|
|
87
|
-
requestId: z.string(),
|
|
88
|
-
detail: z.string(),
|
|
89
|
-
instance: z.string().optional(),
|
|
90
|
-
status: z.number().int(),
|
|
91
|
-
title: z.string(),
|
|
92
|
-
type: z.string(),
|
|
93
|
-
})
|
|
94
|
-
.transform((v) => {
|
|
95
|
-
return new UnauthorizedError(v);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
export type UnauthorizedError$Outbound = {
|
|
100
|
-
requestId: string;
|
|
101
|
-
detail: string;
|
|
102
|
-
instance?: string | undefined;
|
|
103
|
-
status: number;
|
|
104
|
-
title: string;
|
|
105
|
-
type: string;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/** @internal */
|
|
109
|
-
export const UnauthorizedError$outboundSchema: z.ZodType<
|
|
110
|
-
UnauthorizedError$Outbound,
|
|
111
|
-
z.ZodTypeDef,
|
|
112
|
-
UnauthorizedError
|
|
113
|
-
> = z.instanceof(UnauthorizedError)
|
|
114
|
-
.transform(v => v.data$)
|
|
115
|
-
.pipe(z.object({
|
|
116
|
-
requestId: z.string(),
|
|
117
|
-
detail: z.string(),
|
|
118
|
-
instance: z.string().optional(),
|
|
119
|
-
status: z.number().int(),
|
|
120
|
-
title: z.string(),
|
|
121
|
-
type: z.string(),
|
|
122
|
-
}));
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @internal
|
|
126
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
127
|
-
*/
|
|
128
|
-
export namespace UnauthorizedError$ {
|
|
129
|
-
/** @deprecated use `UnauthorizedError$inboundSchema` instead. */
|
|
130
|
-
export const inboundSchema = UnauthorizedError$inboundSchema;
|
|
131
|
-
/** @deprecated use `UnauthorizedError$outboundSchema` instead. */
|
|
132
|
-
export const outboundSchema = UnauthorizedError$outboundSchema;
|
|
133
|
-
/** @deprecated use `UnauthorizedError$Outbound` instead. */
|
|
134
|
-
export type Outbound = UnauthorizedError$Outbound;
|
|
135
|
-
}
|