@usehercules/sdk 1.11.0 → 1.12.1
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 +28 -0
- package/README.md +13 -12
- package/client.d.mts +12 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -3
- package/client.d.ts.map +1 -1
- package/client.js +12 -3
- package/client.js.map +1 -1
- package/client.mjs +12 -3
- package/client.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/{beta/commerce → commerce}/commerce.d.mts +38 -21
- package/resources/commerce/commerce.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/commerce.d.ts +38 -21
- package/resources/commerce/commerce.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/commerce.js +36 -4
- package/resources/commerce/commerce.js.map +1 -0
- package/resources/{beta/commerce → commerce}/commerce.mjs +35 -3
- package/resources/commerce/commerce.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/coupons.d.mts +34 -10
- package/resources/commerce/coupons.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/coupons.d.ts +34 -10
- package/resources/commerce/coupons.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/coupons.js +32 -14
- package/resources/commerce/coupons.js.map +1 -0
- package/resources/{beta/commerce → commerce}/coupons.mjs +32 -14
- package/resources/commerce/coupons.mjs.map +1 -0
- package/resources/commerce/customers/balance-transactions.d.mts +4 -0
- package/resources/commerce/customers/balance-transactions.d.mts.map +1 -0
- package/resources/commerce/customers/balance-transactions.d.ts +4 -0
- package/resources/commerce/customers/balance-transactions.d.ts.map +1 -0
- package/resources/commerce/customers/balance-transactions.js +9 -0
- package/resources/commerce/customers/balance-transactions.js.map +1 -0
- package/resources/commerce/customers/balance-transactions.mjs +5 -0
- package/resources/commerce/customers/balance-transactions.mjs.map +1 -0
- package/resources/{beta/commerce → commerce/customers}/customers.d.mts +51 -12
- package/resources/commerce/customers/customers.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce/customers}/customers.d.ts +51 -12
- package/resources/commerce/customers/customers.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce/customers}/customers.js +43 -11
- package/resources/commerce/customers/customers.js.map +1 -0
- package/resources/{beta/commerce → commerce/customers}/customers.mjs +42 -11
- package/resources/commerce/customers/customers.mjs.map +1 -0
- package/resources/commerce/customers/index.d.mts +3 -0
- package/resources/commerce/customers/index.d.mts.map +1 -0
- package/resources/commerce/customers/index.d.ts +3 -0
- package/resources/commerce/customers/index.d.ts.map +1 -0
- package/resources/commerce/customers/index.js +9 -0
- package/resources/commerce/customers/index.js.map +1 -0
- package/resources/commerce/customers/index.mjs +4 -0
- package/resources/commerce/customers/index.mjs.map +1 -0
- package/resources/commerce/customers.d.mts +2 -0
- package/resources/commerce/customers.d.mts.map +1 -0
- package/resources/commerce/customers.d.ts +2 -0
- package/resources/commerce/customers.d.ts.map +1 -0
- package/resources/{beta.js → commerce/customers.js} +3 -3
- package/resources/commerce/customers.js.map +1 -0
- package/resources/{beta.mjs → commerce/customers.mjs} +2 -2
- package/resources/commerce/customers.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/features.d.mts +35 -20
- package/resources/commerce/features.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/features.d.ts +35 -20
- package/resources/commerce/features.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/features.js +32 -14
- package/resources/commerce/features.js.map +1 -0
- package/resources/{beta/commerce → commerce}/features.mjs +32 -14
- package/resources/commerce/features.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/index.d.mts +2 -1
- package/resources/commerce/index.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/index.d.ts +2 -1
- package/resources/commerce/index.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/index.js +7 -5
- package/resources/commerce/index.js.map +1 -0
- package/resources/{beta/commerce → commerce}/index.mjs +2 -1
- package/resources/commerce/index.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/products/index.d.mts +2 -2
- package/resources/commerce/products/index.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/products/index.d.ts +2 -2
- package/resources/commerce/products/index.d.ts.map +1 -0
- package/resources/commerce/products/index.js.map +1 -0
- package/resources/commerce/products/index.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/products/products.d.mts +45 -55
- package/resources/commerce/products/products.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/products/products.d.ts +45 -55
- package/resources/commerce/products/products.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/products/products.js +34 -11
- package/resources/commerce/products/products.js.map +1 -0
- package/resources/{beta/commerce → commerce}/products/products.mjs +33 -10
- package/resources/commerce/products/products.mjs.map +1 -0
- package/resources/commerce/products/resources.d.mts +174 -0
- package/resources/commerce/products/resources.d.mts.map +1 -0
- package/resources/commerce/products/resources.d.ts +174 -0
- package/resources/commerce/products/resources.d.ts.map +1 -0
- package/resources/commerce/products/resources.js +65 -0
- package/resources/commerce/products/resources.js.map +1 -0
- package/resources/commerce/products/resources.mjs +61 -0
- package/resources/commerce/products/resources.mjs.map +1 -0
- package/resources/{beta/commerce → commerce}/products/variants.d.mts +43 -53
- package/resources/commerce/products/variants.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/products/variants.d.ts +43 -53
- package/resources/commerce/products/variants.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/products/variants.js +39 -11
- package/resources/commerce/products/variants.js.map +1 -0
- package/resources/{beta/commerce → commerce}/products/variants.mjs +39 -11
- package/resources/commerce/products/variants.mjs.map +1 -0
- package/resources/commerce/products.d.mts.map +1 -0
- package/resources/commerce/products.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/products.js +1 -1
- package/resources/commerce/products.js.map +1 -0
- package/resources/commerce/products.mjs.map +1 -0
- package/resources/commerce/subscription-groups.d.mts +4 -0
- package/resources/commerce/subscription-groups.d.mts.map +1 -0
- package/resources/commerce/subscription-groups.d.ts +4 -0
- package/resources/commerce/subscription-groups.d.ts.map +1 -0
- package/resources/commerce/subscription-groups.js +9 -0
- package/resources/commerce/subscription-groups.js.map +1 -0
- package/resources/commerce/subscription-groups.mjs +5 -0
- package/resources/commerce/subscription-groups.mjs.map +1 -0
- package/resources/commerce.d.mts.map +1 -0
- package/resources/{beta/commerce.d.ts.map → commerce.d.ts.map} +1 -1
- package/resources/{beta/commerce.js → commerce.js} +1 -1
- package/resources/commerce.js.map +1 -0
- package/resources/commerce.mjs.map +1 -0
- package/resources/{beta/content → content}/assets.d.mts +5 -5
- package/resources/content/assets.d.mts.map +1 -0
- package/resources/{beta/content → content}/assets.d.ts +5 -5
- package/resources/content/assets.d.ts.map +1 -0
- package/resources/{beta/content → content}/assets.js +4 -4
- package/resources/content/assets.js.map +1 -0
- package/resources/{beta/content → content}/assets.mjs +4 -4
- package/resources/content/assets.mjs.map +1 -0
- package/resources/{beta/content → content}/content.d.mts +4 -1
- package/resources/content/content.d.mts.map +1 -0
- package/resources/{beta/content → content}/content.d.ts +4 -1
- package/resources/content/content.d.ts.map +1 -0
- package/resources/{beta/content → content}/content.js +5 -2
- package/resources/content/content.js.map +1 -0
- package/resources/{beta/content → content}/content.mjs +4 -1
- package/resources/content/content.mjs.map +1 -0
- package/resources/{beta/content → content}/entries.d.mts +5 -5
- package/resources/content/entries.d.mts.map +1 -0
- package/resources/{beta/content → content}/entries.d.ts +5 -5
- package/resources/content/entries.d.ts.map +1 -0
- package/resources/{beta/content → content}/entries.js +3 -3
- package/resources/content/entries.js.map +1 -0
- package/resources/{beta/content → content}/entries.mjs +3 -3
- package/resources/content/entries.mjs.map +1 -0
- package/resources/content/index.d.mts.map +1 -0
- package/resources/content/index.d.ts.map +1 -0
- package/resources/content/index.js.map +1 -0
- package/resources/content/index.mjs.map +1 -0
- package/resources/{beta/content → content}/locales.d.mts +6 -6
- package/resources/content/locales.d.mts.map +1 -0
- package/resources/{beta/content → content}/locales.d.ts +6 -6
- package/resources/content/locales.d.ts.map +1 -0
- package/resources/{beta/content → content}/locales.js +4 -4
- package/resources/content/locales.js.map +1 -0
- package/resources/{beta/content → content}/locales.mjs +4 -4
- package/resources/content/locales.mjs.map +1 -0
- package/resources/{beta/content → content}/models/fields.d.mts +6 -6
- package/resources/content/models/fields.d.mts.map +1 -0
- package/resources/{beta/content → content}/models/fields.d.ts +6 -6
- package/resources/content/models/fields.d.ts.map +1 -0
- package/resources/{beta/content → content}/models/fields.js +3 -3
- package/resources/content/models/fields.js.map +1 -0
- package/resources/{beta/content → content}/models/fields.mjs +3 -3
- package/resources/content/models/fields.mjs.map +1 -0
- package/resources/content/models/index.d.mts.map +1 -0
- package/resources/content/models/index.d.ts.map +1 -0
- package/resources/content/models/index.js.map +1 -0
- package/resources/content/models/index.mjs.map +1 -0
- package/resources/{beta/content → content}/models/models.d.mts +10 -10
- package/resources/content/models/models.d.mts.map +1 -0
- package/resources/{beta/content → content}/models/models.d.ts +10 -10
- package/resources/content/models/models.d.ts.map +1 -0
- package/resources/{beta/content → content}/models/models.js +4 -4
- package/resources/content/models/models.js.map +1 -0
- package/resources/{beta/content → content}/models/models.mjs +3 -3
- package/resources/content/models/models.mjs.map +1 -0
- package/resources/content/models.d.mts.map +1 -0
- package/resources/content/models.d.ts.map +1 -0
- package/resources/{beta/content → content}/models.js +1 -1
- package/resources/content/models.js.map +1 -0
- package/resources/content/models.mjs.map +1 -0
- package/resources/content/releases/index.d.mts.map +1 -0
- package/resources/content/releases/index.d.ts.map +1 -0
- package/resources/content/releases/index.js.map +1 -0
- package/resources/content/releases/index.mjs.map +1 -0
- package/resources/{beta/content → content}/releases/items.d.mts +3 -3
- package/resources/content/releases/items.d.mts.map +1 -0
- package/resources/{beta/content → content}/releases/items.d.ts +3 -3
- package/resources/content/releases/items.d.ts.map +1 -0
- package/resources/{beta/content → content}/releases/items.js +3 -3
- package/resources/content/releases/items.js.map +1 -0
- package/resources/{beta/content → content}/releases/items.mjs +3 -3
- package/resources/content/releases/items.mjs.map +1 -0
- package/resources/{beta/content → content}/releases/releases.d.mts +6 -6
- package/resources/content/releases/releases.d.mts.map +1 -0
- package/resources/{beta/content → content}/releases/releases.d.ts +6 -6
- package/resources/content/releases/releases.d.ts.map +1 -0
- package/resources/{beta/content → content}/releases/releases.js +5 -5
- package/resources/content/releases/releases.js.map +1 -0
- package/resources/{beta/content → content}/releases/releases.mjs +4 -4
- package/resources/content/releases/releases.mjs.map +1 -0
- package/resources/content/releases.d.mts.map +1 -0
- package/resources/content/releases.d.ts.map +1 -0
- package/resources/{beta/content → content}/releases.js +1 -1
- package/resources/content/releases.js.map +1 -0
- package/resources/content/releases.mjs.map +1 -0
- package/resources/{beta/content.d.mts.map → content.d.mts.map} +1 -1
- package/resources/{beta/content.d.ts.map → content.d.ts.map} +1 -1
- package/resources/{beta/content.js → content.js} +1 -1
- package/resources/content.js.map +1 -0
- package/resources/content.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +31 -4
- package/src/resources/{beta/commerce → commerce}/commerce.ts +51 -33
- package/src/resources/{beta/commerce → commerce}/coupons.ts +35 -18
- package/src/resources/commerce/customers/balance-transactions.ts +5 -0
- package/src/resources/{beta/commerce → commerce/customers}/customers.ts +57 -19
- package/src/resources/commerce/customers/index.ts +15 -0
- package/src/resources/{beta.ts → commerce/customers.ts} +1 -1
- package/src/resources/{beta/commerce → commerce}/features.ts +36 -30
- package/src/resources/{beta/commerce → commerce}/index.ts +2 -1
- package/src/resources/{beta/commerce → commerce}/products/index.ts +1 -2
- package/src/resources/{beta/commerce → commerce}/products/products.ts +44 -66
- package/src/resources/commerce/products/resources.ts +226 -0
- package/src/resources/{beta/commerce → commerce}/products/variants.ts +43 -66
- package/src/resources/commerce/subscription-groups.ts +5 -0
- package/src/resources/{beta/content → content}/assets.ts +7 -7
- package/src/resources/{beta/content → content}/content.ts +4 -1
- package/src/resources/{beta/content → content}/entries.ts +6 -6
- package/src/resources/{beta/content → content}/locales.ts +8 -8
- package/src/resources/{beta/content → content}/models/fields.ts +8 -8
- package/src/resources/{beta/content → content}/models/models.ts +11 -11
- package/src/resources/{beta/content → content}/releases/items.ts +5 -5
- package/src/resources/{beta/content → content}/releases/releases.ts +8 -8
- package/src/resources/index.ts +10 -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/beta/beta.d.mts +0 -14
- package/resources/beta/beta.d.mts.map +0 -1
- package/resources/beta/beta.d.ts +0 -14
- package/resources/beta/beta.d.ts.map +0 -1
- package/resources/beta/beta.js +0 -21
- package/resources/beta/beta.js.map +0 -1
- package/resources/beta/beta.mjs +0 -16
- package/resources/beta/beta.mjs.map +0 -1
- package/resources/beta/commerce/commerce.d.mts.map +0 -1
- package/resources/beta/commerce/commerce.d.ts.map +0 -1
- package/resources/beta/commerce/commerce.js.map +0 -1
- package/resources/beta/commerce/commerce.mjs.map +0 -1
- package/resources/beta/commerce/coupons.d.mts.map +0 -1
- package/resources/beta/commerce/coupons.d.ts.map +0 -1
- package/resources/beta/commerce/coupons.js.map +0 -1
- package/resources/beta/commerce/coupons.mjs.map +0 -1
- package/resources/beta/commerce/customers.d.mts.map +0 -1
- package/resources/beta/commerce/customers.d.ts.map +0 -1
- package/resources/beta/commerce/customers.js.map +0 -1
- package/resources/beta/commerce/customers.mjs.map +0 -1
- package/resources/beta/commerce/features.d.mts.map +0 -1
- package/resources/beta/commerce/features.d.ts.map +0 -1
- package/resources/beta/commerce/features.js.map +0 -1
- package/resources/beta/commerce/features.mjs.map +0 -1
- package/resources/beta/commerce/index.d.mts.map +0 -1
- package/resources/beta/commerce/index.d.ts.map +0 -1
- package/resources/beta/commerce/index.js.map +0 -1
- package/resources/beta/commerce/index.mjs.map +0 -1
- package/resources/beta/commerce/products/index.d.mts.map +0 -1
- package/resources/beta/commerce/products/index.d.ts.map +0 -1
- package/resources/beta/commerce/products/index.js.map +0 -1
- package/resources/beta/commerce/products/index.mjs.map +0 -1
- package/resources/beta/commerce/products/products.d.mts.map +0 -1
- package/resources/beta/commerce/products/products.d.ts.map +0 -1
- package/resources/beta/commerce/products/products.js.map +0 -1
- package/resources/beta/commerce/products/products.mjs.map +0 -1
- package/resources/beta/commerce/products/resources.d.mts +0 -161
- package/resources/beta/commerce/products/resources.d.mts.map +0 -1
- package/resources/beta/commerce/products/resources.d.ts +0 -161
- package/resources/beta/commerce/products/resources.d.ts.map +0 -1
- package/resources/beta/commerce/products/resources.js +0 -41
- package/resources/beta/commerce/products/resources.js.map +0 -1
- package/resources/beta/commerce/products/resources.mjs +0 -37
- package/resources/beta/commerce/products/resources.mjs.map +0 -1
- package/resources/beta/commerce/products/variants.d.mts.map +0 -1
- package/resources/beta/commerce/products/variants.d.ts.map +0 -1
- package/resources/beta/commerce/products/variants.js.map +0 -1
- package/resources/beta/commerce/products/variants.mjs.map +0 -1
- package/resources/beta/commerce/products.d.mts.map +0 -1
- package/resources/beta/commerce/products.d.ts.map +0 -1
- package/resources/beta/commerce/products.js.map +0 -1
- package/resources/beta/commerce/products.mjs.map +0 -1
- package/resources/beta/commerce.d.mts.map +0 -1
- package/resources/beta/commerce.js.map +0 -1
- package/resources/beta/commerce.mjs.map +0 -1
- package/resources/beta/content/assets.d.mts.map +0 -1
- package/resources/beta/content/assets.d.ts.map +0 -1
- package/resources/beta/content/assets.js.map +0 -1
- package/resources/beta/content/assets.mjs.map +0 -1
- package/resources/beta/content/content.d.mts.map +0 -1
- package/resources/beta/content/content.d.ts.map +0 -1
- package/resources/beta/content/content.js.map +0 -1
- package/resources/beta/content/content.mjs.map +0 -1
- package/resources/beta/content/entries.d.mts.map +0 -1
- package/resources/beta/content/entries.d.ts.map +0 -1
- package/resources/beta/content/entries.js.map +0 -1
- package/resources/beta/content/entries.mjs.map +0 -1
- package/resources/beta/content/index.d.mts.map +0 -1
- package/resources/beta/content/index.d.ts.map +0 -1
- package/resources/beta/content/index.js.map +0 -1
- package/resources/beta/content/index.mjs.map +0 -1
- package/resources/beta/content/locales.d.mts.map +0 -1
- package/resources/beta/content/locales.d.ts.map +0 -1
- package/resources/beta/content/locales.js.map +0 -1
- package/resources/beta/content/locales.mjs.map +0 -1
- package/resources/beta/content/models/fields.d.mts.map +0 -1
- package/resources/beta/content/models/fields.d.ts.map +0 -1
- package/resources/beta/content/models/fields.js.map +0 -1
- package/resources/beta/content/models/fields.mjs.map +0 -1
- package/resources/beta/content/models/index.d.mts.map +0 -1
- package/resources/beta/content/models/index.d.ts.map +0 -1
- package/resources/beta/content/models/index.js.map +0 -1
- package/resources/beta/content/models/index.mjs.map +0 -1
- package/resources/beta/content/models/models.d.mts.map +0 -1
- package/resources/beta/content/models/models.d.ts.map +0 -1
- package/resources/beta/content/models/models.js.map +0 -1
- package/resources/beta/content/models/models.mjs.map +0 -1
- package/resources/beta/content/models.d.mts.map +0 -1
- package/resources/beta/content/models.d.ts.map +0 -1
- package/resources/beta/content/models.js.map +0 -1
- package/resources/beta/content/models.mjs.map +0 -1
- package/resources/beta/content/releases/index.d.mts.map +0 -1
- package/resources/beta/content/releases/index.d.ts.map +0 -1
- package/resources/beta/content/releases/index.js.map +0 -1
- package/resources/beta/content/releases/index.mjs.map +0 -1
- package/resources/beta/content/releases/items.d.mts.map +0 -1
- package/resources/beta/content/releases/items.d.ts.map +0 -1
- package/resources/beta/content/releases/items.js.map +0 -1
- package/resources/beta/content/releases/items.mjs.map +0 -1
- package/resources/beta/content/releases/releases.d.mts.map +0 -1
- package/resources/beta/content/releases/releases.d.ts.map +0 -1
- package/resources/beta/content/releases/releases.js.map +0 -1
- package/resources/beta/content/releases/releases.mjs.map +0 -1
- package/resources/beta/content/releases.d.mts.map +0 -1
- package/resources/beta/content/releases.d.ts.map +0 -1
- package/resources/beta/content/releases.js.map +0 -1
- package/resources/beta/content/releases.mjs.map +0 -1
- package/resources/beta/content.js.map +0 -1
- package/resources/beta/content.mjs.map +0 -1
- package/resources/beta/index.d.mts +0 -4
- package/resources/beta/index.d.mts.map +0 -1
- package/resources/beta/index.d.ts +0 -4
- package/resources/beta/index.d.ts.map +0 -1
- package/resources/beta/index.js +0 -11
- package/resources/beta/index.js.map +0 -1
- package/resources/beta/index.mjs +0 -5
- package/resources/beta/index.mjs.map +0 -1
- package/resources/beta.d.mts +0 -2
- package/resources/beta.d.mts.map +0 -1
- package/resources/beta.d.ts +0 -2
- package/resources/beta.d.ts.map +0 -1
- package/resources/beta.js.map +0 -1
- package/resources/beta.mjs.map +0 -1
- package/src/resources/beta/beta.ts +0 -37
- package/src/resources/beta/commerce/products/resources.ts +0 -214
- package/src/resources/beta/index.ts +0 -13
- /package/resources/{beta/commerce → commerce}/products/index.js +0 -0
- /package/resources/{beta/commerce → commerce}/products/index.mjs +0 -0
- /package/resources/{beta/commerce → commerce}/products.d.mts +0 -0
- /package/resources/{beta/commerce → commerce}/products.d.ts +0 -0
- /package/resources/{beta/commerce → commerce}/products.mjs +0 -0
- /package/resources/{beta/commerce.d.mts → commerce.d.mts} +0 -0
- /package/resources/{beta/commerce.d.ts → commerce.d.ts} +0 -0
- /package/resources/{beta/commerce.mjs → commerce.mjs} +0 -0
- /package/resources/{beta/content → content}/index.d.mts +0 -0
- /package/resources/{beta/content → content}/index.d.ts +0 -0
- /package/resources/{beta/content → content}/index.js +0 -0
- /package/resources/{beta/content → content}/index.mjs +0 -0
- /package/resources/{beta/content → content}/models/index.d.mts +0 -0
- /package/resources/{beta/content → content}/models/index.d.ts +0 -0
- /package/resources/{beta/content → content}/models/index.js +0 -0
- /package/resources/{beta/content → content}/models/index.mjs +0 -0
- /package/resources/{beta/content → content}/models.d.mts +0 -0
- /package/resources/{beta/content → content}/models.d.ts +0 -0
- /package/resources/{beta/content → content}/models.mjs +0 -0
- /package/resources/{beta/content → content}/releases/index.d.mts +0 -0
- /package/resources/{beta/content → content}/releases/index.d.ts +0 -0
- /package/resources/{beta/content → content}/releases/index.js +0 -0
- /package/resources/{beta/content → content}/releases/index.mjs +0 -0
- /package/resources/{beta/content → content}/releases.d.mts +0 -0
- /package/resources/{beta/content → content}/releases.d.ts +0 -0
- /package/resources/{beta/content → content}/releases.mjs +0 -0
- /package/resources/{beta/content.d.mts → content.d.mts} +0 -0
- /package/resources/{beta/content.d.ts → content.d.ts} +0 -0
- /package/resources/{beta/content.mjs → content.mjs} +0 -0
- /package/src/resources/{beta/commerce → commerce}/products.ts +0 -0
- /package/src/resources/{beta/commerce.ts → commerce.ts} +0 -0
- /package/src/resources/{beta/content → content}/index.ts +0 -0
- /package/src/resources/{beta/content → content}/models/index.ts +0 -0
- /package/src/resources/{beta/content → content}/models.ts +0 -0
- /package/src/resources/{beta/content → content}/releases/index.ts +0 -0
- /package/src/resources/{beta/content → content}/releases.ts +0 -0
- /package/src/resources/{beta/content.ts → content.ts} +0 -0
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as CouponsAPI from "./coupons.mjs";
|
|
3
3
|
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.mjs";
|
|
4
|
-
import * as CustomersAPI from "./customers.mjs";
|
|
5
|
-
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerGetResponse, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.mjs";
|
|
6
4
|
import * as FeaturesAPI from "./features.mjs";
|
|
7
5
|
import { Feature, FeatureCreateParams, FeatureListParams, FeatureUpdateParams, Features, FeaturesCursorIDPage } from "./features.mjs";
|
|
6
|
+
import * as SubscriptionGroupsAPI from "./subscription-groups.mjs";
|
|
7
|
+
import { SubscriptionGroups } from "./subscription-groups.mjs";
|
|
8
|
+
import * as CustomersAPI from "./customers/customers.mjs";
|
|
9
|
+
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerGetResponse, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers/customers.mjs";
|
|
8
10
|
import * as ProductsAPI from "./products/products.mjs";
|
|
9
11
|
import { Product, ProductCreateParams, ProductListParams, ProductUpdateParams, Products, ProductsCursorIDPage } from "./products/products.mjs";
|
|
10
|
-
import { APIPromise } from "
|
|
11
|
-
import { RequestOptions } from "
|
|
12
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
13
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
14
|
+
/**
|
|
15
|
+
* Commerce APIs are currently in beta.
|
|
16
|
+
*/
|
|
12
17
|
export declare class Commerce extends APIResource {
|
|
13
18
|
customers: CustomersAPI.Customers;
|
|
14
19
|
products: ProductsAPI.Products;
|
|
15
20
|
coupons: CouponsAPI.Coupons;
|
|
16
21
|
features: FeaturesAPI.Features;
|
|
22
|
+
subscriptionGroups: SubscriptionGroupsAPI.SubscriptionGroups;
|
|
17
23
|
/**
|
|
18
24
|
* Cancels a customer's subscription. By default, the subscription remains active
|
|
19
25
|
* until the end of the current billing period. Set cancellation_timing to
|
|
20
26
|
* 'immediate' to cancel immediately.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response = await client.commerce.cancel({
|
|
31
|
+
* customer_id: 'cus_1234567890',
|
|
32
|
+
* subscription_id: 'sub_1234567890',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
21
35
|
*/
|
|
22
36
|
cancel(body: CommerceCancelParams, options?: RequestOptions): APIPromise<CommerceCancelResponse>;
|
|
23
37
|
/**
|
|
@@ -25,12 +39,29 @@ export declare class Commerce extends APIResource {
|
|
|
25
39
|
* features in your app based on the customer's active subscription and the
|
|
26
40
|
* entitlements attached to their product. Hercules recommends calling this before
|
|
27
41
|
* allowing access to premium features.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const response = await client.commerce.check({
|
|
46
|
+
* customer_id: 'cus_1234567890',
|
|
47
|
+
* resource_id: 'feat_1234567890',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
28
50
|
*/
|
|
29
51
|
check(body: CommerceCheckParams, options?: RequestOptions): APIPromise<CommerceCheckResponse>;
|
|
30
52
|
/**
|
|
31
53
|
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
32
54
|
* URL to redirect the customer to for payment. After successful payment, the
|
|
33
55
|
* customer is subscribed to the product and gains access to its entitlements.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const response = await client.commerce.checkout({
|
|
60
|
+
* customer_id: 'cus_1234567890',
|
|
61
|
+
* line_items: [{ variant_id: 'var_1234567890' }],
|
|
62
|
+
* success_url: 'https://example.com',
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
34
65
|
*/
|
|
35
66
|
checkout(body: CommerceCheckoutParams, options?: RequestOptions): APIPromise<CommerceCheckoutResponse>;
|
|
36
67
|
}
|
|
@@ -56,23 +87,13 @@ export interface CommerceCancelResponse {
|
|
|
56
87
|
canceled_at?: string | null;
|
|
57
88
|
}
|
|
58
89
|
/**
|
|
59
|
-
* Check resource access response.
|
|
60
|
-
* what means.
|
|
90
|
+
* Check resource access response.
|
|
61
91
|
*/
|
|
62
92
|
export interface CommerceCheckResponse {
|
|
63
|
-
/**
|
|
64
|
-
* How the customer has access: through a subscription, one-time purchase, manual
|
|
65
|
-
* grant, or no access
|
|
66
|
-
*/
|
|
67
|
-
access_type: 'subscription' | 'one_time_purchase' | 'manual_grant' | 'none';
|
|
68
93
|
/**
|
|
69
94
|
* Whether the customer has access to the resource
|
|
70
95
|
*/
|
|
71
96
|
has_access: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* The resource ID that was checked
|
|
74
|
-
*/
|
|
75
|
-
resource_id: string;
|
|
76
97
|
}
|
|
77
98
|
/**
|
|
78
99
|
* Checkout response. For new customers, returns a checkout URL. For existing
|
|
@@ -165,11 +186,6 @@ export interface CommerceCheckoutParams {
|
|
|
165
186
|
* URL to redirect on success
|
|
166
187
|
*/
|
|
167
188
|
success_url: string;
|
|
168
|
-
/**
|
|
169
|
-
* Optional custom ID for the subscription or payment. If not provided, one will be
|
|
170
|
-
* generated.
|
|
171
|
-
*/
|
|
172
|
-
id?: string;
|
|
173
189
|
/**
|
|
174
190
|
* URL to redirect on cancel
|
|
175
191
|
*/
|
|
@@ -222,5 +238,6 @@ export declare namespace Commerce {
|
|
|
222
238
|
export { Products as Products, type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
223
239
|
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
224
240
|
export { Features as Features, type Feature as Feature, type FeaturesCursorIDPage as FeaturesCursorIDPage, type FeatureCreateParams as FeatureCreateParams, type FeatureUpdateParams as FeatureUpdateParams, type FeatureListParams as FeatureListParams, };
|
|
241
|
+
export { SubscriptionGroups as SubscriptionGroups };
|
|
225
242
|
}
|
|
226
243
|
//# sourceMappingURL=commerce.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce.d.mts","sourceRoot":"","sources":["../../src/resources/commerce/commerce.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,WAAW;OAChB,EACL,OAAO,EACP,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACrB;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AAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CACrD"}
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as CouponsAPI from "./coupons.js";
|
|
3
3
|
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.js";
|
|
4
|
-
import * as CustomersAPI from "./customers.js";
|
|
5
|
-
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerGetResponse, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.js";
|
|
6
4
|
import * as FeaturesAPI from "./features.js";
|
|
7
5
|
import { Feature, FeatureCreateParams, FeatureListParams, FeatureUpdateParams, Features, FeaturesCursorIDPage } from "./features.js";
|
|
6
|
+
import * as SubscriptionGroupsAPI from "./subscription-groups.js";
|
|
7
|
+
import { SubscriptionGroups } from "./subscription-groups.js";
|
|
8
|
+
import * as CustomersAPI from "./customers/customers.js";
|
|
9
|
+
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerGetResponse, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers/customers.js";
|
|
8
10
|
import * as ProductsAPI from "./products/products.js";
|
|
9
11
|
import { Product, ProductCreateParams, ProductListParams, ProductUpdateParams, Products, ProductsCursorIDPage } from "./products/products.js";
|
|
10
|
-
import { APIPromise } from "
|
|
11
|
-
import { RequestOptions } from "
|
|
12
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
13
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
14
|
+
/**
|
|
15
|
+
* Commerce APIs are currently in beta.
|
|
16
|
+
*/
|
|
12
17
|
export declare class Commerce extends APIResource {
|
|
13
18
|
customers: CustomersAPI.Customers;
|
|
14
19
|
products: ProductsAPI.Products;
|
|
15
20
|
coupons: CouponsAPI.Coupons;
|
|
16
21
|
features: FeaturesAPI.Features;
|
|
22
|
+
subscriptionGroups: SubscriptionGroupsAPI.SubscriptionGroups;
|
|
17
23
|
/**
|
|
18
24
|
* Cancels a customer's subscription. By default, the subscription remains active
|
|
19
25
|
* until the end of the current billing period. Set cancellation_timing to
|
|
20
26
|
* 'immediate' to cancel immediately.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response = await client.commerce.cancel({
|
|
31
|
+
* customer_id: 'cus_1234567890',
|
|
32
|
+
* subscription_id: 'sub_1234567890',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
21
35
|
*/
|
|
22
36
|
cancel(body: CommerceCancelParams, options?: RequestOptions): APIPromise<CommerceCancelResponse>;
|
|
23
37
|
/**
|
|
@@ -25,12 +39,29 @@ export declare class Commerce extends APIResource {
|
|
|
25
39
|
* features in your app based on the customer's active subscription and the
|
|
26
40
|
* entitlements attached to their product. Hercules recommends calling this before
|
|
27
41
|
* allowing access to premium features.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const response = await client.commerce.check({
|
|
46
|
+
* customer_id: 'cus_1234567890',
|
|
47
|
+
* resource_id: 'feat_1234567890',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
28
50
|
*/
|
|
29
51
|
check(body: CommerceCheckParams, options?: RequestOptions): APIPromise<CommerceCheckResponse>;
|
|
30
52
|
/**
|
|
31
53
|
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
32
54
|
* URL to redirect the customer to for payment. After successful payment, the
|
|
33
55
|
* customer is subscribed to the product and gains access to its entitlements.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const response = await client.commerce.checkout({
|
|
60
|
+
* customer_id: 'cus_1234567890',
|
|
61
|
+
* line_items: [{ variant_id: 'var_1234567890' }],
|
|
62
|
+
* success_url: 'https://example.com',
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
34
65
|
*/
|
|
35
66
|
checkout(body: CommerceCheckoutParams, options?: RequestOptions): APIPromise<CommerceCheckoutResponse>;
|
|
36
67
|
}
|
|
@@ -56,23 +87,13 @@ export interface CommerceCancelResponse {
|
|
|
56
87
|
canceled_at?: string | null;
|
|
57
88
|
}
|
|
58
89
|
/**
|
|
59
|
-
* Check resource access response.
|
|
60
|
-
* what means.
|
|
90
|
+
* Check resource access response.
|
|
61
91
|
*/
|
|
62
92
|
export interface CommerceCheckResponse {
|
|
63
|
-
/**
|
|
64
|
-
* How the customer has access: through a subscription, one-time purchase, manual
|
|
65
|
-
* grant, or no access
|
|
66
|
-
*/
|
|
67
|
-
access_type: 'subscription' | 'one_time_purchase' | 'manual_grant' | 'none';
|
|
68
93
|
/**
|
|
69
94
|
* Whether the customer has access to the resource
|
|
70
95
|
*/
|
|
71
96
|
has_access: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* The resource ID that was checked
|
|
74
|
-
*/
|
|
75
|
-
resource_id: string;
|
|
76
97
|
}
|
|
77
98
|
/**
|
|
78
99
|
* Checkout response. For new customers, returns a checkout URL. For existing
|
|
@@ -165,11 +186,6 @@ export interface CommerceCheckoutParams {
|
|
|
165
186
|
* URL to redirect on success
|
|
166
187
|
*/
|
|
167
188
|
success_url: string;
|
|
168
|
-
/**
|
|
169
|
-
* Optional custom ID for the subscription or payment. If not provided, one will be
|
|
170
|
-
* generated.
|
|
171
|
-
*/
|
|
172
|
-
id?: string;
|
|
173
189
|
/**
|
|
174
190
|
* URL to redirect on cancel
|
|
175
191
|
*/
|
|
@@ -222,5 +238,6 @@ export declare namespace Commerce {
|
|
|
222
238
|
export { Products as Products, type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
|
|
223
239
|
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
224
240
|
export { Features as Features, type Feature as Feature, type FeaturesCursorIDPage as FeaturesCursorIDPage, type FeatureCreateParams as FeatureCreateParams, type FeatureUpdateParams as FeatureUpdateParams, type FeatureListParams as FeatureListParams, };
|
|
241
|
+
export { SubscriptionGroups as SubscriptionGroups };
|
|
225
242
|
}
|
|
226
243
|
//# sourceMappingURL=commerce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce.d.ts","sourceRoot":"","sources":["../../src/resources/commerce/commerce.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,WAAW;OAChB,EACL,OAAO,EACP,mBAAmB,EACnB,i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AC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EAAE,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;CACrD"}
|
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Commerce = void 0;
|
|
5
|
-
const tslib_1 = require("
|
|
6
|
-
const resource_1 = require("
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
7
|
const CouponsAPI = tslib_1.__importStar(require("./coupons.js"));
|
|
8
8
|
const coupons_1 = require("./coupons.js");
|
|
9
|
-
const CustomersAPI = tslib_1.__importStar(require("./customers.js"));
|
|
10
|
-
const customers_1 = require("./customers.js");
|
|
11
9
|
const FeaturesAPI = tslib_1.__importStar(require("./features.js"));
|
|
12
10
|
const features_1 = require("./features.js");
|
|
11
|
+
const SubscriptionGroupsAPI = tslib_1.__importStar(require("./subscription-groups.js"));
|
|
12
|
+
const subscription_groups_1 = require("./subscription-groups.js");
|
|
13
|
+
const CustomersAPI = tslib_1.__importStar(require("./customers/customers.js"));
|
|
14
|
+
const customers_1 = require("./customers/customers.js");
|
|
13
15
|
const ProductsAPI = tslib_1.__importStar(require("./products/products.js"));
|
|
14
16
|
const products_1 = require("./products/products.js");
|
|
17
|
+
/**
|
|
18
|
+
* Commerce APIs are currently in beta.
|
|
19
|
+
*/
|
|
15
20
|
class Commerce extends resource_1.APIResource {
|
|
16
21
|
constructor() {
|
|
17
22
|
super(...arguments);
|
|
@@ -19,11 +24,20 @@ class Commerce extends resource_1.APIResource {
|
|
|
19
24
|
this.products = new ProductsAPI.Products(this._client);
|
|
20
25
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
21
26
|
this.features = new FeaturesAPI.Features(this._client);
|
|
27
|
+
this.subscriptionGroups = new SubscriptionGroupsAPI.SubscriptionGroups(this._client);
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
30
|
* Cancels a customer's subscription. By default, the subscription remains active
|
|
25
31
|
* until the end of the current billing period. Set cancellation_timing to
|
|
26
32
|
* 'immediate' to cancel immediately.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const response = await client.commerce.cancel({
|
|
37
|
+
* customer_id: 'cus_1234567890',
|
|
38
|
+
* subscription_id: 'sub_1234567890',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
27
41
|
*/
|
|
28
42
|
cancel(body, options) {
|
|
29
43
|
return this._client.post('/v1/commerce/cancel', { body, ...options });
|
|
@@ -33,6 +47,14 @@ class Commerce extends resource_1.APIResource {
|
|
|
33
47
|
* features in your app based on the customer's active subscription and the
|
|
34
48
|
* entitlements attached to their product. Hercules recommends calling this before
|
|
35
49
|
* allowing access to premium features.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const response = await client.commerce.check({
|
|
54
|
+
* customer_id: 'cus_1234567890',
|
|
55
|
+
* resource_id: 'feat_1234567890',
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
36
58
|
*/
|
|
37
59
|
check(body, options) {
|
|
38
60
|
return this._client.post('/v1/commerce/check', { body, ...options });
|
|
@@ -41,6 +63,15 @@ class Commerce extends resource_1.APIResource {
|
|
|
41
63
|
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
42
64
|
* URL to redirect the customer to for payment. After successful payment, the
|
|
43
65
|
* customer is subscribed to the product and gains access to its entitlements.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const response = await client.commerce.checkout({
|
|
70
|
+
* customer_id: 'cus_1234567890',
|
|
71
|
+
* line_items: [{ variant_id: 'var_1234567890' }],
|
|
72
|
+
* success_url: 'https://example.com',
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
44
75
|
*/
|
|
45
76
|
checkout(body, options) {
|
|
46
77
|
return this._client.post('/v1/commerce/checkout', { body, ...options });
|
|
@@ -51,4 +82,5 @@ Commerce.Customers = customers_1.Customers;
|
|
|
51
82
|
Commerce.Products = products_1.Products;
|
|
52
83
|
Commerce.Coupons = coupons_1.Coupons;
|
|
53
84
|
Commerce.Features = features_1.Features;
|
|
85
|
+
Commerce.SubscriptionGroups = subscription_groups_1.SubscriptionGroups;
|
|
54
86
|
//# sourceMappingURL=commerce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce.js","sourceRoot":"","sources":["../../src/resources/commerce/commerce.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,0CAOmB;AACnB,mEAA0C;AAC1C,4CAOoB;AACpB,wFAA+D;AAC/D,kEAA2D;AAC3D,+EAAsD;AACtD,wDAW+B;AAC/B,4EAAmD;AACnD,qDAO6B;AAI7B;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AAC;AAC7B,QAAQ,CAAC,kBAAkB,GAAG,wCAAkB,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as CouponsAPI from "./coupons.mjs";
|
|
4
4
|
import { Coupons, } from "./coupons.mjs";
|
|
5
|
-
import * as CustomersAPI from "./customers.mjs";
|
|
6
|
-
import { Customers, } from "./customers.mjs";
|
|
7
5
|
import * as FeaturesAPI from "./features.mjs";
|
|
8
6
|
import { Features, } from "./features.mjs";
|
|
7
|
+
import * as SubscriptionGroupsAPI from "./subscription-groups.mjs";
|
|
8
|
+
import { SubscriptionGroups } from "./subscription-groups.mjs";
|
|
9
|
+
import * as CustomersAPI from "./customers/customers.mjs";
|
|
10
|
+
import { Customers, } from "./customers/customers.mjs";
|
|
9
11
|
import * as ProductsAPI from "./products/products.mjs";
|
|
10
12
|
import { Products, } from "./products/products.mjs";
|
|
13
|
+
/**
|
|
14
|
+
* Commerce APIs are currently in beta.
|
|
15
|
+
*/
|
|
11
16
|
export class Commerce extends APIResource {
|
|
12
17
|
constructor() {
|
|
13
18
|
super(...arguments);
|
|
@@ -15,11 +20,20 @@ export class Commerce extends APIResource {
|
|
|
15
20
|
this.products = new ProductsAPI.Products(this._client);
|
|
16
21
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
17
22
|
this.features = new FeaturesAPI.Features(this._client);
|
|
23
|
+
this.subscriptionGroups = new SubscriptionGroupsAPI.SubscriptionGroups(this._client);
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* Cancels a customer's subscription. By default, the subscription remains active
|
|
21
27
|
* until the end of the current billing period. Set cancellation_timing to
|
|
22
28
|
* 'immediate' to cancel immediately.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.commerce.cancel({
|
|
33
|
+
* customer_id: 'cus_1234567890',
|
|
34
|
+
* subscription_id: 'sub_1234567890',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
23
37
|
*/
|
|
24
38
|
cancel(body, options) {
|
|
25
39
|
return this._client.post('/v1/commerce/cancel', { body, ...options });
|
|
@@ -29,6 +43,14 @@ export class Commerce extends APIResource {
|
|
|
29
43
|
* features in your app based on the customer's active subscription and the
|
|
30
44
|
* entitlements attached to their product. Hercules recommends calling this before
|
|
31
45
|
* allowing access to premium features.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response = await client.commerce.check({
|
|
50
|
+
* customer_id: 'cus_1234567890',
|
|
51
|
+
* resource_id: 'feat_1234567890',
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
32
54
|
*/
|
|
33
55
|
check(body, options) {
|
|
34
56
|
return this._client.post('/v1/commerce/check', { body, ...options });
|
|
@@ -37,6 +59,15 @@ export class Commerce extends APIResource {
|
|
|
37
59
|
* Creates a checkout session for a customer to subscribe to a product. Returns a
|
|
38
60
|
* URL to redirect the customer to for payment. After successful payment, the
|
|
39
61
|
* customer is subscribed to the product and gains access to its entitlements.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const response = await client.commerce.checkout({
|
|
66
|
+
* customer_id: 'cus_1234567890',
|
|
67
|
+
* line_items: [{ variant_id: 'var_1234567890' }],
|
|
68
|
+
* success_url: 'https://example.com',
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
40
71
|
*/
|
|
41
72
|
checkout(body, options) {
|
|
42
73
|
return this._client.post('/v1/commerce/checkout', { body, ...options });
|
|
@@ -46,4 +77,5 @@ Commerce.Customers = Customers;
|
|
|
46
77
|
Commerce.Products = Products;
|
|
47
78
|
Commerce.Coupons = Coupons;
|
|
48
79
|
Commerce.Features = Features;
|
|
80
|
+
Commerce.SubscriptionGroups = SubscriptionGroups;
|
|
49
81
|
//# sourceMappingURL=commerce.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce.mjs","sourceRoot":"","sources":["../../src/resources/commerce/commerce.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAKL,OAAO,GAER;OACM,KAAK,WAAW;OAChB,EAKL,QAAQ,GAET;OACM,KAAK,qBAAqB;OAC1B,EAAE,kBAAkB,EAAE;OACtB,KAAK,YAAY;OACjB,EASL,SAAS,GAEV;OACM,KAAK,WAAW;OAChB,EAKL,QAAQ,GAET;AAID;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;IAsDJ,CAAC;IApDC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAA0B,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAyB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,IAA4B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AAuMD,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;AAC/B,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC;AAC3B,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}
|
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
2
|
-
import { APIPromise } from "
|
|
3
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "
|
|
4
|
-
import { RequestOptions } from "
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
5
|
export declare class Coupons extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
8
|
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
9
|
* date. Customers can apply coupons during checkout.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const coupon = await client.commerce.coupons.create({
|
|
14
|
+
* code: 'LAUNCH20',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
10
17
|
*/
|
|
11
18
|
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
19
|
/**
|
|
13
20
|
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
21
|
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const coupon = await client.commerce.coupons.update(
|
|
26
|
+
* 'coupon_1234567890',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
15
29
|
*/
|
|
16
30
|
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
31
|
/**
|
|
18
32
|
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
33
|
* customers can apply during checkout using a promo code.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Automatically fetches more pages as needed.
|
|
38
|
+
* for await (const coupon of client.commerce.coupons.list()) {
|
|
39
|
+
* // ...
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
20
42
|
*/
|
|
21
43
|
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
-
/**
|
|
23
|
-
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
-
* discounts applied to active subscriptions are not affected.
|
|
25
|
-
*/
|
|
26
|
-
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
44
|
/**
|
|
28
45
|
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
46
|
* and redemption statistics.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const coupon = await client.commerce.coupons.get(
|
|
51
|
+
* 'coupon_1234567890',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
30
54
|
*/
|
|
31
55
|
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
56
|
}
|
|
@@ -36,7 +60,7 @@ export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
|
36
60
|
*/
|
|
37
61
|
export interface Coupon {
|
|
38
62
|
/**
|
|
39
|
-
* Unique identifier for the
|
|
63
|
+
* Unique identifier for the coupon
|
|
40
64
|
*/
|
|
41
65
|
id: string;
|
|
42
66
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.d.mts","sourceRoot":"","sources":["../../src/resources/commerce/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;;;;;;;;OAUG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAI3C;;;;;;;;;;OAUG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAGpE;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,EAAE,MAAM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1D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
2
|
-
import { APIPromise } from "
|
|
3
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "
|
|
4
|
-
import { RequestOptions } from "
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
5
|
export declare class Coupons extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
8
|
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
9
|
* date. Customers can apply coupons during checkout.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const coupon = await client.commerce.coupons.create({
|
|
14
|
+
* code: 'LAUNCH20',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
10
17
|
*/
|
|
11
18
|
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
19
|
/**
|
|
13
20
|
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
21
|
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const coupon = await client.commerce.coupons.update(
|
|
26
|
+
* 'coupon_1234567890',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
15
29
|
*/
|
|
16
30
|
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
31
|
/**
|
|
18
32
|
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
33
|
* customers can apply during checkout using a promo code.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Automatically fetches more pages as needed.
|
|
38
|
+
* for await (const coupon of client.commerce.coupons.list()) {
|
|
39
|
+
* // ...
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
20
42
|
*/
|
|
21
43
|
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
-
/**
|
|
23
|
-
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
-
* discounts applied to active subscriptions are not affected.
|
|
25
|
-
*/
|
|
26
|
-
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
44
|
/**
|
|
28
45
|
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
46
|
* and redemption statistics.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const coupon = await client.commerce.coupons.get(
|
|
51
|
+
* 'coupon_1234567890',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
30
54
|
*/
|
|
31
55
|
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
56
|
}
|
|
@@ -36,7 +60,7 @@ export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
|
36
60
|
*/
|
|
37
61
|
export interface Coupon {
|
|
38
62
|
/**
|
|
39
|
-
* Unique identifier for the
|
|
63
|
+
* Unique identifier for the coupon
|
|
40
64
|
*/
|
|
41
65
|
id: string;
|
|
42
66
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.d.ts","sourceRoot":"","sources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