@knocklabs/node 1.0.0 → 1.2.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 (414) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/api-promise.js +2 -15
  4. package/api-promise.js.map +1 -1
  5. package/client.d.mts +4 -1
  6. package/client.d.mts.map +1 -1
  7. package/client.d.ts +4 -1
  8. package/client.d.ts.map +1 -1
  9. package/client.js +27 -44
  10. package/client.js.map +1 -1
  11. package/client.mjs +18 -12
  12. package/client.mjs.map +1 -1
  13. package/core/api-promise.d.mts +0 -1
  14. package/core/api-promise.d.mts.map +1 -1
  15. package/core/api-promise.d.ts +0 -1
  16. package/core/api-promise.d.ts.map +1 -1
  17. package/core/api-promise.js +4 -14
  18. package/core/api-promise.js.map +1 -1
  19. package/core/api-promise.mjs +1 -11
  20. package/core/api-promise.mjs.map +1 -1
  21. package/core/error.d.mts +0 -1
  22. package/core/error.d.mts.map +1 -1
  23. package/core/error.d.ts +0 -1
  24. package/core/error.d.ts.map +1 -1
  25. package/core/error.js.map +1 -1
  26. package/core/error.mjs.map +1 -1
  27. package/core/pagination.d.mts +0 -1
  28. package/core/pagination.d.mts.map +1 -1
  29. package/core/pagination.d.ts +0 -1
  30. package/core/pagination.d.ts.map +1 -1
  31. package/core/pagination.js +3 -13
  32. package/core/pagination.js.map +1 -1
  33. package/core/pagination.mjs +1 -11
  34. package/core/pagination.mjs.map +1 -1
  35. package/error.js +2 -15
  36. package/error.js.map +1 -1
  37. package/internal/builtin-types.d.mts +0 -2
  38. package/internal/builtin-types.d.mts.map +1 -1
  39. package/internal/builtin-types.d.ts +0 -2
  40. package/internal/builtin-types.d.ts.map +1 -1
  41. package/internal/detect-platform.js.map +1 -1
  42. package/internal/detect-platform.mjs.map +1 -1
  43. package/internal/errors.d.mts.map +1 -1
  44. package/internal/errors.d.ts.map +1 -1
  45. package/internal/errors.js +2 -2
  46. package/internal/errors.js.map +1 -1
  47. package/internal/errors.mjs.map +1 -1
  48. package/internal/headers.d.mts +0 -1
  49. package/internal/headers.d.mts.map +1 -1
  50. package/internal/headers.d.ts +0 -1
  51. package/internal/headers.d.ts.map +1 -1
  52. package/internal/headers.js +1 -1
  53. package/internal/headers.js.map +1 -1
  54. package/internal/headers.mjs +1 -1
  55. package/internal/headers.mjs.map +1 -1
  56. package/internal/parse.d.mts +0 -1
  57. package/internal/parse.d.mts.map +1 -1
  58. package/internal/parse.d.ts +0 -1
  59. package/internal/parse.d.ts.map +1 -1
  60. package/internal/parse.js +1 -2
  61. package/internal/parse.js.map +1 -1
  62. package/internal/parse.mjs.map +1 -1
  63. package/internal/qs/stringify.js +1 -2
  64. package/internal/qs/stringify.js.map +1 -1
  65. package/internal/qs/stringify.mjs.map +1 -1
  66. package/internal/qs/utils.js +9 -9
  67. package/internal/qs/utils.js.map +1 -1
  68. package/internal/qs/utils.mjs.map +1 -1
  69. package/internal/request-options.d.mts +0 -1
  70. package/internal/request-options.d.mts.map +1 -1
  71. package/internal/request-options.d.ts +0 -1
  72. package/internal/request-options.d.ts.map +1 -1
  73. package/internal/shims.js +5 -6
  74. package/internal/shims.js.map +1 -1
  75. package/internal/shims.mjs.map +1 -1
  76. package/internal/to-file.d.mts +0 -1
  77. package/internal/to-file.d.mts.map +1 -1
  78. package/internal/to-file.d.ts +0 -1
  79. package/internal/to-file.d.ts.map +1 -1
  80. package/internal/to-file.js +4 -4
  81. package/internal/to-file.js.map +1 -1
  82. package/internal/to-file.mjs +3 -2
  83. package/internal/to-file.mjs.map +1 -1
  84. package/internal/tslib.js +81 -0
  85. package/internal/tslib.mjs +17 -0
  86. package/internal/types.d.mts +0 -1
  87. package/internal/types.d.mts.map +1 -1
  88. package/internal/types.d.ts +0 -1
  89. package/internal/types.d.ts.map +1 -1
  90. package/internal/uploads.d.mts +1 -3
  91. package/internal/uploads.d.mts.map +1 -1
  92. package/internal/uploads.d.ts +1 -3
  93. package/internal/uploads.d.ts.map +1 -1
  94. package/internal/uploads.js +16 -6
  95. package/internal/uploads.js.map +1 -1
  96. package/internal/uploads.mjs +12 -3
  97. package/internal/uploads.mjs.map +1 -1
  98. package/internal/utils/base64.d.mts.map +1 -1
  99. package/internal/utils/base64.d.ts.map +1 -1
  100. package/internal/utils/base64.js.map +1 -1
  101. package/internal/utils/base64.mjs.map +1 -1
  102. package/internal/utils/bytes.d.mts +1 -1
  103. package/internal/utils/bytes.d.mts.map +1 -1
  104. package/internal/utils/bytes.d.ts +1 -1
  105. package/internal/utils/bytes.d.ts.map +1 -1
  106. package/internal/utils/bytes.js +3 -4
  107. package/internal/utils/bytes.js.map +1 -1
  108. package/internal/utils/bytes.mjs.map +1 -1
  109. package/internal/utils/env.d.mts.map +1 -1
  110. package/internal/utils/env.d.ts.map +1 -1
  111. package/internal/utils/env.js.map +1 -1
  112. package/internal/utils/env.mjs.map +1 -1
  113. package/internal/utils/log.d.mts +0 -1
  114. package/internal/utils/log.d.mts.map +1 -1
  115. package/internal/utils/log.d.ts +0 -1
  116. package/internal/utils/log.d.ts.map +1 -1
  117. package/internal/utils/log.js +2 -2
  118. package/internal/utils/log.js.map +1 -1
  119. package/internal/utils/log.mjs.map +1 -1
  120. package/internal/utils/path.d.mts.map +1 -1
  121. package/internal/utils/path.d.ts.map +1 -1
  122. package/internal/utils/path.js +2 -2
  123. package/internal/utils/path.js.map +1 -1
  124. package/internal/utils/path.mjs.map +1 -1
  125. package/internal/utils/sleep.d.mts.map +1 -1
  126. package/internal/utils/sleep.d.ts.map +1 -1
  127. package/internal/utils/uuid.d.mts +1 -1
  128. package/internal/utils/uuid.d.mts.map +1 -1
  129. package/internal/utils/uuid.d.ts +1 -1
  130. package/internal/utils/uuid.d.ts.map +1 -1
  131. package/internal/utils/uuid.js +1 -2
  132. package/internal/utils/uuid.js.map +1 -1
  133. package/internal/utils/uuid.mjs +1 -2
  134. package/internal/utils/uuid.mjs.map +1 -1
  135. package/internal/utils/values.d.mts.map +1 -1
  136. package/internal/utils/values.d.ts.map +1 -1
  137. package/internal/utils/values.js +5 -5
  138. package/internal/utils/values.js.map +1 -1
  139. package/internal/utils/values.mjs.map +1 -1
  140. package/internal/utils.js +7 -20
  141. package/internal/utils.js.map +1 -1
  142. package/lib/index.js +3 -16
  143. package/lib/index.js.map +1 -1
  144. package/lib/tokenSigner.js +5 -28
  145. package/lib/tokenSigner.js.map +1 -1
  146. package/lib/tokenSigner.mjs.map +1 -1
  147. package/lib/userTokens.js +1 -1
  148. package/lib/userTokens.js.map +1 -1
  149. package/package.json +2 -6
  150. package/pagination.js +2 -15
  151. package/pagination.js.map +1 -1
  152. package/resource.js +2 -15
  153. package/resource.js.map +1 -1
  154. package/resources/audiences.d.mts +37 -0
  155. package/resources/audiences.d.mts.map +1 -1
  156. package/resources/audiences.d.ts +37 -0
  157. package/resources/audiences.d.ts.map +1 -1
  158. package/resources/audiences.js +25 -0
  159. package/resources/audiences.js.map +1 -1
  160. package/resources/audiences.mjs +25 -0
  161. package/resources/audiences.mjs.map +1 -1
  162. package/resources/bulk-operations.d.mts +7 -0
  163. package/resources/bulk-operations.d.mts.map +1 -1
  164. package/resources/bulk-operations.d.ts +7 -0
  165. package/resources/bulk-operations.d.ts.map +1 -1
  166. package/resources/bulk-operations.js +7 -0
  167. package/resources/bulk-operations.js.map +1 -1
  168. package/resources/bulk-operations.mjs +7 -0
  169. package/resources/bulk-operations.mjs.map +1 -1
  170. package/resources/channels/bulk.d.mts +21 -0
  171. package/resources/channels/bulk.d.mts.map +1 -1
  172. package/resources/channels/bulk.d.ts +21 -0
  173. package/resources/channels/bulk.d.ts.map +1 -1
  174. package/resources/channels/bulk.js +21 -0
  175. package/resources/channels/bulk.js.map +1 -1
  176. package/resources/channels/bulk.mjs +21 -0
  177. package/resources/channels/bulk.mjs.map +1 -1
  178. package/resources/channels/channels.js +2 -24
  179. package/resources/channels/channels.js.map +1 -1
  180. package/resources/channels.js +2 -15
  181. package/resources/channels.js.map +1 -1
  182. package/resources/integrations/integrations.js +3 -25
  183. package/resources/integrations/integrations.js.map +1 -1
  184. package/resources/integrations.js +2 -15
  185. package/resources/integrations.js.map +1 -1
  186. package/resources/messages/batch.d.mts +76 -0
  187. package/resources/messages/batch.d.mts.map +1 -1
  188. package/resources/messages/batch.d.ts +76 -0
  189. package/resources/messages/batch.d.ts.map +1 -1
  190. package/resources/messages/batch.js +76 -0
  191. package/resources/messages/batch.js.map +1 -1
  192. package/resources/messages/batch.mjs +76 -0
  193. package/resources/messages/batch.mjs.map +1 -1
  194. package/resources/messages/index.d.mts +0 -1
  195. package/resources/messages/index.d.mts.map +1 -1
  196. package/resources/messages/index.d.ts +0 -1
  197. package/resources/messages/index.d.ts.map +1 -1
  198. package/resources/messages/index.js +1 -3
  199. package/resources/messages/index.js.map +1 -1
  200. package/resources/messages/index.mjs +0 -1
  201. package/resources/messages/index.mjs.map +1 -1
  202. package/resources/messages/messages.d.mts +101 -4
  203. package/resources/messages/messages.d.mts.map +1 -1
  204. package/resources/messages/messages.d.ts +101 -4
  205. package/resources/messages/messages.d.ts.map +1 -1
  206. package/resources/messages/messages.js +103 -28
  207. package/resources/messages/messages.js.map +1 -1
  208. package/resources/messages/messages.mjs +101 -4
  209. package/resources/messages/messages.mjs.map +1 -1
  210. package/resources/messages.js +2 -15
  211. package/resources/messages.js.map +1 -1
  212. package/resources/objects/bulk.d.mts +49 -0
  213. package/resources/objects/bulk.d.mts.map +1 -1
  214. package/resources/objects/bulk.d.ts +49 -0
  215. package/resources/objects/bulk.d.ts.map +1 -1
  216. package/resources/objects/bulk.js +49 -0
  217. package/resources/objects/bulk.js.map +1 -1
  218. package/resources/objects/bulk.mjs +49 -0
  219. package/resources/objects/bulk.mjs.map +1 -1
  220. package/resources/objects/objects.d.mts +179 -5
  221. package/resources/objects/objects.d.mts.map +1 -1
  222. package/resources/objects/objects.d.ts +179 -5
  223. package/resources/objects/objects.d.ts.map +1 -1
  224. package/resources/objects/objects.js +173 -24
  225. package/resources/objects/objects.js.map +1 -1
  226. package/resources/objects/objects.mjs +171 -0
  227. package/resources/objects/objects.mjs.map +1 -1
  228. package/resources/objects.js +2 -15
  229. package/resources/objects.js.map +1 -1
  230. package/resources/providers/ms-teams.d.mts +40 -0
  231. package/resources/providers/ms-teams.d.mts.map +1 -1
  232. package/resources/providers/ms-teams.d.ts +40 -0
  233. package/resources/providers/ms-teams.d.ts.map +1 -1
  234. package/resources/providers/ms-teams.js +40 -0
  235. package/resources/providers/ms-teams.js.map +1 -1
  236. package/resources/providers/ms-teams.mjs +40 -0
  237. package/resources/providers/ms-teams.mjs.map +1 -1
  238. package/resources/providers/providers.js +3 -25
  239. package/resources/providers/providers.js.map +1 -1
  240. package/resources/providers/slack.d.mts +27 -0
  241. package/resources/providers/slack.d.mts.map +1 -1
  242. package/resources/providers/slack.d.ts +27 -0
  243. package/resources/providers/slack.d.ts.map +1 -1
  244. package/resources/providers/slack.js +27 -0
  245. package/resources/providers/slack.js.map +1 -1
  246. package/resources/providers/slack.mjs +27 -0
  247. package/resources/providers/slack.mjs.map +1 -1
  248. package/resources/providers.js +2 -15
  249. package/resources/providers.js.map +1 -1
  250. package/resources/recipients/channel-data.d.mts +1 -1
  251. package/resources/recipients/channel-data.d.mts.map +1 -1
  252. package/resources/recipients/channel-data.d.ts +1 -1
  253. package/resources/recipients/channel-data.d.ts.map +1 -1
  254. package/resources/recipients/recipients.js +4 -26
  255. package/resources/recipients/recipients.js.map +1 -1
  256. package/resources/recipients.js +2 -15
  257. package/resources/recipients.js.map +1 -1
  258. package/resources/schedules/bulk.d.mts +30 -0
  259. package/resources/schedules/bulk.d.mts.map +1 -1
  260. package/resources/schedules/bulk.d.ts +30 -0
  261. package/resources/schedules/bulk.d.ts.map +1 -1
  262. package/resources/schedules/bulk.js +30 -0
  263. package/resources/schedules/bulk.js.map +1 -1
  264. package/resources/schedules/bulk.mjs +30 -0
  265. package/resources/schedules/bulk.mjs.map +1 -1
  266. package/resources/schedules/schedules.d.mts +75 -2
  267. package/resources/schedules/schedules.d.mts.map +1 -1
  268. package/resources/schedules/schedules.d.ts +75 -2
  269. package/resources/schedules/schedules.d.ts.map +1 -1
  270. package/resources/schedules/schedules.js +76 -24
  271. package/resources/schedules/schedules.js.map +1 -1
  272. package/resources/schedules/schedules.mjs +74 -0
  273. package/resources/schedules/schedules.mjs.map +1 -1
  274. package/resources/schedules.js +2 -15
  275. package/resources/schedules.js.map +1 -1
  276. package/resources/tenants/bulk.d.mts +14 -0
  277. package/resources/tenants/bulk.d.mts.map +1 -1
  278. package/resources/tenants/bulk.d.ts +14 -0
  279. package/resources/tenants/bulk.d.ts.map +1 -1
  280. package/resources/tenants/bulk.js +14 -0
  281. package/resources/tenants/bulk.js.map +1 -1
  282. package/resources/tenants/bulk.mjs +14 -0
  283. package/resources/tenants/bulk.mjs.map +1 -1
  284. package/resources/tenants/tenants.d.mts +33 -0
  285. package/resources/tenants/tenants.d.mts.map +1 -1
  286. package/resources/tenants/tenants.d.ts +33 -0
  287. package/resources/tenants/tenants.d.ts.map +1 -1
  288. package/resources/tenants/tenants.js +35 -24
  289. package/resources/tenants/tenants.js.map +1 -1
  290. package/resources/tenants/tenants.mjs +33 -0
  291. package/resources/tenants/tenants.mjs.map +1 -1
  292. package/resources/tenants.js +2 -15
  293. package/resources/tenants.js.map +1 -1
  294. package/resources/users/bulk.d.mts +41 -0
  295. package/resources/users/bulk.d.mts.map +1 -1
  296. package/resources/users/bulk.d.ts +41 -0
  297. package/resources/users/bulk.d.ts.map +1 -1
  298. package/resources/users/bulk.js +41 -0
  299. package/resources/users/bulk.js.map +1 -1
  300. package/resources/users/bulk.mjs +41 -0
  301. package/resources/users/bulk.mjs.map +1 -1
  302. package/resources/users/feeds.d.mts +19 -0
  303. package/resources/users/feeds.d.mts.map +1 -1
  304. package/resources/users/feeds.d.ts +19 -0
  305. package/resources/users/feeds.d.ts.map +1 -1
  306. package/resources/users/feeds.js +19 -0
  307. package/resources/users/feeds.js.map +1 -1
  308. package/resources/users/feeds.mjs +19 -0
  309. package/resources/users/feeds.mjs.map +1 -1
  310. package/resources/users/guides.d.mts +68 -0
  311. package/resources/users/guides.d.mts.map +1 -1
  312. package/resources/users/guides.d.ts +68 -0
  313. package/resources/users/guides.d.ts.map +1 -1
  314. package/resources/users/guides.js +68 -0
  315. package/resources/users/guides.js.map +1 -1
  316. package/resources/users/guides.mjs +68 -0
  317. package/resources/users/guides.mjs.map +1 -1
  318. package/resources/users/users.d.mts +182 -15
  319. package/resources/users/users.d.mts.map +1 -1
  320. package/resources/users/users.d.ts +182 -15
  321. package/resources/users/users.d.ts.map +1 -1
  322. package/resources/users/users.js +143 -26
  323. package/resources/users/users.js.map +1 -1
  324. package/resources/users/users.mjs +139 -0
  325. package/resources/users/users.mjs.map +1 -1
  326. package/resources/users.js +2 -15
  327. package/resources/users.js.map +1 -1
  328. package/resources/workflows.d.mts +30 -0
  329. package/resources/workflows.d.mts.map +1 -1
  330. package/resources/workflows.d.ts +30 -0
  331. package/resources/workflows.d.ts.map +1 -1
  332. package/resources/workflows.js +30 -0
  333. package/resources/workflows.js.map +1 -1
  334. package/resources/workflows.mjs +30 -0
  335. package/resources/workflows.mjs.map +1 -1
  336. package/resources.js +2 -15
  337. package/resources.js.map +1 -1
  338. package/src/client.ts +17 -0
  339. package/src/internal/headers.ts +1 -1
  340. package/src/internal/to-file.ts +4 -2
  341. package/src/internal/uploads.ts +16 -4
  342. package/src/internal/utils/uuid.ts +1 -3
  343. package/src/resources/audiences.ts +37 -0
  344. package/src/resources/bulk-operations.ts +7 -0
  345. package/src/resources/channels/bulk.ts +21 -0
  346. package/src/resources/messages/batch.ts +76 -0
  347. package/src/resources/messages/index.ts +0 -1
  348. package/src/resources/messages/messages.ts +101 -6
  349. package/src/resources/objects/bulk.ts +49 -0
  350. package/src/resources/objects/objects.ts +179 -5
  351. package/src/resources/providers/ms-teams.ts +40 -0
  352. package/src/resources/providers/slack.ts +27 -0
  353. package/src/resources/recipients/channel-data.ts +4 -1
  354. package/src/resources/schedules/bulk.ts +30 -0
  355. package/src/resources/schedules/schedules.ts +75 -2
  356. package/src/resources/tenants/bulk.ts +14 -0
  357. package/src/resources/tenants/tenants.ts +33 -0
  358. package/src/resources/users/bulk.ts +41 -0
  359. package/src/resources/users/feeds.ts +19 -0
  360. package/src/resources/users/guides.ts +68 -0
  361. package/src/resources/users/users.ts +188 -15
  362. package/src/resources/workflows.ts +30 -0
  363. package/src/version.ts +1 -1
  364. package/uploads.js +2 -15
  365. package/uploads.js.map +1 -1
  366. package/version.d.mts +1 -1
  367. package/version.d.ts +1 -1
  368. package/version.js +1 -1
  369. package/version.mjs +1 -1
  370. package/internal/shims/crypto.d.mts +0 -13
  371. package/internal/shims/crypto.d.mts.map +0 -1
  372. package/internal/shims/crypto.d.ts +0 -13
  373. package/internal/shims/crypto.d.ts.map +0 -1
  374. package/internal/shims/crypto.js +0 -13
  375. package/internal/shims/crypto.js.map +0 -1
  376. package/internal/shims/crypto.mjs +0 -9
  377. package/internal/shims/crypto.mjs.map +0 -1
  378. package/internal/shims/file.d.mts +0 -23
  379. package/internal/shims/file.d.mts.map +0 -1
  380. package/internal/shims/file.d.ts +0 -23
  381. package/internal/shims/file.d.ts.map +0 -1
  382. package/internal/shims/file.js +0 -16
  383. package/internal/shims/file.js.map +0 -1
  384. package/internal/shims/file.mjs +0 -12
  385. package/internal/shims/file.mjs.map +0 -1
  386. package/internal/shims/getBuiltinModule.d.mts +0 -11
  387. package/internal/shims/getBuiltinModule.d.mts.map +0 -1
  388. package/internal/shims/getBuiltinModule.d.ts +0 -11
  389. package/internal/shims/getBuiltinModule.d.ts.map +0 -1
  390. package/internal/shims/getBuiltinModule.js +0 -71
  391. package/internal/shims/getBuiltinModule.js.map +0 -1
  392. package/internal/shims/getBuiltinModule.mjs +0 -67
  393. package/internal/shims/getBuiltinModule.mjs.map +0 -1
  394. package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
  395. package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
  396. package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
  397. package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
  398. package/internal/shims/nullGetBuiltinModule.js +0 -5
  399. package/internal/shims/nullGetBuiltinModule.js.map +0 -1
  400. package/internal/shims/nullGetBuiltinModule.mjs +0 -2
  401. package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
  402. package/resources/messages/activities.d.mts +0 -22
  403. package/resources/messages/activities.d.mts.map +0 -1
  404. package/resources/messages/activities.d.ts +0 -22
  405. package/resources/messages/activities.d.ts.map +0 -1
  406. package/resources/messages/activities.js +0 -17
  407. package/resources/messages/activities.js.map +0 -1
  408. package/resources/messages/activities.mjs +0 -13
  409. package/resources/messages/activities.mjs.map +0 -1
  410. package/src/internal/shims/crypto.ts +0 -18
  411. package/src/internal/shims/file.ts +0 -32
  412. package/src/internal/shims/getBuiltinModule.ts +0 -66
  413. package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
  414. package/src/resources/messages/activities.ts +0 -38
