dub 0.36.0 → 0.36.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.
Files changed (74) hide show
  1. package/dist/commonjs/lib/config.d.ts +3 -3
  2. package/dist/commonjs/lib/config.js +3 -3
  3. package/dist/commonjs/models/components/domainschema.js +3 -3
  4. package/dist/commonjs/models/components/domainschema.js.map +1 -1
  5. package/dist/commonjs/models/components/linkschema.d.ts +5 -0
  6. package/dist/commonjs/models/components/linkschema.d.ts.map +1 -1
  7. package/dist/commonjs/models/components/linkschema.js +8 -6
  8. package/dist/commonjs/models/components/linkschema.js.map +1 -1
  9. package/dist/commonjs/models/components/workspaceschema.d.ts +52 -17
  10. package/dist/commonjs/models/components/workspaceschema.d.ts.map +1 -1
  11. package/dist/commonjs/models/components/workspaceschema.js +26 -12
  12. package/dist/commonjs/models/components/workspaceschema.js.map +1 -1
  13. package/dist/commonjs/models/operations/bulkcreatelinks.js +6 -6
  14. package/dist/commonjs/models/operations/bulkcreatelinks.js.map +1 -1
  15. package/dist/commonjs/models/operations/bulkupdatelinks.js +6 -6
  16. package/dist/commonjs/models/operations/bulkupdatelinks.js.map +1 -1
  17. package/dist/commonjs/models/operations/createdomain.js +1 -1
  18. package/dist/commonjs/models/operations/createdomain.js.map +1 -1
  19. package/dist/commonjs/models/operations/createlink.js +6 -6
  20. package/dist/commonjs/models/operations/createlink.js.map +1 -1
  21. package/dist/commonjs/models/operations/updatedomain.js +1 -1
  22. package/dist/commonjs/models/operations/updatedomain.js.map +1 -1
  23. package/dist/commonjs/models/operations/updatelink.js +6 -6
  24. package/dist/commonjs/models/operations/updatelink.js.map +1 -1
  25. package/dist/commonjs/models/operations/upsertlink.js +6 -6
  26. package/dist/commonjs/models/operations/upsertlink.js.map +1 -1
  27. package/dist/esm/lib/config.d.ts +3 -3
  28. package/dist/esm/lib/config.js +3 -3
  29. package/dist/esm/models/components/domainschema.js +3 -3
  30. package/dist/esm/models/components/domainschema.js.map +1 -1
  31. package/dist/esm/models/components/linkschema.d.ts +5 -0
  32. package/dist/esm/models/components/linkschema.d.ts.map +1 -1
  33. package/dist/esm/models/components/linkschema.js +8 -6
  34. package/dist/esm/models/components/linkschema.js.map +1 -1
  35. package/dist/esm/models/components/workspaceschema.d.ts +52 -17
  36. package/dist/esm/models/components/workspaceschema.d.ts.map +1 -1
  37. package/dist/esm/models/components/workspaceschema.js +26 -12
  38. package/dist/esm/models/components/workspaceschema.js.map +1 -1
  39. package/dist/esm/models/operations/bulkcreatelinks.js +6 -6
  40. package/dist/esm/models/operations/bulkcreatelinks.js.map +1 -1
  41. package/dist/esm/models/operations/bulkupdatelinks.js +6 -6
  42. package/dist/esm/models/operations/bulkupdatelinks.js.map +1 -1
  43. package/dist/esm/models/operations/createdomain.js +1 -1
  44. package/dist/esm/models/operations/createdomain.js.map +1 -1
  45. package/dist/esm/models/operations/createlink.js +6 -6
  46. package/dist/esm/models/operations/createlink.js.map +1 -1
  47. package/dist/esm/models/operations/updatedomain.js +1 -1
  48. package/dist/esm/models/operations/updatedomain.js.map +1 -1
  49. package/dist/esm/models/operations/updatelink.js +6 -6
  50. package/dist/esm/models/operations/updatelink.js.map +1 -1
  51. package/dist/esm/models/operations/upsertlink.js +6 -6
  52. package/dist/esm/models/operations/upsertlink.js.map +1 -1
  53. package/docs/sdks/analytics/README.md +3 -2
  54. package/docs/sdks/domains/README.md +9 -8
  55. package/docs/sdks/dub/README.md +1 -5
  56. package/docs/sdks/events/README.md +3 -2
  57. package/docs/sdks/links/README.md +19 -18
  58. package/docs/sdks/metatags/README.md +3 -2
  59. package/docs/sdks/qrcodes/README.md +3 -2
  60. package/docs/sdks/tags/README.md +7 -6
  61. package/docs/sdks/track/README.md +7 -6
  62. package/docs/sdks/workspaces/README.md +5 -4
  63. package/package.json +1 -1
  64. package/src/lib/config.ts +3 -3
  65. package/src/models/components/domainschema.ts +3 -3
  66. package/src/models/components/linkschema.ts +13 -6
  67. package/src/models/components/workspaceschema.ts +78 -29
  68. package/src/models/operations/bulkcreatelinks.ts +6 -6
  69. package/src/models/operations/bulkupdatelinks.ts +6 -6
  70. package/src/models/operations/createdomain.ts +1 -1
  71. package/src/models/operations/createlink.ts +6 -6
  72. package/src/models/operations/updatedomain.ts +1 -1
  73. package/src/models/operations/updatelink.ts +6 -6
  74. package/src/models/operations/upsertlink.ts +6 -6
