Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.37.0"
".": "4.38.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0f43f737c6520ed2a2407628511350362959997f89a868c50aa38d47d5791171.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-14d1c1e4560c65c7c62f23343268ece4476ae079cd01ba2e6b924efde5f97c3e.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 4.38.0 (2024-11-26)

Full Changelog: [v4.37.0...v4.38.0](https://github.com/orbcorp/orb-node/compare/v4.37.0...v4.38.0)

### Features

* **api:** api update ([#405](https://github.com/orbcorp/orb-node/issues/405)) ([c1e35f2](https://github.com/orbcorp/orb-node/commit/c1e35f2e8b6263b2848a1ee9d579bef845a339f1))


### Chores

* **internal:** codegen related update ([#402](https://github.com/orbcorp/orb-node/issues/402)) ([87f4432](https://github.com/orbcorp/orb-node/commit/87f44324bcbc57e283da122a6f188db6e3f42f35))
* **internal:** codegen related update ([#404](https://github.com/orbcorp/orb-node/issues/404)) ([e16b1f7](https://github.com/orbcorp/orb-node/commit/e16b1f7bc414b78db676d9bc5cc70767ac1c6797))

## 4.37.0 (2024-11-25)

Full Changelog: [v4.36.0...v4.37.0](https://github.com/orbcorp/orb-node/compare/v4.36.0...v4.37.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orb-billing",
"version": "4.37.0",
"version": "4.38.0",
"description": "The official TypeScript library for the Orb API",
"author": "Orb <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm exec tsc-multi
# copy over handwritten .js/.mjs/.d.ts files
cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims
cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto
# we need to add exports = module.exports = Orb TypeScript to index.js;
# we need to add exports = module.exports = Orb to index.js;
# No way to get that from index.ts because it would cause compile errors
# when building .mjs
node scripts/utils/fix-index-exports.cjs
Expand Down
182 changes: 182 additions & 0 deletions src/resources/plans/plans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ export class PlansPage extends Page<Plan> {}
export interface Plan {
id: string;

/**
* Adjustments for this plan. If the plan has phases, this includes adjustments
* across all phases of the plan.
*/
adjustments: Array<
| Plan.AmountDiscountAdjustment
| Plan.PercentageDiscountAdjustment
| Plan.UsageDiscountAdjustment
| Plan.MinimumAdjustment
| Plan.MaximumAdjustment
>;

base_plan: Plan.BasePlan | null;

/**
Expand Down Expand Up @@ -167,6 +179,176 @@ export interface Plan {
}

export namespace Plan {
export interface AmountDiscountAdjustment {
id: string;

adjustment_type: 'amount_discount';

/**
* The amount by which to discount the prices this adjustment applies to in a given
* billing period.
*/
amount_discount: string;

/**
* The price IDs that this adjustment applies to.
*/
applies_to_price_ids: Array<string>;

/**
* True for adjustments that apply to an entire invocice, false for adjustments
* that apply to only one price.
*/
is_invoice_level: boolean;

/**
* The plan phase in which this adjustment is active.
*/
plan_phase_order: number | null;

/**
* The reason for the adjustment.
*/
reason: string | null;
}

export interface PercentageDiscountAdjustment {
id: string;

adjustment_type: 'percentage_discount';

/**
* The price IDs that this adjustment applies to.
*/
applies_to_price_ids: Array<string>;

/**
* True for adjustments that apply to an entire invocice, false for adjustments
* that apply to only one price.
*/
is_invoice_level: boolean;

/**
* The percentage (as a value between 0 and 1) by which to discount the price
* intervals this adjustment applies to in a given billing period.
*/
percentage_discount: number;

/**
* The plan phase in which this adjustment is active.
*/
plan_phase_order: number | null;

/**
* The reason for the adjustment.
*/
reason: string | null;
}

export interface UsageDiscountAdjustment {
id: string;

adjustment_type: 'usage_discount';

/**
* The price IDs that this adjustment applies to.
*/
applies_to_price_ids: Array<string>;

/**
* True for adjustments that apply to an entire invocice, false for adjustments
* that apply to only one price.
*/
is_invoice_level: boolean;

/**
* The plan phase in which this adjustment is active.
*/
plan_phase_order: number | null;

/**
* The reason for the adjustment.
*/
reason: string | null;

/**
* The number of usage units by which to discount the price this adjustment applies
* to in a given billing period.
*/
usage_discount: number;
}

export interface MinimumAdjustment {
id: string;

adjustment_type: 'minimum';

/**
* The price IDs that this adjustment applies to.
*/
applies_to_price_ids: Array<string>;

/**
* True for adjustments that apply to an entire invocice, false for adjustments
* that apply to only one price.
*/
is_invoice_level: boolean;

/**
* The item ID that revenue from this minimum will be attributed to.
*/
item_id: string;

/**
* The minimum amount to charge in a given billing period for the prices this
* adjustment applies to.
*/
minimum_amount: string;

/**
* The plan phase in which this adjustment is active.
*/
plan_phase_order: number | null;

/**
* The reason for the adjustment.
*/
reason: string | null;
}

export interface MaximumAdjustment {
id: string;

adjustment_type: 'maximum';

/**
* The price IDs that this adjustment applies to.
*/
applies_to_price_ids: Array<string>;

/**
* True for adjustments that apply to an entire invocice, false for adjustments
* that apply to only one price.
*/
is_invoice_level: boolean;

/**
* The maximum amount to charge in a given billing period for the prices this
* adjustment applies to.
*/
maximum_amount: string;

/**
* The plan phase in which this adjustment is active.
*/
plan_phase_order: number | null;

/**
* The reason for the adjustment.
*/
reason: string | null;
}

export interface BasePlan {
id: string | null;

Expand Down
Loading
Loading