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/domains.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 Domains extends ClientSDK {
|
|
15
17
|
private readonly options$: SDKOptions & { hooks?: SDKHooks };
|
|
@@ -47,7 +49,7 @@ export class Domains extends ClientSDK {
|
|
|
47
49
|
async list(
|
|
48
50
|
_input: operations.ListDomainsRequest,
|
|
49
51
|
options?: RequestOptions
|
|
50
|
-
): Promise<
|
|
52
|
+
): Promise<Array<components.DomainSchema>> {
|
|
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 Domains 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 Domains 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.DomainSchema$.inboundSchema).parse(val$);
|
|
105
129
|
},
|
|
106
130
|
"Response validation failed"
|
|
107
131
|
);
|
|
@@ -111,91 +135,118 @@ export class Domains 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 Domains extends ClientSDK {
|
|
|
211
262
|
async add(
|
|
212
263
|
input: operations.AddDomainRequestBody | undefined,
|
|
213
264
|
options?: RequestOptions
|
|
214
|
-
): Promise<
|
|
265
|
+
): Promise<components.DomainSchema> {
|
|
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 Domains 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 Domains 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.DomainSchema$.inboundSchema.parse(val$);
|
|
279
352
|
},
|
|
280
353
|
"Response validation failed"
|
|
281
354
|
);
|
|
@@ -285,91 +358,118 @@ export class Domains 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);
|
|
@@ -385,7 +485,7 @@ export class Domains extends ClientSDK {
|
|
|
385
485
|
async delete(
|
|
386
486
|
input: operations.DeleteDomainRequest,
|
|
387
487
|
options?: RequestOptions
|
|
388
|
-
): Promise<operations.
|
|
488
|
+
): Promise<operations.DeleteDomainResponseBody> {
|
|
389
489
|
const headers$ = new Headers();
|
|
390
490
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
391
491
|
headers$.set("Accept", "application/json");
|
|
@@ -433,7 +533,22 @@ export class Domains extends ClientSDK {
|
|
|
433
533
|
};
|
|
434
534
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
435
535
|
|
|
436
|
-
const doOptions = {
|
|
536
|
+
const doOptions = {
|
|
537
|
+
context,
|
|
538
|
+
errorCodes: [
|
|
539
|
+
"400",
|
|
540
|
+
"401",
|
|
541
|
+
"403",
|
|
542
|
+
"404",
|
|
543
|
+
"409",
|
|
544
|
+
"410",
|
|
545
|
+
"422",
|
|
546
|
+
"429",
|
|
547
|
+
"4XX",
|
|
548
|
+
"500",
|
|
549
|
+
"5XX",
|
|
550
|
+
],
|
|
551
|
+
};
|
|
437
552
|
const request = this.createRequest$(
|
|
438
553
|
{
|
|
439
554
|
security: securitySettings$,
|
|
@@ -448,12 +563,19 @@ export class Domains extends ClientSDK {
|
|
|
448
563
|
|
|
449
564
|
const response = await this.do$(request, doOptions);
|
|
450
565
|
|
|
566
|
+
const responseFields$ = {
|
|
567
|
+
HttpMeta: {
|
|
568
|
+
Response: response,
|
|
569
|
+
Request: request,
|
|
570
|
+
},
|
|
571
|
+
};
|
|
572
|
+
|
|
451
573
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
452
574
|
const responseBody = await response.json();
|
|
453
575
|
const result = schemas$.parse(
|
|
454
576
|
responseBody,
|
|
455
577
|
(val$) => {
|
|
456
|
-
return operations.
|
|
578
|
+
return operations.DeleteDomainResponseBody$.inboundSchema.parse(val$);
|
|
457
579
|
},
|
|
458
580
|
"Response validation failed"
|
|
459
581
|
);
|
|
@@ -463,91 +585,118 @@ export class Domains extends ClientSDK {
|
|
|
463
585
|
const result = schemas$.parse(
|
|
464
586
|
responseBody,
|
|
465
587
|
(val$) => {
|
|
466
|
-
return
|
|
588
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
589
|
+
...responseFields$,
|
|
590
|
+
...val$,
|
|
591
|
+
});
|
|
467
592
|
},
|
|
468
593
|
"Response validation failed"
|
|
469
594
|
);
|
|
470
|
-
|
|
595
|
+
throw result;
|
|
471
596
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
472
597
|
const responseBody = await response.json();
|
|
473
598
|
const result = schemas$.parse(
|
|
474
599
|
responseBody,
|
|
475
600
|
(val$) => {
|
|
476
|
-
return
|
|
601
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
602
|
+
...responseFields$,
|
|
603
|
+
...val$,
|
|
604
|
+
});
|
|
477
605
|
},
|
|
478
606
|
"Response validation failed"
|
|
479
607
|
);
|
|
480
|
-
|
|
608
|
+
throw result;
|
|
481
609
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
482
610
|
const responseBody = await response.json();
|
|
483
611
|
const result = schemas$.parse(
|
|
484
612
|
responseBody,
|
|
485
613
|
(val$) => {
|
|
486
|
-
return
|
|
614
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
615
|
+
...responseFields$,
|
|
616
|
+
...val$,
|
|
617
|
+
});
|
|
487
618
|
},
|
|
488
619
|
"Response validation failed"
|
|
489
620
|
);
|
|
490
|
-
|
|
621
|
+
throw result;
|
|
491
622
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
492
623
|
const responseBody = await response.json();
|
|
493
624
|
const result = schemas$.parse(
|
|
494
625
|
responseBody,
|
|
495
626
|
(val$) => {
|
|
496
|
-
return
|
|
627
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
628
|
+
...responseFields$,
|
|
629
|
+
...val$,
|
|
630
|
+
});
|
|
497
631
|
},
|
|
498
632
|
"Response validation failed"
|
|
499
633
|
);
|
|
500
|
-
|
|
634
|
+
throw result;
|
|
501
635
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
502
636
|
const responseBody = await response.json();
|
|
503
637
|
const result = schemas$.parse(
|
|
504
638
|
responseBody,
|
|
505
639
|
(val$) => {
|
|
506
|
-
return
|
|
640
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
641
|
+
...responseFields$,
|
|
642
|
+
...val$,
|
|
643
|
+
});
|
|
507
644
|
},
|
|
508
645
|
"Response validation failed"
|
|
509
646
|
);
|
|
510
|
-
|
|
647
|
+
throw result;
|
|
511
648
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
512
649
|
const responseBody = await response.json();
|
|
513
650
|
const result = schemas$.parse(
|
|
514
651
|
responseBody,
|
|
515
652
|
(val$) => {
|
|
516
|
-
return
|
|
653
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
654
|
+
...responseFields$,
|
|
655
|
+
...val$,
|
|
656
|
+
});
|
|
517
657
|
},
|
|
518
658
|
"Response validation failed"
|
|
519
659
|
);
|
|
520
|
-
|
|
660
|
+
throw result;
|
|
521
661
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
522
662
|
const responseBody = await response.json();
|
|
523
663
|
const result = schemas$.parse(
|
|
524
664
|
responseBody,
|
|
525
665
|
(val$) => {
|
|
526
|
-
return
|
|
666
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
667
|
+
...responseFields$,
|
|
668
|
+
...val$,
|
|
669
|
+
});
|
|
527
670
|
},
|
|
528
671
|
"Response validation failed"
|
|
529
672
|
);
|
|
530
|
-
|
|
673
|
+
throw result;
|
|
531
674
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
532
675
|
const responseBody = await response.json();
|
|
533
676
|
const result = schemas$.parse(
|
|
534
677
|
responseBody,
|
|
535
678
|
(val$) => {
|
|
536
|
-
return
|
|
679
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
680
|
+
...responseFields$,
|
|
681
|
+
...val$,
|
|
682
|
+
});
|
|
537
683
|
},
|
|
538
684
|
"Response validation failed"
|
|
539
685
|
);
|
|
540
|
-
|
|
686
|
+
throw result;
|
|
541
687
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
542
688
|
const responseBody = await response.json();
|
|
543
689
|
const result = schemas$.parse(
|
|
544
690
|
responseBody,
|
|
545
691
|
(val$) => {
|
|
546
|
-
return
|
|
692
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
693
|
+
...responseFields$,
|
|
694
|
+
...val$,
|
|
695
|
+
});
|
|
547
696
|
},
|
|
548
697
|
"Response validation failed"
|
|
549
698
|
);
|
|
550
|
-
|
|
699
|
+
throw result;
|
|
551
700
|
} else {
|
|
552
701
|
const responseBody = await response.text();
|
|
553
702
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -561,16 +710,21 @@ export class Domains extends ClientSDK {
|
|
|
561
710
|
* Edit a domain for the authenticated workspace.
|
|
562
711
|
*/
|
|
563
712
|
async update(
|
|
564
|
-
|
|
713
|
+
slug: string,
|
|
714
|
+
requestBody?: operations.EditDomainRequestBody | undefined,
|
|
565
715
|
options?: RequestOptions
|
|
566
|
-
): Promise<
|
|
716
|
+
): Promise<components.DomainSchema> {
|
|
717
|
+
const input$: operations.EditDomainRequest = {
|
|
718
|
+
slug: slug,
|
|
719
|
+
requestBody: requestBody,
|
|
720
|
+
};
|
|
567
721
|
const headers$ = new Headers();
|
|
568
722
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
569
723
|
headers$.set("Content-Type", "application/json");
|
|
570
724
|
headers$.set("Accept", "application/json");
|
|
571
725
|
|
|
572
726
|
const payload$ = schemas$.parse(
|
|
573
|
-
input
|
|
727
|
+
input$,
|
|
574
728
|
(value$) => operations.EditDomainRequest$.outboundSchema.parse(value$),
|
|
575
729
|
"Input validation failed"
|
|
576
730
|
);
|
|
@@ -612,7 +766,22 @@ export class Domains extends ClientSDK {
|
|
|
612
766
|
};
|
|
613
767
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
614
768
|
|
|
615
|
-
const doOptions = {
|
|
769
|
+
const doOptions = {
|
|
770
|
+
context,
|
|
771
|
+
errorCodes: [
|
|
772
|
+
"400",
|
|
773
|
+
"401",
|
|
774
|
+
"403",
|
|
775
|
+
"404",
|
|
776
|
+
"409",
|
|
777
|
+
"410",
|
|
778
|
+
"422",
|
|
779
|
+
"429",
|
|
780
|
+
"4XX",
|
|
781
|
+
"500",
|
|
782
|
+
"5XX",
|
|
783
|
+
],
|
|
784
|
+
};
|
|
616
785
|
const request = this.createRequest$(
|
|
617
786
|
{
|
|
618
787
|
security: securitySettings$,
|
|
@@ -627,12 +796,19 @@ export class Domains extends ClientSDK {
|
|
|
627
796
|
|
|
628
797
|
const response = await this.do$(request, doOptions);
|
|
629
798
|
|
|
799
|
+
const responseFields$ = {
|
|
800
|
+
HttpMeta: {
|
|
801
|
+
Response: response,
|
|
802
|
+
Request: request,
|
|
803
|
+
},
|
|
804
|
+
};
|
|
805
|
+
|
|
630
806
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
631
807
|
const responseBody = await response.json();
|
|
632
808
|
const result = schemas$.parse(
|
|
633
809
|
responseBody,
|
|
634
810
|
(val$) => {
|
|
635
|
-
return
|
|
811
|
+
return components.DomainSchema$.inboundSchema.parse(val$);
|
|
636
812
|
},
|
|
637
813
|
"Response validation failed"
|
|
638
814
|
);
|
|
@@ -642,91 +818,118 @@ export class Domains extends ClientSDK {
|
|
|
642
818
|
const result = schemas$.parse(
|
|
643
819
|
responseBody,
|
|
644
820
|
(val$) => {
|
|
645
|
-
return
|
|
821
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
822
|
+
...responseFields$,
|
|
823
|
+
...val$,
|
|
824
|
+
});
|
|
646
825
|
},
|
|
647
826
|
"Response validation failed"
|
|
648
827
|
);
|
|
649
|
-
|
|
828
|
+
throw result;
|
|
650
829
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
651
830
|
const responseBody = await response.json();
|
|
652
831
|
const result = schemas$.parse(
|
|
653
832
|
responseBody,
|
|
654
833
|
(val$) => {
|
|
655
|
-
return
|
|
834
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
835
|
+
...responseFields$,
|
|
836
|
+
...val$,
|
|
837
|
+
});
|
|
656
838
|
},
|
|
657
839
|
"Response validation failed"
|
|
658
840
|
);
|
|
659
|
-
|
|
841
|
+
throw result;
|
|
660
842
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
661
843
|
const responseBody = await response.json();
|
|
662
844
|
const result = schemas$.parse(
|
|
663
845
|
responseBody,
|
|
664
846
|
(val$) => {
|
|
665
|
-
return
|
|
847
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
848
|
+
...responseFields$,
|
|
849
|
+
...val$,
|
|
850
|
+
});
|
|
666
851
|
},
|
|
667
852
|
"Response validation failed"
|
|
668
853
|
);
|
|
669
|
-
|
|
854
|
+
throw result;
|
|
670
855
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
671
856
|
const responseBody = await response.json();
|
|
672
857
|
const result = schemas$.parse(
|
|
673
858
|
responseBody,
|
|
674
859
|
(val$) => {
|
|
675
|
-
return
|
|
860
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
861
|
+
...responseFields$,
|
|
862
|
+
...val$,
|
|
863
|
+
});
|
|
676
864
|
},
|
|
677
865
|
"Response validation failed"
|
|
678
866
|
);
|
|
679
|
-
|
|
867
|
+
throw result;
|
|
680
868
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
681
869
|
const responseBody = await response.json();
|
|
682
870
|
const result = schemas$.parse(
|
|
683
871
|
responseBody,
|
|
684
872
|
(val$) => {
|
|
685
|
-
return
|
|
873
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
874
|
+
...responseFields$,
|
|
875
|
+
...val$,
|
|
876
|
+
});
|
|
686
877
|
},
|
|
687
878
|
"Response validation failed"
|
|
688
879
|
);
|
|
689
|
-
|
|
880
|
+
throw result;
|
|
690
881
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
691
882
|
const responseBody = await response.json();
|
|
692
883
|
const result = schemas$.parse(
|
|
693
884
|
responseBody,
|
|
694
885
|
(val$) => {
|
|
695
|
-
return
|
|
886
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
887
|
+
...responseFields$,
|
|
888
|
+
...val$,
|
|
889
|
+
});
|
|
696
890
|
},
|
|
697
891
|
"Response validation failed"
|
|
698
892
|
);
|
|
699
|
-
|
|
893
|
+
throw result;
|
|
700
894
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
701
895
|
const responseBody = await response.json();
|
|
702
896
|
const result = schemas$.parse(
|
|
703
897
|
responseBody,
|
|
704
898
|
(val$) => {
|
|
705
|
-
return
|
|
899
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
900
|
+
...responseFields$,
|
|
901
|
+
...val$,
|
|
902
|
+
});
|
|
706
903
|
},
|
|
707
904
|
"Response validation failed"
|
|
708
905
|
);
|
|
709
|
-
|
|
906
|
+
throw result;
|
|
710
907
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
711
908
|
const responseBody = await response.json();
|
|
712
909
|
const result = schemas$.parse(
|
|
713
910
|
responseBody,
|
|
714
911
|
(val$) => {
|
|
715
|
-
return
|
|
912
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
913
|
+
...responseFields$,
|
|
914
|
+
...val$,
|
|
915
|
+
});
|
|
716
916
|
},
|
|
717
917
|
"Response validation failed"
|
|
718
918
|
);
|
|
719
|
-
|
|
919
|
+
throw result;
|
|
720
920
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
721
921
|
const responseBody = await response.json();
|
|
722
922
|
const result = schemas$.parse(
|
|
723
923
|
responseBody,
|
|
724
924
|
(val$) => {
|
|
725
|
-
return
|
|
925
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
926
|
+
...responseFields$,
|
|
927
|
+
...val$,
|
|
928
|
+
});
|
|
726
929
|
},
|
|
727
930
|
"Response validation failed"
|
|
728
931
|
);
|
|
729
|
-
|
|
932
|
+
throw result;
|
|
730
933
|
} else {
|
|
731
934
|
const responseBody = await response.text();
|
|
732
935
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -742,7 +945,7 @@ export class Domains extends ClientSDK {
|
|
|
742
945
|
async setPrimary(
|
|
743
946
|
input: operations.SetPrimaryDomainRequest,
|
|
744
947
|
options?: RequestOptions
|
|
745
|
-
): Promise<
|
|
948
|
+
): Promise<components.DomainSchema> {
|
|
746
949
|
const headers$ = new Headers();
|
|
747
950
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
748
951
|
headers$.set("Accept", "application/json");
|
|
@@ -790,7 +993,22 @@ export class Domains extends ClientSDK {
|
|
|
790
993
|
};
|
|
791
994
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
792
995
|
|
|
793
|
-
const doOptions = {
|
|
996
|
+
const doOptions = {
|
|
997
|
+
context,
|
|
998
|
+
errorCodes: [
|
|
999
|
+
"400",
|
|
1000
|
+
"401",
|
|
1001
|
+
"403",
|
|
1002
|
+
"404",
|
|
1003
|
+
"409",
|
|
1004
|
+
"410",
|
|
1005
|
+
"422",
|
|
1006
|
+
"429",
|
|
1007
|
+
"4XX",
|
|
1008
|
+
"500",
|
|
1009
|
+
"5XX",
|
|
1010
|
+
],
|
|
1011
|
+
};
|
|
794
1012
|
const request = this.createRequest$(
|
|
795
1013
|
{
|
|
796
1014
|
security: securitySettings$,
|
|
@@ -805,12 +1023,19 @@ export class Domains extends ClientSDK {
|
|
|
805
1023
|
|
|
806
1024
|
const response = await this.do$(request, doOptions);
|
|
807
1025
|
|
|
1026
|
+
const responseFields$ = {
|
|
1027
|
+
HttpMeta: {
|
|
1028
|
+
Response: response,
|
|
1029
|
+
Request: request,
|
|
1030
|
+
},
|
|
1031
|
+
};
|
|
1032
|
+
|
|
808
1033
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
809
1034
|
const responseBody = await response.json();
|
|
810
1035
|
const result = schemas$.parse(
|
|
811
1036
|
responseBody,
|
|
812
1037
|
(val$) => {
|
|
813
|
-
return
|
|
1038
|
+
return components.DomainSchema$.inboundSchema.parse(val$);
|
|
814
1039
|
},
|
|
815
1040
|
"Response validation failed"
|
|
816
1041
|
);
|
|
@@ -820,91 +1045,118 @@ export class Domains extends ClientSDK {
|
|
|
820
1045
|
const result = schemas$.parse(
|
|
821
1046
|
responseBody,
|
|
822
1047
|
(val$) => {
|
|
823
|
-
return
|
|
1048
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1049
|
+
...responseFields$,
|
|
1050
|
+
...val$,
|
|
1051
|
+
});
|
|
824
1052
|
},
|
|
825
1053
|
"Response validation failed"
|
|
826
1054
|
);
|
|
827
|
-
|
|
1055
|
+
throw result;
|
|
828
1056
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
829
1057
|
const responseBody = await response.json();
|
|
830
1058
|
const result = schemas$.parse(
|
|
831
1059
|
responseBody,
|
|
832
1060
|
(val$) => {
|
|
833
|
-
return
|
|
1061
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1062
|
+
...responseFields$,
|
|
1063
|
+
...val$,
|
|
1064
|
+
});
|
|
834
1065
|
},
|
|
835
1066
|
"Response validation failed"
|
|
836
1067
|
);
|
|
837
|
-
|
|
1068
|
+
throw result;
|
|
838
1069
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
839
1070
|
const responseBody = await response.json();
|
|
840
1071
|
const result = schemas$.parse(
|
|
841
1072
|
responseBody,
|
|
842
1073
|
(val$) => {
|
|
843
|
-
return
|
|
1074
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1075
|
+
...responseFields$,
|
|
1076
|
+
...val$,
|
|
1077
|
+
});
|
|
844
1078
|
},
|
|
845
1079
|
"Response validation failed"
|
|
846
1080
|
);
|
|
847
|
-
|
|
1081
|
+
throw result;
|
|
848
1082
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
849
1083
|
const responseBody = await response.json();
|
|
850
1084
|
const result = schemas$.parse(
|
|
851
1085
|
responseBody,
|
|
852
1086
|
(val$) => {
|
|
853
|
-
return
|
|
1087
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1088
|
+
...responseFields$,
|
|
1089
|
+
...val$,
|
|
1090
|
+
});
|
|
854
1091
|
},
|
|
855
1092
|
"Response validation failed"
|
|
856
1093
|
);
|
|
857
|
-
|
|
1094
|
+
throw result;
|
|
858
1095
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
859
1096
|
const responseBody = await response.json();
|
|
860
1097
|
const result = schemas$.parse(
|
|
861
1098
|
responseBody,
|
|
862
1099
|
(val$) => {
|
|
863
|
-
return
|
|
1100
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1101
|
+
...responseFields$,
|
|
1102
|
+
...val$,
|
|
1103
|
+
});
|
|
864
1104
|
},
|
|
865
1105
|
"Response validation failed"
|
|
866
1106
|
);
|
|
867
|
-
|
|
1107
|
+
throw result;
|
|
868
1108
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
869
1109
|
const responseBody = await response.json();
|
|
870
1110
|
const result = schemas$.parse(
|
|
871
1111
|
responseBody,
|
|
872
1112
|
(val$) => {
|
|
873
|
-
return
|
|
1113
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1114
|
+
...responseFields$,
|
|
1115
|
+
...val$,
|
|
1116
|
+
});
|
|
874
1117
|
},
|
|
875
1118
|
"Response validation failed"
|
|
876
1119
|
);
|
|
877
|
-
|
|
1120
|
+
throw result;
|
|
878
1121
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
879
1122
|
const responseBody = await response.json();
|
|
880
1123
|
const result = schemas$.parse(
|
|
881
1124
|
responseBody,
|
|
882
1125
|
(val$) => {
|
|
883
|
-
return
|
|
1126
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1127
|
+
...responseFields$,
|
|
1128
|
+
...val$,
|
|
1129
|
+
});
|
|
884
1130
|
},
|
|
885
1131
|
"Response validation failed"
|
|
886
1132
|
);
|
|
887
|
-
|
|
1133
|
+
throw result;
|
|
888
1134
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
889
1135
|
const responseBody = await response.json();
|
|
890
1136
|
const result = schemas$.parse(
|
|
891
1137
|
responseBody,
|
|
892
1138
|
(val$) => {
|
|
893
|
-
return
|
|
1139
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1140
|
+
...responseFields$,
|
|
1141
|
+
...val$,
|
|
1142
|
+
});
|
|
894
1143
|
},
|
|
895
1144
|
"Response validation failed"
|
|
896
1145
|
);
|
|
897
|
-
|
|
1146
|
+
throw result;
|
|
898
1147
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
899
1148
|
const responseBody = await response.json();
|
|
900
1149
|
const result = schemas$.parse(
|
|
901
1150
|
responseBody,
|
|
902
1151
|
(val$) => {
|
|
903
|
-
return
|
|
1152
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1153
|
+
...responseFields$,
|
|
1154
|
+
...val$,
|
|
1155
|
+
});
|
|
904
1156
|
},
|
|
905
1157
|
"Response validation failed"
|
|
906
1158
|
);
|
|
907
|
-
|
|
1159
|
+
throw result;
|
|
908
1160
|
} else {
|
|
909
1161
|
const responseBody = await response.text();
|
|
910
1162
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
@@ -918,16 +1170,21 @@ export class Domains extends ClientSDK {
|
|
|
918
1170
|
* Transfer a domain to another workspace within the authenticated account.
|
|
919
1171
|
*/
|
|
920
1172
|
async transfer(
|
|
921
|
-
|
|
1173
|
+
slug: string,
|
|
1174
|
+
requestBody?: operations.TransferDomainRequestBody | undefined,
|
|
922
1175
|
options?: RequestOptions
|
|
923
|
-
): Promise<
|
|
1176
|
+
): Promise<components.DomainSchema> {
|
|
1177
|
+
const input$: operations.TransferDomainRequest = {
|
|
1178
|
+
slug: slug,
|
|
1179
|
+
requestBody: requestBody,
|
|
1180
|
+
};
|
|
924
1181
|
const headers$ = new Headers();
|
|
925
1182
|
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
926
1183
|
headers$.set("Content-Type", "application/json");
|
|
927
1184
|
headers$.set("Accept", "application/json");
|
|
928
1185
|
|
|
929
1186
|
const payload$ = schemas$.parse(
|
|
930
|
-
input
|
|
1187
|
+
input$,
|
|
931
1188
|
(value$) => operations.TransferDomainRequest$.outboundSchema.parse(value$),
|
|
932
1189
|
"Input validation failed"
|
|
933
1190
|
);
|
|
@@ -969,7 +1226,22 @@ export class Domains extends ClientSDK {
|
|
|
969
1226
|
};
|
|
970
1227
|
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
971
1228
|
|
|
972
|
-
const doOptions = {
|
|
1229
|
+
const doOptions = {
|
|
1230
|
+
context,
|
|
1231
|
+
errorCodes: [
|
|
1232
|
+
"400",
|
|
1233
|
+
"401",
|
|
1234
|
+
"403",
|
|
1235
|
+
"404",
|
|
1236
|
+
"409",
|
|
1237
|
+
"410",
|
|
1238
|
+
"422",
|
|
1239
|
+
"429",
|
|
1240
|
+
"4XX",
|
|
1241
|
+
"500",
|
|
1242
|
+
"5XX",
|
|
1243
|
+
],
|
|
1244
|
+
};
|
|
973
1245
|
const request = this.createRequest$(
|
|
974
1246
|
{
|
|
975
1247
|
security: securitySettings$,
|
|
@@ -984,12 +1256,19 @@ export class Domains extends ClientSDK {
|
|
|
984
1256
|
|
|
985
1257
|
const response = await this.do$(request, doOptions);
|
|
986
1258
|
|
|
1259
|
+
const responseFields$ = {
|
|
1260
|
+
HttpMeta: {
|
|
1261
|
+
Response: response,
|
|
1262
|
+
Request: request,
|
|
1263
|
+
},
|
|
1264
|
+
};
|
|
1265
|
+
|
|
987
1266
|
if (this.matchResponse(response, 200, "application/json")) {
|
|
988
1267
|
const responseBody = await response.json();
|
|
989
1268
|
const result = schemas$.parse(
|
|
990
1269
|
responseBody,
|
|
991
1270
|
(val$) => {
|
|
992
|
-
return
|
|
1271
|
+
return components.DomainSchema$.inboundSchema.parse(val$);
|
|
993
1272
|
},
|
|
994
1273
|
"Response validation failed"
|
|
995
1274
|
);
|
|
@@ -999,91 +1278,118 @@ export class Domains extends ClientSDK {
|
|
|
999
1278
|
const result = schemas$.parse(
|
|
1000
1279
|
responseBody,
|
|
1001
1280
|
(val$) => {
|
|
1002
|
-
return
|
|
1281
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1282
|
+
...responseFields$,
|
|
1283
|
+
...val$,
|
|
1284
|
+
});
|
|
1003
1285
|
},
|
|
1004
1286
|
"Response validation failed"
|
|
1005
1287
|
);
|
|
1006
|
-
|
|
1288
|
+
throw result;
|
|
1007
1289
|
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1008
1290
|
const responseBody = await response.json();
|
|
1009
1291
|
const result = schemas$.parse(
|
|
1010
1292
|
responseBody,
|
|
1011
1293
|
(val$) => {
|
|
1012
|
-
return
|
|
1294
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1295
|
+
...responseFields$,
|
|
1296
|
+
...val$,
|
|
1297
|
+
});
|
|
1013
1298
|
},
|
|
1014
1299
|
"Response validation failed"
|
|
1015
1300
|
);
|
|
1016
|
-
|
|
1301
|
+
throw result;
|
|
1017
1302
|
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1018
1303
|
const responseBody = await response.json();
|
|
1019
1304
|
const result = schemas$.parse(
|
|
1020
1305
|
responseBody,
|
|
1021
1306
|
(val$) => {
|
|
1022
|
-
return
|
|
1307
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1308
|
+
...responseFields$,
|
|
1309
|
+
...val$,
|
|
1310
|
+
});
|
|
1023
1311
|
},
|
|
1024
1312
|
"Response validation failed"
|
|
1025
1313
|
);
|
|
1026
|
-
|
|
1314
|
+
throw result;
|
|
1027
1315
|
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1028
1316
|
const responseBody = await response.json();
|
|
1029
1317
|
const result = schemas$.parse(
|
|
1030
1318
|
responseBody,
|
|
1031
1319
|
(val$) => {
|
|
1032
|
-
return
|
|
1320
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1321
|
+
...responseFields$,
|
|
1322
|
+
...val$,
|
|
1323
|
+
});
|
|
1033
1324
|
},
|
|
1034
1325
|
"Response validation failed"
|
|
1035
1326
|
);
|
|
1036
|
-
|
|
1327
|
+
throw result;
|
|
1037
1328
|
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1038
1329
|
const responseBody = await response.json();
|
|
1039
1330
|
const result = schemas$.parse(
|
|
1040
1331
|
responseBody,
|
|
1041
1332
|
(val$) => {
|
|
1042
|
-
return
|
|
1333
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1334
|
+
...responseFields$,
|
|
1335
|
+
...val$,
|
|
1336
|
+
});
|
|
1043
1337
|
},
|
|
1044
1338
|
"Response validation failed"
|
|
1045
1339
|
);
|
|
1046
|
-
|
|
1340
|
+
throw result;
|
|
1047
1341
|
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1048
1342
|
const responseBody = await response.json();
|
|
1049
1343
|
const result = schemas$.parse(
|
|
1050
1344
|
responseBody,
|
|
1051
1345
|
(val$) => {
|
|
1052
|
-
return
|
|
1346
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1347
|
+
...responseFields$,
|
|
1348
|
+
...val$,
|
|
1349
|
+
});
|
|
1053
1350
|
},
|
|
1054
1351
|
"Response validation failed"
|
|
1055
1352
|
);
|
|
1056
|
-
|
|
1353
|
+
throw result;
|
|
1057
1354
|
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1058
1355
|
const responseBody = await response.json();
|
|
1059
1356
|
const result = schemas$.parse(
|
|
1060
1357
|
responseBody,
|
|
1061
1358
|
(val$) => {
|
|
1062
|
-
return
|
|
1359
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1360
|
+
...responseFields$,
|
|
1361
|
+
...val$,
|
|
1362
|
+
});
|
|
1063
1363
|
},
|
|
1064
1364
|
"Response validation failed"
|
|
1065
1365
|
);
|
|
1066
|
-
|
|
1366
|
+
throw result;
|
|
1067
1367
|
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1068
1368
|
const responseBody = await response.json();
|
|
1069
1369
|
const result = schemas$.parse(
|
|
1070
1370
|
responseBody,
|
|
1071
1371
|
(val$) => {
|
|
1072
|
-
return
|
|
1372
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1373
|
+
...responseFields$,
|
|
1374
|
+
...val$,
|
|
1375
|
+
});
|
|
1073
1376
|
},
|
|
1074
1377
|
"Response validation failed"
|
|
1075
1378
|
);
|
|
1076
|
-
|
|
1379
|
+
throw result;
|
|
1077
1380
|
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1078
1381
|
const responseBody = await response.json();
|
|
1079
1382
|
const result = schemas$.parse(
|
|
1080
1383
|
responseBody,
|
|
1081
1384
|
(val$) => {
|
|
1082
|
-
return
|
|
1385
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1386
|
+
...responseFields$,
|
|
1387
|
+
...val$,
|
|
1388
|
+
});
|
|
1083
1389
|
},
|
|
1084
1390
|
"Response validation failed"
|
|
1085
1391
|
);
|
|
1086
|
-
|
|
1392
|
+
throw result;
|
|
1087
1393
|
} else {
|
|
1088
1394
|
const responseBody = await response.text();
|
|
1089
1395
|
throw new errors.SDKError("Unexpected API response", response, responseBody);
|