@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.
package/dist/index.js CHANGED
@@ -3012,6 +3012,10 @@ var usageSchema = z14.object({
3012
3012
  }),
3013
3013
  serviceUsage: z14.array(ServiceUsageSchema).openapi({
3014
3014
  description: "Service usage and cost breakdown for current month"
3015
+ }),
3016
+ estimatedMonthlyCost: z14.number().optional().openapi({
3017
+ description: "Projected monthly cost based on current usage trend",
3018
+ example: 14.19
3015
3019
  })
3016
3020
  }).openapi("Usage");
3017
3021
  var billingOrganizationSchema = z14.object({
@@ -3152,6 +3156,68 @@ var subscriptionStatusResponseSchema = z14.object({
3152
3156
  description: "Special offer from private metadata (takes precedence over hackathon offer)"
3153
3157
  })
3154
3158
  }).openapi("SubscriptionStatusResponse");
3159
+ var userUsageItemSchema = z14.object({
3160
+ userId: z14.string().openapi({
3161
+ description: "User ID from Clerk",
3162
+ example: "user_30Gbwrzto1VZvAHcGUm5NLQhpkp"
3163
+ }),
3164
+ userName: z14.string().optional().openapi({
3165
+ description: "User display name",
3166
+ example: "John Doe"
3167
+ }),
3168
+ userEmail: z14.string().optional().openapi({
3169
+ description: "User email address",
3170
+ example: "john@acme.com"
3171
+ }),
3172
+ userImageUrl: z14.string().optional().openapi({
3173
+ description: "User profile image URL",
3174
+ example: "https://img.clerk.com/..."
3175
+ }),
3176
+ role: orgRoleSchema.openapi({
3177
+ description: "User's role in the organization"
3178
+ }),
3179
+ executionCount: z14.number().openapi({
3180
+ description: "Number of executions by this user",
3181
+ example: 42
3182
+ }),
3183
+ totalCost: z14.number().openapi({
3184
+ description: "Total cost incurred by this user",
3185
+ example: 5.67
3186
+ })
3187
+ }).openapi("UserUsageItem");
3188
+ var orgUsageBreakdownResponseSchema = z14.object({
3189
+ organizationId: z14.number().openapi({
3190
+ description: "Organization ID",
3191
+ example: 123
3192
+ }),
3193
+ organizationName: z14.string().optional().openapi({
3194
+ description: "Organization name",
3195
+ example: "Acme Inc"
3196
+ }),
3197
+ monthYear: z14.string().openapi({
3198
+ description: "Billing month in YYYY-MM format",
3199
+ example: "2025-01"
3200
+ }),
3201
+ totalOrgCost: z14.number().openapi({
3202
+ description: "Total organization cost for this billing period",
3203
+ example: 45.67
3204
+ }),
3205
+ totalOrgExecutions: z14.number().openapi({
3206
+ description: "Total executions across all users",
3207
+ example: 500
3208
+ }),
3209
+ users: z14.array(userUsageItemSchema).openapi({
3210
+ description: "Usage breakdown by user"
3211
+ })
3212
+ }).openapi("OrgUsageBreakdownResponse");
3213
+ function isAdminOrOwner(subscription) {
3214
+ const role = subscription.organization?.role;
3215
+ return role === "owner" || role === "admin";
3216
+ }
3217
+ function isMember(subscription) {
3218
+ const role = subscription.organization?.role;
3219
+ return role === "member";
3220
+ }
3155
3221
 
3156
3222
  // src/milk-tea.ts
3157
3223
  import { z as z17 } from "zod";
@@ -4385,7 +4451,9 @@ export {
4385
4451
  grantPermissionSchema,
4386
4452
  hackathonOfferSchema,
4387
4453
  hashToVariableId,
4454
+ isAdminOrOwner,
4388
4455
  isBrowserSessionCredential,
4456
+ isMember,
4389
4457
  isOAuthCredential,
4390
4458
  isServiceTrigger,
4391
4459
  isValidBubbleTriggerEvent,
@@ -4404,6 +4472,7 @@ export {
4404
4472
  oauthTokenRefreshResponseSchema,
4405
4473
  orgRoleSchema,
4406
4474
  orgTypeSchema,
4475
+ orgUsageBreakdownResponseSchema,
4407
4476
  organizationDetailSchema,
4408
4477
  organizationMemberSchema,
4409
4478
  organizationSchema,
@@ -4436,6 +4505,7 @@ export {
4436
4505
  updatePermissionSchema,
4437
4506
  usageSchema,
4438
4507
  usedCredentialSchema,
4508
+ userUsageItemSchema,
4439
4509
  validateBubbleFlowCodeResponseSchema,
4440
4510
  validateBubbleFlowCodeSchema,
4441
4511
  validateCronExpression,