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.
Files changed (278) hide show
  1. package/README.md +50 -12
  2. package/docs/sdks/domains/README.md +6 -4
  3. package/docs/sdks/links/README.md +4 -3
  4. package/hooks/hooks.js +1 -1
  5. package/hooks/index.js +1 -1
  6. package/hooks/types.js +1 -1
  7. package/lib/base64.js +1 -1
  8. package/lib/config.d.ts +3 -3
  9. package/lib/config.js +4 -4
  10. package/lib/dlv.d.ts +14 -0
  11. package/lib/dlv.d.ts.map +1 -0
  12. package/lib/dlv.js +50 -0
  13. package/lib/dlv.js.map +1 -0
  14. package/lib/encodings.js +1 -1
  15. package/lib/http.js +1 -1
  16. package/lib/is-plain-object.js +1 -1
  17. package/lib/primitives.js +1 -1
  18. package/lib/retries.js +1 -1
  19. package/lib/schemas.js +1 -1
  20. package/lib/sdks.js +1 -1
  21. package/lib/security.d.ts +1 -0
  22. package/lib/security.d.ts.map +1 -1
  23. package/lib/security.js +9 -2
  24. package/lib/security.js.map +1 -1
  25. package/lib/url.js +1 -1
  26. package/models/components/clicksbrowsers.js +1 -1
  27. package/models/components/clickscities.js +1 -1
  28. package/models/components/clickscount.js +1 -1
  29. package/models/components/clickscountries.d.ts +3 -3
  30. package/models/components/clickscountries.js +2 -2
  31. package/models/components/clicksdevices.js +1 -1
  32. package/models/components/clicksos.js +1 -1
  33. package/models/components/clicksreferers.js +1 -1
  34. package/models/components/clickstimeseries.js +1 -1
  35. package/models/components/clickstoplinks.js +1 -1
  36. package/models/components/clickstopurls.js +1 -1
  37. package/models/components/continentcode.d.ts +49 -0
  38. package/models/components/continentcode.d.ts.map +1 -0
  39. package/models/components/continentcode.js +58 -0
  40. package/models/components/continentcode.js.map +1 -0
  41. package/models/components/countrycode.js +1 -1
  42. package/models/components/domainschema.js +1 -1
  43. package/models/components/index.d.ts +1 -0
  44. package/models/components/index.d.ts.map +1 -1
  45. package/models/components/index.js +2 -1
  46. package/models/components/index.js.map +1 -1
  47. package/models/components/leadsbrowsers.js +1 -1
  48. package/models/components/leadscities.js +1 -1
  49. package/models/components/leadscount.js +1 -1
  50. package/models/components/leadscountries.d.ts +3 -3
  51. package/models/components/leadscountries.js +2 -2
  52. package/models/components/leadsdevices.js +1 -1
  53. package/models/components/leadsos.js +1 -1
  54. package/models/components/leadsreferers.js +1 -1
  55. package/models/components/leadstimeseries.js +1 -1
  56. package/models/components/leadstoplinks.js +1 -1
  57. package/models/components/leadstopurls.js +1 -1
  58. package/models/components/linkgeotargeting.js +1 -1
  59. package/models/components/linkschema.js +1 -1
  60. package/models/components/salesbrowsers.js +1 -1
  61. package/models/components/salescities.js +1 -1
  62. package/models/components/salescount.js +1 -1
  63. package/models/components/salescountries.d.ts +3 -3
  64. package/models/components/salescountries.js +2 -2
  65. package/models/components/salesdevices.js +1 -1
  66. package/models/components/salesos.js +1 -1
  67. package/models/components/salesreferers.js +1 -1
  68. package/models/components/salestimeseries.js +1 -1
  69. package/models/components/salestoplinks.js +1 -1
  70. package/models/components/salestopurls.js +1 -1
  71. package/models/components/security.js +1 -1
  72. package/models/components/tagschema.js +1 -1
  73. package/models/components/workspaceschema.js +1 -1
  74. package/models/errors/badrequest.js +1 -1
  75. package/models/errors/conflict.js +1 -1
  76. package/models/errors/forbidden.js +1 -1
  77. package/models/errors/index.js +1 -1
  78. package/models/errors/internalservererror.js +1 -1
  79. package/models/errors/inviteexpired.js +1 -1
  80. package/models/errors/notfound.js +1 -1
  81. package/models/errors/ratelimitexceeded.js +1 -1
  82. package/models/errors/sdkerror.js +1 -1
  83. package/models/errors/sdkvalidationerror.js +1 -1
  84. package/models/errors/unauthorized.js +1 -1
  85. package/models/errors/unprocessableentity.js +1 -1
  86. package/models/operations/bulkcreatelinks.d.ts +25 -0
  87. package/models/operations/bulkcreatelinks.d.ts.map +1 -1
  88. package/models/operations/bulkcreatelinks.js +34 -3
  89. package/models/operations/bulkcreatelinks.js.map +1 -1
  90. package/models/operations/bulkupdatelinks.d.ts +25 -0
  91. package/models/operations/bulkupdatelinks.d.ts.map +1 -1
  92. package/models/operations/bulkupdatelinks.js +34 -3
  93. package/models/operations/bulkupdatelinks.js.map +1 -1
  94. package/models/operations/createdomain.js +1 -1
  95. package/models/operations/createlink.d.ts +25 -0
  96. package/models/operations/createlink.d.ts.map +1 -1
  97. package/models/operations/createlink.js +34 -3
  98. package/models/operations/createlink.js.map +1 -1
  99. package/models/operations/createtag.js +1 -1
  100. package/models/operations/deletedomain.js +1 -1
  101. package/models/operations/deletelink.js +1 -1
  102. package/models/operations/getlinkinfo.js +1 -1
  103. package/models/operations/getlinks.d.ts +31 -2
  104. package/models/operations/getlinks.d.ts.map +1 -1
  105. package/models/operations/getlinks.js +39 -4
  106. package/models/operations/getlinks.js.map +1 -1
  107. package/models/operations/getlinkscount.d.ts +26 -4
  108. package/models/operations/getlinkscount.d.ts.map +1 -1
  109. package/models/operations/getlinkscount.js +24 -4
  110. package/models/operations/getlinkscount.js.map +1 -1
  111. package/models/operations/getmetatags.js +1 -1
  112. package/models/operations/getqrcode.js +1 -1
  113. package/models/operations/getworkspace.js +1 -1
  114. package/models/operations/index.d.ts +1 -0
  115. package/models/operations/index.d.ts.map +1 -1
  116. package/models/operations/index.js +2 -1
  117. package/models/operations/index.js.map +1 -1
  118. package/models/operations/listdomains.d.ts +67 -0
  119. package/models/operations/listdomains.d.ts.map +1 -0
  120. package/models/operations/listdomains.js +89 -0
  121. package/models/operations/listdomains.js.map +1 -0
  122. package/models/operations/retrieveanalytics.d.ts +8 -0
  123. package/models/operations/retrieveanalytics.d.ts.map +1 -1
  124. package/models/operations/retrieveanalytics.js +4 -1
  125. package/models/operations/retrieveanalytics.js.map +1 -1
  126. package/models/operations/trackcustomer.js +1 -1
  127. package/models/operations/tracklead.js +1 -1
  128. package/models/operations/tracksale.js +1 -1
  129. package/models/operations/updatedomain.js +1 -1
  130. package/models/operations/updatelink.d.ts +25 -0
  131. package/models/operations/updatelink.d.ts.map +1 -1
  132. package/models/operations/updatelink.js +33 -3
  133. package/models/operations/updatelink.js.map +1 -1
  134. package/models/operations/updatetag.js +1 -1
  135. package/models/operations/updateworkspace.js +1 -1
  136. package/models/operations/upsertlink.d.ts +25 -0
  137. package/models/operations/upsertlink.d.ts.map +1 -1
  138. package/models/operations/upsertlink.js +34 -3
  139. package/models/operations/upsertlink.js.map +1 -1
  140. package/package.json +1 -1
  141. package/sdk/analytics.d.ts.map +1 -1
  142. package/sdk/analytics.js +5 -11
  143. package/sdk/analytics.js.map +1 -1
  144. package/sdk/domains.d.ts +2 -1
  145. package/sdk/domains.d.ts.map +1 -1
  146. package/sdk/domains.js +45 -47
  147. package/sdk/domains.js.map +1 -1
  148. package/sdk/index.js +1 -1
  149. package/sdk/links.d.ts +2 -1
  150. package/sdk/links.d.ts.map +1 -1
  151. package/sdk/links.js +45 -94
  152. package/sdk/links.js.map +1 -1
  153. package/sdk/metatags.d.ts.map +1 -1
  154. package/sdk/metatags.js +4 -11
  155. package/sdk/metatags.js.map +1 -1
  156. package/sdk/qrcodes.d.ts.map +1 -1
  157. package/sdk/qrcodes.js +4 -11
  158. package/sdk/qrcodes.js.map +1 -1
  159. package/sdk/sdk.js +1 -1
  160. package/sdk/tags.d.ts.map +1 -1
  161. package/sdk/tags.js +8 -31
  162. package/sdk/tags.js.map +1 -1
  163. package/sdk/track.d.ts.map +1 -1
  164. package/sdk/track.js +8 -31
  165. package/sdk/track.js.map +1 -1
  166. package/sdk/workspaces.d.ts.map +1 -1
  167. package/sdk/workspaces.js +6 -21
  168. package/sdk/workspaces.js.map +1 -1
  169. package/src/hooks/hooks.ts +1 -1
  170. package/src/hooks/index.ts +1 -1
  171. package/src/hooks/types.ts +1 -1
  172. package/src/lib/base64.ts +1 -1
  173. package/src/lib/config.ts +4 -4
  174. package/src/lib/dlv.ts +53 -0
  175. package/src/lib/encodings.ts +1 -1
  176. package/src/lib/http.ts +1 -1
  177. package/src/lib/is-plain-object.ts +1 -1
  178. package/src/lib/primitives.ts +1 -1
  179. package/src/lib/retries.ts +1 -1
  180. package/src/lib/schemas.ts +1 -1
  181. package/src/lib/sdks.ts +1 -1
  182. package/src/lib/security.ts +11 -1
  183. package/src/lib/url.ts +1 -1
  184. package/src/models/components/clicksbrowsers.ts +1 -1
  185. package/src/models/components/clickscities.ts +1 -1
  186. package/src/models/components/clickscount.ts +1 -1
  187. package/src/models/components/clickscountries.ts +4 -4
  188. package/src/models/components/clicksdevices.ts +1 -1
  189. package/src/models/components/clicksos.ts +1 -1
  190. package/src/models/components/clicksreferers.ts +1 -1
  191. package/src/models/components/clickstimeseries.ts +1 -1
  192. package/src/models/components/clickstoplinks.ts +1 -1
  193. package/src/models/components/clickstopurls.ts +1 -1
  194. package/src/models/components/continentcode.ts +42 -0
  195. package/src/models/components/countrycode.ts +1 -1
  196. package/src/models/components/domainschema.ts +1 -1
  197. package/src/models/components/index.ts +2 -1
  198. package/src/models/components/leadsbrowsers.ts +1 -1
  199. package/src/models/components/leadscities.ts +1 -1
  200. package/src/models/components/leadscount.ts +1 -1
  201. package/src/models/components/leadscountries.ts +4 -4
  202. package/src/models/components/leadsdevices.ts +1 -1
  203. package/src/models/components/leadsos.ts +1 -1
  204. package/src/models/components/leadsreferers.ts +1 -1
  205. package/src/models/components/leadstimeseries.ts +1 -1
  206. package/src/models/components/leadstoplinks.ts +1 -1
  207. package/src/models/components/leadstopurls.ts +1 -1
  208. package/src/models/components/linkgeotargeting.ts +1 -1
  209. package/src/models/components/linkschema.ts +1 -1
  210. package/src/models/components/salesbrowsers.ts +1 -1
  211. package/src/models/components/salescities.ts +1 -1
  212. package/src/models/components/salescount.ts +1 -1
  213. package/src/models/components/salescountries.ts +4 -4
  214. package/src/models/components/salesdevices.ts +1 -1
  215. package/src/models/components/salesos.ts +1 -1
  216. package/src/models/components/salesreferers.ts +1 -1
  217. package/src/models/components/salestimeseries.ts +1 -1
  218. package/src/models/components/salestoplinks.ts +1 -1
  219. package/src/models/components/salestopurls.ts +1 -1
  220. package/src/models/components/security.ts +1 -1
  221. package/src/models/components/tagschema.ts +1 -1
  222. package/src/models/components/workspaceschema.ts +1 -1
  223. package/src/models/errors/badrequest.ts +1 -1
  224. package/src/models/errors/conflict.ts +1 -1
  225. package/src/models/errors/forbidden.ts +1 -1
  226. package/src/models/errors/index.ts +1 -1
  227. package/src/models/errors/internalservererror.ts +1 -1
  228. package/src/models/errors/inviteexpired.ts +1 -1
  229. package/src/models/errors/notfound.ts +1 -1
  230. package/src/models/errors/ratelimitexceeded.ts +1 -1
  231. package/src/models/errors/sdkerror.ts +1 -1
  232. package/src/models/errors/sdkvalidationerror.ts +1 -1
  233. package/src/models/errors/unauthorized.ts +1 -1
  234. package/src/models/errors/unprocessableentity.ts +1 -1
  235. package/src/models/operations/bulkcreatelinks.ts +111 -55
  236. package/src/models/operations/bulkupdatelinks.ts +103 -47
  237. package/src/models/operations/createdomain.ts +1 -1
  238. package/src/models/operations/createlink.ts +111 -55
  239. package/src/models/operations/createtag.ts +1 -1
  240. package/src/models/operations/deletedomain.ts +1 -1
  241. package/src/models/operations/deletelink.ts +1 -1
  242. package/src/models/operations/getlinkinfo.ts +1 -1
  243. package/src/models/operations/getlinks.ts +62 -5
  244. package/src/models/operations/getlinkscount.ts +31 -7
  245. package/src/models/operations/getmetatags.ts +1 -1
  246. package/src/models/operations/getqrcode.ts +1 -1
  247. package/src/models/operations/getworkspace.ts +1 -1
  248. package/src/models/operations/index.ts +2 -1
  249. package/src/models/operations/listdomains.ts +123 -0
  250. package/src/models/operations/retrieveanalytics.ts +9 -1
  251. package/src/models/operations/trackcustomer.ts +1 -1
  252. package/src/models/operations/tracklead.ts +1 -1
  253. package/src/models/operations/tracksale.ts +1 -1
  254. package/src/models/operations/updatedomain.ts +1 -1
  255. package/src/models/operations/updatelink.ts +110 -55
  256. package/src/models/operations/updatetag.ts +1 -1
  257. package/src/models/operations/updateworkspace.ts +1 -1
  258. package/src/models/operations/upsertlink.ts +111 -55
  259. package/src/sdk/analytics.ts +5 -9
  260. package/src/sdk/domains.ts +68 -40
  261. package/src/sdk/index.ts +1 -1
  262. package/src/sdk/links.ts +55 -77
  263. package/src/sdk/metatags.ts +4 -9
  264. package/src/sdk/qrcodes.ts +4 -9
  265. package/src/sdk/sdk.ts +1 -1
  266. package/src/sdk/tags.ts +8 -25
  267. package/src/sdk/track.ts +8 -25
  268. package/src/sdk/workspaces.ts +6 -17
  269. package/src/types/blobs.ts +1 -1
  270. package/src/types/enums.ts +1 -1
  271. package/src/types/index.ts +1 -1
  272. package/src/types/operations.ts +1 -1
  273. package/src/types/rfcdate.ts +1 -1
  274. package/types/blobs.js +1 -1
  275. package/types/enums.js +1 -1
  276. package/types/index.js +1 -1
  277. package/types/operations.js +1 -1
  278. package/types/rfcdate.js +1 -1
