@stigg/typescript 0.1.0-beta.20 → 0.1.0-beta.22
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.
- package/CHANGELOG.md +16 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/v1/addons/addons.d.mts +145 -94
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +145 -94
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +110 -76
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +110 -76
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +62 -36
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +62 -36
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +49 -39
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +49 -39
- package/resources/v1/addons/entitlements.mjs.map +1 -1
- package/resources/v1/addons/index.d.mts +2 -2
- package/resources/v1/addons/index.d.mts.map +1 -1
- package/resources/v1/addons/index.d.ts +2 -2
- package/resources/v1/addons/index.d.ts.map +1 -1
- package/resources/v1/addons/index.js.map +1 -1
- package/resources/v1/addons/index.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +81 -57
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +81 -57
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +60 -45
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +60 -45
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +60 -52
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +60 -52
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +36 -30
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +36 -30
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +98 -74
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +98 -74
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +76 -61
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +76 -61
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +63 -54
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +63 -54
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +35 -33
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +35 -33
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/index.d.mts +2 -2
- package/resources/v1/credits/index.d.mts.map +1 -1
- package/resources/v1/credits/index.d.ts +2 -2
- package/resources/v1/credits/index.d.ts.map +1 -1
- package/resources/v1/credits/index.js.map +1 -1
- package/resources/v1/credits/index.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +167 -127
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +167 -127
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +124 -96
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +124 -96
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +2 -2
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +2 -2
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/integrations.d.mts +66 -58
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +66 -58
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +57 -56
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +57 -56
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +33 -25
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +33 -25
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +26 -20
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +26 -20
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +42 -60
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +42 -60
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +38 -57
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +38 -57
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/events/data-export/data-export.d.mts +29 -21
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
- package/resources/v1/events/data-export/data-export.d.ts +29 -21
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
- package/resources/v1/events/data-export/data-export.js +27 -18
- package/resources/v1/events/data-export/data-export.js.map +1 -1
- package/resources/v1/events/data-export/data-export.mjs +27 -18
- package/resources/v1/events/data-export/data-export.mjs.map +1 -1
- package/resources/v1/events/data-export/destinations.d.mts +29 -22
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.ts +29 -22
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.js +26 -21
- package/resources/v1/events/data-export/destinations.js.map +1 -1
- package/resources/v1/events/data-export/destinations.mjs +26 -21
- package/resources/v1/events/data-export/destinations.mjs.map +1 -1
- package/resources/v1/events/data-export/index.d.mts +1 -1
- package/resources/v1/events/data-export/index.d.mts.map +1 -1
- package/resources/v1/events/data-export/index.d.ts +1 -1
- package/resources/v1/events/data-export/index.d.ts.map +1 -1
- package/resources/v1/events/data-export/index.js.map +1 -1
- package/resources/v1/events/data-export/index.mjs.map +1 -1
- package/resources/v1/events/events.d.mts +13 -19
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +13 -19
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +14 -19
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +14 -19
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/events/index.d.mts +0 -1
- package/resources/v1/events/index.d.mts.map +1 -1
- package/resources/v1/events/index.d.ts +0 -1
- package/resources/v1/events/index.d.ts.map +1 -1
- package/resources/v1/events/index.js +3 -5
- package/resources/v1/events/index.js.map +1 -1
- package/resources/v1/events/index.mjs +0 -1
- package/resources/v1/events/index.mjs.map +1 -1
- package/resources/v1/features.d.mts +109 -74
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +109 -74
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +72 -54
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +72 -54
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +7 -7
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +7 -7
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +62 -36
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +62 -36
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +49 -39
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +49 -39
- package/resources/v1/plans/entitlements.mjs.map +1 -1
- package/resources/v1/plans/index.d.mts +2 -2
- package/resources/v1/plans/index.d.mts.map +1 -1
- package/resources/v1/plans/index.d.ts +2 -2
- package/resources/v1/plans/index.d.ts.map +1 -1
- package/resources/v1/plans/index.js.map +1 -1
- package/resources/v1/plans/index.mjs.map +1 -1
- package/resources/v1/plans/plans.d.mts +159 -106
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +159 -106
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +127 -89
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +127 -89
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +97 -66
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +97 -66
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +73 -54
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +73 -54
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +29 -19
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +29 -19
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +25 -20
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +25 -20
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +4 -4
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +4 -4
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs +1 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +15 -8
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +15 -8
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +13 -8
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +13 -8
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +244 -161
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +244 -161
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +126 -100
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +128 -102
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +29 -17
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +29 -17
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +26 -17
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +26 -17
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/usage.d.mts +24 -26
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +24 -26
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +26 -28
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +26 -28
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +14 -14
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -14
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1-beta/customers/assignments.d.mts +242 -0
- package/resources/v1-beta/customers/assignments.d.mts.map +1 -0
- package/resources/v1-beta/customers/assignments.d.ts +242 -0
- package/resources/v1-beta/customers/assignments.d.ts.map +1 -0
- package/resources/v1-beta/customers/assignments.js +84 -0
- package/resources/v1-beta/customers/assignments.js.map +1 -0
- package/resources/v1-beta/customers/assignments.mjs +80 -0
- package/resources/v1-beta/customers/assignments.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.d.mts +1 -1
- package/resources/v1-beta/customers/customers.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.d.ts +1 -1
- package/resources/v1-beta/customers/customers.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.js +2 -2
- package/resources/v1-beta/customers/customers.js.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/customers.mjs +1 -1
- package/resources/v1-beta/customers/customers.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entities.d.mts +94 -47
- package/resources/v1-beta/customers/entities.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entities.d.ts +94 -47
- package/resources/v1-beta/customers/entities.d.ts.map +1 -0
- package/resources/v1-beta/customers/entities.js +150 -0
- package/resources/v1-beta/customers/entities.js.map +1 -0
- package/resources/v1-beta/customers/entities.mjs +146 -0
- package/resources/v1-beta/customers/entities.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entitlements.d.mts +27 -16
- package/resources/v1-beta/customers/entitlements.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers/entitlements.d.ts +27 -16
- package/resources/v1-beta/customers/entitlements.d.ts.map +1 -0
- package/resources/v1-beta/customers/entitlements.js +36 -0
- package/resources/v1-beta/customers/entitlements.js.map +1 -0
- package/resources/v1-beta/customers/entitlements.mjs +32 -0
- package/resources/v1-beta/customers/entitlements.mjs.map +1 -0
- package/resources/v1-beta/customers/index.d.mts.map +1 -0
- package/resources/v1-beta/customers/index.d.ts.map +1 -0
- package/resources/v1-beta/customers/index.js.map +1 -0
- package/resources/v1-beta/customers/index.mjs.map +1 -0
- package/resources/v1-beta/customers.d.mts.map +1 -0
- package/resources/v1-beta/customers.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/customers.js +1 -1
- package/resources/v1-beta/customers.js.map +1 -0
- package/resources/v1-beta/customers.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/entity-types.d.mts +44 -23
- package/resources/v1-beta/entity-types.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/entity-types.d.ts +44 -23
- package/resources/v1-beta/entity-types.d.ts.map +1 -0
- package/resources/v1-beta/entity-types.js +75 -0
- package/resources/v1-beta/entity-types.js.map +1 -0
- package/resources/v1-beta/entity-types.mjs +71 -0
- package/resources/v1-beta/entity-types.mjs.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.d.mts +1 -1
- package/resources/v1-beta/index.d.mts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.d.ts +1 -1
- package/resources/v1-beta/index.d.ts.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.js +3 -3
- package/resources/v1-beta/index.js.map +1 -0
- package/resources/{v1/events/beta → v1-beta}/index.mjs +1 -1
- package/resources/v1-beta/index.mjs.map +1 -0
- package/resources/{v1/events/beta/beta.d.mts → v1-beta/v1-beta.d.mts} +4 -4
- package/resources/v1-beta/v1-beta.d.mts.map +1 -0
- package/resources/{v1/events/beta/beta.d.ts → v1-beta/v1-beta.d.ts} +4 -4
- package/resources/v1-beta/v1-beta.d.ts.map +1 -0
- package/resources/{v1/events/beta/beta.js → v1-beta/v1-beta.js} +8 -8
- package/resources/v1-beta/v1-beta.js.map +1 -0
- package/resources/{v1/events/beta/beta.mjs → v1-beta/v1-beta.mjs} +5 -5
- package/resources/v1-beta/v1-beta.mjs.map +1 -0
- package/resources/v1-beta.d.mts +2 -0
- package/resources/v1-beta.d.mts.map +1 -0
- package/resources/v1-beta.d.ts +2 -0
- package/resources/v1-beta.d.ts.map +1 -0
- package/resources/{v1/events/beta.js → v1-beta.js} +3 -3
- package/resources/v1-beta.js.map +1 -0
- package/resources/{v1/events/beta.mjs → v1-beta.mjs} +2 -2
- package/resources/v1-beta.mjs.map +1 -0
- package/src/client.ts +5 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/v1/addons/addons.ts +293 -105
- package/src/resources/v1/addons/entitlements.ts +123 -41
- package/src/resources/v1/addons/index.ts +5 -0
- package/src/resources/v1/coupons.ts +158 -63
- package/src/resources/v1/credits/credits.ts +103 -50
- package/src/resources/v1/credits/custom-currencies.ts +191 -82
- package/src/resources/v1/credits/grants.ts +104 -54
- package/src/resources/v1/credits/index.ts +4 -0
- package/src/resources/v1/customers/customers.ts +324 -140
- package/src/resources/v1/customers/index.ts +8 -1
- package/src/resources/v1/customers/integrations.ts +129 -63
- package/src/resources/v1/customers/payment-method.ts +66 -25
- package/src/resources/v1/customers/promotional-entitlements.ts +82 -62
- package/src/resources/v1/events/data-export/data-export.ts +58 -21
- package/src/resources/v1/events/data-export/destinations.ts +61 -23
- package/src/resources/v1/events/data-export/index.ts +1 -0
- package/src/resources/v1/events/events.ts +28 -22
- package/src/resources/v1/events/index.ts +0 -1
- package/src/resources/v1/features.ts +209 -82
- package/src/resources/v1/index.ts +19 -0
- package/src/resources/v1/plans/entitlements.ts +123 -41
- package/src/resources/v1/plans/index.ts +5 -0
- package/src/resources/v1/plans/plans.ts +321 -119
- package/src/resources/v1/products.ts +193 -74
- package/src/resources/v1/subscriptions/future-update.ts +68 -21
- package/src/resources/v1/subscriptions/index.ts +9 -2
- package/src/resources/v1/subscriptions/invoice.ts +36 -9
- package/src/resources/v1/subscriptions/subscriptions.ts +417 -173
- package/src/resources/v1/subscriptions/usage.ts +61 -18
- package/src/resources/v1/usage.ts +53 -29
- package/src/resources/v1/v1.ts +38 -0
- package/src/resources/v1-beta/customers/assignments.ts +328 -0
- package/src/resources/{v1/events/beta → v1-beta}/customers/customers.ts +1 -1
- package/src/resources/{v1/events/beta → v1-beta}/customers/entities.ts +165 -54
- package/src/resources/{v1/events/beta → v1-beta}/customers/entitlements.ts +43 -18
- package/src/resources/{v1/events/beta → v1-beta}/entity-types.ts +70 -25
- package/src/resources/{v1/events/beta → v1-beta}/index.ts +1 -1
- package/src/resources/{v1/events/beta/beta.ts → v1-beta/v1-beta.ts} +5 -5
- package/src/resources/{v1/events/beta.ts → v1-beta.ts} +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/v1/events/beta/beta.d.mts.map +0 -1
- package/resources/v1/events/beta/beta.d.ts.map +0 -1
- package/resources/v1/events/beta/beta.js.map +0 -1
- package/resources/v1/events/beta/beta.mjs.map +0 -1
- package/resources/v1/events/beta/customers/assignments.d.mts +0 -178
- package/resources/v1/events/beta/customers/assignments.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/assignments.d.ts +0 -178
- package/resources/v1/events/beta/customers/assignments.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/assignments.js +0 -62
- package/resources/v1/events/beta/customers/assignments.js.map +0 -1
- package/resources/v1/events/beta/customers/assignments.mjs +0 -58
- package/resources/v1/events/beta/customers/assignments.mjs.map +0 -1
- package/resources/v1/events/beta/customers/customers.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/customers.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/customers.js.map +0 -1
- package/resources/v1/events/beta/customers/customers.mjs.map +0 -1
- package/resources/v1/events/beta/customers/entities.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/entities.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/entities.js +0 -105
- package/resources/v1/events/beta/customers/entities.js.map +0 -1
- package/resources/v1/events/beta/customers/entities.mjs +0 -101
- package/resources/v1/events/beta/customers/entities.mjs.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.js +0 -26
- package/resources/v1/events/beta/customers/entitlements.js.map +0 -1
- package/resources/v1/events/beta/customers/entitlements.mjs +0 -22
- package/resources/v1/events/beta/customers/entitlements.mjs.map +0 -1
- package/resources/v1/events/beta/customers/index.d.mts.map +0 -1
- package/resources/v1/events/beta/customers/index.d.ts.map +0 -1
- package/resources/v1/events/beta/customers/index.js.map +0 -1
- package/resources/v1/events/beta/customers/index.mjs.map +0 -1
- package/resources/v1/events/beta/customers.d.mts.map +0 -1
- package/resources/v1/events/beta/customers.d.ts.map +0 -1
- package/resources/v1/events/beta/customers.js.map +0 -1
- package/resources/v1/events/beta/customers.mjs.map +0 -1
- package/resources/v1/events/beta/entity-types.d.mts.map +0 -1
- package/resources/v1/events/beta/entity-types.d.ts.map +0 -1
- package/resources/v1/events/beta/entity-types.js +0 -56
- package/resources/v1/events/beta/entity-types.js.map +0 -1
- package/resources/v1/events/beta/entity-types.mjs +0 -52
- package/resources/v1/events/beta/entity-types.mjs.map +0 -1
- package/resources/v1/events/beta/index.d.mts.map +0 -1
- package/resources/v1/events/beta/index.d.ts.map +0 -1
- package/resources/v1/events/beta/index.js.map +0 -1
- package/resources/v1/events/beta/index.mjs.map +0 -1
- package/resources/v1/events/beta.d.mts +0 -2
- package/resources/v1/events/beta.d.mts.map +0 -1
- package/resources/v1/events/beta.d.ts +0 -2
- package/resources/v1/events/beta.d.ts.map +0 -1
- package/resources/v1/events/beta.js.map +0 -1
- package/resources/v1/events/beta.mjs.map +0 -1
- package/src/resources/v1/events/beta/customers/assignments.ts +0 -228
- /package/resources/{v1/events/beta → v1-beta}/customers/index.d.mts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.d.ts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.js +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers/index.mjs +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.d.mts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.d.ts +0 -0
- /package/resources/{v1/events/beta → v1-beta}/customers.mjs +0 -0
- /package/src/resources/{v1/events/beta → v1-beta}/customers/index.ts +0 -0
- /package/src/resources/{v1/events/beta → v1-beta}/customers.ts +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Assignments extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Returns a cursor-paginated list of capability assignments for the given
|
|
8
|
+
* customer. An assignment ties an entity to a capability with a usage limit and
|
|
9
|
+
* reset cadence.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Automatically fetches more pages as needed.
|
|
14
|
+
* for await (const assignmentListResponse of client.v1Beta.customers.assignments.list(
|
|
15
|
+
* 'id',
|
|
16
|
+
* )) {
|
|
17
|
+
* // ...
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(id: string, params?: AssignmentListParams | null | undefined, options?: RequestOptions): PagePromise<AssignmentListResponsesMyCursorIDPage, AssignmentListResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Batched create-or-update of capability assignments. Existing assignments matched
|
|
24
|
+
* by (entityId, capabilityId) are updated; new pairs are created. On update,
|
|
25
|
+
* omitted fields (usageLimit, cadence) are preserved; on create both are required
|
|
26
|
+
* by the governance service.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response =
|
|
31
|
+
* await client.v1Beta.customers.assignments.upsert('id', {
|
|
32
|
+
* assignments: [
|
|
33
|
+
* {
|
|
34
|
+
* entityId: 'workspace-001',
|
|
35
|
+
* featureId: 'compute-minutes',
|
|
36
|
+
* usageLimit: 1000,
|
|
37
|
+
* cadence: 'MONTH',
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* entityId: 'workspace-002',
|
|
41
|
+
* currencyId: 'cred-type-tokens',
|
|
42
|
+
* usageLimit: 2000,
|
|
43
|
+
* cadence: 'MONTH',
|
|
44
|
+
* parentId: 'workspace-001',
|
|
45
|
+
* scopeEntityIds: ['user-1'],
|
|
46
|
+
* },
|
|
47
|
+
* ],
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
upsert(id: string, params: AssignmentUpsertParams, options?: RequestOptions): APIPromise<AssignmentUpsertResponse>;
|
|
52
|
+
}
|
|
53
|
+
export type AssignmentListResponsesMyCursorIDPage = MyCursorIDPage<AssignmentListResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* A capability assignment for an entity belonging to a customer. Defines how much
|
|
56
|
+
* of the capability the entity may consume (`usageLimit`) and how often the
|
|
57
|
+
* counter resets (`cadence`).
|
|
58
|
+
*/
|
|
59
|
+
export interface AssignmentListResponse {
|
|
60
|
+
/**
|
|
61
|
+
* Synthetic UUID identifier — also the cursor anchor for paginated lists
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* Usage-reset cadence. Currently only `MONTH` is supported
|
|
66
|
+
*/
|
|
67
|
+
cadence: 'MONTH';
|
|
68
|
+
/**
|
|
69
|
+
* Timestamp of when the record was created
|
|
70
|
+
*/
|
|
71
|
+
createdAt: string;
|
|
72
|
+
/**
|
|
73
|
+
* The entity refId this assignment is attached to
|
|
74
|
+
*/
|
|
75
|
+
entityId: string;
|
|
76
|
+
/**
|
|
77
|
+
* Parent entity refId in the hierarchy, or `null` for a root.
|
|
78
|
+
*/
|
|
79
|
+
parentId: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Dimension-scoped sub-budget key: the set of entity refIds this budget applies
|
|
82
|
+
* to. Empty is the node-wide budget that always matches; a non-empty set only
|
|
83
|
+
* applies when every listed entity is present in the resolved set
|
|
84
|
+
* (order-insensitive).
|
|
85
|
+
*/
|
|
86
|
+
scopeEntityIds: Array<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Timestamp of when the record was last updated
|
|
89
|
+
*/
|
|
90
|
+
updatedAt: string;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum usage allowed within one cadence window
|
|
93
|
+
*/
|
|
94
|
+
usageLimit: number;
|
|
95
|
+
/**
|
|
96
|
+
* Currency refId this assignment grants (present for credit capabilities).
|
|
97
|
+
*/
|
|
98
|
+
currencyId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Feature refId this assignment grants (present for feature capabilities).
|
|
101
|
+
*/
|
|
102
|
+
featureId?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Assignments after upsert.
|
|
106
|
+
*/
|
|
107
|
+
export interface AssignmentUpsertResponse {
|
|
108
|
+
data: Array<AssignmentUpsertResponse.Data>;
|
|
109
|
+
}
|
|
110
|
+
export declare namespace AssignmentUpsertResponse {
|
|
111
|
+
/**
|
|
112
|
+
* A capability assignment for an entity belonging to a customer. Defines how much
|
|
113
|
+
* of the capability the entity may consume (`usageLimit`) and how often the
|
|
114
|
+
* counter resets (`cadence`).
|
|
115
|
+
*/
|
|
116
|
+
interface Data {
|
|
117
|
+
/**
|
|
118
|
+
* Synthetic UUID identifier — also the cursor anchor for paginated lists
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* Usage-reset cadence. Currently only `MONTH` is supported
|
|
123
|
+
*/
|
|
124
|
+
cadence: 'MONTH';
|
|
125
|
+
/**
|
|
126
|
+
* Timestamp of when the record was created
|
|
127
|
+
*/
|
|
128
|
+
createdAt: string;
|
|
129
|
+
/**
|
|
130
|
+
* The entity refId this assignment is attached to
|
|
131
|
+
*/
|
|
132
|
+
entityId: string;
|
|
133
|
+
/**
|
|
134
|
+
* Parent entity refId in the hierarchy, or `null` for a root.
|
|
135
|
+
*/
|
|
136
|
+
parentId: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Dimension-scoped sub-budget key: the set of entity refIds this budget applies
|
|
139
|
+
* to. Empty is the node-wide budget that always matches; a non-empty set only
|
|
140
|
+
* applies when every listed entity is present in the resolved set
|
|
141
|
+
* (order-insensitive).
|
|
142
|
+
*/
|
|
143
|
+
scopeEntityIds: Array<string>;
|
|
144
|
+
/**
|
|
145
|
+
* Timestamp of when the record was last updated
|
|
146
|
+
*/
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
/**
|
|
149
|
+
* Maximum usage allowed within one cadence window
|
|
150
|
+
*/
|
|
151
|
+
usageLimit: number;
|
|
152
|
+
/**
|
|
153
|
+
* Currency refId this assignment grants (present for credit capabilities).
|
|
154
|
+
*/
|
|
155
|
+
currencyId?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Feature refId this assignment grants (present for feature capabilities).
|
|
158
|
+
*/
|
|
159
|
+
featureId?: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export interface AssignmentListParams extends MyCursorIDPageParams {
|
|
163
|
+
/**
|
|
164
|
+
* Query param: Filter assignments to a specific capability refId
|
|
165
|
+
*/
|
|
166
|
+
capabilityId?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Query param: Filter assignments to a specific entity refId
|
|
169
|
+
*/
|
|
170
|
+
entityId?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
173
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
174
|
+
*/
|
|
175
|
+
'X-ACCOUNT-ID'?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
178
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
179
|
+
* intrinsic to the key).
|
|
180
|
+
*/
|
|
181
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface AssignmentUpsertParams {
|
|
184
|
+
/**
|
|
185
|
+
* Body param: Assignments to upsert (1–100 per request)
|
|
186
|
+
*/
|
|
187
|
+
assignments: Array<AssignmentUpsertParams.Assignment>;
|
|
188
|
+
/**
|
|
189
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
190
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
191
|
+
*/
|
|
192
|
+
'X-ACCOUNT-ID'?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
195
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
196
|
+
* intrinsic to the key).
|
|
197
|
+
*/
|
|
198
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
199
|
+
}
|
|
200
|
+
export declare namespace AssignmentUpsertParams {
|
|
201
|
+
/**
|
|
202
|
+
* A single assignment to create or update. Identify the capability with exactly
|
|
203
|
+
* one of `featureId` or `currencyId`. The natural key is the
|
|
204
|
+
* `(entityId, capability, scopeEntityIds)` triple. On create both `usageLimit` and
|
|
205
|
+
* `cadence` are required; on update they may be omitted individually to preserve
|
|
206
|
+
* the existing value.
|
|
207
|
+
*/
|
|
208
|
+
interface Assignment {
|
|
209
|
+
/**
|
|
210
|
+
* The entity refId this assignment is attached to
|
|
211
|
+
*/
|
|
212
|
+
entityId: string;
|
|
213
|
+
/**
|
|
214
|
+
* Usage-reset cadence (required on create). Currently only `MONTH` is supported
|
|
215
|
+
*/
|
|
216
|
+
cadence?: 'MONTH';
|
|
217
|
+
/**
|
|
218
|
+
* Currency refId this assignment grants (credit budgets). Mutually exclusive with
|
|
219
|
+
* `featureId`.
|
|
220
|
+
*/
|
|
221
|
+
currencyId?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Feature refId this assignment grants. Mutually exclusive with `currencyId`.
|
|
224
|
+
*/
|
|
225
|
+
featureId?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Parent entity refId in the hierarchy. Omit to leave the current parent untouched
|
|
228
|
+
* (a new node defaults to a root); `null` detaches to a root; a refId sets or
|
|
229
|
+
* changes the parent. Reparenting an existing node is leaf-only.
|
|
230
|
+
*/
|
|
231
|
+
parentId?: string | null;
|
|
232
|
+
scopeEntityIds?: Array<string>;
|
|
233
|
+
/**
|
|
234
|
+
* Maximum usage allowed within one cadence window (required on create)
|
|
235
|
+
*/
|
|
236
|
+
usageLimit?: number;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export declare namespace Assignments {
|
|
240
|
+
export { type AssignmentListResponse as AssignmentListResponse, type AssignmentUpsertResponse as AssignmentUpsertResponse, type AssignmentListResponsesMyCursorIDPage as AssignmentListResponsesMyCursorIDPage, type AssignmentListParams as AssignmentListParams, type AssignmentUpsertParams as AssignmentUpsertParams, };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=assignments.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignments.d.mts","sourceRoot":"","sources":["../../../src/resources/v1-beta/customers/assignments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,qCAAiC;AAElG,OAAO,EAAE,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AAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAE/B;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from "../../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class Assignments extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Returns a cursor-paginated list of capability assignments for the given
|
|
8
|
+
* customer. An assignment ties an entity to a capability with a usage limit and
|
|
9
|
+
* reset cadence.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Automatically fetches more pages as needed.
|
|
14
|
+
* for await (const assignmentListResponse of client.v1Beta.customers.assignments.list(
|
|
15
|
+
* 'id',
|
|
16
|
+
* )) {
|
|
17
|
+
* // ...
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(id: string, params?: AssignmentListParams | null | undefined, options?: RequestOptions): PagePromise<AssignmentListResponsesMyCursorIDPage, AssignmentListResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Batched create-or-update of capability assignments. Existing assignments matched
|
|
24
|
+
* by (entityId, capabilityId) are updated; new pairs are created. On update,
|
|
25
|
+
* omitted fields (usageLimit, cadence) are preserved; on create both are required
|
|
26
|
+
* by the governance service.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response =
|
|
31
|
+
* await client.v1Beta.customers.assignments.upsert('id', {
|
|
32
|
+
* assignments: [
|
|
33
|
+
* {
|
|
34
|
+
* entityId: 'workspace-001',
|
|
35
|
+
* featureId: 'compute-minutes',
|
|
36
|
+
* usageLimit: 1000,
|
|
37
|
+
* cadence: 'MONTH',
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* entityId: 'workspace-002',
|
|
41
|
+
* currencyId: 'cred-type-tokens',
|
|
42
|
+
* usageLimit: 2000,
|
|
43
|
+
* cadence: 'MONTH',
|
|
44
|
+
* parentId: 'workspace-001',
|
|
45
|
+
* scopeEntityIds: ['user-1'],
|
|
46
|
+
* },
|
|
47
|
+
* ],
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
upsert(id: string, params: AssignmentUpsertParams, options?: RequestOptions): APIPromise<AssignmentUpsertResponse>;
|
|
52
|
+
}
|
|
53
|
+
export type AssignmentListResponsesMyCursorIDPage = MyCursorIDPage<AssignmentListResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* A capability assignment for an entity belonging to a customer. Defines how much
|
|
56
|
+
* of the capability the entity may consume (`usageLimit`) and how often the
|
|
57
|
+
* counter resets (`cadence`).
|
|
58
|
+
*/
|
|
59
|
+
export interface AssignmentListResponse {
|
|
60
|
+
/**
|
|
61
|
+
* Synthetic UUID identifier — also the cursor anchor for paginated lists
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* Usage-reset cadence. Currently only `MONTH` is supported
|
|
66
|
+
*/
|
|
67
|
+
cadence: 'MONTH';
|
|
68
|
+
/**
|
|
69
|
+
* Timestamp of when the record was created
|
|
70
|
+
*/
|
|
71
|
+
createdAt: string;
|
|
72
|
+
/**
|
|
73
|
+
* The entity refId this assignment is attached to
|
|
74
|
+
*/
|
|
75
|
+
entityId: string;
|
|
76
|
+
/**
|
|
77
|
+
* Parent entity refId in the hierarchy, or `null` for a root.
|
|
78
|
+
*/
|
|
79
|
+
parentId: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Dimension-scoped sub-budget key: the set of entity refIds this budget applies
|
|
82
|
+
* to. Empty is the node-wide budget that always matches; a non-empty set only
|
|
83
|
+
* applies when every listed entity is present in the resolved set
|
|
84
|
+
* (order-insensitive).
|
|
85
|
+
*/
|
|
86
|
+
scopeEntityIds: Array<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Timestamp of when the record was last updated
|
|
89
|
+
*/
|
|
90
|
+
updatedAt: string;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum usage allowed within one cadence window
|
|
93
|
+
*/
|
|
94
|
+
usageLimit: number;
|
|
95
|
+
/**
|
|
96
|
+
* Currency refId this assignment grants (present for credit capabilities).
|
|
97
|
+
*/
|
|
98
|
+
currencyId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Feature refId this assignment grants (present for feature capabilities).
|
|
101
|
+
*/
|
|
102
|
+
featureId?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Assignments after upsert.
|
|
106
|
+
*/
|
|
107
|
+
export interface AssignmentUpsertResponse {
|
|
108
|
+
data: Array<AssignmentUpsertResponse.Data>;
|
|
109
|
+
}
|
|
110
|
+
export declare namespace AssignmentUpsertResponse {
|
|
111
|
+
/**
|
|
112
|
+
* A capability assignment for an entity belonging to a customer. Defines how much
|
|
113
|
+
* of the capability the entity may consume (`usageLimit`) and how often the
|
|
114
|
+
* counter resets (`cadence`).
|
|
115
|
+
*/
|
|
116
|
+
interface Data {
|
|
117
|
+
/**
|
|
118
|
+
* Synthetic UUID identifier — also the cursor anchor for paginated lists
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* Usage-reset cadence. Currently only `MONTH` is supported
|
|
123
|
+
*/
|
|
124
|
+
cadence: 'MONTH';
|
|
125
|
+
/**
|
|
126
|
+
* Timestamp of when the record was created
|
|
127
|
+
*/
|
|
128
|
+
createdAt: string;
|
|
129
|
+
/**
|
|
130
|
+
* The entity refId this assignment is attached to
|
|
131
|
+
*/
|
|
132
|
+
entityId: string;
|
|
133
|
+
/**
|
|
134
|
+
* Parent entity refId in the hierarchy, or `null` for a root.
|
|
135
|
+
*/
|
|
136
|
+
parentId: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Dimension-scoped sub-budget key: the set of entity refIds this budget applies
|
|
139
|
+
* to. Empty is the node-wide budget that always matches; a non-empty set only
|
|
140
|
+
* applies when every listed entity is present in the resolved set
|
|
141
|
+
* (order-insensitive).
|
|
142
|
+
*/
|
|
143
|
+
scopeEntityIds: Array<string>;
|
|
144
|
+
/**
|
|
145
|
+
* Timestamp of when the record was last updated
|
|
146
|
+
*/
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
/**
|
|
149
|
+
* Maximum usage allowed within one cadence window
|
|
150
|
+
*/
|
|
151
|
+
usageLimit: number;
|
|
152
|
+
/**
|
|
153
|
+
* Currency refId this assignment grants (present for credit capabilities).
|
|
154
|
+
*/
|
|
155
|
+
currencyId?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Feature refId this assignment grants (present for feature capabilities).
|
|
158
|
+
*/
|
|
159
|
+
featureId?: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export interface AssignmentListParams extends MyCursorIDPageParams {
|
|
163
|
+
/**
|
|
164
|
+
* Query param: Filter assignments to a specific capability refId
|
|
165
|
+
*/
|
|
166
|
+
capabilityId?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Query param: Filter assignments to a specific entity refId
|
|
169
|
+
*/
|
|
170
|
+
entityId?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
173
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
174
|
+
*/
|
|
175
|
+
'X-ACCOUNT-ID'?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
178
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
179
|
+
* intrinsic to the key).
|
|
180
|
+
*/
|
|
181
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface AssignmentUpsertParams {
|
|
184
|
+
/**
|
|
185
|
+
* Body param: Assignments to upsert (1–100 per request)
|
|
186
|
+
*/
|
|
187
|
+
assignments: Array<AssignmentUpsertParams.Assignment>;
|
|
188
|
+
/**
|
|
189
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
190
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
191
|
+
*/
|
|
192
|
+
'X-ACCOUNT-ID'?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
195
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
196
|
+
* intrinsic to the key).
|
|
197
|
+
*/
|
|
198
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
199
|
+
}
|
|
200
|
+
export declare namespace AssignmentUpsertParams {
|
|
201
|
+
/**
|
|
202
|
+
* A single assignment to create or update. Identify the capability with exactly
|
|
203
|
+
* one of `featureId` or `currencyId`. The natural key is the
|
|
204
|
+
* `(entityId, capability, scopeEntityIds)` triple. On create both `usageLimit` and
|
|
205
|
+
* `cadence` are required; on update they may be omitted individually to preserve
|
|
206
|
+
* the existing value.
|
|
207
|
+
*/
|
|
208
|
+
interface Assignment {
|
|
209
|
+
/**
|
|
210
|
+
* The entity refId this assignment is attached to
|
|
211
|
+
*/
|
|
212
|
+
entityId: string;
|
|
213
|
+
/**
|
|
214
|
+
* Usage-reset cadence (required on create). Currently only `MONTH` is supported
|
|
215
|
+
*/
|
|
216
|
+
cadence?: 'MONTH';
|
|
217
|
+
/**
|
|
218
|
+
* Currency refId this assignment grants (credit budgets). Mutually exclusive with
|
|
219
|
+
* `featureId`.
|
|
220
|
+
*/
|
|
221
|
+
currencyId?: string;
|
|
222
|
+
/**
|
|
223
|
+
* Feature refId this assignment grants. Mutually exclusive with `currencyId`.
|
|
224
|
+
*/
|
|
225
|
+
featureId?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Parent entity refId in the hierarchy. Omit to leave the current parent untouched
|
|
228
|
+
* (a new node defaults to a root); `null` detaches to a root; a refId sets or
|
|
229
|
+
* changes the parent. Reparenting an existing node is leaf-only.
|
|
230
|
+
*/
|
|
231
|
+
parentId?: string | null;
|
|
232
|
+
scopeEntityIds?: Array<string>;
|
|
233
|
+
/**
|
|
234
|
+
* Maximum usage allowed within one cadence window (required on create)
|
|
235
|
+
*/
|
|
236
|
+
usageLimit?: number;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export declare namespace Assignments {
|
|
240
|
+
export { type AssignmentListResponse as AssignmentListResponse, type AssignmentUpsertResponse as AssignmentUpsertResponse, type AssignmentListResponsesMyCursorIDPage as AssignmentListResponsesMyCursorIDPage, type AssignmentListParams as AssignmentListParams, type AssignmentUpsertParams as AssignmentUpsertParams, };
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=assignments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../../src/resources/v1-beta/customers/assignments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,oCAAiC;AAElG,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,C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BAAwB,EACzD,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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.Assignments = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
9
|
+
class Assignments extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a cursor-paginated list of capability assignments for the given
|
|
12
|
+
* customer. An assignment ties an entity to a capability with a usage limit and
|
|
13
|
+
* reset cadence.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // Automatically fetches more pages as needed.
|
|
18
|
+
* for await (const assignmentListResponse of client.v1Beta.customers.assignments.list(
|
|
19
|
+
* 'id',
|
|
20
|
+
* )) {
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(id, params = {}, options) {
|
|
26
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
27
|
+
return this._client.getAPIList((0, path_1.path) `/api/v1-beta/customers/${id}/assignments`, (pagination_1.MyCursorIDPage), {
|
|
28
|
+
query,
|
|
29
|
+
...options,
|
|
30
|
+
headers: (0, headers_1.buildHeaders)([
|
|
31
|
+
{
|
|
32
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
33
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
34
|
+
},
|
|
35
|
+
options?.headers,
|
|
36
|
+
]),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Batched create-or-update of capability assignments. Existing assignments matched
|
|
41
|
+
* by (entityId, capabilityId) are updated; new pairs are created. On update,
|
|
42
|
+
* omitted fields (usageLimit, cadence) are preserved; on create both are required
|
|
43
|
+
* by the governance service.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response =
|
|
48
|
+
* await client.v1Beta.customers.assignments.upsert('id', {
|
|
49
|
+
* assignments: [
|
|
50
|
+
* {
|
|
51
|
+
* entityId: 'workspace-001',
|
|
52
|
+
* featureId: 'compute-minutes',
|
|
53
|
+
* usageLimit: 1000,
|
|
54
|
+
* cadence: 'MONTH',
|
|
55
|
+
* },
|
|
56
|
+
* {
|
|
57
|
+
* entityId: 'workspace-002',
|
|
58
|
+
* currencyId: 'cred-type-tokens',
|
|
59
|
+
* usageLimit: 2000,
|
|
60
|
+
* cadence: 'MONTH',
|
|
61
|
+
* parentId: 'workspace-001',
|
|
62
|
+
* scopeEntityIds: ['user-1'],
|
|
63
|
+
* },
|
|
64
|
+
* ],
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
upsert(id, params, options) {
|
|
69
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
70
|
+
return this._client.put((0, path_1.path) `/api/v1-beta/customers/${id}/assignments`, {
|
|
71
|
+
body,
|
|
72
|
+
...options,
|
|
73
|
+
headers: (0, headers_1.buildHeaders)([
|
|
74
|
+
{
|
|
75
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
76
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
77
|
+
},
|
|
78
|
+
options?.headers,
|
|
79
|
+
]),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.Assignments = Assignments;
|
|
84
|
+
//# sourceMappingURL=assignments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignments.js","sourceRoot":"","sources":["../../../src/resources/v1-beta/customers/assignments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAAkG;AAClG,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,EAAU,EACV,SAAkD,EAAE,EACpD,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAClG,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,EAAE,cAAc,EAC9C,CAAA,2BAAsC,CAAA,EACtC;YACE,KAAK;YACL,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,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CACJ,EAAU,EACV,MAA8B,EAC9B,OAAwB;QAExB,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,0BAA0B,EAAE,cAAc,EAAE;YACtE,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;AAtFD,kCAsFC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { MyCursorIDPage } from "../../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
6
|
+
export class Assignments extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Returns a cursor-paginated list of capability assignments for the given
|
|
9
|
+
* customer. An assignment ties an entity to a capability with a usage limit and
|
|
10
|
+
* reset cadence.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const assignmentListResponse of client.v1Beta.customers.assignments.list(
|
|
16
|
+
* 'id',
|
|
17
|
+
* )) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(id, params = {}, options) {
|
|
23
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
24
|
+
return this._client.getAPIList(path `/api/v1-beta/customers/${id}/assignments`, (MyCursorIDPage), {
|
|
25
|
+
query,
|
|
26
|
+
...options,
|
|
27
|
+
headers: buildHeaders([
|
|
28
|
+
{
|
|
29
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
30
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
31
|
+
},
|
|
32
|
+
options?.headers,
|
|
33
|
+
]),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Batched create-or-update of capability assignments. Existing assignments matched
|
|
38
|
+
* by (entityId, capabilityId) are updated; new pairs are created. On update,
|
|
39
|
+
* omitted fields (usageLimit, cadence) are preserved; on create both are required
|
|
40
|
+
* by the governance service.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response =
|
|
45
|
+
* await client.v1Beta.customers.assignments.upsert('id', {
|
|
46
|
+
* assignments: [
|
|
47
|
+
* {
|
|
48
|
+
* entityId: 'workspace-001',
|
|
49
|
+
* featureId: 'compute-minutes',
|
|
50
|
+
* usageLimit: 1000,
|
|
51
|
+
* cadence: 'MONTH',
|
|
52
|
+
* },
|
|
53
|
+
* {
|
|
54
|
+
* entityId: 'workspace-002',
|
|
55
|
+
* currencyId: 'cred-type-tokens',
|
|
56
|
+
* usageLimit: 2000,
|
|
57
|
+
* cadence: 'MONTH',
|
|
58
|
+
* parentId: 'workspace-001',
|
|
59
|
+
* scopeEntityIds: ['user-1'],
|
|
60
|
+
* },
|
|
61
|
+
* ],
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
upsert(id, params, options) {
|
|
66
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
67
|
+
return this._client.put(path `/api/v1-beta/customers/${id}/assignments`, {
|
|
68
|
+
body,
|
|
69
|
+
...options,
|
|
70
|
+
headers: buildHeaders([
|
|
71
|
+
{
|
|
72
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
73
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
74
|
+
},
|
|
75
|
+
options?.headers,
|
|
76
|
+
]),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=assignments.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignments.mjs","sourceRoot":"","sources":["../../../src/resources/v1-beta/customers/assignments.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,cAAc,EAA0C,qCAAiC;AAClG,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,EAAU,EACV,SAAkD,EAAE,EACpD,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAClG,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,EAAE,cAAc,EAC9C,CAAA,cAAsC,CAAA,EACtC;YACE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;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,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CACJ,EAAU,EACV,MAA8B,EAC9B,OAAwB;QAExB,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3F,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,EAAE,cAAc,EAAE;YACtE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
2
|
import * as AssignmentsAPI from "./assignments.mjs";
|
|
3
3
|
import { AssignmentListParams, AssignmentListResponse, AssignmentListResponsesMyCursorIDPage, AssignmentUpsertParams, AssignmentUpsertResponse, Assignments } from "./assignments.mjs";
|
|
4
4
|
import * as EntitiesAPI from "./entities.mjs";
|