dub 0.45.0 → 0.45.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 (207) hide show
  1. package/README.md +15 -2
  2. package/dist/commonjs/funcs/customersCreate.d.ts +16 -0
  3. package/dist/commonjs/funcs/customersCreate.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/customersCreate.js +114 -0
  5. package/dist/commonjs/funcs/customersCreate.js.map +1 -0
  6. package/dist/commonjs/funcs/customersDelete.d.ts +16 -0
  7. package/dist/commonjs/funcs/customersDelete.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/customersDelete.js +120 -0
  9. package/dist/commonjs/funcs/customersDelete.js.map +1 -0
  10. package/dist/commonjs/funcs/customersGet.d.ts +16 -0
  11. package/dist/commonjs/funcs/customersGet.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/customersGet.js +117 -0
  13. package/dist/commonjs/funcs/customersGet.js.map +1 -0
  14. package/dist/commonjs/funcs/customersList.d.ts +16 -0
  15. package/dist/commonjs/funcs/customersList.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/customersList.js +103 -0
  17. package/dist/commonjs/funcs/customersList.js.map +1 -0
  18. package/dist/commonjs/funcs/customersUpdate.d.ts +16 -0
  19. package/dist/commonjs/funcs/customersUpdate.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/customersUpdate.js +122 -0
  21. package/dist/commonjs/funcs/customersUpdate.js.map +1 -0
  22. package/dist/commonjs/funcs/trackCustomer.d.ts +2 -0
  23. package/dist/commonjs/funcs/trackCustomer.d.ts.map +1 -1
  24. package/dist/commonjs/funcs/trackCustomer.js +2 -0
  25. package/dist/commonjs/funcs/trackCustomer.js.map +1 -1
  26. package/dist/commonjs/lib/config.d.ts +3 -3
  27. package/dist/commonjs/lib/config.js +3 -3
  28. package/dist/commonjs/models/components/leadcreatedevent.d.ts +28 -6
  29. package/dist/commonjs/models/components/leadcreatedevent.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/leadcreatedevent.js +10 -6
  31. package/dist/commonjs/models/components/leadcreatedevent.js.map +1 -1
  32. package/dist/commonjs/models/components/leadevent.d.ts +26 -4
  33. package/dist/commonjs/models/components/leadevent.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/leadevent.js +8 -4
  35. package/dist/commonjs/models/components/leadevent.js.map +1 -1
  36. package/dist/commonjs/models/components/salecreatedevent.d.ts +28 -6
  37. package/dist/commonjs/models/components/salecreatedevent.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/salecreatedevent.js +10 -6
  39. package/dist/commonjs/models/components/salecreatedevent.js.map +1 -1
  40. package/dist/commonjs/models/components/saleevent.d.ts +26 -4
  41. package/dist/commonjs/models/components/saleevent.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/saleevent.js +8 -4
  43. package/dist/commonjs/models/components/saleevent.js.map +1 -1
  44. package/dist/commonjs/models/components/workspaceschema.d.ts +21 -1
  45. package/dist/commonjs/models/components/workspaceschema.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/workspaceschema.js +8 -0
  47. package/dist/commonjs/models/components/workspaceschema.js.map +1 -1
  48. package/dist/commonjs/models/operations/createcustomer.d.ts +97 -0
  49. package/dist/commonjs/models/operations/createcustomer.d.ts.map +1 -0
  50. package/dist/commonjs/models/operations/createcustomer.js +85 -0
  51. package/dist/commonjs/models/operations/createcustomer.js.map +1 -0
  52. package/dist/commonjs/models/operations/deletecustomer.d.ts +57 -0
  53. package/dist/commonjs/models/operations/deletecustomer.d.ts.map +1 -0
  54. package/dist/commonjs/models/operations/deletecustomer.js +69 -0
  55. package/dist/commonjs/models/operations/deletecustomer.js.map +1 -0
  56. package/dist/commonjs/models/operations/getcustomer.d.ts +82 -0
  57. package/dist/commonjs/models/operations/getcustomer.d.ts.map +1 -0
  58. package/dist/commonjs/models/operations/getcustomer.js +79 -0
  59. package/dist/commonjs/models/operations/getcustomer.js.map +1 -0
  60. package/dist/commonjs/models/operations/getcustomers.d.ts +53 -0
  61. package/dist/commonjs/models/operations/getcustomers.d.ts.map +1 -0
  62. package/dist/commonjs/models/operations/getcustomers.js +60 -0
  63. package/dist/commonjs/models/operations/getcustomers.js.map +1 -0
  64. package/dist/commonjs/models/operations/index.d.ts +5 -0
  65. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  66. package/dist/commonjs/models/operations/index.js +5 -0
  67. package/dist/commonjs/models/operations/index.js.map +1 -1
  68. package/dist/commonjs/models/operations/tracklead.d.ts +11 -4
  69. package/dist/commonjs/models/operations/tracklead.d.ts.map +1 -1
  70. package/dist/commonjs/models/operations/tracklead.js +6 -4
  71. package/dist/commonjs/models/operations/tracklead.js.map +1 -1
  72. package/dist/commonjs/models/operations/tracksale.d.ts +11 -2
  73. package/dist/commonjs/models/operations/tracksale.d.ts.map +1 -1
  74. package/dist/commonjs/models/operations/tracksale.js +6 -2
  75. package/dist/commonjs/models/operations/tracksale.js.map +1 -1
  76. package/dist/commonjs/models/operations/updatecustomer.d.ts +125 -0
  77. package/dist/commonjs/models/operations/updatecustomer.d.ts.map +1 -0
  78. package/dist/commonjs/models/operations/updatecustomer.js +116 -0
  79. package/dist/commonjs/models/operations/updatecustomer.js.map +1 -0
  80. package/dist/commonjs/sdk/customers.d.ts +40 -0
  81. package/dist/commonjs/sdk/customers.d.ts.map +1 -0
  82. package/dist/commonjs/sdk/customers.js +62 -0
  83. package/dist/commonjs/sdk/customers.js.map +1 -0
  84. package/dist/commonjs/sdk/sdk.d.ts +7 -4
  85. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  86. package/dist/commonjs/sdk/sdk.js +13 -8
  87. package/dist/commonjs/sdk/sdk.js.map +1 -1
  88. package/dist/commonjs/sdk/track.d.ts +2 -0
  89. package/dist/commonjs/sdk/track.d.ts.map +1 -1
  90. package/dist/commonjs/sdk/track.js +2 -0
  91. package/dist/commonjs/sdk/track.js.map +1 -1
  92. package/dist/esm/funcs/customersCreate.d.ts +16 -0
  93. package/dist/esm/funcs/customersCreate.d.ts.map +1 -0
  94. package/dist/esm/funcs/customersCreate.js +87 -0
  95. package/dist/esm/funcs/customersCreate.js.map +1 -0
  96. package/dist/esm/funcs/customersDelete.d.ts +16 -0
  97. package/dist/esm/funcs/customersDelete.d.ts.map +1 -0
  98. package/dist/esm/funcs/customersDelete.js +93 -0
  99. package/dist/esm/funcs/customersDelete.js.map +1 -0
  100. package/dist/esm/funcs/customersGet.d.ts +16 -0
  101. package/dist/esm/funcs/customersGet.d.ts.map +1 -0
  102. package/dist/esm/funcs/customersGet.js +90 -0
  103. package/dist/esm/funcs/customersGet.js.map +1 -0
  104. package/dist/esm/funcs/customersList.d.ts +16 -0
  105. package/dist/esm/funcs/customersList.d.ts.map +1 -0
  106. package/dist/esm/funcs/customersList.js +76 -0
  107. package/dist/esm/funcs/customersList.js.map +1 -0
  108. package/dist/esm/funcs/customersUpdate.d.ts +16 -0
  109. package/dist/esm/funcs/customersUpdate.d.ts.map +1 -0
  110. package/dist/esm/funcs/customersUpdate.js +95 -0
  111. package/dist/esm/funcs/customersUpdate.js.map +1 -0
  112. package/dist/esm/funcs/trackCustomer.d.ts +2 -0
  113. package/dist/esm/funcs/trackCustomer.d.ts.map +1 -1
  114. package/dist/esm/funcs/trackCustomer.js +2 -0
  115. package/dist/esm/funcs/trackCustomer.js.map +1 -1
  116. package/dist/esm/lib/config.d.ts +3 -3
  117. package/dist/esm/lib/config.js +3 -3
  118. package/dist/esm/models/components/leadcreatedevent.d.ts +28 -6
  119. package/dist/esm/models/components/leadcreatedevent.d.ts.map +1 -1
  120. package/dist/esm/models/components/leadcreatedevent.js +10 -6
  121. package/dist/esm/models/components/leadcreatedevent.js.map +1 -1
  122. package/dist/esm/models/components/leadevent.d.ts +26 -4
  123. package/dist/esm/models/components/leadevent.d.ts.map +1 -1
  124. package/dist/esm/models/components/leadevent.js +8 -4
  125. package/dist/esm/models/components/leadevent.js.map +1 -1
  126. package/dist/esm/models/components/salecreatedevent.d.ts +28 -6
  127. package/dist/esm/models/components/salecreatedevent.d.ts.map +1 -1
  128. package/dist/esm/models/components/salecreatedevent.js +10 -6
  129. package/dist/esm/models/components/salecreatedevent.js.map +1 -1
  130. package/dist/esm/models/components/saleevent.d.ts +26 -4
  131. package/dist/esm/models/components/saleevent.d.ts.map +1 -1
  132. package/dist/esm/models/components/saleevent.js +8 -4
  133. package/dist/esm/models/components/saleevent.js.map +1 -1
  134. package/dist/esm/models/components/workspaceschema.d.ts +21 -1
  135. package/dist/esm/models/components/workspaceschema.d.ts.map +1 -1
  136. package/dist/esm/models/components/workspaceschema.js +8 -0
  137. package/dist/esm/models/components/workspaceschema.js.map +1 -1
  138. package/dist/esm/models/operations/createcustomer.d.ts +97 -0
  139. package/dist/esm/models/operations/createcustomer.d.ts.map +1 -0
  140. package/dist/esm/models/operations/createcustomer.js +59 -0
  141. package/dist/esm/models/operations/createcustomer.js.map +1 -0
  142. package/dist/esm/models/operations/deletecustomer.d.ts +57 -0
  143. package/dist/esm/models/operations/deletecustomer.d.ts.map +1 -0
  144. package/dist/esm/models/operations/deletecustomer.js +43 -0
  145. package/dist/esm/models/operations/deletecustomer.js.map +1 -0
  146. package/dist/esm/models/operations/getcustomer.d.ts +82 -0
  147. package/dist/esm/models/operations/getcustomer.d.ts.map +1 -0
  148. package/dist/esm/models/operations/getcustomer.js +53 -0
  149. package/dist/esm/models/operations/getcustomer.js.map +1 -0
  150. package/dist/esm/models/operations/getcustomers.d.ts +53 -0
  151. package/dist/esm/models/operations/getcustomers.d.ts.map +1 -0
  152. package/dist/esm/models/operations/getcustomers.js +34 -0
  153. package/dist/esm/models/operations/getcustomers.js.map +1 -0
  154. package/dist/esm/models/operations/index.d.ts +5 -0
  155. package/dist/esm/models/operations/index.d.ts.map +1 -1
  156. package/dist/esm/models/operations/index.js +5 -0
  157. package/dist/esm/models/operations/index.js.map +1 -1
  158. package/dist/esm/models/operations/tracklead.d.ts +11 -4
  159. package/dist/esm/models/operations/tracklead.d.ts.map +1 -1
  160. package/dist/esm/models/operations/tracklead.js +6 -4
  161. package/dist/esm/models/operations/tracklead.js.map +1 -1
  162. package/dist/esm/models/operations/tracksale.d.ts +11 -2
  163. package/dist/esm/models/operations/tracksale.d.ts.map +1 -1
  164. package/dist/esm/models/operations/tracksale.js +6 -2
  165. package/dist/esm/models/operations/tracksale.js.map +1 -1
  166. package/dist/esm/models/operations/updatecustomer.d.ts +125 -0
  167. package/dist/esm/models/operations/updatecustomer.d.ts.map +1 -0
  168. package/dist/esm/models/operations/updatecustomer.js +90 -0
  169. package/dist/esm/models/operations/updatecustomer.js.map +1 -0
  170. package/dist/esm/sdk/customers.d.ts +40 -0
  171. package/dist/esm/sdk/customers.d.ts.map +1 -0
  172. package/dist/esm/sdk/customers.js +58 -0
  173. package/dist/esm/sdk/customers.js.map +1 -0
  174. package/dist/esm/sdk/sdk.d.ts +7 -4
  175. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  176. package/dist/esm/sdk/sdk.js +13 -8
  177. package/dist/esm/sdk/sdk.js.map +1 -1
  178. package/dist/esm/sdk/track.d.ts +2 -0
  179. package/dist/esm/sdk/track.d.ts.map +1 -1
  180. package/dist/esm/sdk/track.js +2 -0
  181. package/dist/esm/sdk/track.js.map +1 -1
  182. package/docs/sdks/customers/README.md +421 -0
  183. package/docs/sdks/track/README.md +4 -2
  184. package/package.json +1 -1
  185. package/src/funcs/customersCreate.ts +172 -0
  186. package/src/funcs/customersDelete.ts +177 -0
  187. package/src/funcs/customersGet.ts +173 -0
  188. package/src/funcs/customersList.ts +152 -0
  189. package/src/funcs/customersUpdate.ts +180 -0
  190. package/src/funcs/trackCustomer.ts +2 -0
  191. package/src/lib/config.ts +3 -3
  192. package/src/models/components/leadcreatedevent.ts +38 -12
  193. package/src/models/components/leadevent.ts +34 -8
  194. package/src/models/components/salecreatedevent.ts +38 -12
  195. package/src/models/components/saleevent.ts +34 -8
  196. package/src/models/components/workspaceschema.ts +29 -1
  197. package/src/models/operations/createcustomer.ts +150 -0
  198. package/src/models/operations/deletecustomer.ts +94 -0
  199. package/src/models/operations/getcustomer.ts +129 -0
  200. package/src/models/operations/getcustomers.ts +83 -0
  201. package/src/models/operations/index.ts +5 -0
  202. package/src/models/operations/tracklead.ts +17 -8
  203. package/src/models/operations/tracksale.ts +17 -4
  204. package/src/models/operations/updatecustomer.ts +207 -0
  205. package/src/sdk/customers.ts +99 -0
  206. package/src/sdk/sdk.ts +16 -10
  207. package/src/sdk/track.ts +2 -0