@@ -73,6 +73,26 @@ export type WorkspaceSchema = {
73
73
  * The logo of the workspace.
74
74
  */
75
75
  logo?: string | null | undefined;
76
+ /**
77
+ * The plan of the workspace.
78
+ */
79
+ plan: Plan;
80
+ /**
81
+ * The Stripe ID of the workspace.
82
+ */
83
+ stripeId: string | null;
84
+ /**
85
+ * The date and time when the billing cycle starts for the workspace.
86
+ */
87
+ billingCycleStart: number;
88
+ /**
89
+ * [BETA]: The Stripe Connect ID of the workspace.
90
+ */
91
+ stripeConnectId: string | null;
92
+ /**
93
+ * The invite code of the workspace.
94
+ */
95
+ inviteCode: string | null;
76
96
  /**
77
97
  * The usage of the workspace.
78
98
  */
@@ -89,6 +109,14 @@ export type WorkspaceSchema = {
89
109
  * The links limit of the workspace.
90
110
  */
91
111
  linksLimit: number;
112
+ /**
113
+ * The dollar amount of tracked revenue in the current billing cycle (in cents).
114
+ */
115
+ salesUsage: number;
116
+ /**
117
+ * The limit of tracked revenue in the current billing cycle (in cents).
118
+ */
119
+ salesLimit: number;
92
120
  /**
93
121
  * The domains limit of the workspace.
94
122
  */
@@ -102,21 +130,25 @@ export type WorkspaceSchema = {
102
130
  */
103
131
  usersLimit: number;
104
132
  /**
105
- * The plan of the workspace.
133
+ * The AI usage of the workspace.
106
134
  */
107
- plan: Plan;
135
+ aiUsage: number;
108
136
  /**
109
- * The Stripe ID of the workspace.
137
+ * The AI limit of the workspace.
110
138
  */
111
- stripeId: string | null;
139
+ aiLimit: number;
112
140
  /**
113
- * The date and time when the billing cycle starts for the workspace.
141
+ * The ID of the referral link of the workspace.
114
142
  */
115
- billingCycleStart: number;
143
+ referralLinkId: string | null;
116
144
  /**
117
- * [BETA]: The Stripe Connect ID of the workspace.
145
+ * The number of signups referred by the workspace.
118
146
  */
119
- stripeConnectId: string | null;
147
+ referredSignups: number;
148
+ /**
149
+ * Whether the workspace has conversion tracking enabled (d.to/conversions).
150
+ */
151
+ conversionEnabled: boolean;
120
152
  /**
121
153
  * The date and time when the workspace was created.
122
154
  */
@@ -129,10 +161,6 @@ export type WorkspaceSchema = {
129
161
  * The domains of the workspace.
130
162
  */
131
163
  domains: Array<Domains>;
132
- /**
133
- * The invite code of the workspace.
134
- */
135
- inviteCode: string | null;
136
164
  /**
137
165
  * The feature flags of the workspace, indicating which features are enabled.
138
166
  */
@@ -204,8 +232,8 @@ export namespace Users$ {
204
232
  /** @internal */
205
233
  export const Domains$inboundSchema: z.ZodType<Domains, z.ZodTypeDef, unknown> = z.object({
206
234
  slug: z.string(),
207
- primary: z.boolean(),
208
- verified: z.boolean(),
235
+ primary: z.boolean().default(false),
236
+ verified: z.boolean().default(false),
209
237
  });
210
238
 
211
239
  /** @internal */
@@ -242,21 +270,28 @@ export const WorkspaceSchema$inboundSchema: z.ZodType<WorkspaceSchema, z.ZodType
242
270
  name: z.string(),
243
271
  slug: z.string(),
244
272
  logo: z.nullable(z.string()).default(null),
273
+ plan: Plan$inboundSchema,
274
+ stripeId: z.nullable(z.string()),
275
+ billingCycleStart: z.number(),
276
+ stripeConnectId: z.nullable(z.string()),
277
+ inviteCode: z.nullable(z.string()),
245
278
  usage: z.number(),
246
279
  usageLimit: z.number(),
247
280
  linksUsage: z.number(),
248
281
  linksLimit: z.number(),
282
+ salesUsage: z.number(),
283
+ salesLimit: z.number(),
249
284
  domainsLimit: z.number(),
250
285
  tagsLimit: z.number(),
251
286
  usersLimit: z.number(),
252
- plan: Plan$inboundSchema,
253
- stripeId: z.nullable(z.string()),
254
- billingCycleStart: z.number(),
255
- stripeConnectId: z.nullable(z.string()),
287
+ aiUsage: z.number(),
288
+ aiLimit: z.number(),
289
+ referralLinkId: z.nullable(z.string()),
290
+ referredSignups: z.number(),
291
+ conversionEnabled: z.boolean(),
256
292
  createdAt: z.string(),
257
293
  users: z.array(z.lazy(() => Users$inboundSchema)),
258
294
  domains: z.array(z.lazy(() => Domains$inboundSchema)),
259
- inviteCode: z.nullable(z.string()),
260
295
  flags: z.record(z.boolean()).optional(),
261
296
  });
262
297
 
@@ -266,21 +301,28 @@ export type WorkspaceSchema$Outbound = {
266
301
  name: string;
267
302
  slug: string;
268
303
  logo: string | null;
304
+ plan: string;
305
+ stripeId: string | null;
306
+ billingCycleStart: number;
307
+ stripeConnectId: string | null;
308
+ inviteCode: string | null;
269
309
  usage: number;
270
310
  usageLimit: number;
271
311
  linksUsage: number;
272
312
  linksLimit: number;
313
+ salesUsage: number;
314
+ salesLimit: number;
273
315
  domainsLimit: number;
274
316
  tagsLimit: number;
275
317
  usersLimit: number;
276
- plan: string;
277
- stripeId: string | null;
278
- billingCycleStart: number;
279
- stripeConnectId: string | null;
318
+ aiUsage: number;
319
+ aiLimit: number;
320
+ referralLinkId: string | null;
321
+ referredSignups: number;
322
+ conversionEnabled: boolean;
280
323
  createdAt: string;
281
324
  users: Array<Users$Outbound>;
282
325
  domains: Array<Domains$Outbound>;
283
- inviteCode: string | null;
284
326
  flags?: { [k: string]: boolean } | undefined;
285
327
  };
286
328
 
@@ -294,21 +336,28 @@ export const WorkspaceSchema$outboundSchema: z.ZodType<
294
336
  name: z.string(),
295
337
  slug: z.string(),
296
338
  logo: z.nullable(z.string()).default(null),
339
+ plan: Plan$outboundSchema,
340
+ stripeId: z.nullable(z.string()),
341
+ billingCycleStart: z.number(),
342
+ stripeConnectId: z.nullable(z.string()),
343
+ inviteCode: z.nullable(z.string()),
297
344
  usage: z.number(),
298
345
  usageLimit: z.number(),
299
346
  linksUsage: z.number(),
300
347
  linksLimit: z.number(),
348
+ salesUsage: z.number(),
349
+ salesLimit: z.number(),
301
350
  domainsLimit: z.number(),
302
351
  tagsLimit: z.number(),
303
352
  usersLimit: z.number(),
304
- plan: Plan$outboundSchema,
305
- stripeId: z.nullable(z.string()),
306
- billingCycleStart: z.number(),
307
- stripeConnectId: z.nullable(z.string()),
353
+ aiUsage: z.number(),
354
+ aiLimit: z.number(),
355
+ referralLinkId: z.nullable(z.string()),
356
+ referredSignups: z.number(),
357
+ conversionEnabled: z.boolean(),
308
358
  createdAt: z.string(),
309
359
  users: z.array(z.lazy(() => Users$outboundSchema)),
310
360
  domains: z.array(z.lazy(() => Domains$outboundSchema)),
311
- inviteCode: z.nullable(z.string()),
312
361
  flags: z.record(z.boolean()).optional(),
313
362
  });
314
363
 
@@ -209,9 +209,9 @@ export const RequestBody$inboundSchema: z.ZodType<RequestBody, z.ZodTypeDef, unk
209
209
  key: z.string().optional(),
210
210
  externalId: z.nullable(z.string()).optional(),
211
211
  prefix: z.string().optional(),
212
- trackConversion: z.boolean(),
213
- archived: z.boolean(),
214
- publicStats: z.boolean(),
212
+ trackConversion: z.boolean().default(false),
213
+ archived: z.boolean().default(false),
214
+ publicStats: z.boolean().default(false),
215
215
  tagId: z.nullable(z.string()).optional(),
216
216
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
217
217
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
@@ -219,16 +219,16 @@ export const RequestBody$inboundSchema: z.ZodType<RequestBody, z.ZodTypeDef, unk
219
219
  expiresAt: z.nullable(z.string()).optional(),
220
220
  expiredUrl: z.nullable(z.string()).optional(),
221
221
  password: z.nullable(z.string()).optional(),
222
- proxy: z.boolean(),
222
+ proxy: z.boolean().default(false),
223
223
  title: z.nullable(z.string()).optional(),
224
224
  description: z.nullable(z.string()).optional(),
225
225
  image: z.nullable(z.string()).optional(),
226
226
  video: z.nullable(z.string()).optional(),
227
- rewrite: z.boolean(),
227
+ rewrite: z.boolean().default(false),
228
228
  ios: z.nullable(z.string()).optional(),
229
229
  android: z.nullable(z.string()).optional(),
230
230
  geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
231
- doIndex: z.boolean(),
231
+ doIndex: z.boolean().default(false),
232
232
  utm_source: z.nullable(z.string()).optional(),
233
233
  utm_medium: z.nullable(z.string()).optional(),
234
234
  utm_campaign: z.nullable(z.string()).optional(),
@@ -194,9 +194,9 @@ export namespace BulkUpdateLinksTagNames$ {
194
194
  export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
195
195
  .object({
196
196
  url: z.string().optional(),
197
- trackConversion: z.boolean(),
198
- archived: z.boolean(),
199
- publicStats: z.boolean(),
197
+ trackConversion: z.boolean().default(false),
198
+ archived: z.boolean().default(false),
199
+ publicStats: z.boolean().default(false),
200
200
  tagId: z.nullable(z.string()).optional(),
201
201
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
202
202
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
@@ -204,16 +204,16 @@ export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
204
204
  expiresAt: z.nullable(z.string()).optional(),
205
205
  expiredUrl: z.nullable(z.string()).optional(),
206
206
  password: z.nullable(z.string()).optional(),
207
- proxy: z.boolean(),
207
+ proxy: z.boolean().default(false),
208
208
  title: z.nullable(z.string()).optional(),
209
209
  description: z.nullable(z.string()).optional(),
210
210
  image: z.nullable(z.string()).optional(),
211
211
  video: z.nullable(z.string()).optional(),
212
- rewrite: z.boolean(),
212
+ rewrite: z.boolean().default(false),
213
213
  ios: z.nullable(z.string()).optional(),
214
214
  android: z.nullable(z.string()).optional(),
215
215
  geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
216
- doIndex: z.boolean(),
216
+ doIndex: z.boolean().default(false),
217
217
  utm_source: z.nullable(z.string()).optional(),
218
218
  utm_medium: z.nullable(z.string()).optional(),
219
219
  utm_campaign: z.nullable(z.string()).optional(),
@@ -31,7 +31,7 @@ export const CreateDomainRequestBody$inboundSchema: z.ZodType<
31
31
  > = z.object({
32
32
  slug: z.string(),
33
33
  expiredUrl: z.nullable(z.string()).optional(),
34
- archived: z.boolean(),
34
+ archived: z.boolean().default(false),
35
35
  placeholder: z.nullable(z.string().default("https://dub.co/help/article/what-is-dub")),
36
36
  });
37
37
 
@@ -207,9 +207,9 @@ export const CreateLinkRequestBody$inboundSchema: z.ZodType<
207
207
  key: z.string().optional(),
208
208
  externalId: z.nullable(z.string()).optional(),
209
209
  prefix: z.string().optional(),
210
- trackConversion: z.boolean(),
211
- archived: z.boolean(),
212
- publicStats: z.boolean(),
210
+ trackConversion: z.boolean().default(false),
211
+ archived: z.boolean().default(false),
212
+ publicStats: z.boolean().default(false),
213
213
  tagId: z.nullable(z.string()).optional(),
214
214
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
215
215
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
@@ -217,16 +217,16 @@ export const CreateLinkRequestBody$inboundSchema: z.ZodType<
217
217
  expiresAt: z.nullable(z.string()).optional(),
218
218
  expiredUrl: z.nullable(z.string()).optional(),
219
219
  password: z.nullable(z.string()).optional(),
220
- proxy: z.boolean(),
220
+ proxy: z.boolean().default(false),
221
221
  title: z.nullable(z.string()).optional(),
222
222
  description: z.nullable(z.string()).optional(),
223
223
  image: z.nullable(z.string()).optional(),
224
224
  video: z.nullable(z.string()).optional(),
225
- rewrite: z.boolean(),
225
+ rewrite: z.boolean().default(false),
226
226
  ios: z.nullable(z.string()).optional(),
227
227
  android: z.nullable(z.string()).optional(),
228
228
  geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
229
- doIndex: z.boolean(),
229
+ doIndex: z.boolean().default(false),
230
230
  utm_source: z.nullable(z.string()).optional(),
231
231
  utm_medium: z.nullable(z.string()).optional(),
232
232
  utm_campaign: z.nullable(z.string()).optional(),
@@ -40,7 +40,7 @@ export const UpdateDomainRequestBody$inboundSchema: z.ZodType<
40
40
  > = z.object({
41
41
  slug: z.string().optional(),
42
42
  expiredUrl: z.nullable(z.string()).optional(),
43
- archived: z.boolean(),
43
+ archived: z.boolean().default(false),
44
44
  placeholder: z.nullable(z.string().default("https://dub.co/help/article/what-is-dub")),
45
45
  });
46
46
 
@@ -215,9 +215,9 @@ export const UpdateLinkRequestBody$inboundSchema: z.ZodType<
215
215
  key: z.string().optional(),
216
216
  externalId: z.nullable(z.string()).optional(),
217
217
  prefix: z.string().optional(),
218
- trackConversion: z.boolean(),
219
- archived: z.boolean(),
220
- publicStats: z.boolean(),
218
+ trackConversion: z.boolean().default(false),
219
+ archived: z.boolean().default(false),
220
+ publicStats: z.boolean().default(false),
221
221
  tagId: z.nullable(z.string()).optional(),
222
222
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
223
223
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
@@ -225,16 +225,16 @@ export const UpdateLinkRequestBody$inboundSchema: z.ZodType<
225
225
  expiresAt: z.nullable(z.string()).optional(),
226
226
  expiredUrl: z.nullable(z.string()).optional(),
227
227
  password: z.nullable(z.string()).optional(),
228
- proxy: z.boolean(),
228
+ proxy: z.boolean().default(false),
229
229
  title: z.nullable(z.string()).optional(),
230
230
  description: z.nullable(z.string()).optional(),
231
231
  image: z.nullable(z.string()).optional(),
232
232
  video: z.nullable(z.string()).optional(),
233
- rewrite: z.boolean(),
233
+ rewrite: z.boolean().default(false),
234
234
  ios: z.nullable(z.string()).optional(),
235
235
  android: z.nullable(z.string()).optional(),
236
236
  geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
237
- doIndex: z.boolean(),
237
+ doIndex: z.boolean().default(false),
238
238
  utm_source: z.nullable(z.string()).optional(),
239
239
  utm_medium: z.nullable(z.string()).optional(),
240
240
  utm_campaign: z.nullable(z.string()).optional(),
@@ -210,9 +210,9 @@ export const UpsertLinkRequestBody$inboundSchema: z.ZodType<
210
210
  key: z.string().optional(),
211
211
  externalId: z.nullable(z.string()).optional(),
212
212
  prefix: z.string().optional(),
213
- trackConversion: z.boolean(),
214
- archived: z.boolean(),
215
- publicStats: z.boolean(),
213
+ trackConversion: z.boolean().default(false),
214
+ archived: z.boolean().default(false),
215
+ publicStats: z.boolean().default(false),
216
216
  tagId: z.nullable(z.string()).optional(),
217
217
  tagIds: z.union([z.string(), z.array(z.string())]).optional(),
218
218
  tagNames: z.union([z.string(), z.array(z.string())]).optional(),
@@ -220,16 +220,16 @@ export const UpsertLinkRequestBody$inboundSchema: z.ZodType<
220
220
  expiresAt: z.nullable(z.string()).optional(),
221
221
  expiredUrl: z.nullable(z.string()).optional(),
222
222
  password: z.nullable(z.string()).optional(),
223
- proxy: z.boolean(),
223
+ proxy: z.boolean().default(false),
224
224
  title: z.nullable(z.string()).optional(),
225
225
  description: z.nullable(z.string()).optional(),
226
226
  image: z.nullable(z.string()).optional(),
227
227
  video: z.nullable(z.string()).optional(),
228
- rewrite: z.boolean(),
228
+ rewrite: z.boolean().default(false),
229
229
  ios: z.nullable(z.string()).optional(),
230
230
  android: z.nullable(z.string()).optional(),
231
231
  geo: z.nullable(components.LinkGeoTargeting$inboundSchema).optional(),
232
- doIndex: z.boolean(),
232
+ doIndex: z.boolean().default(false),
233
233
  utm_source: z.nullable(z.string()).optional(),
234
234
  utm_medium: z.nullable(z.string()).optional(),
235
235
  utm_campaign: z.nullable(z.string()).optional(),