casedev 0.41.0 → 0.42.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 (88) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +1 -0
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -0
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +3 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/usage/index.d.mts +3 -0
  20. package/resources/usage/index.d.mts.map +1 -0
  21. package/resources/usage/index.d.ts +3 -0
  22. package/resources/usage/index.d.ts.map +1 -0
  23. package/resources/usage/index.js +9 -0
  24. package/resources/usage/index.js.map +1 -0
  25. package/resources/usage/index.mjs +4 -0
  26. package/resources/usage/index.mjs.map +1 -0
  27. package/resources/usage/usage.d.mts +10 -0
  28. package/resources/usage/usage.d.mts.map +1 -0
  29. package/resources/usage/usage.d.ts +10 -0
  30. package/resources/usage/usage.d.ts.map +1 -0
  31. package/resources/usage/usage.js +17 -0
  32. package/resources/usage/usage.js.map +1 -0
  33. package/resources/usage/usage.mjs +12 -0
  34. package/resources/usage/usage.mjs.map +1 -0
  35. package/resources/usage/v1/index.d.mts +3 -0
  36. package/resources/usage/v1/index.d.mts.map +1 -0
  37. package/resources/usage/v1/index.d.ts +3 -0
  38. package/resources/usage/v1/index.d.ts.map +1 -0
  39. package/resources/usage/v1/index.js +9 -0
  40. package/resources/usage/v1/index.js.map +1 -0
  41. package/resources/usage/v1/index.mjs +4 -0
  42. package/resources/usage/v1/index.mjs.map +1 -0
  43. package/resources/usage/v1/subscriptions.d.mts +51 -0
  44. package/resources/usage/v1/subscriptions.d.mts.map +1 -0
  45. package/resources/usage/v1/subscriptions.d.ts +51 -0
  46. package/resources/usage/v1/subscriptions.d.ts.map +1 -0
  47. package/resources/usage/v1/subscriptions.js +63 -0
  48. package/resources/usage/v1/subscriptions.js.map +1 -0
  49. package/resources/usage/v1/subscriptions.mjs +59 -0
  50. package/resources/usage/v1/subscriptions.mjs.map +1 -0
  51. package/resources/usage/v1/v1.d.mts +37 -0
  52. package/resources/usage/v1/v1.d.mts.map +1 -0
  53. package/resources/usage/v1/v1.d.ts +37 -0
  54. package/resources/usage/v1/v1.d.ts.map +1 -0
  55. package/resources/usage/v1/v1.js +34 -0
  56. package/resources/usage/v1/v1.js.map +1 -0
  57. package/resources/usage/v1/v1.mjs +29 -0
  58. package/resources/usage/v1/v1.mjs.map +1 -0
  59. package/resources/usage/v1.d.mts +2 -0
  60. package/resources/usage/v1.d.mts.map +1 -0
  61. package/resources/usage/v1.d.ts +2 -0
  62. package/resources/usage/v1.d.ts.map +1 -0
  63. package/resources/usage/v1.js +6 -0
  64. package/resources/usage/v1.js.map +1 -0
  65. package/resources/usage/v1.mjs +3 -0
  66. package/resources/usage/v1.mjs.map +1 -0
  67. package/resources/usage.d.mts +2 -0
  68. package/resources/usage.d.mts.map +1 -0
  69. package/resources/usage.d.ts +2 -0
  70. package/resources/usage.d.ts.map +1 -0
  71. package/resources/usage.js +6 -0
  72. package/resources/usage.js.map +1 -0
  73. package/resources/usage.mjs +3 -0
  74. package/resources/usage.mjs.map +1 -0
  75. package/src/client.ts +5 -0
  76. package/src/resources/index.ts +1 -0
  77. package/src/resources/usage/index.ts +4 -0
  78. package/src/resources/usage/usage.ts +15 -0
  79. package/src/resources/usage/v1/index.ts +9 -0
  80. package/src/resources/usage/v1/subscriptions.ts +108 -0
  81. package/src/resources/usage/v1/v1.ts +64 -0
  82. package/src/resources/usage/v1.ts +3 -0
  83. package/src/resources/usage.ts +3 -0
  84. package/src/version.ts +1 -1
  85. package/version.d.mts +1 -1
  86. package/version.d.ts +1 -1
  87. package/version.js +1 -1
  88. package/version.mjs +1 -1
