@bubblelab/shared-schemas 0.1.48 → 0.1.49

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.
@@ -34,10 +34,10 @@ export declare const MilkTeaRequestSchema: z.ZodObject<{
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  bubbleName: string;
36
36
  model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b";
37
+ userName: string;
37
38
  userRequest: string;
38
39
  bubbleSchema: Record<string, unknown>;
39
40
  availableCredentials: string[];
40
- userName: string;
41
41
  conversationHistory: {
42
42
  role: "user" | "assistant" | "tool";
43
43
  content: string;
@@ -48,9 +48,9 @@ export declare const MilkTeaRequestSchema: z.ZodObject<{
48
48
  insertLocation?: string | undefined;
49
49
  }, {
50
50
  bubbleName: string;
51
+ userName: string;
51
52
  userRequest: string;
52
53
  bubbleSchema: Record<string, unknown>;
53
- userName: string;
54
54
  model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | undefined;
55
55
  currentCode?: string | undefined;
56
56
  availableCredentials?: string[] | undefined;
package/dist/pearl.d.ts CHANGED
@@ -44,8 +44,8 @@ export declare const PearlRequestSchema: z.ZodObject<{
44
44
  }>, "many">>>;
45
45
  }, "strip", z.ZodTypeAny, {
46
46
  model: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b";
47
- userRequest: string;
48
47
  userName: string;
48
+ userRequest: string;
49
49
  conversationHistory: {
50
50
  role: "user" | "assistant" | "tool";
51
51
  content: string;
@@ -61,8 +61,8 @@ export declare const PearlRequestSchema: z.ZodObject<{
61
61
  currentCode?: string | undefined;
62
62
  additionalContext?: string | undefined;
63
63
  }, {
64
- userRequest: string;
65
64
  userName: string;
65
+ userRequest: string;
66
66
  availableVariables: any[];
67
67
  model?: "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-5.1" | "openai/gpt-5.2" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "google/gemini-2.5-flash-image-preview" | "google/gemini-3-pro-preview" | "google/gemini-3-pro-image-preview" | "google/gemini-3-flash-preview" | "anthropic/claude-sonnet-4-5" | "anthropic/claude-opus-4-5" | "anthropic/claude-haiku-4-5" | "openrouter/x-ai/grok-code-fast-1" | "openrouter/z-ai/glm-4.6" | "openrouter/anthropic/claude-sonnet-4.5" | "openrouter/google/gemini-3-pro-preview" | "openrouter/morph/morph-v3-large" | "openrouter/openai/gpt-oss-120b" | undefined;
68
68
  currentCode?: string | undefined;
@@ -62,6 +62,7 @@ export declare const usageSchema: z.ZodObject<{
62
62
  totalCost: number;
63
63
  subService?: string | undefined;
64
64
  }>, "many">;
65
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
65
66
  }, "strip", z.ZodTypeAny, {
66
67
  serviceUsage: {
67
68
  service: import("./types").CredentialType;
@@ -78,6 +79,7 @@ export declare const usageSchema: z.ZodObject<{
78
79
  totalTokens: number;
79
80
  modelName?: string | undefined;
80
81
  }[];
82
+ estimatedMonthlyCost?: number | undefined;
81
83
  }, {
82
84
  serviceUsage: {
83
85
  service: import("./types").CredentialType;
@@ -94,6 +96,7 @@ export declare const usageSchema: z.ZodObject<{
94
96
  totalTokens: number;
95
97
  modelName?: string | undefined;
96
98
  }[];
99
+ estimatedMonthlyCost?: number | undefined;
97
100
  }>;
98
101
  export type Usage = z.infer<typeof usageSchema>;
99
102
  /**
@@ -254,10 +257,10 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
254
257
  totalTokens: number;
255
258
  modelName?: string | undefined;
256
259
  }[];
260
+ estimatedMonthlyCost: number;
257
261
  executionLimit: number;
258
262
  creditLimit: number;
259
263
  activeFlowLimit: number;
260
- estimatedMonthlyCost: number;
261
264
  resetDate: string;
262
265
  }, {
263
266
  serviceUsage: {
@@ -275,10 +278,10 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
275
278
  totalTokens: number;
276
279
  modelName?: string | undefined;
277
280
  }[];
281
+ estimatedMonthlyCost: number;
278
282
  executionLimit: number;
279
283
  creditLimit: number;
280
284
  activeFlowLimit: number;
281
- estimatedMonthlyCost: number;
282
285
  resetDate: string;
283
286
  }>;
284
287
  personalUsage: z.ZodOptional<z.ZodObject<{
@@ -321,6 +324,7 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
321
324
  totalCost: number;
322
325
  subService?: string | undefined;
323
326
  }>, "many">;
327
+ estimatedMonthlyCost: z.ZodOptional<z.ZodNumber>;
324
328
  }, "strip", z.ZodTypeAny, {
325
329
  serviceUsage: {
326
330
  service: import("./types").CredentialType;
@@ -337,6 +341,7 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
337
341
  totalTokens: number;
338
342
  modelName?: string | undefined;
339
343
  }[];
344
+ estimatedMonthlyCost?: number | undefined;
340
345
  }, {
341
346
  serviceUsage: {
342
347
  service: import("./types").CredentialType;
@@ -353,6 +358,7 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
353
358
  totalTokens: number;
354
359
  modelName?: string | undefined;
355
360
  }[];
361
+ estimatedMonthlyCost?: number | undefined;
356
362
  }>>;
357
363
  isActive: z.ZodBoolean;
358
364
  hackathonOffer: z.ZodOptional<z.ZodObject<{
@@ -398,10 +404,10 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
398
404
  totalTokens: number;
399
405
  modelName?: string | undefined;
400
406
  }[];
407
+ estimatedMonthlyCost: number;
401
408
  executionLimit: number;
402
409
  creditLimit: number;
403
410
  activeFlowLimit: number;
404
- estimatedMonthlyCost: number;
405
411
  resetDate: string;
406
412
  };
407
413
  userId: string;
@@ -432,6 +438,7 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
432
438
  totalTokens: number;
433
439
  modelName?: string | undefined;
434
440
  }[];
441
+ estimatedMonthlyCost?: number | undefined;
435
442
  } | undefined;
436
443
  hackathonOffer?: {
437
444
  isActive: boolean;
@@ -460,10 +467,10 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
460
467
  totalTokens: number;
461
468
  modelName?: string | undefined;
462
469
  }[];
470
+ estimatedMonthlyCost: number;
463
471
  executionLimit: number;
464
472
  creditLimit: number;
465
473
  activeFlowLimit: number;
466
- estimatedMonthlyCost: number;
467
474
  resetDate: string;
468
475
  };
469
476
  userId: string;
@@ -494,6 +501,7 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
494
501
  totalTokens: number;
495
502
  modelName?: string | undefined;
496
503
  }[];
504
+ estimatedMonthlyCost?: number | undefined;
497
505
  } | undefined;
498
506
  hackathonOffer?: {
499
507
  isActive: boolean;
@@ -507,4 +515,108 @@ export declare const subscriptionStatusResponseSchema: z.ZodObject<{
507
515
  } | undefined;
508
516
  }>;
509
517
  export type SubscriptionStatusResponse = z.infer<typeof subscriptionStatusResponseSchema>;
518
+ /**
519
+ * User usage item in org usage breakdown (admin/owner only endpoint)
520
+ */
521
+ export declare const userUsageItemSchema: z.ZodObject<{
522
+ userId: z.ZodString;
523
+ userName: z.ZodOptional<z.ZodString>;
524
+ userEmail: z.ZodOptional<z.ZodString>;
525
+ userImageUrl: z.ZodOptional<z.ZodString>;
526
+ role: z.ZodEnum<["owner", "admin", "member"]>;
527
+ executionCount: z.ZodNumber;
528
+ totalCost: z.ZodNumber;
529
+ }, "strip", z.ZodTypeAny, {
530
+ role: "owner" | "admin" | "member";
531
+ totalCost: number;
532
+ userId: string;
533
+ executionCount: number;
534
+ userName?: string | undefined;
535
+ userEmail?: string | undefined;
536
+ userImageUrl?: string | undefined;
537
+ }, {
538
+ role: "owner" | "admin" | "member";
539
+ totalCost: number;
540
+ userId: string;
541
+ executionCount: number;
542
+ userName?: string | undefined;
543
+ userEmail?: string | undefined;
544
+ userImageUrl?: string | undefined;
545
+ }>;
546
+ export type UserUsageItem = z.infer<typeof userUsageItemSchema>;
547
+ /**
548
+ * Organization usage breakdown response (admin/owner only)
549
+ * Response from GET /subscription/org-usage
550
+ */
551
+ export declare const orgUsageBreakdownResponseSchema: z.ZodObject<{
552
+ organizationId: z.ZodNumber;
553
+ organizationName: z.ZodOptional<z.ZodString>;
554
+ monthYear: z.ZodString;
555
+ totalOrgCost: z.ZodNumber;
556
+ totalOrgExecutions: z.ZodNumber;
557
+ users: z.ZodArray<z.ZodObject<{
558
+ userId: z.ZodString;
559
+ userName: z.ZodOptional<z.ZodString>;
560
+ userEmail: z.ZodOptional<z.ZodString>;
561
+ userImageUrl: z.ZodOptional<z.ZodString>;
562
+ role: z.ZodEnum<["owner", "admin", "member"]>;
563
+ executionCount: z.ZodNumber;
564
+ totalCost: z.ZodNumber;
565
+ }, "strip", z.ZodTypeAny, {
566
+ role: "owner" | "admin" | "member";
567
+ totalCost: number;
568
+ userId: string;
569
+ executionCount: number;
570
+ userName?: string | undefined;
571
+ userEmail?: string | undefined;
572
+ userImageUrl?: string | undefined;
573
+ }, {
574
+ role: "owner" | "admin" | "member";
575
+ totalCost: number;
576
+ userId: string;
577
+ executionCount: number;
578
+ userName?: string | undefined;
579
+ userEmail?: string | undefined;
580
+ userImageUrl?: string | undefined;
581
+ }>, "many">;
582
+ }, "strip", z.ZodTypeAny, {
583
+ organizationId: number;
584
+ users: {
585
+ role: "owner" | "admin" | "member";
586
+ totalCost: number;
587
+ userId: string;
588
+ executionCount: number;
589
+ userName?: string | undefined;
590
+ userEmail?: string | undefined;
591
+ userImageUrl?: string | undefined;
592
+ }[];
593
+ monthYear: string;
594
+ totalOrgCost: number;
595
+ totalOrgExecutions: number;
596
+ organizationName?: string | undefined;
597
+ }, {
598
+ organizationId: number;
599
+ users: {
600
+ role: "owner" | "admin" | "member";
601
+ totalCost: number;
602
+ userId: string;
603
+ executionCount: number;
604
+ userName?: string | undefined;
605
+ userEmail?: string | undefined;
606
+ userImageUrl?: string | undefined;
607
+ }[];
608
+ monthYear: string;
609
+ totalOrgCost: number;
610
+ totalOrgExecutions: number;
611
+ organizationName?: string | undefined;
612
+ }>;
613
+ export type OrgUsageBreakdownResponse = z.infer<typeof orgUsageBreakdownResponseSchema>;
614
+ /**
615
+ * Helper to check if user is admin or owner in their org
616
+ */
617
+ export declare function isAdminOrOwner(subscription: SubscriptionStatusResponse): boolean;
618
+ /**
619
+ * Helper to check if user is a regular member
620
+ */
621
+ export declare function isMember(subscription: SubscriptionStatusResponse): boolean;
510
622
  //# sourceMappingURL=subscription-status-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription-status-schema.d.ts","sourceRoot":"","sources":["../src/subscription-status-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAQtC;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAmBL,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaL,CAAC;AAEpB,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAsBL,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAO5E,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAeL,CAAC;AAE7B,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAgBL,CAAC;AAE3B,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,eAAO,MAAM,yBAAyB;;;;;;EAOL,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAeL,CAAC;AAEn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,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BL,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAMF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,0BAA0B,GACvC,OAAO,CAGT;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,YAAY,EAAE,0BAA0B,GAAG,OAAO,CAG1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bubblelab/shared-schemas",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",