@@ -0,0 +1,129 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export type GetCustomerRequest = {
8
+ /**
9
+ * The unique identifier of the customer in Dub.
10
+ */
11
+ id: string;
12
+ };
13
+
14
+ /**
15
+ * The customer object.
16
+ */
17
+ export type GetCustomerResponseBody = {
18
+ /**
19
+ * The unique identifier of the customer in Dub.
20
+ */
21
+ id: string;
22
+ /**
23
+ * Unique identifier for the customer in the client's app.
24
+ */
25
+ externalId: string;
26
+ /**
27
+ * Name of the customer.
28
+ */
29
+ name: string;
30
+ /**
31
+ * Email of the customer.
32
+ */
33
+ email?: string | null | undefined;
34
+ /**
35
+ * Avatar URL of the customer.
36
+ */
37
+ avatar?: string | null | undefined;
38
+ /**
39
+ * The date the customer was created.
40
+ */
41
+ createdAt: string;
42
+ };
43
+
44
+ /** @internal */
45
+ export const GetCustomerRequest$inboundSchema: z.ZodType<
46
+ GetCustomerRequest,
47
+ z.ZodTypeDef,
48
+ unknown
49
+ > = z.object({
50
+ id: z.string(),
51
+ });
52
+
53
+ /** @internal */
54
+ export type GetCustomerRequest$Outbound = {
55
+ id: string;
56
+ };
57
+
58
+ /** @internal */
59
+ export const GetCustomerRequest$outboundSchema: z.ZodType<
60
+ GetCustomerRequest$Outbound,
61
+ z.ZodTypeDef,
62
+ GetCustomerRequest
63
+ > = z.object({
64
+ id: z.string(),
65
+ });
66
+
67
+ /**
68
+ * @internal
69
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
70
+ */
71
+ export namespace GetCustomerRequest$ {
72
+ /** @deprecated use `GetCustomerRequest$inboundSchema` instead. */
73
+ export const inboundSchema = GetCustomerRequest$inboundSchema;
74
+ /** @deprecated use `GetCustomerRequest$outboundSchema` instead. */
75
+ export const outboundSchema = GetCustomerRequest$outboundSchema;
76
+ /** @deprecated use `GetCustomerRequest$Outbound` instead. */
77
+ export type Outbound = GetCustomerRequest$Outbound;
78
+ }
79
+
80
+ /** @internal */
81
+ export const GetCustomerResponseBody$inboundSchema: z.ZodType<
82
+ GetCustomerResponseBody,
83
+ z.ZodTypeDef,
84
+ unknown
85
+ > = z.object({
86
+ id: z.string(),
87
+ externalId: z.string(),
88
+ name: z.string(),
89
+ email: z.nullable(z.string()).optional(),
90
+ avatar: z.nullable(z.string()).optional(),
91
+ createdAt: z.string(),
92
+ });
93
+
94
+ /** @internal */
95
+ export type GetCustomerResponseBody$Outbound = {
96
+ id: string;
97
+ externalId: string;
98
+ name: string;
99
+ email?: string | null | undefined;
100
+ avatar?: string | null | undefined;
101
+ createdAt: string;
102
+ };
103
+
104
+ /** @internal */
105
+ export const GetCustomerResponseBody$outboundSchema: z.ZodType<
106
+ GetCustomerResponseBody$Outbound,
107
+ z.ZodTypeDef,
108
+ GetCustomerResponseBody
109
+ > = z.object({
110
+ id: z.string(),
111
+ externalId: z.string(),
112
+ name: z.string(),
113
+ email: z.nullable(z.string()).optional(),
114
+ avatar: z.nullable(z.string()).optional(),
115
+ createdAt: z.string(),
116
+ });
117
+
118
+ /**
119
+ * @internal
120
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
121
+ */
122
+ export namespace GetCustomerResponseBody$ {
123
+ /** @deprecated use `GetCustomerResponseBody$inboundSchema` instead. */
124
+ export const inboundSchema = GetCustomerResponseBody$inboundSchema;
125
+ /** @deprecated use `GetCustomerResponseBody$outboundSchema` instead. */
126
+ export const outboundSchema = GetCustomerResponseBody$outboundSchema;
127
+ /** @deprecated use `GetCustomerResponseBody$Outbound` instead. */
128
+ export type Outbound = GetCustomerResponseBody$Outbound;
129
+ }
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export type ResponseBody = {
8
+ /**
9
+ * The unique identifier of the customer in Dub.
10
+ */
11
+ id: string;
12
+ /**
13
+ * Unique identifier for the customer in the client's app.
14
+ */
15
+ externalId: string;
16
+ /**
17
+ * Name of the customer.
18
+ */
19
+ name: string;
20
+ /**
21
+ * Email of the customer.
22
+ */
23
+ email?: string | null | undefined;
24
+ /**
25
+ * Avatar URL of the customer.
26
+ */
27
+ avatar?: string | null | undefined;
28
+ /**
29
+ * The date the customer was created.
30
+ */
31
+ createdAt: string;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ResponseBody$inboundSchema: z.ZodType<
36
+ ResponseBody,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ id: z.string(),
41
+ externalId: z.string(),
42
+ name: z.string(),
43
+ email: z.nullable(z.string()).optional(),
44
+ avatar: z.nullable(z.string()).optional(),
45
+ createdAt: z.string(),
46
+ });
47
+
48
+ /** @internal */
49
+ export type ResponseBody$Outbound = {
50
+ id: string;
51
+ externalId: string;
52
+ name: string;
53
+ email?: string | null | undefined;
54
+ avatar?: string | null | undefined;
55
+ createdAt: string;
56
+ };
57
+
58
+ /** @internal */
59
+ export const ResponseBody$outboundSchema: z.ZodType<
60
+ ResponseBody$Outbound,
61
+ z.ZodTypeDef,
62
+ ResponseBody
63
+ > = z.object({
64
+ id: z.string(),
65
+ externalId: z.string(),
66
+ name: z.string(),
67
+ email: z.nullable(z.string()).optional(),
68
+ avatar: z.nullable(z.string()).optional(),
69
+ createdAt: z.string(),
70
+ });
71
+
72
+ /**
73
+ * @internal
74
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
+ */
76
+ export namespace ResponseBody$ {
77
+ /** @deprecated use `ResponseBody$inboundSchema` instead. */
78
+ export const inboundSchema = ResponseBody$inboundSchema;
79
+ /** @deprecated use `ResponseBody$outboundSchema` instead. */
80
+ export const outboundSchema = ResponseBody$outboundSchema;
81
+ /** @deprecated use `ResponseBody$Outbound` instead. */
82
+ export type Outbound = ResponseBody$Outbound;
83
+ }
@@ -5,12 +5,16 @@
5
5
  export * from "./bulkcreatelinks.js";
