@supernova-studio/model 0.47.16 → 0.47.18

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
@@ -3222,42 +3222,44 @@ var ExporterDestinationDocs = z133.object({
3222
3222
  });
3223
3223
  var ExporterDestinationS3 = z133.object({});
3224
3224
  var ExporterDestinationGithub = z133.object({
3225
+ credentialId: z133.string().optional(),
3226
+ // Repository
3225
3227
  url: z133.string(),
3228
+ // Location
3226
3229
  branch: z133.string(),
3227
- userId: z133.string(),
3228
- connectionId: z133.string(),
3229
- relativePath: z133.string()
3230
+ relativePath: nullishToOptional(z133.string())
3230
3231
  });
3231
3232
  var ExporterDestinationAzure = z133.object({
3232
- connectionId: z133.string(),
3233
+ credentialId: z133.string().optional(),
3234
+ // Repository
3233
3235
  organizationId: z133.string(),
3234
3236
  projectId: z133.string(),
3235
3237
  repositoryId: z133.string(),
3238
+ // Location
3236
3239
  branch: z133.string(),
3237
- relativePath: z133.string()
3238
- // // +
3239
- // userId: z.coerce.string(),
3240
- // url: z.string(),
3240
+ relativePath: nullishToOptional(z133.string()),
3241
+ // Maybe not needed
3242
+ url: nullishToOptional(z133.string())
3241
3243
  });
3242
3244
  var ExporterDestinationGitlab = z133.object({
3243
- connectionId: z133.string(),
3245
+ credentialId: z133.string().optional(),
3246
+ // Repository
3244
3247
  projectId: z133.string(),
3248
+ // Location
3245
3249
  branch: z133.string(),
3246
- relativePath: z133.string()
3247
- // // +
3248
- // userId: z.coerce.string(),
3249
- // url: z.string(),
3250
+ relativePath: nullishToOptional(z133.string()),
3251
+ // Maybe not needed
3252
+ url: nullishToOptional(z133.string())
3250
3253
  });
3251
3254
  var ExporterDestinationBitbucket = z133.object({
3252
- connectionId: z133.string(),
3255
+ credentialId: z133.string().optional(),
3256
+ // Repository
3253
3257
  workspaceSlug: z133.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3254
3258
  projectKey: z133.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3255
3259
  repoSlug: z133.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3260
+ // Location
3256
3261
  branch: z133.string(),
3257
- relativePath: z133.string()
3258
- // // +
3259
- // userId: z.string(),
3260
- // url: z.string(),
3262
+ relativePath: nullishToOptional(z133.string())
3261
3263
  });
