@usehercules/sdk 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -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 +36 -11
- package/resources/commerce/features.d.mts.map +1 -0
- package/resources/{beta/commerce → commerce}/features.d.ts +36 -11
- package/resources/commerce/features.d.ts.map +1 -0
- package/resources/{beta/commerce → commerce}/features.js +33 -14
- package/resources/commerce/features.js.map +1 -0
- package/resources/{beta/commerce → commerce}/features.mjs +33 -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 +37 -19
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-transactions.d.ts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/balance-transactions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;AAEtB,qBAAa,mBAAoB,SAAQ,WAAW;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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.BalanceTransactions = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
class BalanceTransactions extends resource_1.APIResource {
|
|
7
|
+
}
|
|
8
|
+
exports.BalanceTransactions = BalanceTransactions;
|
|
9
|
+
//# sourceMappingURL=balance-transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-transactions.js","sourceRoot":"","sources":["../../../src/resources/commerce/customers/balance-transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,MAAa,mBAAoB,SAAQ,sBAAW;CAAG;AAAvD,kDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"balance-transactions.mjs","sourceRoot":"","sources":["../../../src/resources/commerce/customers/balance-transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,mBAAoB,SAAQ,WAAW;CAAG"}
|
|
@@ -1,40 +1,73 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as BalanceTransactionsAPI from "./balance-transactions.mjs";
|
|
3
|
+
import { BalanceTransactions } from "./balance-transactions.mjs";
|
|
2
4
|
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
5
|
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
6
|
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
7
|
export declare class Customers extends APIResource {
|
|
8
|
+
balanceTransactions: BalanceTransactionsAPI.BalanceTransactions;
|
|
6
9
|
/**
|
|
7
10
|
* Creates a new billable customer. A customer represents the entity in your app
|
|
8
11
|
* that will be charged—typically a user, organization, or project. Hercules
|
|
9
12
|
* recommends creating a customer immediately after creating the corresponding
|
|
10
13
|
* entity in your app.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const customer = await client.commerce.customers.create();
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
create(body?: CustomerCreateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
13
21
|
/**
|
|
14
22
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
15
23
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const customer = await client.commerce.customers.update(
|
|
28
|
+
* 'cus_1234567890',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
16
31
|
*/
|
|
17
32
|
update(customerID: string, body?: CustomerUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
18
33
|
/**
|
|
19
34
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
20
35
|
* in your app—typically users, organizations, or projects.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Automatically fetches more pages as needed.
|
|
40
|
+
* for await (const customer of client.commerce.customers.list()) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
21
44
|
*/
|
|
22
45
|
list(query?: CustomerListParams | null | undefined, options?: RequestOptions): PagePromise<CustomersCursorIDPage, Customer>;
|
|
23
|
-
/**
|
|
24
|
-
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
25
|
-
* action cannot be undone.
|
|
26
|
-
*/
|
|
27
|
-
delete(customerID: string, options?: RequestOptions): APIPromise<void>;
|
|
28
46
|
/**
|
|
29
47
|
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
30
48
|
* update payment methods, and manage billing details. Redirect the customer to the
|
|
31
49
|
* returned URL.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const response =
|
|
54
|
+
* await client.commerce.customers.billingPortal(
|
|
55
|
+
* 'cus_1234567890',
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
32
58
|
*/
|
|
33
59
|
billingPortal(customerID: string, body?: CustomerBillingPortalParams | null | undefined, options?: RequestOptions): APIPromise<CustomerBillingPortalResponse>;
|
|
34
60
|
/**
|
|
35
61
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
36
62
|
* information, billing address, active subscriptions, recent invoices, and saved
|
|
37
63
|
* payment methods.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const customer = await client.commerce.customers.get(
|
|
68
|
+
* 'cus_1234567890',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
38
71
|
*/
|
|
39
72
|
get(customerID: string, options?: RequestOptions): APIPromise<CustomerGetResponse>;
|
|
40
73
|
}
|
|
@@ -45,7 +78,7 @@ export type CustomersCursorIDPage = CursorIDPage<Customer>;
|
|
|
45
78
|
*/
|
|
46
79
|
export interface Customer {
|
|
47
80
|
/**
|
|
48
|
-
* Unique identifier for the
|
|
81
|
+
* Unique identifier for the customer
|
|
49
82
|
*/
|
|
50
83
|
id: string;
|
|
51
84
|
/**
|
|
@@ -113,7 +146,7 @@ export interface CustomerBillingPortalResponse {
|
|
|
113
146
|
*/
|
|
114
147
|
export interface CustomerGetResponse {
|
|
115
148
|
/**
|
|
116
|
-
* Unique identifier for the
|
|
149
|
+
* Unique identifier for the customer
|
|
117
150
|
*/
|
|
118
151
|
id: string;
|
|
119
152
|
/**
|
|
@@ -124,6 +157,11 @@ export interface CustomerGetResponse {
|
|
|
124
157
|
* The customer's billing address
|
|
125
158
|
*/
|
|
126
159
|
address?: CustomerAddress | null;
|
|
160
|
+
/**
|
|
161
|
+
* Current customer balance in cents (negative = credit available to apply to
|
|
162
|
+
* future invoices)
|
|
163
|
+
*/
|
|
164
|
+
balance?: number;
|
|
127
165
|
/**
|
|
128
166
|
* The customer's email address for receipts and notifications
|
|
129
167
|
*/
|
|
@@ -155,7 +193,7 @@ export declare namespace CustomerGetResponse {
|
|
|
155
193
|
*/
|
|
156
194
|
interface Invoice {
|
|
157
195
|
/**
|
|
158
|
-
* Unique identifier for the
|
|
196
|
+
* Unique identifier for the invoice
|
|
159
197
|
*/
|
|
160
198
|
id: string;
|
|
161
199
|
/**
|
|
@@ -224,7 +262,7 @@ export declare namespace CustomerGetResponse {
|
|
|
224
262
|
*/
|
|
225
263
|
interface PaymentMethod {
|
|
226
264
|
/**
|
|
227
|
-
* Unique identifier for the
|
|
265
|
+
* Unique identifier for the payment method
|
|
228
266
|
*/
|
|
229
267
|
id: string;
|
|
230
268
|
/**
|
|
@@ -272,7 +310,7 @@ export declare namespace CustomerGetResponse {
|
|
|
272
310
|
*/
|
|
273
311
|
interface Subscription {
|
|
274
312
|
/**
|
|
275
|
-
* Unique identifier for the
|
|
313
|
+
* Unique identifier for the subscription
|
|
276
314
|
*/
|
|
277
315
|
id: string;
|
|
278
316
|
/**
|
|
@@ -322,7 +360,7 @@ export declare namespace CustomerGetResponse {
|
|
|
322
360
|
*/
|
|
323
361
|
interface Product {
|
|
324
362
|
/**
|
|
325
|
-
* Unique identifier for the
|
|
363
|
+
* Unique identifier for the product
|
|
326
364
|
*/
|
|
327
365
|
id: string;
|
|
328
366
|
/**
|
|
@@ -335,7 +373,7 @@ export declare namespace CustomerGetResponse {
|
|
|
335
373
|
*/
|
|
336
374
|
interface Variant {
|
|
337
375
|
/**
|
|
338
|
-
* Unique identifier for the
|
|
376
|
+
* Unique identifier for the variant
|
|
339
377
|
*/
|
|
340
378
|
id: string;
|
|
341
379
|
/**
|
|
@@ -439,5 +477,6 @@ export interface CustomerBillingPortalParams {
|
|
|
439
477
|
}
|
|
440
478
|
export declare namespace Customers {
|
|
441
479
|
export { type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomerGetResponse as CustomerGetResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
480
|
+
export { BalanceTransactions as BalanceTransactions };
|
|
442
481
|
}
|
|
443
482
|
//# sourceMappingURL=customers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.mts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/customers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,sBAAsB;OAC3B,EAAE,mBAAmB,EAAE;OACvB,EAAE,UAAU,EAA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AAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EAAE,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACvD"}
|
|
@@ -1,40 +1,73 @@
|
|
|
1
1
|
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as BalanceTransactionsAPI from "./balance-transactions.js";
|
|
3
|
+
import { BalanceTransactions } from "./balance-transactions.js";
|
|
2
4
|
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
5
|
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
|
|
4
6
|
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
7
|
export declare class Customers extends APIResource {
|
|
8
|
+
balanceTransactions: BalanceTransactionsAPI.BalanceTransactions;
|
|
6
9
|
/**
|
|
7
10
|
* Creates a new billable customer. A customer represents the entity in your app
|
|
8
11
|
* that will be charged—typically a user, organization, or project. Hercules
|
|
9
12
|
* recommends creating a customer immediately after creating the corresponding
|
|
10
13
|
* entity in your app.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const customer = await client.commerce.customers.create();
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
create(body?: CustomerCreateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
13
21
|
/**
|
|
14
22
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
15
23
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const customer = await client.commerce.customers.update(
|
|
28
|
+
* 'cus_1234567890',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
16
31
|
*/
|
|
17
32
|
update(customerID: string, body?: CustomerUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
18
33
|
/**
|
|
19
34
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
20
35
|
* in your app—typically users, organizations, or projects.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Automatically fetches more pages as needed.
|
|
40
|
+
* for await (const customer of client.commerce.customers.list()) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
21
44
|
*/
|
|
22
45
|
list(query?: CustomerListParams | null | undefined, options?: RequestOptions): PagePromise<CustomersCursorIDPage, Customer>;
|
|
23
|
-
/**
|
|
24
|
-
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
25
|
-
* action cannot be undone.
|
|
26
|
-
*/
|
|
27
|
-
delete(customerID: string, options?: RequestOptions): APIPromise<void>;
|
|
28
46
|
/**
|
|
29
47
|
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
30
48
|
* update payment methods, and manage billing details. Redirect the customer to the
|
|
31
49
|
* returned URL.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const response =
|
|
54
|
+
* await client.commerce.customers.billingPortal(
|
|
55
|
+
* 'cus_1234567890',
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
32
58
|
*/
|
|
33
59
|
billingPortal(customerID: string, body?: CustomerBillingPortalParams | null | undefined, options?: RequestOptions): APIPromise<CustomerBillingPortalResponse>;
|
|
34
60
|
/**
|
|
35
61
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
36
62
|
* information, billing address, active subscriptions, recent invoices, and saved
|
|
37
63
|
* payment methods.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const customer = await client.commerce.customers.get(
|
|
68
|
+
* 'cus_1234567890',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
38
71
|
*/
|
|
39
72
|
get(customerID: string, options?: RequestOptions): APIPromise<CustomerGetResponse>;
|
|
40
73
|
}
|
|
@@ -45,7 +78,7 @@ export type CustomersCursorIDPage = CursorIDPage<Customer>;
|
|
|
45
78
|
*/
|
|
46
79
|
export interface Customer {
|
|
47
80
|
/**
|
|
48
|
-
* Unique identifier for the
|
|
81
|
+
* Unique identifier for the customer
|
|
49
82
|
*/
|
|
50
83
|
id: string;
|
|
51
84
|
/**
|
|
@@ -113,7 +146,7 @@ export interface CustomerBillingPortalResponse {
|
|
|
113
146
|
*/
|
|
114
147
|
export interface CustomerGetResponse {
|
|
115
148
|
/**
|
|
116
|
-
* Unique identifier for the
|
|
149
|
+
* Unique identifier for the customer
|
|
117
150
|
*/
|
|
118
151
|
id: string;
|
|
119
152
|
/**
|
|
@@ -124,6 +157,11 @@ export interface CustomerGetResponse {
|
|
|
124
157
|
* The customer's billing address
|
|
125
158
|
*/
|
|
126
159
|
address?: CustomerAddress | null;
|
|
160
|
+
/**
|
|
161
|
+
* Current customer balance in cents (negative = credit available to apply to
|
|
162
|
+
* future invoices)
|
|
163
|
+
*/
|
|
164
|
+
balance?: number;
|
|
127
165
|
/**
|
|
128
166
|
* The customer's email address for receipts and notifications
|
|
129
167
|
*/
|
|
@@ -155,7 +193,7 @@ export declare namespace CustomerGetResponse {
|
|
|
155
193
|
*/
|
|
156
194
|
interface Invoice {
|
|
157
195
|
/**
|
|
158
|
-
* Unique identifier for the
|
|
196
|
+
* Unique identifier for the invoice
|
|
159
197
|
*/
|
|
160
198
|
id: string;
|
|
161
199
|
/**
|
|
@@ -224,7 +262,7 @@ export declare namespace CustomerGetResponse {
|
|
|
224
262
|
*/
|
|
225
263
|
interface PaymentMethod {
|
|
226
264
|
/**
|
|
227
|
-
* Unique identifier for the
|
|
265
|
+
* Unique identifier for the payment method
|
|
228
266
|
*/
|
|
229
267
|
id: string;
|
|
230
268
|
/**
|
|
@@ -272,7 +310,7 @@ export declare namespace CustomerGetResponse {
|
|
|
272
310
|
*/
|
|
273
311
|
interface Subscription {
|
|
274
312
|
/**
|
|
275
|
-
* Unique identifier for the
|
|
313
|
+
* Unique identifier for the subscription
|
|
276
314
|
*/
|
|
277
315
|
id: string;
|
|
278
316
|
/**
|
|
@@ -322,7 +360,7 @@ export declare namespace CustomerGetResponse {
|
|
|
322
360
|
*/
|
|
323
361
|
interface Product {
|
|
324
362
|
/**
|
|
325
|
-
* Unique identifier for the
|
|
363
|
+
* Unique identifier for the product
|
|
326
364
|
*/
|
|
327
365
|
id: string;
|
|
328
366
|
/**
|
|
@@ -335,7 +373,7 @@ export declare namespace CustomerGetResponse {
|
|
|
335
373
|
*/
|
|
336
374
|
interface Variant {
|
|
337
375
|
/**
|
|
338
|
-
* Unique identifier for the
|
|
376
|
+
* Unique identifier for the variant
|
|
339
377
|
*/
|
|
340
378
|
id: string;
|
|
341
379
|
/**
|
|
@@ -439,5 +477,6 @@ export interface CustomerBillingPortalParams {
|
|
|
439
477
|
}
|
|
440
478
|
export declare namespace Customers {
|
|
441
479
|
export { type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomerGetResponse as CustomerGetResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
480
|
+
export { BalanceTransactions as BalanceTransactions };
|
|
442
481
|
}
|
|
443
482
|
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/customers.ts"],"names":[],"mappings":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MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EAAE,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACvD"}
|
|
@@ -2,16 +2,27 @@
|
|
|
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.Customers = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
5
6
|
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const BalanceTransactionsAPI = tslib_1.__importStar(require("./balance-transactions.js"));
|
|
8
|
+
const balance_transactions_1 = require("./balance-transactions.js");
|
|
6
9
|
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
-
const headers_1 = require("../../../internal/headers.js");
|
|
8
10
|
const path_1 = require("../../../internal/utils/path.js");
|
|
9
11
|
class Customers extends resource_1.APIResource {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.balanceTransactions = new BalanceTransactionsAPI.BalanceTransactions(this._client);
|
|
15
|
+
}
|
|
10
16
|
/**
|
|
11
17
|
* Creates a new billable customer. A customer represents the entity in your app
|
|
12
18
|
* that will be charged—typically a user, organization, or project. Hercules
|
|
13
19
|
* recommends creating a customer immediately after creating the corresponding
|
|
14
20
|
* entity in your app.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const customer = await client.commerce.customers.create();
|
|
25
|
+
* ```
|
|
15
26
|
*/
|
|
16
27
|
create(body = {}, options) {
|
|
17
28
|
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
@@ -19,6 +30,13 @@ class Customers extends resource_1.APIResource {
|
|
|
19
30
|
/**
|
|
20
31
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
21
32
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const customer = await client.commerce.customers.update(
|
|
37
|
+
* 'cus_1234567890',
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
22
40
|
*/
|
|
23
41
|
update(customerID, body = {}, options) {
|
|
24
42
|
return this._client.patch((0, path_1.path) `/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
@@ -26,24 +44,30 @@ class Customers extends resource_1.APIResource {
|
|
|
26
44
|
/**
|
|
27
45
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
28
46
|
* in your app—typically users, organizations, or projects.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Automatically fetches more pages as needed.
|
|
51
|
+
* for await (const customer of client.commerce.customers.list()) {
|
|
52
|
+
* // ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
29
55
|
*/
|
|
30
56
|
list(query = {}, options) {
|
|
31
57
|
return this._client.getAPIList('/v1/commerce/customers', (pagination_1.CursorIDPage), { query, ...options });
|
|
32
58
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
35
|
-
* action cannot be undone.
|
|
36
|
-
*/
|
|
37
|
-
delete(customerID, options) {
|
|
38
|
-
return this._client.delete((0, path_1.path) `/v1/commerce/customers/${customerID}`, {
|
|
39
|
-
...options,
|
|
40
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
59
|
/**
|
|
44
60
|
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
45
61
|
* update payment methods, and manage billing details. Redirect the customer to the
|
|
46
62
|
* returned URL.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const response =
|
|
67
|
+
* await client.commerce.customers.billingPortal(
|
|
68
|
+
* 'cus_1234567890',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
47
71
|
*/
|
|
48
72
|
billingPortal(customerID, body = {}, options) {
|
|
49
73
|
return this._client.post((0, path_1.path) `/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
@@ -52,10 +76,18 @@ class Customers extends resource_1.APIResource {
|
|
|
52
76
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
53
77
|
* information, billing address, active subscriptions, recent invoices, and saved
|
|
54
78
|
* payment methods.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const customer = await client.commerce.customers.get(
|
|
83
|
+
* 'cus_1234567890',
|
|
84
|
+
* );
|
|
85
|
+
* ```
|
|
55
86
|
*/
|
|
56
87
|
get(customerID, options) {
|
|
57
88
|
return this._client.get((0, path_1.path) `/v1/commerce/customers/${customerID}`, options);
|
|
58
89
|
}
|
|
59
90
|
}
|
|
60
91
|
exports.Customers = Customers;
|
|
92
|
+
Customers.BalanceTransactions = balance_transactions_1.BalanceTransactions;
|
|
61
93
|
//# sourceMappingURL=customers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../src/resources/commerce/customers/customers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,0FAAiE;AACjE,oEAA6D;AAE7D,4DAA8F;AAE9F,0DAAoD;AAEpD,M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mBAAmB,GAAG,0CAAmB,CAAC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as BalanceTransactionsAPI from "./balance-transactions.mjs";
|
|
4
|
+
import { BalanceTransactions } from "./balance-transactions.mjs";
|
|
3
5
|
import { CursorIDPage } from "../../../core/pagination.mjs";
|
|
4
|
-
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
5
6
|
import { path } from "../../../internal/utils/path.mjs";
|
|
6
7
|
export class Customers extends APIResource {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.balanceTransactions = new BalanceTransactionsAPI.BalanceTransactions(this._client);
|
|
11
|
+
}
|
|
7
12
|
/**
|
|
8
13
|
* Creates a new billable customer. A customer represents the entity in your app
|
|
9
14
|
* that will be charged—typically a user, organization, or project. Hercules
|
|
10
15
|
* recommends creating a customer immediately after creating the corresponding
|
|
11
16
|
* entity in your app.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const customer = await client.commerce.customers.create();
|
|
21
|
+
* ```
|
|
12
22
|
*/
|
|
13
23
|
create(body = {}, options) {
|
|
14
24
|
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
@@ -16,6 +26,13 @@ export class Customers extends APIResource {
|
|
|
16
26
|
/**
|
|
17
27
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
18
28
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const customer = await client.commerce.customers.update(
|
|
33
|
+
* 'cus_1234567890',
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
19
36
|
*/
|
|
20
37
|
update(customerID, body = {}, options) {
|
|
21
38
|
return this._client.patch(path `/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
@@ -23,24 +40,30 @@ export class Customers extends APIResource {
|
|
|
23
40
|
/**
|
|
24
41
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
25
42
|
* in your app—typically users, organizations, or projects.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // Automatically fetches more pages as needed.
|
|
47
|
+
* for await (const customer of client.commerce.customers.list()) {
|
|
48
|
+
* // ...
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
26
51
|
*/
|
|
27
52
|
list(query = {}, options) {
|
|
28
53
|
return this._client.getAPIList('/v1/commerce/customers', (CursorIDPage), { query, ...options });
|
|
29
54
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
32
|
-
* action cannot be undone.
|
|
33
|
-
*/
|
|
34
|
-
delete(customerID, options) {
|
|
35
|
-
return this._client.delete(path `/v1/commerce/customers/${customerID}`, {
|
|
36
|
-
...options,
|
|
37
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
55
|
/**
|
|
41
56
|
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
42
57
|
* update payment methods, and manage billing details. Redirect the customer to the
|
|
43
58
|
* returned URL.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response =
|
|
63
|
+
* await client.commerce.customers.billingPortal(
|
|
64
|
+
* 'cus_1234567890',
|
|
65
|
+
* );
|
|
66
|
+
* ```
|
|
44
67
|
*/
|
|
45
68
|
billingPortal(customerID, body = {}, options) {
|
|
46
69
|
return this._client.post(path `/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
@@ -49,9 +72,17 @@ export class Customers extends APIResource {
|
|
|
49
72
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
50
73
|
* information, billing address, active subscriptions, recent invoices, and saved
|
|
51
74
|
* payment methods.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const customer = await client.commerce.customers.get(
|
|
79
|
+
* 'cus_1234567890',
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
52
82
|
*/
|
|
53
83
|
get(customerID, options) {
|
|
54
84
|
return this._client.get(path `/v1/commerce/customers/${customerID}`, options);
|
|
55
85
|
}
|
|
56
86
|
}
|
|
87
|
+
Customers.BalanceTransactions = BalanceTransactions;
|
|
57
88
|
//# sourceMappingURL=customers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.mjs","sourceRoot":"","sources":["../../../src/resources/commerce/customers/customers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,sBAAsB;OAC3B,EAAE,mBAAmB,EAAE;OAEvB,EAAE,YAAY,EAAwC;OAEtD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,wBAAmB,GACjB,IAAI,sBAAsB,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2FjE,CAAC;IAzFC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAgD,EAAE,EAAE,OAAwB;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,UAAkB,EAClB,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,0BAA0B,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAA,YAAsB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,aAAa,CACX,UAAkB,EAClB,OAAuD,EAAE,EACzD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,UAAU,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,UAAkB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,0BAA0B,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;CACF;AAgfD,SAAS,CAAC,mBAAmB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BalanceTransactions } from "./balance-transactions.mjs";
|
|
2
|
+
export { Customers, type Customer, type CustomerAddress, type CustomerBillingPortalResponse, type CustomerGetResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomersCursorIDPage, } from "./customers.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":"OAEO,EAAE,mBAAmB,EAAE;OACvB,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BalanceTransactions } from "./balance-transactions.js";
|
|
2
|
+
export { Customers, type Customer, type CustomerAddress, type CustomerBillingPortalResponse, type CustomerGetResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomersCursorIDPage, } from "./customers.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":"OAEO,EAAE,mBAAmB,EAAE;OACvB,EACL,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,GAC3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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.Customers = exports.BalanceTransactions = void 0;
|
|
5
|
+
var balance_transactions_1 = require("./balance-transactions.js");
|
|
6
|
+
Object.defineProperty(exports, "BalanceTransactions", { enumerable: true, get: function () { return balance_transactions_1.BalanceTransactions; } });
|
|
7
|
+
var customers_1 = require("./customers.js");
|
|
8
|
+
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kEAA6D;AAApD,2HAAA,mBAAmB,OAAA;AAC5B,4CAWqB;AAVnB,sGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/commerce/customers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,mBAAmB,EAAE;OACvB,EACL,SAAS,GAUV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.mts","sourceRoot":"","sources":["../../src/resources/commerce/customers.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../src/resources/commerce/customers.ts"],"names":[],"mappings":""}
|