@@ -46,6 +46,30 @@ export class Users extends APIResource {
46
46
  * Create or update a user with the provided identification data. When you identify
47
47
  * an existing user, the system merges the properties you specific with what is
48
48
  * currently set on the user, updating only the fields included in your requests.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const user = await client.users.update('user_id', {
53
+ * channel_data: {
54
+ * '97c5837d-c65c-4d54-aa39-080eeb81c69d': {
55
+ * tokens: ['push_token_123'],
56
+ * },
57
+ * },
58
+ * email: 'ian.malcolm@chaos.theory',
59
+ * name: 'Dr. Ian Malcolm',
60
+ * preferences: {
61
+ * default: {
62
+ * channel_types: { email: true },
63
+ * workflows: {
64
+ * 'dinosaurs-loose': {
65
+ * channel_types: { email: true },
66
+ * },
67
+ * },
68
+ * },
69
+ * },
70
+ * timezone: 'America/New_York',
71
+ * });
72
+ * ```
49
73
  */
50
74
  update(userID: string, body: UserUpdateParams, options?: RequestOptions): APIPromise<User> {
51
75
  return this._client.put(path`/v1/users/${userID}`, { body, ...options });
@@ -54,6 +78,14 @@ export class Users extends APIResource {
54
78
  /**
55
79
  * Retrieve a paginated list of users in the environment. Defaults to 50 users per
56
80
  * page.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * // Automatically fetches more pages as needed.
85
+ * for await (const user of client.users.list()) {
86
+ * // ...
87
+ * }
88
+ * ```
57
89
  */
58
90
  list(
59
91
  query: UserListParams | null | undefined = {},
@@ -64,6 +96,11 @@ export class Users extends APIResource {
64
96
 
65
97
  /**
66
98
  * Permanently delete a user and all associated data.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const user = await client.users.delete('user_id');
103
+ * ```
67
104
  */
68
105
  delete(userID: string, options?: RequestOptions): APIPromise<string> {
69
106
  return this._client.delete(path`/v1/users/${userID}`, options);
@@ -71,6 +108,11 @@ export class Users extends APIResource {
71
108
 
72
109
  /**
73
110
  * Retrieve a specific user by their ID.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const user = await client.users.get('user_id');
115
+ * ```
74
116
  */
75
117
  get(userID: string, options?: RequestOptions): APIPromise<User> {
76
118
  return this._client.get(path`/v1/users/${userID}`, options);
@@ -78,6 +120,14 @@ export class Users extends APIResource {
78
120
 
79
121
  /**
80
122
  * Retrieves the channel data for a specific user and channel ID.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const channelData = await client.users.getChannelData(
127
+ * 'user_id',
128
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
129
+ * );
130
+ * ```
81
131
  */
82
132
  getChannelData(
83
133
  userID: string,
@@ -90,6 +140,14 @@ export class Users extends APIResource {
90
140
  /**
91
141
  * Retrieves a specific preference set for a user identified by the preference set
92
142
  * ID.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * const preferenceSet = await client.users.getPreferences(
147
+ * 'user_id',
148
+ * 'default',
149
+ * );
150
+ * ```
93
151
  */
94
152
  getPreferences(
95
153
  userID: string,
@@ -104,6 +162,16 @@ export class Users extends APIResource {
104
162
  * Returns a paginated list of messages for a specific user. Allows filtering by
105
163
  * message status and provides various sorting options. Messages outside the
106
164
  * account's retention window will not be included in the results.
165
+ *
166
+ * @example
167
+ * ```ts
168
+ * // Automatically fetches more pages as needed.
169
+ * for await (const message of client.users.listMessages(
170
+ * 'user-123',
171
+ * )) {
172
+ * // ...
173
+ * }
174
+ * ```
107
175
  */
108
176
  listMessages(
109
177
  userID: string,
@@ -118,6 +186,13 @@ export class Users extends APIResource {
118
186
 
119
187
  /**
120
188
  * Retrieves a list of all preference sets for a specific user.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const preferenceSets = await client.users.listPreferences(
193
+ * 'user_id',
194
+ * );
195
+ * ```
121
196
  */
122
197
  listPreferences(userID: string, options?: RequestOptions): APIPromise<UserListPreferencesResponse> {
123
198
  return this._client.get(path`/v1/users/${userID}/preferences`, options);
@@ -125,6 +200,16 @@ export class Users extends APIResource {
125
200
 
126
201
  /**
127
202
  * Returns a paginated list of schedules for a specific user, in descending order.
203
+ *
204
+ * @example
205
+ * ```ts
206
+ * // Automatically fetches more pages as needed.
207
+ * for await (const schedule of client.users.listSchedules(
208
+ * 'user_id',
209
+ * )) {
210
+ * // ...
211
+ * }
212
+ * ```
128
213
  */
129
214
  listSchedules(
130
215
  userID: string,
@@ -141,6 +226,16 @@ export class Users extends APIResource {
141
226
  /**
142
227
  * Retrieves a paginated list of subscriptions for a specific user, in descending
143
228
  * order.
229
+ *
230
+ * @example
231
+ * ```ts
232
+ * // Automatically fetches more pages as needed.
233
+ * for await (const subscription of client.users.listSubscriptions(
234
+ * 'user_id',
235
+ * )) {
236
+ * // ...
237
+ * }
238
+ * ```
144
239
  */
145
240
  listSubscriptions(
146
241
  userID: string,
@@ -157,6 +252,13 @@ export class Users extends APIResource {
157
252
  /**
158
253
  * Merge two users together, where the user specified with the `from_user_id` param
159
254
  * will be merged into the user specified by `user_id`.
255
+ *
256
+ * @example
257
+ * ```ts
258
+ * const user = await client.users.merge('user_id', {
259
+ * from_user_id: 'user_1',
260
+ * });
261
+ * ```
160
262
  */
161
263
  merge(userID: string, body: UserMergeParams, options?: RequestOptions): APIPromise<User> {
162
264
  return this._client.post(path`/v1/users/${userID}/merge`, { body, ...options });
@@ -164,6 +266,15 @@ export class Users extends APIResource {
164
266
 
165
267
  /**
166
268
  * Updates or creates channel data for a specific user and channel ID.
269
+ *
270
+ * @example
271
+ * ```ts
272
+ * const channelData = await client.users.setChannelData(
273
+ * 'user_id',
274
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
275
+ * { data: { tokens: ['push_token_1'] } },
276
+ * );
277
+ * ```
167
278
  */
168
279
  setChannelData(
169
280
  userID: string,
@@ -177,6 +288,26 @@ export class Users extends APIResource {
177
288
  /**
178
289
  * Updates a complete preference set for a user. This is a destructive operation
179
290
  * that will replace the existing preference set for the user.
291
+ *
292
+ * @example
293
+ * ```ts
294
+ * const preferenceSet = await client.users.setPreferences(
295
+ * 'user_id',
296
+ * 'default',
297
+ * {
298
+ * categories: {
299
+ * marketing: false,
300
+ * transactional: { channel_types: { email: false } },
301
+ * },
302
+ * channel_types: { email: true },
303
+ * workflows: {
304
+ * 'dinosaurs-loose': {
305
+ * channel_types: { email: false },
306
+ * },
307
+ * },
308
+ * },
309
+ * );
310
+ * ```
180
311
  */
181
312
  setPreferences(
182
313
  userID: string,
@@ -189,6 +320,14 @@ export class Users extends APIResource {
189
320
 
190
321
  /**
191
322
  * Deletes channel data for a specific user and channel ID.
323
+ *
324
+ * @example
325
+ * ```ts
326
+ * const response = await client.users.unsetChannelData(
327
+ * 'user_id',
328
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
329
+ * );
330
+ * ```
192
331
  */
193
332
  unsetChannelData(userID: string, channelID: string, options?: RequestOptions): APIPromise<string> {
194
333
  return this._client.delete(path`/v1/users/${userID}/channel_data/${channelID}`, options);
@@ -234,7 +373,7 @@ export interface IdentifyUserRequest {
234
373
  name?: string | null;
235
374
 
236
375
  /**
237
- * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
376
+ * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
238
377
  * user (required for SMS channels).
239
378
  */
240
379
  phone_number?: string | null;
@@ -245,10 +384,10 @@ export interface IdentifyUserRequest {
245
384
  preferences?: PreferencesAPI.InlinePreferenceSetRequest | null;
246
385
 
247
386
  /**
248
- * The timezone of the user. Must be a valid
249
- * [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
250
- * Used for
251
- * [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
387
+ * The timezone of the user. Must be a
388
+ * valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
389
+ * Used
390
+ * for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
252
391
  */
253
392
  timezone?: string | null;
254
393
 
@@ -267,6 +406,11 @@ export interface InlineIdentifyUserRequest {
267
406
  */
268
407
  id: string;
269
408
 
409
+ /**
410
+ * URL to the user's avatar image.
411
+ */
412
+ avatar?: string | null;
413
+
270
414
  /**
271
415
  * A request to set channel data for a type of channel inline.
272
416
  */
@@ -277,11 +421,40 @@ export interface InlineIdentifyUserRequest {
277
421
  */
278
422
  created_at?: string | null;
279
423
 
424
+ /**
425
+ * The primary email address for the user.
426
+ */
427
+ email?: string | null;
428
+
429
+ /**
430
+ * The locale of the user. Used for [message localization](/concepts/translations).
431
+ */
432
+ locale?: string | null;
433
+
434
+ /**
435
+ * Display name of the user.
436
+ */
437
+ name?: string | null;
438
+
439
+ /**
440
+ * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
441
+ * user (required for SMS channels).
442
+ */
443
+ phone_number?: string | null;
444
+
280
445
  /**
281
446
  * Inline set preferences for a recipient, where the key is the preference set id.
282
447
  */
283
448
  preferences?: PreferencesAPI.InlinePreferenceSetRequest | null;
284
449
 
450
+ /**
451
+ * The timezone of the user. Must be a
452
+ * valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
453
+ * Used
454
+ * for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
455
+ */
456
+ timezone?: string | null;
457
+
285
458
  [k: string]: unknown;
286
459
  }
287
460
 
@@ -327,16 +500,16 @@ export interface User {
327
500
  name?: string | null;
328
501
 
329
502
  /**
330
- * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
503
+ * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
331
504
  * user (required for SMS channels).
332
505
  */
333
506
  phone_number?: string | null;
334
507
 
335
508
  /**
336
- * The timezone of the user. Must be a valid
337
- * [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
338
- * Used for
339
- * [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
509
+ * The timezone of the user. Must be a
510
+ * valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
511
+ * Used
512
+ * for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
340
513
  */
341
514
  timezone?: string | null;
342
515
 
@@ -390,7 +563,7 @@ export interface UserUpdateParams {
390
563
  name?: string | null;
391
564
 
392
565
  /**
393
- * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
566
+ * The [E.164](https://www.twilio.com/docs/glossary/what-e164) phone number of the
394
567
  * user (required for SMS channels).
395
568
  */
396
569
  phone_number?: string | null;
@@ -401,10 +574,10 @@ export interface UserUpdateParams {
401
574
  preferences?: PreferencesAPI.InlinePreferenceSetRequest | null;
402
575
 
403
576
  /**
404
- * The timezone of the user. Must be a valid
405
- * [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
406
- * Used for
407
- * [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
577
+ * The timezone of the user. Must be a
578
+ * valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
579
+ * Used
580
+ * for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
408
581
  */
409
582
  timezone?: string | null;
410
583
 
@@ -12,6 +12,14 @@ export class Workflows extends APIResource {
12
12
  * When invoked for a workflow using a specific workflow key and cancellation key,
13
13
  * will cancel any queued workflow runs associated with that key/cancellation key
14
14
  * pair. Can optionally be provided one or more recipients to scope the request to.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const response = await client.workflows.cancel('key', {
19
+ * cancellation_key: 'cancel-workflow-123',
20
+ * recipients: ['jhammond'],
21
+ * });
22
+ * ```
15
23
  */
16
24
  cancel(key: string, body: WorkflowCancelParams, options?: RequestOptions): APIPromise<string> {
17
25
  return this._client.post(path`/v1/workflows/${key}/cancel`, { body, ...options });
@@ -23,6 +31,28 @@ export class Workflows extends APIResource {
23
31
  * workflow runs are executed asynchronously. This endpoint also handles
24
32
  * [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
25
33
  * for the `actor`, `recipient`, and `tenant` fields.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const response = await client.workflows.trigger('key', {
38
+ * recipients: ['dr_grant', 'dr_sattler', 'dr_malcolm'],
39
+ * actor: 'mr_dna',
40
+ * cancellation_key: 'isla_nublar_incident_1993',
41
+ * data: {
42
+ * affected_areas: [
43
+ * 'visitor_center',
44
+ * 'raptor_pen',
45
+ * 'trex_paddock',
46
+ * ],
47
+ * attraction_id: 'paddock_rex_01',
48
+ * evacuation_protocol: 'active',
49
+ * message: 'Life finds a way',
50
+ * severity: 'critical',
51
+ * system_status: 'fences_failing',
52
+ * },
53
+ * tenant: 'ingen_isla_nublar',
54
+ * });
55
+ * ```
26
56
  */
27
57
  trigger(
28
58
  key: string,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.0.0'; // x-release-please-version
1
+ export const VERSION = '1.2.0'; // x-release-please-version
package/uploads.js CHANGED
@@ -1,19 +1,6 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("./internal/tslib.js");
17
4
  /** @deprecated Import from ./core/uploads instead */
18
- __exportStar(require("./core/uploads.js"), exports);
5
+ tslib_1.__exportStar(require("./core/uploads.js"), exports);
19
6
  //# sourceMappingURL=uploads.js.map
package/uploads.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,oDAA+B"}
1
+ {"version":3,"file":"uploads.js","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4DAA+B"}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0";
1
+ export declare const VERSION = "1.2.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.0";
1
+ export declare const VERSION = "1.2.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.0.0'; // x-release-please-version
4
+ exports.VERSION = '1.2.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.0.0'; // x-release-please-version
1
+ export const VERSION = '1.2.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,13 +0,0 @@
1
- type Crypto = {
2
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
3
- getRandomValues<T extends ArrayBufferView | null>(array: T): T;
4
- /**
5
- * Available only in secure contexts.
6
- *
7
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
8
- */
9
- randomUUID?: () => string;
10
- };
11
- export declare let getCrypto: () => Crypto | undefined;
12
- export {};
13
- //# sourceMappingURL=crypto.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.d.mts","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,yFAAyF;IACzF,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,IAAI,SAAS,EAAE,MAAM,MAAM,GAAG,SAKpC,CAAC"}
@@ -1,13 +0,0 @@
1
- type Crypto = {
2
- /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/getRandomValues) */
3
- getRandomValues<T extends ArrayBufferView | null>(array: T): T;
4
- /**
5
- * Available only in secure contexts.
6
- *
7
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Crypto/randomUUID)
8
- */
9
- randomUUID?: () => string;
10
- };
11
- export declare let getCrypto: () => Crypto | undefined;
12
- export {};
13
- //# sourceMappingURL=crypto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,yFAAyF;IACzF,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AACF,eAAO,IAAI,SAAS,EAAE,MAAM,MAAM,GAAG,SAKpC,CAAC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCrypto = void 0;
4
- const getBuiltinModule_1 = require("./getBuiltinModule.js");
5
- let getCrypto = function lazyGetCrypto() {
6
- if (exports.getCrypto !== lazyGetCrypto)
7
- return (0, exports.getCrypto)();
8
- const crypto = globalThis.crypto || (0, getBuiltinModule_1.getBuiltinModule)?.('node:crypto')?.webcrypto;
9
- exports.getCrypto = () => crypto;
10
- return crypto;
11
- };
12
- exports.getCrypto = getCrypto;
13
- //# sourceMappingURL=crypto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":";;;AAAA,4DAAsD;AAY/C,IAAI,SAAS,GAA6B,SAAS,aAAa;IACrE,IAAI,iBAAS,KAAK,aAAa;QAAE,OAAO,IAAA,iBAAS,GAAE,CAAC;IACpD,MAAM,MAAM,GAAY,UAAkB,CAAC,MAAM,IAAK,IAAA,mCAAgB,CAAA,EAAE,CAAC,aAAa,CAAS,EAAE,SAAS,CAAC;IAC3G,iBAAS,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AALS,QAAA,SAAS,aAKlB"}
@@ -1,9 +0,0 @@
1
- import { getBuiltinModule } from "./getBuiltinModule.mjs";
2
- export let getCrypto = function lazyGetCrypto() {
3
- if (getCrypto !== lazyGetCrypto)
4
- return getCrypto();
5
- const crypto = globalThis.crypto || getBuiltinModule?.('node:crypto')?.webcrypto;
6
- getCrypto = () => crypto;
7
- return crypto;
8
- };
9
- //# sourceMappingURL=crypto.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.mjs","sourceRoot":"","sources":["../../src/internal/shims/crypto.ts"],"names":[],"mappings":"OAAO,EAAE,gBAAgB,EAAE;AAY3B,MAAM,CAAC,IAAI,SAAS,GAA6B,SAAS,aAAa;IACrE,IAAI,SAAS,KAAK,aAAa;QAAE,OAAO,SAAS,EAAE,CAAC;IACpD,MAAM,MAAM,GAAY,UAAkB,CAAC,MAAM,IAAK,gBAAgB,EAAE,CAAC,aAAa,CAAS,EAAE,SAAS,CAAC;IAC3G,SAAS,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1,23 +0,0 @@
1
-
2
- export declare let getFile: () => FileConstructor;
3
- type FileConstructor = typeof globalThis extends {
4
- File: infer fileConstructor;
5
- } ? fileConstructor : typeof FallbackFile;
6
- export type File = InstanceType<FileConstructor>;
7
- type FallbackBlobSource = ConstructorParameters<typeof Blob>[0] extends infer T ? T : never;
8
- /**
9
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
10
- */
11
- declare class FallbackFile extends Blob {
12
- constructor(sources: FallbackBlobSource, fileName: string, options?: any);
13
- /**
14
- * The name of the `File`.
15
- */
16
- readonly name: string;
17
- /**
18
- * The last modified date of the `File`.
19
- */
20
- readonly lastModified: number;
21
- }
22
- export {};
23
- //# sourceMappingURL=file.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.d.mts","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":";AAEA,eAAO,IAAI,OAAO,QAA2B,eAO5C,CAAC;AAEF,KAAK,eAAe,GAClB,OAAO,UAAU,SAAS;IAAE,IAAI,EAAE,MAAM,eAAe,CAAA;CAAE,GAAG,eAAe,GAAG,OAAO,YAAY,CAAC;AACpG,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAIjD,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5F;;GAEG;AACH,OAAO,OAAO,YAAa,SAAQ,IAAI;gBACzB,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IACxE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
@@ -1,23 +0,0 @@
1
-
2
- export declare let getFile: () => FileConstructor;
3
- type FileConstructor = typeof globalThis extends {
4
- File: infer fileConstructor;
5
- } ? fileConstructor : typeof FallbackFile;
6
- export type File = InstanceType<FileConstructor>;
7
- type FallbackBlobSource = ConstructorParameters<typeof Blob>[0] extends infer T ? T : never;
8
- /**
9
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
10
- */
11
- declare class FallbackFile extends Blob {
12
- constructor(sources: FallbackBlobSource, fileName: string, options?: any);
13
- /**
14
- * The name of the `File`.
15
- */
16
- readonly name: string;
17
- /**
18
- * The last modified date of the `File`.
19
- */
20
- readonly lastModified: number;
21
- }
22
- export {};
23
- //# sourceMappingURL=file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":";AAEA,eAAO,IAAI,OAAO,QAA2B,eAO5C,CAAC;AAEF,KAAK,eAAe,GAClB,OAAO,UAAU,SAAS;IAAE,IAAI,EAAE,MAAM,eAAe,CAAA;CAAE,GAAG,eAAe,GAAG,OAAO,YAAY,CAAC;AACpG,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAIjD,KAAK,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC5F;;GAEG;AACH,OAAO,OAAO,YAAa,SAAQ,IAAI;gBACzB,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IACxE;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFile = void 0;
4
- const getBuiltinModule_1 = require("./getBuiltinModule.js");
5
- let getFile = function lazyGetFile() {
6
- if (exports.getFile !== lazyGetFile)
7
- return (0, exports.getFile)();
8
- // We can drop getBuiltinModule once we no longer support Node < 20.0.0
9
- const File = globalThis.File ?? (0, getBuiltinModule_1.getBuiltinModule)?.('node:buffer')?.File;
10
- if (!File)
11
- throw new Error('`File` is not defined as a global, which is required for file uploads.');
12
- exports.getFile = () => File;
13
- return File;
14
- };
15
- exports.getFile = getFile;
16
- //# sourceMappingURL=file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":";;;AAAA,4DAAsD;AAE/C,IAAI,OAAO,GAAG,SAAS,WAAW;IACvC,IAAI,eAAO,KAAK,WAAW;QAAE,OAAO,IAAA,eAAO,GAAE,CAAC;IAC9C,uEAAuE;IACvE,MAAM,IAAI,GAAI,UAAkB,CAAC,IAAI,IAAK,IAAA,mCAAgB,CAAA,EAAE,CAAC,aAAa,CAAS,EAAE,IAAI,CAAC;IAC1F,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IACrG,eAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAPS,QAAA,OAAO,WAOhB"}
@@ -1,12 +0,0 @@
1
- import { getBuiltinModule } from "./getBuiltinModule.mjs";
2
- export let getFile = function lazyGetFile() {
3
- if (getFile !== lazyGetFile)
4
- return getFile();
5
- // We can drop getBuiltinModule once we no longer support Node < 20.0.0
6
- const File = globalThis.File ?? getBuiltinModule?.('node:buffer')?.File;
7
- if (!File)
8
- throw new Error('`File` is not defined as a global, which is required for file uploads.');
9
- getFile = () => File;
10
- return File;
11
- };
12
- //# sourceMappingURL=file.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.mjs","sourceRoot":"","sources":["../../src/internal/shims/file.ts"],"names":[],"mappings":"OAAO,EAAE,gBAAgB,EAAE;AAE3B,MAAM,CAAC,IAAI,OAAO,GAAG,SAAS,WAAW;IACvC,IAAI,OAAO,KAAK,WAAW;QAAE,OAAO,OAAO,EAAE,CAAC;IAC9C,uEAAuE;IACvE,MAAM,IAAI,GAAI,UAAkB,CAAC,IAAI,IAAK,gBAAgB,EAAE,CAAC,aAAa,CAAS,EAAE,IAAI,CAAC;IAC1F,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IACrG,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Load a Node built-in module. ID may or may not be prefixed by `node:` and
3
- * will be normalized. If we used static imports then our bundle size would be bloated by
4
- * injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
5
- * our code would not work when bundled to ESM and run in Node 18.
6
- * @param {string} id ID of the built-in to be loaded.
7
- * @returns {object|undefined} exports of the built-in. Undefined if the built-in
8
- * does not exist.
9
- */
10
- export declare let getBuiltinModule: null | ((id: string) => object | undefined);
11
- //# sourceMappingURL=getBuiltinModule.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getBuiltinModule.d.mts","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,IAAI,gBAAgB,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAwDtE,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Load a Node built-in module. ID may or may not be prefixed by `node:` and
3
- * will be normalized. If we used static imports then our bundle size would be bloated by
4
- * injected polyfills, and if we used dynamic require then in addition to bundlers logging warnings,
5
- * our code would not work when bundled to ESM and run in Node 18.
6
- * @param {string} id ID of the built-in to be loaded.
7
- * @returns {object|undefined} exports of the built-in. Undefined if the built-in
8
- * does not exist.
9
- */
10
- export declare let getBuiltinModule: null | ((id: string) => object | undefined);
11
- //# sourceMappingURL=getBuiltinModule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getBuiltinModule.d.ts","sourceRoot":"","sources":["../../src/internal/shims/getBuiltinModule.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,IAAI,gBAAgB,EAAE,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAwDtE,CAAC"}