@usagetap/sdk 0.2.1 → 0.4.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.
- package/README.md +27 -1
- package/dist/adapters/openai.d.cts +1 -1
- package/dist/adapters/openai.d.ts +1 -1
- package/dist/adapters/openrouter.d.cts +1 -1
- package/dist/adapters/openrouter.d.ts +1 -1
- package/dist/index.cjs +23 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/{openai-CeptbEGH.d.cts → openai-Ch7hN2vD.d.cts} +16 -1
- package/dist/{openai-CeptbEGH.d.ts → openai-Ch7hN2vD.d.ts} +16 -1
- package/package.json +1 -1
|
@@ -257,6 +257,20 @@ interface CheckUsageResponseBody {
|
|
|
257
257
|
balances?: BalanceSummary;
|
|
258
258
|
stripeCustomerId?: string | null;
|
|
259
259
|
}
|
|
260
|
+
interface CreateCustomerRequest {
|
|
261
|
+
customerId: string;
|
|
262
|
+
customerFriendlyName?: string;
|
|
263
|
+
customerName?: string;
|
|
264
|
+
customerEmail?: string;
|
|
265
|
+
stripeCustomerId?: string;
|
|
266
|
+
}
|
|
267
|
+
interface CreateCustomerOptions extends RequestOptions {
|
|
268
|
+
correlationId?: string;
|
|
269
|
+
idempotencyKey?: string;
|
|
270
|
+
}
|
|
271
|
+
interface CreateCustomerResponseBody extends CheckUsageResponseBody {
|
|
272
|
+
newCustomer: boolean;
|
|
273
|
+
}
|
|
260
274
|
|
|
261
275
|
declare class UsageTapClient {
|
|
262
276
|
private readonly apiKey;
|
|
@@ -274,6 +288,7 @@ declare class UsageTapClient {
|
|
|
274
288
|
beginCall(request: BeginCallRequest, options?: BeginCallOptions): Promise<UsageTapSuccessResponse<BeginCallResponseBody>>;
|
|
275
289
|
endCall(request: EndCallRequest, options?: EndCallOptions): Promise<UsageTapSuccessResponse<EndCallResponseBody>>;
|
|
276
290
|
checkUsage(request: CheckUsageRequest, options?: CheckUsageOptions): Promise<UsageTapSuccessResponse<CheckUsageResponseBody>>;
|
|
291
|
+
createCustomer(request: CreateCustomerRequest, options?: CreateCustomerOptions): Promise<UsageTapSuccessResponse<CreateCustomerResponseBody>>;
|
|
277
292
|
withUsage<T>(beginRequest: BeginCallRequest, handler: (context: WithUsageContext) => Promise<T>, options?: WithUsageOptions): Promise<T>;
|
|
278
293
|
private request;
|
|
279
294
|
private requestGet;
|
|
@@ -417,4 +432,4 @@ interface NodeResponseLike {
|
|
|
417
432
|
flush?(): void;
|
|
418
433
|
}
|
|
419
434
|
|
|
420
|
-
export { type
|
|
435
|
+
export { type SubscriptionSnapshot as $, type EntitlementHints as A, type BeginCallRequest as B, type CreateCustomerOptions as C, type MeterSnapshot as D, type EndCallOptions as E, type MeteredUsage as F, type RequestedEntitlements as G, type AllowedEntitlements as H, type RetryOptions as I, type UsageTapClientOptions as J, type UsageTapSuccessResponse as K, type UsageTapErrorResponse as L, type MeterSummary as M, type NodeResponseLike as N, type OpenAIAdapter as O, type PlanSummary as P, type UsageTapResultEnvelope as Q, type RemainingRatios as R, type StreamMode as S, type UsageTapResultStatus as T, UsageTapClient as U, type VendorHints as V, type WrapOpenAIContext as W, type UsageTapLogEntry as X, type WithUsageContext as Y, type WithUsageOptions as Z, type LimitType as _, type WrapOpenAIOptions as a, type ModelHints as a0, type IdempotencyMetadata as a1, type OpenAIRequestContext as a2, type OpenAIStreamCallResult as a3, type UsageTapStream as a4, type OpenAIAdapterInit as b, createOpenAIAdapter as c, type OpenAIInvokeParams as d, type OpenAIInvokeResult as e, type OpenAIStreamParams as f, type OpenAIStreamResult as g, type StreamToResponseOptions as h, type WrapOpenAICallOptions as i, type WrapOpenAIResponseCallOptions as j, type WrappedOpenAI as k, type StreamOpenAIRouteOptions as l, type BeginCallOptions as m, type BeginCallResponseBody as n, type CreateCustomerRequest as o, pipeToResponse as p, type CreateCustomerResponseBody as q, type CheckUsageOptions as r, streamOpenAIRoute as s, toNextResponse as t, type CheckUsageRequest as u, type CheckUsageResponseBody as v, wrapOpenAI as w, type EndCallRequest as x, type EndCallResponseBody as y, type BalanceSummary as z };
|
|
@@ -257,6 +257,20 @@ interface CheckUsageResponseBody {
|
|
|
257
257
|
balances?: BalanceSummary;
|
|
258
258
|
stripeCustomerId?: string | null;
|
|
259
259
|
}
|
|
260
|
+
interface CreateCustomerRequest {
|
|
261
|
+
customerId: string;
|
|
262
|
+
customerFriendlyName?: string;
|
|
263
|
+
customerName?: string;
|
|
264
|
+
customerEmail?: string;
|
|
265
|
+
stripeCustomerId?: string;
|
|
266
|
+
}
|
|
267
|
+
interface CreateCustomerOptions extends RequestOptions {
|
|
268
|
+
correlationId?: string;
|
|
269
|
+
idempotencyKey?: string;
|
|
270
|
+
}
|
|
271
|
+
interface CreateCustomerResponseBody extends CheckUsageResponseBody {
|
|
272
|
+
newCustomer: boolean;
|
|
273
|
+
}
|
|
260
274
|
|
|
261
275
|
declare class UsageTapClient {
|
|
262
276
|
private readonly apiKey;
|
|
@@ -274,6 +288,7 @@ declare class UsageTapClient {
|
|
|
274
288
|
beginCall(request: BeginCallRequest, options?: BeginCallOptions): Promise<UsageTapSuccessResponse<BeginCallResponseBody>>;
|
|
275
289
|
endCall(request: EndCallRequest, options?: EndCallOptions): Promise<UsageTapSuccessResponse<EndCallResponseBody>>;
|
|
276
290
|
checkUsage(request: CheckUsageRequest, options?: CheckUsageOptions): Promise<UsageTapSuccessResponse<CheckUsageResponseBody>>;
|
|
291
|
+
createCustomer(request: CreateCustomerRequest, options?: CreateCustomerOptions): Promise<UsageTapSuccessResponse<CreateCustomerResponseBody>>;
|
|
277
292
|
withUsage<T>(beginRequest: BeginCallRequest, handler: (context: WithUsageContext) => Promise<T>, options?: WithUsageOptions): Promise<T>;
|
|
278
293
|
private request;
|
|
279
294
|
private requestGet;
|
|
@@ -417,4 +432,4 @@ interface NodeResponseLike {
|
|
|
417
432
|
flush?(): void;
|
|
418
433
|
}
|
|
419
434
|
|
|
420
|
-
export { type
|
|
435
|
+
export { type SubscriptionSnapshot as $, type EntitlementHints as A, type BeginCallRequest as B, type CreateCustomerOptions as C, type MeterSnapshot as D, type EndCallOptions as E, type MeteredUsage as F, type RequestedEntitlements as G, type AllowedEntitlements as H, type RetryOptions as I, type UsageTapClientOptions as J, type UsageTapSuccessResponse as K, type UsageTapErrorResponse as L, type MeterSummary as M, type NodeResponseLike as N, type OpenAIAdapter as O, type PlanSummary as P, type UsageTapResultEnvelope as Q, type RemainingRatios as R, type StreamMode as S, type UsageTapResultStatus as T, UsageTapClient as U, type VendorHints as V, type WrapOpenAIContext as W, type UsageTapLogEntry as X, type WithUsageContext as Y, type WithUsageOptions as Z, type LimitType as _, type WrapOpenAIOptions as a, type ModelHints as a0, type IdempotencyMetadata as a1, type OpenAIRequestContext as a2, type OpenAIStreamCallResult as a3, type UsageTapStream as a4, type OpenAIAdapterInit as b, createOpenAIAdapter as c, type OpenAIInvokeParams as d, type OpenAIInvokeResult as e, type OpenAIStreamParams as f, type OpenAIStreamResult as g, type StreamToResponseOptions as h, type WrapOpenAICallOptions as i, type WrapOpenAIResponseCallOptions as j, type WrappedOpenAI as k, type StreamOpenAIRouteOptions as l, type BeginCallOptions as m, type BeginCallResponseBody as n, type CreateCustomerRequest as o, pipeToResponse as p, type CreateCustomerResponseBody as q, type CheckUsageOptions as r, streamOpenAIRoute as s, toNextResponse as t, type CheckUsageRequest as u, type CheckUsageResponseBody as v, wrapOpenAI as w, type EndCallRequest as x, type EndCallResponseBody as y, type BalanceSummary as z };
|