dub 0.24.0 → 0.24.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 +62 -10
- package/docs/sdks/analytics/README.md +130 -40
- package/docs/sdks/domains/README.md +114 -44
- package/docs/sdks/links/README.md +100 -28
- package/docs/sdks/qrcodes/README.md +13 -4
- package/docs/sdks/tags/README.md +26 -8
- package/docs/sdks/workspaces/README.md +39 -12
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/domainschema.d.ts +80 -0
- package/models/components/domainschema.d.ts.map +1 -0
- package/models/components/domainschema.js +94 -0
- package/models/components/domainschema.js.map +1 -0
- package/models/components/index.d.ts +1 -9
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -9
- package/models/components/index.js.map +1 -1
- package/models/{components → errors}/badrequest.d.ts +13 -1
- package/models/errors/badrequest.d.ts.map +1 -0
- package/models/{components → errors}/badrequest.js +23 -4
- package/models/errors/badrequest.js.map +1 -0
- package/models/{components → errors}/conflict.d.ts +13 -1
- package/models/errors/conflict.d.ts.map +1 -0
- package/models/{components → errors}/conflict.js +23 -4
- package/models/errors/conflict.js.map +1 -0
- package/models/{components → errors}/forbidden.d.ts +13 -1
- package/models/errors/forbidden.d.ts.map +1 -0
- package/models/{components → errors}/forbidden.js +23 -4
- package/models/errors/forbidden.js.map +1 -0
- package/models/errors/index.d.ts +9 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +9 -0
- package/models/errors/index.js.map +1 -1
- package/models/{components → errors}/internalservererror.d.ts +13 -1
- package/models/errors/internalservererror.d.ts.map +1 -0
- package/models/{components → errors}/internalservererror.js +23 -4
- package/models/errors/internalservererror.js.map +1 -0
- package/models/{components → errors}/inviteexpired.d.ts +13 -1
- package/models/errors/inviteexpired.d.ts.map +1 -0
- package/models/{components → errors}/inviteexpired.js +23 -4
- package/models/errors/inviteexpired.js.map +1 -0
- package/models/{components → errors}/notfound.d.ts +13 -1
- package/models/errors/notfound.d.ts.map +1 -0
- package/models/{components → errors}/notfound.js +23 -4
- package/models/errors/notfound.js.map +1 -0
- package/models/{components → errors}/ratelimitexceeded.d.ts +13 -1
- package/models/errors/ratelimitexceeded.d.ts.map +1 -0
- package/models/{components → errors}/ratelimitexceeded.js +23 -4
- package/models/errors/ratelimitexceeded.js.map +1 -0
- package/models/{components → errors}/unauthorized.d.ts +13 -1
- package/models/errors/unauthorized.d.ts.map +1 -0
- package/models/{components → errors}/unauthorized.js +23 -4
- package/models/errors/unauthorized.js.map +1 -0
- package/models/{components → errors}/unprocessableentity.d.ts +13 -1
- package/models/errors/unprocessableentity.d.ts.map +1 -0
- package/models/{components → errors}/unprocessableentity.js +23 -4
- package/models/errors/unprocessableentity.js.map +1 -0
- package/models/operations/adddomain.d.ts +0 -90
- package/models/operations/adddomain.d.ts.map +1 -1
- package/models/operations/adddomain.js +1 -93
- package/models/operations/adddomain.js.map +1 -1
- package/models/operations/bulkcreatelinks.d.ts +17 -9
- package/models/operations/bulkcreatelinks.d.ts.map +1 -1
- package/models/operations/bulkcreatelinks.js +11 -30
- package/models/operations/bulkcreatelinks.js.map +1 -1
- package/models/operations/createlink.d.ts +17 -9
- package/models/operations/createlink.d.ts.map +1 -1
- package/models/operations/createlink.js +17 -30
- package/models/operations/createlink.js.map +1 -1
- package/models/operations/createtag.d.ts +0 -9
- package/models/operations/createtag.d.ts.map +1 -1
- package/models/operations/createtag.js +1 -30
- package/models/operations/createtag.js.map +1 -1
- package/models/operations/createworkspace.d.ts +0 -9
- package/models/operations/createworkspace.d.ts.map +1 -1
- package/models/operations/createworkspace.js +1 -30
- package/models/operations/createworkspace.js.map +1 -1
- package/models/operations/deletedomain.d.ts +0 -9
- package/models/operations/deletedomain.d.ts.map +1 -1
- package/models/operations/deletedomain.js +1 -30
- package/models/operations/deletedomain.js.map +1 -1
- package/models/operations/deletelink.d.ts +0 -9
- package/models/operations/deletelink.d.ts.map +1 -1
- package/models/operations/deletelink.js +1 -30
- package/models/operations/deletelink.js.map +1 -1
- package/models/operations/editdomain.d.ts +0 -90
- package/models/operations/editdomain.d.ts.map +1 -1
- package/models/operations/editdomain.js +1 -93
- package/models/operations/editdomain.js.map +1 -1
- package/models/operations/editlink.d.ts +17 -9
- package/models/operations/editlink.d.ts.map +1 -1
- package/models/operations/editlink.js +17 -30
- package/models/operations/editlink.js.map +1 -1
- package/models/operations/getbrowseranalytics.d.ts +0 -9
- package/models/operations/getbrowseranalytics.d.ts.map +1 -1
- package/models/operations/getbrowseranalytics.js +1 -30
- package/models/operations/getbrowseranalytics.js.map +1 -1
- package/models/operations/getcityanalytics.d.ts +0 -9
- package/models/operations/getcityanalytics.d.ts.map +1 -1
- package/models/operations/getcityanalytics.js +1 -30
- package/models/operations/getcityanalytics.js.map +1 -1
- package/models/operations/getclicksanalytics.d.ts +0 -9
- package/models/operations/getclicksanalytics.d.ts.map +1 -1
- package/models/operations/getclicksanalytics.js +1 -30
- package/models/operations/getclicksanalytics.js.map +1 -1
- package/models/operations/getcountryanalytics.d.ts +0 -9
- package/models/operations/getcountryanalytics.d.ts.map +1 -1
- package/models/operations/getcountryanalytics.js +1 -30
- package/models/operations/getcountryanalytics.js.map +1 -1
- package/models/operations/getdeviceanalytics.d.ts +0 -9
- package/models/operations/getdeviceanalytics.d.ts.map +1 -1
- package/models/operations/getdeviceanalytics.js +1 -30
- package/models/operations/getdeviceanalytics.js.map +1 -1
- package/models/operations/getlinkinfo.d.ts +0 -9
- package/models/operations/getlinkinfo.d.ts.map +1 -1
- package/models/operations/getlinkinfo.js +1 -30
- package/models/operations/getlinkinfo.js.map +1 -1
- package/models/operations/getlinks.d.ts +17 -9
- package/models/operations/getlinks.d.ts.map +1 -1
- package/models/operations/getlinks.js +17 -30
- package/models/operations/getlinks.js.map +1 -1
- package/models/operations/getlinkscount.d.ts +17 -9
- package/models/operations/getlinkscount.d.ts.map +1 -1
- package/models/operations/getlinkscount.js +11 -30
- package/models/operations/getlinkscount.js.map +1 -1
- package/models/operations/getosanalytics.d.ts +0 -9
- package/models/operations/getosanalytics.d.ts.map +1 -1
- package/models/operations/getosanalytics.js +1 -30
- package/models/operations/getosanalytics.js.map +1 -1
- package/models/operations/getqrcode.d.ts +0 -9
- package/models/operations/getqrcode.d.ts.map +1 -1
- package/models/operations/getqrcode.js +1 -30
- package/models/operations/getqrcode.js.map +1 -1
- package/models/operations/getrefereranalytics.d.ts +0 -9
- package/models/operations/getrefereranalytics.d.ts.map +1 -1
- package/models/operations/getrefereranalytics.js +1 -30
- package/models/operations/getrefereranalytics.js.map +1 -1
- package/models/operations/gettags.d.ts +0 -9
- package/models/operations/gettags.d.ts.map +1 -1
- package/models/operations/gettags.js +1 -30
- package/models/operations/gettags.js.map +1 -1
- package/models/operations/gettimeseriesanalytics.d.ts +0 -9
- package/models/operations/gettimeseriesanalytics.d.ts.map +1 -1
- package/models/operations/gettimeseriesanalytics.js +1 -30
- package/models/operations/gettimeseriesanalytics.js.map +1 -1
- package/models/operations/gettoplinks.d.ts +0 -9
- package/models/operations/gettoplinks.d.ts.map +1 -1
- package/models/operations/gettoplinks.js +1 -30
- package/models/operations/gettoplinks.js.map +1 -1
- package/models/operations/gettopurls.d.ts +0 -9
- package/models/operations/gettopurls.d.ts.map +1 -1
- package/models/operations/gettopurls.js +1 -30
- package/models/operations/gettopurls.js.map +1 -1
- package/models/operations/getworkspace.d.ts +0 -9
- package/models/operations/getworkspace.d.ts.map +1 -1
- package/models/operations/getworkspace.js +1 -30
- package/models/operations/getworkspace.js.map +1 -1
- package/models/operations/index.d.ts +0 -1
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -1
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdomains.d.ts +0 -87
- package/models/operations/listdomains.d.ts.map +1 -1
- package/models/operations/listdomains.js +1 -93
- package/models/operations/listdomains.js.map +1 -1
- package/models/operations/setprimarydomain.d.ts +0 -90
- package/models/operations/setprimarydomain.d.ts.map +1 -1
- package/models/operations/setprimarydomain.js +1 -93
- package/models/operations/setprimarydomain.js.map +1 -1
- package/models/operations/transferdomain.d.ts +0 -90
- package/models/operations/transferdomain.d.ts.map +1 -1
- package/models/operations/transferdomain.js +1 -93
- package/models/operations/transferdomain.js.map +1 -1
- package/package.json +1 -1
- package/sdk/analytics.d.ts +10 -10
- package/sdk/analytics.d.ts.map +1 -1
- package/sdk/analytics.js +693 -200
- package/sdk/analytics.js.map +1 -1
- package/sdk/domains.d.ts +7 -6
- package/sdk/domains.d.ts.map +1 -1
- package/sdk/domains.js +422 -124
- package/sdk/domains.js.map +1 -1
- package/sdk/links.d.ts +8 -7
- package/sdk/links.d.ts.map +1 -1
- package/sdk/links.js +485 -140
- package/sdk/links.js.map +1 -1
- package/sdk/metatags.js +1 -1
- package/sdk/metatags.js.map +1 -1
- package/sdk/qrcodes.d.ts +1 -1
- package/sdk/qrcodes.d.ts.map +1 -1
- package/sdk/qrcodes.js +69 -20
- package/sdk/qrcodes.js.map +1 -1
- package/sdk/tags.d.ts +3 -2
- package/sdk/tags.d.ts.map +1 -1
- package/sdk/tags.js +138 -40
- package/sdk/tags.js.map +1 -1
- package/sdk/workspaces.d.ts +4 -3
- package/sdk/workspaces.d.ts.map +1 -1
- package/sdk/workspaces.js +206 -60
- package/sdk/workspaces.js.map +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/domainschema.ts +138 -0
- package/src/models/components/index.ts +1 -9
- package/src/models/{components → errors}/badrequest.ts +43 -11
- package/src/models/{components → errors}/conflict.ts +43 -11
- package/src/models/{components → errors}/forbidden.ts +43 -11
- package/src/models/errors/index.ts +9 -0
- package/src/models/{components → errors}/internalservererror.ts +43 -11
- package/src/models/{components → errors}/inviteexpired.ts +43 -11
- package/src/models/{components → errors}/notfound.ts +43 -11
- package/src/models/{components → errors}/ratelimitexceeded.ts +43 -11
- package/src/models/{components → errors}/unauthorized.ts +43 -11
- package/src/models/{components → errors}/unprocessableentity.ts +43 -11
- package/src/models/operations/adddomain.ts +0 -200
- package/src/models/operations/bulkcreatelinks.ts +27 -67
- package/src/models/operations/createlink.ts +30 -64
- package/src/models/operations/createtag.ts +0 -64
- package/src/models/operations/createworkspace.ts +0 -67
- package/src/models/operations/deletedomain.ts +0 -64
- package/src/models/operations/deletelink.ts +0 -64
- package/src/models/operations/editdomain.ts +0 -202
- package/src/models/operations/editlink.ts +30 -64
- package/src/models/operations/getbrowseranalytics.ts +0 -66
- package/src/models/operations/getcityanalytics.ts +0 -66
- package/src/models/operations/getclicksanalytics.ts +0 -66
- package/src/models/operations/getcountryanalytics.ts +0 -66
- package/src/models/operations/getdeviceanalytics.ts +0 -66
- package/src/models/operations/getlinkinfo.ts +0 -64
- package/src/models/operations/getlinks.ts +30 -64
- package/src/models/operations/getlinkscount.ts +29 -66
- package/src/models/operations/getosanalytics.ts +0 -65
- package/src/models/operations/getqrcode.ts +0 -64
- package/src/models/operations/getrefereranalytics.ts +0 -66
- package/src/models/operations/gettags.ts +0 -64
- package/src/models/operations/gettimeseriesanalytics.ts +0 -66
- package/src/models/operations/gettoplinks.ts +0 -64
- package/src/models/operations/gettopurls.ts +0 -64
- package/src/models/operations/getworkspace.ts +0 -64
- package/src/models/operations/index.ts +0 -1
- package/src/models/operations/listdomains.ts +0 -198
- package/src/models/operations/setprimarydomain.ts +0 -203
- package/src/models/operations/transferdomain.ts +0 -202
- package/src/sdk/analytics.ts +713 -210
- package/src/sdk/domains.ts +436 -130
- package/src/sdk/links.ts +502 -150
- package/src/sdk/metatags.ts +1 -1
- package/src/sdk/qrcodes.ts +71 -21
- package/src/sdk/tags.ts +142 -42
- package/src/sdk/workspaces.ts +212 -63
- package/models/components/badrequest.d.ts.map +0 -1
- package/models/components/badrequest.js.map +0 -1
- package/models/components/conflict.d.ts.map +0 -1
- package/models/components/conflict.js.map +0 -1
- package/models/components/forbidden.d.ts.map +0 -1
- package/models/components/forbidden.js.map +0 -1
- package/models/components/internalservererror.d.ts.map +0 -1
- package/models/components/internalservererror.js.map +0 -1
- package/models/components/inviteexpired.d.ts.map +0 -1
- package/models/components/inviteexpired.js.map +0 -1
- package/models/components/notfound.d.ts.map +0 -1
- package/models/components/notfound.js.map +0 -1
- package/models/components/ratelimitexceeded.d.ts.map +0 -1
- package/models/components/ratelimitexceeded.js.map +0 -1
- package/models/components/unauthorized.d.ts.map +0 -1
- package/models/components/unauthorized.js.map +0 -1
- package/models/components/unprocessableentity.d.ts.map +0 -1
- package/models/components/unprocessableentity.js.map +0 -1
- package/models/operations/getworkspaces.d.ts +0 -11
- package/models/operations/getworkspaces.d.ts.map +0 -1
- package/models/operations/getworkspaces.js +0 -60
- package/models/operations/getworkspaces.js.map +0 -1
- package/src/models/operations/getworkspaces.ts +0 -71
package/src/sdk/metatags.ts
CHANGED
|
@@ -82,7 +82,7 @@ export class Metatags extends ClientSDK {
|
|
|
82
82
|
};
|
|
83
83
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
84
84
|
|
|
85
|
-
const doOptions = { context, errorCodes: [] };
|
|
85
|
+
const doOptions = { context, errorCodes: ["4XX", "5XX"] };
|
|
86
86
|
const request = this.createRequest$(
|
|
87
87
|
{
|
|
88
88
|
security: securitySettings$,
|
package/src/sdk/qrcodes.ts
CHANGED
|
@@ -10,6 +10,7 @@ import * as schemas$ from "../lib/schemas";
|
|
|
10
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks";
|
|
11
11
|
import * as errors from "../models/errors";
|
|
12
12
|
import * as operations from "../models/operations";
|
|
13
|
+
import * as z from "zod";
|
|
13
14
|
|
|
14
15
|
export enum GetAcceptEnum {
|
|
15
16
|
applicationJson = "application/json",
|
|
@@ -52,7 +53,7 @@ export class QRCodes extends ClientSDK {
|
|
|
52
53
|
async get(
|
|
53
54
|
input: operations.GetQRCodeRequest,
|
|
54
55
|
options?: RequestOptions & { acceptHeaderOverride?: GetAcceptEnum }
|
|
55
|
-
): Promise<
|
|
56
|
+
): Promise<string> {
|
|
56
57
|
const headers$ = new Headers();
|
|
57
58
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
58
59
|
|
|
@@ -103,7 +104,22 @@ export class QRCodes extends ClientSDK {
|
|
|
103
104
|
};
|
|
104
105
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
105
106
|
|
|
106
|
-
const doOptions = {
|
|
107
|
+
const doOptions = {
|
|
108
|
+
context,
|
|
109
|
+
errorCodes: [
|
|
110
|
+
"400",
|
|
111
|
+
"401",
|
|
112
|
+
"403",
|
|
113
|
+
"404",
|
|
114
|
+
"409",
|
|
115
|
+
"410",
|
|
116
|
+
"422",
|
|
117
|
+
"429",
|
|
118
|
+
"4XX",
|
|
119
|
+
"500",
|
|
120
|
+
"5XX",
|
|
121
|
+
],
|
|
122
|
+
};
|
|
107
123
|
const request = this.createRequest$(
|
|
108
124
|
{
|
|
109
125
|
security: securitySettings$,
|
|
@@ -118,12 +134,19 @@ export class QRCodes extends ClientSDK {
|
|
|
118
134
|
|
|
119
135
|
const response = await this.do$(request, doOptions);
|
|
120
136
|
|
|
137
|
+
const responseFields$ = {
|
|
138
|
+
HttpMeta: {
|
|
139
|
+
Response: response,
|
|
140
|
+
Request: request,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
121
144
|
if (this.matchResponse(response, 200, "image/png")) {
|
|
122
145
|
const responseBody = await response.text();
|
|
123
146
|
const result = schemas$.parse(
|
|
124
147
|
responseBody,
|
|
125
148
|
(val$) => {
|
|
126
|
-
return
|
|
149
|
+
return z.string().parse(val$);
|
|
127
150
|
},
|
|
128
151
|
"Response validation failed"
|
|
129
152
|
);
|
|
@@ -133,91 +156,118 @@ export class QRCodes extends ClientSDK {
|
|
|
133
156
|
const result = schemas$.parse(
|
|
134
157
|
responseBody,
|
|
135
158
|
(val$) => {
|
|
136
|
-
return
|
|
159
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
160
|
+
...responseFields$,
|
|
161
|
+
...val$,
|
|
162
|
+
});
|
|
137
163
|
},
|
|
138
164
|
"Response validation failed"
|
|
139
165
|
);
|
|
140
|
-
|
|
166
|
+
throw result;
|
|
141
167
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
142
168
|
const responseBody = await response.json();
|
|
143
169
|
const result = schemas$.parse(
|
|
144
170
|
responseBody,
|
|
145
171
|
(val$) => {
|
|
146
|
-
return
|
|
172
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
173
|
+
...responseFields$,
|
|
174
|
+
...val$,
|
|
175
|
+
});
|
|
147
176
|
},
|
|
148
177
|
"Response validation failed"
|
|
149
178
|
);
|
|
150
|
-
|
|
179
|
+
throw result;
|
|
151
180
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
152
181
|
const responseBody = await response.json();
|
|
153
182
|
const result = schemas$.parse(
|
|
154
183
|
responseBody,
|
|
155
184
|
(val$) => {
|
|
156
|
-
return
|
|
185
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
186
|
+
...responseFields$,
|
|
187
|
+
...val$,
|
|
188
|
+
});
|
|
157
189
|
},
|
|
158
190
|
"Response validation failed"
|
|
159
191
|
);
|
|
160
|
-
|
|
192
|
+
throw result;
|
|
161
193
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
162
194
|
const responseBody = await response.json();
|
|
163
195
|
const result = schemas$.parse(
|
|
164
196
|
responseBody,
|
|
165
197
|
(val$) => {
|
|
166
|
-
return
|
|
198
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
199
|
+
...responseFields$,
|
|
200
|
+
...val$,
|
|
201
|
+
});
|
|
167
202
|
},
|
|
168
203
|
"Response validation failed"
|
|
169
204
|
);
|
|
170
|
-
|
|
205
|
+
throw result;
|
|
171
206
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
172
207
|
const responseBody = await response.json();
|
|
173
208
|
const result = schemas$.parse(
|
|
174
209
|
responseBody,
|
|
175
210
|
(val$) => {
|
|
176
|
-
return
|
|
211
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
212
|
+
...responseFields$,
|
|
213
|
+
...val$,
|
|
214
|
+
});
|
|
177
215
|
},
|
|
178
216
|
"Response validation failed"
|
|
179
217
|
);
|
|
180
|
-
|
|
218
|
+
throw result;
|
|
181
219
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
182
220
|
const responseBody = await response.json();
|
|
183
221
|
const result = schemas$.parse(
|
|
184
222
|
responseBody,
|
|
185
223
|
(val$) => {
|
|
186
|
-
return
|
|
224
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
225
|
+
...responseFields$,
|
|
226
|
+
...val$,
|
|
227
|
+
});
|
|
187
228
|
},
|
|
188
229
|
"Response validation failed"
|
|
189
230
|
);
|
|
190
|
-
|
|
231
|
+
throw result;
|
|
191
232
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
192
233
|
const responseBody = await response.json();
|
|
193
234
|
const result = schemas$.parse(
|
|
194
235
|
responseBody,
|
|
195
236
|
(val$) => {
|
|
196
|
-
return
|
|
237
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
238
|
+
...responseFields$,
|
|
239
|
+
...val$,
|
|
240
|
+
});
|
|
197
241
|
},
|
|
198
242
|
"Response validation failed"
|
|
199
243
|
);
|
|
200
|
-
|
|
244
|
+
throw result;
|
|
201
245
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
202
246
|
const responseBody = await response.json();
|
|
203
247
|
const result = schemas$.parse(
|
|
204
248
|
responseBody,
|
|
205
249
|
(val$) => {
|
|
206
|
-
return
|
|
250
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
251
|
+
...responseFields$,
|
|
252
|
+
...val$,
|
|
253
|
+
});
|
|
207
254
|
},
|
|
208
255
|
"Response validation failed"
|
|
209
256
|
);
|
|
210
|
-
|
|
257
|
+
throw result;
|
|
211
258
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
212
259
|
const responseBody = await response.json();
|
|
213
260
|
const result = schemas$.parse(
|
|
214
261
|
responseBody,
|
|
215
262
|
(val$) => {
|
|
216
|
-
return
|
|
263
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
264
|
+
...responseFields$,
|
|
265
|
+
...val$,
|
|
266
|
+
});
|
|
217
267
|
},
|
|
218
268
|
"Response validation failed"
|
|
219
269
|
);
|
|
220
|
-
|
|
270
|
+
throw result;
|
|
221
271
|
} else {
|
|
222
272
|
const responseBody = await response.text();
|
|
223
273
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
package/src/sdk/tags.ts
CHANGED
|
@@ -8,8 +8,10 @@ import * as enc$ from "../lib/encodings";
|
|
|
8
8
|
import { HTTPClient } from "../lib/http";
|
|
9
9
|
import * as schemas$ from "../lib/schemas";
|
|
10
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks";
|
|
11
|
+
import * as components from "../models/components";
|
|
11
12
|
import * as errors from "../models/errors";
|
|
12
13
|
import * as operations from "../models/operations";
|
|
14
|
+
import * as z from "zod";
|
|
13
15
|
|
|
14
16
|
export class Tags extends ClientSDK {
|
|
15
17
|
private readonly options$: SDKOptions & { hooks?: SDKHooks };
|
|
@@ -47,7 +49,7 @@ export class Tags extends ClientSDK {
|
|
|
47
49
|
async list(
|
|
48
50
|
_input: operations.GetTagsRequest,
|
|
49
51
|
options?: RequestOptions
|
|
50
|
-
): Promise<
|
|
52
|
+
): Promise<Array<components.TagSchema>> {
|
|
51
53
|
const headers$ = new Headers();
|
|
52
54
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
53
55
|
headers$.set("Accept", "application/json");
|
|
@@ -82,7 +84,22 @@ export class Tags extends ClientSDK {
|
|
|
82
84
|
};
|
|
83
85
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
84
86
|
|
|
85
|
-
const doOptions = {
|
|
87
|
+
const doOptions = {
|
|
88
|
+
context,
|
|
89
|
+
errorCodes: [
|
|
90
|
+
"400",
|
|
91
|
+
"401",
|
|
92
|
+
"403",
|
|
93
|
+
"404",
|
|
94
|
+
"409",
|
|
95
|
+
"410",
|
|
96
|
+
"422",
|
|
97
|
+
"429",
|
|
98
|
+
"4XX",
|
|
99
|
+
"500",
|
|
100
|
+
"5XX",
|
|
101
|
+
],
|
|
102
|
+
};
|
|
86
103
|
const request = this.createRequest$(
|
|
87
104
|
{
|
|
88
105
|
security: securitySettings$,
|
|
@@ -96,12 +113,19 @@ export class Tags extends ClientSDK {
|
|
|
96
113
|
|
|
97
114
|
const response = await this.do$(request, doOptions);
|
|
98
115
|
|
|
116
|
+
const responseFields$ = {
|
|
117
|
+
HttpMeta: {
|
|
118
|
+
Response: response,
|
|
119
|
+
Request: request,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
99
123
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
100
124
|
const responseBody = await response.json();
|
|
101
125
|
const result = schemas$.parse(
|
|
102
126
|
responseBody,
|
|
103
127
|
(val$) => {
|
|
104
|
-
return
|
|
128
|
+
return z.array(components.TagSchema$.inboundSchema).parse(val$);
|
|
105
129
|
},
|
|
106
130
|
"Response validation failed"
|
|
107
131
|
);
|
|
@@ -111,91 +135,118 @@ export class Tags extends ClientSDK {
|
|
|
111
135
|
const result = schemas$.parse(
|
|
112
136
|
responseBody,
|
|
113
137
|
(val$) => {
|
|
114
|
-
return
|
|
138
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
139
|
+
...responseFields$,
|
|
140
|
+
...val$,
|
|
141
|
+
});
|
|
115
142
|
},
|
|
116
143
|
"Response validation failed"
|
|
117
144
|
);
|
|
118
|
-
|
|
145
|
+
throw result;
|
|
119
146
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
120
147
|
const responseBody = await response.json();
|
|
121
148
|
const result = schemas$.parse(
|
|
122
149
|
responseBody,
|
|
123
150
|
(val$) => {
|
|
124
|
-
return
|
|
151
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
152
|
+
...responseFields$,
|
|
153
|
+
...val$,
|
|
154
|
+
});
|
|
125
155
|
},
|
|
126
156
|
"Response validation failed"
|
|
127
157
|
);
|
|
128
|
-
|
|
158
|
+
throw result;
|
|
129
159
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
130
160
|
const responseBody = await response.json();
|
|
131
161
|
const result = schemas$.parse(
|
|
132
162
|
responseBody,
|
|
133
163
|
(val$) => {
|
|
134
|
-
return
|
|
164
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
165
|
+
...responseFields$,
|
|
166
|
+
...val$,
|
|
167
|
+
});
|
|
135
168
|
},
|
|
136
169
|
"Response validation failed"
|
|
137
170
|
);
|
|
138
|
-
|
|
171
|
+
throw result;
|
|
139
172
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
140
173
|
const responseBody = await response.json();
|
|
141
174
|
const result = schemas$.parse(
|
|
142
175
|
responseBody,
|
|
143
176
|
(val$) => {
|
|
144
|
-
return
|
|
177
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
178
|
+
...responseFields$,
|
|
179
|
+
...val$,
|
|
180
|
+
});
|
|
145
181
|
},
|
|
146
182
|
"Response validation failed"
|
|
147
183
|
);
|
|
148
|
-
|
|
184
|
+
throw result;
|
|
149
185
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
150
186
|
const responseBody = await response.json();
|
|
151
187
|
const result = schemas$.parse(
|
|
152
188
|
responseBody,
|
|
153
189
|
(val$) => {
|
|
154
|
-
return
|
|
190
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
191
|
+
...responseFields$,
|
|
192
|
+
...val$,
|
|
193
|
+
});
|
|
155
194
|
},
|
|
156
195
|
"Response validation failed"
|
|
157
196
|
);
|
|
158
|
-
|
|
197
|
+
throw result;
|
|
159
198
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
160
199
|
const responseBody = await response.json();
|
|
161
200
|
const result = schemas$.parse(
|
|
162
201
|
responseBody,
|
|
163
202
|
(val$) => {
|
|
164
|
-
return
|
|
203
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
204
|
+
...responseFields$,
|
|
205
|
+
...val$,
|
|
206
|
+
});
|
|
165
207
|
},
|
|
166
208
|
"Response validation failed"
|
|
167
209
|
);
|
|
168
|
-
|
|
210
|
+
throw result;
|
|
169
211
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
170
212
|
const responseBody = await response.json();
|
|
171
213
|
const result = schemas$.parse(
|
|
172
214
|
responseBody,
|
|
173
215
|
(val$) => {
|
|
174
|
-
return
|
|
216
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
217
|
+
...responseFields$,
|
|
218
|
+
...val$,
|
|
219
|
+
});
|
|
175
220
|
},
|
|
176
221
|
"Response validation failed"
|
|
177
222
|
);
|
|
178
|
-
|
|
223
|
+
throw result;
|
|
179
224
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
180
225
|
const responseBody = await response.json();
|
|
181
226
|
const result = schemas$.parse(
|
|
182
227
|
responseBody,
|
|
183
228
|
(val$) => {
|
|
184
|
-
return
|
|
229
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
230
|
+
...responseFields$,
|
|
231
|
+
...val$,
|
|
232
|
+
});
|
|
185
233
|
},
|
|
186
234
|
"Response validation failed"
|
|
187
235
|
);
|
|
188
|
-
|
|
236
|
+
throw result;
|
|
189
237
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
190
238
|
const responseBody = await response.json();
|
|
191
239
|
const result = schemas$.parse(
|
|
192
240
|
responseBody,
|
|
193
241
|
(val$) => {
|
|
194
|
-
return
|
|
242
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
243
|
+
...responseFields$,
|
|
244
|
+
...val$,
|
|
245
|
+
});
|
|
195
246
|
},
|
|
196
247
|
"Response validation failed"
|
|
197
248
|
);
|
|
198
|
-
|
|
249
|
+
throw result;
|
|
199
250
|
} else {
|
|
200
251
|
const responseBody = await response.text();
|
|
201
252
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -211,7 +262,7 @@ export class Tags extends ClientSDK {
|
|
|
211
262
|
async create(
|
|
212
263
|
input: operations.CreateTagRequestBody | undefined,
|
|
213
264
|
options?: RequestOptions
|
|
214
|
-
): Promise<
|
|
265
|
+
): Promise<components.TagSchema> {
|
|
215
266
|
const headers$ = new Headers();
|
|
216
267
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
217
268
|
headers$.set("Content-Type", "application/json");
|
|
@@ -255,7 +306,22 @@ export class Tags extends ClientSDK {
|
|
|
255
306
|
};
|
|
256
307
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
257
308
|
|
|
258
|
-
const doOptions = {
|
|
309
|
+
const doOptions = {
|
|
310
|
+
context,
|
|
311
|
+
errorCodes: [
|
|
312
|
+
"400",
|
|
313
|
+
"401",
|
|
314
|
+
"403",
|
|
315
|
+
"404",
|
|
316
|
+
"409",
|
|
317
|
+
"410",
|
|
318
|
+
"422",
|
|
319
|
+
"429",
|
|
320
|
+
"4XX",
|
|
321
|
+
"500",
|
|
322
|
+
"5XX",
|
|
323
|
+
],
|
|
324
|
+
};
|
|
259
325
|
const request = this.createRequest$(
|
|
260
326
|
{
|
|
261
327
|
security: securitySettings$,
|
|
@@ -270,12 +336,19 @@ export class Tags extends ClientSDK {
|
|
|
270
336
|
|
|
271
337
|
const response = await this.do$(request, doOptions);
|
|
272
338
|
|
|
339
|
+
const responseFields$ = {
|
|
340
|
+
HttpMeta: {
|
|
341
|
+
Response: response,
|
|
342
|
+
Request: request,
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
|
|
273
346
|
if (this.matchResponse(response, 201, "application/json")) {
|
|
274
347
|
const responseBody = await response.json();
|
|
275
348
|
const result = schemas$.parse(
|
|
276
349
|
responseBody,
|
|
277
350
|
(val$) => {
|
|
278
|
-
return
|
|
351
|
+
return components.TagSchema$.inboundSchema.parse(val$);
|
|
279
352
|
},
|
|
280
353
|
"Response validation failed"
|
|
281
354
|
);
|
|
@@ -285,91 +358,118 @@ export class Tags extends ClientSDK {
|
|
|
285
358
|
const result = schemas$.parse(
|
|
286
359
|
responseBody,
|
|
287
360
|
(val$) => {
|
|
288
|
-
return
|
|
361
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
362
|
+
...responseFields$,
|
|
363
|
+
...val$,
|
|
364
|
+
});
|
|
289
365
|
},
|
|
290
366
|
"Response validation failed"
|
|
291
367
|
);
|
|
292
|
-
|
|
368
|
+
throw result;
|
|
293
369
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
294
370
|
const responseBody = await response.json();
|
|
295
371
|
const result = schemas$.parse(
|
|
296
372
|
responseBody,
|
|
297
373
|
(val$) => {
|
|
298
|
-
return
|
|
374
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
375
|
+
...responseFields$,
|
|
376
|
+
...val$,
|
|
377
|
+
});
|
|
299
378
|
},
|
|
300
379
|
"Response validation failed"
|
|
301
380
|
);
|
|
302
|
-
|
|
381
|
+
throw result;
|
|
303
382
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
304
383
|
const responseBody = await response.json();
|
|
305
384
|
const result = schemas$.parse(
|
|
306
385
|
responseBody,
|
|
307
386
|
(val$) => {
|
|
308
|
-
return
|
|
387
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
388
|
+
...responseFields$,
|
|
389
|
+
...val$,
|
|
390
|
+
});
|
|
309
391
|
},
|
|
310
392
|
"Response validation failed"
|
|
311
393
|
);
|
|
312
|
-
|
|
394
|
+
throw result;
|
|
313
395
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
314
396
|
const responseBody = await response.json();
|
|
315
397
|
const result = schemas$.parse(
|
|
316
398
|
responseBody,
|
|
317
399
|
(val$) => {
|
|
318
|
-
return
|
|
400
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
401
|
+
...responseFields$,
|
|
402
|
+
...val$,
|
|
403
|
+
});
|
|
319
404
|
},
|
|
320
405
|
"Response validation failed"
|
|
321
406
|
);
|
|
322
|
-
|
|
407
|
+
throw result;
|
|
323
408
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
324
409
|
const responseBody = await response.json();
|
|
325
410
|
const result = schemas$.parse(
|
|
326
411
|
responseBody,
|
|
327
412
|
(val$) => {
|
|
328
|
-
return
|
|
413
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
414
|
+
...responseFields$,
|
|
415
|
+
...val$,
|
|
416
|
+
});
|
|
329
417
|
},
|
|
330
418
|
"Response validation failed"
|
|
331
419
|
);
|
|
332
|
-
|
|
420
|
+
throw result;
|
|
333
421
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
334
422
|
const responseBody = await response.json();
|
|
335
423
|
const result = schemas$.parse(
|
|
336
424
|
responseBody,
|
|
337
425
|
(val$) => {
|
|
338
|
-
return
|
|
426
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
427
|
+
...responseFields$,
|
|
428
|
+
...val$,
|
|
429
|
+
});
|
|
339
430
|
},
|
|
340
431
|
"Response validation failed"
|
|
341
432
|
);
|
|
342
|
-
|
|
433
|
+
throw result;
|
|
343
434
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
344
435
|
const responseBody = await response.json();
|
|
345
436
|
const result = schemas$.parse(
|
|
346
437
|
responseBody,
|
|
347
438
|
(val$) => {
|
|
348
|
-
return
|
|
439
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
440
|
+
...responseFields$,
|
|
441
|
+
...val$,
|
|
442
|
+
});
|
|
349
443
|
},
|
|
350
444
|
"Response validation failed"
|
|
351
445
|
);
|
|
352
|
-
|
|
446
|
+
throw result;
|
|
353
447
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
354
448
|
const responseBody = await response.json();
|
|
355
449
|
const result = schemas$.parse(
|
|
356
450
|
responseBody,
|
|
357
451
|
(val$) => {
|
|
358
|
-
return
|
|
452
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
453
|
+
...responseFields$,
|
|
454
|
+
...val$,
|
|
455
|
+
});
|
|
359
456
|
},
|
|
360
457
|
"Response validation failed"
|
|
361
458
|
);
|
|
362
|
-
|
|
459
|
+
throw result;
|
|
363
460
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
364
461
|
const responseBody = await response.json();
|
|
365
462
|
const result = schemas$.parse(
|
|
366
463
|
responseBody,
|
|
367
464
|
(val$) => {
|
|
368
|
-
return
|
|
465
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
466
|
+
...responseFields$,
|
|
467
|
+
...val$,
|
|
468
|
+
});
|
|
369
469
|
},
|
|
370
470
|
"Response validation failed"
|
|
371
471
|
);
|
|
372
|
-
|
|
472
|
+
throw result;
|
|
373
473
|
} else {
|
|
374
474
|
const responseBody = await response.text();
|
|
375
475
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|