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/links.ts
CHANGED
|
@@ -8,6 +8,7 @@ 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";
|
|
13
14
|
import * as z from "zod";
|
|
@@ -48,7 +49,7 @@ export class Links extends ClientSDK {
|
|
|
48
49
|
async list(
|
|
49
50
|
input: operations.GetLinksRequest,
|
|
50
51
|
options?: RequestOptions
|
|
51
|
-
): Promise<
|
|
52
|
+
): Promise<Array<components.LinkSchema>> {
|
|
52
53
|
const headers$ = new Headers();
|
|
53
54
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
54
55
|
headers$.set("Accept", "application/json");
|
|
@@ -77,6 +78,10 @@ export class Links extends ClientSDK {
|
|
|
77
78
|
enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }),
|
|
78
79
|
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
79
80
|
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
81
|
+
enc$.encodeForm("tagNames", payload$.tagNames, {
|
|
82
|
+
explode: true,
|
|
83
|
+
charEncoding: "percent",
|
|
84
|
+
}),
|
|
80
85
|
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
81
86
|
enc$.encodeForm("withTags", payload$.withTags, {
|
|
82
87
|
explode: true,
|
|
@@ -105,7 +110,22 @@ export class Links extends ClientSDK {
|
|
|
105
110
|
};
|
|
106
111
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
107
112
|
|
|
108
|
-
const doOptions = {
|
|
113
|
+
const doOptions = {
|
|
114
|
+
context,
|
|
115
|
+
errorCodes: [
|
|
116
|
+
"400",
|
|
117
|
+
"401",
|
|
118
|
+
"403",
|
|
119
|
+
"404",
|
|
120
|
+
"409",
|
|
121
|
+
"410",
|
|
122
|
+
"422",
|
|
123
|
+
"429",
|
|
124
|
+
"4XX",
|
|
125
|
+
"500",
|
|
126
|
+
"5XX",
|
|
127
|
+
],
|
|
128
|
+
};
|
|
109
129
|
const request = this.createRequest$(
|
|
110
130
|
{
|
|
111
131
|
security: securitySettings$,
|
|
@@ -120,12 +140,19 @@ export class Links extends ClientSDK {
|
|
|
120
140
|
|
|
121
141
|
const response = await this.do$(request, doOptions);
|
|
122
142
|
|
|
143
|
+
const responseFields$ = {
|
|
144
|
+
HttpMeta: {
|
|
145
|
+
Response: response,
|
|
146
|
+
Request: request,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
123
150
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
124
151
|
const responseBody = await response.json();
|
|
125
152
|
const result = schemas$.parse(
|
|
126
153
|
responseBody,
|
|
127
154
|
(val$) => {
|
|
128
|
-
return
|
|
155
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
129
156
|
},
|
|
130
157
|
"Response validation failed"
|
|
131
158
|
);
|
|
@@ -135,91 +162,118 @@ export class Links extends ClientSDK {
|
|
|
135
162
|
const result = schemas$.parse(
|
|
136
163
|
responseBody,
|
|
137
164
|
(val$) => {
|
|
138
|
-
return
|
|
165
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
166
|
+
...responseFields$,
|
|
167
|
+
...val$,
|
|
168
|
+
});
|
|
139
169
|
},
|
|
140
170
|
"Response validation failed"
|
|
141
171
|
);
|
|
142
|
-
|
|
172
|
+
throw result;
|
|
143
173
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
144
174
|
const responseBody = await response.json();
|
|
145
175
|
const result = schemas$.parse(
|
|
146
176
|
responseBody,
|
|
147
177
|
(val$) => {
|
|
148
|
-
return
|
|
178
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
179
|
+
...responseFields$,
|
|
180
|
+
...val$,
|
|
181
|
+
});
|
|
149
182
|
},
|
|
150
183
|
"Response validation failed"
|
|
151
184
|
);
|
|
152
|
-
|
|
185
|
+
throw result;
|
|
153
186
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
154
187
|
const responseBody = await response.json();
|
|
155
188
|
const result = schemas$.parse(
|
|
156
189
|
responseBody,
|
|
157
190
|
(val$) => {
|
|
158
|
-
return
|
|
191
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
192
|
+
...responseFields$,
|
|
193
|
+
...val$,
|
|
194
|
+
});
|
|
159
195
|
},
|
|
160
196
|
"Response validation failed"
|
|
161
197
|
);
|
|
162
|
-
|
|
198
|
+
throw result;
|
|
163
199
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
164
200
|
const responseBody = await response.json();
|
|
165
201
|
const result = schemas$.parse(
|
|
166
202
|
responseBody,
|
|
167
203
|
(val$) => {
|
|
168
|
-
return
|
|
204
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
205
|
+
...responseFields$,
|
|
206
|
+
...val$,
|
|
207
|
+
});
|
|
169
208
|
},
|
|
170
209
|
"Response validation failed"
|
|
171
210
|
);
|
|
172
|
-
|
|
211
|
+
throw result;
|
|
173
212
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
174
213
|
const responseBody = await response.json();
|
|
175
214
|
const result = schemas$.parse(
|
|
176
215
|
responseBody,
|
|
177
216
|
(val$) => {
|
|
178
|
-
return
|
|
217
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
218
|
+
...responseFields$,
|
|
219
|
+
...val$,
|
|
220
|
+
});
|
|
179
221
|
},
|
|
180
222
|
"Response validation failed"
|
|
181
223
|
);
|
|
182
|
-
|
|
224
|
+
throw result;
|
|
183
225
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
184
226
|
const responseBody = await response.json();
|
|
185
227
|
const result = schemas$.parse(
|
|
186
228
|
responseBody,
|
|
187
229
|
(val$) => {
|
|
188
|
-
return
|
|
230
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
231
|
+
...responseFields$,
|
|
232
|
+
...val$,
|
|
233
|
+
});
|
|
189
234
|
},
|
|
190
235
|
"Response validation failed"
|
|
191
236
|
);
|
|
192
|
-
|
|
237
|
+
throw result;
|
|
193
238
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
194
239
|
const responseBody = await response.json();
|
|
195
240
|
const result = schemas$.parse(
|
|
196
241
|
responseBody,
|
|
197
242
|
(val$) => {
|
|
198
|
-
return
|
|
243
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
244
|
+
...responseFields$,
|
|
245
|
+
...val$,
|
|
246
|
+
});
|
|
199
247
|
},
|
|
200
248
|
"Response validation failed"
|
|
201
249
|
);
|
|
202
|
-
|
|
250
|
+
throw result;
|
|
203
251
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
204
252
|
const responseBody = await response.json();
|
|
205
253
|
const result = schemas$.parse(
|
|
206
254
|
responseBody,
|
|
207
255
|
(val$) => {
|
|
208
|
-
return
|
|
256
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
257
|
+
...responseFields$,
|
|
258
|
+
...val$,
|
|
259
|
+
});
|
|
209
260
|
},
|
|
210
261
|
"Response validation failed"
|
|
211
262
|
);
|
|
212
|
-
|
|
263
|
+
throw result;
|
|
213
264
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
214
265
|
const responseBody = await response.json();
|
|
215
266
|
const result = schemas$.parse(
|
|
216
267
|
responseBody,
|
|
217
268
|
(val$) => {
|
|
218
|
-
return
|
|
269
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
270
|
+
...responseFields$,
|
|
271
|
+
...val$,
|
|
272
|
+
});
|
|
219
273
|
},
|
|
220
274
|
"Response validation failed"
|
|
221
275
|
);
|
|
222
|
-
|
|
276
|
+
throw result;
|
|
223
277
|
} else {
|
|
224
278
|
const responseBody = await response.text();
|
|
225
279
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -235,7 +289,7 @@ export class Links extends ClientSDK {
|
|
|
235
289
|
async create(
|
|
236
290
|
input: operations.CreateLinkRequestBody | undefined,
|
|
237
291
|
options?: RequestOptions
|
|
238
|
-
): Promise<
|
|
292
|
+
): Promise<components.LinkSchema> {
|
|
239
293
|
const headers$ = new Headers();
|
|
240
294
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
241
295
|
headers$.set("Content-Type", "application/json");
|
|
@@ -279,7 +333,22 @@ export class Links extends ClientSDK {
|
|
|
279
333
|
};
|
|
280
334
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
281
335
|
|
|
282
|
-
const doOptions = {
|
|
336
|
+
const doOptions = {
|
|
337
|
+
context,
|
|
338
|
+
errorCodes: [
|
|
339
|
+
"400",
|
|
340
|
+
"401",
|
|
341
|
+
"403",
|
|
342
|
+
"404",
|
|
343
|
+
"409",
|
|
344
|
+
"410",
|
|
345
|
+
"422",
|
|
346
|
+
"429",
|
|
347
|
+
"4XX",
|
|
348
|
+
"500",
|
|
349
|
+
"5XX",
|
|
350
|
+
],
|
|
351
|
+
};
|
|
283
352
|
const request = this.createRequest$(
|
|
284
353
|
{
|
|
285
354
|
security: securitySettings$,
|
|
@@ -294,12 +363,19 @@ export class Links extends ClientSDK {
|
|
|
294
363
|
|
|
295
364
|
const response = await this.do$(request, doOptions);
|
|
296
365
|
|
|
366
|
+
const responseFields$ = {
|
|
367
|
+
HttpMeta: {
|
|
368
|
+
Response: response,
|
|
369
|
+
Request: request,
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
|
|
297
373
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
298
374
|
const responseBody = await response.json();
|
|
299
375
|
const result = schemas$.parse(
|
|
300
376
|
responseBody,
|
|
301
377
|
(val$) => {
|
|
302
|
-
return
|
|
378
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
303
379
|
},
|
|
304
380
|
"Response validation failed"
|
|
305
381
|
);
|
|
@@ -309,91 +385,118 @@ export class Links extends ClientSDK {
|
|
|
309
385
|
const result = schemas$.parse(
|
|
310
386
|
responseBody,
|
|
311
387
|
(val$) => {
|
|
312
|
-
return
|
|
388
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
389
|
+
...responseFields$,
|
|
390
|
+
...val$,
|
|
391
|
+
});
|
|
313
392
|
},
|
|
314
393
|
"Response validation failed"
|
|
315
394
|
);
|
|
316
|
-
|
|
395
|
+
throw result;
|
|
317
396
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
318
397
|
const responseBody = await response.json();
|
|
319
398
|
const result = schemas$.parse(
|
|
320
399
|
responseBody,
|
|
321
400
|
(val$) => {
|
|
322
|
-
return
|
|
401
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
402
|
+
...responseFields$,
|
|
403
|
+
...val$,
|
|
404
|
+
});
|
|
323
405
|
},
|
|
324
406
|
"Response validation failed"
|
|
325
407
|
);
|
|
326
|
-
|
|
408
|
+
throw result;
|
|
327
409
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
328
410
|
const responseBody = await response.json();
|
|
329
411
|
const result = schemas$.parse(
|
|
330
412
|
responseBody,
|
|
331
413
|
(val$) => {
|
|
332
|
-
return
|
|
414
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
415
|
+
...responseFields$,
|
|
416
|
+
...val$,
|
|
417
|
+
});
|
|
333
418
|
},
|
|
334
419
|
"Response validation failed"
|
|
335
420
|
);
|
|
336
|
-
|
|
421
|
+
throw result;
|
|
337
422
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
338
423
|
const responseBody = await response.json();
|
|
339
424
|
const result = schemas$.parse(
|
|
340
425
|
responseBody,
|
|
341
426
|
(val$) => {
|
|
342
|
-
return
|
|
427
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
428
|
+
...responseFields$,
|
|
429
|
+
...val$,
|
|
430
|
+
});
|
|
343
431
|
},
|
|
344
432
|
"Response validation failed"
|
|
345
433
|
);
|
|
346
|
-
|
|
434
|
+
throw result;
|
|
347
435
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
348
436
|
const responseBody = await response.json();
|
|
349
437
|
const result = schemas$.parse(
|
|
350
438
|
responseBody,
|
|
351
439
|
(val$) => {
|
|
352
|
-
return
|
|
440
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
441
|
+
...responseFields$,
|
|
442
|
+
...val$,
|
|
443
|
+
});
|
|
353
444
|
},
|
|
354
445
|
"Response validation failed"
|
|
355
446
|
);
|
|
356
|
-
|
|
447
|
+
throw result;
|
|
357
448
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
358
449
|
const responseBody = await response.json();
|
|
359
450
|
const result = schemas$.parse(
|
|
360
451
|
responseBody,
|
|
361
452
|
(val$) => {
|
|
362
|
-
return
|
|
453
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
454
|
+
...responseFields$,
|
|
455
|
+
...val$,
|
|
456
|
+
});
|
|
363
457
|
},
|
|
364
458
|
"Response validation failed"
|
|
365
459
|
);
|
|
366
|
-
|
|
460
|
+
throw result;
|
|
367
461
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
368
462
|
const responseBody = await response.json();
|
|
369
463
|
const result = schemas$.parse(
|
|
370
464
|
responseBody,
|
|
371
465
|
(val$) => {
|
|
372
|
-
return
|
|
466
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
467
|
+
...responseFields$,
|
|
468
|
+
...val$,
|
|
469
|
+
});
|
|
373
470
|
},
|
|
374
471
|
"Response validation failed"
|
|
375
472
|
);
|
|
376
|
-
|
|
473
|
+
throw result;
|
|
377
474
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
378
475
|
const responseBody = await response.json();
|
|
379
476
|
const result = schemas$.parse(
|
|
380
477
|
responseBody,
|
|
381
478
|
(val$) => {
|
|
382
|
-
return
|
|
479
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
480
|
+
...responseFields$,
|
|
481
|
+
...val$,
|
|
482
|
+
});
|
|
383
483
|
},
|
|
384
484
|
"Response validation failed"
|
|
385
485
|
);
|
|
386
|
-
|
|
486
|
+
throw result;
|
|
387
487
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
388
488
|
const responseBody = await response.json();
|
|
389
489
|
const result = schemas$.parse(
|
|
390
490
|
responseBody,
|
|
391
491
|
(val$) => {
|
|
392
|
-
return
|
|
492
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
493
|
+
...responseFields$,
|
|
494
|
+
...val$,
|
|
495
|
+
});
|
|
393
496
|
},
|
|
394
497
|
"Response validation failed"
|
|
395
498
|
);
|
|
396
|
-
|
|
499
|
+
throw result;
|
|
397
500
|
} else {
|
|
398
501
|
const responseBody = await response.text();
|
|
399
502
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -406,10 +509,7 @@ export class Links extends ClientSDK {
|
|
|
406
509
|
* @remarks
|
|
407
510
|
* Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.
|
|
408
511
|
*/
|
|
409
|
-
async count(
|
|
410
|
-
input: operations.GetLinksCountRequest,
|
|
411
|
-
options?: RequestOptions
|
|
412
|
-
): Promise<operations.GetLinksCountResponse> {
|
|
512
|
+
async count(input: operations.GetLinksCountRequest, options?: RequestOptions): Promise<number> {
|
|
413
513
|
const headers$ = new Headers();
|
|
414
514
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
415
515
|
headers$.set("Accept", "application/json");
|
|
@@ -440,6 +540,10 @@ export class Links extends ClientSDK {
|
|
|
440
540
|
}),
|
|
441
541
|
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
442
542
|
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
543
|
+
enc$.encodeForm("tagNames", payload$.tagNames, {
|
|
544
|
+
explode: true,
|
|
545
|
+
charEncoding: "percent",
|
|
546
|
+
}),
|
|
443
547
|
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
444
548
|
enc$.encodeForm("withTags", payload$.withTags, {
|
|
445
549
|
explode: true,
|
|
@@ -468,7 +572,22 @@ export class Links extends ClientSDK {
|
|
|
468
572
|
};
|
|
469
573
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
470
574
|
|
|
471
|
-
const doOptions = {
|
|
575
|
+
const doOptions = {
|
|
576
|
+
context,
|
|
577
|
+
errorCodes: [
|
|
578
|
+
"400",
|
|
579
|
+
"401",
|
|
580
|
+
"403",
|
|
581
|
+
"404",
|
|
582
|
+
"409",
|
|
583
|
+
"410",
|
|
584
|
+
"422",
|
|
585
|
+
"429",
|
|
586
|
+
"4XX",
|
|
587
|
+
"500",
|
|
588
|
+
"5XX",
|
|
589
|
+
],
|
|
590
|
+
};
|
|
472
591
|
const request = this.createRequest$(
|
|
473
592
|
{
|
|
474
593
|
security: securitySettings$,
|
|
@@ -483,12 +602,19 @@ export class Links extends ClientSDK {
|
|
|
483
602
|
|
|
484
603
|
const response = await this.do$(request, doOptions);
|
|
485
604
|
|
|
605
|
+
const responseFields$ = {
|
|
606
|
+
HttpMeta: {
|
|
607
|
+
Response: response,
|
|
608
|
+
Request: request,
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
|
|
486
612
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
487
613
|
const responseBody = await response.json();
|
|
488
614
|
const result = schemas$.parse(
|
|
489
615
|
responseBody,
|
|
490
616
|
(val$) => {
|
|
491
|
-
return
|
|
617
|
+
return z.number().parse(val$);
|
|
492
618
|
},
|
|
493
619
|
"Response validation failed"
|
|
494
620
|
);
|
|
@@ -498,91 +624,118 @@ export class Links extends ClientSDK {
|
|
|
498
624
|
const result = schemas$.parse(
|
|
499
625
|
responseBody,
|
|
500
626
|
(val$) => {
|
|
501
|
-
return
|
|
627
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
628
|
+
...responseFields$,
|
|
629
|
+
...val$,
|
|
630
|
+
});
|
|
502
631
|
},
|
|
503
632
|
"Response validation failed"
|
|
504
633
|
);
|
|
505
|
-
|
|
634
|
+
throw result;
|
|
506
635
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
507
636
|
const responseBody = await response.json();
|
|
508
637
|
const result = schemas$.parse(
|
|
509
638
|
responseBody,
|
|
510
639
|
(val$) => {
|
|
511
|
-
return
|
|
640
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
641
|
+
...responseFields$,
|
|
642
|
+
...val$,
|
|
643
|
+
});
|
|
512
644
|
},
|
|
513
645
|
"Response validation failed"
|
|
514
646
|
);
|
|
515
|
-
|
|
647
|
+
throw result;
|
|
516
648
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
517
649
|
const responseBody = await response.json();
|
|
518
650
|
const result = schemas$.parse(
|
|
519
651
|
responseBody,
|
|
520
652
|
(val$) => {
|
|
521
|
-
return
|
|
653
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
654
|
+
...responseFields$,
|
|
655
|
+
...val$,
|
|
656
|
+
});
|
|
522
657
|
},
|
|
523
658
|
"Response validation failed"
|
|
524
659
|
);
|
|
525
|
-
|
|
660
|
+
throw result;
|
|
526
661
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
527
662
|
const responseBody = await response.json();
|
|
528
663
|
const result = schemas$.parse(
|
|
529
664
|
responseBody,
|
|
530
665
|
(val$) => {
|
|
531
|
-
return
|
|
666
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
667
|
+
...responseFields$,
|
|
668
|
+
...val$,
|
|
669
|
+
});
|
|
532
670
|
},
|
|
533
671
|
"Response validation failed"
|
|
534
672
|
);
|
|
535
|
-
|
|
673
|
+
throw result;
|
|
536
674
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
537
675
|
const responseBody = await response.json();
|
|
538
676
|
const result = schemas$.parse(
|
|
539
677
|
responseBody,
|
|
540
678
|
(val$) => {
|
|
541
|
-
return
|
|
679
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
680
|
+
...responseFields$,
|
|
681
|
+
...val$,
|
|
682
|
+
});
|
|
542
683
|
},
|
|
543
684
|
"Response validation failed"
|
|
544
685
|
);
|
|
545
|
-
|
|
686
|
+
throw result;
|
|
546
687
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
547
688
|
const responseBody = await response.json();
|
|
548
689
|
const result = schemas$.parse(
|
|
549
690
|
responseBody,
|
|
550
691
|
(val$) => {
|
|
551
|
-
return
|
|
692
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
693
|
+
...responseFields$,
|
|
694
|
+
...val$,
|
|
695
|
+
});
|
|
552
696
|
},
|
|
553
697
|
"Response validation failed"
|
|
554
698
|
);
|
|
555
|
-
|
|
699
|
+
throw result;
|
|
556
700
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
557
701
|
const responseBody = await response.json();
|
|
558
702
|
const result = schemas$.parse(
|
|
559
703
|
responseBody,
|
|
560
704
|
(val$) => {
|
|
561
|
-
return
|
|
705
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
706
|
+
...responseFields$,
|
|
707
|
+
...val$,
|
|
708
|
+
});
|
|
562
709
|
},
|
|
563
710
|
"Response validation failed"
|
|
564
711
|
);
|
|
565
|
-
|
|
712
|
+
throw result;
|
|
566
713
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
567
714
|
const responseBody = await response.json();
|
|
568
715
|
const result = schemas$.parse(
|
|
569
716
|
responseBody,
|
|
570
717
|
(val$) => {
|
|
571
|
-
return
|
|
718
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
719
|
+
...responseFields$,
|
|
720
|
+
...val$,
|
|
721
|
+
});
|
|
572
722
|
},
|
|
573
723
|
"Response validation failed"
|
|
574
724
|
);
|
|
575
|
-
|
|
725
|
+
throw result;
|
|
576
726
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
577
727
|
const responseBody = await response.json();
|
|
578
728
|
const result = schemas$.parse(
|
|
579
729
|
responseBody,
|
|
580
730
|
(val$) => {
|
|
581
|
-
return
|
|
731
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
732
|
+
...responseFields$,
|
|
733
|
+
...val$,
|
|
734
|
+
});
|
|
582
735
|
},
|
|
583
736
|
"Response validation failed"
|
|
584
737
|
);
|
|
585
|
-
|
|
738
|
+
throw result;
|
|
586
739
|
} else {
|
|
587
740
|
const responseBody = await response.text();
|
|
588
741
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -598,7 +751,7 @@ export class Links extends ClientSDK {
|
|
|
598
751
|
async get(
|
|
599
752
|
input: operations.GetLinkInfoRequest,
|
|
600
753
|
options?: RequestOptions
|
|
601
|
-
): Promise<
|
|
754
|
+
): Promise<components.LinkSchema> {
|
|
602
755
|
const headers$ = new Headers();
|
|
603
756
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
604
757
|
headers$.set("Accept", "application/json");
|
|
@@ -642,7 +795,22 @@ export class Links extends ClientSDK {
|
|
|
642
795
|
};
|
|
643
796
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
644
797
|
|
|
645
|
-
const doOptions = {
|
|
798
|
+
const doOptions = {
|
|
799
|
+
context,
|
|
800
|
+
errorCodes: [
|
|
801
|
+
"400",
|
|
802
|
+
"401",
|
|
803
|
+
"403",
|
|
804
|
+
"404",
|
|
805
|
+
"409",
|
|
806
|
+
"410",
|
|
807
|
+
"422",
|
|
808
|
+
"429",
|
|
809
|
+
"4XX",
|
|
810
|
+
"500",
|
|
811
|
+
"5XX",
|
|
812
|
+
],
|
|
813
|
+
};
|
|
646
814
|
const request = this.createRequest$(
|
|
647
815
|
{
|
|
648
816
|
security: securitySettings$,
|
|
@@ -657,12 +825,19 @@ export class Links extends ClientSDK {
|
|
|
657
825
|
|
|
658
826
|
const response = await this.do$(request, doOptions);
|
|
659
827
|
|
|
828
|
+
const responseFields$ = {
|
|
829
|
+
HttpMeta: {
|
|
830
|
+
Response: response,
|
|
831
|
+
Request: request,
|
|
832
|
+
},
|
|
833
|
+
};
|
|
834
|
+
|
|
660
835
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
661
836
|
const responseBody = await response.json();
|
|
662
837
|
const result = schemas$.parse(
|
|
663
838
|
responseBody,
|
|
664
839
|
(val$) => {
|
|
665
|
-
return
|
|
840
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
666
841
|
},
|
|
667
842
|
"Response validation failed"
|
|
668
843
|
);
|
|
@@ -672,91 +847,118 @@ export class Links extends ClientSDK {
|
|
|
672
847
|
const result = schemas$.parse(
|
|
673
848
|
responseBody,
|
|
674
849
|
(val$) => {
|
|
675
|
-
return
|
|
850
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
851
|
+
...responseFields$,
|
|
852
|
+
...val$,
|
|
853
|
+
});
|
|
676
854
|
},
|
|
677
855
|
"Response validation failed"
|
|
678
856
|
);
|
|
679
|
-
|
|
857
|
+
throw result;
|
|
680
858
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
681
859
|
const responseBody = await response.json();
|
|
682
860
|
const result = schemas$.parse(
|
|
683
861
|
responseBody,
|
|
684
862
|
(val$) => {
|
|
685
|
-
return
|
|
863
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
864
|
+
...responseFields$,
|
|
865
|
+
...val$,
|
|
866
|
+
});
|
|
686
867
|
},
|
|
687
868
|
"Response validation failed"
|
|
688
869
|
);
|
|
689
|
-
|
|
870
|
+
throw result;
|
|
690
871
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
691
872
|
const responseBody = await response.json();
|
|
692
873
|
const result = schemas$.parse(
|
|
693
874
|
responseBody,
|
|
694
875
|
(val$) => {
|
|
695
|
-
return
|
|
876
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
877
|
+
...responseFields$,
|
|
878
|
+
...val$,
|
|
879
|
+
});
|
|
696
880
|
},
|
|
697
881
|
"Response validation failed"
|
|
698
882
|
);
|
|
699
|
-
|
|
883
|
+
throw result;
|
|
700
884
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
701
885
|
const responseBody = await response.json();
|
|
702
886
|
const result = schemas$.parse(
|
|
703
887
|
responseBody,
|
|
704
888
|
(val$) => {
|
|
705
|
-
return
|
|
889
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
890
|
+
...responseFields$,
|
|
891
|
+
...val$,
|
|
892
|
+
});
|
|
706
893
|
},
|
|
707
894
|
"Response validation failed"
|
|
708
895
|
);
|
|
709
|
-
|
|
896
|
+
throw result;
|
|
710
897
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
711
898
|
const responseBody = await response.json();
|
|
712
899
|
const result = schemas$.parse(
|
|
713
900
|
responseBody,
|
|
714
901
|
(val$) => {
|
|
715
|
-
return
|
|
902
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
903
|
+
...responseFields$,
|
|
904
|
+
...val$,
|
|
905
|
+
});
|
|
716
906
|
},
|
|
717
907
|
"Response validation failed"
|
|
718
908
|
);
|
|
719
|
-
|
|
909
|
+
throw result;
|
|
720
910
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
721
911
|
const responseBody = await response.json();
|
|
722
912
|
const result = schemas$.parse(
|
|
723
913
|
responseBody,
|
|
724
914
|
(val$) => {
|
|
725
|
-
return
|
|
915
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
916
|
+
...responseFields$,
|
|
917
|
+
...val$,
|
|
918
|
+
});
|
|
726
919
|
},
|
|
727
920
|
"Response validation failed"
|
|
728
921
|
);
|
|
729
|
-
|
|
922
|
+
throw result;
|
|
730
923
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
731
924
|
const responseBody = await response.json();
|
|
732
925
|
const result = schemas$.parse(
|
|
733
926
|
responseBody,
|
|
734
927
|
(val$) => {
|
|
735
|
-
return
|
|
928
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
929
|
+
...responseFields$,
|
|
930
|
+
...val$,
|
|
931
|
+
});
|
|
736
932
|
},
|
|
737
933
|
"Response validation failed"
|
|
738
934
|
);
|
|
739
|
-
|
|
935
|
+
throw result;
|
|
740
936
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
741
937
|
const responseBody = await response.json();
|
|
742
938
|
const result = schemas$.parse(
|
|
743
939
|
responseBody,
|
|
744
940
|
(val$) => {
|
|
745
|
-
return
|
|
941
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
942
|
+
...responseFields$,
|
|
943
|
+
...val$,
|
|
944
|
+
});
|
|
746
945
|
},
|
|
747
946
|
"Response validation failed"
|
|
748
947
|
);
|
|
749
|
-
|
|
948
|
+
throw result;
|
|
750
949
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
751
950
|
const responseBody = await response.json();
|
|
752
951
|
const result = schemas$.parse(
|
|
753
952
|
responseBody,
|
|
754
953
|
(val$) => {
|
|
755
|
-
return
|
|
954
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
955
|
+
...responseFields$,
|
|
956
|
+
...val$,
|
|
957
|
+
});
|
|
756
958
|
},
|
|
757
959
|
"Response validation failed"
|
|
758
960
|
);
|
|
759
|
-
|
|
961
|
+
throw result;
|
|
760
962
|
} else {
|
|
761
963
|
const responseBody = await response.text();
|
|
762
964
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -773,7 +975,7 @@ export class Links extends ClientSDK {
|
|
|
773
975
|
linkId: string,
|
|
774
976
|
requestBody?: operations.EditLinkRequestBody | undefined,
|
|
775
977
|
options?: RequestOptions
|
|
776
|
-
): Promise<
|
|
978
|
+
): Promise<components.LinkSchema> {
|
|
777
979
|
const input$: operations.EditLinkRequest = {
|
|
778
980
|
linkId: linkId,
|
|
779
981
|
requestBody: requestBody,
|
|
@@ -826,7 +1028,22 @@ export class Links extends ClientSDK {
|
|
|
826
1028
|
};
|
|
827
1029
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
828
1030
|
|
|
829
|
-
const doOptions = {
|
|
1031
|
+
const doOptions = {
|
|
1032
|
+
context,
|
|
1033
|
+
errorCodes: [
|
|
1034
|
+
"400",
|
|
1035
|
+
"401",
|
|
1036
|
+
"403",
|
|
1037
|
+
"404",
|
|
1038
|
+
"409",
|
|
1039
|
+
"410",
|
|
1040
|
+
"422",
|
|
1041
|
+
"429",
|
|
1042
|
+
"4XX",
|
|
1043
|
+
"500",
|
|
1044
|
+
"5XX",
|
|
1045
|
+
],
|
|
1046
|
+
};
|
|
830
1047
|
const request = this.createRequest$(
|
|
831
1048
|
{
|
|
832
1049
|
security: securitySettings$,
|
|
@@ -841,12 +1058,19 @@ export class Links extends ClientSDK {
|
|
|
841
1058
|
|
|
842
1059
|
const response = await this.do$(request, doOptions);
|
|
843
1060
|
|
|
1061
|
+
const responseFields$ = {
|
|
1062
|
+
HttpMeta: {
|
|
1063
|
+
Response: response,
|
|
1064
|
+
Request: request,
|
|
1065
|
+
},
|
|
1066
|
+
};
|
|
1067
|
+
|
|
844
1068
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
845
1069
|
const responseBody = await response.json();
|
|
846
1070
|
const result = schemas$.parse(
|
|
847
1071
|
responseBody,
|
|
848
1072
|
(val$) => {
|
|
849
|
-
return
|
|
1073
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
850
1074
|
},
|
|
851
1075
|
"Response validation failed"
|
|
852
1076
|
);
|
|
@@ -856,91 +1080,118 @@ export class Links extends ClientSDK {
|
|
|
856
1080
|
const result = schemas$.parse(
|
|
857
1081
|
responseBody,
|
|
858
1082
|
(val$) => {
|
|
859
|
-
return
|
|
1083
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1084
|
+
...responseFields$,
|
|
1085
|
+
...val$,
|
|
1086
|
+
});
|
|
860
1087
|
},
|
|
861
1088
|
"Response validation failed"
|
|
862
1089
|
);
|
|
863
|
-
|
|
1090
|
+
throw result;
|
|
864
1091
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
865
1092
|
const responseBody = await response.json();
|
|
866
1093
|
const result = schemas$.parse(
|
|
867
1094
|
responseBody,
|
|
868
1095
|
(val$) => {
|
|
869
|
-
return
|
|
1096
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1097
|
+
...responseFields$,
|
|
1098
|
+
...val$,
|
|
1099
|
+
});
|
|
870
1100
|
},
|
|
871
1101
|
"Response validation failed"
|
|
872
1102
|
);
|
|
873
|
-
|
|
1103
|
+
throw result;
|
|
874
1104
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
875
1105
|
const responseBody = await response.json();
|
|
876
1106
|
const result = schemas$.parse(
|
|
877
1107
|
responseBody,
|
|
878
1108
|
(val$) => {
|
|
879
|
-
return
|
|
1109
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1110
|
+
...responseFields$,
|
|
1111
|
+
...val$,
|
|
1112
|
+
});
|
|
880
1113
|
},
|
|
881
1114
|
"Response validation failed"
|
|
882
1115
|
);
|
|
883
|
-
|
|
1116
|
+
throw result;
|
|
884
1117
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
885
1118
|
const responseBody = await response.json();
|
|
886
1119
|
const result = schemas$.parse(
|
|
887
1120
|
responseBody,
|
|
888
1121
|
(val$) => {
|
|
889
|
-
return
|
|
1122
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1123
|
+
...responseFields$,
|
|
1124
|
+
...val$,
|
|
1125
|
+
});
|
|
890
1126
|
},
|
|
891
1127
|
"Response validation failed"
|
|
892
1128
|
);
|
|
893
|
-
|
|
1129
|
+
throw result;
|
|
894
1130
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
895
1131
|
const responseBody = await response.json();
|
|
896
1132
|
const result = schemas$.parse(
|
|
897
1133
|
responseBody,
|
|
898
1134
|
(val$) => {
|
|
899
|
-
return
|
|
1135
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1136
|
+
...responseFields$,
|
|
1137
|
+
...val$,
|
|
1138
|
+
});
|
|
900
1139
|
},
|
|
901
1140
|
"Response validation failed"
|
|
902
1141
|
);
|
|
903
|
-
|
|
1142
|
+
throw result;
|
|
904
1143
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
905
1144
|
const responseBody = await response.json();
|
|
906
1145
|
const result = schemas$.parse(
|
|
907
1146
|
responseBody,
|
|
908
1147
|
(val$) => {
|
|
909
|
-
return
|
|
1148
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1149
|
+
...responseFields$,
|
|
1150
|
+
...val$,
|
|
1151
|
+
});
|
|
910
1152
|
},
|
|
911
1153
|
"Response validation failed"
|
|
912
1154
|
);
|
|
913
|
-
|
|
1155
|
+
throw result;
|
|
914
1156
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
915
1157
|
const responseBody = await response.json();
|
|
916
1158
|
const result = schemas$.parse(
|
|
917
1159
|
responseBody,
|
|
918
1160
|
(val$) => {
|
|
919
|
-
return
|
|
1161
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1162
|
+
...responseFields$,
|
|
1163
|
+
...val$,
|
|
1164
|
+
});
|
|
920
1165
|
},
|
|
921
1166
|
"Response validation failed"
|
|
922
1167
|
);
|
|
923
|
-
|
|
1168
|
+
throw result;
|
|
924
1169
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
925
1170
|
const responseBody = await response.json();
|
|
926
1171
|
const result = schemas$.parse(
|
|
927
1172
|
responseBody,
|
|
928
1173
|
(val$) => {
|
|
929
|
-
return
|
|
1174
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1175
|
+
...responseFields$,
|
|
1176
|
+
...val$,
|
|
1177
|
+
});
|
|
930
1178
|
},
|
|
931
1179
|
"Response validation failed"
|
|
932
1180
|
);
|
|
933
|
-
|
|
1181
|
+
throw result;
|
|
934
1182
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
935
1183
|
const responseBody = await response.json();
|
|
936
1184
|
const result = schemas$.parse(
|
|
937
1185
|
responseBody,
|
|
938
1186
|
(val$) => {
|
|
939
|
-
return
|
|
1187
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1188
|
+
...responseFields$,
|
|
1189
|
+
...val$,
|
|
1190
|
+
});
|
|
940
1191
|
},
|
|
941
1192
|
"Response validation failed"
|
|
942
1193
|
);
|
|
943
|
-
|
|
1194
|
+
throw result;
|
|
944
1195
|
} else {
|
|
945
1196
|
const responseBody = await response.text();
|
|
946
1197
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -953,7 +1204,10 @@ export class Links extends ClientSDK {
|
|
|
953
1204
|
* @remarks
|
|
954
1205
|
* Delete a link for the authenticated workspace.
|
|
955
1206
|
*/
|
|
956
|
-
async delete(
|
|
1207
|
+
async delete(
|
|
1208
|
+
linkId: string,
|
|
1209
|
+
options?: RequestOptions
|
|
1210
|
+
): Promise<operations.DeleteLinkResponseBody> {
|
|
957
1211
|
const input$: operations.DeleteLinkRequest = {
|
|
958
1212
|
linkId: linkId,
|
|
959
1213
|
};
|
|
@@ -1004,7 +1258,22 @@ export class Links extends ClientSDK {
|
|
|
1004
1258
|
};
|
|
1005
1259
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1006
1260
|
|
|
1007
|
-
const doOptions = {
|
|
1261
|
+
const doOptions = {
|
|
1262
|
+
context,
|
|
1263
|
+
errorCodes: [
|
|
1264
|
+
"400",
|
|
1265
|
+
"401",
|
|
1266
|
+
"403",
|
|
1267
|
+
"404",
|
|
1268
|
+
"409",
|
|
1269
|
+
"410",
|
|
1270
|
+
"422",
|
|
1271
|
+
"429",
|
|
1272
|
+
"4XX",
|
|
1273
|
+
"500",
|
|
1274
|
+
"5XX",
|
|
1275
|
+
],
|
|
1276
|
+
};
|
|
1008
1277
|
const request = this.createRequest$(
|
|
1009
1278
|
{
|
|
1010
1279
|
security: securitySettings$,
|
|
@@ -1019,12 +1288,19 @@ export class Links extends ClientSDK {
|
|
|
1019
1288
|
|
|
1020
1289
|
const response = await this.do$(request, doOptions);
|
|
1021
1290
|
|
|
1291
|
+
const responseFields$ = {
|
|
1292
|
+
HttpMeta: {
|
|
1293
|
+
Response: response,
|
|
1294
|
+
Request: request,
|
|
1295
|
+
},
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1022
1298
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
1023
1299
|
const responseBody = await response.json();
|
|
1024
1300
|
const result = schemas$.parse(
|
|
1025
1301
|
responseBody,
|
|
1026
1302
|
(val$) => {
|
|
1027
|
-
return operations.
|
|
1303
|
+
return operations.DeleteLinkResponseBody$.inboundSchema.parse(val$);
|
|
1028
1304
|
},
|
|
1029
1305
|
"Response validation failed"
|
|
1030
1306
|
);
|
|
@@ -1034,91 +1310,118 @@ export class Links extends ClientSDK {
|
|
|
1034
1310
|
const result = schemas$.parse(
|
|
1035
1311
|
responseBody,
|
|
1036
1312
|
(val$) => {
|
|
1037
|
-
return
|
|
1313
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1314
|
+
...responseFields$,
|
|
1315
|
+
...val$,
|
|
1316
|
+
});
|
|
1038
1317
|
},
|
|
1039
1318
|
"Response validation failed"
|
|
1040
1319
|
);
|
|
1041
|
-
|
|
1320
|
+
throw result;
|
|
1042
1321
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1043
1322
|
const responseBody = await response.json();
|
|
1044
1323
|
const result = schemas$.parse(
|
|
1045
1324
|
responseBody,
|
|
1046
1325
|
(val$) => {
|
|
1047
|
-
return
|
|
1326
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1327
|
+
...responseFields$,
|
|
1328
|
+
...val$,
|
|
1329
|
+
});
|
|
1048
1330
|
},
|
|
1049
1331
|
"Response validation failed"
|
|
1050
1332
|
);
|
|
1051
|
-
|
|
1333
|
+
throw result;
|
|
1052
1334
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1053
1335
|
const responseBody = await response.json();
|
|
1054
1336
|
const result = schemas$.parse(
|
|
1055
1337
|
responseBody,
|
|
1056
1338
|
(val$) => {
|
|
1057
|
-
return
|
|
1339
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1340
|
+
...responseFields$,
|
|
1341
|
+
...val$,
|
|
1342
|
+
});
|
|
1058
1343
|
},
|
|
1059
1344
|
"Response validation failed"
|
|
1060
1345
|
);
|
|
1061
|
-
|
|
1346
|
+
throw result;
|
|
1062
1347
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1063
1348
|
const responseBody = await response.json();
|
|
1064
1349
|
const result = schemas$.parse(
|
|
1065
1350
|
responseBody,
|
|
1066
1351
|
(val$) => {
|
|
1067
|
-
return
|
|
1352
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1353
|
+
...responseFields$,
|
|
1354
|
+
...val$,
|
|
1355
|
+
});
|
|
1068
1356
|
},
|
|
1069
1357
|
"Response validation failed"
|
|
1070
1358
|
);
|
|
1071
|
-
|
|
1359
|
+
throw result;
|
|
1072
1360
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1073
1361
|
const responseBody = await response.json();
|
|
1074
1362
|
const result = schemas$.parse(
|
|
1075
1363
|
responseBody,
|
|
1076
1364
|
(val$) => {
|
|
1077
|
-
return
|
|
1365
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1366
|
+
...responseFields$,
|
|
1367
|
+
...val$,
|
|
1368
|
+
});
|
|
1078
1369
|
},
|
|
1079
1370
|
"Response validation failed"
|
|
1080
1371
|
);
|
|
1081
|
-
|
|
1372
|
+
throw result;
|
|
1082
1373
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1083
1374
|
const responseBody = await response.json();
|
|
1084
1375
|
const result = schemas$.parse(
|
|
1085
1376
|
responseBody,
|
|
1086
1377
|
(val$) => {
|
|
1087
|
-
return
|
|
1378
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1379
|
+
...responseFields$,
|
|
1380
|
+
...val$,
|
|
1381
|
+
});
|
|
1088
1382
|
},
|
|
1089
1383
|
"Response validation failed"
|
|
1090
1384
|
);
|
|
1091
|
-
|
|
1385
|
+
throw result;
|
|
1092
1386
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1093
1387
|
const responseBody = await response.json();
|
|
1094
1388
|
const result = schemas$.parse(
|
|
1095
1389
|
responseBody,
|
|
1096
1390
|
(val$) => {
|
|
1097
|
-
return
|
|
1391
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1392
|
+
...responseFields$,
|
|
1393
|
+
...val$,
|
|
1394
|
+
});
|
|
1098
1395
|
},
|
|
1099
1396
|
"Response validation failed"
|
|
1100
1397
|
);
|
|
1101
|
-
|
|
1398
|
+
throw result;
|
|
1102
1399
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1103
1400
|
const responseBody = await response.json();
|
|
1104
1401
|
const result = schemas$.parse(
|
|
1105
1402
|
responseBody,
|
|
1106
1403
|
(val$) => {
|
|
1107
|
-
return
|
|
1404
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1405
|
+
...responseFields$,
|
|
1406
|
+
...val$,
|
|
1407
|
+
});
|
|
1108
1408
|
},
|
|
1109
1409
|
"Response validation failed"
|
|
1110
1410
|
);
|
|
1111
|
-
|
|
1411
|
+
throw result;
|
|
1112
1412
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1113
1413
|
const responseBody = await response.json();
|
|
1114
1414
|
const result = schemas$.parse(
|
|
1115
1415
|
responseBody,
|
|
1116
1416
|
(val$) => {
|
|
1117
|
-
return
|
|
1417
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1418
|
+
...responseFields$,
|
|
1419
|
+
...val$,
|
|
1420
|
+
});
|
|
1118
1421
|
},
|
|
1119
1422
|
"Response validation failed"
|
|
1120
1423
|
);
|
|
1121
|
-
|
|
1424
|
+
throw result;
|
|
1122
1425
|
} else {
|
|
1123
1426
|
const responseBody = await response.text();
|
|
1124
1427
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -1134,7 +1437,7 @@ export class Links extends ClientSDK {
|
|
|
1134
1437
|
async createMany(
|
|
1135
1438
|
input: Array<operations.RequestBody> | undefined,
|
|
1136
1439
|
options?: RequestOptions
|
|
1137
|
-
): Promise<
|
|
1440
|
+
): Promise<Array<components.LinkSchema>> {
|
|
1138
1441
|
const headers$ = new Headers();
|
|
1139
1442
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
1140
1443
|
headers$.set("Content-Type", "application/json");
|
|
@@ -1178,7 +1481,22 @@ export class Links extends ClientSDK {
|
|
|
1178
1481
|
};
|
|
1179
1482
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1180
1483
|
|
|
1181
|
-
const doOptions = {
|
|
1484
|
+
const doOptions = {
|
|
1485
|
+
context,
|
|
1486
|
+
errorCodes: [
|
|
1487
|
+
"400",
|
|
1488
|
+
"401",
|
|
1489
|
+
"403",
|
|
1490
|
+
"404",
|
|
1491
|
+
"409",
|
|
1492
|
+
"410",
|
|
1493
|
+
"422",
|
|
1494
|
+
"429",
|
|
1495
|
+
"4XX",
|
|
1496
|
+
"500",
|
|
1497
|
+
"5XX",
|
|
1498
|
+
],
|
|
1499
|
+
};
|
|
1182
1500
|
const request = this.createRequest$(
|
|
1183
1501
|
{
|
|
1184
1502
|
security: securitySettings$,
|
|
@@ -1193,12 +1511,19 @@ export class Links extends ClientSDK {
|
|
|
1193
1511
|
|
|
1194
1512
|
const response = await this.do$(request, doOptions);
|
|
1195
1513
|
|
|
1514
|
+
const responseFields$ = {
|
|
1515
|
+
HttpMeta: {
|
|
1516
|
+
Response: response,
|
|
1517
|
+
Request: request,
|
|
1518
|
+
},
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1196
1521
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
1197
1522
|
const responseBody = await response.json();
|
|
1198
1523
|
const result = schemas$.parse(
|
|
1199
1524
|
responseBody,
|
|
1200
1525
|
(val$) => {
|
|
1201
|
-
return
|
|
1526
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
1202
1527
|
},
|
|
1203
1528
|
"Response validation failed"
|
|
1204
1529
|
);
|
|
@@ -1208,91 +1533,118 @@ export class Links extends ClientSDK {
|
|
|
1208
1533
|
const result = schemas$.parse(
|
|
1209
1534
|
responseBody,
|
|
1210
1535
|
(val$) => {
|
|
1211
|
-
return
|
|
1536
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1537
|
+
...responseFields$,
|
|
1538
|
+
...val$,
|
|
1539
|
+
});
|
|
1212
1540
|
},
|
|
1213
1541
|
"Response validation failed"
|
|
1214
1542
|
);
|
|
1215
|
-
|
|
1543
|
+
throw result;
|
|
1216
1544
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1217
1545
|
const responseBody = await response.json();
|
|
1218
1546
|
const result = schemas$.parse(
|
|
1219
1547
|
responseBody,
|
|
1220
1548
|
(val$) => {
|
|
1221
|
-
return
|
|
1549
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1550
|
+
...responseFields$,
|
|
1551
|
+
...val$,
|
|
1552
|
+
});
|
|
1222
1553
|
},
|
|
1223
1554
|
"Response validation failed"
|
|
1224
1555
|
);
|
|
1225
|
-
|
|
1556
|
+
throw result;
|
|
1226
1557
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1227
1558
|
const responseBody = await response.json();
|
|
1228
1559
|
const result = schemas$.parse(
|
|
1229
1560
|
responseBody,
|
|
1230
1561
|
(val$) => {
|
|
1231
|
-
return
|
|
1562
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1563
|
+
...responseFields$,
|
|
1564
|
+
...val$,
|
|
1565
|
+
});
|
|
1232
1566
|
},
|
|
1233
1567
|
"Response validation failed"
|
|
1234
1568
|
);
|
|
1235
|
-
|
|
1569
|
+
throw result;
|
|
1236
1570
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1237
1571
|
const responseBody = await response.json();
|
|
1238
1572
|
const result = schemas$.parse(
|
|
1239
1573
|
responseBody,
|
|
1240
1574
|
(val$) => {
|
|
1241
|
-
return
|
|
1575
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1576
|
+
...responseFields$,
|
|
1577
|
+
...val$,
|
|
1578
|
+
});
|
|
1242
1579
|
},
|
|
1243
1580
|
"Response validation failed"
|
|
1244
1581
|
);
|
|
1245
|
-
|
|
1582
|
+
throw result;
|
|
1246
1583
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1247
1584
|
const responseBody = await response.json();
|
|
1248
1585
|
const result = schemas$.parse(
|
|
1249
1586
|
responseBody,
|
|
1250
1587
|
(val$) => {
|
|
1251
|
-
return
|
|
1588
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1589
|
+
...responseFields$,
|
|
1590
|
+
...val$,
|
|
1591
|
+
});
|
|
1252
1592
|
},
|
|
1253
1593
|
"Response validation failed"
|
|
1254
1594
|
);
|
|
1255
|
-
|
|
1595
|
+
throw result;
|
|
1256
1596
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1257
1597
|
const responseBody = await response.json();
|
|
1258
1598
|
const result = schemas$.parse(
|
|
1259
1599
|
responseBody,
|
|
1260
1600
|
(val$) => {
|
|
1261
|
-
return
|
|
1601
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1602
|
+
...responseFields$,
|
|
1603
|
+
...val$,
|
|
1604
|
+
});
|
|
1262
1605
|
},
|
|
1263
1606
|
"Response validation failed"
|
|
1264
1607
|
);
|
|
1265
|
-
|
|
1608
|
+
throw result;
|
|
1266
1609
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1267
1610
|
const responseBody = await response.json();
|
|
1268
1611
|
const result = schemas$.parse(
|
|
1269
1612
|
responseBody,
|
|
1270
1613
|
(val$) => {
|
|
1271
|
-
return
|
|
1614
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1615
|
+
...responseFields$,
|
|
1616
|
+
...val$,
|
|
1617
|
+
});
|
|
1272
1618
|
},
|
|
1273
1619
|
"Response validation failed"
|
|
1274
1620
|
);
|
|
1275
|
-
|
|
1621
|
+
throw result;
|
|
1276
1622
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1277
1623
|
const responseBody = await response.json();
|
|
1278
1624
|
const result = schemas$.parse(
|
|
1279
1625
|
responseBody,
|
|
1280
1626
|
(val$) => {
|
|
1281
|
-
return
|
|
1627
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1628
|
+
...responseFields$,
|
|
1629
|
+
...val$,
|
|
1630
|
+
});
|
|
1282
1631
|
},
|
|
1283
1632
|
"Response validation failed"
|
|
1284
1633
|
);
|
|
1285
|
-
|
|
1634
|
+
throw result;
|
|
1286
1635
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1287
1636
|
const responseBody = await response.json();
|
|
1288
1637
|
const result = schemas$.parse(
|
|
1289
1638
|
responseBody,
|
|
1290
1639
|
(val$) => {
|
|
1291
|
-
return
|
|
1640
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1641
|
+
...responseFields$,
|
|
1642
|
+
...val$,
|
|
1643
|
+
});
|
|
1292
1644
|
},
|
|
1293
1645
|
"Response validation failed"
|
|
1294
1646
|
);
|
|
1295
|
-
|
|
1647
|
+
throw result;
|
|
1296
1648
|
} else {
|
|
1297
1649
|
const responseBody = await response.text();
|
|
1298
1650
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|