@stigg/typescript 0.1.0-beta.65 → 0.1.0-beta.66

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 (349) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/v1/addons/addons.d.mts +59 -0
  4. package/resources/v1/addons/addons.d.mts.map +1 -1
  5. package/resources/v1/addons/addons.d.ts +59 -0
  6. package/resources/v1/addons/addons.d.ts.map +1 -1
  7. package/resources/v1/addons/addons.js +59 -0
  8. package/resources/v1/addons/addons.js.map +1 -1
  9. package/resources/v1/addons/addons.mjs +59 -0
  10. package/resources/v1/addons/addons.mjs.map +1 -1
  11. package/resources/v1/addons/entitlements.d.mts +31 -0
  12. package/resources/v1/addons/entitlements.d.mts.map +1 -1
  13. package/resources/v1/addons/entitlements.d.ts +31 -0
  14. package/resources/v1/addons/entitlements.d.ts.map +1 -1
  15. package/resources/v1/addons/entitlements.js +31 -0
  16. package/resources/v1/addons/entitlements.js.map +1 -1
  17. package/resources/v1/addons/entitlements.mjs +31 -0
  18. package/resources/v1/addons/entitlements.mjs.map +1 -1
  19. package/resources/v1/contracts.d.mts +30 -0
  20. package/resources/v1/contracts.d.mts.map +1 -1
  21. package/resources/v1/contracts.d.ts +30 -0
  22. package/resources/v1/contracts.d.ts.map +1 -1
  23. package/resources/v1/contracts.js +30 -0
  24. package/resources/v1/contracts.js.map +1 -1
  25. package/resources/v1/contracts.mjs +30 -0
  26. package/resources/v1/contracts.mjs.map +1 -1
  27. package/resources/v1/coupons.d.mts +36 -0
  28. package/resources/v1/coupons.d.mts.map +1 -1
  29. package/resources/v1/coupons.d.ts +36 -0
  30. package/resources/v1/coupons.d.ts.map +1 -1
  31. package/resources/v1/coupons.js +36 -0
  32. package/resources/v1/coupons.js.map +1 -1
  33. package/resources/v1/coupons.mjs +36 -0
  34. package/resources/v1/coupons.mjs.map +1 -1
  35. package/resources/v1/credits/consumption.d.mts +26 -0
  36. package/resources/v1/credits/consumption.d.mts.map +1 -1
  37. package/resources/v1/credits/consumption.d.ts +26 -0
  38. package/resources/v1/credits/consumption.d.ts.map +1 -1
  39. package/resources/v1/credits/consumption.js +26 -0
  40. package/resources/v1/credits/consumption.js.map +1 -1
  41. package/resources/v1/credits/consumption.mjs +26 -0
  42. package/resources/v1/credits/consumption.mjs.map +1 -1
  43. package/resources/v1/credits/credits.d.mts +25 -0
  44. package/resources/v1/credits/credits.d.mts.map +1 -1
  45. package/resources/v1/credits/credits.d.ts +25 -0
  46. package/resources/v1/credits/credits.d.ts.map +1 -1
  47. package/resources/v1/credits/credits.js +25 -0
  48. package/resources/v1/credits/credits.js.map +1 -1
  49. package/resources/v1/credits/credits.mjs +25 -0
  50. package/resources/v1/credits/credits.mjs.map +1 -1
  51. package/resources/v1/credits/custom-currencies.d.mts +49 -0
  52. package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
  53. package/resources/v1/credits/custom-currencies.d.ts +49 -0
  54. package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
  55. package/resources/v1/credits/custom-currencies.js +49 -0
  56. package/resources/v1/credits/custom-currencies.js.map +1 -1
  57. package/resources/v1/credits/custom-currencies.mjs +49 -0
  58. package/resources/v1/credits/custom-currencies.mjs.map +1 -1
  59. package/resources/v1/credits/grants.d.mts +28 -0
  60. package/resources/v1/credits/grants.d.mts.map +1 -1
  61. package/resources/v1/credits/grants.d.ts +28 -0
  62. package/resources/v1/credits/grants.d.ts.map +1 -1
  63. package/resources/v1/credits/grants.js +28 -0
  64. package/resources/v1/credits/grants.js.map +1 -1
  65. package/resources/v1/credits/grants.mjs +28 -0
  66. package/resources/v1/credits/grants.mjs.map +1 -1
  67. package/resources/v1/credits/reservations.d.mts +10 -0
  68. package/resources/v1/credits/reservations.d.mts.map +1 -1
  69. package/resources/v1/credits/reservations.d.ts +10 -0
  70. package/resources/v1/credits/reservations.d.ts.map +1 -1
  71. package/resources/v1/credits/reservations.js +10 -0
  72. package/resources/v1/credits/reservations.js.map +1 -1
  73. package/resources/v1/credits/reservations.mjs +10 -0
  74. package/resources/v1/credits/reservations.mjs.map +1 -1
  75. package/resources/v1/customers/customers.d.mts +182 -7
  76. package/resources/v1/customers/customers.d.mts.map +1 -1
  77. package/resources/v1/customers/customers.d.ts +182 -7
  78. package/resources/v1/customers/customers.d.ts.map +1 -1
  79. package/resources/v1/customers/customers.js +106 -6
  80. package/resources/v1/customers/customers.js.map +1 -1
  81. package/resources/v1/customers/customers.mjs +106 -6
  82. package/resources/v1/customers/customers.mjs.map +1 -1
  83. package/resources/v1/customers/entities/entities.d.mts +332 -0
  84. package/resources/v1/customers/entities/entities.d.mts.map +1 -0
  85. package/resources/v1/customers/entities/entities.d.ts +332 -0
  86. package/resources/v1/customers/entities/entities.d.ts.map +1 -0
  87. package/resources/v1/customers/entities/entities.js +139 -0
  88. package/resources/v1/customers/entities/entities.js.map +1 -0
  89. package/resources/v1/customers/entities/entities.mjs +134 -0
  90. package/resources/v1/customers/entities/entities.mjs.map +1 -0
  91. package/resources/v1/customers/entities/entitlements.d.mts +260 -0
  92. package/resources/v1/customers/entities/entitlements.d.mts.map +1 -0
  93. package/resources/v1/customers/entities/entitlements.d.ts +260 -0
  94. package/resources/v1/customers/entities/entitlements.d.ts.map +1 -0
  95. package/resources/v1/customers/entities/entitlements.js +87 -0
  96. package/resources/v1/customers/entities/entitlements.js.map +1 -0
  97. package/resources/v1/customers/entities/entitlements.mjs +83 -0
  98. package/resources/v1/customers/entities/entitlements.mjs.map +1 -0
  99. package/resources/v1/customers/entities/index.d.mts +3 -0
  100. package/resources/v1/customers/entities/index.d.mts.map +1 -0
  101. package/resources/v1/customers/entities/index.d.ts +3 -0
  102. package/resources/v1/customers/entities/index.d.ts.map +1 -0
  103. package/resources/v1/customers/entities/index.js +9 -0
  104. package/resources/v1/customers/entities/index.js.map +1 -0
  105. package/resources/v1/customers/entities/index.mjs +4 -0
  106. package/resources/v1/customers/entities/index.mjs.map +1 -0
  107. package/resources/v1/customers/entities.d.mts +2 -0
  108. package/resources/v1/customers/entities.d.mts.map +1 -0
  109. package/resources/v1/customers/entities.d.ts +2 -0
  110. package/resources/v1/customers/entities.d.ts.map +1 -0
  111. package/resources/v1/customers/entities.js +6 -0
  112. package/resources/v1/customers/entities.js.map +1 -0
  113. package/resources/v1/customers/entities.mjs +3 -0
  114. package/resources/v1/customers/entities.mjs.map +1 -0
  115. package/resources/v1/customers/index.d.mts +1 -0
  116. package/resources/v1/customers/index.d.mts.map +1 -1
  117. package/resources/v1/customers/index.d.ts +1 -0
  118. package/resources/v1/customers/index.d.ts.map +1 -1
  119. package/resources/v1/customers/index.js +3 -1
  120. package/resources/v1/customers/index.js.map +1 -1
  121. package/resources/v1/customers/index.mjs +1 -0
  122. package/resources/v1/customers/index.mjs.map +1 -1
  123. package/resources/v1/customers/integrations.d.mts +47 -0
  124. package/resources/v1/customers/integrations.d.mts.map +1 -1
  125. package/resources/v1/customers/integrations.d.ts +47 -0
  126. package/resources/v1/customers/integrations.d.ts.map +1 -1
  127. package/resources/v1/customers/integrations.js +47 -0
  128. package/resources/v1/customers/integrations.js.map +1 -1
  129. package/resources/v1/customers/integrations.mjs +47 -0
  130. package/resources/v1/customers/integrations.mjs.map +1 -1
  131. package/resources/v1/customers/payment-method.d.mts +16 -0
  132. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  133. package/resources/v1/customers/payment-method.d.ts +16 -0
  134. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  135. package/resources/v1/customers/payment-method.js +16 -0
  136. package/resources/v1/customers/payment-method.js.map +1 -1
  137. package/resources/v1/customers/payment-method.mjs +16 -0
  138. package/resources/v1/customers/payment-method.mjs.map +1 -1
  139. package/resources/v1/customers/promotional-entitlements.d.mts +51 -0
  140. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
  141. package/resources/v1/customers/promotional-entitlements.d.ts +51 -0
  142. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
  143. package/resources/v1/customers/promotional-entitlements.js +51 -0
  144. package/resources/v1/customers/promotional-entitlements.js.map +1 -1
  145. package/resources/v1/customers/promotional-entitlements.mjs +51 -0
  146. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
  147. package/resources/v1/entity-types.d.mts +291 -0
  148. package/resources/v1/entity-types.d.mts.map +1 -0
  149. package/resources/v1/entity-types.d.ts +291 -0
  150. package/resources/v1/entity-types.d.ts.map +1 -0
  151. package/resources/v1/entity-types.js +128 -0
  152. package/resources/v1/entity-types.js.map +1 -0
  153. package/resources/v1/entity-types.mjs +124 -0
  154. package/resources/v1/entity-types.mjs.map +1 -0
  155. package/resources/v1/events/beta/customers.d.mts +8 -0
  156. package/resources/v1/events/beta/customers.d.mts.map +1 -1
  157. package/resources/v1/events/beta/customers.d.ts +8 -0
  158. package/resources/v1/events/beta/customers.d.ts.map +1 -1
  159. package/resources/v1/events/beta/customers.js +8 -0
  160. package/resources/v1/events/beta/customers.js.map +1 -1
  161. package/resources/v1/events/beta/customers.mjs +8 -0
  162. package/resources/v1/events/beta/customers.mjs.map +1 -1
  163. package/resources/v1/events/data-export/data-export.d.mts +12 -0
  164. package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
  165. package/resources/v1/events/data-export/data-export.d.ts +12 -0
  166. package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
  167. package/resources/v1/events/data-export/data-export.js +12 -0
  168. package/resources/v1/events/data-export/data-export.js.map +1 -1
  169. package/resources/v1/events/data-export/data-export.mjs +12 -0
  170. package/resources/v1/events/data-export/data-export.mjs.map +1 -1
  171. package/resources/v1/events/data-export/destinations.d.mts +26 -0
  172. package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
  173. package/resources/v1/events/data-export/destinations.d.ts +26 -0
  174. package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
  175. package/resources/v1/events/data-export/destinations.js +26 -0
  176. package/resources/v1/events/data-export/destinations.js.map +1 -1
  177. package/resources/v1/events/data-export/destinations.mjs +26 -0
  178. package/resources/v1/events/data-export/destinations.mjs.map +1 -1
  179. package/resources/v1/events/events.d.mts +21 -0
  180. package/resources/v1/events/events.d.mts.map +1 -1
  181. package/resources/v1/events/events.d.ts +21 -0
  182. package/resources/v1/events/events.d.ts.map +1 -1
  183. package/resources/v1/events/events.js +21 -0
  184. package/resources/v1/events/events.js.map +1 -1
  185. package/resources/v1/events/events.mjs +21 -0
  186. package/resources/v1/events/events.mjs.map +1 -1
  187. package/resources/v1/features.d.mts +43 -0
  188. package/resources/v1/features.d.mts.map +1 -1
  189. package/resources/v1/features.d.ts +43 -0
  190. package/resources/v1/features.d.ts.map +1 -1
  191. package/resources/v1/features.js +43 -0
  192. package/resources/v1/features.js.map +1 -1
  193. package/resources/v1/features.mjs +43 -0
  194. package/resources/v1/features.mjs.map +1 -1
  195. package/resources/v1/index.d.mts +1 -0
  196. package/resources/v1/index.d.mts.map +1 -1
  197. package/resources/v1/index.d.ts +1 -0
  198. package/resources/v1/index.d.ts.map +1 -1
  199. package/resources/v1/index.js +3 -1
  200. package/resources/v1/index.js.map +1 -1
  201. package/resources/v1/index.mjs +1 -0
  202. package/resources/v1/index.mjs.map +1 -1
  203. package/resources/v1/plans/entitlements.d.mts +31 -0
  204. package/resources/v1/plans/entitlements.d.mts.map +1 -1
  205. package/resources/v1/plans/entitlements.d.ts +31 -0
  206. package/resources/v1/plans/entitlements.d.ts.map +1 -1
  207. package/resources/v1/plans/entitlements.js +31 -0
  208. package/resources/v1/plans/entitlements.js.map +1 -1
  209. package/resources/v1/plans/entitlements.mjs +31 -0
  210. package/resources/v1/plans/entitlements.mjs.map +1 -1
  211. package/resources/v1/plans/plans.d.mts +69 -0
  212. package/resources/v1/plans/plans.d.mts.map +1 -1
  213. package/resources/v1/plans/plans.d.ts +69 -0
  214. package/resources/v1/plans/plans.d.ts.map +1 -1
  215. package/resources/v1/plans/plans.js +69 -0
  216. package/resources/v1/plans/plans.js.map +1 -1
  217. package/resources/v1/plans/plans.mjs +69 -0
  218. package/resources/v1/plans/plans.mjs.map +1 -1
  219. package/resources/v1/products.d.mts +43 -0
  220. package/resources/v1/products.d.mts.map +1 -1
  221. package/resources/v1/products.d.ts +43 -0
  222. package/resources/v1/products.d.ts.map +1 -1
  223. package/resources/v1/products.js +43 -0
  224. package/resources/v1/products.js.map +1 -1
  225. package/resources/v1/products.mjs +43 -0
  226. package/resources/v1/products.mjs.map +1 -1
  227. package/resources/v1/subscriptions/future-update.d.mts +16 -0
  228. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  229. package/resources/v1/subscriptions/future-update.d.ts +16 -0
  230. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  231. package/resources/v1/subscriptions/future-update.js +16 -0
  232. package/resources/v1/subscriptions/future-update.js.map +1 -1
  233. package/resources/v1/subscriptions/future-update.mjs +16 -0
  234. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  235. package/resources/v1/subscriptions/invoice.d.mts +6 -0
  236. package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
  237. package/resources/v1/subscriptions/invoice.d.ts +6 -0
  238. package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
  239. package/resources/v1/subscriptions/invoice.js +6 -0
  240. package/resources/v1/subscriptions/invoice.js.map +1 -1
  241. package/resources/v1/subscriptions/invoice.mjs +6 -0
  242. package/resources/v1/subscriptions/invoice.mjs.map +1 -1
  243. package/resources/v1/subscriptions/subscriptions.d.mts +81 -0
  244. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  245. package/resources/v1/subscriptions/subscriptions.d.ts +81 -0
  246. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  247. package/resources/v1/subscriptions/subscriptions.js +81 -0
  248. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  249. package/resources/v1/subscriptions/subscriptions.mjs +81 -0
  250. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  251. package/resources/v1/subscriptions/usage.d.mts +13 -0
  252. package/resources/v1/subscriptions/usage.d.mts.map +1 -1
  253. package/resources/v1/subscriptions/usage.d.ts +13 -0
  254. package/resources/v1/subscriptions/usage.d.ts.map +1 -1
  255. package/resources/v1/subscriptions/usage.js +13 -0
  256. package/resources/v1/subscriptions/usage.js.map +1 -1
  257. package/resources/v1/subscriptions/usage.mjs +13 -0
  258. package/resources/v1/subscriptions/usage.mjs.map +1 -1
  259. package/resources/v1/usage.d.mts +20 -0
  260. package/resources/v1/usage.d.mts.map +1 -1
  261. package/resources/v1/usage.d.ts +20 -0
  262. package/resources/v1/usage.d.ts.map +1 -1
  263. package/resources/v1/usage.js +20 -0
  264. package/resources/v1/usage.js.map +1 -1
  265. package/resources/v1/usage.mjs +20 -0
  266. package/resources/v1/usage.mjs.map +1 -1
  267. package/resources/v1/v1.d.mts +4 -0
  268. package/resources/v1/v1.d.mts.map +1 -1
  269. package/resources/v1/v1.d.ts +4 -0
  270. package/resources/v1/v1.d.ts.map +1 -1
  271. package/resources/v1/v1.js +4 -0
  272. package/resources/v1/v1.js.map +1 -1
  273. package/resources/v1/v1.mjs +4 -0
  274. package/resources/v1/v1.mjs.map +1 -1
  275. package/resources/v1-beta/customers/assignments.d.mts +12 -33
  276. package/resources/v1-beta/customers/assignments.d.mts.map +1 -1
  277. package/resources/v1-beta/customers/assignments.d.ts +12 -33
  278. package/resources/v1-beta/customers/assignments.d.ts.map +1 -1
  279. package/resources/v1-beta/customers/assignments.js +7 -33
  280. package/resources/v1-beta/customers/assignments.js.map +1 -1
  281. package/resources/v1-beta/customers/assignments.mjs +7 -33
  282. package/resources/v1-beta/customers/assignments.mjs.map +1 -1
  283. package/resources/v1-beta/customers/entities.d.mts +17 -50
  284. package/resources/v1-beta/customers/entities.d.mts.map +1 -1
  285. package/resources/v1-beta/customers/entities.d.ts +17 -50
  286. package/resources/v1-beta/customers/entities.d.ts.map +1 -1
  287. package/resources/v1-beta/customers/entities.js +17 -50
  288. package/resources/v1-beta/customers/entities.js.map +1 -1
  289. package/resources/v1-beta/customers/entities.mjs +17 -50
  290. package/resources/v1-beta/customers/entities.mjs.map +1 -1
  291. package/resources/v1-beta/customers/entitlements.d.mts +7 -10
  292. package/resources/v1-beta/customers/entitlements.d.mts.map +1 -1
  293. package/resources/v1-beta/customers/entitlements.d.ts +7 -10
  294. package/resources/v1-beta/customers/entitlements.d.ts.map +1 -1
  295. package/resources/v1-beta/customers/entitlements.js +2 -5
  296. package/resources/v1-beta/customers/entitlements.js.map +1 -1
  297. package/resources/v1-beta/customers/entitlements.mjs +2 -5
  298. package/resources/v1-beta/customers/entitlements.mjs.map +1 -1
  299. package/resources/v1-beta/entity-types.d.mts +4 -27
  300. package/resources/v1-beta/entity-types.d.mts.map +1 -1
  301. package/resources/v1-beta/entity-types.d.ts +4 -27
  302. package/resources/v1-beta/entity-types.d.ts.map +1 -1
  303. package/resources/v1-beta/entity-types.js +4 -27
  304. package/resources/v1-beta/entity-types.js.map +1 -1
  305. package/resources/v1-beta/entity-types.mjs +4 -27
  306. package/resources/v1-beta/entity-types.mjs.map +1 -1
  307. package/src/resources/v1/addons/addons.ts +59 -0
  308. package/src/resources/v1/addons/entitlements.ts +31 -0
  309. package/src/resources/v1/contracts.ts +30 -0
  310. package/src/resources/v1/coupons.ts +36 -0
  311. package/src/resources/v1/credits/consumption.ts +26 -0
  312. package/src/resources/v1/credits/credits.ts +25 -0
  313. package/src/resources/v1/credits/custom-currencies.ts +49 -0
  314. package/src/resources/v1/credits/grants.ts +28 -0
  315. package/src/resources/v1/credits/reservations.ts +10 -0
  316. package/src/resources/v1/customers/customers.ts +217 -7
  317. package/src/resources/v1/customers/entities/entities.ts +470 -0
  318. package/src/resources/v1/customers/entities/entitlements.ts +347 -0
  319. package/src/resources/v1/customers/entities/index.ts +22 -0
  320. package/src/resources/v1/customers/entities.ts +3 -0
  321. package/src/resources/v1/customers/index.ts +12 -0
  322. package/src/resources/v1/customers/integrations.ts +47 -0
  323. package/src/resources/v1/customers/payment-method.ts +16 -0
  324. package/src/resources/v1/customers/promotional-entitlements.ts +51 -0
  325. package/src/resources/v1/entity-types.ts +402 -0
  326. package/src/resources/v1/events/beta/customers.ts +8 -0
  327. package/src/resources/v1/events/data-export/data-export.ts +12 -0
  328. package/src/resources/v1/events/data-export/destinations.ts +26 -0
  329. package/src/resources/v1/events/events.ts +21 -0
  330. package/src/resources/v1/features.ts +43 -0
  331. package/src/resources/v1/index.ts +12 -0
  332. package/src/resources/v1/plans/entitlements.ts +31 -0
  333. package/src/resources/v1/plans/plans.ts +69 -0
  334. package/src/resources/v1/products.ts +43 -0
  335. package/src/resources/v1/subscriptions/future-update.ts +16 -0
  336. package/src/resources/v1/subscriptions/invoice.ts +6 -0
  337. package/src/resources/v1/subscriptions/subscriptions.ts +81 -0
  338. package/src/resources/v1/subscriptions/usage.ts +13 -0
  339. package/src/resources/v1/usage.ts +20 -0
  340. package/src/resources/v1/v1.ts +28 -0
  341. package/src/resources/v1-beta/customers/assignments.ts +12 -33
  342. package/src/resources/v1-beta/customers/entities.ts +17 -50
  343. package/src/resources/v1-beta/customers/entitlements.ts +7 -10
  344. package/src/resources/v1-beta/entity-types.ts +4 -27
  345. package/src/version.ts +1 -1
  346. package/version.d.mts +1 -1
  347. package/version.d.ts +1 -1
  348. package/version.js +1 -1
  349. package/version.mjs +1 -1
