dub 0.57.2 → 0.58.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 (186) hide show
  1. package/README.md +4 -2
  2. package/bin/mcp-server.js +936 -382
  3. package/bin/mcp-server.js.map +20 -17
  4. package/dist/commonjs/funcs/embedTokensReferrals.d.ts +17 -0
  5. package/dist/commonjs/funcs/embedTokensReferrals.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/{embedTokensCreate.js → embedTokensReferrals.js} +11 -10
  7. package/dist/commonjs/funcs/embedTokensReferrals.js.map +1 -0
  8. package/dist/commonjs/funcs/partnersUpdateSale.d.ts +17 -0
  9. package/dist/commonjs/funcs/partnersUpdateSale.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/partnersUpdateSale.js +121 -0
  11. package/dist/commonjs/funcs/partnersUpdateSale.js.map +1 -0
  12. package/dist/commonjs/lib/config.d.ts +3 -3
  13. package/dist/commonjs/lib/config.js +3 -3
  14. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  15. package/dist/commonjs/mcp-server/cli/start/command.js +9 -0
  16. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  17. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +1 -0
  18. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  19. package/dist/commonjs/mcp-server/cli/start/impl.js +2 -0
  20. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  21. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  22. package/dist/commonjs/mcp-server/server.d.ts +1 -0
  23. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  24. package/dist/commonjs/mcp-server/server.js +7 -4
  25. package/dist/commonjs/mcp-server/server.js.map +1 -1
  26. package/dist/commonjs/mcp-server/tools/embedTokensReferrals.d.ts +8 -0
  27. package/dist/commonjs/mcp-server/tools/embedTokensReferrals.d.ts.map +1 -0
  28. package/dist/commonjs/mcp-server/tools/{embedTokensCreate.js → embedTokensReferrals.js} +10 -9
  29. package/dist/commonjs/mcp-server/tools/embedTokensReferrals.js.map +1 -0
  30. package/dist/commonjs/mcp-server/tools/{embedTokensCreate.d.ts → partnersUpdateSale.d.ts} +3 -3
  31. package/dist/commonjs/mcp-server/tools/partnersUpdateSale.d.ts.map +1 -0
  32. package/dist/commonjs/mcp-server/tools/partnersUpdateSale.js +54 -0
  33. package/dist/commonjs/mcp-server/tools/partnersUpdateSale.js.map +1 -0
  34. package/dist/commonjs/mcp-server/tools.d.ts +1 -1
  35. package/dist/commonjs/mcp-server/tools.d.ts.map +1 -1
  36. package/dist/commonjs/mcp-server/tools.js +4 -1
  37. package/dist/commonjs/mcp-server/tools.js.map +1 -1
  38. package/dist/commonjs/models/operations/createpartner.d.ts +3 -8
  39. package/dist/commonjs/models/operations/createpartner.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/createpartner.js +2 -4
  41. package/dist/commonjs/models/operations/createpartner.js.map +1 -1
  42. package/dist/commonjs/models/operations/createpartnerlink.d.ts +0 -5
  43. package/dist/commonjs/models/operations/createpartnerlink.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/createpartnerlink.js +0 -2
  45. package/dist/commonjs/models/operations/createpartnerlink.js.map +1 -1
  46. package/dist/commonjs/models/operations/createreferralsembedtoken.d.ts +1108 -0
  47. package/dist/commonjs/models/operations/createreferralsembedtoken.d.ts.map +1 -0
  48. package/dist/commonjs/models/operations/createreferralsembedtoken.js +549 -0
  49. package/dist/commonjs/models/operations/createreferralsembedtoken.js.map +1 -0
  50. package/dist/commonjs/models/operations/getcustomers.d.ts +15 -15
  51. package/dist/commonjs/models/operations/getcustomers.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/getcustomers.js +20 -18
  53. package/dist/commonjs/models/operations/getcustomers.js.map +1 -1
  54. package/dist/commonjs/models/operations/index.d.ts +2 -1
  55. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  56. package/dist/commonjs/models/operations/index.js +2 -1
  57. package/dist/commonjs/models/operations/index.js.map +1 -1
  58. package/dist/commonjs/models/operations/updatepartnersale.d.ts +114 -0
  59. package/dist/commonjs/models/operations/updatepartnersale.d.ts.map +1 -0
  60. package/dist/commonjs/models/operations/updatepartnersale.js +125 -0
  61. package/dist/commonjs/models/operations/updatepartnersale.js.map +1 -0
  62. package/dist/commonjs/models/operations/upsertpartnerlink.d.ts +0 -5
  63. package/dist/commonjs/models/operations/upsertpartnerlink.d.ts.map +1 -1
  64. package/dist/commonjs/models/operations/upsertpartnerlink.js +0 -2
  65. package/dist/commonjs/models/operations/upsertpartnerlink.js.map +1 -1
  66. package/dist/commonjs/sdk/embedtokens.d.ts +3 -3
  67. package/dist/commonjs/sdk/embedtokens.d.ts.map +1 -1
  68. package/dist/commonjs/sdk/embedtokens.js +5 -5
  69. package/dist/commonjs/sdk/embedtokens.js.map +1 -1
  70. package/dist/commonjs/sdk/partners.d.ts +7 -0
  71. package/dist/commonjs/sdk/partners.d.ts.map +1 -1
  72. package/dist/commonjs/sdk/partners.js +10 -0
  73. package/dist/commonjs/sdk/partners.js.map +1 -1
  74. package/dist/esm/funcs/embedTokensReferrals.d.ts +17 -0
  75. package/dist/esm/funcs/embedTokensReferrals.d.ts.map +1 -0
  76. package/dist/esm/funcs/{embedTokensCreate.js → embedTokensReferrals.js} +9 -8
  77. package/dist/esm/funcs/embedTokensReferrals.js.map +1 -0
  78. package/dist/esm/funcs/partnersUpdateSale.d.ts +17 -0
  79. package/dist/esm/funcs/partnersUpdateSale.d.ts.map +1 -0
  80. package/dist/esm/funcs/partnersUpdateSale.js +94 -0
  81. package/dist/esm/funcs/partnersUpdateSale.js.map +1 -0
  82. package/dist/esm/lib/config.d.ts +3 -3
  83. package/dist/esm/lib/config.js +3 -3
  84. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  85. package/dist/esm/mcp-server/cli/start/command.js +9 -0
  86. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  87. package/dist/esm/mcp-server/cli/start/impl.d.ts +1 -0
  88. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  89. package/dist/esm/mcp-server/cli/start/impl.js +2 -0
  90. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  91. package/dist/esm/mcp-server/mcp-server.js +1 -1
  92. package/dist/esm/mcp-server/server.d.ts +1 -0
  93. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  94. package/dist/esm/mcp-server/server.js +7 -4
  95. package/dist/esm/mcp-server/server.js.map +1 -1
  96. package/dist/esm/mcp-server/tools/embedTokensReferrals.d.ts +8 -0
  97. package/dist/esm/mcp-server/tools/embedTokensReferrals.d.ts.map +1 -0
  98. package/dist/esm/mcp-server/tools/embedTokensReferrals.js +29 -0
  99. package/dist/esm/mcp-server/tools/embedTokensReferrals.js.map +1 -0
  100. package/dist/esm/mcp-server/tools/{embedTokensCreate.d.ts → partnersUpdateSale.d.ts} +3 -3
  101. package/dist/esm/mcp-server/tools/partnersUpdateSale.d.ts.map +1 -0
  102. package/dist/esm/mcp-server/tools/partnersUpdateSale.js +28 -0
  103. package/dist/esm/mcp-server/tools/partnersUpdateSale.js.map +1 -0
  104. package/dist/esm/mcp-server/tools.d.ts +1 -1
  105. package/dist/esm/mcp-server/tools.d.ts.map +1 -1
  106. package/dist/esm/mcp-server/tools.js +4 -1
  107. package/dist/esm/mcp-server/tools.js.map +1 -1
  108. package/dist/esm/models/operations/createpartner.d.ts +3 -8
  109. package/dist/esm/models/operations/createpartner.d.ts.map +1 -1
  110. package/dist/esm/models/operations/createpartner.js +2 -4
  111. package/dist/esm/models/operations/createpartner.js.map +1 -1
  112. package/dist/esm/models/operations/createpartnerlink.d.ts +0 -5
  113. package/dist/esm/models/operations/createpartnerlink.d.ts.map +1 -1
  114. package/dist/esm/models/operations/createpartnerlink.js +0 -2
  115. package/dist/esm/models/operations/createpartnerlink.js.map +1 -1
  116. package/dist/esm/models/operations/createreferralsembedtoken.d.ts +1108 -0
  117. package/dist/esm/models/operations/createreferralsembedtoken.d.ts.map +1 -0
  118. package/dist/esm/models/operations/createreferralsembedtoken.js +511 -0
  119. package/dist/esm/models/operations/createreferralsembedtoken.js.map +1 -0
  120. package/dist/esm/models/operations/getcustomers.d.ts +15 -15
  121. package/dist/esm/models/operations/getcustomers.d.ts.map +1 -1
  122. package/dist/esm/models/operations/getcustomers.js +17 -15
  123. package/dist/esm/models/operations/getcustomers.js.map +1 -1
  124. package/dist/esm/models/operations/index.d.ts +2 -1
  125. package/dist/esm/models/operations/index.d.ts.map +1 -1
  126. package/dist/esm/models/operations/index.js +2 -1
  127. package/dist/esm/models/operations/index.js.map +1 -1
  128. package/dist/esm/models/operations/updatepartnersale.d.ts +114 -0
  129. package/dist/esm/models/operations/updatepartnersale.d.ts.map +1 -0
  130. package/dist/esm/models/operations/updatepartnersale.js +95 -0
  131. package/dist/esm/models/operations/updatepartnersale.js.map +1 -0
  132. package/dist/esm/models/operations/upsertpartnerlink.d.ts +0 -5
  133. package/dist/esm/models/operations/upsertpartnerlink.d.ts.map +1 -1
  134. package/dist/esm/models/operations/upsertpartnerlink.js +0 -2
  135. package/dist/esm/models/operations/upsertpartnerlink.js.map +1 -1
  136. package/dist/esm/sdk/embedtokens.d.ts +3 -3
  137. package/dist/esm/sdk/embedtokens.d.ts.map +1 -1
  138. package/dist/esm/sdk/embedtokens.js +5 -5
  139. package/dist/esm/sdk/embedtokens.js.map +1 -1
  140. package/dist/esm/sdk/partners.d.ts +7 -0
  141. package/dist/esm/sdk/partners.d.ts.map +1 -1
  142. package/dist/esm/sdk/partners.js +10 -0
  143. package/dist/esm/sdk/partners.js.map +1 -1
  144. package/docs/sdks/embedtokens/README.md +8 -8
  145. package/docs/sdks/partners/README.md +82 -0
  146. package/jsr.json +1 -1
  147. package/package.json +1 -1
  148. package/src/funcs/embedTokensReferrals.ts +211 -0
  149. package/src/funcs/{embedTokensCreate.ts → partnersUpdateSale.ts} +13 -13
  150. package/src/lib/config.ts +3 -3
  151. package/src/mcp-server/cli/start/command.ts +9 -0
  152. package/src/mcp-server/cli/start/impl.ts +3 -0
  153. package/src/mcp-server/mcp-server.ts +1 -1
  154. package/src/mcp-server/server.ts +14 -4
  155. package/src/mcp-server/tools/{embedTokensCreate.ts → embedTokensReferrals.ts} +8 -7
  156. package/src/mcp-server/tools/partnersUpdateSale.ts +37 -0
  157. package/src/mcp-server/tools.ts +5 -0
  158. package/src/models/operations/createpartner.ts +5 -12
  159. package/src/models/operations/createpartnerlink.ts +0 -7
  160. package/src/models/operations/createreferralsembedtoken.ts +915 -0
  161. package/src/models/operations/getcustomers.ts +38 -29
  162. package/src/models/operations/index.ts +2 -1
  163. package/src/models/operations/updatepartnersale.ts +200 -0
  164. package/src/models/operations/upsertpartnerlink.ts +0 -7
  165. package/src/sdk/embedtokens.ts +7 -7
  166. package/src/sdk/partners.ts +18 -0
  167. package/dist/commonjs/funcs/embedTokensCreate.d.ts +0 -17
  168. package/dist/commonjs/funcs/embedTokensCreate.d.ts.map +0 -1
  169. package/dist/commonjs/funcs/embedTokensCreate.js.map +0 -1
  170. package/dist/commonjs/mcp-server/tools/embedTokensCreate.d.ts.map +0 -1
  171. package/dist/commonjs/mcp-server/tools/embedTokensCreate.js.map +0 -1
  172. package/dist/commonjs/models/operations/createembedtoken.d.ts +0 -63
  173. package/dist/commonjs/models/operations/createembedtoken.d.ts.map +0 -1
  174. package/dist/commonjs/models/operations/createembedtoken.js +0 -92
  175. package/dist/commonjs/models/operations/createembedtoken.js.map +0 -1
  176. package/dist/esm/funcs/embedTokensCreate.d.ts +0 -17
  177. package/dist/esm/funcs/embedTokensCreate.d.ts.map +0 -1
  178. package/dist/esm/funcs/embedTokensCreate.js.map +0 -1
  179. package/dist/esm/mcp-server/tools/embedTokensCreate.d.ts.map +0 -1
  180. package/dist/esm/mcp-server/tools/embedTokensCreate.js +0 -28
  181. package/dist/esm/mcp-server/tools/embedTokensCreate.js.map +0 -1
  182. package/dist/esm/models/operations/createembedtoken.d.ts +0 -63
  183. package/dist/esm/models/operations/createembedtoken.d.ts.map +0 -1
  184. package/dist/esm/models/operations/createembedtoken.js +0 -62
  185. package/dist/esm/models/operations/createembedtoken.js.map +0 -1
  186. package/src/models/operations/createembedtoken.ts +0 -143
