@nirvana-labs/nirvana 1.95.2 → 1.96.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +1 -1
  3. package/resources/organizations/billing/billing.d.mts +208 -0
  4. package/resources/organizations/billing/billing.d.mts.map +1 -0
  5. package/resources/organizations/billing/billing.d.ts +208 -0
  6. package/resources/organizations/billing/billing.d.ts.map +1 -0
  7. package/resources/organizations/billing/billing.js +112 -0
  8. package/resources/organizations/billing/billing.js.map +1 -0
  9. package/resources/organizations/billing/billing.mjs +107 -0
  10. package/resources/organizations/billing/billing.mjs.map +1 -0
  11. package/resources/organizations/billing/index.d.mts +3 -0
  12. package/resources/organizations/billing/index.d.mts.map +1 -0
  13. package/resources/organizations/billing/index.d.ts +3 -0
  14. package/resources/organizations/billing/index.d.ts.map +1 -0
  15. package/resources/organizations/billing/index.js +9 -0
  16. package/resources/organizations/billing/index.js.map +1 -0
  17. package/resources/organizations/billing/index.mjs +4 -0
  18. package/resources/organizations/billing/index.mjs.map +1 -0
  19. package/resources/organizations/billing/recharge-policy.d.mts +81 -0
  20. package/resources/organizations/billing/recharge-policy.d.mts.map +1 -0
  21. package/resources/organizations/billing/recharge-policy.d.ts +81 -0
  22. package/resources/organizations/billing/recharge-policy.d.ts.map +1 -0
  23. package/resources/organizations/billing/recharge-policy.js +45 -0
  24. package/resources/organizations/billing/recharge-policy.js.map +1 -0
  25. package/resources/organizations/billing/recharge-policy.mjs +41 -0
  26. package/resources/organizations/billing/recharge-policy.mjs.map +1 -0
  27. package/resources/organizations/billing.d.mts +1 -203
  28. package/resources/organizations/billing.d.mts.map +1 -1
  29. package/resources/organizations/billing.d.ts +1 -203
  30. package/resources/organizations/billing.d.ts.map +1 -1
  31. package/resources/organizations/billing.js +2 -100
  32. package/resources/organizations/billing.js.map +1 -1
  33. package/resources/organizations/billing.mjs +1 -98
  34. package/resources/organizations/billing.mjs.map +1 -1
  35. package/resources/organizations/index.d.mts +1 -1
  36. package/resources/organizations/index.d.mts.map +1 -1
  37. package/resources/organizations/index.d.ts +1 -1
  38. package/resources/organizations/index.d.ts.map +1 -1
  39. package/resources/organizations/index.js +2 -2
  40. package/resources/organizations/index.js.map +1 -1
  41. package/resources/organizations/index.mjs +1 -1
  42. package/resources/organizations/index.mjs.map +1 -1
  43. package/resources/organizations/organizations.d.mts +2 -2
  44. package/resources/organizations/organizations.d.mts.map +1 -1
  45. package/resources/organizations/organizations.d.ts +2 -2
  46. package/resources/organizations/organizations.d.ts.map +1 -1
  47. package/resources/organizations/organizations.js +2 -2
  48. package/resources/organizations/organizations.js.map +1 -1
  49. package/resources/organizations/organizations.mjs +2 -2
  50. package/resources/organizations/organizations.mjs.map +1 -1
  51. package/src/resources/organizations/api.md +23 -10
  52. package/src/resources/organizations/billing/billing.ts +301 -0
  53. package/src/resources/organizations/billing/index.ts +21 -0
  54. package/src/resources/organizations/billing/recharge-policy.ts +109 -0
  55. package/src/resources/organizations/billing.ts +1 -279
  56. package/src/resources/organizations/index.ts +1 -1
  57. package/src/resources/organizations/organizations.ts +11 -11
  58. package/src/version.ts +1 -1
  59. package/version.d.mts +1 -1
  60. package/version.d.ts +1 -1
  61. package/version.js +1 -1
  62. package/version.mjs +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.mjs","sourceRoot":"","sources":["../../../src/resources/organizations/billing/billing.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EAGL,cAAc,GAGf,8BAA0B;AAE3B,OAAO,EAAE,YAAY,EAAE,sCAAkC;AAEzD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,mBAAc,GAAqC,IAAI,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAA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,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qBAAqB,cAAc,mBAAmB,EAAE;YACnF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SACjF,CAAC,CAAC;IACL,CAAC;CACF;AAiJD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Billing, type BillingHistoryEntry, type BillingHistoryEntryList, type BillingHistoryEntryType, type DailyCostPoint, type OrganizationDailyCost, type BillingCostParams, type BillingHistoryParams, type BillingTopUpParams, type BillingRechargeParams, } from "./billing.mjs";
