dub 0.34.2 → 0.35.0
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 +50 -12
- package/docs/sdks/domains/README.md +6 -4
- package/docs/sdks/links/README.md +4 -3
- package/hooks/hooks.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/types.js +1 -1
- package/lib/base64.js +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +4 -4
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +50 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.js +1 -1
- package/lib/http.js +1 -1
- package/lib/is-plain-object.js +1 -1
- package/lib/primitives.js +1 -1
- package/lib/retries.js +1 -1
- package/lib/schemas.js +1 -1
- package/lib/sdks.js +1 -1
- package/lib/security.d.ts +1 -0
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +9 -2
- package/lib/security.js.map +1 -1
- package/lib/url.js +1 -1
- package/models/components/clicksbrowsers.js +1 -1
- package/models/components/clickscities.js +1 -1
- package/models/components/clickscount.js +1 -1
- package/models/components/clickscountries.d.ts +3 -3
- package/models/components/clickscountries.js +2 -2
- package/models/components/clicksdevices.js +1 -1
- package/models/components/clicksos.js +1 -1
- package/models/components/clicksreferers.js +1 -1
- package/models/components/clickstimeseries.js +1 -1
- package/models/components/clickstoplinks.js +1 -1
- package/models/components/clickstopurls.js +1 -1
- package/models/components/continentcode.d.ts +49 -0
- package/models/components/continentcode.d.ts.map +1 -0
- package/models/components/continentcode.js +58 -0
- package/models/components/continentcode.js.map +1 -0
- package/models/components/countrycode.js +1 -1
- package/models/components/domainschema.js +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -1
- package/models/components/index.js.map +1 -1
- package/models/components/leadsbrowsers.js +1 -1
- package/models/components/leadscities.js +1 -1
- package/models/components/leadscount.js +1 -1
- package/models/components/leadscountries.d.ts +3 -3
- package/models/components/leadscountries.js +2 -2
- package/models/components/leadsdevices.js +1 -1
- package/models/components/leadsos.js +1 -1
- package/models/components/leadsreferers.js +1 -1
- package/models/components/leadstimeseries.js +1 -1
- package/models/components/leadstoplinks.js +1 -1
- package/models/components/leadstopurls.js +1 -1
- package/models/components/linkgeotargeting.js +1 -1
- package/models/components/linkschema.js +1 -1
- package/models/components/salesbrowsers.js +1 -1
- package/models/components/salescities.js +1 -1
- package/models/components/salescount.js +1 -1
- package/models/components/salescountries.d.ts +3 -3
- package/models/components/salescountries.js +2 -2
- package/models/components/salesdevices.js +1 -1
- package/models/components/salesos.js +1 -1
- package/models/components/salesreferers.js +1 -1
- package/models/components/salestimeseries.js +1 -1
- package/models/components/salestoplinks.js +1 -1
- package/models/components/salestopurls.js +1 -1
- package/models/components/security.js +1 -1
- package/models/components/tagschema.js +1 -1
- package/models/components/workspaceschema.js +1 -1
- package/models/errors/badrequest.js +1 -1
- package/models/errors/conflict.js +1 -1
- package/models/errors/forbidden.js +1 -1
- package/models/errors/index.js +1 -1
- package/models/errors/internalservererror.js +1 -1
- package/models/errors/inviteexpired.js +1 -1
- package/models/errors/notfound.js +1 -1
- package/models/errors/ratelimitexceeded.js +1 -1
- package/models/errors/sdkerror.js +1 -1
- package/models/errors/sdkvalidationerror.js +1 -1
- package/models/errors/unauthorized.js +1 -1
- package/models/errors/unprocessableentity.js +1 -1
- package/models/operations/bulkcreatelinks.d.ts +25 -0
- package/models/operations/bulkcreatelinks.d.ts.map +1 -1
- package/models/operations/bulkcreatelinks.js +34 -3
- package/models/operations/bulkcreatelinks.js.map +1 -1
- package/models/operations/bulkupdatelinks.d.ts +25 -0
- package/models/operations/bulkupdatelinks.d.ts.map +1 -1
- package/models/operations/bulkupdatelinks.js +34 -3
- package/models/operations/bulkupdatelinks.js.map +1 -1
- package/models/operations/createdomain.js +1 -1
- package/models/operations/createlink.d.ts +25 -0
- package/models/operations/createlink.d.ts.map +1 -1
- package/models/operations/createlink.js +34 -3
- package/models/operations/createlink.js.map +1 -1
- package/models/operations/createtag.js +1 -1
- package/models/operations/deletedomain.js +1 -1
- package/models/operations/deletelink.js +1 -1
- package/models/operations/getlinkinfo.js +1 -1
- package/models/operations/getlinks.d.ts +31 -2
- package/models/operations/getlinks.d.ts.map +1 -1
- package/models/operations/getlinks.js +39 -4
- package/models/operations/getlinks.js.map +1 -1
- package/models/operations/getlinkscount.d.ts +26 -4
- package/models/operations/getlinkscount.d.ts.map +1 -1
- package/models/operations/getlinkscount.js +24 -4
- package/models/operations/getlinkscount.js.map +1 -1
- package/models/operations/getmetatags.js +1 -1
- package/models/operations/getqrcode.js +1 -1
- package/models/operations/getworkspace.js +1 -1
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -1
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdomains.d.ts +67 -0
- package/models/operations/listdomains.d.ts.map +1 -0
- package/models/operations/listdomains.js +89 -0
- package/models/operations/listdomains.js.map +1 -0
- package/models/operations/retrieveanalytics.d.ts +8 -0
- package/models/operations/retrieveanalytics.d.ts.map +1 -1
- package/models/operations/retrieveanalytics.js +4 -1
- package/models/operations/retrieveanalytics.js.map +1 -1
- package/models/operations/trackcustomer.js +1 -1
- package/models/operations/tracklead.js +1 -1
- package/models/operations/tracksale.js +1 -1
- package/models/operations/updatedomain.js +1 -1
- package/models/operations/updatelink.d.ts +25 -0
- package/models/operations/updatelink.d.ts.map +1 -1
- package/models/operations/updatelink.js +33 -3
- package/models/operations/updatelink.js.map +1 -1
- package/models/operations/updatetag.js +1 -1
- package/models/operations/updateworkspace.js +1 -1
- package/models/operations/upsertlink.d.ts +25 -0
- package/models/operations/upsertlink.d.ts.map +1 -1
- package/models/operations/upsertlink.js +34 -3
- package/models/operations/upsertlink.js.map +1 -1
- package/package.json +1 -1
- package/sdk/analytics.d.ts.map +1 -1
- package/sdk/analytics.js +5 -11
- package/sdk/analytics.js.map +1 -1
- package/sdk/domains.d.ts +2 -1
- package/sdk/domains.d.ts.map +1 -1
- package/sdk/domains.js +45 -47
- package/sdk/domains.js.map +1 -1
- package/sdk/index.js +1 -1
- package/sdk/links.d.ts +2 -1
- package/sdk/links.d.ts.map +1 -1
- package/sdk/links.js +45 -94
- package/sdk/links.js.map +1 -1
- package/sdk/metatags.d.ts.map +1 -1
- package/sdk/metatags.js +4 -11
- package/sdk/metatags.js.map +1 -1
- package/sdk/qrcodes.d.ts.map +1 -1
- package/sdk/qrcodes.js +4 -11
- package/sdk/qrcodes.js.map +1 -1
- package/sdk/sdk.js +1 -1
- package/sdk/tags.d.ts.map +1 -1
- package/sdk/tags.js +8 -31
- package/sdk/tags.js.map +1 -1
- package/sdk/track.d.ts.map +1 -1
- package/sdk/track.js +8 -31
- package/sdk/track.js.map +1 -1
- package/sdk/workspaces.d.ts.map +1 -1
- package/sdk/workspaces.js +6 -21
- package/sdk/workspaces.js.map +1 -1
- package/src/hooks/hooks.ts +1 -1
- package/src/hooks/index.ts +1 -1
- package/src/hooks/types.ts +1 -1
- package/src/lib/base64.ts +1 -1
- package/src/lib/config.ts +4 -4
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +1 -1
- package/src/lib/http.ts +1 -1
- package/src/lib/is-plain-object.ts +1 -1
- package/src/lib/primitives.ts +1 -1
- package/src/lib/retries.ts +1 -1
- package/src/lib/schemas.ts +1 -1
- package/src/lib/sdks.ts +1 -1
- package/src/lib/security.ts +11 -1
- package/src/lib/url.ts +1 -1
- package/src/models/components/clicksbrowsers.ts +1 -1
- package/src/models/components/clickscities.ts +1 -1
- package/src/models/components/clickscount.ts +1 -1
- package/src/models/components/clickscountries.ts +4 -4
- package/src/models/components/clicksdevices.ts +1 -1
- package/src/models/components/clicksos.ts +1 -1
- package/src/models/components/clicksreferers.ts +1 -1
- package/src/models/components/clickstimeseries.ts +1 -1
- package/src/models/components/clickstoplinks.ts +1 -1
- package/src/models/components/clickstopurls.ts +1 -1
- package/src/models/components/continentcode.ts +42 -0
- package/src/models/components/countrycode.ts +1 -1
- package/src/models/components/domainschema.ts +1 -1
- package/src/models/components/index.ts +2 -1
- package/src/models/components/leadsbrowsers.ts +1 -1
- package/src/models/components/leadscities.ts +1 -1
- package/src/models/components/leadscount.ts +1 -1
- package/src/models/components/leadscountries.ts +4 -4
- package/src/models/components/leadsdevices.ts +1 -1
- package/src/models/components/leadsos.ts +1 -1
- package/src/models/components/leadsreferers.ts +1 -1
- package/src/models/components/leadstimeseries.ts +1 -1
- package/src/models/components/leadstoplinks.ts +1 -1
- package/src/models/components/leadstopurls.ts +1 -1
- package/src/models/components/linkgeotargeting.ts +1 -1
- package/src/models/components/linkschema.ts +1 -1
- package/src/models/components/salesbrowsers.ts +1 -1
- package/src/models/components/salescities.ts +1 -1
- package/src/models/components/salescount.ts +1 -1
- package/src/models/components/salescountries.ts +4 -4
- package/src/models/components/salesdevices.ts +1 -1
- package/src/models/components/salesos.ts +1 -1
- package/src/models/components/salesreferers.ts +1 -1
- package/src/models/components/salestimeseries.ts +1 -1
- package/src/models/components/salestoplinks.ts +1 -1
- package/src/models/components/salestopurls.ts +1 -1
- package/src/models/components/security.ts +1 -1
- package/src/models/components/tagschema.ts +1 -1
- package/src/models/components/workspaceschema.ts +1 -1
- package/src/models/errors/badrequest.ts +1 -1
- package/src/models/errors/conflict.ts +1 -1
- package/src/models/errors/forbidden.ts +1 -1
- package/src/models/errors/index.ts +1 -1
- package/src/models/errors/internalservererror.ts +1 -1
- package/src/models/errors/inviteexpired.ts +1 -1
- package/src/models/errors/notfound.ts +1 -1
- package/src/models/errors/ratelimitexceeded.ts +1 -1
- package/src/models/errors/sdkerror.ts +1 -1
- package/src/models/errors/sdkvalidationerror.ts +1 -1
- package/src/models/errors/unauthorized.ts +1 -1
- package/src/models/errors/unprocessableentity.ts +1 -1
- package/src/models/operations/bulkcreatelinks.ts +111 -55
- package/src/models/operations/bulkupdatelinks.ts +103 -47
- package/src/models/operations/createdomain.ts +1 -1
- package/src/models/operations/createlink.ts +111 -55
- package/src/models/operations/createtag.ts +1 -1
- package/src/models/operations/deletedomain.ts +1 -1
- package/src/models/operations/deletelink.ts +1 -1
- package/src/models/operations/getlinkinfo.ts +1 -1
- package/src/models/operations/getlinks.ts +62 -5
- package/src/models/operations/getlinkscount.ts +31 -7
- package/src/models/operations/getmetatags.ts +1 -1
- package/src/models/operations/getqrcode.ts +1 -1
- package/src/models/operations/getworkspace.ts +1 -1
- package/src/models/operations/index.ts +2 -1
- package/src/models/operations/listdomains.ts +123 -0
- package/src/models/operations/retrieveanalytics.ts +9 -1
- package/src/models/operations/trackcustomer.ts +1 -1
- package/src/models/operations/tracklead.ts +1 -1
- package/src/models/operations/tracksale.ts +1 -1
- package/src/models/operations/updatedomain.ts +1 -1
- package/src/models/operations/updatelink.ts +110 -55
- package/src/models/operations/updatetag.ts +1 -1
- package/src/models/operations/updateworkspace.ts +1 -1
- package/src/models/operations/upsertlink.ts +111 -55
- package/src/sdk/analytics.ts +5 -9
- package/src/sdk/domains.ts +68 -40
- package/src/sdk/index.ts +1 -1
- package/src/sdk/links.ts +55 -77
- package/src/sdk/metatags.ts +4 -9
- package/src/sdk/qrcodes.ts +4 -9
- package/src/sdk/sdk.ts +1 -1
- package/src/sdk/tags.ts +8 -25
- package/src/sdk/track.ts +8 -25
- package/src/sdk/workspaces.ts +6 -17
- package/src/types/blobs.ts +1 -1
- package/src/types/enums.ts +1 -1
- package/src/types/index.ts +1 -1
- package/src/types/operations.ts +1 -1
- package/src/types/rfcdate.ts +1 -1
- package/types/blobs.js +1 -1
- package/types/enums.js +1 -1
- package/types/index.js +1 -1
- package/types/operations.js +1 -1
- package/types/rfcdate.js +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Code generated by Speakeasy (https://
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
5
6
|
import * as components from "../components/index.js";
|
|
6
7
|
import * as z from "zod";
|
|
7
8
|
|
|
@@ -118,6 +119,26 @@ export type UpsertLinkRequestBody = {
|
|
|
118
119
|
* Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex
|
|
119
120
|
*/
|
|
120
121
|
doIndex?: boolean | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.
|
|
124
|
+
*/
|
|
125
|
+
utmSource?: string | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.
|
|
128
|
+
*/
|
|
129
|
+
utmMedium?: string | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.
|
|
132
|
+
*/
|
|
133
|
+
utmCampaign?: string | null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.
|
|
136
|
+
*/
|
|
137
|
+
utmTerm?: string | null | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.
|
|
140
|
+
*/
|
|
141
|
+
utmContent?: string | null | undefined;
|
|
121
142
|
};
|
|
122
143
|
|
|
123
144
|
/** @internal */
|
|
@@ -182,33 +203,48 @@ export const UpsertLinkRequestBody$inboundSchema: z.ZodType<
|
|
|
182
203
|
UpsertLinkRequestBody,
|
|
183
204
|
z.ZodTypeDef,
|
|
184
205
|
unknown
|
|
185
|
-
> = z
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
> = z
|
|
207
|
+
.object({
|
|
208
|
+
url: z.string(),
|
|
209
|
+
domain: z.string().optional(),
|
|
210
|
+
key: z.string().optional(),
|
|
211
|
+
externalId: z.nullable(z.string()).optional(),
|
|
212
|
+
prefix: z.string().optional(),
|
|
213
|
+
trackConversion: z.boolean().default(false),
|
|
214
|
+
archived: z.boolean().default(false),
|
|
215
|
+
publicStats: z.boolean().default(false),
|
|
216
|
+
tagId: z.nullable(z.string()).optional(),
|
|
217
|
+
tagIds: z.union([z.string(), z.array(z.string())]).optional(),
|
|
218
|
+
tagNames: z.union([z.string(), z.array(z.string())]).optional(),
|
|
219
|
+
comments: z.nullable(z.string()).optional(),
|
|
220
|
+
expiresAt: z.nullable(z.string()).optional(),
|
|
221
|
+
expiredUrl: z.nullable(z.string()).optional(),
|
|
222
|
+
password: z.nullable(z.string()).optional(),
|
|
223
|
+
proxy: z.boolean().default(false),
|
|
224
|
+
title: z.nullable(z.string()).optional(),
|
|
225
|
+
description: z.nullable(z.string()).optional(),
|
|
226
|
+
image: z.nullable(z.string()).optional(),
|
|
227
|
+
video: z.nullable(z.string()).optional(),
|
|
228
|
+
rewrite: z.boolean().default(false),
|
|
229
|
+
ios: z.nullable(z.string()).optional(),
|
|
230
|
+
android: z.nullable(z.string()).optional(),
|
|
231
|
+
geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
|
|
232
|
+
doIndex: z.boolean().default(false),
|
|
233
|
+
utm_source: z.nullable(z.string()).optional(),
|
|
234
|
+
utm_medium: z.nullable(z.string()).optional(),
|
|
235
|
+
utm_campaign: z.nullable(z.string()).optional(),
|
|
236
|
+
utm_term: z.nullable(z.string()).optional(),
|
|
237
|
+
utm_content: z.nullable(z.string()).optional(),
|
|
238
|
+
})
|
|
239
|
+
.transform((v) => {
|
|
240
|
+
return remap$(v, {
|
|
241
|
+
utm_source: "utmSource",
|
|
242
|
+
utm_medium: "utmMedium",
|
|
243
|
+
utm_campaign: "utmCampaign",
|
|
244
|
+
utm_term: "utmTerm",
|
|
245
|
+
utm_content: "utmContent",
|
|
246
|
+
});
|
|
247
|
+
});
|
|
212
248
|
|
|
213
249
|
/** @internal */
|
|
214
250
|
export type UpsertLinkRequestBody$Outbound = {
|
|
@@ -237,6 +273,11 @@ export type UpsertLinkRequestBody$Outbound = {
|
|
|
237
273
|
android?: string | null | undefined;
|
|
238
274
|
geo?: components.LinkGeoTargeting$Outbound | null | undefined;
|
|
239
275
|
doIndex: boolean;
|
|
276
|
+
utm_source?: string | null | undefined;
|
|
277
|
+
utm_medium?: string | null | undefined;
|
|
278
|
+
utm_campaign?: string | null | undefined;
|
|
279
|
+
utm_term?: string | null | undefined;
|
|
280
|
+
utm_content?: string | null | undefined;
|
|
240
281
|
};
|
|
241
282
|
|
|
242
283
|
/** @internal */
|
|
@@ -244,33 +285,48 @@ export const UpsertLinkRequestBody$outboundSchema: z.ZodType<
|
|
|
244
285
|
UpsertLinkRequestBody$Outbound,
|
|
245
286
|
z.ZodTypeDef,
|
|
246
287
|
UpsertLinkRequestBody
|
|
247
|
-
> = z
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
288
|
+
> = z
|
|
289
|
+
.object({
|
|
290
|
+
url: z.string(),
|
|
291
|
+
domain: z.string().optional(),
|
|
292
|
+
key: z.string().optional(),
|
|
293
|
+
externalId: z.nullable(z.string()).optional(),
|
|
294
|
+
prefix: z.string().optional(),
|
|
295
|
+
trackConversion: z.boolean().default(false),
|
|
296
|
+
archived: z.boolean().default(false),
|
|
297
|
+
publicStats: z.boolean().default(false),
|
|
298
|
+
tagId: z.nullable(z.string()).optional(),
|
|
299
|
+
tagIds: z.union([z.string(), z.array(z.string())]).optional(),
|
|
300
|
+
tagNames: z.union([z.string(), z.array(z.string())]).optional(),
|
|
301
|
+
comments: z.nullable(z.string()).optional(),
|
|
302
|
+
expiresAt: z.nullable(z.string()).optional(),
|
|
303
|
+
expiredUrl: z.nullable(z.string()).optional(),
|
|
304
|
+
password: z.nullable(z.string()).optional(),
|
|
305
|
+
proxy: z.boolean().default(false),
|
|
306
|
+
title: z.nullable(z.string()).optional(),
|
|
307
|
+
description: z.nullable(z.string()).optional(),
|
|
308
|
+
image: z.nullable(z.string()).optional(),
|
|
309
|
+
video: z.nullable(z.string()).optional(),
|
|
310
|
+
rewrite: z.boolean().default(false),
|
|
311
|
+
ios: z.nullable(z.string()).optional(),
|
|
312
|
+
android: z.nullable(z.string()).optional(),
|
|
313
|
+
geo: z.nullable(components.LinkGeoTargeting$outboundSchema).optional(),
|
|
314
|
+
doIndex: z.boolean().default(false),
|
|
315
|
+
utmSource: z.nullable(z.string()).optional(),
|
|
316
|
+
utmMedium: z.nullable(z.string()).optional(),
|
|
317
|
+
utmCampaign: z.nullable(z.string()).optional(),
|
|
318
|
+
utmTerm: z.nullable(z.string()).optional(),
|
|
319
|
+
utmContent: z.nullable(z.string()).optional(),
|
|
320
|
+
})
|
|
321
|
+
.transform((v) => {
|
|
322
|
+
return remap$(v, {
|
|
323
|
+
utmSource: "utm_source",
|
|
324
|
+
utmMedium: "utm_medium",
|
|
325
|
+
utmCampaign: "utm_campaign",
|
|
326
|
+
utmTerm: "utm_term",
|
|
327
|
+
utmContent: "utm_content",
|
|
328
|
+
});
|
|
329
|
+
});
|
|
274
330
|
|
|
275
331
|
/**
|
|
276
332
|
* @internal
|
package/src/sdk/analytics.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Code generated by Speakeasy (https://
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKHooks } from "../hooks/hooks.js";
|
|
@@ -8,6 +8,7 @@ import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js";
|
|
|
8
8
|
import { HTTPClient } from "../lib/http.js";
|
|
9
9
|
import * as schemas$ from "../lib/schemas.js";
|
|
10
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity } from "../lib/security.js";
|
|
11
12
|
import * as errors from "../models/errors/index.js";
|
|
12
13
|
import * as operations from "../models/operations/index.js";
|
|
13
14
|
|
|
@@ -62,6 +63,7 @@ export class Analytics extends ClientSDK {
|
|
|
62
63
|
const query$ = encodeFormQuery$({
|
|
63
64
|
browser: payload$.browser,
|
|
64
65
|
city: payload$.city,
|
|
66
|
+
continent: payload$.continent,
|
|
65
67
|
country: payload$.country,
|
|
66
68
|
device: payload$.device,
|
|
67
69
|
domain: payload$.domain,
|
|
@@ -86,14 +88,8 @@ export class Analytics extends ClientSDK {
|
|
|
86
88
|
Accept: "application/json",
|
|
87
89
|
});
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
security$ = { token: await this.options$.token() };
|
|
92
|
-
} else if (this.options$.token) {
|
|
93
|
-
security$ = { token: this.options$.token };
|
|
94
|
-
} else {
|
|
95
|
-
security$ = {};
|
|
96
|
-
}
|
|
91
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
92
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
97
93
|
const context = {
|
|
98
94
|
operationID: "retrieveAnalytics",
|
|
99
95
|
oAuth2Scopes: [],
|
package/src/sdk/domains.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Code generated by Speakeasy (https://
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKHooks } from "../hooks/hooks.js";
|
|
6
6
|
import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
encodeFormQuery as encodeFormQuery$,
|
|
9
|
+
encodeJSON as encodeJSON$,
|
|
10
|
+
encodeSimple as encodeSimple$,
|
|
11
|
+
} from "../lib/encodings.js";
|
|
8
12
|
import { HTTPClient } from "../lib/http.js";
|
|
9
13
|
import * as schemas$ from "../lib/schemas.js";
|
|
10
14
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity } from "../lib/security.js";
|
|
11
16
|
import * as components from "../models/components/index.js";
|
|
12
17
|
import * as errors from "../models/errors/index.js";
|
|
13
18
|
import * as operations from "../models/operations/index.js";
|
|
14
|
-
import
|
|
19
|
+
import { createPageIterator, PageIterator, Paginator } from "../types/operations.js";
|
|
15
20
|
|
|
16
21
|
export class Domains extends ClientSDK {
|
|
17
22
|
private readonly options$: SDKOptions & { hooks?: SDKHooks };
|
|
@@ -46,23 +51,34 @@ export class Domains extends ClientSDK {
|
|
|
46
51
|
* @remarks
|
|
47
52
|
* Retrieve a list of domains associated with the authenticated workspace.
|
|
48
53
|
*/
|
|
49
|
-
async list(
|
|
54
|
+
async list(
|
|
55
|
+
request?: operations.ListDomainsRequest | undefined,
|
|
56
|
+
options?: RequestOptions
|
|
57
|
+
): Promise<PageIterator<operations.ListDomainsResponse>> {
|
|
58
|
+
const input$ = typeof request === "undefined" ? {} : request;
|
|
59
|
+
|
|
60
|
+
const payload$ = schemas$.parse(
|
|
61
|
+
input$,
|
|
62
|
+
(value$) => operations.ListDomainsRequest$outboundSchema.parse(value$),
|
|
63
|
+
"Input validation failed"
|
|
64
|
+
);
|
|
65
|
+
const body$ = null;
|
|
66
|
+
|
|
50
67
|
const path$ = this.templateURLComponent("/domains")();
|
|
51
68
|
|
|
52
|
-
const query$ =
|
|
69
|
+
const query$ = encodeFormQuery$({
|
|
70
|
+
archived: payload$.archived,
|
|
71
|
+
page: payload$.page,
|
|
72
|
+
pageSize: payload$.pageSize,
|
|
73
|
+
search: payload$.search,
|
|
74
|
+
});
|
|
53
75
|
|
|
54
76
|
const headers$ = new Headers({
|
|
55
77
|
Accept: "application/json",
|
|
56
78
|
});
|
|
57
79
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
security$ = { token: await this.options$.token() };
|
|
61
|
-
} else if (this.options$.token) {
|
|
62
|
-
security$ = { token: this.options$.token };
|
|
63
|
-
} else {
|
|
64
|
-
security$ = {};
|
|
65
|
-
}
|
|
80
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
81
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
66
82
|
const context = {
|
|
67
83
|
operationID: "listDomains",
|
|
68
84
|
oAuth2Scopes: [],
|
|
@@ -78,6 +94,7 @@ export class Domains extends ClientSDK {
|
|
|
78
94
|
path: path$,
|
|
79
95
|
headers: headers$,
|
|
80
96
|
query: query$,
|
|
97
|
+
body: body$,
|
|
81
98
|
timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1,
|
|
82
99
|
},
|
|
83
100
|
options
|
|
@@ -106,8 +123,8 @@ export class Domains extends ClientSDK {
|
|
|
106
123
|
HttpMeta: { Response: response, Request: request$ },
|
|
107
124
|
};
|
|
108
125
|
|
|
109
|
-
const [result$] = await this.matcher<
|
|
110
|
-
.json(200,
|
|
126
|
+
const [result$, raw$] = await this.matcher<operations.ListDomainsResponse>()
|
|
127
|
+
.json(200, operations.ListDomainsResponse$inboundSchema, { key: "Result" })
|
|
111
128
|
.json(400, errors.BadRequest$inboundSchema, { err: true })
|
|
112
129
|
.json(401, errors.Unauthorized$inboundSchema, { err: true })
|
|
113
130
|
.json(403, errors.Forbidden$inboundSchema, { err: true })
|
|
@@ -120,7 +137,36 @@ export class Domains extends ClientSDK {
|
|
|
120
137
|
.fail(["4XX", "5XX"])
|
|
121
138
|
.match(response, { extraFields: responseFields$ });
|
|
122
139
|
|
|
123
|
-
|
|
140
|
+
const nextFunc = (responseData: unknown): Paginator<operations.ListDomainsResponse> => {
|
|
141
|
+
const page = input$.page || 0;
|
|
142
|
+
const nextPage = page + 1;
|
|
143
|
+
|
|
144
|
+
if (!responseData) {
|
|
145
|
+
return () => null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const results = responseData;
|
|
149
|
+
|
|
150
|
+
if (!Array.isArray(results) || !results.length) {
|
|
151
|
+
return () => null;
|
|
152
|
+
}
|
|
153
|
+
const limit = input$.pageSize || 0;
|
|
154
|
+
if (results.length < limit) {
|
|
155
|
+
return () => null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return () =>
|
|
159
|
+
this.list(
|
|
160
|
+
{
|
|
161
|
+
...input$,
|
|
162
|
+
page: nextPage,
|
|
163
|
+
},
|
|
164
|
+
options
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const page$ = { ...result$, next: nextFunc(raw$) };
|
|
169
|
+
return { ...page$, ...createPageIterator(page$) };
|
|
124
170
|
}
|
|
125
171
|
|
|
126
172
|
/**
|
|
@@ -152,14 +198,8 @@ export class Domains extends ClientSDK {
|
|
|
152
198
|
Accept: "application/json",
|
|
153
199
|
});
|
|
154
200
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
security$ = { token: await this.options$.token() };
|
|
158
|
-
} else if (this.options$.token) {
|
|
159
|
-
security$ = { token: this.options$.token };
|
|
160
|
-
} else {
|
|
161
|
-
security$ = {};
|
|
162
|
-
}
|
|
201
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
202
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
163
203
|
const context = {
|
|
164
204
|
operationID: "createDomain",
|
|
165
205
|
oAuth2Scopes: [],
|
|
@@ -253,14 +293,8 @@ export class Domains extends ClientSDK {
|
|
|
253
293
|
Accept: "application/json",
|
|
254
294
|
});
|
|
255
295
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
security$ = { token: await this.options$.token() };
|
|
259
|
-
} else if (this.options$.token) {
|
|
260
|
-
security$ = { token: this.options$.token };
|
|
261
|
-
} else {
|
|
262
|
-
security$ = {};
|
|
263
|
-
}
|
|
296
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
297
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
264
298
|
const context = {
|
|
265
299
|
operationID: "deleteDomain",
|
|
266
300
|
oAuth2Scopes: [],
|
|
@@ -357,14 +391,8 @@ export class Domains extends ClientSDK {
|
|
|
357
391
|
Accept: "application/json",
|
|
358
392
|
});
|
|
359
393
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
security$ = { token: await this.options$.token() };
|
|
363
|
-
} else if (this.options$.token) {
|
|
364
|
-
security$ = { token: this.options$.token };
|
|
365
|
-
} else {
|
|
366
|
-
security$ = {};
|
|
367
|
-
}
|
|
394
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
395
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
368
396
|
const context = {
|
|
369
397
|
operationID: "updateDomain",
|
|
370
398
|
oAuth2Scopes: [],
|
package/src/sdk/index.ts
CHANGED
package/src/sdk/links.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Code generated by Speakeasy (https://
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { SDKHooks } from "../hooks/hooks.js";
|
|
@@ -12,9 +12,11 @@ import {
|
|
|
12
12
|
import { HTTPClient } from "../lib/http.js";
|
|
13
13
|
import * as schemas$ from "../lib/schemas.js";
|
|
14
14
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
15
|
+
import { extractSecurity } from "../lib/security.js";
|
|
15
16
|
import * as components from "../models/components/index.js";
|
|
16
17
|
import * as errors from "../models/errors/index.js";
|
|
17
18
|
import * as operations from "../models/operations/index.js";
|
|
19
|
+
import { createPageIterator, PageIterator, Paginator } from "../types/operations.js";
|
|
18
20
|
import * as z from "zod";
|
|
19
21
|
|
|
20
22
|
export class Links extends ClientSDK {
|
|
@@ -53,7 +55,7 @@ export class Links extends ClientSDK {
|
|
|
53
55
|
async list(
|
|
54
56
|
request?: operations.GetLinksRequest | undefined,
|
|
55
57
|
options?: RequestOptions
|
|
56
|
-
): Promise<
|
|
58
|
+
): Promise<PageIterator<operations.GetLinksResponse>> {
|
|
57
59
|
const input$ = typeof request === "undefined" ? {} : request;
|
|
58
60
|
|
|
59
61
|
const payload$ = schemas$.parse(
|
|
@@ -68,6 +70,7 @@ export class Links extends ClientSDK {
|
|
|
68
70
|
const query$ = encodeFormQuery$({
|
|
69
71
|
domain: payload$.domain,
|
|
70
72
|
page: payload$.page,
|
|
73
|
+
pageSize: payload$.pageSize,
|
|
71
74
|
search: payload$.search,
|
|
72
75
|
showArchived: payload$.showArchived,
|
|
73
76
|
sort: payload$.sort,
|
|
@@ -82,14 +85,8 @@ export class Links extends ClientSDK {
|
|
|
82
85
|
Accept: "application/json",
|
|
83
86
|
});
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
security$ = { token: await this.options$.token() };
|
|
88
|
-
} else if (this.options$.token) {
|
|
89
|
-
security$ = { token: this.options$.token };
|
|
90
|
-
} else {
|
|
91
|
-
security$ = {};
|
|
92
|
-
}
|
|
88
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
89
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
93
90
|
const context = {
|
|
94
91
|
operationID: "getLinks",
|
|
95
92
|
oAuth2Scopes: [],
|
|
@@ -134,8 +131,8 @@ export class Links extends ClientSDK {
|
|
|
134
131
|
HttpMeta: { Response: response, Request: request$ },
|
|
135
132
|
};
|
|
136
133
|
|
|
137
|
-
const [result$] = await this.matcher<
|
|
138
|
-
.json(200,
|
|
134
|
+
const [result$, raw$] = await this.matcher<operations.GetLinksResponse>()
|
|
135
|
+
.json(200, operations.GetLinksResponse$inboundSchema, { key: "Result" })
|
|
139
136
|
.json(400, errors.BadRequest$inboundSchema, { err: true })
|
|
140
137
|
.json(401, errors.Unauthorized$inboundSchema, { err: true })
|
|
141
138
|
.json(403, errors.Forbidden$inboundSchema, { err: true })
|
|
@@ -148,7 +145,36 @@ export class Links extends ClientSDK {
|
|
|
148
145
|
.fail(["4XX", "5XX"])
|
|
149
146
|
.match(response, { extraFields: responseFields$ });
|
|
150
147
|
|
|
151
|
-
|
|
148
|
+
const nextFunc = (responseData: unknown): Paginator<operations.GetLinksResponse> => {
|
|
149
|
+
const page = input$.page || 0;
|
|
150
|
+
const nextPage = page + 1;
|
|
151
|
+
|
|
152
|
+
if (!responseData) {
|
|
153
|
+
return () => null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const results = responseData;
|
|
157
|
+
|
|
158
|
+
if (!Array.isArray(results) || !results.length) {
|
|
159
|
+
return () => null;
|
|
160
|
+
}
|
|
161
|
+
const limit = input$.pageSize || 0;
|
|
162
|
+
if (results.length < limit) {
|
|
163
|
+
return () => null;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return () =>
|
|
167
|
+
this.list(
|
|
168
|
+
{
|
|
169
|
+
...input$,
|
|
170
|
+
page: nextPage,
|
|
171
|
+
},
|
|
172
|
+
options
|
|
173
|
+
);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const page$ = { ...result$, next: nextFunc(raw$) };
|
|
177
|
+
return { ...page$, ...createPageIterator(page$) };
|
|
152
178
|
}
|
|
153
179
|
|
|
154
180
|
/**
|
|
@@ -180,14 +206,8 @@ export class Links extends ClientSDK {
|
|
|
180
206
|
Accept: "application/json",
|
|
181
207
|
});
|
|
182
208
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
security$ = { token: await this.options$.token() };
|
|
186
|
-
} else if (this.options$.token) {
|
|
187
|
-
security$ = { token: this.options$.token };
|
|
188
|
-
} else {
|
|
189
|
-
security$ = {};
|
|
190
|
-
}
|
|
209
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
210
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
191
211
|
const context = {
|
|
192
212
|
operationID: "createLink",
|
|
193
213
|
oAuth2Scopes: [],
|
|
@@ -286,14 +306,8 @@ export class Links extends ClientSDK {
|
|
|
286
306
|
Accept: "application/json",
|
|
287
307
|
});
|
|
288
308
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
security$ = { token: await this.options$.token() };
|
|
292
|
-
} else if (this.options$.token) {
|
|
293
|
-
security$ = { token: this.options$.token };
|
|
294
|
-
} else {
|
|
295
|
-
security$ = {};
|
|
296
|
-
}
|
|
309
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
310
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
297
311
|
const context = {
|
|
298
312
|
operationID: "getLinksCount",
|
|
299
313
|
oAuth2Scopes: [],
|
|
@@ -387,14 +401,8 @@ export class Links extends ClientSDK {
|
|
|
387
401
|
Accept: "application/json",
|
|
388
402
|
});
|
|
389
403
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
security$ = { token: await this.options$.token() };
|
|
393
|
-
} else if (this.options$.token) {
|
|
394
|
-
security$ = { token: this.options$.token };
|
|
395
|
-
} else {
|
|
396
|
-
security$ = {};
|
|
397
|
-
}
|
|
404
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
405
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
398
406
|
const context = {
|
|
399
407
|
operationID: "getLinkInfo",
|
|
400
408
|
oAuth2Scopes: [],
|
|
@@ -491,14 +499,8 @@ export class Links extends ClientSDK {
|
|
|
491
499
|
Accept: "application/json",
|
|
492
500
|
});
|
|
493
501
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
security$ = { token: await this.options$.token() };
|
|
497
|
-
} else if (this.options$.token) {
|
|
498
|
-
security$ = { token: this.options$.token };
|
|
499
|
-
} else {
|
|
500
|
-
security$ = {};
|
|
501
|
-
}
|
|
502
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
503
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
502
504
|
const context = {
|
|
503
505
|
operationID: "deleteLink",
|
|
504
506
|
oAuth2Scopes: [],
|
|
@@ -598,14 +600,8 @@ export class Links extends ClientSDK {
|
|
|
598
600
|
Accept: "application/json",
|
|
599
601
|
});
|
|
600
602
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
security$ = { token: await this.options$.token() };
|
|
604
|
-
} else if (this.options$.token) {
|
|
605
|
-
security$ = { token: this.options$.token };
|
|
606
|
-
} else {
|
|
607
|
-
security$ = {};
|
|
608
|
-
}
|
|
603
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
604
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
609
605
|
const context = {
|
|
610
606
|
operationID: "updateLink",
|
|
611
607
|
oAuth2Scopes: [],
|
|
@@ -696,14 +692,8 @@ export class Links extends ClientSDK {
|
|
|
696
692
|
Accept: "application/json",
|
|
697
693
|
});
|
|
698
694
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
security$ = { token: await this.options$.token() };
|
|
702
|
-
} else if (this.options$.token) {
|
|
703
|
-
security$ = { token: this.options$.token };
|
|
704
|
-
} else {
|
|
705
|
-
security$ = {};
|
|
706
|
-
}
|
|
695
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
696
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
707
697
|
const context = {
|
|
708
698
|
operationID: "bulkCreateLinks",
|
|
709
699
|
oAuth2Scopes: [],
|
|
@@ -795,14 +785,8 @@ export class Links extends ClientSDK {
|
|
|
795
785
|
Accept: "application/json",
|
|
796
786
|
});
|
|
797
787
|
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
security$ = { token: await this.options$.token() };
|
|
801
|
-
} else if (this.options$.token) {
|
|
802
|
-
security$ = { token: this.options$.token };
|
|
803
|
-
} else {
|
|
804
|
-
security$ = {};
|
|
805
|
-
}
|
|
788
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
789
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
806
790
|
const context = {
|
|
807
791
|
operationID: "bulkUpdateLinks",
|
|
808
792
|
oAuth2Scopes: [],
|
|
@@ -893,14 +877,8 @@ export class Links extends ClientSDK {
|
|
|
893
877
|
Accept: "application/json",
|
|
894
878
|
});
|
|
895
879
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
security$ = { token: await this.options$.token() };
|
|
899
|
-
} else if (this.options$.token) {
|
|
900
|
-
security$ = { token: this.options$.token };
|
|
901
|
-
} else {
|
|
902
|
-
security$ = {};
|
|
903
|
-
}
|
|
880
|
+
const token$ = await extractSecurity(this.options$.token);
|
|
881
|
+
const security$ = token$ == null ? {} : { token: token$ };
|
|
904
882
|
const context = {
|
|
905
883
|
operationID: "upsertLink",
|
|
906
884
|
oAuth2Scopes: [],
|