@@ -0,0 +1,915 @@
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
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * Country where the partner is based.
14
+ */
15
+ export const CreateReferralsEmbedTokenCountry = {
16
+ Af: "AF",
17
+ Al: "AL",
18
+ Dz: "DZ",
19
+ As: "AS",
20
+ Ad: "AD",
21
+ Ao: "AO",
22
+ Ai: "AI",
23
+ Aq: "AQ",
24
+ Ag: "AG",
25
+ Ar: "AR",
26
+ Am: "AM",
27
+ Aw: "AW",
28
+ Au: "AU",
29
+ At: "AT",
30
+ Az: "AZ",
31
+ Bs: "BS",
32
+ Bh: "BH",
33
+ Bd: "BD",
34
+ Bb: "BB",
35
+ By: "BY",
36
+ Be: "BE",
37
+ Bz: "BZ",
38
+ Bj: "BJ",
39
+ Bm: "BM",
40
+ Bt: "BT",
41
+ Bo: "BO",
42
+ Ba: "BA",
43
+ Bw: "BW",
44
+ Bv: "BV",
45
+ Br: "BR",
46
+ Io: "IO",
47
+ Bn: "BN",
48
+ Bg: "BG",
49
+ Bf: "BF",
50
+ Bi: "BI",
51
+ Kh: "KH",
52
+ Cm: "CM",
53
+ Ca: "CA",
54
+ Cv: "CV",
55
+ Ky: "KY",
56
+ Cf: "CF",
57
+ Td: "TD",
58
+ Cl: "CL",
59
+ Cn: "CN",
60
+ Cx: "CX",
61
+ Cc: "CC",
62
+ Co: "CO",
63
+ Km: "KM",
64
+ Cg: "CG",
65
+ Cd: "CD",
66
+ Ck: "CK",
67
+ Cr: "CR",
68
+ Ci: "CI",
69
+ Hr: "HR",
70
+ Cu: "CU",
71
+ Cy: "CY",
72
+ Cz: "CZ",
73
+ Dk: "DK",
74
+ Dj: "DJ",
75
+ Dm: "DM",
76
+ Do: "DO",
77
+ Ec: "EC",
78
+ Eg: "EG",
79
+ Sv: "SV",
80
+ Gq: "GQ",
81
+ Er: "ER",
82
+ Ee: "EE",
83
+ Et: "ET",
84
+ Fk: "FK",
85
+ Fo: "FO",
86
+ Fj: "FJ",
87
+ Fi: "FI",
88
+ Fr: "FR",
89
+ Gf: "GF",
90
+ Pf: "PF",
91
+ Tf: "TF",
92
+ Ga: "GA",
93
+ Gm: "GM",
94
+ Ge: "GE",
95
+ De: "DE",
96
+ Gh: "GH",
97
+ Gi: "GI",
98
+ Gr: "GR",
99
+ Gl: "GL",
100
+ Gd: "GD",
101
+ Gp: "GP",
102
+ Gu: "GU",
103
+ Gt: "GT",
104
+ Gn: "GN",
105
+ Gw: "GW",
106
+ Gy: "GY",
107
+ Ht: "HT",
108
+ Hm: "HM",
109
+ Va: "VA",
110
+ Hn: "HN",
111
+ Hk: "HK",
112
+ Hu: "HU",
113
+ Is: "IS",
114
+ In: "IN",
115
+ Id: "ID",
116
+ Ir: "IR",
117
+ Iq: "IQ",
118
+ Ie: "IE",
119
+ Il: "IL",
120
+ It: "IT",
121
+ Jm: "JM",
122
+ Jp: "JP",
123
+ Jo: "JO",
124
+ Kz: "KZ",
125
+ Ke: "KE",
126
+ Ki: "KI",
127
+ Kp: "KP",
128
+ Kr: "KR",
129
+ Kw: "KW",
130
+ Kg: "KG",
131
+ La: "LA",
132
+ Lv: "LV",
133
+ Lb: "LB",
134
+ Ls: "LS",
135
+ Lr: "LR",
136
+ Ly: "LY",
137
+ Li: "LI",
138
+ Lt: "LT",
139
+ Lu: "LU",
140
+ Mo: "MO",
141
+ Mg: "MG",
142
+ Mw: "MW",
143
+ My: "MY",
144
+ Mv: "MV",
145
+ Ml: "ML",
146
+ Mt: "MT",
147
+ Mh: "MH",
148
+ Mq: "MQ",
149
+ Mr: "MR",
150
+ Mu: "MU",
151
+ Yt: "YT",
152
+ Mx: "MX",
153
+ Fm: "FM",
154
+ Md: "MD",
155
+ Mc: "MC",
156
+ Mn: "MN",
157
+ Ms: "MS",
158
+ Ma: "MA",
159
+ Mz: "MZ",
160
+ Mm: "MM",
161
+ Na: "NA",
162
+ Nr: "NR",
163
+ Np: "NP",
164
+ Nl: "NL",
165
+ Nc: "NC",
166
+ Nz: "NZ",
167
+ Ni: "NI",
168
+ Ne: "NE",
169
+ Ng: "NG",
170
+ Nu: "NU",
171
+ Nf: "NF",
172
+ Mk: "MK",
173
+ Mp: "MP",
174
+ No: "NO",
175
+ Om: "OM",
176
+ Pk: "PK",
177
+ Pw: "PW",
178
+ Ps: "PS",
179
+ Pa: "PA",
180
+ Pg: "PG",
181
+ Py: "PY",
182
+ Pe: "PE",
183
+ Ph: "PH",
184
+ Pn: "PN",
185
+ Pl: "PL",
186
+ Pt: "PT",
187
+ Pr: "PR",
188
+ Qa: "QA",
189
+ Re: "RE",
190
+ Ro: "RO",
191
+ Ru: "RU",
192
+ Rw: "RW",
193
+ Sh: "SH",
194
+ Kn: "KN",
195
+ Lc: "LC",
196
+ Pm: "PM",
197
+ Vc: "VC",
198
+ Ws: "WS",
199
+ Sm: "SM",
200
+ St: "ST",
201
+ Sa: "SA",
202
+ Sn: "SN",
203
+ Sc: "SC",
204
+ Sl: "SL",
205
+ Sg: "SG",
206
+ Sk: "SK",
207
+ Si: "SI",
208
+ Sb: "SB",
209
+ So: "SO",
210
+ Za: "ZA",
211
+ Gs: "GS",
212
+ Es: "ES",
213
+ Lk: "LK",
214
+ Sd: "SD",
215
+ Sr: "SR",
216
+ Sj: "SJ",
217
+ Sz: "SZ",
218
+ Se: "SE",
219
+ Ch: "CH",
220
+ Sy: "SY",
221
+ Tw: "TW",
222
+ Tj: "TJ",
223
+ Tz: "TZ",
224
+ Th: "TH",
225
+ Tl: "TL",
226
+ Tg: "TG",
227
+ Tk: "TK",
228
+ To: "TO",
229
+ Tt: "TT",
230
+ Tn: "TN",
231
+ Tr: "TR",
232
+ Tm: "TM",
233
+ Tc: "TC",
234
+ Tv: "TV",
235
+ Ug: "UG",
236
+ Ua: "UA",
237
+ Ae: "AE",
238
+ Gb: "GB",
239
+ Us: "US",
240
+ Um: "UM",
241
+ Uy: "UY",
242
+ Uz: "UZ",
243
+ Vu: "VU",
244
+ Ve: "VE",
245
+ Vn: "VN",
246
+ Vg: "VG",
247
+ Vi: "VI",
248
+ Wf: "WF",
249
+ Eh: "EH",
250
+ Ye: "YE",
251
+ Zm: "ZM",
252
+ Zw: "ZW",
253
+ Ax: "AX",
254
+ Bq: "BQ",
255
+ Cw: "CW",
256
+ Gg: "GG",
257
+ Im: "IM",
258
+ Je: "JE",
259
+ Me: "ME",
260
+ Bl: "BL",
261
+ Mf: "MF",
262
+ Rs: "RS",
263
+ Sx: "SX",
264
+ Ss: "SS",
265
+ Xk: "XK",
266
+ } as const;
267
+ /**
268
+ * Country where the partner is based.
269
+ */
270
+ export type CreateReferralsEmbedTokenCountry = ClosedEnum<
271
+ typeof CreateReferralsEmbedTokenCountry
272
+ >;
273
+
274
+ /**
275
+ * The unique IDs of the tags assigned to the short link.
276
+ */
277
+ export type CreateReferralsEmbedTokenTagIds = string | Array<string>;
278
+
279
+ /**
280
+ * The unique name of the tags assigned to the short link (case insensitive).
281
+ */
282
+ export type CreateReferralsEmbedTokenTagNames = string | Array<string>;
283
+
284
+ /**
285
+ * Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner.
286
+ */
287
+ export type CreateReferralsEmbedTokenLinkProps = {
288
+ /**
289
+ * The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace.
290
+ */
291
+ externalId?: string | null | undefined;
292
+ /**
293
+ * The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant.
294
+ */
295
+ tenantId?: string | null | undefined;
296
+ /**
297
+ * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided.
298
+ */
299
+ prefix?: string | undefined;
300
+ /**
301
+ * Whether the short link is archived. Defaults to `false` if not provided.
302
+ */
303
+ archived?: boolean | undefined;
304
+ /**
305
+ * The unique IDs of the tags assigned to the short link.
306
+ */
307
+ tagIds?: string | Array<string> | undefined;
308
+ /**
309
+ * The unique name of the tags assigned to the short link (case insensitive).
310
+ */
311
+ tagNames?: string | Array<string> | undefined;
312
+ /**
313
+ * The unique ID existing folder to assign the short link to.
314
+ */
315
+ folderId?: string | null | undefined;
316
+ /**
317
+ * The comments for the short link.
318
+ */
319
+ comments?: string | null | undefined;
320
+ /**
321
+ * The date and time when the short link will expire at.
322
+ */
323
+ expiresAt?: string | null | undefined;
324
+ /**
325
+ * The URL to redirect to when the short link has expired.
326
+ */
327
+ expiredUrl?: string | null | undefined;
328
+ /**
329
+ * The password required to access the destination URL of the short link.
330
+ */
331
+ password?: string | null | undefined;
332
+ /**
333
+ * Whether the short link uses Custom Social Media Cards feature. Defaults to `false` if not provided.
334
+ */
335
+ proxy?: boolean | undefined;
336
+ /**
337
+ * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og
338
+ */
339
+ title?: string | null | undefined;
340
+ /**
341
+ * The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og
342
+ */
343
+ description?: string | null | undefined;
344
+ /**
345
+ * The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og
346
+ */
347
+ image?: string | null | undefined;
348
+ /**
349
+ * The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og
350
+ */
351
+ video?: string | null | undefined;
352
+ /**
353
+ * Whether the short link uses link cloaking. Defaults to `false` if not provided.
354
+ */
355
+ rewrite?: boolean | undefined;
356
+ /**
357
+ * The iOS destination URL for the short link for iOS device targeting.
358
+ */
359
+ ios?: string | null | undefined;
360
+ /**
361
+ * The Android destination URL for the short link for Android device targeting.
362
+ */
363
+ android?: string | null | undefined;
364
+ /**
365
+ * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex
366
+ */
367
+ doIndex?: boolean | undefined;
368
+ /**
369
+ * The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.
370
+ */
371
+ utmSource?: string | null | undefined;
372
+ /**
373
+ * The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.
374
+ */
375
+ utmMedium?: string | null | undefined;
376
+ /**
377
+ * The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.
378
+ */
379
+ utmCampaign?: string | null | undefined;
380
+ /**
381
+ * The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.
382
+ */
383
+ utmTerm?: string | null | undefined;
384
+ /**
385
+ * The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.
386
+ */
387
+ utmContent?: string | null | undefined;
388
+ /**
389
+ * The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.
390
+ */
391
+ ref?: string | null | undefined;
392
+ };
393
+
394
+ export type Partner = {
395
+ /**
396
+ * Full legal name of the partner.
397
+ */
398
+ name: string;
399
+ /**
400
+ * Email for the partner in your system. Partners will be able to claim their profile by signing up to Dub Partners with this email.
401
+ */
402
+ email: string;
403
+ /**
404
+ * A unique username for the partner in your system (max 100 characters). This will be used to create a short link for the partner using your program's default domain. If not provided, Dub will try to generate a username from the partner's name or email.
405
+ */
406
+ username?: string | null | undefined;
407
+ /**
408
+ * Avatar image for the partner – if not provided, a default avatar will be used.
409
+ */
410
+ image?: string | null | undefined;
411
+ /**
412
+ * Country where the partner is based.
413
+ */
414
+ country?: CreateReferralsEmbedTokenCountry | null | undefined;
415
+ /**
416
+ * A brief description of the partner and their background.
417
+ */
418
+ description?: string | null | undefined;
419
+ /**
420
+ * The ID of the partner in your system.
421
+ */
422
+ tenantId?: string | undefined;
423
+ /**
424
+ * Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner.
425
+ */
426
+ linkProps?: CreateReferralsEmbedTokenLinkProps | undefined;
427
+ };
428
+
429
+ export type CreateReferralsEmbedTokenRequestBody = {
430
+ programId: string;
431
+ partnerId?: string | undefined;
432
+ tenantId?: string | undefined;
433
+ partner?: Partner | undefined;
434
+ };
435
+
436
+ /**
437
+ * The created public embed token.
438
+ */
439
+ export type CreateReferralsEmbedTokenResponseBody = {
440
+ publicToken: string;
441
+ expires: string;
442
+ };
443
+
444
+ /** @internal */
445
+ export const CreateReferralsEmbedTokenCountry$inboundSchema: z.ZodNativeEnum<
446
+ typeof CreateReferralsEmbedTokenCountry
447
+ > = z.nativeEnum(CreateReferralsEmbedTokenCountry);
448
+
449
+ /** @internal */
450
+ export const CreateReferralsEmbedTokenCountry$outboundSchema: z.ZodNativeEnum<
451
+ typeof CreateReferralsEmbedTokenCountry
452
+ > = CreateReferralsEmbedTokenCountry$inboundSchema;
453
+
454
+ /**
455
+ * @internal
456
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
457
+ */
458
+ export namespace CreateReferralsEmbedTokenCountry$ {
459
+ /** @deprecated use `CreateReferralsEmbedTokenCountry$inboundSchema` instead. */
460
+ export const inboundSchema = CreateReferralsEmbedTokenCountry$inboundSchema;
461
+ /** @deprecated use `CreateReferralsEmbedTokenCountry$outboundSchema` instead. */
462
+ export const outboundSchema = CreateReferralsEmbedTokenCountry$outboundSchema;
463
+ }
464
+
465
+ /** @internal */
466
+ export const CreateReferralsEmbedTokenTagIds$inboundSchema: z.ZodType<
467
+ CreateReferralsEmbedTokenTagIds,
468
+ z.ZodTypeDef,
469
+ unknown
470
+ > = z.union([z.string(), z.array(z.string())]);
471
+
472
+ /** @internal */
473
+ export type CreateReferralsEmbedTokenTagIds$Outbound = string | Array<string>;
474
+
475
+ /** @internal */
476
+ export const CreateReferralsEmbedTokenTagIds$outboundSchema: z.ZodType<
477
+ CreateReferralsEmbedTokenTagIds$Outbound,
478
+ z.ZodTypeDef,
479
+ CreateReferralsEmbedTokenTagIds
480
+ > = z.union([z.string(), z.array(z.string())]);
481
+
482
+ /**
483
+ * @internal
484
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
485
+ */
486
+ export namespace CreateReferralsEmbedTokenTagIds$ {
487
+ /** @deprecated use `CreateReferralsEmbedTokenTagIds$inboundSchema` instead. */
488
+ export const inboundSchema = CreateReferralsEmbedTokenTagIds$inboundSchema;
489
+ /** @deprecated use `CreateReferralsEmbedTokenTagIds$outboundSchema` instead. */
490
+ export const outboundSchema = CreateReferralsEmbedTokenTagIds$outboundSchema;
491
+ /** @deprecated use `CreateReferralsEmbedTokenTagIds$Outbound` instead. */
492
+ export type Outbound = CreateReferralsEmbedTokenTagIds$Outbound;
493
+ }
494
+
495
+ export function createReferralsEmbedTokenTagIdsToJSON(
496
+ createReferralsEmbedTokenTagIds: CreateReferralsEmbedTokenTagIds,
497
+ ): string {
498
+ return JSON.stringify(
499
+ CreateReferralsEmbedTokenTagIds$outboundSchema.parse(
500
+ createReferralsEmbedTokenTagIds,
501
+ ),
502
+ );
503
+ }
504
+
505
+ export function createReferralsEmbedTokenTagIdsFromJSON(
506
+ jsonString: string,
507
+ ): SafeParseResult<CreateReferralsEmbedTokenTagIds, SDKValidationError> {
508
+ return safeParse(
509
+ jsonString,
510
+ (x) => CreateReferralsEmbedTokenTagIds$inboundSchema.parse(JSON.parse(x)),
511
+ `Failed to parse 'CreateReferralsEmbedTokenTagIds' from JSON`,
512
+ );
513
+ }
514
+
515
+ /** @internal */
516
+ export const CreateReferralsEmbedTokenTagNames$inboundSchema: z.ZodType<
517
+ CreateReferralsEmbedTokenTagNames,
518
+ z.ZodTypeDef,
519
+ unknown
520
+ > = z.union([z.string(), z.array(z.string())]);
521
+
522
+ /** @internal */
523
+ export type CreateReferralsEmbedTokenTagNames$Outbound = string | Array<string>;
524
+
525
+ /** @internal */
526
+ export const CreateReferralsEmbedTokenTagNames$outboundSchema: z.ZodType<
527
+ CreateReferralsEmbedTokenTagNames$Outbound,
528
+ z.ZodTypeDef,
529
+ CreateReferralsEmbedTokenTagNames
530
+ > = z.union([z.string(), z.array(z.string())]);
531
+
532
+ /**
533
+ * @internal
534
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
535
+ */
536
+ export namespace CreateReferralsEmbedTokenTagNames$ {
537
+ /** @deprecated use `CreateReferralsEmbedTokenTagNames$inboundSchema` instead. */
538
+ export const inboundSchema = CreateReferralsEmbedTokenTagNames$inboundSchema;
539
+ /** @deprecated use `CreateReferralsEmbedTokenTagNames$outboundSchema` instead. */
540
+ export const outboundSchema =
541
+ CreateReferralsEmbedTokenTagNames$outboundSchema;
542
+ /** @deprecated use `CreateReferralsEmbedTokenTagNames$Outbound` instead. */
543
+ export type Outbound = CreateReferralsEmbedTokenTagNames$Outbound;
544
+ }
545
+
546
+ export function createReferralsEmbedTokenTagNamesToJSON(
547
+ createReferralsEmbedTokenTagNames: CreateReferralsEmbedTokenTagNames,
548
+ ): string {
549
+ return JSON.stringify(
550
+ CreateReferralsEmbedTokenTagNames$outboundSchema.parse(
551
+ createReferralsEmbedTokenTagNames,
552
+ ),
553
+ );
554
+ }
555
+
556
+ export function createReferralsEmbedTokenTagNamesFromJSON(
557
+ jsonString: string,
558
+ ): SafeParseResult<CreateReferralsEmbedTokenTagNames, SDKValidationError> {
559
+ return safeParse(
560
+ jsonString,
561
+ (x) => CreateReferralsEmbedTokenTagNames$inboundSchema.parse(JSON.parse(x)),
562
+ `Failed to parse 'CreateReferralsEmbedTokenTagNames' from JSON`,
563
+ );
564
+ }
565
+
566
+ /** @internal */
567
+ export const CreateReferralsEmbedTokenLinkProps$inboundSchema: z.ZodType<
568
+ CreateReferralsEmbedTokenLinkProps,
569
+ z.ZodTypeDef,
570
+ unknown
571
+ > = z.object({
572
+ externalId: z.nullable(z.string()).optional(),
573
+ tenantId: z.nullable(z.string()).optional(),
574
+ prefix: z.string().optional(),
575
+ archived: z.boolean().optional(),
576
+ tagIds: z.union([z.string(), z.array(z.string())]).optional(),
577
+ tagNames: z.union([z.string(), z.array(z.string())]).optional(),
578
+ folderId: z.nullable(z.string()).optional(),
579
+ comments: z.nullable(z.string()).optional(),
580
+ expiresAt: z.nullable(z.string()).optional(),
581
+ expiredUrl: z.nullable(z.string()).optional(),
582
+ password: z.nullable(z.string()).optional(),
583
+ proxy: z.boolean().optional(),
584
+ title: z.nullable(z.string()).optional(),
585
+ description: z.nullable(z.string()).optional(),
586
+ image: z.nullable(z.string()).optional(),
587
+ video: z.nullable(z.string()).optional(),
588
+ rewrite: z.boolean().optional(),
589
+ ios: z.nullable(z.string()).optional(),
590
+ android: z.nullable(z.string()).optional(),
591
+ doIndex: z.boolean().optional(),
592
+ utm_source: z.nullable(z.string()).optional(),
593
+ utm_medium: z.nullable(z.string()).optional(),
594
+ utm_campaign: z.nullable(z.string()).optional(),
595
+ utm_term: z.nullable(z.string()).optional(),
596
+ utm_content: z.nullable(z.string()).optional(),
597
+ ref: z.nullable(z.string()).optional(),
598
+ }).transform((v) => {
599
+ return remap$(v, {
600
+ "utm_source": "utmSource",
601
+ "utm_medium": "utmMedium",
602
+ "utm_campaign": "utmCampaign",
603
+ "utm_term": "utmTerm",
604
+ "utm_content": "utmContent",
605
+ });
606
+ });
607
+
608
+ /** @internal */
609
+ export type CreateReferralsEmbedTokenLinkProps$Outbound = {
610
+ externalId?: string | null | undefined;
611
+ tenantId?: string | null | undefined;
612
+ prefix?: string | undefined;
613
+ archived?: boolean | undefined;
614
+ tagIds?: string | Array<string> | undefined;
615
+ tagNames?: string | Array<string> | undefined;
616
+ folderId?: string | null | undefined;
617
+ comments?: string | null | undefined;
618
+ expiresAt?: string | null | undefined;
619
+ expiredUrl?: string | null | undefined;
620
+ password?: string | null | undefined;
621
+ proxy?: boolean | undefined;
622
+ title?: string | null | undefined;
623
+ description?: string | null | undefined;
624
+ image?: string | null | undefined;
625
+ video?: string | null | undefined;
626
+ rewrite?: boolean | undefined;
627
+ ios?: string | null | undefined;
628
+ android?: string | null | undefined;
629
+ doIndex?: boolean | undefined;
630
+ utm_source?: string | null | undefined;
631
+ utm_medium?: string | null | undefined;
632
+ utm_campaign?: string | null | undefined;
633
+ utm_term?: string | null | undefined;
634
+ utm_content?: string | null | undefined;
635
+ ref?: string | null | undefined;
636
+ };
637
+
638
+ /** @internal */
639
+ export const CreateReferralsEmbedTokenLinkProps$outboundSchema: z.ZodType<
640
+ CreateReferralsEmbedTokenLinkProps$Outbound,
641
+ z.ZodTypeDef,
642
+ CreateReferralsEmbedTokenLinkProps
643
+ > = z.object({
644
+ externalId: z.nullable(z.string()).optional(),
645
+ tenantId: z.nullable(z.string()).optional(),
646
+ prefix: z.string().optional(),
647
+ archived: z.boolean().optional(),
648
+ tagIds: z.union([z.string(), z.array(z.string())]).optional(),
649
+ tagNames: z.union([z.string(), z.array(z.string())]).optional(),
650
+ folderId: z.nullable(z.string()).optional(),
651
+ comments: z.nullable(z.string()).optional(),
652
+ expiresAt: z.nullable(z.string()).optional(),
653
+ expiredUrl: z.nullable(z.string()).optional(),
654
+ password: z.nullable(z.string()).optional(),
655
+ proxy: z.boolean().optional(),
656
+ title: z.nullable(z.string()).optional(),
657
+ description: z.nullable(z.string()).optional(),
658
+ image: z.nullable(z.string()).optional(),
659
+ video: z.nullable(z.string()).optional(),
660
+ rewrite: z.boolean().optional(),
661
+ ios: z.nullable(z.string()).optional(),
662
+ android: z.nullable(z.string()).optional(),
663
+ doIndex: z.boolean().optional(),
664
+ utmSource: z.nullable(z.string()).optional(),
665
+ utmMedium: z.nullable(z.string()).optional(),
666
+ utmCampaign: z.nullable(z.string()).optional(),
667
+ utmTerm: z.nullable(z.string()).optional(),
668
+ utmContent: z.nullable(z.string()).optional(),
669
+ ref: z.nullable(z.string()).optional(),
670
+ }).transform((v) => {
671
+ return remap$(v, {
672
+ utmSource: "utm_source",
673
+ utmMedium: "utm_medium",
674
+ utmCampaign: "utm_campaign",
675
+ utmTerm: "utm_term",
676
+ utmContent: "utm_content",
677
+ });
678
+ });
679
+
680
+ /**
681
+ * @internal
682
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
683
+ */
684
+ export namespace CreateReferralsEmbedTokenLinkProps$ {
685
+ /** @deprecated use `CreateReferralsEmbedTokenLinkProps$inboundSchema` instead. */
686
+ export const inboundSchema = CreateReferralsEmbedTokenLinkProps$inboundSchema;
687
+ /** @deprecated use `CreateReferralsEmbedTokenLinkProps$outboundSchema` instead. */
688
+ export const outboundSchema =
689
+ CreateReferralsEmbedTokenLinkProps$outboundSchema;
690
+ /** @deprecated use `CreateReferralsEmbedTokenLinkProps$Outbound` instead. */
691
+ export type Outbound = CreateReferralsEmbedTokenLinkProps$Outbound;
692
+ }
693
+
694
+ export function createReferralsEmbedTokenLinkPropsToJSON(
695
+ createReferralsEmbedTokenLinkProps: CreateReferralsEmbedTokenLinkProps,
696
+ ): string {
697
+ return JSON.stringify(
698
+ CreateReferralsEmbedTokenLinkProps$outboundSchema.parse(
699
+ createReferralsEmbedTokenLinkProps,
700
+ ),
701
+ );
702
+ }
703
+
704
+ export function createReferralsEmbedTokenLinkPropsFromJSON(
705
+ jsonString: string,
706
+ ): SafeParseResult<CreateReferralsEmbedTokenLinkProps, SDKValidationError> {
707
+ return safeParse(
708
+ jsonString,
709
+ (x) =>
710
+ CreateReferralsEmbedTokenLinkProps$inboundSchema.parse(JSON.parse(x)),
711
+ `Failed to parse 'CreateReferralsEmbedTokenLinkProps' from JSON`,
712
+ );
713
+ }
714
+
715
+ /** @internal */
716
+ export const Partner$inboundSchema: z.ZodType<Partner, z.ZodTypeDef, unknown> =
717
+ z.object({
718
+ name: z.string(),
719
+ email: z.string(),
720
+ username: z.nullable(z.string()).optional(),
721
+ image: z.nullable(z.string()).optional(),
722
+ country: z.nullable(CreateReferralsEmbedTokenCountry$inboundSchema)
723
+ .optional(),
724
+ description: z.nullable(z.string()).optional(),
725
+ tenantId: z.string().optional(),
726
+ linkProps: z.lazy(() => CreateReferralsEmbedTokenLinkProps$inboundSchema)
727
+ .optional(),
728
+ });
729
+
730
+ /** @internal */
731
+ export type Partner$Outbound = {
732
+ name: string;
733
+ email: string;
734
+ username?: string | null | undefined;
735
+ image?: string | null | undefined;
736
+ country?: string | null | undefined;
737
+ description?: string | null | undefined;
738
+ tenantId?: string | undefined;
739
+ linkProps?: CreateReferralsEmbedTokenLinkProps$Outbound | undefined;
740
+ };
741
+
742
+ /** @internal */
743
+ export const Partner$outboundSchema: z.ZodType<
744
+ Partner$Outbound,
745
+ z.ZodTypeDef,
746
+ Partner
747
+ > = z.object({
748
+ name: z.string(),
749
+ email: z.string(),
750
+ username: z.nullable(z.string()).optional(),
751
+ image: z.nullable(z.string()).optional(),
752
+ country: z.nullable(CreateReferralsEmbedTokenCountry$outboundSchema)
753
+ .optional(),
754
+ description: z.nullable(z.string()).optional(),
755
+ tenantId: z.string().optional(),
756
+ linkProps: z.lazy(() => CreateReferralsEmbedTokenLinkProps$outboundSchema)
757
+ .optional(),
758
+ });
759
+
760
+ /**
761
+ * @internal
762
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
763
+ */
764
+ export namespace Partner$ {
765
+ /** @deprecated use `Partner$inboundSchema` instead. */
766
+ export const inboundSchema = Partner$inboundSchema;
767
+ /** @deprecated use `Partner$outboundSchema` instead. */
768
+ export const outboundSchema = Partner$outboundSchema;
769
+ /** @deprecated use `Partner$Outbound` instead. */
770
+ export type Outbound = Partner$Outbound;
771
+ }
772
+
773
+ export function partnerToJSON(partner: Partner): string {
774
+ return JSON.stringify(Partner$outboundSchema.parse(partner));
775
+ }
776
+
777
+ export function partnerFromJSON(
778
+ jsonString: string,
779
+ ): SafeParseResult<Partner, SDKValidationError> {
780
+ return safeParse(
781
+ jsonString,
782
+ (x) => Partner$inboundSchema.parse(JSON.parse(x)),
783
+ `Failed to parse 'Partner' from JSON`,
784
+ );
785
+ }
786
+
787
+ /** @internal */
788
+ export const CreateReferralsEmbedTokenRequestBody$inboundSchema: z.ZodType<
789
+ CreateReferralsEmbedTokenRequestBody,
790
+ z.ZodTypeDef,
791
+ unknown
792
+ > = z.object({
793
+ programId: z.string(),
794
+ partnerId: z.string().optional(),
795
+ tenantId: z.string().optional(),
796
+ partner: z.lazy(() => Partner$inboundSchema).optional(),
797
+ });
798
+
799
+ /** @internal */
800
+ export type CreateReferralsEmbedTokenRequestBody$Outbound = {
801
+ programId: string;
802
+ partnerId?: string | undefined;
803
+ tenantId?: string | undefined;
804
+ partner?: Partner$Outbound | undefined;
805
+ };
806
+
807
+ /** @internal */
808
+ export const CreateReferralsEmbedTokenRequestBody$outboundSchema: z.ZodType<
809
+ CreateReferralsEmbedTokenRequestBody$Outbound,
810
+ z.ZodTypeDef,
811
+ CreateReferralsEmbedTokenRequestBody
812
+ > = z.object({
813
+ programId: z.string(),
814
+ partnerId: z.string().optional(),
815
+ tenantId: z.string().optional(),
816
+ partner: z.lazy(() => Partner$outboundSchema).optional(),
817
+ });
818
+
819
+ /**
820
+ * @internal
821
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
822
+ */
823
+ export namespace CreateReferralsEmbedTokenRequestBody$ {
824
+ /** @deprecated use `CreateReferralsEmbedTokenRequestBody$inboundSchema` instead. */
825
+ export const inboundSchema =
826
+ CreateReferralsEmbedTokenRequestBody$inboundSchema;
827
+ /** @deprecated use `CreateReferralsEmbedTokenRequestBody$outboundSchema` instead. */
828
+ export const outboundSchema =
829
+ CreateReferralsEmbedTokenRequestBody$outboundSchema;
830
+ /** @deprecated use `CreateReferralsEmbedTokenRequestBody$Outbound` instead. */
831
+ export type Outbound = CreateReferralsEmbedTokenRequestBody$Outbound;
832
+ }
833
+
834
+ export function createReferralsEmbedTokenRequestBodyToJSON(
835
+ createReferralsEmbedTokenRequestBody: CreateReferralsEmbedTokenRequestBody,
836
+ ): string {
837
+ return JSON.stringify(
838
+ CreateReferralsEmbedTokenRequestBody$outboundSchema.parse(
839
+ createReferralsEmbedTokenRequestBody,
840
+ ),
841
+ );
842
+ }
843
+
844
+ export function createReferralsEmbedTokenRequestBodyFromJSON(
845
+ jsonString: string,
846
+ ): SafeParseResult<CreateReferralsEmbedTokenRequestBody, SDKValidationError> {
847
+ return safeParse(
848
+ jsonString,
849
+ (x) =>
850
+ CreateReferralsEmbedTokenRequestBody$inboundSchema.parse(JSON.parse(x)),
851
+ `Failed to parse 'CreateReferralsEmbedTokenRequestBody' from JSON`,
852
+ );
853
+ }
854
+
855
+ /** @internal */
856
+ export const CreateReferralsEmbedTokenResponseBody$inboundSchema: z.ZodType<
857
+ CreateReferralsEmbedTokenResponseBody,
858
+ z.ZodTypeDef,
859
+ unknown
860
+ > = z.object({
861
+ publicToken: z.string(),
862
+ expires: z.string(),
863
+ });
864
+
865
+ /** @internal */
866
+ export type CreateReferralsEmbedTokenResponseBody$Outbound = {
867
+ publicToken: string;
868
+ expires: string;
869
+ };
870
+
871
+ /** @internal */
872
+ export const CreateReferralsEmbedTokenResponseBody$outboundSchema: z.ZodType<
873
+ CreateReferralsEmbedTokenResponseBody$Outbound,
874
+ z.ZodTypeDef,
875
+ CreateReferralsEmbedTokenResponseBody
876
+ > = z.object({
877
+ publicToken: z.string(),
878
+ expires: z.string(),
879
+ });
880
+
881
+ /**
882
+ * @internal
883
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
884
+ */
885
+ export namespace CreateReferralsEmbedTokenResponseBody$ {
886
+ /** @deprecated use `CreateReferralsEmbedTokenResponseBody$inboundSchema` instead. */
887
+ export const inboundSchema =
888
+ CreateReferralsEmbedTokenResponseBody$inboundSchema;
889
+ /** @deprecated use `CreateReferralsEmbedTokenResponseBody$outboundSchema` instead. */
890
+ export const outboundSchema =
891
+ CreateReferralsEmbedTokenResponseBody$outboundSchema;
892
+ /** @deprecated use `CreateReferralsEmbedTokenResponseBody$Outbound` instead. */
893
+ export type Outbound = CreateReferralsEmbedTokenResponseBody$Outbound;
894
+ }
895
+
896
+ export function createReferralsEmbedTokenResponseBodyToJSON(
897
+ createReferralsEmbedTokenResponseBody: CreateReferralsEmbedTokenResponseBody,
898
+ ): string {
899
+ return JSON.stringify(
900
+ CreateReferralsEmbedTokenResponseBody$outboundSchema.parse(
901
+ createReferralsEmbedTokenResponseBody,
902
+ ),
903
+ );
904
+ }
905
+
906
+ export function createReferralsEmbedTokenResponseBodyFromJSON(
907
+ jsonString: string,
908
+ ): SafeParseResult<CreateReferralsEmbedTokenResponseBody, SDKValidationError> {
909
+ return safeParse(
910
+ jsonString,
911
+ (x) =>
912
+ CreateReferralsEmbedTokenResponseBody$inboundSchema.parse(JSON.parse(x)),
913
+ `Failed to parse 'CreateReferralsEmbedTokenResponseBody' from JSON`,
914
+ );
915
+ }