6
6
  export * from "./bulkdeletelinks.js";
7
7
  export * from "./bulkupdatelinks.js";
8
+ export * from "./createcustomer.js";
8
9
  export * from "./createdomain.js";
9
10
  export * from "./createlink.js";
10
11
  export * from "./createtag.js";
12
+ export * from "./deletecustomer.js";
11
13
  export * from "./deletedomain.js";
12
14
  export * from "./deletelink.js";
13
15
  export * from "./deletetag.js";
16
+ export * from "./getcustomer.js";
17
+ export * from "./getcustomers.js";
14
18
  export * from "./getlinkinfo.js";
15
19
  export * from "./getlinks.js";
16
20
  export * from "./getlinkscount.js";
@@ -23,6 +27,7 @@ export * from "./retrieveanalytics.js";
23
27
  export * from "./trackcustomer.js";
24
28
  export * from "./tracklead.js";
25
29
  export * from "./tracksale.js";
30
+ export * from "./updatecustomer.js";
26
31
  export * from "./updatedomain.js";
27
32
  export * from "./updatelink.js";
28
33
  export * from "./updatetag.js";
@@ -16,7 +16,13 @@ export type TrackLeadRequestBody = {
16
16
  /**
17
17
  * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.
18
18
  */
19
- customerId: string;
19
+ externalId?: string | undefined;
20
+ /**
21
+ * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.
22
+ *
23
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
24
+ */
25
+ customerId?: string | null | undefined;
20
26
  /**
21
27
  * Name of the customer in the client's app.
22
28
  */
@@ -40,10 +46,10 @@ export type Click = {
40
46
  };
41
47
 
42
48
  export type Customer = {
43
- id: string;
44
49
  name: string | null;
45
50
  email: string | null;
46
51
  avatar: string | null;
52
+ externalId: string | null;
47
53
  };
48
54
 
49
55
  /**
@@ -62,7 +68,8 @@ export const TrackLeadRequestBody$inboundSchema: z.ZodType<
62
68
  > = z.object({
63
69
  clickId: z.string(),
64
70
  eventName: z.string(),
65
- customerId: z.string(),
71
+ externalId: z.string().default(""),
72
+ customerId: z.nullable(z.string()).default(null),
66
73
  customerName: z.nullable(z.string()).default(null),
67
74
  customerEmail: z.nullable(z.string()).default(null),
68
75
  customerAvatar: z.nullable(z.string()).default(null),
@@ -73,7 +80,8 @@ export const TrackLeadRequestBody$inboundSchema: z.ZodType<
73
80
  export type TrackLeadRequestBody$Outbound = {
74
81
  clickId: string;
75
82
  eventName: string;
76
- customerId: string;
83
+ externalId: string;
84
+ customerId: string | null;
77
85
  customerName: string | null;
78
86
  customerEmail: string | null;
79
87
  customerAvatar: string | null;
@@ -88,7 +96,8 @@ export const TrackLeadRequestBody$outboundSchema: z.ZodType<
88
96
  > = z.object({
89
97
  clickId: z.string(),
90
98
  eventName: z.string(),
91
- customerId: z.string(),
99
+ externalId: z.string().default(""),
100
+ customerId: z.nullable(z.string()).default(null),
92
101
  customerName: z.nullable(z.string()).default(null),
93
102
  customerEmail: z.nullable(z.string()).default(null),
94
103
  customerAvatar: z.nullable(z.string()).default(null),
@@ -147,18 +156,18 @@ export const Customer$inboundSchema: z.ZodType<
147
156
  z.ZodTypeDef,
148
157
  unknown
149
158
  > = z.object({
150
- id: z.string(),
151
159
  name: z.nullable(z.string()),
152
160
  email: z.nullable(z.string()),
153
161
  avatar: z.nullable(z.string()),
162
+ externalId: z.nullable(z.string()),
154
163
  });
155
164
 
156
165
  /** @internal */
157
166
  export type Customer$Outbound = {
158
- id: string;
159
167
  name: string | null;
160
168
  email: string | null;
161
169
  avatar: string | null;
170
+ externalId: string | null;
162
171
  };
163
172
 
164
173
  /** @internal */
@@ -167,10 +176,10 @@ export const Customer$outboundSchema: z.ZodType<
167
176
  z.ZodTypeDef,
168
177
  Customer
169
178
  > = z.object({
170
- id: z.string(),
171
179
  name: z.nullable(z.string()),
172
180
  email: z.nullable(z.string()),
173
181
  avatar: z.nullable(z.string()),
182
+ externalId: z.nullable(z.string()),
174
183
  });
175
184
 
176
185
  /**
@@ -22,7 +22,13 @@ export type TrackSaleRequestBody = {
22
22
  /**
23
23
  * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.
24
24
  */
25
- customerId: string;
25
+ externalId?: string | undefined;
26
+ /**
27
+ * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey.
28
+ *
29
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
30
+ */
31
+ customerId?: string | null | undefined;
26
32
  /**
27
33
  * The amount of the sale. Should be passed in cents.
28
34
  */
@@ -54,6 +60,7 @@ export type TrackSaleCustomer = {
54
60
  name: string | null;
55
61
  email: string | null;
56
62
  avatar: string | null;
63
+ externalId: string | null;
57
64
  };
58
65
 
59
66
  export type Sale = {
@@ -100,7 +107,8 @@ export const TrackSaleRequestBody$inboundSchema: z.ZodType<
100
107
  z.ZodTypeDef,
101
108
  unknown
102
109
  > = z.object({
103
- customerId: z.string(),
110
+ externalId: z.string().default(""),
111
+ customerId: z.nullable(z.string()).default(null),
104
112
  amount: z.number().int(),
105
113
  paymentProcessor: PaymentProcessor$inboundSchema,
106
114
  eventName: z.string().default("Purchase"),
@@ -111,7 +119,8 @@ export const TrackSaleRequestBody$inboundSchema: z.ZodType<
111
119
 
112
120
  /** @internal */
113
121
  export type TrackSaleRequestBody$Outbound = {
114
- customerId: string;
122
+ externalId: string;
123
+ customerId: string | null;
115
124
  amount: number;
116
125
  paymentProcessor: string;
117
126
  eventName: string;
@@ -126,7 +135,8 @@ export const TrackSaleRequestBody$outboundSchema: z.ZodType<
126
135
  z.ZodTypeDef,
127
136
  TrackSaleRequestBody
128
137
  > = z.object({
129
- customerId: z.string(),
138
+ externalId: z.string().default(""),
139
+ customerId: z.nullable(z.string()).default(null),
130
140
  amount: z.number().int(),
131
141
  paymentProcessor: PaymentProcessor$outboundSchema,
132
142
  eventName: z.string().default("Purchase"),
@@ -158,6 +168,7 @@ export const TrackSaleCustomer$inboundSchema: z.ZodType<
158
168
  name: z.nullable(z.string()),
159
169
  email: z.nullable(z.string()),
160
170
  avatar: z.nullable(z.string()),
171
+ externalId: z.nullable(z.string()),
161
172
  });
162
173
 
163
174
  /** @internal */
@@ -166,6 +177,7 @@ export type TrackSaleCustomer$Outbound = {
166
177
  name: string | null;
167
178
  email: string | null;
168
179
  avatar: string | null;
180
+ externalId: string | null;
169
181
  };
170
182
 
171
183
  /** @internal */
@@ -178,6 +190,7 @@ export const TrackSaleCustomer$outboundSchema: z.ZodType<
178
190
  name: z.nullable(z.string()),
179
191
  email: z.nullable(z.string()),
180
192
  avatar: z.nullable(z.string()),
193
+ externalId: z.nullable(z.string()),
181
194
  });
182
195
 
183
196
  /**
@@ -0,0 +1,207 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+
8
+ export type UpdateCustomerRequestBody = {
9
+ /**
10
+ * Email of the customer in the client's app.
11
+ */
12
+ email?: string | null | undefined;
13
+ /**
14
+ * Name of the customer in the client's app. If not provided, a random name will be generated.
15
+ */
16
+ name?: string | null | undefined;
17
+ /**
18
+ * Avatar URL of the customer in the client's app.
19
+ */
20
+ avatar?: string | null | undefined;
21
+ /**
22
+ * Unique identifier for the customer in the client's app.
23
+ */
24
+ externalId?: string | undefined;
25
+ };
26
+
27
+ export type UpdateCustomerRequest = {
28
+ /**
29
+ * The unique identifier of the customer in Dub.
30
+ */
31
+ id: string;
32
+ requestBody?: UpdateCustomerRequestBody | undefined;
33
+ };
34
+
35
+ /**
36
+ * The customer was updated.
37
+ */
38
+ export type UpdateCustomerResponseBody = {
39
+ /**
40
+ * The unique identifier of the customer in Dub.
41
+ */
42
+ id: string;
43
+ /**
44
+ * Unique identifier for the customer in the client's app.
45
+ */
46
+ externalId: string;
47
+ /**
48
+ * Name of the customer.
49
+ */
50
+ name: string;
51
+ /**
52
+ * Email of the customer.
53
+ */
54
+ email?: string | null | undefined;
55
+ /**
56
+ * Avatar URL of the customer.
57
+ */
58
+ avatar?: string | null | undefined;
59
+ /**
60
+ * The date the customer was created.
61
+ */
62
+ createdAt: string;
63
+ };
64
+
65
+ /** @internal */
66
+ export const UpdateCustomerRequestBody$inboundSchema: z.ZodType<
67
+ UpdateCustomerRequestBody,
68
+ z.ZodTypeDef,
69
+ unknown
70
+ > = z.object({
71
+ email: z.nullable(z.string()).optional(),
72
+ name: z.nullable(z.string()).optional(),
73
+ avatar: z.nullable(z.string()).optional(),
74
+ externalId: z.string().optional(),
75
+ });
76
+
77
+ /** @internal */
78
+ export type UpdateCustomerRequestBody$Outbound = {
79
+ email?: string | null | undefined;
80
+ name?: string | null | undefined;
81
+ avatar?: string | null | undefined;
82
+ externalId?: string | undefined;
83
+ };
84
+
85
+ /** @internal */
86
+ export const UpdateCustomerRequestBody$outboundSchema: z.ZodType<
87
+ UpdateCustomerRequestBody$Outbound,
88
+ z.ZodTypeDef,
89
+ UpdateCustomerRequestBody
90
+ > = z.object({
91
+ email: z.nullable(z.string()).optional(),
92
+ name: z.nullable(z.string()).optional(),
93
+ avatar: z.nullable(z.string()).optional(),
94
+ externalId: z.string().optional(),
95
+ });
96
+
97
+ /**
98
+ * @internal
99
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
100
+ */
101
+ export namespace UpdateCustomerRequestBody$ {
102
+ /** @deprecated use `UpdateCustomerRequestBody$inboundSchema` instead. */
103
+ export const inboundSchema = UpdateCustomerRequestBody$inboundSchema;
104
+ /** @deprecated use `UpdateCustomerRequestBody$outboundSchema` instead. */
105
+ export const outboundSchema = UpdateCustomerRequestBody$outboundSchema;
106
+ /** @deprecated use `UpdateCustomerRequestBody$Outbound` instead. */
107
+ export type Outbound = UpdateCustomerRequestBody$Outbound;
108
+ }
109
+
110
+ /** @internal */
111
+ export const UpdateCustomerRequest$inboundSchema: z.ZodType<
112
+ UpdateCustomerRequest,
113
+ z.ZodTypeDef,
114
+ unknown
115
+ > = z.object({
116
+ id: z.string(),
117
+ RequestBody: z.lazy(() => UpdateCustomerRequestBody$inboundSchema).optional(),
118
+ }).transform((v) => {
119
+ return remap$(v, {
120
+ "RequestBody": "requestBody",
121
+ });
122
+ });
123
+
124
+ /** @internal */
125
+ export type UpdateCustomerRequest$Outbound = {
126
+ id: string;
127
+ RequestBody?: UpdateCustomerRequestBody$Outbound | undefined;
128
+ };
129
+
130
+ /** @internal */
131
+ export const UpdateCustomerRequest$outboundSchema: z.ZodType<
132
+ UpdateCustomerRequest$Outbound,
133
+ z.ZodTypeDef,
134
+ UpdateCustomerRequest
135
+ > = z.object({
136
+ id: z.string(),
137
+ requestBody: z.lazy(() => UpdateCustomerRequestBody$outboundSchema)
138
+ .optional(),
139
+ }).transform((v) => {
140
+ return remap$(v, {
141
+ requestBody: "RequestBody",
142
+ });
143
+ });
144
+
145
+ /**
146
+ * @internal
147
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
148
+ */
149
+ export namespace UpdateCustomerRequest$ {
150
+ /** @deprecated use `UpdateCustomerRequest$inboundSchema` instead. */
151
+ export const inboundSchema = UpdateCustomerRequest$inboundSchema;
152
+ /** @deprecated use `UpdateCustomerRequest$outboundSchema` instead. */
153
+ export const outboundSchema = UpdateCustomerRequest$outboundSchema;
154
+ /** @deprecated use `UpdateCustomerRequest$Outbound` instead. */
155
+ export type Outbound = UpdateCustomerRequest$Outbound;
156
+ }
157
+
158
+ /** @internal */
159
+ export const UpdateCustomerResponseBody$inboundSchema: z.ZodType<
160
+ UpdateCustomerResponseBody,
161
+ z.ZodTypeDef,
162
+ unknown
163
+ > = z.object({
164
+ id: z.string(),
165
+ externalId: z.string(),
166
+ name: z.string(),
167
+ email: z.nullable(z.string()).optional(),
168
+ avatar: z.nullable(z.string()).optional(),
169
+ createdAt: z.string(),
170
+ });
171
+
172
+ /** @internal */
173
+ export type UpdateCustomerResponseBody$Outbound = {
174
+ id: string;
175
+ externalId: string;
176
+ name: string;
177
+ email?: string | null | undefined;
178
+ avatar?: string | null | undefined;
179
+ createdAt: string;
180
+ };
181
+
182
+ /** @internal */
183
+ export const UpdateCustomerResponseBody$outboundSchema: z.ZodType<
184
+ UpdateCustomerResponseBody$Outbound,
185
+ z.ZodTypeDef,
186
+ UpdateCustomerResponseBody
187
+ > = z.object({
188
+ id: z.string(),
189
+ externalId: z.string(),
190
+ name: z.string(),
191
+ email: z.nullable(z.string()).optional(),
192
+ avatar: z.nullable(z.string()).optional(),
193
+ createdAt: z.string(),
194
+ });
195
+
196
+ /**
197
+ * @internal
198
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
199
+ */
200
+ export namespace UpdateCustomerResponseBody$ {
201
+ /** @deprecated use `UpdateCustomerResponseBody$inboundSchema` instead. */
202
+ export const inboundSchema = UpdateCustomerResponseBody$inboundSchema;
203
+ /** @deprecated use `UpdateCustomerResponseBody$outboundSchema` instead. */
204
+ export const outboundSchema = UpdateCustomerResponseBody$outboundSchema;
205
+ /** @deprecated use `UpdateCustomerResponseBody$Outbound` instead. */
206
+ export type Outbound = UpdateCustomerResponseBody$Outbound;
207
+ }
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { customersCreate } from "../funcs/customersCreate.js";
6
+ import { customersDelete } from "../funcs/customersDelete.js";
7
+ import { customersGet } from "../funcs/customersGet.js";
8
+ import { customersList } from "../funcs/customersList.js";
9
+ import { customersUpdate } from "../funcs/customersUpdate.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as operations from "../models/operations/index.js";
12
+ import { unwrapAsync } from "../types/fp.js";
13
+
14
+ export class Customers extends ClientSDK {
15
+ /**
16
+ * Retrieve a list of customers
17
+ *
18
+ * @remarks
19
+ * Retrieve a list of customers for the authenticated workspace.
20
+ */
21
+ async list(
22
+ options?: RequestOptions,
23
+ ): Promise<Array<operations.ResponseBody>> {
24
+ return unwrapAsync(customersList(
25
+ this,
26
+ options,
27
+ ));
28
+ }
29
+
30
+ /**
31
+ * Create a customer
32
+ *
33
+ * @remarks
34
+ * Create a customer for the authenticated workspace.
35
+ */
36
+ async create(
37
+ request?: operations.CreateCustomerRequestBody | undefined,
38
+ options?: RequestOptions,
39
+ ): Promise<operations.CreateCustomerResponseBody> {
40
+ return unwrapAsync(customersCreate(
41
+ this,
42
+ request,
43
+ options,
44
+ ));
45
+ }
46
+
47
+ /**
48
+ * Retrieve a customer
49
+ *
50
+ * @remarks
51
+ * Retrieve a customer by ID for the authenticated workspace.
52
+ */
53
+ async get(
54
+ request: operations.GetCustomerRequest,
55
+ options?: RequestOptions,
56
+ ): Promise<operations.GetCustomerResponseBody> {
57
+ return unwrapAsync(customersGet(
58
+ this,
59
+ request,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ /**
65
+ * Update a customer
66
+ *
67
+ * @remarks
68
+ * Update a customer for the authenticated workspace.
69
+ */
70
+ async update(
71
+ id: string,
72
+ requestBody?: operations.UpdateCustomerRequestBody | undefined,
73
+ options?: RequestOptions,
74
+ ): Promise<operations.UpdateCustomerResponseBody> {
75
+ return unwrapAsync(customersUpdate(
76
+ this,
77
+ id,
78
+ requestBody,
79
+ options,
80
+ ));
81
+ }
82
+
83
+ /**
84
+ * Delete a customer
85
+ *
86
+ * @remarks
87
+ * Delete a customer from a workspace.
88
+ */
89
+ async delete(
90
+ id: string,
91
+ options?: RequestOptions,
92
+ ): Promise<operations.DeleteCustomerResponseBody> {
93
+ return unwrapAsync(customersDelete(
94
+ this,
95
+ id,
96
+ options,
97
+ ));
98
+ }
99
+ }