@stigg/typescript 0.1.0-alpha.3 → 0.1.0-alpha.4
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 +8 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +6 -89
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +6 -89
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/customers/customers.d.mts +106 -46
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +106 -46
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +16 -10
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +16 -10
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.mts +2 -2
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +2 -2
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +3 -3
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +350 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.d.ts +350 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
- package/resources/v1/customers/promotional-entitlements.js +23 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -0
- package/resources/v1/customers/promotional-entitlements.mjs +19 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
- package/resources/v1/events.d.mts +62 -0
- package/resources/v1/events.d.mts.map +1 -0
- package/resources/v1/events.d.ts +62 -0
- package/resources/v1/events.d.ts.map +1 -0
- package/resources/v1/events.js +15 -0
- package/resources/v1/events.js.map +1 -0
- package/resources/v1/events.mjs +11 -0
- package/resources/v1/events.mjs.map +1 -0
- package/resources/v1/index.d.mts +6 -4
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +6 -4
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +5 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +3 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +6 -20
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +6 -20
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/index.d.mts +2 -2
- package/resources/v1/subscriptions/index.d.mts.map +1 -1
- package/resources/v1/subscriptions/index.d.ts +2 -2
- package/resources/v1/subscriptions/index.d.ts.map +1 -1
- package/resources/v1/subscriptions/index.js.map +1 -1
- package/resources/v1/subscriptions/index.mjs +1 -1
- package/resources/v1/subscriptions/index.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +963 -1049
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +963 -1049
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +24 -6
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +25 -7
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/usage.d.mts +229 -0
- package/resources/v1/usage.d.mts.map +1 -0
- package/resources/v1/usage.d.ts +229 -0
- package/resources/v1/usage.d.ts.map +1 -0
- package/resources/v1/usage.js +23 -0
- package/resources/v1/usage.js.map +1 -0
- package/resources/v1/usage.mjs +19 -0
- package/resources/v1/usage.mjs.map +1 -0
- package/resources/v1/v1.d.mts +14 -172
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +14 -172
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +8 -12
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +8 -12
- package/resources/v1/v1.mjs.map +1 -1
- package/src/client.ts +2 -14
- package/src/resources/index.ts +1 -7
- package/src/resources/v1/coupons.ts +6 -222
- package/src/resources/v1/customers/customers.ts +142 -57
- package/src/resources/v1/customers/index.ts +10 -2
- package/src/resources/v1/customers/promotional-entitlements.ts +466 -0
- package/src/resources/v1/events.ts +73 -0
- package/src/resources/v1/index.ts +19 -15
- package/src/resources/v1/subscriptions/future-update.ts +6 -28
- package/src/resources/v1/subscriptions/index.ts +8 -11
- package/src/resources/v1/subscriptions/subscriptions.ts +2541 -2304
- package/src/resources/v1/usage.ts +283 -0
- package/src/resources/v1/v1.ts +50 -220
- 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/v1/customers/usage.d.mts +0 -4
- package/resources/v1/customers/usage.d.mts.map +0 -1
- package/resources/v1/customers/usage.d.ts +0 -4
- package/resources/v1/customers/usage.d.ts.map +0 -1
- package/resources/v1/customers/usage.js +0 -9
- package/resources/v1/customers/usage.js.map +0 -1
- package/resources/v1/customers/usage.mjs +0 -5
- package/resources/v1/customers/usage.mjs.map +0 -1
- package/src/resources/v1/customers/usage.ts +0 -5
package/resources/v1/v1.d.ts
CHANGED
|
@@ -1,184 +1,26 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as CouponsAPI from "./coupons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Coupon, CouponCreateParams, CouponListParams, CouponListResponse, CouponListResponsesMyCursorIDPage, Coupons } from "./coupons.js";
|
|
4
|
+
import * as EventsAPI from "./events.js";
|
|
5
|
+
import { EventReportParams, EventReportResponse, Events } from "./events.js";
|
|
6
|
+
import * as UsageAPI from "./usage.js";
|
|
7
|
+
import { Usage, UsageHistoryParams, UsageHistoryResponse, UsageReportParams, UsageReportResponse } from "./usage.js";
|
|
4
8
|
import * as CustomersAPI from "./customers/customers.js";
|
|
5
|
-
import {
|
|
9
|
+
import { CustomerImportParams, CustomerImportResponse, CustomerListParams, CustomerListResponse, CustomerListResponsesMyCursorIDPage, CustomerProvisionParams, CustomerResponse, CustomerUpdateParams, Customers } from "./customers/customers.js";
|
|
6
10
|
import * as SubscriptionsAPI from "./subscriptions/subscriptions.js";
|
|
7
|
-
import {
|
|
8
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
9
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
11
|
+
import { Subscription, SubscriptionCancelParams, SubscriptionDelegateParams, SubscriptionImportParams, SubscriptionImportResponse, SubscriptionListParams, SubscriptionListResponse, SubscriptionListResponsesMyCursorIDPage, SubscriptionMigrateParams, SubscriptionPreviewParams, SubscriptionPreviewResponse, SubscriptionProvisionParams, SubscriptionProvisionResponse, SubscriptionTransferParams, SubscriptionUpdateParams, Subscriptions } from "./subscriptions/subscriptions.js";
|
|
10
12
|
export declare class V1 extends APIResource {
|
|
11
13
|
customers: CustomersAPI.Customers;
|
|
12
14
|
subscriptions: SubscriptionsAPI.Subscriptions;
|
|
13
15
|
coupons: CouponsAPI.Coupons;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
createEvent(body: V1CreateEventParams, options?: RequestOptions): APIPromise<V1CreateEventResponse>;
|
|
18
|
-
/**
|
|
19
|
-
* Report usage measurements
|
|
20
|
-
*/
|
|
21
|
-
createUsage(body: V1CreateUsageParams, options?: RequestOptions): APIPromise<V1CreateUsageResponse>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Response object
|
|
25
|
-
*/
|
|
26
|
-
export interface V1CreateEventResponse {
|
|
27
|
-
/**
|
|
28
|
-
* Empty success response confirming that events were successfully ingested and
|
|
29
|
-
* queued for processing by Stigg's metering system.
|
|
30
|
-
*/
|
|
31
|
-
data: unknown;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Response containing reported usage measurements with current usage values,
|
|
35
|
-
* period information, and reset dates for each measurement.
|
|
36
|
-
*/
|
|
37
|
-
export interface V1CreateUsageResponse {
|
|
38
|
-
/**
|
|
39
|
-
* Array of usage measurements with current values and period info
|
|
40
|
-
*/
|
|
41
|
-
data: Array<V1CreateUsageResponse.Data>;
|
|
42
|
-
}
|
|
43
|
-
export declare namespace V1CreateUsageResponse {
|
|
44
|
-
/**
|
|
45
|
-
* Recorded usage with period info
|
|
46
|
-
*/
|
|
47
|
-
interface Data {
|
|
48
|
-
/**
|
|
49
|
-
* Unique identifier for the entity
|
|
50
|
-
*/
|
|
51
|
-
id: string;
|
|
52
|
-
/**
|
|
53
|
-
* Timestamp of when the record was created
|
|
54
|
-
*/
|
|
55
|
-
createdAt: string;
|
|
56
|
-
/**
|
|
57
|
-
* Customer id
|
|
58
|
-
*/
|
|
59
|
-
customerId: string;
|
|
60
|
-
/**
|
|
61
|
-
* Feature id
|
|
62
|
-
*/
|
|
63
|
-
featureId: string;
|
|
64
|
-
/**
|
|
65
|
-
* Timestamp
|
|
66
|
-
*/
|
|
67
|
-
timestamp: string;
|
|
68
|
-
/**
|
|
69
|
-
* The usage measurement record
|
|
70
|
-
*/
|
|
71
|
-
value: number;
|
|
72
|
-
/**
|
|
73
|
-
* The current measured usage value
|
|
74
|
-
*/
|
|
75
|
-
currentUsage?: number | null;
|
|
76
|
-
/**
|
|
77
|
-
* The date when the next usage reset will occur
|
|
78
|
-
*/
|
|
79
|
-
nextResetDate?: string | null;
|
|
80
|
-
/**
|
|
81
|
-
* Resource id
|
|
82
|
-
*/
|
|
83
|
-
resourceId?: string | null;
|
|
84
|
-
/**
|
|
85
|
-
* The end date of the usage period in which this measurement resides (for
|
|
86
|
-
* entitlements with a reset period)
|
|
87
|
-
*/
|
|
88
|
-
usagePeriodEnd?: string | null;
|
|
89
|
-
/**
|
|
90
|
-
* The start date of the usage period in which this measurement resides (for
|
|
91
|
-
* entitlements with a reset period)
|
|
92
|
-
*/
|
|
93
|
-
usagePeriodStart?: string | null;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export interface V1CreateEventParams {
|
|
97
|
-
/**
|
|
98
|
-
* A list of usage events to report
|
|
99
|
-
*/
|
|
100
|
-
events: Array<V1CreateEventParams.Event>;
|
|
101
|
-
}
|
|
102
|
-
export declare namespace V1CreateEventParams {
|
|
103
|
-
/**
|
|
104
|
-
* Raw usage event
|
|
105
|
-
*/
|
|
106
|
-
interface Event {
|
|
107
|
-
/**
|
|
108
|
-
* Customer id
|
|
109
|
-
*/
|
|
110
|
-
customerId: string;
|
|
111
|
-
/**
|
|
112
|
-
* The name of the usage event
|
|
113
|
-
*/
|
|
114
|
-
eventName: string;
|
|
115
|
-
/**
|
|
116
|
-
* Idempotency key
|
|
117
|
-
*/
|
|
118
|
-
idempotencyKey: string;
|
|
119
|
-
/**
|
|
120
|
-
* Dimensions associated with the usage event
|
|
121
|
-
*/
|
|
122
|
-
dimensions?: {
|
|
123
|
-
[key: string]: string | number | boolean;
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Resource id
|
|
127
|
-
*/
|
|
128
|
-
resourceId?: string | null;
|
|
129
|
-
/**
|
|
130
|
-
* Timestamp
|
|
131
|
-
*/
|
|
132
|
-
timestamp?: string;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
export interface V1CreateUsageParams {
|
|
136
|
-
/**
|
|
137
|
-
* A list of usage reports to be submitted in bulk
|
|
138
|
-
*/
|
|
139
|
-
usages: Array<V1CreateUsageParams.Usage>;
|
|
140
|
-
}
|
|
141
|
-
export declare namespace V1CreateUsageParams {
|
|
142
|
-
/**
|
|
143
|
-
* Single usage measurement
|
|
144
|
-
*/
|
|
145
|
-
interface Usage {
|
|
146
|
-
/**
|
|
147
|
-
* Customer id
|
|
148
|
-
*/
|
|
149
|
-
customerId: string;
|
|
150
|
-
/**
|
|
151
|
-
* Feature id
|
|
152
|
-
*/
|
|
153
|
-
featureId: string;
|
|
154
|
-
/**
|
|
155
|
-
* The value to report for usage
|
|
156
|
-
*/
|
|
157
|
-
value: number;
|
|
158
|
-
/**
|
|
159
|
-
* Timestamp of when the record was created
|
|
160
|
-
*/
|
|
161
|
-
createdAt?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Additional dimensions for the usage report
|
|
164
|
-
*/
|
|
165
|
-
dimensions?: {
|
|
166
|
-
[key: string]: string | number | boolean;
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* Resource id
|
|
170
|
-
*/
|
|
171
|
-
resourceId?: string | null;
|
|
172
|
-
/**
|
|
173
|
-
* The method by which the usage value should be updated
|
|
174
|
-
*/
|
|
175
|
-
updateBehavior?: 'DELTA' | 'SET';
|
|
176
|
-
}
|
|
16
|
+
events: EventsAPI.Events;
|
|
17
|
+
usage: UsageAPI.Usage;
|
|
177
18
|
}
|
|
178
19
|
export declare namespace V1 {
|
|
179
|
-
export { type
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
182
|
-
export {
|
|
20
|
+
export { Customers as Customers, type CustomerResponse as CustomerResponse, type CustomerListResponse as CustomerListResponse, type CustomerImportResponse as CustomerImportResponse, type CustomerListResponsesMyCursorIDPage as CustomerListResponsesMyCursorIDPage, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerImportParams as CustomerImportParams, type CustomerProvisionParams as CustomerProvisionParams, };
|
|
21
|
+
export { Subscriptions as Subscriptions, type Subscription as Subscription, type SubscriptionListResponse as SubscriptionListResponse, type SubscriptionImportResponse as SubscriptionImportResponse, type SubscriptionPreviewResponse as SubscriptionPreviewResponse, type SubscriptionProvisionResponse as SubscriptionProvisionResponse, type SubscriptionListResponsesMyCursorIDPage as SubscriptionListResponsesMyCursorIDPage, type SubscriptionUpdateParams as SubscriptionUpdateParams, type SubscriptionListParams as SubscriptionListParams, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionDelegateParams as SubscriptionDelegateParams, type SubscriptionImportParams as SubscriptionImportParams, type SubscriptionMigrateParams as SubscriptionMigrateParams, type SubscriptionPreviewParams as SubscriptionPreviewParams, type SubscriptionProvisionParams as SubscriptionProvisionParams, type SubscriptionTransferParams as SubscriptionTransferParams, };
|
|
22
|
+
export { Coupons as Coupons, type Coupon as Coupon, type CouponListResponse as CouponListResponse, type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponListParams as CouponListParams, };
|
|
23
|
+
export { Events as Events, type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams, };
|
|
24
|
+
export { Usage as Usage, type UsageHistoryResponse as UsageHistoryResponse, type UsageReportResponse as UsageReportResponse, type UsageHistoryParams as UsageHistoryParams, type UsageReportParams as UsageReportParams, };
|
|
183
25
|
}
|
|
184
26
|
//# sourceMappingURL=v1.d.ts.map
|
package/resources/v1/v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,g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
|
const resource_1 = require("../../core/resource.js");
|
|
7
7
|
const CouponsAPI = tslib_1.__importStar(require("./coupons.js"));
|
|
8
8
|
const coupons_1 = require("./coupons.js");
|
|
9
|
+
const EventsAPI = tslib_1.__importStar(require("./events.js"));
|
|
10
|
+
const events_1 = require("./events.js");
|
|
11
|
+
const UsageAPI = tslib_1.__importStar(require("./usage.js"));
|
|
12
|
+
const usage_1 = require("./usage.js");
|
|
9
13
|
const CustomersAPI = tslib_1.__importStar(require("./customers/customers.js"));
|
|
10
14
|
const customers_1 = require("./customers/customers.js");
|
|
11
15
|
const SubscriptionsAPI = tslib_1.__importStar(require("./subscriptions/subscriptions.js"));
|
|
@@ -16,22 +20,14 @@ class V1 extends resource_1.APIResource {
|
|
|
16
20
|
this.customers = new CustomersAPI.Customers(this._client);
|
|
17
21
|
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
18
22
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* Report usage events
|
|
22
|
-
*/
|
|
23
|
-
createEvent(body, options) {
|
|
24
|
-
return this._client.post('/api/v1/events', { body, ...options });
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Report usage measurements
|
|
28
|
-
*/
|
|
29
|
-
createUsage(body, options) {
|
|
30
|
-
return this._client.post('/api/v1/usage', { body, ...options });
|
|
23
|
+
this.events = new EventsAPI.Events(this._client);
|
|
24
|
+
this.usage = new UsageAPI.Usage(this._client);
|
|
31
25
|
}
|
|
32
26
|
}
|
|
33
27
|
exports.V1 = V1;
|
|
34
28
|
V1.Customers = customers_1.Customers;
|
|
35
29
|
V1.Subscriptions = subscriptions_1.Subscriptions;
|
|
36
30
|
V1.Coupons = coupons_1.Coupons;
|
|
31
|
+
V1.Events = events_1.Events;
|
|
32
|
+
V1.Usage = usage_1.Usage;
|
|
37
33
|
//# sourceMappingURL=v1.js.map
|
package/resources/v1/v1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,iEAAwC;AACxC,0CAOmB;AACnB,+DAAsC;AACtC,wCAA0E;AAC1E,6DAAoC;AACpC,sCAMiB;AACjB,+EAAsD;AACtD,wDAU+B;AAC/B,2FAAkE;AAClE,oEAiBuC;AAEvC,MAAa,EAAG,SAAQ,sBAAW;IAAnC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CAAA;AAND,gBAMC;AAED,EAAE,CAAC,SAAS,GAAG,qBAAS,CAAC;AACzB,EAAE,CAAC,aAAa,GAAG,6BAAa,CAAC;AACjC,EAAE,CAAC,OAAO,GAAG,iBAAO,CAAC;AACrB,EAAE,CAAC,MAAM,GAAG,eAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,aAAK,CAAC"}
|
package/resources/v1/v1.mjs
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as CouponsAPI from "./coupons.mjs";
|
|
4
4
|
import { Coupons, } from "./coupons.mjs";
|
|
5
|
+
import * as EventsAPI from "./events.mjs";
|
|
6
|
+
import { Events } from "./events.mjs";
|
|
7
|
+
import * as UsageAPI from "./usage.mjs";
|
|
8
|
+
import { Usage, } from "./usage.mjs";
|
|
5
9
|
import * as CustomersAPI from "./customers/customers.mjs";
|
|
6
10
|
import { Customers, } from "./customers/customers.mjs";
|
|
7
11
|
import * as SubscriptionsAPI from "./subscriptions/subscriptions.mjs";
|
|
@@ -12,21 +16,13 @@ export class V1 extends APIResource {
|
|
|
12
16
|
this.customers = new CustomersAPI.Customers(this._client);
|
|
13
17
|
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
14
18
|
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Report usage events
|
|
18
|
-
*/
|
|
19
|
-
createEvent(body, options) {
|
|
20
|
-
return this._client.post('/api/v1/events', { body, ...options });
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Report usage measurements
|
|
24
|
-
*/
|
|
25
|
-
createUsage(body, options) {
|
|
26
|
-
return this._client.post('/api/v1/usage', { body, ...options });
|
|
19
|
+
this.events = new EventsAPI.Events(this._client);
|
|
20
|
+
this.usage = new UsageAPI.Usage(this._client);
|
|
27
21
|
}
|
|
28
22
|
}
|
|
29
23
|
V1.Customers = Customers;
|
|
30
24
|
V1.Subscriptions = Subscriptions;
|
|
31
25
|
V1.Coupons = Coupons;
|
|
26
|
+
V1.Events = Events;
|
|
27
|
+
V1.Usage = Usage;
|
|
32
28
|
//# sourceMappingURL=v1.mjs.map
|
package/resources/v1/v1.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,
|
|
1
|
+
{"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/resources/v1/v1.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAML,OAAO,GACR;OACM,KAAK,SAAS;OACd,EAA0C,MAAM,EAAE;OAClD,KAAK,QAAQ;OACb,EACL,KAAK,GAKN;OACM,KAAK,YAAY;OACjB,EASL,SAAS,GACV;OACM,KAAK,gBAAgB;OACrB,EAgBL,aAAa,GACd;AAED,MAAM,OAAO,EAAG,SAAQ,WAAW;IAAnC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CAAA;AAED,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AACzB,EAAE,CAAC,aAAa,GAAG,aAAa,CAAC;AACjC,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC;AACrB,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;AACnB,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -18,13 +18,7 @@ import { AbstractPage, type MyCursorIDPageParams, MyCursorIDPageResponse } from
|
|
|
18
18
|
import * as Uploads from './core/uploads';
|
|
19
19
|
import * as API from './resources/index';
|
|
20
20
|
import { APIPromise } from './core/api-promise';
|
|
21
|
-
import {
|
|
22
|
-
V1,
|
|
23
|
-
V1CreateEventParams,
|
|
24
|
-
V1CreateEventResponse,
|
|
25
|
-
V1CreateUsageParams,
|
|
26
|
-
V1CreateUsageResponse,
|
|
27
|
-
} from './resources/v1/v1';
|
|
21
|
+
import { V1 } from './resources/v1/v1';
|
|
28
22
|
import { type Fetch } from './internal/builtin-types';
|
|
29
23
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
30
24
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
@@ -755,11 +749,5 @@ export declare namespace Stigg {
|
|
|
755
749
|
type MyCursorIDPageResponse as MyCursorIDPageResponse,
|
|
756
750
|
};
|
|
757
751
|
|
|
758
|
-
export {
|
|
759
|
-
V1 as V1,
|
|
760
|
-
type V1CreateEventResponse as V1CreateEventResponse,
|
|
761
|
-
type V1CreateUsageResponse as V1CreateUsageResponse,
|
|
762
|
-
type V1CreateEventParams as V1CreateEventParams,
|
|
763
|
-
type V1CreateUsageParams as V1CreateUsageParams,
|
|
764
|
-
};
|
|
752
|
+
export { V1 as V1 };
|
|
765
753
|
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
V1,
|
|
5
|
-
type V1CreateEventResponse,
|
|
6
|
-
type V1CreateUsageResponse,
|
|
7
|
-
type V1CreateEventParams,
|
|
8
|
-
type V1CreateUsageParams,
|
|
9
|
-
} from './v1/v1';
|
|
3
|
+
export { V1 } from './v1/v1';
|
|
@@ -10,14 +10,14 @@ export class Coupons extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Create coupon
|
|
12
12
|
*/
|
|
13
|
-
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<
|
|
13
|
+
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
14
14
|
return this._client.post('/api/v1/coupons', { body, ...options });
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Get a single coupon by ID
|
|
19
19
|
*/
|
|
20
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<
|
|
20
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<Coupon> {
|
|
21
21
|
return this._client.get(path`/api/v1/coupons/${id}`, options);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -40,229 +40,14 @@ export type CouponListResponsesMyCursorIDPage = MyCursorIDPage<CouponListRespons
|
|
|
40
40
|
/**
|
|
41
41
|
* Response object
|
|
42
42
|
*/
|
|
43
|
-
export interface
|
|
43
|
+
export interface Coupon {
|
|
44
44
|
/**
|
|
45
45
|
* Discount instrument with percentage or fixed amount
|
|
46
46
|
*/
|
|
47
|
-
data:
|
|
47
|
+
data: Coupon.Data;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export namespace
|
|
51
|
-
/**
|
|
52
|
-
* Discount instrument with percentage or fixed amount
|
|
53
|
-
*/
|
|
54
|
-
export interface Data {
|
|
55
|
-
/**
|
|
56
|
-
* The unique identifier for the entity
|
|
57
|
-
*/
|
|
58
|
-
id: string;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Fixed amount discounts in different currencies
|
|
62
|
-
*/
|
|
63
|
-
amountsOff: Array<Data.AmountsOff> | null;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* The unique identifier for the entity in the billing provider
|
|
67
|
-
*/
|
|
68
|
-
billingId: string | null;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The URL to the entity in the billing provider
|
|
72
|
-
*/
|
|
73
|
-
billingLinkUrl: string | null;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Timestamp of when the record was created
|
|
77
|
-
*/
|
|
78
|
-
createdAt: string;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Description of the coupon
|
|
82
|
-
*/
|
|
83
|
-
description: string | null;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Duration of the coupon validity in months
|
|
87
|
-
*/
|
|
88
|
-
durationInMonths: number | null;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Name of the coupon
|
|
92
|
-
*/
|
|
93
|
-
name: string;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Percentage discount off the original price
|
|
97
|
-
*/
|
|
98
|
-
percentOff: number | null;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* The source of the coupon
|
|
102
|
-
*/
|
|
103
|
-
source: 'STIGG' | 'STIGG_ADHOC' | 'STRIPE' | null;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Current status of the coupon
|
|
107
|
-
*/
|
|
108
|
-
status: 'ACTIVE' | 'ARCHIVED';
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Type of the coupon (percentage or fixed amount)
|
|
112
|
-
*/
|
|
113
|
-
type: 'FIXED' | 'PERCENTAGE';
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Timestamp of when the record was last updated
|
|
117
|
-
*/
|
|
118
|
-
updatedAt: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export namespace Data {
|
|
122
|
-
/**
|
|
123
|
-
* Monetary amount with currency
|
|
124
|
-
*/
|
|
125
|
-
export interface AmountsOff {
|
|
126
|
-
/**
|
|
127
|
-
* The price amount
|
|
128
|
-
*/
|
|
129
|
-
amount: number;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* The price currency
|
|
133
|
-
*/
|
|
134
|
-
currency:
|
|
135
|
-
| 'usd'
|
|
136
|
-
| 'aed'
|
|
137
|
-
| 'all'
|
|
138
|
-
| 'amd'
|
|
139
|
-
| 'ang'
|
|
140
|
-
| 'aud'
|
|
141
|
-
| 'awg'
|
|
142
|
-
| 'azn'
|
|
143
|
-
| 'bam'
|
|
144
|
-
| 'bbd'
|
|
145
|
-
| 'bdt'
|
|
146
|
-
| 'bgn'
|
|
147
|
-
| 'bif'
|
|
148
|
-
| 'bmd'
|
|
149
|
-
| 'bnd'
|
|
150
|
-
| 'bsd'
|
|
151
|
-
| 'bwp'
|
|
152
|
-
| 'byn'
|
|
153
|
-
| 'bzd'
|
|
154
|
-
| 'brl'
|
|
155
|
-
| 'cad'
|
|
156
|
-
| 'cdf'
|
|
157
|
-
| 'chf'
|
|
158
|
-
| 'cny'
|
|
159
|
-
| 'czk'
|
|
160
|
-
| 'dkk'
|
|
161
|
-
| 'dop'
|
|
162
|
-
| 'dzd'
|
|
163
|
-
| 'egp'
|
|
164
|
-
| 'etb'
|
|
165
|
-
| 'eur'
|
|
166
|
-
| 'fjd'
|
|
167
|
-
| 'gbp'
|
|
168
|
-
| 'gel'
|
|
169
|
-
| 'gip'
|
|
170
|
-
| 'gmd'
|
|
171
|
-
| 'gyd'
|
|
172
|
-
| 'hkd'
|
|
173
|
-
| 'hrk'
|
|
174
|
-
| 'htg'
|
|
175
|
-
| 'idr'
|
|
176
|
-
| 'ils'
|
|
177
|
-
| 'inr'
|
|
178
|
-
| 'isk'
|
|
179
|
-
| 'jmd'
|
|
180
|
-
| 'jpy'
|
|
181
|
-
| 'kes'
|
|
182
|
-
| 'kgs'
|
|
183
|
-
| 'khr'
|
|
184
|
-
| 'kmf'
|
|
185
|
-
| 'krw'
|
|
186
|
-
| 'kyd'
|
|
187
|
-
| 'kzt'
|
|
188
|
-
| 'lbp'
|
|
189
|
-
| 'lkr'
|
|
190
|
-
| 'lrd'
|
|
191
|
-
| 'lsl'
|
|
192
|
-
| 'mad'
|
|
193
|
-
| 'mdl'
|
|
194
|
-
| 'mga'
|
|
195
|
-
| 'mkd'
|
|
196
|
-
| 'mmk'
|
|
197
|
-
| 'mnt'
|
|
198
|
-
| 'mop'
|
|
199
|
-
| 'mro'
|
|
200
|
-
| 'mvr'
|
|
201
|
-
| 'mwk'
|
|
202
|
-
| 'mxn'
|
|
203
|
-
| 'myr'
|
|
204
|
-
| 'mzn'
|
|
205
|
-
| 'nad'
|
|
206
|
-
| 'ngn'
|
|
207
|
-
| 'nok'
|
|
208
|
-
| 'npr'
|
|
209
|
-
| 'nzd'
|
|
210
|
-
| 'pgk'
|
|
211
|
-
| 'php'
|
|
212
|
-
| 'pkr'
|
|
213
|
-
| 'pln'
|
|
214
|
-
| 'qar'
|
|
215
|
-
| 'ron'
|
|
216
|
-
| 'rsd'
|
|
217
|
-
| 'rub'
|
|
218
|
-
| 'rwf'
|
|
219
|
-
| 'sar'
|
|
220
|
-
| 'sbd'
|
|
221
|
-
| 'scr'
|
|
222
|
-
| 'sek'
|
|
223
|
-
| 'sgd'
|
|
224
|
-
| 'sle'
|
|
225
|
-
| 'sll'
|
|
226
|
-
| 'sos'
|
|
227
|
-
| 'szl'
|
|
228
|
-
| 'thb'
|
|
229
|
-
| 'tjs'
|
|
230
|
-
| 'top'
|
|
231
|
-
| 'try'
|
|
232
|
-
| 'ttd'
|
|
233
|
-
| 'tzs'
|
|
234
|
-
| 'uah'
|
|
235
|
-
| 'uzs'
|
|
236
|
-
| 'vnd'
|
|
237
|
-
| 'vuv'
|
|
238
|
-
| 'wst'
|
|
239
|
-
| 'xaf'
|
|
240
|
-
| 'xcd'
|
|
241
|
-
| 'yer'
|
|
242
|
-
| 'zar'
|
|
243
|
-
| 'zmw'
|
|
244
|
-
| 'clp'
|
|
245
|
-
| 'djf'
|
|
246
|
-
| 'gnf'
|
|
247
|
-
| 'ugx'
|
|
248
|
-
| 'pyg'
|
|
249
|
-
| 'xof'
|
|
250
|
-
| 'xpf';
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Response object
|
|
257
|
-
*/
|
|
258
|
-
export interface CouponRetrieveResponse {
|
|
259
|
-
/**
|
|
260
|
-
* Discount instrument with percentage or fixed amount
|
|
261
|
-
*/
|
|
262
|
-
data: CouponRetrieveResponse.Data;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
export namespace CouponRetrieveResponse {
|
|
50
|
+
export namespace Coupon {
|
|
266
51
|
/**
|
|
267
52
|
* Discount instrument with percentage or fixed amount
|
|
268
53
|
*/
|
|
@@ -844,8 +629,7 @@ export interface CouponListParams extends MyCursorIDPageParams {}
|
|
|
844
629
|
|
|
845
630
|
export declare namespace Coupons {
|
|
846
631
|
export {
|
|
847
|
-
type
|
|
848
|
-
type CouponRetrieveResponse as CouponRetrieveResponse,
|
|
632
|
+
type Coupon as Coupon,
|
|
849
633
|
type CouponListResponse as CouponListResponse,
|
|
850
634
|
type CouponListResponsesMyCursorIDPage as CouponListResponsesMyCursorIDPage,
|
|
851
635
|
type CouponCreateParams as CouponCreateParams,
|