@@ -0,0 +1,332 @@
1
+ import { APIResource } from "../../../../core/resource.js";
2
+ import * as EntitlementsAPI from "./entitlements.js";
3
+ import { EntitlementListParams, EntitlementListResponse, EntitlementListResponsesMyCursorIDPage, EntitlementUpsertParams, EntitlementUpsertResponse, Entitlements } from "./entitlements.js";
4
+ import { APIPromise } from "../../../../core/api-promise.js";
5
+ import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from "../../../../core/pagination.js";
6
+ import { RequestOptions } from "../../../../internal/request-options.js";
7
+ export declare class Entities extends APIResource {
8
+ entitlements: EntitlementsAPI.Entitlements;
9
+ /**
10
+ * Retrieves a single entity for the given customer by its identifier.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const entity = await client.v1.customers.entities.retrieve(
15
+ * 'x',
16
+ * { id: 'id' },
17
+ * );
18
+ * ```
19
+ */
20
+ retrieve(entityID: string, params: EntityRetrieveParams, options?: RequestOptions): APIPromise<EntityRetrieveResponse>;
21
+ /**
22
+ * Retrieves a paginated list of entities for the given customer.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * // Automatically fetches more pages as needed.
27
+ * for await (const entityListResponse of client.v1.customers.entities.list(
28
+ * 'id',
29
+ * )) {
30
+ * // ...
31
+ * }
32
+ * ```
33
+ */
34
+ list(id: string, params?: EntityListParams | null | undefined, options?: RequestOptions): PagePromise<EntityListResponsesMyCursorIDPage, EntityListResponse>;
35
+ /**
36
+ * Archives entities in bulk for the given customer by id. Upsert an archived
37
+ * entity to restore it.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const response = await client.v1.customers.entities.archive(
42
+ * 'id',
43
+ * { ids: ['user-7f3a0c1d', 'user-c4d1b2e9'] },
44
+ * );
45
+ * ```
46
+ */
47
+ archive(id: string, params: EntityArchiveParams, options?: RequestOptions): APIPromise<EntityArchiveResponse>;
48
+ /**
49
+ * Creates or updates entities in bulk for the given customer. Existing entities
50
+ * matched by id are updated; new ids are created. An upsert of an archived entity
51
+ * restores it. An entity on an archived entity type fails with 400.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const response = await client.v1.customers.entities.upsert(
56
+ * 'id',
57
+ * {
58
+ * entities: [
59
+ * {
60
+ * id: 'user-7f3a0c1d',
61
+ * displayName: 'Jane Doe',
62
+ * entityTypeId: 'user',
63
+ * metadata: { email: 'jane@acme.com', role: 'admin' },
64
+ * },
65
+ * {
66
+ * id: 'user-c4d1b2e9',
67
+ * displayName: 'John Roe',
68
+ * entityTypeId: 'user',
69
+ * metadata: { email: 'john@acme.com' },
70
+ * },
71
+ * ],
72
+ * },
73
+ * );
74
+ * ```
75
+ */
76
+ upsert(id: string, params: EntityUpsertParams, options?: RequestOptions): APIPromise<EntityUpsertResponse>;
77
+ }
78
+ export type EntityListResponsesMyCursorIDPage = MyCursorIDPage<EntityListResponse>;
79
+ /**
80
+ * Response object
81
+ */
82
+ export interface EntityRetrieveResponse {
83
+ /**
84
+ * A stored entity instance tracked by the governance service for a given customer
85
+ */
86
+ data: EntityRetrieveResponse.Data;
87
+ }
88
+ export declare namespace EntityRetrieveResponse {
89
+ /**
90
+ * A stored entity instance tracked by the governance service for a given customer
91
+ */
92
+ interface Data {
93
+ /**
94
+ * The unique identifier for the entity
95
+ */
96
+ id: string;
97
+ /**
98
+ * Timestamp of when the record was deleted
99
+ */
100
+ archivedAt: string | null;
101
+ /**
102
+ * Timestamp of when the record was created
103
+ */
104
+ createdAt: string;
105
+ /**
106
+ * Human-readable name for the entity, or null when none is set — in which case
107
+ * clients display the entity ID
108
+ */
109
+ displayName: string | null;
110
+ /**
111
+ * The entity type identifier this entity instantiates
112
+ */
113
+ entityTypeId: string;
114
+ /**
115
+ * Free-form key/value metadata attached to the entity
116
+ */
117
+ metadata: {
118
+ [key: string]: string;
119
+ };
120
+ /**
121
+ * Timestamp of when the record was last updated
122
+ */
123
+ updatedAt: string;
124
+ }
125
+ }
126
+ /**
127
+ * A stored entity instance tracked by the governance service for a given customer
128
+ */
129
+ export interface EntityListResponse {
130
+ /**
131
+ * The unique identifier for the entity
132
+ */
133
+ id: string;
134
+ /**
135
+ * Timestamp of when the record was deleted
136
+ */
137
+ archivedAt: string | null;
138
+ /**
139
+ * Timestamp of when the record was created
140
+ */
141
+ createdAt: string;
142
+ /**
143
+ * Human-readable name for the entity, or null when none is set — in which case
144
+ * clients display the entity ID
145
+ */
146
+ displayName: string | null;
147
+ /**
148
+ * The entity type identifier this entity instantiates
149
+ */
150
+ entityTypeId: string;
151
+ /**
152
+ * Free-form key/value metadata attached to the entity
153
+ */
154
+ metadata: {
155
+ [key: string]: string;
156
+ };
157
+ /**
158
+ * Timestamp of when the record was last updated
159
+ */
160
+ updatedAt: string;
161
+ }
162
+ /**
163
+ * Wrapped response echoing the ids that were acted on by an archive/unarchive call
164
+ */
165
+ export interface EntityArchiveResponse {
166
+ /**
167
+ * List of entity identifiers that were acted on
168
+ */
169
+ data: EntityArchiveResponse.Data;
170
+ }
171
+ export declare namespace EntityArchiveResponse {
172
+ /**
173
+ * List of entity identifiers that were acted on
174
+ */
175
+ interface Data {
176
+ /**
177
+ * Entity identifiers to act on
178
+ */
179
+ ids: Array<string>;
180
+ }
181
+ }
182
+ /**
183
+ * List of entities created or updated by an upsert request
184
+ */
185
+ export interface EntityUpsertResponse {
186
+ data: Array<EntityUpsertResponse.Data>;
187
+ }
188
+ export declare namespace EntityUpsertResponse {
189
+ /**
190
+ * A stored entity instance tracked by the governance service for a given customer
191
+ */
192
+ interface Data {
193
+ /**
194
+ * The unique identifier for the entity
195
+ */
196
+ id: string;
197
+ /**
198
+ * Timestamp of when the record was deleted
199
+ */
200
+ archivedAt: string | null;
201
+ /**
202
+ * Timestamp of when the record was created
203
+ */
204
+ createdAt: string;
205
+ /**
206
+ * Human-readable name for the entity, or null when none is set — in which case
207
+ * clients display the entity ID
208
+ */
209
+ displayName: string | null;
210
+ /**
211
+ * The entity type identifier this entity instantiates
212
+ */
213
+ entityTypeId: string;
214
+ /**
215
+ * Free-form key/value metadata attached to the entity
216
+ */
217
+ metadata: {
218
+ [key: string]: string;
219
+ };
220
+ /**
221
+ * Timestamp of when the record was last updated
222
+ */
223
+ updatedAt: string;
224
+ }
225
+ }
226
+ export interface EntityRetrieveParams {
227
+ /**
228
+ * Path param: The customer identifier (owner) the entity belongs to
229
+ */
230
+ id: string;
231
+ /**
232
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
233
+ * token); falls back to the user's first membership. Ignored for API-key auth.
234
+ */
235
+ 'X-ACCOUNT-ID'?: string;
236
+ /**
237
+ * Header param: Environment ID — required when authenticating with a user JWT
238
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
239
+ * intrinsic to the key).
240
+ */
241
+ 'X-ENVIRONMENT-ID'?: string;
242
+ }
243
+ export interface EntityListParams extends MyCursorIDPageParams {
244
+ /**
245
+ * Query param: Filter results to entities of a specific entity type, by the type's
246
+ * ID
247
+ */
248
+ entityTypeId?: string;
249
+ /**
250
+ * Query param: Whether to include archived entities. One of: true, false
251
+ */
252
+ includeArchived?: 'true' | 'false';
253
+ /**
254
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
255
+ * token); falls back to the user's first membership. Ignored for API-key auth.
256
+ */
257
+ 'X-ACCOUNT-ID'?: string;
258
+ /**
259
+ * Header param: Environment ID — required when authenticating with a user JWT
260
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
261
+ * intrinsic to the key).
262
+ */
263
+ 'X-ENVIRONMENT-ID'?: string;
264
+ }
265
+ export interface EntityArchiveParams {
266
+ /**
267
+ * Body param: Entity identifiers to act on
268
+ */
269
+ ids: Array<string>;
270
+ /**
271
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
272
+ * token); falls back to the user's first membership. Ignored for API-key auth.
273
+ */
274
+ 'X-ACCOUNT-ID'?: string;
275
+ /**
276
+ * Header param: Environment ID — required when authenticating with a user JWT
277
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
278
+ * intrinsic to the key).
279
+ */
280
+ 'X-ENVIRONMENT-ID'?: string;
281
+ }
282
+ export interface EntityUpsertParams {
283
+ /**
284
+ * Body param: List of entities to create or update (1-100 entries)
285
+ */
286
+ entities: Array<EntityUpsertParams.Entity>;
287
+ /**
288
+ * Header param: Account ID — optional when authenticating with a user JWT (Bearer
289
+ * token); falls back to the user's first membership. Ignored for API-key auth.
290
+ */
291
+ 'X-ACCOUNT-ID'?: string;
292
+ /**
293
+ * Header param: Environment ID — required when authenticating with a user JWT
294
+ * (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
295
+ * intrinsic to the key).
296
+ */
297
+ 'X-ENVIRONMENT-ID'?: string;
298
+ }
299
+ export declare namespace EntityUpsertParams {
300
+ /**
301
+ * A single entity to create or update.
302
+ */
303
+ interface Entity {
304
+ /**
305
+ * The unique identifier for the entity
306
+ */
307
+ id: string;
308
+ /**
309
+ * Human-readable name for the entity. Omit to preserve the stored value, or send
310
+ * an empty string or null to clear it.
311
+ */
312
+ displayName?: string | null;
313
+ /**
314
+ * The entity type ID this entity instantiates. Required when creating a new
315
+ * entity; on a re-upsert may be omitted to preserve the existing type. Governance
316
+ * returns 400 if missing on create.
317
+ */
318
+ entityTypeId?: string;
319
+ /**
320
+ * Free-form key/value metadata. Patch semantics: empty-string value removes a key,
321
+ * omitted keys are preserved.
322
+ */
323
+ metadata?: {
324
+ [key: string]: string;
325
+ };
326
+ }
327
+ }
328
+ export declare namespace Entities {
329
+ export { type EntityRetrieveResponse as EntityRetrieveResponse, type EntityListResponse as EntityListResponse, type EntityArchiveResponse as EntityArchiveResponse, type EntityUpsertResponse as EntityUpsertResponse, type EntityListResponsesMyCursorIDPage as EntityListResponsesMyCursorIDPage, type EntityRetrieveParams as EntityRetrieveParams, type EntityListParams as EntityListParams, type EntityArchiveParams as EntityArchiveParams, type EntityUpsertParams as EntityUpsertParams, };
330
+ export { Entitlements as Entitlements, type EntitlementListResponse as EntitlementListResponse, type EntitlementUpsertResponse as EntitlementUpsertResponse, type EntitlementListResponsesMyCursorIDPage as EntitlementListResponsesMyCursorIDPage, type EntitlementListParams as EntitlementListParams, type EntitlementUpsertParams as EntitlementUpsertParams, };
331
+ }
332
+ //# sourceMappingURL=entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../../src/resources/v1/customers/entities/entities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qCAAkC;AACxD,OAAO,KAAK,eAAe,0BAAuB;AAClD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,sCAAsC,EACtC,uBAAuB,EACvB,yBAAyB,EACzB,YAAY,EACb,0BAAuB;AACxB,OAAO,EAAE,UAAU,EAAE,wCAAqC;AAC1D,OAAO,EAAE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;QAEtB;;;WAGG;QACH,QAAQ,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACtC;CACF;AAID,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,139 @@
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.Entities = void 0;
5
+ const tslib_1 = require("../../../../internal/tslib.js");
6
+ const resource_1 = require("../../../../core/resource.js");
7
+ const EntitlementsAPI = tslib_1.__importStar(require("./entitlements.js"));
8
+ const entitlements_1 = require("./entitlements.js");
9
+ const pagination_1 = require("../../../../core/pagination.js");
10
+ const headers_1 = require("../../../../internal/headers.js");
11
+ const path_1 = require("../../../../internal/utils/path.js");
12
+ class Entities extends resource_1.APIResource {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.entitlements = new EntitlementsAPI.Entitlements(this._client);
16
+ }
17
+ /**
18
+ * Retrieves a single entity for the given customer by its identifier.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const entity = await client.v1.customers.entities.retrieve(
23
+ * 'x',
24
+ * { id: 'id' },
25
+ * );
26
+ * ```
27
+ */
28
+ retrieve(entityID, params, options) {
29
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
30
+ return this._client.get((0, path_1.path) `/api/v1/customers/${id}/entities/${entityID}`, {
31
+ ...options,
32
+ headers: (0, headers_1.buildHeaders)([
33
+ {
34
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
35
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
36
+ },
37
+ options?.headers,
38
+ ]),
39
+ });
40
+ }
41
+ /**
42
+ * Retrieves a paginated list of entities for the given customer.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * // Automatically fetches more pages as needed.
47
+ * for await (const entityListResponse of client.v1.customers.entities.list(
48
+ * 'id',
49
+ * )) {
50
+ * // ...
51
+ * }
52
+ * ```
53
+ */
54
+ list(id, params = {}, options) {
55
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
56
+ return this._client.getAPIList((0, path_1.path) `/api/v1/customers/${id}/entities`, (pagination_1.MyCursorIDPage), {
57
+ query,
58
+ ...options,
59
+ headers: (0, headers_1.buildHeaders)([
60
+ {
61
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
62
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
63
+ },
64
+ options?.headers,
65
+ ]),
66
+ });
67
+ }
68
+ /**
69
+ * Archives entities in bulk for the given customer by id. Upsert an archived
70
+ * entity to restore it.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const response = await client.v1.customers.entities.archive(
75
+ * 'id',
76
+ * { ids: ['user-7f3a0c1d', 'user-c4d1b2e9'] },
77
+ * );
78
+ * ```
79
+ */
80
+ archive(id, params, options) {
81
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
82
+ return this._client.post((0, path_1.path) `/api/v1/customers/${id}/entities/archive`, {
83
+ body,
84
+ ...options,
85
+ headers: (0, headers_1.buildHeaders)([
86
+ {
87
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
88
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
89
+ },
90
+ options?.headers,
91
+ ]),
92
+ });
93
+ }
94
+ /**
95
+ * Creates or updates entities in bulk for the given customer. Existing entities
96
+ * matched by id are updated; new ids are created. An upsert of an archived entity
97
+ * restores it. An entity on an archived entity type fails with 400.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const response = await client.v1.customers.entities.upsert(
102
+ * 'id',
103
+ * {
104
+ * entities: [
105
+ * {
106
+ * id: 'user-7f3a0c1d',
107
+ * displayName: 'Jane Doe',
108
+ * entityTypeId: 'user',
109
+ * metadata: { email: 'jane@acme.com', role: 'admin' },
110
+ * },
111
+ * {
112
+ * id: 'user-c4d1b2e9',
113
+ * displayName: 'John Roe',
114
+ * entityTypeId: 'user',
115
+ * metadata: { email: 'john@acme.com' },
116
+ * },
117
+ * ],
118
+ * },
119
+ * );
120
+ * ```
121
+ */
122
+ upsert(id, params, options) {
123
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
124
+ return this._client.put((0, path_1.path) `/api/v1/customers/${id}/entities`, {
125
+ body,
126
+ ...options,
127
+ headers: (0, headers_1.buildHeaders)([
128
+ {
129
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
130
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
131
+ },
132
+ options?.headers,
133
+ ]),
134
+ });
135
+ }
136
+ }
137
+ exports.Entities = Entities;
138
+ Entities.Entitlements = entitlements_1.Entitlements;
139
+ //# sourceMappingURL=entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.js","sourceRoot":"","sources":["../../../../src/resources/v1/customers/entities/entities.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,2DAAwD;AACxD,2EAAkD;AAClD,oDAOwB;AAExB,+DAAqG;AACrG,6DAA4D;AAE5D,6DAAuD;AAEvD,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4I9F,CAAC;IA1IC;;;;;;;;;;OAUG;IACH,QAAQ,CACN,QAAgB,EAChB,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;QACtF,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,EAAE,aAAa,QAAQ,EAAE,EAAE;YAC1E,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,EAAU,EACV,SAA8C,EAAE,EAChD,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAA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AAE,OAAwB;QACrE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3F,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,EAAE,WAAW,EAAE;YAC9D,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBACpE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACjF;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA7ID,4BA6IC;AA+RD,QAAQ,CAAC,YAAY,GAAG,2BAAY,CAAC"}
@@ -0,0 +1,134 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../../core/resource.mjs";
3
+ import * as EntitlementsAPI from "./entitlements.mjs";
4
+ import { Entitlements, } from "./entitlements.mjs";
5
+ import { MyCursorIDPage } from "../../../../core/pagination.mjs";
6
+ import { buildHeaders } from "../../../../internal/headers.mjs";
7
+ import { path } from "../../../../internal/utils/path.mjs";
8
+ export class Entities extends APIResource {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.entitlements = new EntitlementsAPI.Entitlements(this._client);
12
+ }
13
+ /**
14
+ * Retrieves a single entity for the given customer by its identifier.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const entity = await client.v1.customers.entities.retrieve(
19
+ * 'x',
20
+ * { id: 'id' },
21
+ * );
22
+ * ```
23
+ */
24
+ retrieve(entityID, params, options) {
25
+ const { id, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
26
+ return this._client.get(path `/api/v1/customers/${id}/entities/${entityID}`, {
27
+ ...options,
28
+ headers: buildHeaders([
29
+ {
30
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
31
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
32
+ },
33
+ options?.headers,
34
+ ]),
35
+ });
36
+ }
37
+ /**
38
+ * Retrieves a paginated list of entities for the given customer.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const entityListResponse of client.v1.customers.entities.list(
44
+ * 'id',
45
+ * )) {
46
+ * // ...
47
+ * }
48
+ * ```
49
+ */
50
+ list(id, params = {}, options) {
51
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
52
+ return this._client.getAPIList(path `/api/v1/customers/${id}/entities`, (MyCursorIDPage), {
53
+ query,
54
+ ...options,
55
+ headers: buildHeaders([
56
+ {
57
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
58
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
59
+ },
60
+ options?.headers,
61
+ ]),
62
+ });
63
+ }
64
+ /**
65
+ * Archives entities in bulk for the given customer by id. Upsert an archived
66
+ * entity to restore it.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const response = await client.v1.customers.entities.archive(
71
+ * 'id',
72
+ * { ids: ['user-7f3a0c1d', 'user-c4d1b2e9'] },
73
+ * );
74
+ * ```
75
+ */
76
+ archive(id, params, options) {
77
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
78
+ return this._client.post(path `/api/v1/customers/${id}/entities/archive`, {
79
+ body,
80
+ ...options,
81
+ headers: buildHeaders([
82
+ {
83
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
84
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
85
+ },
86
+ options?.headers,
87
+ ]),
88
+ });
89
+ }
90
+ /**
91
+ * Creates or updates entities in bulk for the given customer. Existing entities
92
+ * matched by id are updated; new ids are created. An upsert of an archived entity
93
+ * restores it. An entity on an archived entity type fails with 400.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const response = await client.v1.customers.entities.upsert(
98
+ * 'id',
99
+ * {
100
+ * entities: [
101
+ * {
102
+ * id: 'user-7f3a0c1d',
103
+ * displayName: 'Jane Doe',
104
+ * entityTypeId: 'user',
105
+ * metadata: { email: 'jane@acme.com', role: 'admin' },
106
+ * },
107
+ * {
108
+ * id: 'user-c4d1b2e9',
109
+ * displayName: 'John Roe',
110
+ * entityTypeId: 'user',
111
+ * metadata: { email: 'john@acme.com' },
112
+ * },
113
+ * ],
114
+ * },
115
+ * );
116
+ * ```
117
+ */
118
+ upsert(id, params, options) {
119
+ const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
120
+ return this._client.put(path `/api/v1/customers/${id}/entities`, {
121
+ body,
122
+ ...options,
123
+ headers: buildHeaders([
124
+ {
125
+ ...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
126
+ ...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
127
+ },
128
+ options?.headers,
129
+ ]),
130
+ });
131
+ }
132
+ }
133
+ Entities.Entitlements = Entitlements;
134
+ //# sourceMappingURL=entities.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entities.mjs","sourceRoot":"","sources":["../../../../src/resources/v1/customers/entities/entities.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,sCAAkC;AACxD,OAAO,KAAK,eAAe,2BAAuB;AAClD,OAAO,EAML,YAAY,GACb,2B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