@anuragpal02/zcl-contracts 0.49.0 → 0.51.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/dist/admin.d.ts CHANGED
@@ -466,6 +466,74 @@ export type AdminJobStep = z.infer<typeof adminJobStepSchema>;
466
466
  export type AdminJobEvent = z.infer<typeof adminJobEventSchema>;
467
467
  export type AdminJobDetailResponse = z.infer<typeof adminJobDetailResponseSchema>;
468
468
  export type AdminUsageResponse = z.infer<typeof adminUsageResponseSchema>;
469
+ /** What a captured credit was spent on: a generation job type, a frame iteration, or
470
+ * a capture whose reservation no longer resolves to either (`unlinked`). */
471
+ export declare const freeCreditSpendTargetSchema: z.ZodUnion<readonly [z.ZodEnum<{
472
+ "image.generate": "image.generate";
473
+ "prompt.enhance": "prompt.enhance";
474
+ "image.edit": "image.edit";
475
+ "image.mask": "image.mask";
476
+ "image.export": "image.export";
477
+ "image.panel": "image.panel";
478
+ "video.loop": "video.loop";
479
+ "video.upscale": "video.upscale";
480
+ "video.smart": "video.smart";
481
+ "video.panel": "video.panel";
482
+ }>, z.ZodLiteral<"frame_iteration">, z.ZodLiteral<"unlinked">]>;
483
+ export declare const adminFreeCreditsResponseSchema: z.ZodObject<{
484
+ data: z.ZodObject<{
485
+ asOf: z.ZodString;
486
+ workspaces: z.ZodObject<{
487
+ total: z.ZodNumber;
488
+ neverPurchased: z.ZodNumber;
489
+ freeOnlyActive: z.ZodNumber;
490
+ }, z.core.$strip>;
491
+ given: z.ZodObject<{
492
+ signupBonus: z.ZodNumber;
493
+ adminTopups: z.ZodNumber;
494
+ total: z.ZodNumber;
495
+ }, z.core.$strip>;
496
+ purchased: z.ZodNumber;
497
+ otherGrants: z.ZodNumber;
498
+ spent: z.ZodObject<{
499
+ total: z.ZodNumber;
500
+ byFreeOnlyWorkspaces: z.ZodNumber;
501
+ }, z.core.$strip>;
502
+ freeBurnt: z.ZodObject<{
503
+ exact: z.ZodNumber;
504
+ lowerBound: z.ZodNumber;
505
+ upperBound: z.ZodNumber;
506
+ }, z.core.$strip>;
507
+ freeOnlySpendByType: z.ZodArray<z.ZodObject<{
508
+ type: z.ZodUnion<readonly [z.ZodEnum<{
509
+ "image.generate": "image.generate";
510
+ "prompt.enhance": "prompt.enhance";
511
+ "image.edit": "image.edit";
512
+ "image.mask": "image.mask";
513
+ "image.export": "image.export";
514
+ "image.panel": "image.panel";
515
+ "video.loop": "video.loop";
516
+ "video.upscale": "video.upscale";
517
+ "video.smart": "video.smart";
518
+ "video.panel": "video.panel";
519
+ }>, z.ZodLiteral<"frame_iteration">, z.ZodLiteral<"unlinked">]>;
520
+ captures: z.ZodNumber;
521
+ credits: z.ZodNumber;
522
+ estimatedUsd: z.ZodNumber;
523
+ }, z.core.$strip>>;
524
+ estimatedCostUsd: z.ZodObject<{
525
+ freeOnly: z.ZodNumber;
526
+ note: z.ZodString;
527
+ }, z.core.$strip>;
528
+ signupBonusesByMonth: z.ZodArray<z.ZodObject<{
529
+ month: z.ZodString;
530
+ bonuses: z.ZodNumber;
531
+ credits: z.ZodNumber;
532
+ }, z.core.$strip>>;
533
+ }, z.core.$strip>;
534
+ }, z.core.$strip>;
535
+ export type FreeCreditSpendTarget = z.infer<typeof freeCreditSpendTargetSchema>;
536
+ export type AdminFreeCreditsResponse = z.infer<typeof adminFreeCreditsResponseSchema>;
469
537
  export type AdminWorkspaceSummary = z.infer<typeof adminWorkspaceSummarySchema>;
470
538
  export type ListAdminWorkspacesResponse = z.infer<typeof listAdminWorkspacesResponseSchema>;
