growsurf-typescript 0.0.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 (370) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +201 -0
  3. package/README.md +358 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +181 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +181 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +476 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +472 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +87 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +81 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/query.d.mts +5 -0
  199. package/internal/utils/query.d.mts.map +1 -0
  200. package/internal/utils/query.d.ts +5 -0
  201. package/internal/utils/query.d.ts.map +1 -0
  202. package/internal/utils/query.js +23 -0
  203. package/internal/utils/query.js.map +1 -0
  204. package/internal/utils/query.mjs +20 -0
  205. package/internal/utils/query.mjs.map +1 -0
  206. package/internal/utils/sleep.d.mts +2 -0
  207. package/internal/utils/sleep.d.mts.map +1 -0
  208. package/internal/utils/sleep.d.ts +2 -0
  209. package/internal/utils/sleep.d.ts.map +1 -0
  210. package/internal/utils/sleep.js +7 -0
  211. package/internal/utils/sleep.js.map +1 -0
  212. package/internal/utils/sleep.mjs +3 -0
  213. package/internal/utils/sleep.mjs.map +1 -0
  214. package/internal/utils/uuid.d.mts +5 -0
  215. package/internal/utils/uuid.d.mts.map +1 -0
  216. package/internal/utils/uuid.d.ts +5 -0
  217. package/internal/utils/uuid.d.ts.map +1 -0
  218. package/internal/utils/uuid.js +19 -0
  219. package/internal/utils/uuid.js.map +1 -0
  220. package/internal/utils/uuid.mjs +15 -0
  221. package/internal/utils/uuid.mjs.map +1 -0
  222. package/internal/utils/values.d.mts +18 -0
  223. package/internal/utils/values.d.mts.map +1 -0
  224. package/internal/utils/values.d.ts +18 -0
  225. package/internal/utils/values.d.ts.map +1 -0
  226. package/internal/utils/values.js +112 -0
  227. package/internal/utils/values.js.map +1 -0
  228. package/internal/utils/values.mjs +94 -0
  229. package/internal/utils/values.mjs.map +1 -0
  230. package/internal/utils.d.mts +8 -0
  231. package/internal/utils.d.mts.map +1 -0
  232. package/internal/utils.d.ts +8 -0
  233. package/internal/utils.d.ts.map +1 -0
  234. package/internal/utils.js +12 -0
  235. package/internal/utils.js.map +1 -0
  236. package/internal/utils.mjs +9 -0
  237. package/internal/utils.mjs.map +1 -0
  238. package/package.json +143 -0
  239. package/resource.d.mts +2 -0
  240. package/resource.d.mts.map +1 -0
  241. package/resource.d.ts +2 -0
  242. package/resource.d.ts.map +1 -0
  243. package/resource.js +6 -0
  244. package/resource.js.map +1 -0
  245. package/resource.mjs +2 -0
  246. package/resource.mjs.map +1 -0
  247. package/resources/campaign/campaign.d.mts +398 -0
  248. package/resources/campaign/campaign.d.mts.map +1 -0
  249. package/resources/campaign/campaign.d.ts +398 -0
  250. package/resources/campaign/campaign.d.ts.map +1 -0
  251. package/resources/campaign/campaign.js +123 -0
  252. package/resources/campaign/campaign.js.map +1 -0
  253. package/resources/campaign/campaign.mjs +118 -0
  254. package/resources/campaign/campaign.mjs.map +1 -0
  255. package/resources/campaign/commission.d.mts +54 -0
  256. package/resources/campaign/commission.d.mts.map +1 -0
  257. package/resources/campaign/commission.d.ts +54 -0
  258. package/resources/campaign/commission.d.ts.map +1 -0
  259. package/resources/campaign/commission.js +43 -0
  260. package/resources/campaign/commission.js.map +1 -0
  261. package/resources/campaign/commission.mjs +39 -0
  262. package/resources/campaign/commission.mjs.map +1 -0
  263. package/resources/campaign/index.d.mts +5 -0
  264. package/resources/campaign/index.d.mts.map +1 -0
  265. package/resources/campaign/index.d.ts +5 -0
  266. package/resources/campaign/index.d.ts.map +1 -0
  267. package/resources/campaign/index.js +13 -0
  268. package/resources/campaign/index.js.map +1 -0
  269. package/resources/campaign/index.mjs +6 -0
  270. package/resources/campaign/index.mjs.map +1 -0
  271. package/resources/campaign/participant.d.mts +611 -0
  272. package/resources/campaign/participant.d.mts.map +1 -0
  273. package/resources/campaign/participant.d.ts +611 -0
  274. package/resources/campaign/participant.d.ts.map +1 -0
  275. package/resources/campaign/participant.js +234 -0
  276. package/resources/campaign/participant.js.map +1 -0
  277. package/resources/campaign/participant.mjs +230 -0
  278. package/resources/campaign/participant.mjs.map +1 -0
  279. package/resources/campaign/reward.d.mts +80 -0
  280. package/resources/campaign/reward.d.mts.map +1 -0
  281. package/resources/campaign/reward.d.ts +80 -0
  282. package/resources/campaign/reward.d.ts.map +1 -0
  283. package/resources/campaign/reward.js +59 -0
  284. package/resources/campaign/reward.js.map +1 -0
  285. package/resources/campaign/reward.mjs +55 -0
  286. package/resources/campaign/reward.mjs.map +1 -0
  287. package/resources/campaign.d.mts +2 -0
  288. package/resources/campaign.d.mts.map +1 -0
  289. package/resources/campaign.d.ts +2 -0
  290. package/resources/campaign.d.ts.map +1 -0
  291. package/resources/campaign.js +6 -0
  292. package/resources/campaign.js.map +1 -0
  293. package/resources/campaign.mjs +3 -0
  294. package/resources/campaign.mjs.map +1 -0
  295. package/resources/index.d.mts +2 -0
  296. package/resources/index.d.mts.map +1 -0
  297. package/resources/index.d.ts +2 -0
  298. package/resources/index.d.ts.map +1 -0
  299. package/resources/index.js +7 -0
  300. package/resources/index.js.map +1 -0
  301. package/resources/index.mjs +3 -0
  302. package/resources/index.mjs.map +1 -0
  303. package/resources.d.mts +2 -0
  304. package/resources.d.mts.map +1 -0
  305. package/resources.d.ts +2 -0
  306. package/resources.d.ts.map +1 -0
  307. package/resources.js +5 -0
  308. package/resources.js.map +1 -0
  309. package/resources.mjs +2 -0
  310. package/resources.mjs.map +1 -0
  311. package/src/api-promise.ts +2 -0
  312. package/src/client.ts +774 -0
  313. package/src/core/README.md +3 -0
  314. package/src/core/api-promise.ts +92 -0
  315. package/src/core/error.ts +130 -0
  316. package/src/core/resource.ts +11 -0
  317. package/src/core/uploads.ts +2 -0
  318. package/src/error.ts +2 -0
  319. package/src/index.ts +22 -0
  320. package/src/internal/README.md +3 -0
  321. package/src/internal/builtin-types.ts +93 -0
  322. package/src/internal/detect-platform.ts +196 -0
  323. package/src/internal/errors.ts +33 -0
  324. package/src/internal/headers.ts +97 -0
  325. package/src/internal/parse.ts +56 -0
  326. package/src/internal/request-options.ts +91 -0
  327. package/src/internal/shim-types.ts +26 -0
  328. package/src/internal/shims.ts +107 -0
  329. package/src/internal/to-file.ts +154 -0
  330. package/src/internal/types.ts +93 -0
  331. package/src/internal/uploads.ts +187 -0
  332. package/src/internal/utils/base64.ts +40 -0
  333. package/src/internal/utils/bytes.ts +32 -0
  334. package/src/internal/utils/env.ts +18 -0
  335. package/src/internal/utils/log.ts +128 -0
  336. package/src/internal/utils/path.ts +88 -0
  337. package/src/internal/utils/query.ts +23 -0
  338. package/src/internal/utils/sleep.ts +3 -0
  339. package/src/internal/utils/uuid.ts +17 -0
  340. package/src/internal/utils/values.ts +105 -0
  341. package/src/internal/utils.ts +9 -0
  342. package/src/lib/.keep +4 -0
  343. package/src/resource.ts +2 -0
  344. package/src/resources/campaign/campaign.ts +718 -0
  345. package/src/resources/campaign/commission.ts +82 -0
  346. package/src/resources/campaign/index.ts +59 -0
  347. package/src/resources/campaign/participant.ts +897 -0
  348. package/src/resources/campaign/reward.ts +121 -0
  349. package/src/resources/campaign.ts +3 -0
  350. package/src/resources/index.ts +19 -0
  351. package/src/resources.ts +1 -0
  352. package/src/tsconfig.json +11 -0
  353. package/src/uploads.ts +2 -0
  354. package/src/version.ts +1 -0
  355. package/uploads.d.mts +2 -0
  356. package/uploads.d.mts.map +1 -0
  357. package/uploads.d.ts +2 -0
  358. package/uploads.d.ts.map +1 -0
  359. package/uploads.js +6 -0
  360. package/uploads.js.map +1 -0
  361. package/uploads.mjs +2 -0
  362. package/uploads.mjs.map +1 -0
  363. package/version.d.mts +2 -0
  364. package/version.d.mts.map +1 -0
  365. package/version.d.ts +2 -0
  366. package/version.d.ts.map +1 -0
  367. package/version.js +5 -0
  368. package/version.js.map +1 -0
  369. package/version.mjs +2 -0
  370. package/version.mjs.map +1 -0
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ParticipantResource = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ class ParticipantResource extends resource_1.APIResource {
8
+ /**
9
+ * Retrieves a single participant by GrowSurf participant ID or email address.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const participant =
14
+ * await client.campaign.participant.retrieve(
15
+ * 'participantIdOrEmail',
16
+ * { id: 'id' },
17
+ * );
18
+ * ```
19
+ */
20
+ retrieve(participantIDOrEmail, params, options) {
21
+ const { id } = params;
22
+ return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, options);
23
+ }
24
+ /**
25
+ * Updates a participant by GrowSurf participant ID or email address.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const participant =
30
+ * await client.campaign.participant.update(
31
+ * 'participantIdOrEmail',
32
+ * {
33
+ * id: 'id',
34
+ * firstName: 'Gavin',
35
+ * lastName: 'Belson',
36
+ * metadata: { company: 'Hooli, Inc' },
37
+ * },
38
+ * );
39
+ * ```
40
+ */
41
+ update(participantIDOrEmail, params, options) {
42
+ const { id, ...body } = params;
43
+ return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, { body, ...options });
44
+ }
45
+ /**
46
+ * Removes a participant by GrowSurf participant ID or email address.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const participant =
51
+ * await client.campaign.participant.delete(
52
+ * 'participantIdOrEmail',
53
+ * { id: 'id' },
54
+ * );
55
+ * ```
56
+ */
57
+ delete(participantIDOrEmail, params, options) {
58
+ const { id } = params;
59
+ return this._client.delete((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}`, options);
60
+ }
61
+ /**
62
+ * Adds a new participant to the program. If the email already exists, the existing
63
+ * participant is returned.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const participant = await client.campaign.participant.add(
68
+ * 'id',
69
+ * {
70
+ * email: 'gavin@hooli.com',
71
+ * firstName: 'Gavin',
72
+ * ipAddress: '203.0.113.10',
73
+ * lastName: 'Belson',
74
+ * metadata: {
75
+ * companyName: 'Hooli',
76
+ * industry: 'Software',
77
+ * },
78
+ * referredBy: 'richard-h8kp6l',
79
+ * },
80
+ * );
81
+ * ```
82
+ */
83
+ add(id, body, options) {
84
+ return this._client.post((0, path_1.path) `/campaign/${id}/participant`, { body, ...options });
85
+ }
86
+ /**
87
+ * Retrieves a paged list of commissions earned by a participant.
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const participantCommissionList =
92
+ * await client.campaign.participant.listCommissions(
93
+ * 'participantIdOrEmail',
94
+ * { id: 'id' },
95
+ * );
96
+ * ```
97
+ */
98
+ listCommissions(participantIDOrEmail, params, options) {
99
+ const { id, ...query } = params;
100
+ return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/commissions`, {
101
+ query,
102
+ ...options,
103
+ });
104
+ }
105
+ /**
106
+ * Retrieves a paged list of payouts that belong to a participant.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const participantPayoutList =
111
+ * await client.campaign.participant.listPayouts(
112
+ * 'participantIdOrEmail',
113
+ * { id: 'id' },
114
+ * );
115
+ * ```
116
+ */
117
+ listPayouts(participantIDOrEmail, params, options) {
118
+ const { id, ...query } = params;
119
+ return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/payouts`, {
120
+ query,
121
+ ...options,
122
+ });
123
+ }
124
+ /**
125
+ * Retrieves referrals and email invites made by a participant.
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const referralList =
130
+ * await client.campaign.participant.listReferrals(
131
+ * 'participantIdOrEmail',
132
+ * { id: 'id' },
133
+ * );
134
+ * ```
135
+ */
136
+ listReferrals(participantIDOrEmail, params, options) {
137
+ const { id, ...query } = params;
138
+ return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/referrals`, {
139
+ query,
140
+ ...options,
141
+ });
142
+ }
143
+ /**
144
+ * Retrieves a paged list of rewards earned by a participant.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * const response =
149
+ * await client.campaign.participant.listRewards(
150
+ * 'participantIdOrEmail',
151
+ * { id: 'id' },
152
+ * );
153
+ * ```
154
+ */
155
+ listRewards(participantIDOrEmail, params, options) {
156
+ const { id, ...query } = params;
157
+ return this._client.get((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/rewards`, {
158
+ query,
159
+ ...options,
160
+ });
161
+ }
162
+ /**
163
+ * Records a sale made by a referred customer and generates affiliate commissions
164
+ * for their referrer when applicable.
165
+ *
166
+ * @example
167
+ * ```ts
168
+ * const response =
169
+ * await client.campaign.participant.recordTransaction(
170
+ * 'participantIdOrEmail',
171
+ * {
172
+ * id: 'id',
173
+ * currency: 'USD',
174
+ * grossAmount: 9900,
175
+ * amountCashNet: 7900,
176
+ * description: 'Renewal for Pro subscription',
177
+ * invoiceId: 'invoice_54',
178
+ * paidAt: 1733702400000,
179
+ * },
180
+ * );
181
+ * ```
182
+ */
183
+ recordTransaction(participantIDOrEmail, params, options) {
184
+ const { id, ...body } = params;
185
+ return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/transaction`, {
186
+ body,
187
+ ...options,
188
+ });
189
+ }
190
+ /**
191
+ * Sends email invites on behalf of a participant to a list of email addresses.
192
+ *
193
+ * @example
194
+ * ```ts
195
+ * const response =
196
+ * await client.campaign.participant.sendInvites(
197
+ * 'participantIdOrEmail',
198
+ * {
199
+ * id: 'id',
200
+ * emailAddresses: ['erlich@aviato.com'],
201
+ * messageText:
202
+ * '{{referrerFirstName}} invited you with {{referrerShareUrl}}.',
203
+ * subjectText: 'Join me on Pied Piper',
204
+ * },
205
+ * );
206
+ * ```
207
+ */
208
+ sendInvites(participantIDOrEmail, params, options) {
209
+ const { id, ...body } = params;
210
+ return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/invites`, {
211
+ body,
212
+ ...options,
213
+ });
214
+ }
215
+ /**
216
+ * Triggers referral credit for an existing referred participant by GrowSurf
217
+ * participant ID or email address.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * const response =
222
+ * await client.campaign.participant.triggerReferral(
223
+ * 'participantIdOrEmail',
224
+ * { id: 'id' },
225
+ * );
226
+ * ```
227
+ */
228
+ triggerReferral(participantIDOrEmail, params, options) {
229
+ const { id } = params;
230
+ return this._client.post((0, path_1.path) `/campaign/${id}/participant/${participantIDOrEmail}/ref`, options);
231
+ }
232
+ }
233
+ exports.ParticipantResource = ParticipantResource;
234
+ //# sourceMappingURL=participant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participant.js","sourceRoot":"","sources":["../../src/resources/campaign/participant.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAiD;AAEjD,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,oBAA4B,EAC5B,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,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CACF;AAnRD,kDAmRC"}
@@ -0,0 +1,230 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
4
+ export class ParticipantResource extends APIResource {
5
+ /**
6
+ * Retrieves a single participant by GrowSurf participant ID or email address.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const participant =
11
+ * await client.campaign.participant.retrieve(
12
+ * 'participantIdOrEmail',
13
+ * { id: 'id' },
14
+ * );
15
+ * ```
16
+ */
17
+ retrieve(participantIDOrEmail, params, options) {
18
+ const { id } = params;
19
+ return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}`, options);
20
+ }
21
+ /**
22
+ * Updates a participant by GrowSurf participant ID or email address.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const participant =
27
+ * await client.campaign.participant.update(
28
+ * 'participantIdOrEmail',
29
+ * {
30
+ * id: 'id',
31
+ * firstName: 'Gavin',
32
+ * lastName: 'Belson',
33
+ * metadata: { company: 'Hooli, Inc' },
34
+ * },
35
+ * );
36
+ * ```
37
+ */
38
+ update(participantIDOrEmail, params, options) {
39
+ const { id, ...body } = params;
40
+ return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}`, { body, ...options });
41
+ }
42
+ /**
43
+ * Removes a participant by GrowSurf participant ID or email address.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const participant =
48
+ * await client.campaign.participant.delete(
49
+ * 'participantIdOrEmail',
50
+ * { id: 'id' },
51
+ * );
52
+ * ```
53
+ */
54
+ delete(participantIDOrEmail, params, options) {
55
+ const { id } = params;
56
+ return this._client.delete(path `/campaign/${id}/participant/${participantIDOrEmail}`, options);
57
+ }
58
+ /**
59
+ * Adds a new participant to the program. If the email already exists, the existing
60
+ * participant is returned.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const participant = await client.campaign.participant.add(
65
+ * 'id',
66
+ * {
67
+ * email: 'gavin@hooli.com',
68
+ * firstName: 'Gavin',
69
+ * ipAddress: '203.0.113.10',
70
+ * lastName: 'Belson',
71
+ * metadata: {
72
+ * companyName: 'Hooli',
73
+ * industry: 'Software',
74
+ * },
75
+ * referredBy: 'richard-h8kp6l',
76
+ * },
77
+ * );
78
+ * ```
79
+ */
80
+ add(id, body, options) {
81
+ return this._client.post(path `/campaign/${id}/participant`, { body, ...options });
82
+ }
83
+ /**
84
+ * Retrieves a paged list of commissions earned by a participant.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const participantCommissionList =
89
+ * await client.campaign.participant.listCommissions(
90
+ * 'participantIdOrEmail',
91
+ * { id: 'id' },
92
+ * );
93
+ * ```
94
+ */
95
+ listCommissions(participantIDOrEmail, params, options) {
96
+ const { id, ...query } = params;
97
+ return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/commissions`, {
98
+ query,
99
+ ...options,
100
+ });
101
+ }
102
+ /**
103
+ * Retrieves a paged list of payouts that belong to a participant.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const participantPayoutList =
108
+ * await client.campaign.participant.listPayouts(
109
+ * 'participantIdOrEmail',
110
+ * { id: 'id' },
111
+ * );
112
+ * ```
113
+ */
114
+ listPayouts(participantIDOrEmail, params, options) {
115
+ const { id, ...query } = params;
116
+ return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/payouts`, {
117
+ query,
118
+ ...options,
119
+ });
120
+ }
121
+ /**
122
+ * Retrieves referrals and email invites made by a participant.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const referralList =
127
+ * await client.campaign.participant.listReferrals(
128
+ * 'participantIdOrEmail',
129
+ * { id: 'id' },
130
+ * );
131
+ * ```
132
+ */
133
+ listReferrals(participantIDOrEmail, params, options) {
134
+ const { id, ...query } = params;
135
+ return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/referrals`, {
136
+ query,
137
+ ...options,
138
+ });
139
+ }
140
+ /**
141
+ * Retrieves a paged list of rewards earned by a participant.
142
+ *
143
+ * @example
144
+ * ```ts
145
+ * const response =
146
+ * await client.campaign.participant.listRewards(
147
+ * 'participantIdOrEmail',
148
+ * { id: 'id' },
149
+ * );
150
+ * ```
151
+ */
152
+ listRewards(participantIDOrEmail, params, options) {
153
+ const { id, ...query } = params;
154
+ return this._client.get(path `/campaign/${id}/participant/${participantIDOrEmail}/rewards`, {
155
+ query,
156
+ ...options,
157
+ });
158
+ }
159
+ /**
160
+ * Records a sale made by a referred customer and generates affiliate commissions
161
+ * for their referrer when applicable.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * const response =
166
+ * await client.campaign.participant.recordTransaction(
167
+ * 'participantIdOrEmail',
168
+ * {
169
+ * id: 'id',
170
+ * currency: 'USD',
171
+ * grossAmount: 9900,
172
+ * amountCashNet: 7900,
173
+ * description: 'Renewal for Pro subscription',
174
+ * invoiceId: 'invoice_54',
175
+ * paidAt: 1733702400000,
176
+ * },
177
+ * );
178
+ * ```
179
+ */
180
+ recordTransaction(participantIDOrEmail, params, options) {
181
+ const { id, ...body } = params;
182
+ return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/transaction`, {
183
+ body,
184
+ ...options,
185
+ });
186
+ }
187
+ /**
188
+ * Sends email invites on behalf of a participant to a list of email addresses.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const response =
193
+ * await client.campaign.participant.sendInvites(
194
+ * 'participantIdOrEmail',
195
+ * {
196
+ * id: 'id',
197
+ * emailAddresses: ['erlich@aviato.com'],
198
+ * messageText:
199
+ * '{{referrerFirstName}} invited you with {{referrerShareUrl}}.',
200
+ * subjectText: 'Join me on Pied Piper',
201
+ * },
202
+ * );
203
+ * ```
204
+ */
205
+ sendInvites(participantIDOrEmail, params, options) {
206
+ const { id, ...body } = params;
207
+ return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/invites`, {
208
+ body,
209
+ ...options,
210
+ });
211
+ }
212
+ /**
213
+ * Triggers referral credit for an existing referred participant by GrowSurf
214
+ * participant ID or email address.
215
+ *
216
+ * @example
217
+ * ```ts
218
+ * const response =
219
+ * await client.campaign.participant.triggerReferral(
220
+ * 'participantIdOrEmail',
221
+ * { id: 'id' },
222
+ * );
223
+ * ```
224
+ */
225
+ triggerReferral(participantIDOrEmail, params, options) {
226
+ const { id } = params;
227
+ return this._client.post(path `/campaign/${id}/participant/${participantIDOrEmail}/ref`, options);
228
+ }
229
+ }
230
+ //# sourceMappingURL=participant.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participant.mjs","sourceRoot":"","sources":["../../src/resources/campaign/participant.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,oBAA4B,EAC5B,MAAiC,EACjC,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,EAAE,gBAAgB,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,oBAA4B,EAC5B,MAA+B,EAC/B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aA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s";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ /**
5
+ * Participant reward retrieval and manual reward operations.
6
+ */
7
+ export declare class Reward extends APIResource {
8
+ /**
9
+ * Removes a manually approved participant reward that has not already been
10
+ * approved.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const reward = await client.campaign.reward.delete(
15
+ * 'rewardId',
16
+ * { id: 'id' },
17
+ * );
18
+ * ```
19
+ */
20
+ delete(rewardID: string, params: RewardDeleteParams, options?: RequestOptions): APIPromise<RewardDeleteResponse>;
21
+ /**
22
+ * Approves a manually approved reward earned by a participant.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response = await client.campaign.reward.approve(
27
+ * 'rewardId',
28
+ * { id: 'id' },
29
+ * );
30
+ * ```
31
+ */
32
+ approve(rewardID: string, params: RewardApproveParams, options?: RequestOptions): APIPromise<RewardApproveResponse>;
33
+ /**
34
+ * Marks an approved participant reward as fulfilled.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const response = await client.campaign.reward.fulfill(
39
+ * 'rewardId',
40
+ * { id: 'id' },
41
+ * );
42
+ * ```
43
+ */
44
+ fulfill(rewardID: string, params: RewardFulfillParams, options?: RequestOptions): APIPromise<RewardFulfillResponse>;
45
+ }
46
+ export interface RewardDeleteResponse {
47
+ success: boolean;
48
+ }
49
+ export interface RewardApproveResponse {
50
+ success: boolean;
51
+ }
52
+ export interface RewardFulfillResponse {
53
+ success: boolean;
54
+ }
55
+ export interface RewardDeleteParams {
56
+ /**
57
+ * GrowSurf program ID.
58
+ */
59
+ id: string;
60
+ }
61
+ export interface RewardApproveParams {
62
+ /**
63
+ * Path param: GrowSurf program ID.
64
+ */
65
+ id: string;
66
+ /**
67
+ * Body param: Set true to mark the reward as fulfilled after approval.
68
+ */
69
+ fulfill?: boolean;
70
+ }
71
+ export interface RewardFulfillParams {
72
+ /**
73
+ * GrowSurf program ID.
74
+ */
75
+ id: string;
76
+ }
77
+ export declare namespace Reward {
78
+ export { type RewardDeleteResponse as RewardDeleteResponse, type RewardApproveResponse as RewardApproveResponse, type RewardFulfillResponse as RewardFulfillResponse, type RewardDeleteParams as RewardDeleteParams, type RewardApproveParams as RewardApproveParams, type RewardFulfillParams as RewardFulfillParams, };
79
+ }
80
+ //# sourceMappingURL=reward.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reward.d.mts","sourceRoot":"","sources":["../../src/resources/campaign/reward.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;CAIrC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -0,0 +1,80 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ /**
5
+ * Participant reward retrieval and manual reward operations.
6
+ */
7
+ export declare class Reward extends APIResource {
8
+ /**
9
+ * Removes a manually approved participant reward that has not already been
10
+ * approved.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const reward = await client.campaign.reward.delete(
15
+ * 'rewardId',
16
+ * { id: 'id' },
17
+ * );
18
+ * ```
19
+ */
20
+ delete(rewardID: string, params: RewardDeleteParams, options?: RequestOptions): APIPromise<RewardDeleteResponse>;
21
+ /**
22
+ * Approves a manually approved reward earned by a participant.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response = await client.campaign.reward.approve(
27
+ * 'rewardId',
28
+ * { id: 'id' },
29
+ * );
30
+ * ```
31
+ */
32
+ approve(rewardID: string, params: RewardApproveParams, options?: RequestOptions): APIPromise<RewardApproveResponse>;
33
+ /**
34
+ * Marks an approved participant reward as fulfilled.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const response = await client.campaign.reward.fulfill(
39
+ * 'rewardId',
40
+ * { id: 'id' },
41
+ * );
42
+ * ```
43
+ */
44
+ fulfill(rewardID: string, params: RewardFulfillParams, options?: RequestOptions): APIPromise<RewardFulfillResponse>;
45
+ }
46
+ export interface RewardDeleteResponse {
47
+ success: boolean;
48
+ }
49
+ export interface RewardApproveResponse {
50
+ success: boolean;
51
+ }
52
+ export interface RewardFulfillResponse {
53
+ success: boolean;
54
+ }
55
+ export interface RewardDeleteParams {
56
+ /**
57
+ * GrowSurf program ID.
58
+ */
59
+ id: string;
60
+ }
61
+ export interface RewardApproveParams {
62
+ /**
63
+ * Path param: GrowSurf program ID.
64
+ */
65
+ id: string;
66
+ /**
67
+ * Body param: Set true to mark the reward as fulfilled after approval.
68
+ */
69
+ fulfill?: boolean;
70
+ }
71
+ export interface RewardFulfillParams {
72
+ /**
73
+ * GrowSurf program ID.
74
+ */
75
+ id: string;
76
+ }
77
+ export declare namespace Reward {
78
+ export { type RewardDeleteResponse as RewardDeleteResponse, type RewardApproveResponse as RewardApproveResponse, type RewardFulfillResponse as RewardFulfillResponse, type RewardDeleteParams as RewardDeleteParams, type RewardApproveParams as RewardApproveParams, type RewardFulfillParams as RewardFulfillParams, };
79
+ }
80
+ //# sourceMappingURL=reward.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reward.d.ts","sourceRoot":"","sources":["../../src/resources/campaign/reward.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAKpC;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cA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