@@ -0,0 +1,108 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { buildHeaders } from '../../../internal/headers';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
8
+
9
+ /**
10
+ * Usage reporting and webhook subscriptions
11
+ */
12
+ export class Subscriptions extends APIResource {
13
+ /**
14
+ * Creates a webhook subscription for usage, balance, and billing events.
15
+ */
16
+ create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<void> {
17
+ return this._client.post('/usage/v1/subscriptions', {
18
+ body,
19
+ ...options,
20
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
21
+ });
22
+ }
23
+
24
+ /**
25
+ * Updates callback URL, event filters, active state, or signing secret.
26
+ */
27
+ update(
28
+ subscriptionID: string,
29
+ body: SubscriptionUpdateParams | null | undefined = {},
30
+ options?: RequestOptions,
31
+ ): APIPromise<void> {
32
+ return this._client.patch(path`/usage/v1/subscriptions/${subscriptionID}`, {
33
+ body,
34
+ ...options,
35
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Lists webhook subscriptions configured for usage and billing events.
41
+ */
42
+ list(options?: RequestOptions): APIPromise<void> {
43
+ return this._client.get('/usage/v1/subscriptions', {
44
+ ...options,
45
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
46
+ });
47
+ }
48
+
49
+ /**
50
+ * Deactivates a usage webhook subscription.
51
+ */
52
+ delete(subscriptionID: string, options?: RequestOptions): APIPromise<void> {
53
+ return this._client.delete(path`/usage/v1/subscriptions/${subscriptionID}`, {
54
+ ...options,
55
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
56
+ });
57
+ }
58
+
59
+ /**
60
+ * Delivers a test event to a single usage webhook subscription using the same
61
+ * payload shape and signing behavior as production delivery.
62
+ */
63
+ test(
64
+ subscriptionID: string,
65
+ body: SubscriptionTestParams | null | undefined = {},
66
+ options?: RequestOptions,
67
+ ): APIPromise<void> {
68
+ return this._client.post(path`/usage/v1/subscriptions/${subscriptionID}/test`, {
69
+ body,
70
+ ...options,
71
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
72
+ });
73
+ }
74
+ }
75
+
76
+ export interface SubscriptionCreateParams {
77
+ callbackUrl: string;
78
+
79
+ eventTypes?: Array<string>;
80
+
81
+ signingSecret?: string;
82
+ }
83
+
84
+ export interface SubscriptionUpdateParams {
85
+ callbackUrl?: string;
86
+
87
+ clearSigningSecret?: boolean;
88
+
89
+ eventTypes?: Array<string>;
90
+
91
+ isActive?: boolean;
92
+
93
+ signingSecret?: string;
94
+ }
95
+
96
+ export interface SubscriptionTestParams {
97
+ eventType?: string;
98
+
99
+ payload?: { [key: string]: unknown };
100
+ }
101
+
102
+ export declare namespace Subscriptions {
103
+ export {
104
+ type SubscriptionCreateParams as SubscriptionCreateParams,
105
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
106
+ type SubscriptionTestParams as SubscriptionTestParams,
107
+ };
108
+ }
@@ -0,0 +1,64 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as SubscriptionsAPI from './subscriptions';
5
+ import {
6
+ SubscriptionCreateParams,
7
+ SubscriptionTestParams,
8
+ SubscriptionUpdateParams,
9
+ Subscriptions,
10
+ } from './subscriptions';
11
+ import { APIPromise } from '../../../core/api-promise';
12
+ import { buildHeaders } from '../../../internal/headers';
13
+ import { RequestOptions } from '../../../internal/request-options';
14
+
15
+ /**
16
+ * Usage reporting and webhook subscriptions
17
+ */
18
+ export class V1 extends APIResource {
19
+ subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
20
+
21
+ /**
22
+ * Returns customer-facing usage metrics and costs for the requested period.
23
+ * Supports summary totals and daily buckets for timestamped usage sources. Vault
24
+ * storage is intentionally omitted from totals because it is not yet periodized
25
+ * for arbitrary windows.
26
+ */
27
+ retrieve(query: V1RetrieveParams | null | undefined = {}, options?: RequestOptions): APIPromise<void> {
28
+ return this._client.get('/usage/v1', {
29
+ query,
30
+ ...options,
31
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
32
+ });
33
+ }
34
+ }
35
+
36
+ export interface V1RetrieveParams {
37
+ /**
38
+ * Whether to return period totals only or include daily buckets.
39
+ */
40
+ granularity?: 'summary' | 'daily';
41
+
42
+ /**
43
+ * Period end date. Defaults to now.
44
+ */
45
+ periodEnd?: string;
46
+
47
+ /**
48
+ * Period start date. Defaults to the start of the current calendar month.
49
+ */
50
+ periodStart?: string;
51
+ }
52
+
53
+ V1.Subscriptions = Subscriptions;
54
+
55
+ export declare namespace V1 {
56
+ export { type V1RetrieveParams as V1RetrieveParams };
57
+
58
+ export {
59
+ Subscriptions as Subscriptions,
60
+ type SubscriptionCreateParams as SubscriptionCreateParams,
61
+ type SubscriptionUpdateParams as SubscriptionUpdateParams,
62
+ type SubscriptionTestParams as SubscriptionTestParams,
63
+ };
64
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './v1/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './usage/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.41.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.41.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.41.0";
1
+ export declare const VERSION = "0.42.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.41.0'; // x-release-please-version
4
+ exports.VERSION = '0.42.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.41.0'; // x-release-please-version
1
+ export const VERSION = '0.42.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map