471
539
  //# sourceMappingURL=admin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,sBAAsB;;;;;;;EAOjC,CAAA;AAGF,eAAO,MAAM,qBAAqB;;;;;;;iBAOjC,CAAA;AAED,eAAO,MAAM,2B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,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAWzE;4EAC4E;AAC5E,eAAO,MAAM,2BAA2B;;;;;;;;;;;+DAItC,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+C1C,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AACrF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA"}
package/dist/admin.js CHANGED
@@ -206,3 +206,60 @@ export const stepUpVerifyRequestSchema = z.object({
206
206
  export const stepUpVerifyResponseSchema = apiSuccessSchema(z.object({
207
207
  verifiedUntil: isoDateSchema
208
208
  }));
209
+ // ─── Free credits: what ZCL has given away, and how much of it has been spent ──────
210
+ //
211
+ // LIFETIME figures (no window) — the question this answers is "how much have we burnt
212
+ // on free credits so far". Free = signup bonuses + positive admin adjustments; paid =
213
+ // Zero Store purchases. Balances are pooled per workspace, so a spent credit is not
214
+ // labelled free or paid: `freeBurnt.exact` covers workspaces that never purchased (all
215
+ // their spend is free), and the bounds bracket the rest by assuming free credits are
216
+ // spent last (`lowerBound`) or first (`upperBound`).
217
+ /** What a captured credit was spent on: a generation job type, a frame iteration, or
218
+ * a capture whose reservation no longer resolves to either (`unlinked`). */
219
+ export const freeCreditSpendTargetSchema = z.union([
220
+ generationJobTypeSchema,
221
+ z.literal('frame_iteration'),
222
+ z.literal('unlinked')
223
+ ]);
224
+ export const adminFreeCreditsResponseSchema = apiSuccessSchema(z.object({
225
+ asOf: isoDateSchema,
226
+ workspaces: z.object({
227
+ total: z.number().int(),
228
+ neverPurchased: z.number().int(),
229
+ /** Never purchased AND spent at least one credit. */
230
+ freeOnlyActive: z.number().int()
231
+ }),
232
+ given: z.object({
233
+ signupBonus: z.number().int(),
234
+ adminTopups: z.number().int(),
235
+ total: z.number().int()
236
+ }),
237
+ purchased: z.number().int(),
238
+ /** Grants that are neither a signup bonus nor a Zero Store order. Expected 0. */
239
+ otherGrants: z.number().int(),
240
+ spent: z.object({
241
+ total: z.number().int(),
242
+ byFreeOnlyWorkspaces: z.number().int()
243
+ }),
244
+ freeBurnt: z.object({
245
+ exact: z.number().int(),
246
+ lowerBound: z.number().int(),
247
+ upperBound: z.number().int()
248
+ }),
249
+ freeOnlySpendByType: z.array(z.object({
250
+ type: freeCreditSpendTargetSchema,
251
+ captures: z.number().int(),
252
+ credits: z.number().int(),
253
+ estimatedUsd: z.number()
254
+ })),
255
+ /** What the free-only spend cost ZCL in provider fees — list prices, approximate. */
256
+ estimatedCostUsd: z.object({
257
+ freeOnly: z.number(),
258
+ note: z.string()
259
+ }),
260
+ signupBonusesByMonth: z.array(z.object({
261
+ month: z.string().regex(/^\d{4}-\d{2}$/),
262
+ bonuses: z.number().int(),
263
+ credits: z.number().int()
264
+ }))
265
+ }));
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './client.js';
6
6
  export * from './common.js';
7
7
  export * from './collection.js';
8
8
  export * from './credits.js';
9
+ export * from './pricing.js';
9
10
  export * from './frame-iterator.js';
10
11
  export * from './generation.js';
11
12
  export * from './guidelines.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './client.js';
6
6
  export * from './common.js';
7
7
  export * from './collection.js';
8
8
  export * from './credits.js';
9
+ export * from './pricing.js';
9
10
  export * from './frame-iterator.js';
10
11
  export * from './generation.js';
11
12
  export * from './guidelines.js';
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What the tools cost, served BY the API so a client never has to know.
4
+ *
5
+ * ── Why this exists ──────────────────────────────────────────────────────────
6
+ *
7
+ * The Loop Generator's price lived in three places: `LOOP_TOOL_CREDIT_COST` in
8
+ * zcl-api, a `creditsFor()` helper in the web app's hook, and a third copy as
9
+ * display strings in the markup. Nothing kept them in step, and they drifted — the
10
+ * UI quoted 250 / 1,250 while the API charged 188 / 313. At 4K that is FOUR TIMES
11
+ * the real price, shown to customers deciding whether they could afford it.
12
+ *
13
+ * The Frame Iterator has the identical shape (10 in the UI, 10 in the API) and is
14
+ * currently correct by luck rather than by construction — it drifts the moment
15
+ * either number moves.
16
+ *
17
+ * So the fix is not "correct the numbers", it is "have one number". The API owns
18
+ * the price because the API is what charges it; a client that displays a different
19
+ * figure is by definition wrong.
20
+ *
21
+ * ── Why it is public ─────────────────────────────────────────────────────────
22
+ *
23
+ * Both tools render for signed-out visitors, and they show the price before anyone
24
+ * has an account. A workspace-scoped shape could not serve that, and gating it
25
+ * behind auth would mean the signed-out UI going back to hardcoding — which is the
26
+ * bug this removes.
27
+ *
28
+ * Prices are already public information: they are on the pricing page.
29
+ */
30
+ export declare const loopToolPricingSchema: z.ZodObject<{
31
+ '1080p': z.ZodNumber;
32
+ '4k': z.ZodNumber;
33
+ }, z.core.$strip>;
34
+ export declare const pricingSchema: z.ZodObject<{
35
+ loopTool: z.ZodObject<{
36
+ '1080p': z.ZodNumber;
37
+ '4k': z.ZodNumber;
38
+ }, z.core.$strip>;
39
+ frameIterationCredits: z.ZodNumber;
40
+ imageCredits: z.ZodNumber;
41
+ }, z.core.$strip>;
42
+ export declare const pricingResponseSchema: z.ZodObject<{
43
+ data: z.ZodObject<{
44
+ loopTool: z.ZodObject<{
45
+ '1080p': z.ZodNumber;
46
+ '4k': z.ZodNumber;
47
+ }, z.core.$strip>;
48
+ frameIterationCredits: z.ZodNumber;
49
+ imageCredits: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ }, z.core.$strip>;
52
+ export type LoopToolPricing = z.infer<typeof loopToolPricingSchema>;
53
+ export type Pricing = z.infer<typeof pricingSchema>;
54
+ export type PricingResponse = z.infer<typeof pricingResponseSchema>;
55
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;iBAUxB,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;iBAAkC,CAAA;AAEpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { apiSuccessSchema } from './common.js';
3
+ /**
4
+ * What the tools cost, served BY the API so a client never has to know.
5
+ *
6
+ * ── Why this exists ──────────────────────────────────────────────────────────
7
+ *
8
+ * The Loop Generator's price lived in three places: `LOOP_TOOL_CREDIT_COST` in
9
+ * zcl-api, a `creditsFor()` helper in the web app's hook, and a third copy as
10
+ * display strings in the markup. Nothing kept them in step, and they drifted — the
11
+ * UI quoted 250 / 1,250 while the API charged 188 / 313. At 4K that is FOUR TIMES
12
+ * the real price, shown to customers deciding whether they could afford it.
13
+ *
14
+ * The Frame Iterator has the identical shape (10 in the UI, 10 in the API) and is
15
+ * currently correct by luck rather than by construction — it drifts the moment
16
+ * either number moves.
17
+ *
18
+ * So the fix is not "correct the numbers", it is "have one number". The API owns
19
+ * the price because the API is what charges it; a client that displays a different
20
+ * figure is by definition wrong.
21
+ *
22
+ * ── Why it is public ─────────────────────────────────────────────────────────
23
+ *
24
+ * Both tools render for signed-out visitors, and they show the price before anyone
25
+ * has an account. A workspace-scoped shape could not serve that, and gating it
26
+ * behind auth would mean the signed-out UI going back to hardcoding — which is the
27
+ * bug this removes.
28
+ *
29
+ * Prices are already public information: they are on the pricing page.
30
+ */
31
+ export const loopToolPricingSchema = z.object({
32
+ '1080p': z.number().int().positive(),
33
+ '4k': z.number().int().positive()
34
+ });
35
+ export const pricingSchema = z.object({
36
+ /** Standalone Loop Generator, keyed by the output resolution the user picks. */
37
+ loopTool: loopToolPricingSchema,
38
+ /** Frame Iterator, charged per variation — the client multiplies by the count. */
39
+ frameIterationCredits: z.number().int().positive(),
40
+ /**
41
+ * A single generated image: one concept variation, one panel, one edit. The wall
42
+ * flows multiply this by their own panel counts, which the client already knows.
43
+ */
44
+ imageCredits: z.number().int().positive()
45
+ });
46
+ export const pricingResponseSchema = apiSuccessSchema(pricingSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuragpal02/zcl-contracts",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",