@supernova-studio/model 0.45.0 → 0.46.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
@@ -1,3 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+
1
8
  // src/auth/plugin-oauth-request.ts
2
9
  import { z } from "zod";
3
10
  var PluginOAuthRequestSchema = z.object({
@@ -1217,8 +1224,8 @@ var defaultDocumentationItemHeaderV2 = {
1217
1224
  // src/dsm/elements/data/documentation-v2.ts
1218
1225
  var DocumentationItemConfigurationV2 = z41.object({
1219
1226
  showSidebar: z41.boolean(),
1220
- isPrivate: z41.boolean(),
1221
- isHidden: z41.boolean(),
1227
+ isPrivate: z41.boolean().optional(),
1228
+ isHidden: z41.boolean().optional(),
1222
1229
  header: DocumentationItemHeaderV2
1223
1230
  });
1224
1231
  var defaultDocumentationItemConfigurationV2 = {
@@ -1893,8 +1900,8 @@ function traversePageItemsV2(pageItems, fn) {
1893
1900
  }
1894
1901
  var PageBlockDefinitionsMap = class {
1895
1902
  constructor(definitions) {
1896
- this.definitionsMap = /* @__PURE__ */ new Map();
1897
- this.propertiesMap = /* @__PURE__ */ new Map();
1903
+ __publicField(this, "definitionsMap", /* @__PURE__ */ new Map());
1904
+ __publicField(this, "propertiesMap", /* @__PURE__ */ new Map());
1898
1905
  definitions.forEach((d) => {
1899
1906
  this.definitionsMap.set(d.id, d);
1900
1907
  d.item.properties.forEach((p) => {
@@ -2937,6 +2944,7 @@ var PublishedDocPage = z118.object({
2937
2944
  pathV1: z118.string(),
2938
2945
  pathV2: z118.string(),
2939
2946
  storagePath: z118.string(),
2947
+ fallbackPublicPath: z118.string().optional(),
2940
2948
  locale: z118.string().optional(),
2941
2949
  isPrivate: z118.boolean(),
2942
2950
  isHidden: z118.boolean(),
@@ -3368,13 +3376,13 @@ var ExternalOAuthRequest = z137.object({
3368
3376
 
3369
3377
  // src/integrations/integration.ts
3370
3378
  import { z as z138 } from "zod";
3371
- var IntegrationCredentialsType = z138.enum(["OAuth2", "PAT"]);
3379
+ var IntegrationCredentialsType = z138.enum(["OAuth2", "PAT", "GithubApp"]);
3372
3380
  var IntegrationCredentialsProfile = z138.object({
3373
3381
  id: z138.string(),
3374
3382
  username: z138.string().optional(),
3375
3383
  avatarUrl: z138.string().optional()
3376
3384
  });
3377
- var IntegrationCredentialsSchema = z138.object({
3385
+ var IntegrationCredentials = z138.object({
3378
3386
  id: z138.string(),
3379
3387
  type: IntegrationCredentialsType,
3380
3388
  integrationId: z138.string(),
@@ -3382,7 +3390,8 @@ var IntegrationCredentialsSchema = z138.object({
3382
3390
  userId: z138.string(),
3383
3391
  createdAt: z138.coerce.date(),
3384
3392
  refreshToken: z138.string().optional(),
3385
- profile: IntegrationCredentialsProfile.optional()
3393
+ profile: IntegrationCredentialsProfile.optional(),
3394
+ customUrl: z138.string().optional()
3386
3395
  });
3387
3396
  var IntegrationType = z138.enum(["Figma", "Github", "Gitlab", "Bitbucket", "Azure"]);
3388
3397
  var Integration = z138.object({
@@ -3390,7 +3399,29 @@ var Integration = z138.object({
3390
3399
  workspaceId: z138.string(),
3391
3400
  type: IntegrationType,
3392
3401
  createdAt: z138.coerce.date(),
3393
- integrationCredentials: z138.array(IntegrationCredentialsSchema).optional()
3402
+ integrationCredentials: z138.array(IntegrationCredentials).optional()
3403
+ });
3404
+ var forbiddenCustomUrldomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
3405
+ var IntegrationTokenResponse = z138.object({
3406
+ access_token: z138.string(),
3407
+ refresh_token: z138.string().optional(),
3408
+ expires_in: z138.number().optional(),
3409
+ token_type: z138.string().optional(),
3410
+ custom_url: z138.string().optional().refine((value) => {
3411
+ if (!value)
3412
+ return true;
3413
+ if (forbiddenCustomUrldomainList.some((domain) => value.includes(domain)))
3414
+ return false;
3415
+ return true;
3416
+ }, "Custom URL validation failed")
3417
+ }).transform((data) => {
3418
+ return {
3419
+ accessToken: data.access_token,
3420
+ refreshToken: data.refresh_token,
3421
+ expiresIn: data.expires_in,
3422
+ tokenType: data.token_type,
3423
+ customUrl: data.custom_url
3424
+ };
3394
3425
  });
3395
3426
 
3396
3427
  // src/integrations/oauth-token.ts
@@ -4486,9 +4517,10 @@ export {
4486
4517
  ImportedFigmaSourceData,
4487
4518
  Integration,
4488
4519
  IntegrationAuthType,
4520
+ IntegrationCredentials,
4489
4521
  IntegrationCredentialsProfile,
4490
- IntegrationCredentialsSchema,
4491
4522
  IntegrationCredentialsType,
4523
+ IntegrationTokenResponse,
4492
4524
  IntegrationTokenSchema,
4493
4525
  IntegrationType,
4494
4526
  IntegrationUserInfo,