@copilotz/billing 1.0.0-rc.63 → 1.0.0-rc.65
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.
|
@@ -47,7 +47,20 @@ export declare const creditSchema: {
|
|
|
47
47
|
export type Credit = Infer<typeof creditSchema> & {
|
|
48
48
|
_id: string;
|
|
49
49
|
};
|
|
50
|
-
export declare const credit: {
|
|
50
|
+
export declare const credit: Omit<import("copilotz").CollectionDef, "schema" | "queries"> & {
|
|
51
|
+
queries?: Record<string, import("copilotz").QueryDef<import("copilotz").WithId<{
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
expires?: string | undefined;
|
|
54
|
+
note?: string | undefined;
|
|
55
|
+
reason?: string | undefined;
|
|
56
|
+
by?: string | undefined;
|
|
57
|
+
takes?: string | undefined;
|
|
58
|
+
sandbox?: boolean | undefined;
|
|
59
|
+
kind: "trial" | "plan" | "gift" | "referral" | "purchase" | "waived" | "adjustment";
|
|
60
|
+
amount: number;
|
|
61
|
+
at: string;
|
|
62
|
+
}>>> | undefined;
|
|
63
|
+
} & {
|
|
51
64
|
schema: {
|
|
52
65
|
readonly type: "object";
|
|
53
66
|
readonly properties: {
|
|
@@ -87,24 +100,4 @@ export declare const credit: {
|
|
|
87
100
|
};
|
|
88
101
|
readonly required: readonly ["kind", "amount", "at"];
|
|
89
102
|
};
|
|
90
|
-
events?: boolean;
|
|
91
|
-
records?: boolean;
|
|
92
|
-
durable?: false;
|
|
93
|
-
indexes?: string[][];
|
|
94
|
-
private?: string[];
|
|
95
|
-
queries?: Record<string, import("copilotz").QueryDef<{
|
|
96
|
-
[x: string]: unknown;
|
|
97
|
-
expires?: string | undefined;
|
|
98
|
-
note?: string | undefined;
|
|
99
|
-
reason?: string | undefined;
|
|
100
|
-
by?: string | undefined;
|
|
101
|
-
takes?: string | undefined;
|
|
102
|
-
sandbox?: boolean | undefined;
|
|
103
|
-
kind: "trial" | "plan" | "gift" | "referral" | "purchase" | "waived" | "adjustment";
|
|
104
|
-
amount: number;
|
|
105
|
-
at: string;
|
|
106
|
-
} & {
|
|
107
|
-
_id: string;
|
|
108
|
-
}>> | undefined;
|
|
109
|
-
vectors?: string[];
|
|
110
103
|
};
|
|
@@ -59,7 +59,24 @@ export declare const paymentSchema: {
|
|
|
59
59
|
export type Payment = Infer<typeof paymentSchema> & {
|
|
60
60
|
_id: string;
|
|
61
61
|
};
|
|
62
|
-
export declare const payment: {
|
|
62
|
+
export declare const payment: Omit<import("copilotz").CollectionDef, "schema" | "queries"> & {
|
|
63
|
+
queries?: Record<string, import("copilotz").QueryDef<import("copilotz").WithId<{
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
credits?: number | undefined;
|
|
66
|
+
note?: string | undefined;
|
|
67
|
+
by?: string | undefined;
|
|
68
|
+
sandbox?: boolean | undefined;
|
|
69
|
+
seller?: string | undefined;
|
|
70
|
+
rate?: number | undefined;
|
|
71
|
+
fee?: number | undefined;
|
|
72
|
+
amount: number;
|
|
73
|
+
at: string;
|
|
74
|
+
currency: string;
|
|
75
|
+
channel: string;
|
|
76
|
+
purpose: "credits" | "seats" | "contract" | "refund";
|
|
77
|
+
ref: string;
|
|
78
|
+
}>>> | undefined;
|
|
79
|
+
} & {
|
|
63
80
|
schema: {
|
|
64
81
|
readonly type: "object";
|
|
65
82
|
readonly properties: {
|
|
@@ -112,28 +129,4 @@ export declare const payment: {
|
|
|
112
129
|
};
|
|
113
130
|
readonly required: readonly ["channel", "ref", "amount", "currency", "purpose", "at"];
|
|
114
131
|
};
|
|
115
|
-
events?: boolean;
|
|
116
|
-
records?: boolean;
|
|
117
|
-
durable?: false;
|
|
118
|
-
indexes?: string[][];
|
|
119
|
-
private?: string[];
|
|
120
|
-
queries?: Record<string, import("copilotz").QueryDef<{
|
|
121
|
-
[x: string]: unknown;
|
|
122
|
-
credits?: number | undefined;
|
|
123
|
-
note?: string | undefined;
|
|
124
|
-
by?: string | undefined;
|
|
125
|
-
sandbox?: boolean | undefined;
|
|
126
|
-
seller?: string | undefined;
|
|
127
|
-
rate?: number | undefined;
|
|
128
|
-
fee?: number | undefined;
|
|
129
|
-
amount: number;
|
|
130
|
-
at: string;
|
|
131
|
-
currency: string;
|
|
132
|
-
channel: string;
|
|
133
|
-
purpose: "credits" | "seats" | "contract" | "refund";
|
|
134
|
-
ref: string;
|
|
135
|
-
} & {
|
|
136
|
-
_id: string;
|
|
137
|
-
}>> | undefined;
|
|
138
|
-
vectors?: string[];
|
|
139
132
|
};
|
|
@@ -183,7 +183,66 @@ export declare const planSchema: {
|
|
|
183
183
|
export type Plan = Infer<typeof planSchema> & {
|
|
184
184
|
_id: string;
|
|
185
185
|
};
|
|
186
|
-
export declare const billingPlan: {
|
|
186
|
+
export declare const billingPlan: Omit<import("copilotz").CollectionDef, "schema" | "queries"> & {
|
|
187
|
+
queries?: Record<string, import("copilotz").QueryDef<import("copilotz").WithId<{
|
|
188
|
+
[x: string]: unknown;
|
|
189
|
+
budget?: number | null | undefined;
|
|
190
|
+
waived?: {
|
|
191
|
+
[x: string]: unknown;
|
|
192
|
+
seats?: {
|
|
193
|
+
[x: string]: unknown;
|
|
194
|
+
by?: string | undefined;
|
|
195
|
+
until?: string | undefined;
|
|
196
|
+
people?: string[] | undefined;
|
|
197
|
+
reason: string;
|
|
198
|
+
from: string;
|
|
199
|
+
} | undefined;
|
|
200
|
+
usage?: {
|
|
201
|
+
[x: string]: unknown;
|
|
202
|
+
by?: string | undefined;
|
|
203
|
+
until?: string | undefined;
|
|
204
|
+
reason: string;
|
|
205
|
+
from: string;
|
|
206
|
+
} | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
sandbox?: boolean | undefined;
|
|
209
|
+
seats?: number | undefined;
|
|
210
|
+
counting?: boolean | undefined;
|
|
211
|
+
channel?: string | undefined;
|
|
212
|
+
seller?: string | undefined;
|
|
213
|
+
customer?: string | undefined;
|
|
214
|
+
subscription?: string | undefined;
|
|
215
|
+
status?: string | undefined;
|
|
216
|
+
statusAt?: string | undefined;
|
|
217
|
+
ended?: string[] | undefined;
|
|
218
|
+
at: string;
|
|
219
|
+
anchor: string;
|
|
220
|
+
name: string;
|
|
221
|
+
terms: {
|
|
222
|
+
[x: string]: unknown;
|
|
223
|
+
for?: "personal" | "team" | undefined;
|
|
224
|
+
seat?: {
|
|
225
|
+
[x: string]: unknown;
|
|
226
|
+
price: number;
|
|
227
|
+
currency: string;
|
|
228
|
+
} | undefined;
|
|
229
|
+
credits?: {
|
|
230
|
+
[x: string]: unknown;
|
|
231
|
+
once?: number | undefined;
|
|
232
|
+
monthly?: number | undefined;
|
|
233
|
+
perSeat?: number | undefined;
|
|
234
|
+
} | undefined;
|
|
235
|
+
prices?: string | undefined;
|
|
236
|
+
budget?: {
|
|
237
|
+
[x: string]: unknown;
|
|
238
|
+
perSeat?: number | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
models?: string | undefined;
|
|
241
|
+
title: string;
|
|
242
|
+
};
|
|
243
|
+
since: string;
|
|
244
|
+
}>>> | undefined;
|
|
245
|
+
} & {
|
|
187
246
|
schema: {
|
|
188
247
|
readonly type: "object";
|
|
189
248
|
readonly properties: {
|
|
@@ -359,70 +418,4 @@ export declare const billingPlan: {
|
|
|
359
418
|
};
|
|
360
419
|
readonly required: readonly ["name", "terms", "since", "anchor", "at"];
|
|
361
420
|
};
|
|
362
|
-
events?: boolean;
|
|
363
|
-
records?: boolean;
|
|
364
|
-
durable?: false;
|
|
365
|
-
indexes?: string[][];
|
|
366
|
-
private?: string[];
|
|
367
|
-
queries?: Record<string, import("copilotz").QueryDef<{
|
|
368
|
-
[x: string]: unknown;
|
|
369
|
-
budget?: number | null | undefined;
|
|
370
|
-
waived?: {
|
|
371
|
-
[x: string]: unknown;
|
|
372
|
-
seats?: {
|
|
373
|
-
[x: string]: unknown;
|
|
374
|
-
by?: string | undefined;
|
|
375
|
-
until?: string | undefined;
|
|
376
|
-
people?: string[] | undefined;
|
|
377
|
-
reason: string;
|
|
378
|
-
from: string;
|
|
379
|
-
} | undefined;
|
|
380
|
-
usage?: {
|
|
381
|
-
[x: string]: unknown;
|
|
382
|
-
by?: string | undefined;
|
|
383
|
-
until?: string | undefined;
|
|
384
|
-
reason: string;
|
|
385
|
-
from: string;
|
|
386
|
-
} | undefined;
|
|
387
|
-
} | undefined;
|
|
388
|
-
sandbox?: boolean | undefined;
|
|
389
|
-
seats?: number | undefined;
|
|
390
|
-
counting?: boolean | undefined;
|
|
391
|
-
channel?: string | undefined;
|
|
392
|
-
seller?: string | undefined;
|
|
393
|
-
customer?: string | undefined;
|
|
394
|
-
subscription?: string | undefined;
|
|
395
|
-
status?: string | undefined;
|
|
396
|
-
statusAt?: string | undefined;
|
|
397
|
-
ended?: string[] | undefined;
|
|
398
|
-
at: string;
|
|
399
|
-
anchor: string;
|
|
400
|
-
name: string;
|
|
401
|
-
terms: {
|
|
402
|
-
[x: string]: unknown;
|
|
403
|
-
for?: "personal" | "team" | undefined;
|
|
404
|
-
seat?: {
|
|
405
|
-
[x: string]: unknown;
|
|
406
|
-
price: number;
|
|
407
|
-
currency: string;
|
|
408
|
-
} | undefined;
|
|
409
|
-
credits?: {
|
|
410
|
-
[x: string]: unknown;
|
|
411
|
-
once?: number | undefined;
|
|
412
|
-
monthly?: number | undefined;
|
|
413
|
-
perSeat?: number | undefined;
|
|
414
|
-
} | undefined;
|
|
415
|
-
prices?: string | undefined;
|
|
416
|
-
budget?: {
|
|
417
|
-
[x: string]: unknown;
|
|
418
|
-
perSeat?: number | undefined;
|
|
419
|
-
} | undefined;
|
|
420
|
-
models?: string | undefined;
|
|
421
|
-
title: string;
|
|
422
|
-
};
|
|
423
|
-
since: string;
|
|
424
|
-
} & {
|
|
425
|
-
_id: string;
|
|
426
|
-
}>> | undefined;
|
|
427
|
-
vectors?: string[];
|
|
428
421
|
};
|
|
@@ -36,7 +36,17 @@ export declare const roomSchema: {
|
|
|
36
36
|
export type Room = Infer<typeof roomSchema> & {
|
|
37
37
|
_id: string;
|
|
38
38
|
};
|
|
39
|
-
export declare const billingRoom: {
|
|
39
|
+
export declare const billingRoom: Omit<import("copilotz").CollectionDef, "schema" | "queries"> & {
|
|
40
|
+
queries?: Record<string, import("copilotz").QueryDef<import("copilotz").WithId<{
|
|
41
|
+
[x: string]: unknown;
|
|
42
|
+
limit?: number | undefined;
|
|
43
|
+
lowCredits?: number | undefined;
|
|
44
|
+
lowBudget?: number | undefined;
|
|
45
|
+
credits: number;
|
|
46
|
+
budget: number;
|
|
47
|
+
until: string;
|
|
48
|
+
}>>> | undefined;
|
|
49
|
+
} & {
|
|
40
50
|
schema: {
|
|
41
51
|
readonly type: "object";
|
|
42
52
|
readonly properties: {
|
|
@@ -65,21 +75,4 @@ export declare const billingRoom: {
|
|
|
65
75
|
};
|
|
66
76
|
readonly required: readonly ["credits", "budget", "until"];
|
|
67
77
|
};
|
|
68
|
-
events?: boolean;
|
|
69
|
-
records?: boolean;
|
|
70
|
-
durable?: false;
|
|
71
|
-
indexes?: string[][];
|
|
72
|
-
private?: string[];
|
|
73
|
-
queries?: Record<string, import("copilotz").QueryDef<{
|
|
74
|
-
[x: string]: unknown;
|
|
75
|
-
limit?: number | undefined;
|
|
76
|
-
lowCredits?: number | undefined;
|
|
77
|
-
lowBudget?: number | undefined;
|
|
78
|
-
credits: number;
|
|
79
|
-
budget: number;
|
|
80
|
-
until: string;
|
|
81
|
-
} & {
|
|
82
|
-
_id: string;
|
|
83
|
-
}>> | undefined;
|
|
84
|
-
vectors?: string[];
|
|
85
78
|
};
|
|
@@ -14,8 +14,8 @@ import { type PlanTerms } from "./settings.js";
|
|
|
14
14
|
import { type Walked } from "./walk.js";
|
|
15
15
|
/** What stands for "no limit" in `room`: taking prices off it never gets near zero. */
|
|
16
16
|
export declare const NO_LIMIT = 1000000000000000;
|
|
17
|
-
export declare const rooms: (ctx: Context) => import("copilotz").Collection<Room>;
|
|
18
|
-
export declare const planOf: (ctx: Context) => Promise<import("copilotz").WithId<Plan
|
|
17
|
+
export declare const rooms: (ctx: Context) => import("copilotz").Collection<import("../../../../dist/npm/runtime/names.js").AppDocument<string, Room>, string>;
|
|
18
|
+
export declare const planOf: (ctx: Context) => Promise<import("copilotz").WithId<import("../../../../dist/npm/runtime/names.js").AppDocument<string, Plan>> | null>;
|
|
19
19
|
/**
|
|
20
20
|
* A plan's terms for this org. A trial is one a person: the personal org they
|
|
21
21
|
* get once. A team's starts without it, and doesn't gain it by falling back.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotz/billing",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.65",
|
|
4
4
|
"description": "What an org has to spend (credits, plans, budgets) and paying for it with Stripe, on Copilotz's usage ledger. A Copilotz plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"copilotz",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@types/react": "^19.3.0",
|
|
55
|
-
"copilotz": "1.0.0-rc.
|
|
55
|
+
"copilotz": "1.0.0-rc.65",
|
|
56
56
|
"react": "^19.3.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|