3262
3264
  var ExportDestinationsMap = z133.object({
3263
3265
  webhookUrl: z133.string().optional(),
@@ -3271,7 +3273,15 @@ var ExportDestinationsMap = z133.object({
3271
3273
 
3272
3274
  // src/export/export-jobs.ts
3273
3275
  import { z as z134 } from "zod";
3274
- var ExportJobDestinationType = z134.enum(["s3", "webhookUrl", "github", "documentation", "azure", "gitlab"]);
3276
+ var ExportJobDestinationType = z134.enum([
3277
+ "s3",
3278
+ "webhookUrl",
3279
+ "github",
3280
+ "documentation",
3281
+ "azure",
3282
+ "gitlab",
3283
+ "bitbucket"
3284
+ ]);
3275
3285
  var ExportJobStatus = z134.enum(["InProgress", "Success", "Failed", "Timeout"]);
3276
3286
  var ExportJobLogEntryType = z134.enum(["success", "info", "warning", "error", "user"]);
3277
3287
  var ExportJobLogEntry = z134.object({
@@ -3333,41 +3343,24 @@ var ExportJobFindByFilter = ExportJob.pick({
3333
3343
  docsEnvironment: PublishedDocEnvironment
3334
3344
  }).partial();
3335
3345
 
3336
- // src/export/export-schedule.ts
3337
- import { z as z135 } from "zod";
3338
- var ExporterScheduleEventType = z135.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
3339
- var ExporterSchedule = z135.object({
3340
- id: z135.string(),
3341
- name: z135.string(),
3342
- eventType: ExporterScheduleEventType,
3343
- isEnabled: z135.boolean(),
3344
- workspaceId: z135.string(),
3345
- designSystemId: z135.string(),
3346
- exporterId: z135.string(),
3347
- brandId: z135.string().optional(),
3348
- themeId: z135.string().optional(),
3349
- // Destinations
3350
- ...ExportDestinationsMap.shape
3351
- });
3352
-
3353
3346
  // src/export/exporter-workspace-membership-role.ts
3354
- import { z as z136 } from "zod";
3355
- var ExporterWorkspaceMembershipRole = z136.enum(["Owner", "OwnerArchived", "User"]);
3347
+ import { z as z135 } from "zod";
3348
+ var ExporterWorkspaceMembershipRole = z135.enum(["Owner", "OwnerArchived", "User"]);
3356
3349
 
3357
3350
  // src/export/exporter-workspace-membership.ts
3358
- import { z as z137 } from "zod";
3359
- var ExporterWorkspaceMembership = z137.object({
3360
- id: z137.string(),
3361
- workspaceId: z137.string(),
3362
- exporterId: z137.string(),
3351
+ import { z as z136 } from "zod";
3352
+ var ExporterWorkspaceMembership = z136.object({
3353
+ id: z136.string(),
3354
+ workspaceId: z136.string(),
3355
+ exporterId: z136.string(),
3363
3356
  role: ExporterWorkspaceMembershipRole
3364
3357
  });
3365
3358
 
3366
3359
  // src/export/exporter.ts
3367
- import { z as z140 } from "zod";
3360
+ import { z as z139 } from "zod";
3368
3361
 
3369
3362
  // src/export/git-providers.ts
3370
- import { z as z138 } from "zod";
3363
+ import { z as z137 } from "zod";
3371
3364
  var GitProviderNames = /* @__PURE__ */ ((GitProviderNames2) => {
3372
3365
  GitProviderNames2["Azure"] = "azure";
3373
3366
  GitProviderNames2["Github"] = "github";
@@ -3375,11 +3368,11 @@ var GitProviderNames = /* @__PURE__ */ ((GitProviderNames2) => {
3375
3368
  GitProviderNames2["Bitbucket"] = "bitbucket";
3376
3369
  return GitProviderNames2;
3377
3370
  })(GitProviderNames || {});
3378
- var GitProvider = z138.nativeEnum(GitProviderNames);
3371
+ var GitProvider = z137.nativeEnum(GitProviderNames);
3379
3372
 
3380
3373
  // src/export/pulsar.ts
3381
- import { z as z139 } from "zod";
3382
- var PulsarPropertyType = z139.enum([
3374
+ import { z as z138 } from "zod";
3375
+ var PulsarPropertyType = z138.enum([
3383
3376
  "string",
3384
3377
  "number",
3385
3378
  "boolean",
@@ -3392,72 +3385,94 @@ var PulsarPropertyType = z139.enum([
3392
3385
  "tokenProperties",
3393
3386
  "tokenType"
3394
3387
  ]);
3395
- var PulsarBaseProperty = z139.object({
3396
- label: z139.string(),
3397
- key: z139.string(),
3398
- description: z139.string().nullish(),
3388
+ var PulsarBaseProperty = z138.object({
3389
+ label: z138.string(),
3390
+ key: z138.string(),
3391
+ description: z138.string().nullish(),
3399
3392
  type: PulsarPropertyType,
3400
- values: z139.array(z139.string()).nullish(),
3401
- default: z139.union([z139.string(), z139.boolean(), z139.number()]).nullish(),
3393
+ values: z138.array(z138.string()).nullish(),
3394
+ default: z138.union([z138.string(), z138.boolean(), z138.number()]).nullish(),
3402
3395
  // PulsarPropertyValueType //is optional?
3403
- inputType: z139.enum(["code", "plain"]).optional(),
3396
+ inputType: z138.enum(["code", "plain"]).optional(),
3404
3397
  //is optional?
3405
- isMultiline: z139.boolean().nullish()
3398
+ isMultiline: z138.boolean().nullish()
3406
3399
  });
3407
3400
  var PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({
3408
- category: z139.string()
3401
+ category: z138.string()
3409
3402
  });
3410
- var PulsarContributionVariant = z139.object({
3411
- key: z139.string(),
3412
- name: z139.string(),
3413
- isDefault: nullishToOptional(z139.boolean()),
3414
- description: nullishToOptional(z139.string()),
3415
- thumbnailURL: nullishToOptional(z139.string())
3416
- });
3417
- var PulsarCustomBlock = z139.object({
3418
- title: nullishToOptional(z139.string()),
3419
- key: z139.string(),
3420
- category: nullishToOptional(z139.string()),
3421
- description: nullishToOptional(z139.string()),
3422
- iconURL: nullishToOptional(z139.string()),
3423
- mode: nullishToOptional(z139.enum(["array", "block"])),
3424
- properties: nullishToOptional(z139.array(PulsarBaseProperty)).transform((v) => v ?? [])
3403
+ var PulsarContributionVariant = z138.object({
3404
+ key: z138.string(),
3405
+ name: z138.string(),
3406
+ isDefault: nullishToOptional(z138.boolean()),
3407
+ description: nullishToOptional(z138.string()),
3408
+ thumbnailURL: nullishToOptional(z138.string())
3409
+ });
3410
+ var PulsarCustomBlock = z138.object({
3411
+ title: nullishToOptional(z138.string()),
3412
+ key: z138.string(),
3413
+ category: nullishToOptional(z138.string()),
3414
+ description: nullishToOptional(z138.string()),
3415
+ iconURL: nullishToOptional(z138.string()),
3416
+ mode: nullishToOptional(z138.enum(["array", "block"])),
3417
+ properties: nullishToOptional(z138.array(PulsarBaseProperty)).transform((v) => v ?? [])
3425
3418
  });
3426
3419
 
3427
3420
  // src/export/exporter.ts
3428
- var ExporterType = z140.enum(["code", "documentation"]);
3429
- var ExporterSource = z140.enum(["git", "upload"]);
3430
- var ExporterTag = z140.string().regex(/^[0-9a-zA-Z]+(\s[0-9a-zA-Z]+)*$/);
3431
- var ExporterDetails = z140.object({
3432
- description: z140.string(),
3433
- version: z140.string(),
3434
- routingVersion: nullishToOptional(z140.string()),
3435
- author: nullishToOptional(z140.string()),
3436
- organization: nullishToOptional(z140.string()),
3437
- homepage: nullishToOptional(z140.string()),
3438
- readme: nullishToOptional(z140.string()),
3439
- tags: nullishToOptional(z140.array(ExporterTag)).default([]),
3440
- packageId: nullishToOptional(z140.string().max(255)),
3441
- iconURL: nullishToOptional(z140.string()),
3442
- configurationProperties: nullishToOptional(z140.array(PulsarContributionConfigurationProperty)).default([]),
3443
- customBlocks: nullishToOptional(z140.array(PulsarCustomBlock)).default([]),
3444
- blockVariants: nullishToOptional(z140.record(z140.string(), z140.array(PulsarContributionVariant))).default({}),
3445
- usesBrands: nullishToOptional(z140.boolean()).default(false),
3446
- usesThemes: nullishToOptional(z140.boolean()).default(false),
3421
+ var ExporterType = z139.enum(["code", "documentation"]);
3422
+ var ExporterSource = z139.enum(["git", "upload"]);
3423
+ var ExporterTag = z139.string().regex(/^[0-9a-zA-Z]+(\s[0-9a-zA-Z]+)*$/);
3424
+ var ExporterPulsarDetails = z139.object({
3425
+ description: z139.string(),
3426
+ version: z139.string(),
3427
+ routingVersion: nullishToOptional(z139.string()),
3428
+ author: nullishToOptional(z139.string()),
3429
+ organization: nullishToOptional(z139.string()),
3430
+ homepage: nullishToOptional(z139.string()),
3431
+ readme: nullishToOptional(z139.string()),
3432
+ tags: nullishToOptional(z139.array(ExporterTag)).default([]),
3433
+ packageId: nullishToOptional(z139.string().max(255)),
3434
+ iconURL: nullishToOptional(z139.string()),
3435
+ configurationProperties: nullishToOptional(z139.array(PulsarContributionConfigurationProperty)).default([]),
3436
+ customBlocks: nullishToOptional(z139.array(PulsarCustomBlock)).default([]),
3437
+ blockVariants: nullishToOptional(z139.record(z139.string(), z139.array(PulsarContributionVariant))).default({}),
3438
+ usesBrands: nullishToOptional(z139.boolean()).default(false),
3439
+ usesThemes: nullishToOptional(z139.boolean()).default(false)
3440
+ });
3441
+ var ExporterDetails = ExporterPulsarDetails.extend({
3447
3442
  source: ExporterSource,
3448
3443
  gitProvider: nullishToOptional(GitProvider),
3449
- gitUrl: nullishToOptional(z140.string()),
3450
- gitBranch: nullishToOptional(z140.string()),
3451
- gitDirectory: nullishToOptional(z140.string())
3444
+ gitUrl: nullishToOptional(z139.string()),
3445
+ gitBranch: nullishToOptional(z139.string()),
3446
+ gitDirectory: nullishToOptional(z139.string())
3452
3447
  });
3453
- var Exporter = z140.object({
3454
- id: z140.string(),
3455
- createdAt: z140.coerce.date(),
3456
- name: z140.string(),
3457
- isPrivate: z140.boolean(),
3448
+ var Exporter = z139.object({
3449
+ id: z139.string(),
3450
+ createdAt: z139.coerce.date(),
3451
+ name: z139.string(),
3452
+ isPrivate: z139.boolean(),
3458
3453
  details: ExporterDetails,
3459
3454
  exporterType: nullishToOptional(ExporterType).default("code"),
3460
- storagePath: nullishToOptional(z140.string()).default("")
3455
+ storagePath: nullishToOptional(z139.string()).default("")
3456
+ });
3457
+
3458
+ // src/export/pipeline.ts
3459
+ import { z as z140 } from "zod";
3460
+ var PipelineEventType = z140.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
3461
+ var PipelineDestinationGitType = z140.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
3462
+ var PipelineDestinationExtraType = z140.enum(["WebhookUrl", "S3", "Documentation"]);
3463
+ var PipelineDestinationType = z140.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
3464
+ var Pipeline = z140.object({
3465
+ id: z140.string(),
3466
+ name: z140.string(),
3467
+ eventType: PipelineEventType,
3468
+ isEnabled: z140.boolean(),
3469
+ workspaceId: z140.string(),
3470
+ designSystemId: z140.string(),
3471
+ exporterId: z140.string(),
3472
+ brandPersistentId: z140.string().optional(),
3473
+ themePersistentId: z140.string().optional(),
3474
+ // Destinations
3475
+ ...ExportDestinationsMap.shape
3461
3476
  });
3462
3477
 
3463
3478
  // src/feature-flags/feature-flags.ts
@@ -3499,6 +3514,18 @@ var ExternalOAuthRequest = z143.object({
3499
3514
 
3500
3515
  // src/integrations/git.ts
3501
3516
  import { z as z144 } from "zod";
3517
+ var GitObjectsQuery = z144.object({
3518
+ organization: z144.string().optional(),
3519
+ // Azure Organization | Bitbucket Workspace slug | Gitlab Group | Github Account (User or Organization)
3520
+ project: z144.string().optional(),
3521
+ // Only for Bitbucket and Azure
3522
+ repository: z144.string().optional(),
3523
+ // For all providers. For Gitlab, it's called "project".
3524
+ branch: z144.string().optional(),
3525
+ // For all providers.
3526
+ user: z144.string().optional()
3527
+ // Gitlab user
3528
+ });
3502
3529
  var GitOrganization = z144.object({
3503
3530
  id: z144.string(),
3504
3531
  name: z144.string(),
@@ -3564,6 +3591,7 @@ var ExtendedIntegrationType = z145.enum([
3564
3591
  "FigmaVariablesPlugin"
3565
3592
  ]);
3566
3593
  var IntegrationType = ExtendedIntegrationType.exclude(["TokenStudio", "FigmaVariablesPlugin"]);
3594
+ var GitIntegrationType = IntegrationType.exclude(["Figma"]);
3567
3595
  var Integration = z145.object({
3568
3596
  id: z145.string(),
3569
3597
  workspaceId: z145.string(),
@@ -3603,8 +3631,18 @@ var IntegrationToken = z145.object({
3603
3631
  tokenName: data.token_name,
3604
3632
  tokenBitbucketUsername: data.token_bitbucket_username,
3605
3633
  tokenAzureOrganizationName: data.token_azure_organization_name,
3606
- customUrl: data.custom_url
3634
+ customUrl: data.custom_url ? formatCustomUrl(data.custom_url) : void 0
3607
3635
  };
3636
+ function formatCustomUrl(url) {
3637
+ let formattedUrl = url.trim();
3638
+ if (!formattedUrl.startsWith("http://") && !formattedUrl.startsWith("https://")) {
3639
+ formattedUrl = "http://" + formattedUrl;
3640
+ }
3641
+ if (formattedUrl.endsWith("/")) {
3642
+ formattedUrl = formattedUrl.slice(0, -1);
3643
+ }
3644
+ return formattedUrl;
3645
+ }
3608
3646
  });
3609
3647
 
3610
3648
  // src/integrations/oauth-token.ts
@@ -3820,6 +3858,15 @@ function trimLeadingSlash(string) {
3820
3858
  function trimTrailingSlash(string) {
3821
3859
  return string.endsWith("/") ? string.substring(0, string.length - 1) : string;
3822
3860
  }
3861
+ function tryParseUrl(url) {
3862
+ try {
3863
+ return parseUrl(url);
3864
+ } catch (e) {
3865
+ console.error(`Error parsing URL ${url}`);
3866
+ console.error(e);
3867
+ return null;
3868
+ }
3869
+ }
3823
3870
  function parseUrl(url) {
3824
3871
  return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
3825
3872
  }
@@ -4761,8 +4808,7 @@ export {
4761
4808
  ExporterPropertyImageValue,
4762
4809
  ExporterPropertyValue,
4763
4810
  ExporterPropertyValuesCollection,
4764
- ExporterSchedule,
4765
- ExporterScheduleEventType,
4811
+ ExporterPulsarDetails,
4766
4812
  ExporterSource,
4767
4813
  ExporterTag,
4768
4814
  ExporterType,
@@ -4808,6 +4854,8 @@ export {
4808
4854
  FontWeightTokenData,
4809
4855
  FontWeightValue,
4810
4856
  GitBranch,
4857
+ GitIntegrationType,
4858
+ GitObjectsQuery,
4811
4859
  GitOrganization,
4812
4860
  GitProject,
4813
4861
  GitProvider,
@@ -5005,6 +5053,11 @@ export {
5005
5053
  ParagraphSpacingValue,
5006
5054
  PeriodSchema,
5007
5055
  PersonalAccessToken,
5056
+ Pipeline,
5057
+ PipelineDestinationExtraType,
5058
+ PipelineDestinationGitType,
5059
+ PipelineDestinationType,
5060
+ PipelineEventType,
5008
5061
  PluginOAuthRequestSchema,
5009
5062
  Point2D,
5010
5063
  PostStripeCheckoutBodyInputSchema,
@@ -5169,6 +5222,7 @@ export {
5169
5222
  trimLeadingSlash,
5170
5223
  trimTrailingSlash,
5171
5224
  tryParseShortPersistentId,
5225
+ tryParseUrl,
5172
5226
  zodCreateInputOmit,
5173
5227
  zodUpdateInputOmit
5174
5228
  };