2
+ export { RechargePolicy, type AutomaticPolicyArgs, type OrganizationRechargePolicy, type RechargePolicyMode, type RechargePolicyUpdateParams, } from "./recharge-policy.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/organizations/billing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,sBAAkB;AACnB,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,8BAA0B"}
@@ -0,0 +1,3 @@
1
+ export { Billing, type BillingHistoryEntry, type BillingHistoryEntryList, type BillingHistoryEntryType, type DailyCostPoint, type OrganizationDailyCost, type BillingCostParams, type BillingHistoryParams, type BillingTopUpParams, type BillingRechargeParams, } from "./billing.js";
2
+ export { RechargePolicy, type AutomaticPolicyArgs, type OrganizationRechargePolicy, type RechargePolicyMode, type RechargePolicyUpdateParams, } from "./recharge-policy.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/organizations/billing/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,qBAAkB;AACnB,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,6BAA0B"}
@@ -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.RechargePolicy = exports.Billing = void 0;
5
+ var billing_1 = require("./billing.js");
6
+ Object.defineProperty(exports, "Billing", { enumerable: true, get: function () { return billing_1.Billing; } });
7
+ var recharge_policy_1 = require("./recharge-policy.js");
8
+ Object.defineProperty(exports, "RechargePolicy", { enumerable: true, get: function () { return recharge_policy_1.RechargePolicy; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/organizations/billing/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAWmB;AAVjB,kGAAA,OAAO,OAAA;AAWT,wDAM2B;AALzB,iHAAA,cAAc,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Billing, } from "./billing.mjs";
3
+ export { RechargePolicy, } from "./recharge-policy.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/organizations/billing/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,OAAO,GAUR,sBAAkB;AACnB,OAAO,EACL,cAAc,GAKf,8BAA0B"}
@@ -0,0 +1,81 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ export declare class RechargePolicy extends APIResource {
5
+ /**
6
+ * Get the organization's recharge configuration: the top-up mode and the fixed and
7
+ * proportional threshold components.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const organizationRechargePolicy =
12
+ * await client.organizations.billing.rechargePolicy.get(
13
+ * 'organization_id',
14
+ * );
15
+ * ```
16
+ */
17
+ get(organizationID: string, options?: RequestOptions): APIPromise<OrganizationRechargePolicy>;
18
+ /**
19
+ * Update the organization's recharge mode: manual for self-serve top-ups, or
20
+ * automatic to charge the card on file at the recharge threshold (fixed and
21
+ * proportional required).
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const organizationRechargePolicy =
26
+ * await client.organizations.billing.rechargePolicy.update(
27
+ * 'organization_id',
28
+ * { policy: 'automatic' },
29
+ * );
30
+ * ```
31
+ */
32
+ update(organizationID: string, body: RechargePolicyUpdateParams, options?: RequestOptions): APIPromise<OrganizationRechargePolicy>;
33
+ }
34
+ /**
35
+ * PolicyArgs carries the threshold parameters. Required when policy is
36
+ * "automatic"; must be omitted when policy is "manual".
37
+ */
38
+ export interface AutomaticPolicyArgs {
39
+ /**
40
+ * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
41
+ */
42
+ fixed: string;
43
+ /**
44
+ * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
45
+ */
46
+ runway_days: string;
47
+ }
48
+ /**
49
+ * An organization's current recharge policy. policy_args is null for a manual
50
+ * policy.
51
+ */
52
+ export interface OrganizationRechargePolicy {
53
+ /**
54
+ * Policy is the top-up mode.
55
+ */
56
+ policy?: RechargePolicyMode;
57
+ /**
58
+ * PolicyArgs carries the threshold parameters. Required when policy is
59
+ * "automatic"; must be omitted when policy is "manual".
60
+ */
61
+ policy_args?: AutomaticPolicyArgs | null;
62
+ }
63
+ /**
64
+ * Policy is the top-up mode.
65
+ */
66
+ export type RechargePolicyMode = 'manual' | 'automatic';
67
+ export interface RechargePolicyUpdateParams {
68
+ /**
69
+ * Policy is the top-up mode.
70
+ */
71
+ policy: RechargePolicyMode;
72
+ /**
73
+ * PolicyArgs carries the threshold parameters. Required when policy is
74
+ * "automatic"; must be omitted when policy is "manual".
75
+ */
76
+ policy_args?: AutomaticPolicyArgs;
77
+ }
78
+ export declare namespace RechargePolicy {
79
+ export { type AutomaticPolicyArgs as AutomaticPolicyArgs, type OrganizationRechargePolicy as OrganizationRechargePolicy, type RechargePolicyMode as RechargePolicyMode, type RechargePolicyUpdateParams as RechargePolicyUpdateParams, };
80
+ }
81
+ //# sourceMappingURL=recharge-policy.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recharge-policy.d.mts","sourceRoot":"","sources":["../../../src/resources/organizations/billing/recharge-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGnE,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI7F;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;CAM1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAE5B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAE3B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -0,0 +1,81 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { RequestOptions } from "../../../internal/request-options.js";
4
+ export declare class RechargePolicy extends APIResource {
5
+ /**
6
+ * Get the organization's recharge configuration: the top-up mode and the fixed and
7
+ * proportional threshold components.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const organizationRechargePolicy =
12
+ * await client.organizations.billing.rechargePolicy.get(
13
+ * 'organization_id',
14
+ * );
15
+ * ```
16
+ */
17
+ get(organizationID: string, options?: RequestOptions): APIPromise<OrganizationRechargePolicy>;
18
+ /**
19
+ * Update the organization's recharge mode: manual for self-serve top-ups, or
20
+ * automatic to charge the card on file at the recharge threshold (fixed and
21
+ * proportional required).
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const organizationRechargePolicy =
26
+ * await client.organizations.billing.rechargePolicy.update(
27
+ * 'organization_id',
28
+ * { policy: 'automatic' },
29
+ * );
30
+ * ```
31
+ */
32
+ update(organizationID: string, body: RechargePolicyUpdateParams, options?: RequestOptions): APIPromise<OrganizationRechargePolicy>;
33
+ }
34
+ /**
35
+ * PolicyArgs carries the threshold parameters. Required when policy is
36
+ * "automatic"; must be omitted when policy is "manual".
37
+ */
38
+ export interface AutomaticPolicyArgs {
39
+ /**
40
+ * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
41
+ */
42
+ fixed: string;
43
+ /**
44
+ * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
45
+ */
46
+ runway_days: string;
47
+ }
48
+ /**
49
+ * An organization's current recharge policy. policy_args is null for a manual
50
+ * policy.
51
+ */
52
+ export interface OrganizationRechargePolicy {
53
+ /**
54
+ * Policy is the top-up mode.
55
+ */
56
+ policy?: RechargePolicyMode;
57
+ /**
58
+ * PolicyArgs carries the threshold parameters. Required when policy is
59
+ * "automatic"; must be omitted when policy is "manual".
60
+ */
61
+ policy_args?: AutomaticPolicyArgs | null;
62
+ }
63
+ /**
64
+ * Policy is the top-up mode.
65
+ */
66
+ export type RechargePolicyMode = 'manual' | 'automatic';
67
+ export interface RechargePolicyUpdateParams {
68
+ /**
69
+ * Policy is the top-up mode.
70
+ */
71
+ policy: RechargePolicyMode;
72
+ /**
73
+ * PolicyArgs carries the threshold parameters. Required when policy is
74
+ * "automatic"; must be omitted when policy is "manual".
75
+ */
76
+ policy_args?: AutomaticPolicyArgs;
77
+ }
78
+ export declare namespace RechargePolicy {
79
+ export { type AutomaticPolicyArgs as AutomaticPolicyArgs, type OrganizationRechargePolicy as OrganizationRechargePolicy, type RechargePolicyMode as RechargePolicyMode, type RechargePolicyUpdateParams as RechargePolicyUpdateParams, };
80
+ }
81
+ //# sourceMappingURL=recharge-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recharge-policy.d.ts","sourceRoot":"","sources":["../../../src/resources/organizations/billing/recharge-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,qCAAkC;AACvD,OAAO,EAAE,cAAc,EAAE,6CAA0C;AAGnE,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI7F;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,0BAA0B,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,0BAA0B,CAAC;CAM1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAE5B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAE3B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -0,0 +1,45 @@
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.RechargePolicy = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const path_1 = require("../../../internal/utils/path.js");
7
+ class RechargePolicy extends resource_1.APIResource {
8
+ /**
9
+ * Get the organization's recharge configuration: the top-up mode and the fixed and
10
+ * proportional threshold components.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const organizationRechargePolicy =
15
+ * await client.organizations.billing.rechargePolicy.get(
16
+ * 'organization_id',
17
+ * );
18
+ * ```
19
+ */
20
+ get(organizationID, options) {
21
+ return this._client.get((0, path_1.path) `/v1/organizations/${organizationID}/billing/recharge_policy`, options);
22
+ }
23
+ /**
24
+ * Update the organization's recharge mode: manual for self-serve top-ups, or
25
+ * automatic to charge the card on file at the recharge threshold (fixed and
26
+ * proportional required).
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const organizationRechargePolicy =
31
+ * await client.organizations.billing.rechargePolicy.update(
32
+ * 'organization_id',
33
+ * { policy: 'automatic' },
34
+ * );
35
+ * ```
36
+ */
37
+ update(organizationID, body, options) {
38
+ return this._client.patch((0, path_1.path) `/v1/organizations/${organizationID}/billing/recharge_policy`, {
39
+ body,
40
+ ...options,
41
+ });
42
+ }
43
+ }
44
+ exports.RechargePolicy = RechargePolicy;
45
+ //# sourceMappingURL=recharge-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recharge-policy.js","sourceRoot":"","sources":["../../../src/resources/organizations/billing/recharge-policy.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,cAAsB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,qBAAqB,cAAc,0BAA0B,EAAE;YAC3F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAzCD,wCAyCC"}
@@ -0,0 +1,41 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { path } from "../../../internal/utils/path.mjs";
4
+ export class RechargePolicy extends APIResource {
5
+ /**
6
+ * Get the organization's recharge configuration: the top-up mode and the fixed and
7
+ * proportional threshold components.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const organizationRechargePolicy =
12
+ * await client.organizations.billing.rechargePolicy.get(
13
+ * 'organization_id',
14
+ * );
15
+ * ```
16
+ */
17
+ get(organizationID, options) {
18
+ return this._client.get(path `/v1/organizations/${organizationID}/billing/recharge_policy`, options);
19
+ }
20
+ /**
21
+ * Update the organization's recharge mode: manual for self-serve top-ups, or
22
+ * automatic to charge the card on file at the recharge threshold (fixed and
23
+ * proportional required).
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const organizationRechargePolicy =
28
+ * await client.organizations.billing.rechargePolicy.update(
29
+ * 'organization_id',
30
+ * { policy: 'automatic' },
31
+ * );
32
+ * ```
33
+ */
34
+ update(organizationID, body, options) {
35
+ return this._client.patch(path `/v1/organizations/${organizationID}/billing/recharge_policy`, {
36
+ body,
37
+ ...options,
38
+ });
39
+ }
40
+ }
41
+ //# sourceMappingURL=recharge-policy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recharge-policy.mjs","sourceRoot":"","sources":["../../../src/resources/organizations/billing/recharge-policy.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAGrD,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,cAAsB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,cAAc,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,cAAsB,EACtB,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,qBAAqB,cAAc,0BAA0B,EAAE;YAC3F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,204 +1,2 @@
1
- import { APIResource } from "../../core/resource.mjs";
2
- import * as Shared from "../shared.mjs";
3
- import { APIPromise } from "../../core/api-promise.mjs";
4
- import { RequestOptions } from "../../internal/request-options.mjs";
5
- export declare class Billing extends APIResource {
6
- /**
7
- * Get the organization's billing summary: effective balance, monthly and daily
8
- * run-rate cost, runway, and the projected next-recharge date. Costs are run-rate
9
- * projections.
10
- *
11
- * @example
12
- * ```ts
13
- * const organizationBillingSummary =
14
- * await client.organizations.billing.summary(
15
- * 'organization_id',
16
- * );
17
- * ```
18
- */
19
- summary(organizationID: string, options?: RequestOptions): APIPromise<Shared.OrganizationBillingSummary>;
20
- /**
21
- * Get the organization's total usage cost per UTC day over a date range (max 90
22
- * days), summing open and closed resources. One entry per day, oldest first.
23
- * Defaults to the last 30 days.
24
- *
25
- * @example
26
- * ```ts
27
- * const organizationDailyCost =
28
- * await client.organizations.billing.cost(
29
- * 'organization_id',
30
- * );
31
- * ```
32
- */
33
- cost(organizationID: string, query?: BillingCostParams | null | undefined, options?: RequestOptions): APIPromise<OrganizationDailyCost>;
34
- /**
35
- * List the organization's billing history: prepaid credits, top-ups, and manual
36
- * adjustments, newest first. Paginated with an opaque cursor.
37
- *
38
- * @example
39
- * ```ts
40
- * const billingHistoryEntryList =
41
- * await client.organizations.billing.history(
42
- * 'organization_id',
43
- * );
44
- * ```
45
- */
46
- history(organizationID: string, query?: BillingHistoryParams | null | undefined, options?: RequestOptions): APIPromise<BillingHistoryEntryList>;
47
- /**
48
- * Charge the card on file and credit the prepaid balance. A unique Idempotency-Key
49
- * header is required; reuse it across retries so a timed-out top-up is not charged
50
- * twice.
51
- *
52
- * @example
53
- * ```ts
54
- * const organizationBillingSummary =
55
- * await client.organizations.billing.topUp(
56
- * 'organization_id',
57
- * {
58
- * amount: '50.00',
59
- * 'Idempotency-Key': 'Idempotency-Key',
60
- * },
61
- * );
62
- * ```
63
- */
64
- topUp(organizationID: string, params: BillingTopUpParams, options?: RequestOptions): APIPromise<Shared.OrganizationBillingSummary>;
65
- /**
66
- * Charge the card on file up to the recharge target now instead of waiting for the
67
- * scheduled retry. Automatic-policy prepaid organizations only. Idempotency-Key
68
- * header required.
69
- *
70
- * @example
71
- * ```ts
72
- * const organizationBillingSummary =
73
- * await client.organizations.billing.recharge(
74
- * 'organization_id',
75
- * { 'Idempotency-Key': 'Idempotency-Key' },
76
- * );
77
- * ```
78
- */
79
- recharge(organizationID: string, params: BillingRechargeParams, options?: RequestOptions): APIPromise<Shared.OrganizationBillingSummary>;
80
- }
81
- /**
82
- * A single billing history line item: a prepaid credit or a manual adjustment.
83
- */
84
- export interface BillingHistoryEntry {
85
- /**
86
- * Unique identifier for the entry.
87
- */
88
- id: string;
89
- /**
90
- * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
91
- */
92
- amount: string;
93
- /**
94
- * When the entry was recorded.
95
- */
96
- created_at: string;
97
- /**
98
- * ISO 4217 currency code.
99
- */
100
- currency: string;
101
- /**
102
- * Kind of entry.
103
- */
104
- type: BillingHistoryEntryType;
105
- /**
106
- * Human-readable note describing the entry, when available.
107
- */
108
- description?: string | null;
109
- /**
110
- * Link to the hosted receipt for the payment behind this entry, when one is
111
- * available. Present for prepaid credits funded by a card charge; absent for
112
- * manual adjustments and while a payment's receipt is still being finalized.
113
- */
114
- receipt_url?: string | null;
115
- }
116
- export interface BillingHistoryEntryList {
117
- items: Array<BillingHistoryEntry>;
118
- /**
119
- * Pagination response details.
120
- */
121
- pagination: Shared.Pagination;
122
- }
123
- /**
124
- * Kind of entry.
125
- */
126
- export type BillingHistoryEntryType = 'grant' | 'adjustment';
127
- /**
128
- * Total usage cost for a single UTC day.
129
- */
130
- export interface DailyCostPoint {
131
- /**
132
- * Arbitrary-precision decimal serialized as a string (e.g. "58.40").
133
- */
134
- cost: string;
135
- /**
136
- * UTC calendar day (YYYY-MM-DD).
137
- */
138
- date: string;
139
- }
140
- /**
141
- * Daily usage cost over a date range: one entry per UTC day (zero on idle days),
142
- * summing open and closed resources. Suitable for a daily cost bar chart.
143
- */
144
- export interface OrganizationDailyCost {
145
- /**
146
- * ISO 4217 currency code.
147
- */
148
- currency: string;
149
- /**
150
- * One entry per UTC day in the range, oldest first.
151
- */
152
- days: Array<DailyCostPoint>;
153
- /**
154
- * Inclusive start of the range, as a UTC calendar day (YYYY-MM-DD).
155
- */
156
- from: string;
157
- /**
158
- * Inclusive end of the range, as a UTC calendar day (YYYY-MM-DD).
159
- */
160
- to: string;
161
- }
162
- export interface BillingCostParams {
163
- /**
164
- * Inclusive start day, YYYY-MM-DD (UTC). Defaults to 30 days before to.
165
- */
166
- from?: string;
167
- /**
168
- * Inclusive end day, YYYY-MM-DD (UTC). Defaults to today.
169
- */
170
- to?: string;
171
- }
172
- export interface BillingHistoryParams {
173
- /**
174
- * Pagination cursor returned by a previous request
175
- */
176
- cursor?: string;
177
- /**
178
- * Maximum number of items to return
179
- */
180
- limit?: number;
181
- }
182
- export interface BillingTopUpParams {
183
- /**
184
- * Body param: Amount to charge and credit, in USD. Must be greater than 0, at most
185
- * two decimal places, and at most 10000.
186
- */
187
- amount: string;
188
- /**
189
- * Header param: Unique idempotency key scoping the charge; reuse the same value
190
- * across retries so a timed-out top-up is not charged twice
191
- */
192
- 'Idempotency-Key': string;
193
- }
194
- export interface BillingRechargeParams {
195
- /**
196
- * Idempotency key scoping one charge attempt; reuse to retry it, but use a fresh
197
- * key for a new attempt (e.g. after updating a declined card)
198
- */
199
- 'Idempotency-Key': string;
200
- }
201
- export declare namespace Billing {
202
- export { type BillingHistoryEntry as BillingHistoryEntry, type BillingHistoryEntryList as BillingHistoryEntryList, type BillingHistoryEntryType as BillingHistoryEntryType, type DailyCostPoint as DailyCostPoint, type OrganizationDailyCost as OrganizationDailyCost, type BillingCostParams as BillingCostParams, type BillingHistoryParams as BillingHistoryParams, type BillingTopUpParams as BillingTopUpParams, type BillingRechargeParams as BillingRechargeParams, };
203
- }
1
+ export * from "./billing/index.mjs";
204
2
  //# sourceMappingURL=billing.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.d.mts","sourceRoot":"","sources":["../../src/resources/organizations/billing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAEpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,0BAA0B,CAAC;IAIxG;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qBAAqB,CAAC;IAIpC;;;;;;;;;;;OAWG;IACH,OAAO,CACL,cAAc,EAAE,MAAM,EACtB,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;IAItC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CACH,cA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AC;CACZ;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
1
+ {"version":3,"file":"billing.d.mts","sourceRoot":"","sources":["../../src/resources/organizations/billing.ts"],"names":[],"mappings":"AAEA,oCAAgC"}