@@ -1,7 +1,8 @@
1
1
  /*
2
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
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.object({
186
- url: z.string(),
187
- domain: z.string().optional(),
188
- key: z.string().optional(),
189
- externalId: z.nullable(z.string()).optional(),
190
- prefix: z.string().optional(),
191
- trackConversion: z.boolean().default(false),
192
- archived: z.boolean().default(false),
193
- publicStats: z.boolean().default(false),
194
- tagId: z.nullable(z.string()).optional(),
195
- tagIds: z.union([z.string(), z.array(z.string())]).optional(),
196
- tagNames: z.union([z.string(), z.array(z.string())]).optional(),
197
- comments: z.nullable(z.string()).optional(),
198
- expiresAt: z.nullable(z.string()).optional(),
199
- expiredUrl: z.nullable(z.string()).optional(),
200
- password: z.nullable(z.string()).optional(),
201
- proxy: z.boolean().default(false),
202
- title: z.nullable(z.string()).optional(),
203
- description: z.nullable(z.string()).optional(),
204
- image: z.nullable(z.string()).optional(),
205
- video: z.nullable(z.string()).optional(),
206
- rewrite: z.boolean().default(false),
207
- ios: z.nullable(z.string()).optional(),
208
- android: z.nullable(z.string()).optional(),
209
- geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
210
- doIndex: z.boolean().default(false),
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.object({
248
- url: z.string(),
249
- domain: z.string().optional(),
250
- key: z.string().optional(),
251
- externalId: z.nullable(z.string()).optional(),
252
- prefix: z.string().optional(),
253
- trackConversion: z.boolean().default(false),
254
- archived: z.boolean().default(false),
255
- publicStats: z.boolean().default(false),
256
- tagId: z.nullable(z.string()).optional(),
257
- tagIds: z.union([z.string(), z.array(z.string())]).optional(),
258
- tagNames: z.union([z.string(), z.array(z.string())]).optional(),
259
- comments: z.nullable(z.string()).optional(),
260
- expiresAt: z.nullable(z.string()).optional(),
261
- expiredUrl: z.nullable(z.string()).optional(),
262
- password: z.nullable(z.string()).optional(),
263
- proxy: z.boolean().default(false),
264
- title: z.nullable(z.string()).optional(),
265
- description: z.nullable(z.string()).optional(),
266
- image: z.nullable(z.string()).optional(),
267
- video: z.nullable(z.string()).optional(),
268
- rewrite: z.boolean().default(false),
269
- ios: z.nullable(z.string()).optional(),
270
- android: z.nullable(z.string()).optional(),
271
- geo: z.nullable(components.LinkGeoTargeting$outboundSchema).optional(),
272
- doIndex: z.boolean().default(false),
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
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
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
- let security$;
90
- if (typeof this.options$.token === "function") {
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: [],
@@ -1,17 +1,22 @@
1
1
  /*
2
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
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 { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
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 * as z from "zod";
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(options?: RequestOptions): Promise<Array<components.DomainSchema>> {
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
- let security$;
59
- if (typeof this.options$.token === "function") {
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<Array<components.DomainSchema>>()
110
- .json(200, z.array(components.DomainSchema$inboundSchema))
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
- return result$;
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
- let security$;
156
- if (typeof this.options$.token === "function") {
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
- let security$;
257
- if (typeof this.options$.token === "function") {
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
- let security$;
361
- if (typeof this.options$.token === "function") {
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
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
5
  export * from "./sdk.js";
package/src/sdk/links.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
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<Array<components.LinkSchema>> {
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
- let security$;
86
- if (typeof this.options$.token === "function") {
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<Array<components.LinkSchema>>()
138
- .json(200, z.array(components.LinkSchema$inboundSchema))
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
- return result$;
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
- let security$;
184
- if (typeof this.options$.token === "function") {
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
- let security$;
290
- if (typeof this.options$.token === "function") {
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
- let security$;
391
- if (typeof this.options$.token === "function") {
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
- let security$;
495
- if (typeof this.options$.token === "function") {
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
- let security$;
602
- if (typeof this.options$.token === "function") {
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
- let security$;
700
- if (typeof this.options$.token === "function") {
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
- let security$;
799
- if (typeof this.options$.token === "function") {
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
- let security$;
897
- if (typeof this.options$.token === "function") {
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: [],