🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@trigger.dev/billing

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trigger.dev/billing - npm Package Compare versions

Comparing version

to
1.0.2

dist/plans-558232c2.d.ts

2

dist/cost.d.ts
import { P as PricedMetric } from './pricing-df9c71b3.js';
import { P as Plan } from './plans-872a7138.js';
import { P as Plan } from './plans-558232c2.js';
import 'zod';

@@ -4,0 +4,0 @@

@@ -1,2 +0,2 @@

import { P as Plan } from './plans-872a7138.js';
import { P as Plan } from './plans-558232c2.js';
import 'zod';

@@ -3,0 +3,0 @@

@@ -1,4 +0,5 @@

import { z } from 'zod';
import { z, ZodType } from 'zod';
export { P as PricedMetric, a as PricedMetricSchema } from './pricing-df9c71b3.js';
export { P as Plan, a as PlanSchema, b as Plans } from './plans-872a7138.js';
import { a as PlansSchema } from './plans-558232c2.js';
export { P as Plan, b as PlanSchema, c as Plans, R as RunPricingSchema } from './plans-558232c2.js';
export { estimate } from './estimate.js';

@@ -81,4 +82,4 @@

}, "strip", z.ZodTypeAny, {
title: string;
code: string;
title: string;
concurrentRuns?: {

@@ -100,4 +101,4 @@ pricing?: {

}, {
title: string;
code: string;
title: string;
concurrentRuns?: {

@@ -122,120 +123,403 @@ pricing?: {

declare const ActiveSubscriptionSchema: z.ZodObject<{
id: z.ZodString;
status: z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"pending">, z.ZodLiteral<"canceled">, z.ZodLiteral<"terminated">]>;
createdAt: z.ZodString;
terminatedAt: z.ZodOptional<z.ZodString>;
plan: z.ZodObject<{
title: z.ZodString;
code: z.ZodString;
concurrentRuns: z.ZodObject<{
pricing: z.ZodOptional<z.ZodObject<{
code: z.ZodString;
upto: z.ZodOptional<z.ZodNumber>;
tierCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
code: string;
tierCost: number;
upto?: number | undefined;
}, {
code: string;
tierCost: number;
upto?: number | undefined;
}>>;
freeAllowance: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
}, {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
}>;
runs: z.ZodOptional<z.ZodObject<{
pricing: z.ZodOptional<z.ZodObject<{
code: z.ZodString;
brackets: z.ZodArray<z.ZodObject<{
upto: z.ZodOptional<z.ZodNumber>;
unitCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
unitCost: number;
upto?: number | undefined;
}, {
unitCost: number;
upto?: number | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
}, {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
}>>;
freeAllowance: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
}, {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
}, {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
}>;
canceledAt: z.ZodOptional<z.ZodString>;
planCode: z.ZodString;
previousPlanCode: z.ZodOptional<z.ZodString>;
nextPlanCode: z.ZodOptional<z.ZodString>;
downgradePlanDate: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
}, {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
}>;
type ActiveSubscription = z.infer<typeof ActiveSubscriptionSchema>;
declare const LimitsSchema: z.ZodObject<{
runs: z.ZodOptional<z.ZodNumber>;
concurrentRuns: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
concurrentRuns: number;
runs?: number | undefined;
}, {
concurrentRuns: number;
runs?: number | undefined;
}>;
type Limits = z.infer<typeof LimitsSchema>;
declare const CurrentUsageSchema: z.ZodObject<{
declare const CurrentPlanSchema: z.ZodObject<{
subscription: z.ZodOptional<z.ZodObject<{
id: z.ZodString;
status: z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"pending">, z.ZodLiteral<"canceled">, z.ZodLiteral<"terminated">]>;
createdAt: z.ZodString;
terminatedAt: z.ZodOptional<z.ZodString>;
plan: z.ZodObject<{
title: z.ZodString;
code: z.ZodString;
concurrentRuns: z.ZodObject<{
pricing: z.ZodOptional<z.ZodObject<{
code: z.ZodString;
upto: z.ZodOptional<z.ZodNumber>;
tierCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
code: string;
tierCost: number;
upto?: number | undefined;
}, {
code: string;
tierCost: number;
upto?: number | undefined;
}>>;
freeAllowance: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
}, {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
}>;
runs: z.ZodOptional<z.ZodObject<{
pricing: z.ZodOptional<z.ZodObject<{
code: z.ZodString;
brackets: z.ZodArray<z.ZodObject<{
upto: z.ZodOptional<z.ZodNumber>;
unitCost: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
unitCost: number;
upto?: number | undefined;
}, {
unitCost: number;
upto?: number | undefined;
}>, "many">;
}, "strip", z.ZodTypeAny, {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
}, {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
}>>;
freeAllowance: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
}, {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
}, {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
}>;
canceledAt: z.ZodOptional<z.ZodString>;
planCode: z.ZodString;
previousPlanCode: z.ZodOptional<z.ZodString>;
nextPlanCode: z.ZodOptional<z.ZodString>;
downgradePlanDate: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
}, {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
}>>;
limits: z.ZodObject<{
runs: z.ZodOptional<z.ZodNumber>;
concurrentRuns: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
concurrentRuns: number;
runs?: number | undefined;
}, {
concurrentRuns: number;
runs?: number | undefined;
}>;
}, "strip", z.ZodTypeAny, {
limits: {
concurrentRuns: number;
runs?: number | undefined;
};
subscription?: {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
} | undefined;
}, {
limits: {
concurrentRuns: number;
runs?: number | undefined;
};
subscription?: {
status: "active" | "pending" | "canceled" | "terminated";
id: string;
createdAt: string;
planCode: string;
terminatedAt?: string | undefined;
plan: {
title: string;
code: string;
concurrentRuns: {
pricing?: {
code: string;
tierCost: number;
upto?: number | undefined;
} | undefined;
freeAllowance?: number | undefined;
};
runs?: {
pricing?: {
code: string;
brackets: {
unitCost: number;
upto?: number | undefined;
}[];
} | undefined;
freeAllowance?: number | undefined;
} | undefined;
};
canceledAt?: string | undefined;
previousPlanCode?: string | undefined;
nextPlanCode?: string | undefined;
downgradePlanDate?: string | undefined;
} | undefined;
}>;
type CurrentUsage = z.infer<typeof CurrentUsageSchema>;
type CurrentPlan = z.infer<typeof CurrentPlanSchema>;
declare const SetPlanBodySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{

@@ -385,2 +669,32 @@ type: z.ZodLiteral<"paid">;

export { ActiveSubscription, ActiveSubscriptionSchema, BracketSchema, CanceledSubscriptionResult, CreateSubscriptionFlowStart, CurrentUsage, CurrentUsageSchema, Limits, PlanDefinition, PlanDefinitionSchema, SetPlanBody, SetPlanBodySchema, SubscribeResult, SubscribeResultSchema, UpdatedSubscriptionResult };
declare const ErrorSchema: z.ZodObject<{
error: z.ZodString;
}, "strip", z.ZodTypeAny, {
error: string;
}, {
error: string;
}>;
type Error = z.infer<typeof ErrorSchema>;
type BillingClientConfig = {
url: string;
apiKey: string;
};
type SuccessResult<TSchema extends ZodType> = {
success: true;
} & z.infer<TSchema>;
type ErrorResult = {
success: false;
error: string;
};
type Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;
declare class BillingClient {
private readonly config;
constructor(config: BillingClientConfig);
plans(): Promise<Result<typeof PlansSchema>>;
currentPlan(orgId: string): Promise<Result<typeof CurrentPlanSchema>>;
setPlan(orgId: string, body: SetPlanBody): Promise<Result<typeof SubscribeResultSchema>>;
fetch<TSchema extends ZodType = z.ZodTypeAny>(path: string, schema: TSchema): Promise<Result<TSchema>>;
}
export { ActiveSubscription, ActiveSubscriptionSchema, BillingClient, BracketSchema, CanceledSubscriptionResult, CreateSubscriptionFlowStart, CurrentPlan, CurrentPlanSchema, Error, ErrorSchema, PlanDefinition, PlanDefinitionSchema, PlansSchema, SetPlanBody, SetPlanBodySchema, SubscribeResult, SubscribeResultSchema, UpdatedSubscriptionResult };
export * from "./schemas";
export * from "./estimate";
export * from "./client";
//# sourceMappingURL=index.js.map
{
"name": "@trigger.dev/billing",
"version": "1.0.1",
"version": "1.0.2",
"description": "Calculates the billing for a given organization",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet