@supernova-studio/model 0.23.0 → 0.25.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/index.mjs CHANGED
@@ -36,45 +36,72 @@ var PostStripeCheckoutOutputSchema = z3.object({
36
36
  });
37
37
 
38
38
  // src/billing/customer.ts
39
- import { z as z4 } from "zod";
40
- var Customer = z4.object({
41
- id: z4.string()
42
- });
43
- var Address = z4.object({
44
- street1: z4.string().optional(),
45
- street2: z4.string().optional(),
46
- city: z4.string().optional(),
47
- postal: z4.string().optional(),
48
- country: z4.string().optional(),
49
- state: z4.string().optional()
50
- });
51
- var BillingDetails = z4.object({
52
- address: Address.optional(),
53
- email: z4.string().optional(),
54
- companyName: z4.string().optional(),
55
- companyId: z4.string().optional(),
56
- notes: z4.string().optional(),
57
- vat: z4.string().optional(),
58
- poNumber: z4.string().optional()
39
+ import { z as z5 } from "zod";
40
+
41
+ // src/helpers/db.ts
42
+ import {
43
+ z as z4
44
+ } from "zod";
45
+ function zodCreateInputOmit() {
46
+ return {
47
+ id: true,
48
+ createdAt: true,
49
+ updatedAt: true
50
+ };
51
+ }
52
+ function zodUpdateInputOmit() {
53
+ return {
54
+ id: true,
55
+ createdAt: true,
56
+ updatedAt: true,
57
+ persistentId: true
58
+ };
59
+ }
60
+
61
+ // src/helpers/nullish-to-optional.ts
62
+ function nullishToOptional(type) {
63
+ return type.nullish().transform((t) => t ?? void 0);
64
+ }
65
+
66
+ // src/billing/customer.ts
67
+ var Customer = z5.object({
68
+ id: z5.string()
69
+ });
70
+ var Address = z5.object({
71
+ street1: nullishToOptional(z5.string()),
72
+ street2: nullishToOptional(z5.string()),
73
+ city: nullishToOptional(z5.string()),
74
+ postal: nullishToOptional(z5.string()),
75
+ country: nullishToOptional(z5.string()),
76
+ state: nullishToOptional(z5.string())
77
+ });
78
+ var BillingDetails = z5.object({
79
+ address: nullishToOptional(Address),
80
+ email: nullishToOptional(z5.string()),
81
+ companyName: nullishToOptional(z5.string()),
82
+ companyId: nullishToOptional(z5.string()),
83
+ notes: nullishToOptional(z5.string()),
84
+ vat: nullishToOptional(z5.string()),
85
+ poNumber: nullishToOptional(z5.string())
59
86
  });
60
87
 
61
88
  // src/billing/features.ts
62
- import { z as z5 } from "zod";
63
- var featureLimitedSchema = z5.object({
64
- max: z5.number(),
65
- errorMessage: z5.string(),
66
- errorReason: z5.string()
89
+ import { z as z6 } from "zod";
90
+ var featureLimitedSchema = z6.object({
91
+ max: z6.number(),
92
+ errorMessage: z6.string(),
93
+ errorReason: z6.string()
67
94
  });
68
- var featureToggleSchema = z5.object({
69
- enabled: z5.boolean(),
70
- errorMessage: z5.string(),
71
- errorReason: z5.string()
95
+ var featureToggleSchema = z6.object({
96
+ enabled: z6.boolean(),
97
+ errorMessage: z6.string(),
98
+ errorReason: z6.string()
72
99
  });
73
100
  var featureWithImportJobsSchema = featureLimitedSchema.extend({
74
- noImportJobsErrorMessage: z5.string(),
75
- noImportJobsErrorReason: z5.string()
101
+ noImportJobsErrorMessage: z6.string(),
102
+ noImportJobsErrorReason: z6.string()
76
103
  });
77
- var FeaturesSummary = z5.object({
104
+ var FeaturesSummary = z6.object({
78
105
  designSystems: featureLimitedSchema,
79
106
  designSystemSources: featureWithImportJobsSchema,
80
107
  designSystemVersions: featureLimitedSchema,
@@ -95,77 +122,77 @@ var FeaturesSummary = z5.object({
95
122
  });
96
123
 
97
124
  // src/billing/invoice.ts
98
- import { z as z6 } from "zod";
99
- var InvoiceSchema = z6.object({
100
- id: z6.string(),
101
- number: z6.string(),
102
- amount_due: z6.number(),
103
- date: z6.coerce.date(),
104
- hostedUrl: z6.string().url(),
125
+ import { z as z7 } from "zod";
126
+ var InvoiceSchema = z7.object({
127
+ id: z7.string(),
128
+ number: z7.string(),
129
+ amount_due: z7.number(),
130
+ date: z7.coerce.date(),
131
+ hostedUrl: z7.string().url(),
105
132
  card: CardSchema.nullish()
106
133
  });
107
- var PeriodSchema = z6.object({
108
- start: z6.coerce.date(),
109
- end: z6.coerce.date()
134
+ var PeriodSchema = z7.object({
135
+ start: z7.coerce.date(),
136
+ end: z7.coerce.date()
110
137
  });
111
- var InvoiceLineSchema = z6.object({
112
- amount: z6.number(),
138
+ var InvoiceLineSchema = z7.object({
139
+ amount: z7.number(),
113
140
  period: PeriodSchema,
114
- proration: z6.boolean(),
115
- description: z6.string(),
116
- type: z6.string()
141
+ proration: z7.boolean(),
142
+ description: z7.string(),
143
+ type: z7.string()
117
144
  });
118
- var InvoiceCouponSchema = z6.object({
119
- amount_off: z6.number(),
120
- percent_off: z6.number(),
121
- name: z6.string()
145
+ var InvoiceCouponSchema = z7.object({
146
+ amount_off: z7.number(),
147
+ percent_off: z7.number(),
148
+ name: z7.string()
122
149
  });
123
150
 
124
151
  // src/billing/portalSession.ts
125
- import { z as z7 } from "zod";
126
- var PostStripePortalUpdateSessionBodyInputSchema = z7.object({
127
- priceId: z7.string(),
128
- numberOfSeats: z7.number().int()
152
+ import { z as z8 } from "zod";
153
+ var PostStripePortalUpdateSessionBodyInputSchema = z8.object({
154
+ priceId: z8.string(),
155
+ numberOfSeats: z8.number().int()
129
156
  });
130
- var PostStripePortalSessionBodyInputSchema = z7.object({
131
- returnUrl: z7.string().url(),
157
+ var PostStripePortalSessionBodyInputSchema = z8.object({
158
+ returnUrl: z8.string().url(),
132
159
  update: PostStripePortalUpdateSessionBodyInputSchema.optional(),
133
- cancel: z7.boolean().optional()
160
+ cancel: z8.boolean().optional()
134
161
  });
135
- var PostStripePortalSessionOutputSchema = z7.object({
136
- id: z7.string(),
137
- url: z7.string().nullish()
162
+ var PostStripePortalSessionOutputSchema = z8.object({
163
+ id: z8.string(),
164
+ url: z8.string().nullish()
138
165
  });
139
166
 
140
167
  // src/billing/price.ts
141
- import { z as z8 } from "zod";
142
- var BillingIntervalSchema = z8.enum(["daily", "monthly", "weekly", "yearly"]);
143
- var PriceSchema = z8.object({
144
- stripePriceId: z8.string(),
145
- stripeProductId: z8.string(),
146
- stripeProductName: z8.string().optional(),
147
- stripeProductDescription: z8.string().optional(),
148
- active: z8.boolean(),
149
- amount: z8.number(),
168
+ import { z as z9 } from "zod";
169
+ var BillingIntervalSchema = z9.enum(["daily", "monthly", "weekly", "yearly"]);
170
+ var PriceSchema = z9.object({
171
+ stripePriceId: z9.string(),
172
+ stripeProductId: z9.string(),
173
+ stripeProductName: z9.string().optional(),
174
+ stripeProductDescription: z9.string().optional(),
175
+ active: z9.boolean(),
176
+ amount: z9.number(),
150
177
  interval: BillingIntervalSchema,
151
- isPricePerCreator: z8.boolean().optional(),
152
- isTrial: z8.boolean().optional(),
153
- isHidden: z8.boolean().optional(),
154
- minimumSeats: z8.number().optional(),
155
- legacyVersion: z8.string().optional(),
156
- featuresSet: z8.string().optional(),
157
- stripeProductFeatures: z8.array(z8.string()).optional(),
158
- stripeProductAdditionalFeatures: z8.array(z8.string()).optional()
178
+ isPricePerCreator: z9.boolean().optional(),
179
+ isTrial: z9.boolean().optional(),
180
+ isHidden: z9.boolean().optional(),
181
+ minimumSeats: z9.number().optional(),
182
+ legacyVersion: z9.string().optional(),
183
+ featuresSet: z9.string().optional(),
184
+ stripeProductFeatures: z9.array(z9.string()).optional(),
185
+ stripeProductAdditionalFeatures: z9.array(z9.string()).optional()
159
186
  });
160
187
 
161
188
  // src/billing/product.ts
162
- import { z as z9 } from "zod";
163
- var ProductCodeSchema = z9.enum(["free", "team", "team_test", "company", "enterprise"]);
189
+ import { z as z10 } from "zod";
190
+ var ProductCodeSchema = z10.enum(["free", "team", "team_test", "company", "enterprise"]);
164
191
  var ProductCode = ProductCodeSchema.enum;
165
192
 
166
193
  // src/billing/subscription.ts
167
- import { z as z10 } from "zod";
168
- var StripeSubscriptionStatusSchema = z10.enum([
194
+ import { z as z11 } from "zod";
195
+ var StripeSubscriptionStatusSchema = z11.enum([
169
196
  "trialing",
170
197
  "active",
171
198
  "past_due",
@@ -175,14 +202,14 @@ var StripeSubscriptionStatusSchema = z10.enum([
175
202
  "incomplete",
176
203
  "unknown"
177
204
  ]);
178
- var InternalStatusSchema = z10.enum(["active", "suspended", "gracePeriod", "cancelled", "downgraded_to_free"]);
179
- var BillingTypeSchema = z10.enum(["Auto", "Invoice"]);
205
+ var InternalStatusSchema = z11.enum(["active", "suspended", "gracePeriod", "cancelled", "downgraded_to_free"]);
206
+ var BillingTypeSchema = z11.enum(["Auto", "Invoice"]);
180
207
  var StripeSubscriptionStatus = StripeSubscriptionStatusSchema.enum;
181
208
  var InternalStatus = InternalStatusSchema.enum;
182
209
  var BillingType = BillingTypeSchema.enum;
183
- var Subscription = z10.object({
184
- stripeSubscriptionId: z10.string().nullish(),
185
- stripeCustomerId: z10.string().nullish(),
210
+ var Subscription = z11.object({
211
+ stripeSubscriptionId: z11.string().nullish(),
212
+ stripeCustomerId: z11.string().nullish(),
186
213
  status: InternalStatusSchema.optional(),
187
214
  subscriptionStatus: StripeSubscriptionStatusSchema.optional(),
188
215
  // the stripe API official status
@@ -190,178 +217,178 @@ var Subscription = z10.object({
190
217
  // TODO: delete when create/get workspace will stop using it in the former API
191
218
  product: ProductCodeSchema,
192
219
  featuresSummary: FeaturesSummary.optional(),
193
- stripeProductDescription: z10.string().optional(),
194
- stripeProductFeatures: z10.array(z10.string()).optional(),
195
- stripeProductAdditionalFeatures: z10.array(z10.string()).optional(),
196
- stripeSubscriptionMainItemId: z10.string().optional(),
197
- planPriceId: z10.string(),
220
+ stripeProductDescription: z11.string().optional(),
221
+ stripeProductFeatures: z11.array(z11.string()).optional(),
222
+ stripeProductAdditionalFeatures: z11.array(z11.string()).optional(),
223
+ stripeSubscriptionMainItemId: z11.string().optional(),
224
+ planPriceId: z11.string(),
198
225
  planInterval: BillingIntervalSchema,
199
- isPricePerCreator: z10.boolean().optional(),
200
- legacyVersion: z10.string().optional(),
201
- seats: z10.number(),
202
- seatLimit: z10.number(),
203
- currentPeriodStart: z10.string().optional(),
204
- currentPeriodEnd: z10.string().optional(),
205
- subscriptionStatusUpdatedAt: z10.string().optional(),
206
- cancelAt: z10.string().nullish(),
226
+ isPricePerCreator: z11.boolean().optional(),
227
+ legacyVersion: z11.string().optional(),
228
+ seats: z11.number(),
229
+ seatLimit: z11.number(),
230
+ currentPeriodStart: z11.string().optional(),
231
+ currentPeriodEnd: z11.string().optional(),
232
+ subscriptionStatusUpdatedAt: z11.string().optional(),
233
+ cancelAt: z11.string().nullish(),
207
234
  card: CardSchema.optional(),
208
235
  // New
209
- amount: z10.number().nullish(),
210
- isTrial: z10.boolean().optional(),
236
+ amount: z11.number().nullish(),
237
+ isTrial: z11.boolean().optional(),
211
238
  billingType: BillingTypeSchema.optional(),
212
- daysUntilDue: z10.number().optional()
239
+ daysUntilDue: z11.number().optional()
213
240
  });
214
241
 
215
242
  // src/dsm/assets/asset-reference.ts
216
- import { z as z11 } from "zod";
217
- var AssetReference = z11.object({
218
- id: z11.string(),
219
- designSystemVersionId: z11.string(),
220
- assetId: z11.string(),
221
- persistentId: z11.string()
243
+ import { z as z12 } from "zod";
244
+ var AssetReference = z12.object({
245
+ id: z12.string(),
246
+ designSystemVersionId: z12.string(),
247
+ assetId: z12.string(),
248
+ persistentId: z12.string()
222
249
  });
223
250
 
224
251
  // src/dsm/assets/asset-value.ts
225
- import { z as z12 } from "zod";
226
- var AssetValue = z12.object({});
252
+ import { z as z13 } from "zod";
253
+ var AssetValue = z13.object({});
227
254
 
228
255
  // src/dsm/assets/asset.ts
229
- import { z as z13 } from "zod";
230
- var AssetType = z13.enum(["Image", "Font"]);
231
- var AssetScope = z13.enum(["DocumentationFrame", "ComponentThumbnail", "DesignSystem", "Documentation"]);
232
- var AssetFontProperties = z13.object({
233
- family: z13.string(),
234
- subfamily: z13.string()
256
+ import { z as z14 } from "zod";
257
+ var AssetType = z14.enum(["Image", "Font"]);
258
+ var AssetScope = z14.enum(["DocumentationFrame", "ComponentThumbnail", "DesignSystem", "Documentation"]);
259
+ var AssetFontProperties = z14.object({
260
+ family: z14.string(),
261
+ subfamily: z14.string()
235
262
  });
236
- var AssetProperties = z13.object({
237
- fontProperties: z13.array(AssetFontProperties)
263
+ var AssetProperties = z14.object({
264
+ fontProperties: z14.array(AssetFontProperties)
238
265
  });
239
- var AssetOrigin = z13.object({
240
- originKey: z13.string()
266
+ var AssetOrigin = z14.object({
267
+ originKey: z14.string()
241
268
  });
242
- var Asset = z13.object({
243
- id: z13.string(),
244
- designSystemId: z13.string().nullish(),
269
+ var Asset = z14.object({
270
+ id: z14.string(),
271
+ designSystemId: z14.string().nullish(),
245
272
  type: AssetType,
246
- originalFileName: z13.string().nullish(),
247
- filePath: z13.string(),
273
+ originalFileName: z14.string().nullish(),
274
+ filePath: z14.string(),
248
275
  scope: AssetScope,
249
276
  properties: AssetProperties.nullish(),
250
277
  origin: AssetOrigin.optional(),
251
- originKey: z13.string().optional()
278
+ originKey: z14.string().optional()
252
279
  });
253
280
  function isImportedAsset(asset) {
254
281
  return !!asset.originKey;
255
282
  }
256
283
 
257
284
  // src/dsm/data-sources/data-source.ts
258
- import { z as z14 } from "zod";
259
- var DataSourceRemoteType = z14.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
260
- var DataSourceUploadRemoteSource = z14.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
261
- var DataSourceFigmaState = z14.enum(["Active", "MissingIntegration", "MissingFileAccess", "MissingFileOwner"]);
262
- var DataSourceAutoImportMode = z14.enum(["Never", "Hourly"]);
263
- var DataSourceStats = z14.object({
285
+ import { z as z15 } from "zod";
286
+ var DataSourceRemoteType = z15.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
287
+ var DataSourceUploadRemoteSource = z15.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
288
+ var DataSourceFigmaState = z15.enum(["Active", "MissingIntegration", "MissingFileAccess", "MissingFileOwner"]);
289
+ var DataSourceAutoImportMode = z15.enum(["Never", "Hourly"]);
290
+ var DataSourceStats = z15.object({
264
291
  tokens: zeroNumberByDefault(),
265
292
  components: zeroNumberByDefault(),
266
293
  assets: zeroNumberByDefault(),
267
294
  frames: zeroNumberByDefault()
268
295
  });
269
- var DataSourceFigmaFileData = z14.object({
270
- lastUpdatedAt: z14.coerce.date()
296
+ var DataSourceFigmaFileData = z15.object({
297
+ lastUpdatedAt: z15.coerce.date()
271
298
  });
272
- var DataSourceFigmaFileVersionData = z14.object({
273
- id: z14.string(),
274
- label: z14.string().optional(),
275
- description: z14.string().optional(),
276
- createdAt: z14.coerce.date()
277
- });
278
- var DataSourceFigmaScope = z14.object({
279
- assets: z14.boolean(),
280
- components: z14.boolean(),
281
- documentationFrames: z14.boolean(),
282
- tokens: z14.boolean(),
283
- themePersistentId: z14.string().optional()
284
- });
285
- var DataSourceFigmaImportMetadata = z14.object({
299
+ var DataSourceFigmaFileVersionData = z15.object({
300
+ id: z15.string(),
301
+ label: z15.string().optional(),
302
+ description: z15.string().optional(),
303
+ createdAt: z15.coerce.date()
304
+ });
305
+ var DataSourceFigmaScope = z15.object({
306
+ assets: z15.boolean(),
307
+ components: z15.boolean(),
308
+ documentationFrames: z15.boolean(),
309
+ tokens: z15.boolean(),
310
+ themePersistentId: z15.string().optional()
311
+ });
312
+ var DataSourceFigmaImportMetadata = z15.object({
286
313
  fileData: DataSourceFigmaFileData.optional(),
287
314
  importedPublishedVersion: DataSourceFigmaFileVersionData.optional()
288
315
  });
289
- var DataSourceFigmaRemote = z14.object({
290
- type: z14.literal(DataSourceRemoteType.Enum.Figma),
291
- fileId: z14.string(),
292
- ownerId: z14.string(),
293
- ownerName: z14.string(),
316
+ var DataSourceFigmaRemote = z15.object({
317
+ type: z15.literal(DataSourceRemoteType.Enum.Figma),
318
+ fileId: z15.string(),
319
+ ownerId: z15.string(),
320
+ ownerName: z15.string(),
294
321
  scope: DataSourceFigmaScope,
295
322
  state: DataSourceFigmaState,
296
323
  lastImportMetadata: DataSourceFigmaImportMetadata.optional(),
297
- downloadChunkSize: z14.number().optional(),
298
- figmaRenderChunkSize: z14.number().optional()
324
+ downloadChunkSize: z15.number().optional(),
325
+ figmaRenderChunkSize: z15.number().optional()
299
326
  });
300
- var DataSourceTokenStudioRemote = z14.object({
301
- type: z14.literal(DataSourceRemoteType.Enum.TokenStudio)
327
+ var DataSourceTokenStudioRemote = z15.object({
328
+ type: z15.literal(DataSourceRemoteType.Enum.TokenStudio)
302
329
  });
303
- var DataSourceUploadImportMetadata = z14.record(z14.any());
304
- var DataSourceUploadRemote = z14.object({
305
- type: z14.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
306
- remoteId: z14.string(),
330
+ var DataSourceUploadImportMetadata = z15.record(z15.any());
331
+ var DataSourceUploadRemote = z15.object({
332
+ type: z15.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
333
+ remoteId: z15.string(),
307
334
  remoteSourceType: DataSourceUploadRemoteSource,
308
335
  lastImportMetadata: DataSourceUploadImportMetadata.optional()
309
336
  });
310
- var DataSourceRemote = z14.discriminatedUnion("type", [
337
+ var DataSourceRemote = z15.discriminatedUnion("type", [
311
338
  DataSourceFigmaRemote,
312
339
  DataSourceUploadRemote,
313
340
  DataSourceTokenStudioRemote
314
341
  ]);
315
- var DataSourceVersion = z14.object({
316
- id: z14.string(),
317
- createdAt: z14.coerce.date(),
318
- label: z14.string().nullish(),
319
- description: z14.string().nullish()
342
+ var DataSourceVersion = z15.object({
343
+ id: z15.string(),
344
+ createdAt: z15.coerce.date(),
345
+ label: z15.string().nullish(),
346
+ description: z15.string().nullish()
320
347
  });
321
348
  function zeroNumberByDefault() {
322
- return z14.number().nullish().transform((v) => v ?? 0);
349
+ return z15.number().nullish().transform((v) => v ?? 0);
323
350
  }
324
351
 
325
352
  // src/dsm/data-sources/import-job.ts
326
- import { z as z17 } from "zod";
353
+ import { z as z18 } from "zod";
327
354
 
328
355
  // src/common/entity.ts
329
- import { z as z15 } from "zod";
330
- var Entity = z15.object({
331
- id: z15.string(),
332
- createdAt: z15.coerce.date(),
333
- updatedAt: z15.coerce.date()
356
+ import { z as z16 } from "zod";
357
+ var Entity = z16.object({
358
+ id: z16.string(),
359
+ createdAt: z16.coerce.date(),
360
+ updatedAt: z16.coerce.date()
334
361
  });
335
362
 
336
363
  // src/common/object-meta.ts
337
- import { z as z16 } from "zod";
338
- var ObjectMeta = z16.object({
339
- name: z16.string(),
340
- description: z16.string().optional()
364
+ import { z as z17 } from "zod";
365
+ var ObjectMeta = z17.object({
366
+ name: z17.string(),
367
+ description: z17.string().optional()
341
368
  });
342
369
 
343
370
  // src/dsm/data-sources/import-job.ts
344
- var ImportJobState = z17.enum(["PendingInput", "Queued", "InProgress", "Failed", "Success"]);
345
- var ImportJobOperation = z17.enum(["Check", "Import"]);
371
+ var ImportJobState = z18.enum(["PendingInput", "Queued", "InProgress", "Failed", "Success"]);
372
+ var ImportJobOperation = z18.enum(["Check", "Import"]);
346
373
  var ImportJob = Entity.extend({
347
- designSystemId: z17.string(),
348
- designSystemVersionId: z17.string(),
349
- sourceIds: z17.array(z17.string()),
374
+ designSystemId: z18.string(),
375
+ designSystemVersionId: z18.string(),
376
+ sourceIds: z18.array(z18.string()),
350
377
  state: ImportJobState,
351
- createdByUserId: z17.string().optional(),
352
- importContextId: z17.string(),
353
- error: z17.string().optional(),
378
+ createdByUserId: z18.string().optional(),
379
+ importContextId: z18.string(),
380
+ error: z18.string().optional(),
354
381
  sourceType: DataSourceRemoteType,
355
- importContextCleanedUp: z17.boolean()
382
+ importContextCleanedUp: z18.boolean()
356
383
  });
357
384
 
358
385
  // src/dsm/data-sources/import-summary.ts
359
386
  import { z as z87 } from "zod";
360
387
 
361
388
  // src/dsm/elements/data/base.ts
362
- import { z as z18 } from "zod";
363
- var TokenDataAliasSchema = z18.object({
364
- aliasTo: z18.string().optional().nullable().transform((v) => v ?? void 0)
389
+ import { z as z19 } from "zod";
390
+ var TokenDataAliasSchema = z19.object({
391
+ aliasTo: z19.string().optional().nullable().transform((v) => v ?? void 0)
365
392
  });
366
393
  function tokenAliasOrValue(value) {
367
394
  return TokenDataAliasSchema.extend({
@@ -370,68 +397,68 @@ function tokenAliasOrValue(value) {
370
397
  }
371
398
 
372
399
  // src/dsm/elements/data/blur.ts
373
- import { z as z20 } from "zod";
400
+ import { z as z21 } from "zod";
374
401
 
375
402
  // src/dsm/elements/data/dimension.ts
376
- import { z as z19 } from "zod";
377
- var DimensionUnit = z19.enum(["Pixels", "Percent", "Rem", "Ms", "Raw", "Points"]);
378
- var DimensionValue = z19.object({
403
+ import { z as z20 } from "zod";
404
+ var DimensionUnit = z20.enum(["Pixels", "Percent", "Rem", "Ms", "Raw", "Points"]);
405
+ var DimensionValue = z20.object({
379
406
  unit: DimensionUnit,
380
- measure: z19.number()
407
+ measure: z20.number()
381
408
  });
382
409
  var DimensionTokenData = tokenAliasOrValue(DimensionValue);
383
410
 
384
411
  // src/dsm/elements/data/blur.ts
385
- var BlurType = z20.enum(["Layer", "Background"]);
386
- var BlurValue = z20.object({
412
+ var BlurType = z21.enum(["Layer", "Background"]);
413
+ var BlurValue = z21.object({
387
414
  type: BlurType,
388
415
  radius: DimensionTokenData
389
416
  });
390
417
  var BlurTokenData = tokenAliasOrValue(BlurValue);
391
418
 
392
419
  // src/dsm/elements/data/border-radius.ts
393
- import { z as z21 } from "zod";
394
- var BorderRadiusUnit = z21.enum(["Pixels", "Rem", "Percent"]);
395
- var BorderRadiusValue = z21.object({
420
+ import { z as z22 } from "zod";
421
+ var BorderRadiusUnit = z22.enum(["Pixels", "Rem", "Percent"]);
422
+ var BorderRadiusValue = z22.object({
396
423
  unit: BorderRadiusUnit,
397
- measure: z21.number()
424
+ measure: z22.number()
398
425
  });
399
426
  var BorderRadiusTokenData = tokenAliasOrValue(BorderRadiusValue);
400
427
 
401
428
  // src/dsm/elements/data/border-width.ts
402
- import { z as z22 } from "zod";
403
- var BorderWidthUnit = z22.enum(["Pixels"]);
404
- var BorderWidthValue = z22.object({
429
+ import { z as z23 } from "zod";
430
+ var BorderWidthUnit = z23.enum(["Pixels"]);
431
+ var BorderWidthValue = z23.object({
405
432
  unit: BorderWidthUnit,
406
- measure: z22.number()
433
+ measure: z23.number()
407
434
  });
408
435
  var BorderWidthTokenData = tokenAliasOrValue(BorderWidthValue);
409
436
 
410
437
  // src/dsm/elements/data/border.ts
411
- import { z as z25 } from "zod";
438
+ import { z as z26 } from "zod";
412
439
 
413
440
  // src/dsm/elements/data/color.ts
414
- import { z as z24 } from "zod";
441
+ import { z as z25 } from "zod";
415
442
 
416
443
  // src/dsm/elements/data/opacity.ts
417
- import { z as z23 } from "zod";
418
- var OpacityValue = z23.object({
419
- unit: z23.enum(["Raw", "Pixels"]),
420
- measure: z23.number()
444
+ import { z as z24 } from "zod";
445
+ var OpacityValue = z24.object({
446
+ unit: z24.enum(["Raw", "Pixels"]),
447
+ measure: z24.number()
421
448
  });
422
449
  var OpacityTokenData = tokenAliasOrValue(OpacityValue);
423
450
 
424
451
  // src/dsm/elements/data/color.ts
425
- var ColorValue = z24.object({
452
+ var ColorValue = z25.object({
426
453
  opacity: OpacityTokenData,
427
- color: z24.string().or(TokenDataAliasSchema)
454
+ color: z25.string().or(TokenDataAliasSchema)
428
455
  });
429
456
  var ColorTokenData = tokenAliasOrValue(ColorValue);
430
457
 
431
458
  // src/dsm/elements/data/border.ts
432
- var BorderPosition = z25.enum(["Inside", "Center", "Outside"]);
433
- var BorderStyle = z25.enum(["Dashed", "Dotted", "Solid", "Groove"]);
434
- var BorderValue = z25.object({
459
+ var BorderPosition = z26.enum(["Inside", "Center", "Outside"]);
460
+ var BorderStyle = z26.enum(["Dashed", "Dotted", "Solid", "Groove"]);
461
+ var BorderValue = z26.object({
435
462
  color: ColorTokenData,
436
463
  width: BorderWidthTokenData,
437
464
  position: BorderPosition,
@@ -440,19 +467,19 @@ var BorderValue = z25.object({
440
467
  var BorderTokenData = tokenAliasOrValue(BorderValue);
441
468
 
442
469
  // src/dsm/elements/data/component.ts
443
- import { z as z26 } from "zod";
444
- var ComponentElementData = z26.object({
445
- value: z26.object({
446
- thumbnailImage: z26.object({
447
- value: z26.object({
448
- url: z26.string(),
449
- assetId: z26.string()
470
+ import { z as z27 } from "zod";
471
+ var ComponentElementData = z27.object({
472
+ value: z27.object({
473
+ thumbnailImage: z27.object({
474
+ value: z27.object({
475
+ url: z27.string(),
476
+ assetId: z27.string()
450
477
  })
451
478
  }),
452
- svg: z26.object({
453
- value: z26.object({
454
- url: z26.string(),
455
- assetId: z26.string()
479
+ svg: z27.object({
480
+ value: z27.object({
481
+ url: z27.string(),
482
+ assetId: z27.string()
456
483
  })
457
484
  }).optional()
458
485
  })
@@ -462,8 +489,8 @@ var ComponentElementData = z26.object({
462
489
  import { z as z33 } from "zod";
463
490
 
464
491
  // src/dsm/elements/raw-element.ts
465
- import { z as z27 } from "zod";
466
- var DesignTokenType = z27.enum([
492
+ import { z as z28 } from "zod";
493
+ var DesignTokenType = z28.enum([
467
494
  "Color",
468
495
  "Border",
469
496
  "Gradient",
@@ -495,7 +522,7 @@ var DesignTokenType = z27.enum([
495
522
  ]);
496
523
  var tokenElementTypes = [...DesignTokenType.options.filter((v) => v !== "Font")];
497
524
  var DesignElementType = DesignTokenType.or(
498
- z27.enum([
525
+ z28.enum([
499
526
  "Component",
500
527
  "Theme",
501
528
  "Documentation",
@@ -510,7 +537,7 @@ var DesignElementType = DesignTokenType.or(
510
537
  function isTokenType(type) {
511
538
  return DesignTokenType.safeParse(type).success;
512
539
  }
513
- var DesignElementCategory = z27.enum([
540
+ var DesignElementCategory = z28.enum([
514
541
  "Token",
515
542
  "Component",
516
543
  "DesignSystemComponent",
@@ -518,92 +545,92 @@ var DesignElementCategory = z27.enum([
518
545
  "Theme",
519
546
  "PageBlock"
520
547
  ]);
521
- var DesignSystemElementExportProps = z27.object({
522
- isAsset: z27.boolean().nullish().transform((v) => v ?? false),
523
- codeName: z27.string().nullish()
524
- });
525
- var ShallowDesignElement = z27.object({
526
- id: z27.string(),
527
- persistentId: z27.string(),
528
- designSystemVersionId: z27.string(),
548
+ var DesignSystemElementExportProps = z28.object({
549
+ isAsset: z28.boolean().nullish().transform((v) => v ?? false),
550
+ codeName: z28.string().nullish()
551
+ });
552
+ var ShallowDesignElement = z28.object({
553
+ id: z28.string(),
554
+ persistentId: z28.string(),
555
+ designSystemVersionId: z28.string(),
529
556
  type: DesignElementType,
530
- brandPersistentId: z27.string().optional(),
531
- parentPersistentId: z27.string().optional(),
532
- shortPersistentId: z27.string().optional(),
557
+ brandPersistentId: z28.string().optional(),
558
+ parentPersistentId: z28.string().optional(),
559
+ shortPersistentId: z28.string().optional(),
533
560
  childType: DesignElementType.optional(),
534
- sortOrder: z27.number(),
535
- origin: z27.record(z27.any()).optional()
561
+ sortOrder: z28.number(),
562
+ origin: z28.record(z28.any()).optional()
536
563
  });
537
564
  var DesignElement = ShallowDesignElement.extend({
538
565
  meta: ObjectMeta,
539
- slug: z27.string().optional(),
540
- userSlug: z27.string().optional(),
541
- createdAt: z27.coerce.date(),
542
- updatedAt: z27.coerce.date(),
566
+ slug: z28.string().optional(),
567
+ userSlug: z28.string().optional(),
568
+ createdAt: z28.coerce.date(),
569
+ updatedAt: z28.coerce.date(),
543
570
  exportProperties: DesignSystemElementExportProps.optional(),
544
- data: z27.record(z27.any()),
545
- origin: z27.record(z27.any()).optional()
571
+ data: z28.record(z28.any()),
572
+ origin: z28.record(z28.any()).optional()
546
573
  });
547
574
  var HierarchicalElements = DesignTokenType.or(
548
- z27.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
575
+ z28.enum(["Component", "DesignSystemComponent", "DocumentationPage"])
549
576
  );
550
577
 
551
578
  // src/dsm/properties/property-definition.ts
552
- import { z as z28 } from "zod";
553
- var ElementPropertyType = z28.enum(["Text", "Number", "Boolean", "Select", "Generic", "Link", "URL"]);
554
- var ElementPropertyTargetType = z28.enum(["Token", "Component", "DocumentationPage"]);
555
- var ElementPropertyLinkType = z28.enum(["FigmaComponent", "DocumentationPage"]);
556
- var ColorTokenInlineData = z28.object({
557
- value: z28.string()
579
+ import { z as z29 } from "zod";
580
+ var ElementPropertyType = z29.enum(["Text", "Number", "Boolean", "Select", "Generic", "Link", "URL"]);
581
+ var ElementPropertyTargetType = z29.enum(["Token", "Component", "DocumentationPage"]);
582
+ var ElementPropertyLinkType = z29.enum(["FigmaComponent", "DocumentationPage"]);
583
+ var ColorTokenInlineData = z29.object({
584
+ value: z29.string()
558
585
  });
559
- var ElementPropertyDefinitionOption = z28.object({
560
- id: z28.string(),
561
- name: z28.string(),
586
+ var ElementPropertyDefinitionOption = z29.object({
587
+ id: z29.string(),
588
+ name: z29.string(),
562
589
  backgroundColor: ColorTokenInlineData.optional()
563
590
  });
564
- var ElementPropertyDefinition = z28.object({
565
- id: z28.string(),
566
- designSystemVersionId: z28.string(),
567
- persistentId: z28.string(),
568
- name: z28.string(),
569
- codeName: z28.string(),
570
- description: z28.string(),
591
+ var ElementPropertyDefinition = z29.object({
592
+ id: z29.string(),
593
+ designSystemVersionId: z29.string(),
594
+ persistentId: z29.string(),
595
+ name: z29.string(),
596
+ codeName: z29.string(),
597
+ description: z29.string(),
571
598
  type: ElementPropertyType,
572
599
  targetElementType: ElementPropertyTargetType,
573
- options: z28.array(ElementPropertyDefinitionOption).nullish(),
600
+ options: z29.array(ElementPropertyDefinitionOption).nullish(),
574
601
  linkElementType: ElementPropertyLinkType.nullish()
575
602
  });
576
603
 
577
604
  // src/dsm/properties/property-value.ts
578
- import { z as z29 } from "zod";
579
- var ElementPropertyValue = z29.object({
580
- id: z29.string(),
581
- designSystemVersionId: z29.string(),
582
- targetElementPersistentId: z29.string(),
583
- definitionPersistentId: z29.string(),
584
- stringValue: z29.string().nullish(),
585
- numberValue: z29.number().nullish(),
586
- booleanValue: z29.boolean().nullish(),
587
- referenceValue: z29.string().nullish(),
588
- referenceValuePreview: z29.string().nullish()
605
+ import { z as z30 } from "zod";
606
+ var ElementPropertyValue = z30.object({
607
+ id: z30.string(),
608
+ designSystemVersionId: z30.string(),
609
+ targetElementPersistentId: z30.string(),
610
+ definitionPersistentId: z30.string(),
611
+ stringValue: z30.string().nullish(),
612
+ numberValue: z30.number().nullish(),
613
+ booleanValue: z30.boolean().nullish(),
614
+ referenceValue: z30.string().nullish(),
615
+ referenceValuePreview: z30.string().nullish()
589
616
  });
590
617
 
591
618
  // src/dsm/elements/primitives/point.ts
592
- import { z as z30 } from "zod";
593
- var Point2D = z30.object({
594
- x: z30.number(),
595
- y: z30.number()
619
+ import { z as z31 } from "zod";
620
+ var Point2D = z31.object({
621
+ x: z31.number(),
622
+ y: z31.number()
596
623
  });
597
624
 
598
625
  // src/dsm/elements/primitives/size.ts
599
- import { z as z31 } from "zod";
626
+ import { z as z32 } from "zod";
600
627
  var nullSize = { height: -1, width: -1 };
601
628
  function isNullSize(size) {
602
629
  return size.height === nullSize.height && size.width === nullSize.width;
603
630
  }
604
- var Size = z31.object({
605
- width: z31.number().nullish().transform((v) => v ?? nullSize.width),
606
- height: z31.number().nullish().transform((v) => v ?? nullSize.height)
631
+ var Size = z32.object({
632
+ width: z32.number().nullish().transform((v) => v ?? nullSize.width),
633
+ height: z32.number().nullish().transform((v) => v ?? nullSize.height)
607
634
  });
608
635
  var SizeOrUndefined = Size.optional().transform((v) => {
609
636
  if (!v)
@@ -613,31 +640,6 @@ var SizeOrUndefined = Size.optional().transform((v) => {
613
640
  return v;
614
641
  });
615
642
 
616
- // src/helpers/db.ts
617
- import {
618
- z as z32
619
- } from "zod";
620
- function zodCreateInputOmit() {
621
- return {
622
- id: true,
623
- createdAt: true,
624
- updatedAt: true
625
- };
626
- }
627
- function zodUpdateInputOmit() {
628
- return {
629
- id: true,
630
- createdAt: true,
631
- updatedAt: true,
632
- persistentId: true
633
- };
634
- }
635
-
636
- // src/helpers/nullish-to-optional.ts
637
- function nullishToOptional(type) {
638
- return type.nullish().transform((t) => t ?? void 0);
639
- }
640
-
641
643
  // src/dsm/elements/data/documentation-block-v1.ts
642
644
  var PageBlockCalloutType = z33.enum(["Info", "Primary", "Success", "Warning", "Error"]);
643
645
  var PageBlockTypeV1 = z33.enum([
@@ -905,6 +907,16 @@ var PageBlockColorV2 = z34.object({
905
907
  value: z34.string(),
906
908
  referencedTokenId: z34.string().optional()
907
909
  });
910
+ var PageBlockAssetEntityMeta = z34.object({
911
+ title: z34.string().optional(),
912
+ description: z34.string().optional(),
913
+ backgroundColor: PageBlockColorV2.optional()
914
+ });
915
+ var PageBlockFigmaNodeEntityMeta = z34.object({
916
+ title: z34.string().optional(),
917
+ description: z34.string().optional(),
918
+ backgroundColor: PageBlockColorV2.optional()
919
+ });
908
920
  var PageBlockAppearanceV2 = z34.object({
909
921
  itemBackgroundColor: PageBlockColorV2.optional(),
910
922
  numberOfColumns: z34.number().optional()
@@ -940,10 +952,7 @@ var PageBlockItemAssetValue = z34.object({
940
952
  z34.object({
941
953
  entityId: z34.string(),
942
954
  entityType: z34.enum(["Asset", "AssetGroup"]),
943
- entityMeta: z34.object({
944
- title: z34.string().optional(),
945
- description: z34.string().optional()
946
- }).optional()
955
+ entityMeta: PageBlockAssetEntityMeta.optional()
947
956
  })
948
957
  )
949
958
  });
@@ -960,6 +969,7 @@ var PageBlockItemCodeValue = z34.object({
960
969
  });
961
970
  var PageBlockItemSandboxValue = z34.object({
962
971
  showCode: z34.boolean().optional(),
972
+ showControls: z34.boolean().optional(),
963
973
  backgroundColor: z34.string().optional(),
964
974
  alignPreview: z34.enum(["Left", "Center"]).optional(),
965
975
  previewHeight: z34.number().optional(),
@@ -993,14 +1003,11 @@ var PageBlockItemFigmaNodeValue = z34.object({
993
1003
  selectedPropertyIds: z34.array(z34.string()).optional(),
994
1004
  showSearch: z34.boolean().optional(),
995
1005
  previewContainerSize: PageBlockPreviewContainerSize.optional(),
996
- backgroundColor: z34.string().optional(),
1006
+ backgroundColor: PageBlockColorV2.optional(),
997
1007
  value: z34.array(
998
1008
  z34.object({
999
1009
  entityId: z34.string(),
1000
- entityMeta: z34.object({
1001
- title: z34.string().optional(),
1002
- description: z34.string().optional()
1003
- }).optional()
1010
+ entityMeta: PageBlockFigmaNodeEntityMeta.optional()
1004
1011
  })
1005
1012
  )
1006
1013
  });
@@ -1065,6 +1072,7 @@ var PageBlockItemUrlValue = z34.object({
1065
1072
  });
1066
1073
  var PageBlockItemTableRichTextNode = z34.object({
1067
1074
  type: z34.literal("RichText"),
1075
+ id: z34.string(),
1068
1076
  value: PageBlockItemRichTextValue.shape.value
1069
1077
  });
1070
1078
  var PageBlockItemTableMultiRichTextNode = z34.object({
@@ -1073,6 +1081,7 @@ var PageBlockItemTableMultiRichTextNode = z34.object({
1073
1081
  });
1074
1082
  var PageBlockItemTableImageNode = z34.object({
1075
1083
  type: z34.literal("Image"),
1084
+ id: z34.string(),
1076
1085
  caption: PageBlockItemImageValue.shape.caption,
1077
1086
  value: PageBlockItemImageValue.shape.value
1078
1087
  });
@@ -2466,8 +2475,8 @@ var WorkspaceProfile = z98.object({
2466
2475
  name: z98.string(),
2467
2476
  handle: z98.string(),
2468
2477
  color: z98.string(),
2469
- avatar: z98.string().optional(),
2470
- billingDetails: BillingDetails.optional()
2478
+ avatar: nullishToOptional(z98.string()),
2479
+ billingDetails: nullishToOptional(BillingDetails)
2471
2480
  });
2472
2481
  var Workspace = z98.object({
2473
2482
  id: z98.string(),
@@ -4154,6 +4163,7 @@ export {
4154
4163
  PageBlockAppearanceV2,
4155
4164
  PageBlockAsset,
4156
4165
  PageBlockAssetComponent,
4166
+ PageBlockAssetEntityMeta,
4157
4167
  PageBlockAssetType,
4158
4168
  PageBlockBehaviorDataType,
4159
4169
  PageBlockBehaviorSelectionType,
@@ -4200,6 +4210,7 @@ export {
4200
4210
  PageBlockEditorModel,
4201
4211
  PageBlockEditorModelV2,
4202
4212
  PageBlockFigmaFrameProperties,
4213
+ PageBlockFigmaNodeEntityMeta,
4203
4214
  PageBlockFrame,
4204
4215
  PageBlockFrameOrigin,
4205
4216
  PageBlockImageAlignment,