@schematichq/schematic-typescript-node 1.4.8 → 1.5.1
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/README.md +111 -6
- package/dist/Client.d.ts +8 -0
- package/dist/api/resources/credits/client/Client.d.ts +0 -48
- package/dist/api/resources/credits/client/requests/index.d.ts +0 -2
- package/dist/api/resources/credits/types/index.d.ts +0 -4
- package/dist/api/resources/plangroups/client/Client.d.ts +2 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +4 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +4 -0
- package/dist/api/resources/plans/client/Client.d.ts +1 -5
- package/dist/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +1 -6
- package/dist/api/types/BillingCreditGrantZeroedOutReason.d.ts +1 -0
- package/dist/api/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
- package/dist/api/types/ChangeSubscriptionRequestBody.d.ts +1 -0
- package/dist/api/types/CheckoutSettingsResponseData.d.ts +3 -0
- package/dist/api/types/FeatureEntitlement.d.ts +5 -1
- package/dist/api/types/PlanChangeResponseData.d.ts +2 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/dist/api/types/RulesengineFeatureEntitlement.d.ts +5 -1
- package/dist/api/types/index.d.ts +0 -2
- package/dist/cache/redis.d.ts +29 -2
- package/dist/credits/check.d.ts +49 -0
- package/dist/credits/index.d.ts +7 -0
- package/dist/credits/lease-manager.d.ts +68 -0
- package/dist/credits/lease-store.d.ts +133 -0
- package/dist/credits/redis-lease-store.d.ts +30 -0
- package/dist/credits/redis-reservation-store.d.ts +46 -0
- package/dist/credits/reservation-store.d.ts +64 -0
- package/dist/credits/track.d.ts +44 -0
- package/dist/credits/types.d.ts +175 -0
- package/dist/datastream/datastream-client.d.ts +19 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +85 -3
- package/dist/rules-engine.d.ts +3 -1
- package/dist/serialization/resources/credits/types/index.d.ts +0 -4
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +3 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +3 -0
- package/dist/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +0 -2
- package/dist/serialization/types/BillingCreditGrantZeroedOutReason.d.ts +1 -1
- package/dist/serialization/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
- package/dist/serialization/types/ChangeSubscriptionRequestBody.d.ts +1 -0
- package/dist/serialization/types/CheckoutSettingsResponseData.d.ts +3 -0
- package/dist/serialization/types/FeatureEntitlement.d.ts +2 -0
- package/dist/serialization/types/PlanChangeResponseData.d.ts +1 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/dist/serialization/types/RulesengineFeatureEntitlement.d.ts +2 -0
- package/dist/serialization/types/index.d.ts +0 -2
- package/dist/wasm/rulesengine.js +4 -4
- package/dist/wrapper.d.ts +158 -6
- package/package.json +5 -4
- package/dist/api/resources/credits/client/requests/CountCreditLedgerRequest.d.ts +0 -26
- package/dist/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.d.ts +0 -26
- package/dist/api/resources/credits/types/CountCreditLedgerParams.d.ts +0 -16
- package/dist/api/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -6
- package/dist/api/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -16
- package/dist/api/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -6
- package/dist/api/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -25
- package/dist/api/types/CreditLedgerPeriod.d.ts +0 -7
- package/dist/serialization/resources/credits/types/CountCreditLedgerParams.d.ts +0 -17
- package/dist/serialization/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -12
- package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -17
- package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -12
- package/dist/serialization/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -33
- package/dist/serialization/types/CreditLedgerPeriod.d.ts +0 -7
package/dist/wrapper.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { SchematicClient as BaseClient } from "./Client";
|
|
|
3
3
|
import { type CacheProvider } from "./cache";
|
|
4
4
|
import { type Logger, type LogLevel } from "./logger";
|
|
5
5
|
import type { RedisClient } from "./cache/redis";
|
|
6
|
+
import { type CheckOptions, type CheckResult, type CreditLeaseConfig, type Reservation, type TrackWithReservationOptions } from "./credits";
|
|
6
7
|
/**
|
|
7
8
|
* Configuration options for the SchematicClient
|
|
8
9
|
*/
|
|
@@ -53,12 +54,42 @@ export interface SchematicOptions {
|
|
|
53
54
|
offline?: boolean;
|
|
54
55
|
/** The default maximum time to wait for a response in milliseconds */
|
|
55
56
|
timeoutMs?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Enable client-side credit lease + reservation behavior on `check` /
|
|
59
|
+
* `trackWithReservation`. Omit to keep the SDK lease-unaware.
|
|
60
|
+
*
|
|
61
|
+
* Lease-bearing checks require DataStream (or replicator mode) so the
|
|
62
|
+
* SDK has access to the cached flag + company state needed for local
|
|
63
|
+
* gating against the lease balance.
|
|
64
|
+
*/
|
|
65
|
+
creditLeases?: CreditLeaseConfig;
|
|
56
66
|
}
|
|
57
67
|
export interface CheckFlagOptions {
|
|
58
68
|
/** Default value to return on error. Can be a boolean or a function returning a boolean. If not provided, uses configured flag defaults */
|
|
59
69
|
defaultValue?: boolean | (() => boolean);
|
|
60
70
|
/** The maximum time to wait for a response in milliseconds */
|
|
61
71
|
timeoutMs?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Preflight inputs forwarded to the WASM rules engine's
|
|
74
|
+
* `checkFlagWithOptions`. The engine picks the most specific knob for each
|
|
75
|
+
* condition it evaluates. Only applied when the flag is evaluated locally
|
|
76
|
+
* (DataStream); the REST fallback path does not support preflight and
|
|
77
|
+
* ignores these. No reservation is issued — for lease-backed gating use
|
|
78
|
+
* `check()` instead.
|
|
79
|
+
*/
|
|
80
|
+
/** Pre-computed per-credit-id cost. Highest precedence for credit-balance gates. */
|
|
81
|
+
creditCost?: Record<string, number>;
|
|
82
|
+
/** Single integer quantity applied to whatever numeric condition is being evaluated. */
|
|
83
|
+
usage?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Simulated quantity scoped to a specific event subtype. Preferred over
|
|
86
|
+
* `usage` when the subtype is known. Deliberately singular: one check
|
|
87
|
+
* preflights one action.
|
|
88
|
+
*/
|
|
89
|
+
eventUsage?: {
|
|
90
|
+
eventSubtype: string;
|
|
91
|
+
quantity: number;
|
|
92
|
+
};
|
|
62
93
|
}
|
|
63
94
|
/**
|
|
64
95
|
* Optional metadata for a track event. Only fields that are explicitly set are
|
|
@@ -81,6 +112,14 @@ export interface TrackOptions {
|
|
|
81
112
|
export interface IdentifyOptions {
|
|
82
113
|
/** Client-supplied dedupe key. Duplicate events with the same key (scoped to the environment) are dropped server-side for 24 hours. */
|
|
83
114
|
idempotencyKey?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Credit type IDs to acquire leases for in the background after the
|
|
117
|
+
* identify event is enqueued. Fire-and-forget — failures are logged but
|
|
118
|
+
* never surface to the caller. Equivalent to calling `client.prewarm()`
|
|
119
|
+
* directly with the same evalCtx and creditTypeIds. No-op unless
|
|
120
|
+
* `creditLeases` is configured on the client.
|
|
121
|
+
*/
|
|
122
|
+
prewarm?: string[];
|
|
84
123
|
}
|
|
85
124
|
export interface CheckFlagWithEntitlementResponse {
|
|
86
125
|
companyId?: string;
|
|
@@ -101,6 +140,11 @@ export declare class SchematicClient extends BaseClient {
|
|
|
101
140
|
private flagDefaults;
|
|
102
141
|
private logger;
|
|
103
142
|
private offline;
|
|
143
|
+
private creditLeaseManager?;
|
|
144
|
+
private leaseStore?;
|
|
145
|
+
private reservations?;
|
|
146
|
+
private leaseBackendShared;
|
|
147
|
+
private prewarmResolveTimeoutMs;
|
|
104
148
|
/**
|
|
105
149
|
* Creates a new instance of the SchematicClient
|
|
106
150
|
* @param opts - Configuration options for the client
|
|
@@ -144,16 +188,124 @@ export declare class SchematicClient extends BaseClient {
|
|
|
144
188
|
*/
|
|
145
189
|
private checkFlagsViaDataStream;
|
|
146
190
|
/**
|
|
147
|
-
* Gracefully shuts down the client by stopping the event buffer
|
|
191
|
+
* Gracefully shuts down the client by stopping the event buffer, the
|
|
192
|
+
* reservation sweeper, and the DataStream client.
|
|
193
|
+
*
|
|
194
|
+
* Credit leases: with the per-process in-memory backend, this process is
|
|
195
|
+
* the only holder of its leases, so they are released here (best-effort) —
|
|
196
|
+
* their unspent remainder returns to the company balance immediately
|
|
197
|
+
* instead of waiting out the lease expiry. With a shared (Redis) backend,
|
|
198
|
+
* leases are deliberately *not* released: a lease is shared across every
|
|
199
|
+
* SDK instance pointed at the same backend (one row per company+credit),
|
|
200
|
+
* so a single pod shutting down must not release a lease that sibling pods
|
|
201
|
+
* are still drawing on — doing so would refund the grant server-side and
|
|
202
|
+
* pull the balance out from under them. Shared leases reclaim themselves:
|
|
203
|
+
* they expire (client- and server-side) or are fully consumed.
|
|
148
204
|
* @returns Promise that resolves when everything has been stopped
|
|
149
205
|
*/
|
|
150
206
|
close(): Promise<void>;
|
|
151
207
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
208
|
+
* Pre-warm a credit lease for each given credit type ID, so the first
|
|
209
|
+
* `check()` against it doesn't pay the acquire round-trip. Fire-and-forget
|
|
210
|
+
* — failures are logged but don't throw.
|
|
211
|
+
*
|
|
212
|
+
* When `evalCtx.company` carries only secondary keys (no `id`), `prewarm`
|
|
213
|
+
* actively fetches the company over the datastream (waiting up to
|
|
214
|
+
* `creditLeases.prewarmResolveTimeoutMs` for the WS to connect), which both
|
|
215
|
+
* resolves the id and warms the cache so the first `check()` hits the lease
|
|
216
|
+
* path. Covers a brand-new company too: the fetch retries until the server
|
|
217
|
+
* has ingested the preceding `identify` and can stream it back.
|
|
218
|
+
*/
|
|
219
|
+
prewarm(evalCtx: api.CheckFlagRequestBody, creditTypeIds: string[]): Promise<void>;
|
|
220
|
+
/**
|
|
221
|
+
* Like `resolveCompanyId` but actively fetches the company over the
|
|
222
|
+
* datastream when only secondary keys are supplied, warming the cache as a
|
|
223
|
+
* side effect. Returns the resolved id, or undefined if the company never
|
|
224
|
+
* surfaced within `prewarmResolveTimeoutMs`.
|
|
225
|
+
*
|
|
226
|
+
* `identify` does not push a company into the datastream cache — companies
|
|
227
|
+
* are only streamed in response to a request. So we call `getCompany`
|
|
228
|
+
* (cache-first, then sends the request and awaits the push) rather than
|
|
229
|
+
* passively polling `getCachedCompany`, which would watch an empty cache
|
|
230
|
+
* until it times out. Fetching also primes the cache so the first real
|
|
231
|
+
* `check()` hits the lease path instead of falling back.
|
|
232
|
+
*/
|
|
233
|
+
private resolveCompanyIdWithWait;
|
|
234
|
+
/**
|
|
235
|
+
* Lease-aware feature check. When `creditLeases` is configured and the
|
|
236
|
+
* caller passes `usage` (optionally qualified by `eventSubtype`), this
|
|
237
|
+
* acquires a lease (if needed), gates the check against the lease's local
|
|
238
|
+
* balance via WASM, and returns a reservation handle on success — pass
|
|
239
|
+
* that handle to `trackWithReservation` when the work completes.
|
|
240
|
+
*
|
|
241
|
+
* When `creditLeases` is not configured (or `usage` is omitted) this falls
|
|
242
|
+
* through to a plain flag check and returns `{allowed: value}` with no
|
|
243
|
+
* reservation, byte-compatible with `checkFlag` semantics. The caller's
|
|
244
|
+
* preflight (`usage` / `eventSubtype`) is still threaded through the plain
|
|
245
|
+
* check, so any client-side evaluation path (datastream, replicator)
|
|
246
|
+
* gates on the post-call balance — just without a reservation. Only the
|
|
247
|
+
* REST fallback ignores preflight.
|
|
248
|
+
*/
|
|
249
|
+
check(evalCtx: api.CheckFlagRequestBody, key: string, options?: CheckOptions): Promise<CheckResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Consume a reservation issued by `check()`. Refunds the unused slice
|
|
252
|
+
* (`creditsReserved - actualQuantity * consumptionRate`) back to the
|
|
253
|
+
* lease's local balance and enqueues a Track event with
|
|
254
|
+
* `quantity = actualQuantity`. The server-side event processor consumes
|
|
255
|
+
* `actualQuantity × consumption_rate` from the company's real credit
|
|
256
|
+
* balance.
|
|
257
|
+
*
|
|
258
|
+
* If the work outlived the reservation's TTL and the sweeper already
|
|
259
|
+
* returned the hold to the lease, the local refund has happened but the
|
|
260
|
+
* usage must still be billed — so we emit the Track anyway (a "recovery"
|
|
261
|
+
* emit). The server bills it against the lease's sub-ledger if the lease is
|
|
262
|
+
* still live, or falls through to a direct grant decrement if the server
|
|
263
|
+
* lease has itself expired.
|
|
264
|
+
*
|
|
265
|
+
* Double-billing is prevented server-side: the Track carries a deterministic
|
|
266
|
+
* `idempotencyKey` derived from the reservation id, and the events pipeline
|
|
267
|
+
* drops duplicates by `(account, env, event_type, key)` for 24h before any
|
|
268
|
+
* credit consumption runs. So a recovery emit racing the normal emit, or an
|
|
269
|
+
* accidental second `trackWithReservation`, collapses to a single billed
|
|
270
|
+
* event — across pods and process restarts, not just within one process.
|
|
271
|
+
*/
|
|
272
|
+
trackWithReservation(reservation: Reservation, actualQuantity: number, options?: TrackWithReservationOptions): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Lease-aware credit balance for display, in the same three-way split the
|
|
275
|
+
* server exposes on `listCompanyCreditBalances`:
|
|
276
|
+
*
|
|
277
|
+
* - `remaining`: credits available to draw right now — the server balance
|
|
278
|
+
* (`company.creditBalances[creditId]`, already net of any active lease
|
|
279
|
+
* tranche): `B − L`.
|
|
280
|
+
* - `reserved`: the active lease's unsettled hold — its unspent local
|
|
281
|
+
* balance plus open reservations (`L − spent`), reported as the
|
|
282
|
+
* aggregate the server models.
|
|
283
|
+
* - `settled`: the economic balance the end user should see —
|
|
284
|
+
* `remaining + reserved = B − spent`. Invariant to in-flight holds, so
|
|
285
|
+
* a counter bound to it doesn't dip mid-call.
|
|
286
|
+
*
|
|
287
|
+
* Bind a user-facing "credits remaining" counter to `settled`: the server
|
|
288
|
+
* balance alone reads low (or 0) while a lease still has unspent balance.
|
|
289
|
+
*
|
|
290
|
+
* `reserved` is 0 when no lease is held or the held lease has expired — the
|
|
291
|
+
* server refunds an expired lease's unspent hold into the balance, so
|
|
292
|
+
* counting a stale local entry would double-count. Returns zeros when
|
|
293
|
+
* credit leases / datastream aren't configured or the company can't be
|
|
294
|
+
* resolved. The `reserved` term comes from this process's lease +
|
|
295
|
+
* reservation stores, so it (and `settled`) is per-process unless
|
|
296
|
+
* Redis-backed stores are configured.
|
|
297
|
+
*/
|
|
298
|
+
getCreditBalance(company: Record<string, string>, creditId: string): Promise<{
|
|
299
|
+
remaining: number;
|
|
300
|
+
reserved: number;
|
|
301
|
+
settled: number;
|
|
302
|
+
}>;
|
|
303
|
+
private resolveCompanyId;
|
|
304
|
+
/**
|
|
305
|
+
* Send a non-blocking event to create or update companies and users.
|
|
306
|
+
* Pass `options.prewarm` with credit type IDs to kick off lease acquires in
|
|
307
|
+
* the background after the identify event is enqueued (no-op unless
|
|
308
|
+
* `creditLeases` is configured on the client).
|
|
157
309
|
*/
|
|
158
310
|
identify(body: api.EventBodyIdentify, options?: IdentifyOptions): Promise<void>;
|
|
159
311
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematichq/schematic-typescript-node",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"formdata-node": "^6.0.3",
|
|
29
29
|
"node-fetch": "^2.7.0",
|
|
30
30
|
"readable-stream": "^4.7.0",
|
|
31
|
-
"ws": "^8.18.1"
|
|
32
|
-
"@types/ws": "^8.18.1"
|
|
31
|
+
"ws": "^8.18.1"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@types/node-fetch": "^2.6.12",
|
|
@@ -46,7 +45,9 @@
|
|
|
46
45
|
"typescript": "~5.9.3",
|
|
47
46
|
"@biomejs/biome": "2.4.10",
|
|
48
47
|
"esbuild": "^0.25.9",
|
|
49
|
-
"miniflare": "^4.20260421.0"
|
|
48
|
+
"miniflare": "^4.20260421.0",
|
|
49
|
+
"redis": "^4.7.0",
|
|
50
|
+
"@types/ws": "^8.18.1"
|
|
50
51
|
},
|
|
51
52
|
"browser": {
|
|
52
53
|
"fs": false,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* companyId: "company_id",
|
|
6
|
-
* billingCreditId: "billing_credit_id",
|
|
7
|
-
* featureId: "feature_id",
|
|
8
|
-
* period: "daily",
|
|
9
|
-
* startTime: "start_time",
|
|
10
|
-
* endTime: "end_time",
|
|
11
|
-
* limit: 1000000,
|
|
12
|
-
* offset: 1000000
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export interface CountCreditLedgerRequest {
|
|
16
|
-
companyId: string;
|
|
17
|
-
billingCreditId?: string;
|
|
18
|
-
featureId?: string;
|
|
19
|
-
period: Schematic.CreditLedgerPeriod;
|
|
20
|
-
startTime?: string;
|
|
21
|
-
endTime?: string;
|
|
22
|
-
/** Page limit (default 100) */
|
|
23
|
-
limit?: number;
|
|
24
|
-
/** Page offset (default 0) */
|
|
25
|
-
offset?: number;
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* companyId: "company_id",
|
|
6
|
-
* billingCreditId: "billing_credit_id",
|
|
7
|
-
* featureId: "feature_id",
|
|
8
|
-
* period: "daily",
|
|
9
|
-
* startTime: "start_time",
|
|
10
|
-
* endTime: "end_time",
|
|
11
|
-
* limit: 1000000,
|
|
12
|
-
* offset: 1000000
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export interface GetEnrichedCreditLedgerRequest {
|
|
16
|
-
companyId: string;
|
|
17
|
-
billingCreditId?: string;
|
|
18
|
-
featureId?: string;
|
|
19
|
-
period: Schematic.CreditLedgerPeriod;
|
|
20
|
-
startTime?: string;
|
|
21
|
-
endTime?: string;
|
|
22
|
-
/** Page limit (default 100) */
|
|
23
|
-
limit?: number;
|
|
24
|
-
/** Page offset (default 0) */
|
|
25
|
-
offset?: number;
|
|
26
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* Input parameters
|
|
4
|
-
*/
|
|
5
|
-
export interface CountCreditLedgerParams {
|
|
6
|
-
billingCreditId?: string;
|
|
7
|
-
companyId?: string;
|
|
8
|
-
endTime?: string;
|
|
9
|
-
featureId?: string;
|
|
10
|
-
/** Page limit (default 100) */
|
|
11
|
-
limit?: number;
|
|
12
|
-
/** Page offset (default 0) */
|
|
13
|
-
offset?: number;
|
|
14
|
-
period?: Schematic.CreditLedgerPeriod;
|
|
15
|
-
startTime?: string;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* Input parameters
|
|
4
|
-
*/
|
|
5
|
-
export interface GetEnrichedCreditLedgerParams {
|
|
6
|
-
billingCreditId?: string;
|
|
7
|
-
companyId?: string;
|
|
8
|
-
endTime?: string;
|
|
9
|
-
featureId?: string;
|
|
10
|
-
/** Page limit (default 100) */
|
|
11
|
-
limit?: number;
|
|
12
|
-
/** Page offset (default 0) */
|
|
13
|
-
offset?: number;
|
|
14
|
-
period?: Schematic.CreditLedgerPeriod;
|
|
15
|
-
startTime?: string;
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../index";
|
|
2
|
-
export interface CreditLedgerEnrichedEntryResponseData {
|
|
3
|
-
billingCreditAutoTopupGrantCount: number;
|
|
4
|
-
billingCreditId: string;
|
|
5
|
-
company?: Schematic.CompanyLedgerResponseData;
|
|
6
|
-
companyId: string;
|
|
7
|
-
credit?: Schematic.BillingCreditLedgerResponseData;
|
|
8
|
-
expiredGrantCount: number;
|
|
9
|
-
feature?: Schematic.FeatureLedgerResponseData;
|
|
10
|
-
featureId?: string;
|
|
11
|
-
firstTransactionAt: Date;
|
|
12
|
-
freeGrantCount: number;
|
|
13
|
-
grantCount: number;
|
|
14
|
-
lastTransactionAt: Date;
|
|
15
|
-
manuallyZeroedCount: number;
|
|
16
|
-
netChange: number;
|
|
17
|
-
planGrantCount: number;
|
|
18
|
-
purchasedGrantCount: number;
|
|
19
|
-
timeBucket: Date;
|
|
20
|
-
totalConsumed: number;
|
|
21
|
-
totalGranted: number;
|
|
22
|
-
transactionCount: number;
|
|
23
|
-
usageCount: number;
|
|
24
|
-
zeroedOutCount: number;
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerPeriod } from "../../../types/CreditLedgerPeriod";
|
|
5
|
-
export declare const CountCreditLedgerParams: core.serialization.ObjectSchema<serializers.CountCreditLedgerParams.Raw, Schematic.CountCreditLedgerParams>;
|
|
6
|
-
export declare namespace CountCreditLedgerParams {
|
|
7
|
-
interface Raw {
|
|
8
|
-
billing_credit_id?: string | null;
|
|
9
|
-
company_id?: string | null;
|
|
10
|
-
end_time?: string | null;
|
|
11
|
-
feature_id?: string | null;
|
|
12
|
-
limit?: number | null;
|
|
13
|
-
offset?: number | null;
|
|
14
|
-
period?: CreditLedgerPeriod.Raw | null;
|
|
15
|
-
start_time?: string | null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CountResponse } from "../../../types/CountResponse";
|
|
5
|
-
import { CountCreditLedgerParams } from "./CountCreditLedgerParams";
|
|
6
|
-
export declare const CountCreditLedgerResponse: core.serialization.ObjectSchema<serializers.CountCreditLedgerResponse.Raw, Schematic.CountCreditLedgerResponse>;
|
|
7
|
-
export declare namespace CountCreditLedgerResponse {
|
|
8
|
-
interface Raw {
|
|
9
|
-
data: CountResponse.Raw;
|
|
10
|
-
params: CountCreditLedgerParams.Raw;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerPeriod } from "../../../types/CreditLedgerPeriod";
|
|
5
|
-
export declare const GetEnrichedCreditLedgerParams: core.serialization.ObjectSchema<serializers.GetEnrichedCreditLedgerParams.Raw, Schematic.GetEnrichedCreditLedgerParams>;
|
|
6
|
-
export declare namespace GetEnrichedCreditLedgerParams {
|
|
7
|
-
interface Raw {
|
|
8
|
-
billing_credit_id?: string | null;
|
|
9
|
-
company_id?: string | null;
|
|
10
|
-
end_time?: string | null;
|
|
11
|
-
feature_id?: string | null;
|
|
12
|
-
limit?: number | null;
|
|
13
|
-
offset?: number | null;
|
|
14
|
-
period?: CreditLedgerPeriod.Raw | null;
|
|
15
|
-
start_time?: string | null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerEnrichedEntryResponseData } from "../../../types/CreditLedgerEnrichedEntryResponseData";
|
|
5
|
-
import { GetEnrichedCreditLedgerParams } from "./GetEnrichedCreditLedgerParams";
|
|
6
|
-
export declare const GetEnrichedCreditLedgerResponse: core.serialization.ObjectSchema<serializers.GetEnrichedCreditLedgerResponse.Raw, Schematic.GetEnrichedCreditLedgerResponse>;
|
|
7
|
-
export declare namespace GetEnrichedCreditLedgerResponse {
|
|
8
|
-
interface Raw {
|
|
9
|
-
data: CreditLedgerEnrichedEntryResponseData.Raw[];
|
|
10
|
-
params: GetEnrichedCreditLedgerParams.Raw;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../api/index";
|
|
2
|
-
import * as core from "../../core";
|
|
3
|
-
import type * as serializers from "../index";
|
|
4
|
-
import { BillingCreditLedgerResponseData } from "./BillingCreditLedgerResponseData";
|
|
5
|
-
import { CompanyLedgerResponseData } from "./CompanyLedgerResponseData";
|
|
6
|
-
import { FeatureLedgerResponseData } from "./FeatureLedgerResponseData";
|
|
7
|
-
export declare const CreditLedgerEnrichedEntryResponseData: core.serialization.ObjectSchema<serializers.CreditLedgerEnrichedEntryResponseData.Raw, Schematic.CreditLedgerEnrichedEntryResponseData>;
|
|
8
|
-
export declare namespace CreditLedgerEnrichedEntryResponseData {
|
|
9
|
-
interface Raw {
|
|
10
|
-
billing_credit_auto_topup_grant_count: number;
|
|
11
|
-
billing_credit_id: string;
|
|
12
|
-
company?: CompanyLedgerResponseData.Raw | null;
|
|
13
|
-
company_id: string;
|
|
14
|
-
credit?: BillingCreditLedgerResponseData.Raw | null;
|
|
15
|
-
expired_grant_count: number;
|
|
16
|
-
feature?: FeatureLedgerResponseData.Raw | null;
|
|
17
|
-
feature_id?: string | null;
|
|
18
|
-
first_transaction_at: string;
|
|
19
|
-
free_grant_count: number;
|
|
20
|
-
grant_count: number;
|
|
21
|
-
last_transaction_at: string;
|
|
22
|
-
manually_zeroed_count: number;
|
|
23
|
-
net_change: number;
|
|
24
|
-
plan_grant_count: number;
|
|
25
|
-
purchased_grant_count: number;
|
|
26
|
-
time_bucket: string;
|
|
27
|
-
total_consumed: number;
|
|
28
|
-
total_granted: number;
|
|
29
|
-
transaction_count: number;
|
|
30
|
-
usage_count: number;
|
|
31
|
-
zeroed_out_count: number;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../api/index";
|
|
2
|
-
import * as core from "../../core";
|
|
3
|
-
import type * as serializers from "../index";
|
|
4
|
-
export declare const CreditLedgerPeriod: core.serialization.Schema<serializers.CreditLedgerPeriod.Raw, Schematic.CreditLedgerPeriod>;
|
|
5
|
-
export declare namespace CreditLedgerPeriod {
|
|
6
|
-
type Raw = "daily" | "monthly" | "raw" | "weekly";
|
|
7
|
-
}
|