@supernova-studio/model 0.48.12 → 0.48.14

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
@@ -284,7 +284,7 @@ var CustomDomain = z14.object({
284
284
  });
285
285
 
286
286
  // src/data-dumps/code-integration-dump.ts
287
- import { z as z122 } from "zod";
287
+ import { z as z123 } from "zod";
288
288
 
289
289
  // src/export/exporter.ts
290
290
  import { z as z17 } from "zod";
@@ -386,10 +386,10 @@ var Exporter = z17.object({
386
386
  });
387
387
 
388
388
  // src/export/pipeline.ts
389
- import { z as z121 } from "zod";
389
+ import { z as z122 } from "zod";
390
390
 
391
391
  // src/export/export-destinations.ts
392
- import { z as z120 } from "zod";
392
+ import { z as z121 } from "zod";
393
393
 
394
394
  // src/dsm/assets/asset-dynamo-record.ts
395
395
  import { z as z18 } from "zod";
@@ -2832,883 +2832,183 @@ var DocumentationCommentThread = z104.object({
2832
2832
  });
2833
2833
 
2834
2834
  // src/dsm/element-snapshots/base.ts
2835
- import { z as z105 } from "zod";
2836
- var DesignElementSnapshotReason = z105.enum(["Publish", "Deletion"]);
2837
- var DesignElementSnapshotBase = z105.object({
2838
- id: z105.string(),
2839
- persistentId: z105.string(),
2840
- designSystemVersionId: z105.string(),
2841
- createdAt: z105.coerce.date(),
2842
- updatedAt: z105.coerce.date(),
2843
- reason: DesignElementSnapshotReason
2844
- });
2845
-
2846
- // src/dsm/element-snapshots/documentation-page-snapshot.ts
2847
2835
  import { z as z106 } from "zod";
2848
- var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
2849
- page: DocumentationPageV2,
2850
- pageContentHash: z106.string(),
2851
- pageContentStorageKey: z106.string()
2852
- });
2853
-
2854
- // src/dsm/element-snapshots/group-snapshot.ts
2855
- var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
2856
- group: ElementGroup
2857
- });
2858
-
2859
- // src/dsm/views/column.ts
2860
- import { z as z107 } from "zod";
2861
- var ElementViewBaseColumnType = z107.enum(["Name", "Description", "Value", "UpdatedAt"]);
2862
- var ElementViewColumnType = z107.union([
2863
- z107.literal("BaseProperty"),
2864
- z107.literal("PropertyDefinition"),
2865
- z107.literal("Theme")
2866
- ]);
2867
- var ElementViewColumnSharedAttributes = z107.object({
2868
- id: z107.string(),
2869
- persistentId: z107.string(),
2870
- elementDataViewId: z107.string(),
2871
- sortPosition: z107.number(),
2872
- width: z107.number()
2873
- });
2874
- var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
2875
- type: z107.literal("BaseProperty"),
2876
- basePropertyType: ElementViewBaseColumnType
2877
- });
2878
- var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
2879
- type: z107.literal("PropertyDefinition"),
2880
- propertyDefinitionId: z107.string()
2881
- });
2882
- var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
2883
- type: z107.literal("Theme"),
2884
- themeId: z107.string()
2885
- });
2886
- var ElementViewColumn = z107.discriminatedUnion("type", [
2887
- ElementViewBasePropertyColumn,
2888
- ElementViewPropertyDefinitionColumn,
2889
- ElementViewThemeColumn
2890
- ]);
2891
-
2892
- // src/dsm/views/view.ts
2893
- import { z as z108 } from "zod";
2894
- var ElementView = z108.object({
2895
- id: z108.string(),
2896
- persistentId: z108.string(),
2897
- designSystemVersionId: z108.string(),
2898
- name: z108.string(),
2899
- description: z108.string(),
2900
- targetElementType: ElementPropertyTargetType,
2901
- isDefault: z108.boolean()
2902
- });
2903
-
2904
- // src/dsm/brand.ts
2905
- import { z as z109 } from "zod";
2906
- var Brand = z109.object({
2907
- id: z109.string(),
2908
- designSystemVersionId: z109.string(),
2909
- persistentId: z109.string(),
2910
- name: z109.string(),
2911
- description: z109.string()
2912
- });
2913
-
2914
- // src/dsm/design-system-update.ts
2915
- import { z as z114 } from "zod";
2916
-
2917
- // src/dsm/design-system.ts
2918
- import { z as z113 } from "zod";
2919
-
2920
- // src/workspace/workspace.ts
2921
- import IPCIDR from "ip-cidr";
2922
- import { z as z112 } from "zod";
2923
2836
 
2924
- // src/workspace/npm-registry-settings.ts
2925
- import { z as z110 } from "zod";
2926
- var NpmRegistryAuthType = z110.enum(["Basic", "Bearer", "None", "Custom"]);
2927
- var NpmRegistryType = z110.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
2928
- var NpmRegistryBasicAuthConfig = z110.object({
2929
- authType: z110.literal(NpmRegistryAuthType.Enum.Basic),
2930
- username: z110.string(),
2931
- password: z110.string()
2932
- });
2933
- var NpmRegistryBearerAuthConfig = z110.object({
2934
- authType: z110.literal(NpmRegistryAuthType.Enum.Bearer),
2935
- accessToken: z110.string()
2936
- });
2937
- var NpmRegistryNoAuthConfig = z110.object({
2938
- authType: z110.literal(NpmRegistryAuthType.Enum.None)
2939
- });
2940
- var NpmRegistrCustomAuthConfig = z110.object({
2941
- authType: z110.literal(NpmRegistryAuthType.Enum.Custom),
2942
- authHeaderName: z110.string(),
2943
- authHeaderValue: z110.string()
2944
- });
2945
- var NpmRegistryAuthConfig = z110.discriminatedUnion("authType", [
2946
- NpmRegistryBasicAuthConfig,
2947
- NpmRegistryBearerAuthConfig,
2948
- NpmRegistryNoAuthConfig,
2949
- NpmRegistrCustomAuthConfig
2950
- ]);
2951
- var NpmRegistryConfigBase = z110.object({
2952
- registryType: NpmRegistryType,
2953
- enabledScopes: z110.array(z110.string()),
2954
- customRegistryUrl: z110.string().optional(),
2955
- bypassProxy: z110.boolean().default(false),
2956
- npmProxyRegistryConfigId: z110.string().optional(),
2957
- npmProxyVersion: z110.number().optional()
2958
- });
2959
- var NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);
2837
+ // src/utils/errors.ts
2838
+ var SupernovaException = class _SupernovaException extends Error {
2839
+ //
2840
+ // Properties
2841
+ //
2842
+ constructor(type, message) {
2843
+ super(`${type}: ${message}`);
2844
+ this.type = type;
2845
+ }
2846
+ static wrongFormat(message) {
2847
+ return new _SupernovaException("WrongFormat", message);
2848
+ }
2849
+ static validationError(message) {
2850
+ return new _SupernovaException("ValidationError", message);
2851
+ }
2852
+ static accessDenied(message) {
2853
+ return new _SupernovaException("AccessDenied", message);
2854
+ }
2855
+ static tooMuchWork(message) {
2856
+ return new _SupernovaException("TooMuchWork", message);
2857
+ }
2858
+ static notFound(message) {
2859
+ return new _SupernovaException("ResourceNotFound", message);
2860
+ }
2861
+ static timeout(message) {
2862
+ return new _SupernovaException("Timeout", message);
2863
+ }
2864
+ static conflict(message) {
2865
+ return new _SupernovaException("Conflict", message);
2866
+ }
2867
+ static notImplemented(message) {
2868
+ return new _SupernovaException("NotImplemented", message);
2869
+ }
2870
+ static wrongActionOrder(message) {
2871
+ return new _SupernovaException("WrongActionOrder", message);
2872
+ }
2873
+ static invalidOperation(message) {
2874
+ return new _SupernovaException("InvalidOperation", message);
2875
+ }
2876
+ static shouldNotHappen(message) {
2877
+ return new _SupernovaException("UnexpectedError", message);
2878
+ }
2879
+ static ipRestricted(message) {
2880
+ return new _SupernovaException("IPRestricted", message);
2881
+ }
2882
+ static planRestricted(message) {
2883
+ return new _SupernovaException("PlanRestricted", message);
2884
+ }
2885
+ static missingWorkspacePermission(message) {
2886
+ return new _SupernovaException("MissingWorkspacePermission", message);
2887
+ }
2888
+ static missingExporterPermission(message) {
2889
+ return new _SupernovaException("MissingExporterPermission", message);
2890
+ }
2891
+ static missingIntegration(message) {
2892
+ return new _SupernovaException("MissingIntegration", message);
2893
+ }
2894
+ static missingIntegrationAccess(message) {
2895
+ return new _SupernovaException("MissingIntegrationAccess", message);
2896
+ }
2897
+ static noAccess(message) {
2898
+ return new _SupernovaException("NoAccess", message);
2899
+ }
2900
+ static missingCredentials(message) {
2901
+ return new _SupernovaException("MissingCredentials", message);
2902
+ }
2903
+ static thirdPartyError(message) {
2904
+ return new _SupernovaException("ThirdPartyError", message);
2905
+ }
2906
+ //
2907
+ // To refactor
2908
+ //
2909
+ static badRequest(message) {
2910
+ return new _SupernovaException("BadRequest", message);
2911
+ }
2912
+ };
2960
2913
 
2961
- // src/workspace/sso-provider.ts
2962
- import { z as z111 } from "zod";
2963
- var SsoProvider = z111.object({
2964
- providerId: z111.string(),
2965
- defaultAutoInviteValue: z111.boolean(),
2966
- autoInviteDomains: z111.record(z111.string(), z111.boolean()),
2967
- skipDocsSupernovaLogin: z111.boolean(),
2968
- areInvitesDisabled: z111.boolean(),
2969
- isTestMode: z111.boolean(),
2970
- emailDomains: z111.array(z111.string()),
2971
- metadataXml: z111.string().nullish()
2972
- });
2914
+ // src/utils/common.ts
2915
+ function forceUnwrapNullish(value) {
2916
+ if (value === null)
2917
+ throw new Error("Illegal null");
2918
+ if (value === void 0)
2919
+ throw new Error("Illegal undefined");
2920
+ return value;
2921
+ }
2922
+ function trimLeadingSlash(string) {
2923
+ return string.startsWith("/") ? string.substring(1) : string;
2924
+ }
2925
+ function trimTrailingSlash(string) {
2926
+ return string.endsWith("/") ? string.substring(0, string.length - 1) : string;
2927
+ }
2928
+ function tryParseUrl(url) {
2929
+ try {
2930
+ return parseUrl(url);
2931
+ } catch (e) {
2932
+ console.error(`Error parsing URL ${url}`);
2933
+ console.error(e);
2934
+ return null;
2935
+ }
2936
+ }
2937
+ function parseUrl(url) {
2938
+ return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
2939
+ }
2940
+ function mapByUnique(items, keyFn) {
2941
+ const result = /* @__PURE__ */ new Map();
2942
+ for (const item of items) {
2943
+ result.set(keyFn(item), item);
2944
+ }
2945
+ return result;
2946
+ }
2947
+ function groupBy(items, keyFn) {
2948
+ const result = /* @__PURE__ */ new Map();
2949
+ for (const item of items) {
2950
+ const key = keyFn(item);
2951
+ const array = result.get(key);
2952
+ if (array) {
2953
+ array.push(item);
2954
+ } else {
2955
+ result.set(key, [item]);
2956
+ }
2957
+ }
2958
+ return result;
2959
+ }
2960
+ function filterNonNullish(items) {
2961
+ return items.filter(Boolean);
2962
+ }
2963
+ function nonNullishFilter(item) {
2964
+ return !!item;
2965
+ }
2966
+ function nonNullFilter(item) {
2967
+ return item !== null;
2968
+ }
2969
+ function buildConstantEnum(values) {
2970
+ const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});
2971
+ return constMap;
2972
+ }
2973
+ async function promiseWithTimeout(timeoutMs, promise) {
2974
+ let timeoutHandle;
2975
+ const timeoutPromise = new Promise((_, reject) => {
2976
+ timeoutHandle = setTimeout(() => reject(SupernovaException.timeout()), timeoutMs);
2977
+ });
2978
+ const result = await Promise.race([promise(), timeoutPromise]);
2979
+ clearTimeout(timeoutHandle);
2980
+ return result;
2981
+ }
2982
+ async function sleep(ms) {
2983
+ return new Promise((resolve) => setTimeout(resolve, ms));
2984
+ }
2985
+ function uniqueBy(items, prop) {
2986
+ return Array.from(mapByUnique(items, prop).values());
2987
+ }
2973
2988
 
2974
- // src/workspace/workspace.ts
2975
- var isValidCIDR = (value) => {
2976
- return IPCIDR.isValidAddress(value);
2977
- };
2978
- var WorkspaceIpWhitelistEntry = z112.object({
2979
- isEnabled: z112.boolean(),
2980
- name: z112.string(),
2981
- range: z112.string().refine(isValidCIDR, {
2982
- message: "Invalid IP CIDR"
2989
+ // src/utils/content-loader-instruction.ts
2990
+ import { z as z105 } from "zod";
2991
+ var ContentLoadInstruction = z105.object({
2992
+ from: z105.string(),
2993
+ to: z105.string(),
2994
+ authorizationHeaderKvsId: z105.string().optional(),
2995
+ timeout: z105.number().optional()
2996
+ });
2997
+ var ContentLoaderPayload = z105.object({
2998
+ type: z105.literal("Single"),
2999
+ instruction: ContentLoadInstruction
3000
+ }).or(
3001
+ z105.object({
3002
+ type: z105.literal("Multiple"),
3003
+ loadingChunkSize: z105.number().optional(),
3004
+ instructions: z105.array(ContentLoadInstruction)
2983
3005
  })
2984
- });
2985
- var WorkspaceIpSettings = z112.object({
2986
- isEnabledForCloud: z112.boolean(),
2987
- isEnabledForDocs: z112.boolean(),
2988
- entries: z112.array(WorkspaceIpWhitelistEntry)
2989
- });
2990
- var WorkspaceProfile = z112.object({
2991
- name: z112.string(),
2992
- handle: z112.string(),
2993
- color: z112.string(),
2994
- avatar: nullishToOptional(z112.string()),
2995
- billingDetails: nullishToOptional(BillingDetails)
2996
- });
2997
- var WorkspaceProfileUpdate = WorkspaceProfile.omit({
2998
- avatar: true
2999
- });
3000
- var Workspace = z112.object({
3001
- id: z112.string(),
3002
- profile: WorkspaceProfile,
3003
- subscription: Subscription,
3004
- ipWhitelist: nullishToOptional(WorkspaceIpSettings),
3005
- sso: nullishToOptional(SsoProvider),
3006
- npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
3007
- });
3008
- var WorkspaceWithDesignSystems = z112.object({
3009
- workspace: Workspace,
3010
- designSystems: z112.array(DesignSystem)
3011
- });
3012
-
3013
- // src/dsm/design-system.ts
3014
- var DesignSystemSwitcher = z113.object({
3015
- isEnabled: z113.boolean(),
3016
- designSystemIds: z113.array(z113.string())
3017
- });
3018
- var DesignSystem = z113.object({
3019
- id: z113.string(),
3020
- workspaceId: z113.string(),
3021
- name: z113.string(),
3022
- description: z113.string(),
3023
- docExporterId: nullishToOptional(z113.string()),
3024
- docSlug: z113.string(),
3025
- docUserSlug: nullishToOptional(z113.string()),
3026
- docSlugDeprecated: z113.string(),
3027
- isPublic: z113.boolean(),
3028
- isMultibrand: z113.boolean(),
3029
- docViewUrl: nullishToOptional(z113.string()),
3030
- basePrefixes: z113.array(z113.string()),
3031
- designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
3032
- createdAt: z113.coerce.date(),
3033
- updatedAt: z113.coerce.date()
3034
- });
3035
- var DesignSystemWithWorkspace = z113.object({
3036
- designSystem: DesignSystem,
3037
- workspace: Workspace
3038
- });
3039
-
3040
- // src/dsm/design-system-update.ts
3041
- var DS_NAME_MIN_LENGTH = 2;
3042
- var DS_NAME_MAX_LENGTH = 64;
3043
- var DS_DESC_MAX_LENGTH = 64;
3044
- var DesignSystemUpdateInputMetadata = z114.object({
3045
- name: z114.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
3046
- description: z114.string().max(DS_DESC_MAX_LENGTH).trim().optional()
3047
- });
3048
- var DesignSystemUpdateInput = DesignSystem.partial().omit({
3049
- id: true,
3050
- createdAt: true,
3051
- updatedAt: true,
3052
- docSlug: true,
3053
- docViewUrl: true,
3054
- designSystemSwitcher: true
3055
- }).extend({
3056
- meta: DesignSystemUpdateInputMetadata.optional()
3057
- });
3058
-
3059
- // src/dsm/desing-system-create.ts
3060
- import { z as z115 } from "zod";
3061
- var DS_NAME_MIN_LENGTH2 = 2;
3062
- var DS_NAME_MAX_LENGTH2 = 64;
3063
- var DS_DESC_MAX_LENGTH2 = 64;
3064
- var DesignSystemCreateInputMetadata = z115.object({
3065
- name: z115.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
3066
- description: z115.string().max(DS_DESC_MAX_LENGTH2).trim()
3067
- });
3068
- var DesignSystemCreateInput = z115.object({
3069
- meta: DesignSystemCreateInputMetadata,
3070
- workspaceId: z115.string(),
3071
- isPublic: z115.boolean().optional(),
3072
- basePrefixes: z115.array(z115.string()).optional(),
3073
- docUserSlug: z115.string().nullish().optional(),
3074
- source: z115.array(z115.string()).optional()
3075
- });
3076
-
3077
- // src/dsm/exporter-property-values-collection.ts
3078
- import { z as z116 } from "zod";
3079
- var ExporterPropertyImageValue = z116.object({
3080
- asset: PageBlockAsset.optional(),
3081
- assetId: z116.string().optional(),
3082
- assetUrl: z116.string().optional()
3083
- });
3084
- var ExporterPropertyValue = z116.object({
3085
- key: z116.string(),
3086
- value: z116.union([
3087
- z116.number(),
3088
- z116.string(),
3089
- z116.boolean(),
3090
- ExporterPropertyImageValue,
3091
- ColorTokenData,
3092
- TypographyTokenData
3093
- ])
3094
- });
3095
- var ExporterPropertyValuesCollection = z116.object({
3096
- id: z116.string(),
3097
- designSystemId: z116.string(),
3098
- exporterId: z116.string(),
3099
- values: z116.array(ExporterPropertyValue)
3100
- });
3101
-
3102
- // src/dsm/published-doc-page.ts
3103
- import { z as z117 } from "zod";
3104
- var SHORT_PERSISTENT_ID_LENGTH = 8;
3105
- function tryParseShortPersistentId(url = "/") {
3106
- const lastUrlPart = url.split("/").pop() || "";
3107
- const shortPersistentId = lastUrlPart.split("-").pop()?.replaceAll(".html", "") || null;
3108
- return shortPersistentId?.length === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;
3109
- }
3110
- var PublishedDocPage = z117.object({
3111
- id: z117.string(),
3112
- publishedDocId: z117.string(),
3113
- pageShortPersistentId: z117.string(),
3114
- pathV1: z117.string(),
3115
- pathV2: z117.string(),
3116
- storagePath: z117.string(),
3117
- locale: z117.string().optional(),
3118
- isPrivate: z117.boolean(),
3119
- isHidden: z117.boolean(),
3120
- createdAt: z117.coerce.date(),
3121
- updatedAt: z117.coerce.date()
3122
- });
3123
-
3124
- // src/dsm/published-doc.ts
3125
- import { z as z118 } from "zod";
3126
- var publishedDocEnvironments = ["Live", "Preview"];
3127
- var PublishedDocEnvironment = z118.enum(publishedDocEnvironments);
3128
- var PublishedDocsChecksums = z118.record(z118.string());
3129
- var PublishedDocRoutingVersion = z118.enum(["1", "2"]);
3130
- var PublishedDoc = z118.object({
3131
- id: z118.string(),
3132
- designSystemVersionId: z118.string(),
3133
- createdAt: z118.coerce.date(),
3134
- updatedAt: z118.coerce.date(),
3135
- lastPublishedAt: z118.coerce.date(),
3136
- isDefault: z118.boolean(),
3137
- isPublic: z118.boolean(),
3138
- environment: PublishedDocEnvironment,
3139
- checksums: PublishedDocsChecksums,
3140
- storagePath: z118.string(),
3141
- wasMigrated: z118.boolean(),
3142
- routingVersion: PublishedDocRoutingVersion,
3143
- usesLocalizations: z118.boolean(),
3144
- wasPublishedWithLocalizations: z118.boolean(),
3145
- tokenCount: z118.number(),
3146
- assetCount: z118.number()
3147
- });
3148
-
3149
- // src/dsm/version.ts
3150
- import { z as z119 } from "zod";
3151
- var DesignSystemVersion = z119.object({
3152
- id: z119.string(),
3153
- version: z119.string(),
3154
- createdAt: z119.date(),
3155
- designSystemId: z119.string(),
3156
- name: z119.string(),
3157
- comment: z119.string(),
3158
- isReadonly: z119.boolean(),
3159
- changeLog: z119.string(),
3160
- parentId: z119.string().optional(),
3161
- isDraftsFeatureAdopted: z119.boolean()
3162
- });
3163
- var VersionCreationJobStatus = z119.enum(["Success", "InProgress", "Error"]);
3164
- var VersionCreationJob = z119.object({
3165
- id: z119.string(),
3166
- version: z119.string(),
3167
- designSystemId: z119.string(),
3168
- designSystemVersionId: nullishToOptional(z119.string()),
3169
- status: VersionCreationJobStatus,
3170
- errorMessage: nullishToOptional(z119.string())
3171
- });
3172
-
3173
- // src/export/export-destinations.ts
3174
- var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
3175
- var BITBUCKET_MAX_LENGTH = 64;
3176
- var ExportJobDocumentationChanges = z120.object({
3177
- pagePersistentIds: z120.string().array(),
3178
- groupPersistentIds: z120.string().array()
3179
- });
3180
- var ExporterDestinationDocs = z120.object({
3181
- environment: PublishedDocEnvironment,
3182
- changes: nullishToOptional(ExportJobDocumentationChanges)
3183
- });
3184
- var ExporterDestinationS3 = z120.object({});
3185
- var ExporterDestinationGithub = z120.object({
3186
- credentialId: z120.string().optional(),
3187
- // Repository
3188
- url: z120.string(),
3189
- // Location
3190
- branch: z120.string(),
3191
- relativePath: nullishToOptional(z120.string()),
3192
- // Legacy deprecated fields. Use `credentialId` instead
3193
- connectionId: nullishToOptional(z120.string()),
3194
- userId: nullishToOptional(z120.number())
3195
- });
3196
- var ExporterDestinationAzure = z120.object({
3197
- credentialId: z120.string().optional(),
3198
- // Repository
3199
- organizationId: z120.string(),
3200
- projectId: z120.string(),
3201
- repositoryId: z120.string(),
3202
- // Location
3203
- branch: z120.string(),
3204
- relativePath: nullishToOptional(z120.string()),
3205
- // Maybe not needed
3206
- url: nullishToOptional(z120.string()),
3207
- // Legacy deprecated fields. Use `credentialId` instead
3208
- connectionId: nullishToOptional(z120.string()),
3209
- userId: nullishToOptional(z120.number())
3210
- });
3211
- var ExporterDestinationGitlab = z120.object({
3212
- credentialId: z120.string().optional(),
3213
- // Repository
3214
- projectId: z120.string(),
3215
- // Location
3216
- branch: z120.string(),
3217
- relativePath: nullishToOptional(z120.string()),
3218
- // Maybe not needed
3219
- url: nullishToOptional(z120.string()),
3220
- // Legacy deprecated fields. Use `credentialId` instead
3221
- connectionId: nullishToOptional(z120.string()),
3222
- userId: nullishToOptional(z120.number())
3223
- });
3224
- var ExporterDestinationBitbucket = z120.object({
3225
- credentialId: z120.string().optional(),
3226
- // Repository
3227
- workspaceSlug: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3228
- projectKey: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3229
- repoSlug: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3230
- // Location
3231
- branch: z120.string(),
3232
- relativePath: nullishToOptional(z120.string()),
3233
- // Legacy deprecated fields. Use `credentialId` instead
3234
- connectionId: nullishToOptional(z120.string()),
3235
- userId: nullishToOptional(z120.number())
3236
- });
3237
- var ExportDestinationsMap = z120.object({
3238
- webhookUrl: z120.string().optional(),
3239
- destinationSnDocs: ExporterDestinationDocs.optional(),
3240
- destinationS3: ExporterDestinationS3.optional(),
3241
- destinationGithub: ExporterDestinationGithub.optional(),
3242
- destinationAzure: ExporterDestinationAzure.optional(),
3243
- destinationGitlab: ExporterDestinationGitlab.optional(),
3244
- destinationBitbucket: ExporterDestinationBitbucket.optional()
3245
- });
3246
-
3247
- // src/export/pipeline.ts
3248
- var PipelineEventType = z121.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
3249
- var PipelineDestinationGitType = z121.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
3250
- var PipelineDestinationExtraType = z121.enum(["WebhookUrl", "S3", "Documentation"]);
3251
- var PipelineDestinationType = z121.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
3252
- var Pipeline = z121.object({
3253
- id: z121.string(),
3254
- name: z121.string(),
3255
- eventType: PipelineEventType,
3256
- isEnabled: z121.boolean(),
3257
- workspaceId: z121.string(),
3258
- designSystemId: z121.string(),
3259
- exporterId: z121.string(),
3260
- brandPersistentId: z121.string().optional(),
3261
- themePersistentId: z121.string().optional(),
3262
- // Destinations
3263
- ...ExportDestinationsMap.shape
3264
- });
3265
-
3266
- // src/data-dumps/code-integration-dump.ts
3267
- var ExportJobDump = z122.object({
3268
- id: z122.string(),
3269
- createdAt: z122.coerce.date(),
3270
- finishedAt: z122.coerce.date(),
3271
- exportArtefacts: z122.string()
3272
- });
3273
- var CodeIntegrationDump = z122.object({
3274
- exporters: Exporter.array(),
3275
- pipelines: Pipeline.array(),
3276
- exportJobs: ExportJobDump.array()
3277
- });
3278
-
3279
- // src/data-dumps/design-system-dump.ts
3280
- import { z as z129 } from "zod";
3281
-
3282
- // src/data-dumps/design-system-version-dump.ts
3283
- import { z as z128 } from "zod";
3284
-
3285
- // src/liveblocks/rooms/design-system-version-room.ts
3286
- import { z as z123 } from "zod";
3287
- var DesignSystemVersionRoom = Entity.extend({
3288
- designSystemVersionId: z123.string(),
3289
- liveblocksId: z123.string()
3290
- });
3291
- var DesignSystemVersionRoomInternalSettings = z123.object({
3292
- routingVersion: z123.string(),
3293
- isDraftFeatureAdopted: z123.boolean()
3294
- });
3295
- var DesignSystemVersionRoomInitialState = z123.object({
3296
- pages: z123.array(DocumentationPageV2),
3297
- groups: z123.array(ElementGroup),
3298
- pageSnapshots: z123.array(DocumentationPageSnapshot),
3299
- groupSnapshots: z123.array(ElementGroupSnapshot),
3300
- internalSettings: DesignSystemVersionRoomInternalSettings
3301
- });
3302
- var DesignSystemVersionRoomUpdate = z123.object({
3303
- pages: z123.array(DocumentationPageV2),
3304
- groups: z123.array(ElementGroup),
3305
- pageIdsToDelete: z123.array(z123.string()),
3306
- groupIdsToDelete: z123.array(z123.string()),
3307
- pageSnapshots: z123.array(DocumentationPageSnapshot),
3308
- groupSnapshots: z123.array(ElementGroupSnapshot),
3309
- pageSnapshotIdsToDelete: z123.array(z123.string()),
3310
- groupSnapshotIdsToDelete: z123.array(z123.string()),
3311
- pageHashesToUpdate: z123.record(z123.string(), z123.string())
3312
- });
3313
-
3314
- // src/liveblocks/rooms/documentation-page-room.ts
3315
- import { z as z124 } from "zod";
3316
- var DocumentationPageRoom = Entity.extend({
3317
- designSystemVersionId: z124.string(),
3318
- documentationPageId: z124.string(),
3319
- liveblocksId: z124.string(),
3320
- isDirty: z124.boolean()
3321
- });
3322
- var DocumentationPageRoomState = z124.object({
3323
- pageItems: z124.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3324
- itemConfiguration: DocumentationItemConfigurationV2
3325
- });
3326
- var DocumentationPageRoomRoomUpdate = z124.object({
3327
- page: DocumentationPageV2,
3328
- pageParent: ElementGroup
3329
- });
3330
- var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
3331
- pageItems: z124.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3332
- blockDefinitions: z124.array(PageBlockDefinition)
3333
- });
3334
- var RestoredDocumentationPage = z124.object({
3335
- page: DocumentationPageV2,
3336
- pageParent: ElementGroup,
3337
- pageContent: DocumentationPageContentData,
3338
- contentHash: z124.string(),
3339
- roomId: z124.string().optional()
3340
- });
3341
- var RestoredDocumentationGroup = z124.object({
3342
- group: ElementGroup,
3343
- parent: ElementGroup
3344
- });
3345
-
3346
- // src/liveblocks/rooms/room-type.ts
3347
- import { z as z125 } from "zod";
3348
- var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
3349
- RoomTypeEnum2["DocumentationPage"] = "documentation-page";
3350
- RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
3351
- RoomTypeEnum2["Workspace"] = "workspace";
3352
- return RoomTypeEnum2;
3353
- })(RoomTypeEnum || {});
3354
- var RoomTypeSchema = z125.nativeEnum(RoomTypeEnum);
3355
- var RoomType = RoomTypeSchema.enum;
3356
-
3357
- // src/liveblocks/rooms/workspace-room.ts
3358
- import { z as z126 } from "zod";
3359
- var WorkspaceRoom = Entity.extend({
3360
- workspaceId: z126.string(),
3361
- liveblocksId: z126.string()
3362
- });
3363
-
3364
- // src/data-dumps/published-docs-dump.ts
3365
- import { z as z127 } from "zod";
3366
- var PublishedDocsDump = z127.object({
3367
- documentation: PublishedDoc,
3368
- pages: PublishedDocPage.array()
3369
- });
3370
-
3371
- // src/data-dumps/design-system-version-dump.ts
3372
- var DocumentationThreadDump = z128.object({
3373
- thread: DocumentationCommentThread,
3374
- comments: DocumentationComment.array()
3375
- });
3376
- var DocumentationPageRoomDump = z128.object({
3377
- room: DocumentationPageRoom,
3378
- threads: DocumentationThreadDump.array()
3379
- });
3380
- var DesignSystemVersionMultiplayerDump = z128.object({
3381
- documentationPages: DocumentationPageRoomDump.array()
3382
- });
3383
- var DesignSystemVersionDump = z128.object({
3384
- version: DesignSystemVersion,
3385
- brands: Brand.array(),
3386
- elements: DesignElement.array(),
3387
- elementPropertyDefinitions: ElementPropertyDefinition.array(),
3388
- elementPropertyValues: ElementPropertyValue.array(),
3389
- elementViews: ElementView.array(),
3390
- elementColumns: ElementViewColumn.array(),
3391
- documentationPageContents: DocumentationPageContent.array(),
3392
- documentationPageRooms: DocumentationPageRoomDump.array(),
3393
- publishedDocumentations: PublishedDocsDump.array(),
3394
- assetReferences: AssetReference.array()
3395
- });
3396
-
3397
- // src/data-dumps/design-system-dump.ts
3398
- var DesignSystemDump = z129.object({
3399
- designSystem: DesignSystem,
3400
- dataSources: DataSource.array(),
3401
- versions: DesignSystemVersionDump.array(),
3402
- customDomain: CustomDomain.optional(),
3403
- files: Asset.array()
3404
- });
3405
-
3406
- // src/data-dumps/user-data-dump.ts
3407
- import { z as z142 } from "zod";
3408
-
3409
- // src/users/linked-integrations.ts
3410
- import { z as z130 } from "zod";
3411
- var IntegrationAuthType = z130.union([z130.literal("OAuth2"), z130.literal("PAT")]);
3412
- var ExternalServiceType = z130.union([
3413
- z130.literal("figma"),
3414
- z130.literal("github"),
3415
- z130.literal("azure"),
3416
- z130.literal("gitlab"),
3417
- z130.literal("bitbucket")
3418
- ]);
3419
- var IntegrationUserInfo = z130.object({
3420
- id: z130.string(),
3421
- handle: z130.string().optional(),
3422
- avatarUrl: z130.string().optional(),
3423
- email: z130.string().optional(),
3424
- authType: IntegrationAuthType.optional(),
3425
- customUrl: z130.string().optional()
3426
- });
3427
- var UserLinkedIntegrations = z130.object({
3428
- figma: IntegrationUserInfo.optional(),
3429
- github: IntegrationUserInfo.array().optional(),
3430
- azure: IntegrationUserInfo.array().optional(),
3431
- gitlab: IntegrationUserInfo.array().optional(),
3432
- bitbucket: IntegrationUserInfo.array().optional()
3433
- });
3434
-
3435
- // src/users/user-analytics-cleanup-schedule.ts
3436
- import { z as z131 } from "zod";
3437
- var UserAnalyticsCleanupSchedule = z131.object({
3438
- userId: z131.string(),
3439
- createdAt: z131.coerce.date(),
3440
- deleteAt: z131.coerce.date()
3441
- });
3442
- var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
3443
- createdAt: true
3444
- });
3445
-
3446
- // src/users/user-create.ts
3447
- import { z as z132 } from "zod";
3448
- var CreateUserInput = z132.object({
3449
- email: z132.string(),
3450
- name: z132.string(),
3451
- username: z132.string()
3452
- });
3453
-
3454
- // src/users/user-identity.ts
3455
- import { z as z133 } from "zod";
3456
- var UserIdentity = z133.object({
3457
- id: z133.string(),
3458
- userId: z133.string()
3459
- });
3460
-
3461
- // src/users/user-minified.ts
3462
- import { z as z134 } from "zod";
3463
- var UserMinified = z134.object({
3464
- id: z134.string(),
3465
- name: z134.string(),
3466
- email: z134.string(),
3467
- avatar: z134.string().optional()
3468
- });
3469
-
3470
- // src/users/user-notification-settings.ts
3471
- import { z as z135 } from "zod";
3472
- var LiveblocksNotificationSettings = z135.object({
3473
- sendCommentNotificationEmails: z135.boolean()
3474
- });
3475
- var UserNotificationSettings = z135.object({
3476
- liveblocksNotificationSettings: LiveblocksNotificationSettings
3477
- });
3478
- var defaultNotificationSettings = {
3479
- liveblocksNotificationSettings: {
3480
- sendCommentNotificationEmails: true
3481
- }
3482
- };
3483
-
3484
- // src/users/user-profile.ts
3485
- import { z as z136 } from "zod";
3486
- var UserOnboardingDepartment = z136.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
3487
- var UserOnboardingJobLevel = z136.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
3488
- var UserOnboarding = z136.object({
3489
- companyName: z136.string().optional(),
3490
- numberOfPeopleInOrg: z136.string().optional(),
3491
- numberOfPeopleInDesignTeam: z136.string().optional(),
3492
- department: UserOnboardingDepartment.optional(),
3493
- jobTitle: z136.string().optional(),
3494
- phase: z136.string().optional(),
3495
- jobLevel: UserOnboardingJobLevel.optional(),
3496
- designSystemName: z136.string().optional(),
3497
- defaultDestination: z136.string().optional(),
3498
- figmaUrl: z136.string().optional()
3499
- });
3500
- var UserProfile = z136.object({
3501
- name: z136.string(),
3502
- avatar: z136.string().optional(),
3503
- nickname: z136.string().optional(),
3504
- onboarding: UserOnboarding.optional()
3505
- });
3506
- var UserProfileUpdate = UserProfile.partial().omit({
3507
- avatar: true
3508
- });
3509
-
3510
- // src/users/user-test.ts
3511
- import { z as z137 } from "zod";
3512
- var UserTest = z137.object({
3513
- id: z137.string(),
3514
- email: z137.string()
3515
- });
3516
-
3517
- // src/users/user.ts
3518
- import { z as z138 } from "zod";
3519
- var User = z138.object({
3520
- id: z138.string(),
3521
- email: z138.string(),
3522
- emailVerified: z138.boolean(),
3523
- createdAt: z138.coerce.date(),
3524
- trialExpiresAt: z138.coerce.date().optional(),
3525
- profile: UserProfile,
3526
- linkedIntegrations: UserLinkedIntegrations.optional(),
3527
- loggedOutAt: z138.coerce.date().optional(),
3528
- isProtected: z138.boolean()
3529
- });
3530
-
3531
- // src/data-dumps/workspace-dump.ts
3532
- import { z as z141 } from "zod";
3533
-
3534
- // src/integrations/integration.ts
3535
- import { z as z140 } from "zod";
3536
-
3537
- // src/utils/errors.ts
3538
- var SupernovaException = class _SupernovaException extends Error {
3539
- //
3540
- // Properties
3541
- //
3542
- constructor(type, message) {
3543
- super(`${type}: ${message}`);
3544
- this.type = type;
3545
- }
3546
- static wrongFormat(message) {
3547
- return new _SupernovaException("WrongFormat", message);
3548
- }
3549
- static validationError(message) {
3550
- return new _SupernovaException("ValidationError", message);
3551
- }
3552
- static accessDenied(message) {
3553
- return new _SupernovaException("AccessDenied", message);
3554
- }
3555
- static tooMuchWork(message) {
3556
- return new _SupernovaException("TooMuchWork", message);
3557
- }
3558
- static notFound(message) {
3559
- return new _SupernovaException("ResourceNotFound", message);
3560
- }
3561
- static timeout(message) {
3562
- return new _SupernovaException("Timeout", message);
3563
- }
3564
- static conflict(message) {
3565
- return new _SupernovaException("Conflict", message);
3566
- }
3567
- static notImplemented(message) {
3568
- return new _SupernovaException("NotImplemented", message);
3569
- }
3570
- static wrongActionOrder(message) {
3571
- return new _SupernovaException("WrongActionOrder", message);
3572
- }
3573
- static invalidOperation(message) {
3574
- return new _SupernovaException("InvalidOperation", message);
3575
- }
3576
- static shouldNotHappen(message) {
3577
- return new _SupernovaException("UnexpectedError", message);
3578
- }
3579
- static ipRestricted(message) {
3580
- return new _SupernovaException("IPRestricted", message);
3581
- }
3582
- static planRestricted(message) {
3583
- return new _SupernovaException("PlanRestricted", message);
3584
- }
3585
- static missingWorkspacePermission(message) {
3586
- return new _SupernovaException("MissingWorkspacePermission", message);
3587
- }
3588
- static missingExporterPermission(message) {
3589
- return new _SupernovaException("MissingExporterPermission", message);
3590
- }
3591
- static missingIntegration(message) {
3592
- return new _SupernovaException("MissingIntegration", message);
3593
- }
3594
- static missingIntegrationAccess(message) {
3595
- return new _SupernovaException("MissingIntegrationAccess", message);
3596
- }
3597
- static noAccess(message) {
3598
- return new _SupernovaException("NoAccess", message);
3599
- }
3600
- static missingCredentials(message) {
3601
- return new _SupernovaException("MissingCredentials", message);
3602
- }
3603
- static thirdPartyError(message) {
3604
- return new _SupernovaException("ThirdPartyError", message);
3605
- }
3606
- //
3607
- // To refactor
3608
- //
3609
- static badRequest(message) {
3610
- return new _SupernovaException("BadRequest", message);
3611
- }
3612
- };
3613
-
3614
- // src/utils/common.ts
3615
- function forceUnwrapNullish(value) {
3616
- if (value === null)
3617
- throw new Error("Illegal null");
3618
- if (value === void 0)
3619
- throw new Error("Illegal undefined");
3620
- return value;
3621
- }
3622
- function trimLeadingSlash(string) {
3623
- return string.startsWith("/") ? string.substring(1) : string;
3624
- }
3625
- function trimTrailingSlash(string) {
3626
- return string.endsWith("/") ? string.substring(0, string.length - 1) : string;
3627
- }
3628
- function tryParseUrl(url) {
3629
- try {
3630
- return parseUrl(url);
3631
- } catch (e) {
3632
- console.error(`Error parsing URL ${url}`);
3633
- console.error(e);
3634
- return null;
3635
- }
3636
- }
3637
- function parseUrl(url) {
3638
- return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
3639
- }
3640
- function mapByUnique(items, keyFn) {
3641
- const result = /* @__PURE__ */ new Map();
3642
- for (const item of items) {
3643
- result.set(keyFn(item), item);
3644
- }
3645
- return result;
3646
- }
3647
- function groupBy(items, keyFn) {
3648
- const result = /* @__PURE__ */ new Map();
3649
- for (const item of items) {
3650
- const key = keyFn(item);
3651
- const array = result.get(key);
3652
- if (array) {
3653
- array.push(item);
3654
- } else {
3655
- result.set(key, [item]);
3656
- }
3657
- }
3658
- return result;
3659
- }
3660
- function filterNonNullish(items) {
3661
- return items.filter(Boolean);
3662
- }
3663
- function nonNullishFilter(item) {
3664
- return !!item;
3665
- }
3666
- function nonNullFilter(item) {
3667
- return item !== null;
3668
- }
3669
- function buildConstantEnum(values) {
3670
- const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});
3671
- return constMap;
3672
- }
3673
- async function promiseWithTimeout(timeoutMs, promise) {
3674
- let timeoutHandle;
3675
- const timeoutPromise = new Promise((_, reject) => {
3676
- timeoutHandle = setTimeout(() => reject(SupernovaException.timeout()), timeoutMs);
3677
- });
3678
- const result = await Promise.race([promise(), timeoutPromise]);
3679
- clearTimeout(timeoutHandle);
3680
- return result;
3681
- }
3682
- async function sleep(ms) {
3683
- return new Promise((resolve) => setTimeout(resolve, ms));
3684
- }
3685
- function uniqueBy(items, prop) {
3686
- return Array.from(mapByUnique(items, prop).values());
3687
- }
3688
-
3689
- // src/utils/content-loader-instruction.ts
3690
- import { z as z139 } from "zod";
3691
- var ContentLoadInstruction = z139.object({
3692
- from: z139.string(),
3693
- to: z139.string(),
3694
- authorizationHeaderKvsId: z139.string().optional(),
3695
- timeout: z139.number().optional()
3696
- });
3697
- var ContentLoaderPayload = z139.object({
3698
- type: z139.literal("Single"),
3699
- instruction: ContentLoadInstruction
3700
- }).or(
3701
- z139.object({
3702
- type: z139.literal("Multiple"),
3703
- loadingChunkSize: z139.number().optional(),
3704
- instructions: z139.array(ContentLoadInstruction)
3705
- })
3706
- ).or(
3707
- z139.object({
3708
- type: z139.literal("S3"),
3709
- location: z139.string()
3710
- })
3711
- );
3006
+ ).or(
3007
+ z105.object({
3008
+ type: z105.literal("S3"),
3009
+ location: z105.string()
3010
+ })
3011
+ );
3712
3012
 
3713
3013
  // src/utils/naming.ts
3714
3014
  function getCodenameFromText(name) {
@@ -4402,10 +3702,724 @@ function isSlugReserved(slug) {
4402
3702
  return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);
4403
3703
  }
4404
3704
 
4405
- // src/utils/validation.ts
4406
- var slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
3705
+ // src/utils/validation.ts
3706
+ var slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
3707
+
3708
+ // src/dsm/element-snapshots/base.ts
3709
+ var DesignElementSnapshotReason = z106.enum(["Publish", "Deletion"]);
3710
+ var DesignElementSnapshotBase = z106.object({
3711
+ id: z106.string(),
3712
+ persistentId: z106.string(),
3713
+ designSystemVersionId: z106.string(),
3714
+ createdAt: z106.coerce.date(),
3715
+ updatedAt: z106.coerce.date(),
3716
+ reason: DesignElementSnapshotReason,
3717
+ createdByUserId: z106.string()
3718
+ });
3719
+ function pickLatestSnapshots(snapshots, getSnapshotElementId) {
3720
+ const groupedSnapshots = groupBy(snapshots, getSnapshotElementId);
3721
+ return Array.from(groupedSnapshots.entries()).map(([_, snapshots2]) => {
3722
+ const sorted = snapshots2.sort((lhs, rhs) => rhs.createdAt.getTime() - lhs.createdAt.getTime());
3723
+ return sorted[0];
3724
+ });
3725
+ }
3726
+
3727
+ // src/dsm/element-snapshots/documentation-page-snapshot.ts
3728
+ import { z as z107 } from "zod";
3729
+ var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
3730
+ page: DocumentationPageV2,
3731
+ pageContentHash: z107.string(),
3732
+ pageContentStorageKey: z107.string()
3733
+ });
3734
+ function pickLatestPageSnapshots(snapshots) {
3735
+ return pickLatestSnapshots(snapshots, (s) => s.page.id);
3736
+ }
3737
+
3738
+ // src/dsm/element-snapshots/group-snapshot.ts
3739
+ var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
3740
+ group: ElementGroup
3741
+ });
3742
+ function pickLatestGroupSnapshots(snapshots) {
3743
+ return pickLatestSnapshots(snapshots, (s) => s.group.id);
3744
+ }
3745
+
3746
+ // src/dsm/views/column.ts
3747
+ import { z as z108 } from "zod";
3748
+ var ElementViewBaseColumnType = z108.enum(["Name", "Description", "Value", "UpdatedAt"]);
3749
+ var ElementViewColumnType = z108.union([
3750
+ z108.literal("BaseProperty"),
3751
+ z108.literal("PropertyDefinition"),
3752
+ z108.literal("Theme")
3753
+ ]);
3754
+ var ElementViewColumnSharedAttributes = z108.object({
3755
+ id: z108.string(),
3756
+ persistentId: z108.string(),
3757
+ elementDataViewId: z108.string(),
3758
+ sortPosition: z108.number(),
3759
+ width: z108.number()
3760
+ });
3761
+ var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
3762
+ type: z108.literal("BaseProperty"),
3763
+ basePropertyType: ElementViewBaseColumnType
3764
+ });
3765
+ var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
3766
+ type: z108.literal("PropertyDefinition"),
3767
+ propertyDefinitionId: z108.string()
3768
+ });
3769
+ var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
3770
+ type: z108.literal("Theme"),
3771
+ themeId: z108.string()
3772
+ });
3773
+ var ElementViewColumn = z108.discriminatedUnion("type", [
3774
+ ElementViewBasePropertyColumn,
3775
+ ElementViewPropertyDefinitionColumn,
3776
+ ElementViewThemeColumn
3777
+ ]);
3778
+
3779
+ // src/dsm/views/view.ts
3780
+ import { z as z109 } from "zod";
3781
+ var ElementView = z109.object({
3782
+ id: z109.string(),
3783
+ persistentId: z109.string(),
3784
+ designSystemVersionId: z109.string(),
3785
+ name: z109.string(),
3786
+ description: z109.string(),
3787
+ targetElementType: ElementPropertyTargetType,
3788
+ isDefault: z109.boolean()
3789
+ });
3790
+
3791
+ // src/dsm/brand.ts
3792
+ import { z as z110 } from "zod";
3793
+ var Brand = z110.object({
3794
+ id: z110.string(),
3795
+ designSystemVersionId: z110.string(),
3796
+ persistentId: z110.string(),
3797
+ name: z110.string(),
3798
+ description: z110.string()
3799
+ });
3800
+
3801
+ // src/dsm/design-system-update.ts
3802
+ import { z as z115 } from "zod";
3803
+
3804
+ // src/dsm/design-system.ts
3805
+ import { z as z114 } from "zod";
3806
+
3807
+ // src/workspace/workspace.ts
3808
+ import IPCIDR from "ip-cidr";
3809
+ import { z as z113 } from "zod";
3810
+
3811
+ // src/workspace/npm-registry-settings.ts
3812
+ import { z as z111 } from "zod";
3813
+ var NpmRegistryAuthType = z111.enum(["Basic", "Bearer", "None", "Custom"]);
3814
+ var NpmRegistryType = z111.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
3815
+ var NpmRegistryBasicAuthConfig = z111.object({
3816
+ authType: z111.literal(NpmRegistryAuthType.Enum.Basic),
3817
+ username: z111.string(),
3818
+ password: z111.string()
3819
+ });
3820
+ var NpmRegistryBearerAuthConfig = z111.object({
3821
+ authType: z111.literal(NpmRegistryAuthType.Enum.Bearer),
3822
+ accessToken: z111.string()
3823
+ });
3824
+ var NpmRegistryNoAuthConfig = z111.object({
3825
+ authType: z111.literal(NpmRegistryAuthType.Enum.None)
3826
+ });
3827
+ var NpmRegistrCustomAuthConfig = z111.object({
3828
+ authType: z111.literal(NpmRegistryAuthType.Enum.Custom),
3829
+ authHeaderName: z111.string(),
3830
+ authHeaderValue: z111.string()
3831
+ });
3832
+ var NpmRegistryAuthConfig = z111.discriminatedUnion("authType", [
3833
+ NpmRegistryBasicAuthConfig,
3834
+ NpmRegistryBearerAuthConfig,
3835
+ NpmRegistryNoAuthConfig,
3836
+ NpmRegistrCustomAuthConfig
3837
+ ]);
3838
+ var NpmRegistryConfigBase = z111.object({
3839
+ registryType: NpmRegistryType,
3840
+ enabledScopes: z111.array(z111.string()),
3841
+ customRegistryUrl: z111.string().optional(),
3842
+ bypassProxy: z111.boolean().default(false),
3843
+ npmProxyRegistryConfigId: z111.string().optional(),
3844
+ npmProxyVersion: z111.number().optional()
3845
+ });
3846
+ var NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);
3847
+
3848
+ // src/workspace/sso-provider.ts
3849
+ import { z as z112 } from "zod";
3850
+ var SsoProvider = z112.object({
3851
+ providerId: z112.string(),
3852
+ defaultAutoInviteValue: z112.boolean(),
3853
+ autoInviteDomains: z112.record(z112.string(), z112.boolean()),
3854
+ skipDocsSupernovaLogin: z112.boolean(),
3855
+ areInvitesDisabled: z112.boolean(),
3856
+ isTestMode: z112.boolean(),
3857
+ emailDomains: z112.array(z112.string()),
3858
+ metadataXml: z112.string().nullish()
3859
+ });
3860
+
3861
+ // src/workspace/workspace.ts
3862
+ var isValidCIDR = (value) => {
3863
+ return IPCIDR.isValidAddress(value);
3864
+ };
3865
+ var WorkspaceIpWhitelistEntry = z113.object({
3866
+ isEnabled: z113.boolean(),
3867
+ name: z113.string(),
3868
+ range: z113.string().refine(isValidCIDR, {
3869
+ message: "Invalid IP CIDR"
3870
+ })
3871
+ });
3872
+ var WorkspaceIpSettings = z113.object({
3873
+ isEnabledForCloud: z113.boolean(),
3874
+ isEnabledForDocs: z113.boolean(),
3875
+ entries: z113.array(WorkspaceIpWhitelistEntry)
3876
+ });
3877
+ var WorkspaceProfile = z113.object({
3878
+ name: z113.string(),
3879
+ handle: z113.string(),
3880
+ color: z113.string(),
3881
+ avatar: nullishToOptional(z113.string()),
3882
+ billingDetails: nullishToOptional(BillingDetails)
3883
+ });
3884
+ var WorkspaceProfileUpdate = WorkspaceProfile.omit({
3885
+ avatar: true
3886
+ });
3887
+ var Workspace = z113.object({
3888
+ id: z113.string(),
3889
+ profile: WorkspaceProfile,
3890
+ subscription: Subscription,
3891
+ ipWhitelist: nullishToOptional(WorkspaceIpSettings),
3892
+ sso: nullishToOptional(SsoProvider),
3893
+ npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
3894
+ });
3895
+ var WorkspaceWithDesignSystems = z113.object({
3896
+ workspace: Workspace,
3897
+ designSystems: z113.array(DesignSystem)
3898
+ });
3899
+
3900
+ // src/dsm/design-system.ts
3901
+ var DesignSystemSwitcher = z114.object({
3902
+ isEnabled: z114.boolean(),
3903
+ designSystemIds: z114.array(z114.string())
3904
+ });
3905
+ var DesignSystem = z114.object({
3906
+ id: z114.string(),
3907
+ workspaceId: z114.string(),
3908
+ name: z114.string(),
3909
+ description: z114.string(),
3910
+ docExporterId: nullishToOptional(z114.string()),
3911
+ docSlug: z114.string(),
3912
+ docUserSlug: nullishToOptional(z114.string()),
3913
+ docSlugDeprecated: z114.string(),
3914
+ isPublic: z114.boolean(),
3915
+ isMultibrand: z114.boolean(),
3916
+ docViewUrl: nullishToOptional(z114.string()),
3917
+ basePrefixes: z114.array(z114.string()),
3918
+ designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
3919
+ createdAt: z114.coerce.date(),
3920
+ updatedAt: z114.coerce.date()
3921
+ });
3922
+ var DesignSystemWithWorkspace = z114.object({
3923
+ designSystem: DesignSystem,
3924
+ workspace: Workspace
3925
+ });
3926
+
3927
+ // src/dsm/design-system-update.ts
3928
+ var DS_NAME_MIN_LENGTH = 2;
3929
+ var DS_NAME_MAX_LENGTH = 64;
3930
+ var DS_DESC_MAX_LENGTH = 64;
3931
+ var DesignSystemUpdateInputMetadata = z115.object({
3932
+ name: z115.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
3933
+ description: z115.string().max(DS_DESC_MAX_LENGTH).trim().optional()
3934
+ });
3935
+ var DesignSystemUpdateInput = DesignSystem.partial().omit({
3936
+ id: true,
3937
+ createdAt: true,
3938
+ updatedAt: true,
3939
+ docSlug: true,
3940
+ docViewUrl: true,
3941
+ designSystemSwitcher: true
3942
+ }).extend({
3943
+ meta: DesignSystemUpdateInputMetadata.optional()
3944
+ });
3945
+
3946
+ // src/dsm/desing-system-create.ts
3947
+ import { z as z116 } from "zod";
3948
+ var DS_NAME_MIN_LENGTH2 = 2;
3949
+ var DS_NAME_MAX_LENGTH2 = 64;
3950
+ var DS_DESC_MAX_LENGTH2 = 64;
3951
+ var DesignSystemCreateInputMetadata = z116.object({
3952
+ name: z116.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
3953
+ description: z116.string().max(DS_DESC_MAX_LENGTH2).trim()
3954
+ });
3955
+ var DesignSystemCreateInput = z116.object({
3956
+ meta: DesignSystemCreateInputMetadata,
3957
+ workspaceId: z116.string(),
3958
+ isPublic: z116.boolean().optional(),
3959
+ basePrefixes: z116.array(z116.string()).optional(),
3960
+ docUserSlug: z116.string().nullish().optional(),
3961
+ source: z116.array(z116.string()).optional()
3962
+ });
3963
+
3964
+ // src/dsm/exporter-property-values-collection.ts
3965
+ import { z as z117 } from "zod";
3966
+ var ExporterPropertyImageValue = z117.object({
3967
+ asset: PageBlockAsset.optional(),
3968
+ assetId: z117.string().optional(),
3969
+ assetUrl: z117.string().optional()
3970
+ });
3971
+ var ExporterPropertyValue = z117.object({
3972
+ key: z117.string(),
3973
+ value: z117.union([
3974
+ z117.number(),
3975
+ z117.string(),
3976
+ z117.boolean(),
3977
+ ExporterPropertyImageValue,
3978
+ ColorTokenData,
3979
+ TypographyTokenData
3980
+ ])
3981
+ });
3982
+ var ExporterPropertyValuesCollection = z117.object({
3983
+ id: z117.string(),
3984
+ designSystemId: z117.string(),
3985
+ exporterId: z117.string(),
3986
+ values: z117.array(ExporterPropertyValue)
3987
+ });
3988
+
3989
+ // src/dsm/published-doc-page.ts
3990
+ import { z as z118 } from "zod";
3991
+ var SHORT_PERSISTENT_ID_LENGTH = 8;
3992
+ function tryParseShortPersistentId(url = "/") {
3993
+ const lastUrlPart = url.split("/").pop() || "";
3994
+ const shortPersistentId = lastUrlPart.split("-").pop()?.replaceAll(".html", "") || null;
3995
+ return shortPersistentId?.length === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;
3996
+ }
3997
+ var PublishedDocPage = z118.object({
3998
+ id: z118.string(),
3999
+ publishedDocId: z118.string(),
4000
+ pageShortPersistentId: z118.string(),
4001
+ pathV1: z118.string(),
4002
+ pathV2: z118.string(),
4003
+ storagePath: z118.string(),
4004
+ locale: z118.string().optional(),
4005
+ isPrivate: z118.boolean(),
4006
+ isHidden: z118.boolean(),
4007
+ createdAt: z118.coerce.date(),
4008
+ updatedAt: z118.coerce.date()
4009
+ });
4010
+
4011
+ // src/dsm/published-doc.ts
4012
+ import { z as z119 } from "zod";
4013
+ var publishedDocEnvironments = ["Live", "Preview"];
4014
+ var PublishedDocEnvironment = z119.enum(publishedDocEnvironments);
4015
+ var PublishedDocsChecksums = z119.record(z119.string());
4016
+ var PublishedDocRoutingVersion = z119.enum(["1", "2"]);
4017
+ var PublishedDoc = z119.object({
4018
+ id: z119.string(),
4019
+ designSystemVersionId: z119.string(),
4020
+ createdAt: z119.coerce.date(),
4021
+ updatedAt: z119.coerce.date(),
4022
+ lastPublishedAt: z119.coerce.date(),
4023
+ isDefault: z119.boolean(),
4024
+ isPublic: z119.boolean(),
4025
+ environment: PublishedDocEnvironment,
4026
+ checksums: PublishedDocsChecksums,
4027
+ storagePath: z119.string(),
4028
+ wasMigrated: z119.boolean(),
4029
+ routingVersion: PublishedDocRoutingVersion,
4030
+ usesLocalizations: z119.boolean(),
4031
+ wasPublishedWithLocalizations: z119.boolean(),
4032
+ tokenCount: z119.number(),
4033
+ assetCount: z119.number()
4034
+ });
4035
+
4036
+ // src/dsm/version.ts
4037
+ import { z as z120 } from "zod";
4038
+ var DesignSystemVersion = z120.object({
4039
+ id: z120.string(),
4040
+ version: z120.string(),
4041
+ createdAt: z120.date(),
4042
+ designSystemId: z120.string(),
4043
+ name: z120.string(),
4044
+ comment: z120.string(),
4045
+ isReadonly: z120.boolean(),
4046
+ changeLog: z120.string(),
4047
+ parentId: z120.string().optional(),
4048
+ isDraftsFeatureAdopted: z120.boolean()
4049
+ });
4050
+ var VersionCreationJobStatus = z120.enum(["Success", "InProgress", "Error"]);
4051
+ var VersionCreationJob = z120.object({
4052
+ id: z120.string(),
4053
+ version: z120.string(),
4054
+ designSystemId: z120.string(),
4055
+ designSystemVersionId: nullishToOptional(z120.string()),
4056
+ status: VersionCreationJobStatus,
4057
+ errorMessage: nullishToOptional(z120.string())
4058
+ });
4059
+
4060
+ // src/export/export-destinations.ts
4061
+ var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
4062
+ var BITBUCKET_MAX_LENGTH = 64;
4063
+ var ExportJobDocumentationChanges = z121.object({
4064
+ pagePersistentIds: z121.string().array(),
4065
+ groupPersistentIds: z121.string().array()
4066
+ });
4067
+ var ExporterDestinationDocs = z121.object({
4068
+ environment: PublishedDocEnvironment,
4069
+ changes: nullishToOptional(ExportJobDocumentationChanges)
4070
+ });
4071
+ var ExporterDestinationS3 = z121.object({});
4072
+ var ExporterDestinationGithub = z121.object({
4073
+ credentialId: z121.string().optional(),
4074
+ // Repository
4075
+ url: z121.string(),
4076
+ // Location
4077
+ branch: z121.string(),
4078
+ relativePath: nullishToOptional(z121.string()),
4079
+ // Legacy deprecated fields. Use `credentialId` instead
4080
+ connectionId: nullishToOptional(z121.string()),
4081
+ userId: nullishToOptional(z121.number())
4082
+ });
4083
+ var ExporterDestinationAzure = z121.object({
4084
+ credentialId: z121.string().optional(),
4085
+ // Repository
4086
+ organizationId: z121.string(),
4087
+ projectId: z121.string(),
4088
+ repositoryId: z121.string(),
4089
+ // Location
4090
+ branch: z121.string(),
4091
+ relativePath: nullishToOptional(z121.string()),
4092
+ // Maybe not needed
4093
+ url: nullishToOptional(z121.string()),
4094
+ // Legacy deprecated fields. Use `credentialId` instead
4095
+ connectionId: nullishToOptional(z121.string()),
4096
+ userId: nullishToOptional(z121.number())
4097
+ });
4098
+ var ExporterDestinationGitlab = z121.object({
4099
+ credentialId: z121.string().optional(),
4100
+ // Repository
4101
+ projectId: z121.string(),
4102
+ // Location
4103
+ branch: z121.string(),
4104
+ relativePath: nullishToOptional(z121.string()),
4105
+ // Maybe not needed
4106
+ url: nullishToOptional(z121.string()),
4107
+ // Legacy deprecated fields. Use `credentialId` instead
4108
+ connectionId: nullishToOptional(z121.string()),
4109
+ userId: nullishToOptional(z121.number())
4110
+ });
4111
+ var ExporterDestinationBitbucket = z121.object({
4112
+ credentialId: z121.string().optional(),
4113
+ // Repository
4114
+ workspaceSlug: z121.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
4115
+ projectKey: z121.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
4116
+ repoSlug: z121.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
4117
+ // Location
4118
+ branch: z121.string(),
4119
+ relativePath: nullishToOptional(z121.string()),
4120
+ // Legacy deprecated fields. Use `credentialId` instead
4121
+ connectionId: nullishToOptional(z121.string()),
4122
+ userId: nullishToOptional(z121.number())
4123
+ });
4124
+ var ExportDestinationsMap = z121.object({
4125
+ webhookUrl: z121.string().optional(),
4126
+ destinationSnDocs: ExporterDestinationDocs.optional(),
4127
+ destinationS3: ExporterDestinationS3.optional(),
4128
+ destinationGithub: ExporterDestinationGithub.optional(),
4129
+ destinationAzure: ExporterDestinationAzure.optional(),
4130
+ destinationGitlab: ExporterDestinationGitlab.optional(),
4131
+ destinationBitbucket: ExporterDestinationBitbucket.optional()
4132
+ });
4133
+
4134
+ // src/export/pipeline.ts
4135
+ var PipelineEventType = z122.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
4136
+ var PipelineDestinationGitType = z122.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
4137
+ var PipelineDestinationExtraType = z122.enum(["WebhookUrl", "S3", "Documentation"]);
4138
+ var PipelineDestinationType = z122.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
4139
+ var Pipeline = z122.object({
4140
+ id: z122.string(),
4141
+ name: z122.string(),
4142
+ eventType: PipelineEventType,
4143
+ isEnabled: z122.boolean(),
4144
+ workspaceId: z122.string(),
4145
+ designSystemId: z122.string(),
4146
+ exporterId: z122.string(),
4147
+ brandPersistentId: z122.string().optional(),
4148
+ themePersistentId: z122.string().optional(),
4149
+ // Destinations
4150
+ ...ExportDestinationsMap.shape
4151
+ });
4152
+
4153
+ // src/data-dumps/code-integration-dump.ts
4154
+ var ExportJobDump = z123.object({
4155
+ id: z123.string(),
4156
+ createdAt: z123.coerce.date(),
4157
+ finishedAt: z123.coerce.date(),
4158
+ exportArtefacts: z123.string()
4159
+ });
4160
+ var CodeIntegrationDump = z123.object({
4161
+ exporters: Exporter.array(),
4162
+ pipelines: Pipeline.array(),
4163
+ exportJobs: ExportJobDump.array()
4164
+ });
4165
+
4166
+ // src/data-dumps/design-system-dump.ts
4167
+ import { z as z130 } from "zod";
4168
+
4169
+ // src/data-dumps/design-system-version-dump.ts
4170
+ import { z as z129 } from "zod";
4171
+
4172
+ // src/liveblocks/rooms/design-system-version-room.ts
4173
+ import { z as z124 } from "zod";
4174
+ var DesignSystemVersionRoom = Entity.extend({
4175
+ designSystemVersionId: z124.string(),
4176
+ liveblocksId: z124.string()
4177
+ });
4178
+ var DesignSystemVersionRoomInternalSettings = z124.object({
4179
+ routingVersion: z124.string(),
4180
+ isDraftFeatureAdopted: z124.boolean()
4181
+ });
4182
+ var DesignSystemVersionRoomInitialState = z124.object({
4183
+ pages: z124.array(DocumentationPageV2),
4184
+ groups: z124.array(ElementGroup),
4185
+ pageSnapshots: z124.array(DocumentationPageSnapshot),
4186
+ groupSnapshots: z124.array(ElementGroupSnapshot),
4187
+ internalSettings: DesignSystemVersionRoomInternalSettings
4188
+ });
4189
+ var DesignSystemVersionRoomUpdate = z124.object({
4190
+ pages: z124.array(DocumentationPageV2),
4191
+ groups: z124.array(ElementGroup),
4192
+ pageIdsToDelete: z124.array(z124.string()),
4193
+ groupIdsToDelete: z124.array(z124.string()),
4194
+ pageSnapshots: z124.array(DocumentationPageSnapshot),
4195
+ groupSnapshots: z124.array(ElementGroupSnapshot),
4196
+ pageSnapshotIdsToDelete: z124.array(z124.string()),
4197
+ groupSnapshotIdsToDelete: z124.array(z124.string()),
4198
+ pageHashesToUpdate: z124.record(z124.string(), z124.string())
4199
+ });
4200
+
4201
+ // src/liveblocks/rooms/documentation-page-room.ts
4202
+ import { z as z125 } from "zod";
4203
+ var DocumentationPageRoom = Entity.extend({
4204
+ designSystemVersionId: z125.string(),
4205
+ documentationPageId: z125.string(),
4206
+ liveblocksId: z125.string(),
4207
+ isDirty: z125.boolean()
4208
+ });
4209
+ var DocumentationPageRoomState = z125.object({
4210
+ pageItems: z125.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
4211
+ itemConfiguration: DocumentationItemConfigurationV2
4212
+ });
4213
+ var DocumentationPageRoomRoomUpdate = z125.object({
4214
+ page: DocumentationPageV2,
4215
+ pageParent: ElementGroup
4216
+ });
4217
+ var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
4218
+ pageItems: z125.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
4219
+ blockDefinitions: z125.array(PageBlockDefinition)
4220
+ });
4221
+ var RestoredDocumentationPage = z125.object({
4222
+ page: DocumentationPageV2,
4223
+ pageParent: ElementGroup,
4224
+ pageContent: DocumentationPageContentData,
4225
+ contentHash: z125.string(),
4226
+ roomId: z125.string().optional()
4227
+ });
4228
+ var RestoredDocumentationGroup = z125.object({
4229
+ group: ElementGroup,
4230
+ parent: ElementGroup
4231
+ });
4232
+
4233
+ // src/liveblocks/rooms/room-type.ts
4234
+ import { z as z126 } from "zod";
4235
+ var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
4236
+ RoomTypeEnum2["DocumentationPage"] = "documentation-page";
4237
+ RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
4238
+ RoomTypeEnum2["Workspace"] = "workspace";
4239
+ return RoomTypeEnum2;
4240
+ })(RoomTypeEnum || {});
4241
+ var RoomTypeSchema = z126.nativeEnum(RoomTypeEnum);
4242
+ var RoomType = RoomTypeSchema.enum;
4243
+
4244
+ // src/liveblocks/rooms/workspace-room.ts
4245
+ import { z as z127 } from "zod";
4246
+ var WorkspaceRoom = Entity.extend({
4247
+ workspaceId: z127.string(),
4248
+ liveblocksId: z127.string()
4249
+ });
4250
+
4251
+ // src/data-dumps/published-docs-dump.ts
4252
+ import { z as z128 } from "zod";
4253
+ var PublishedDocsDump = z128.object({
4254
+ documentation: PublishedDoc,
4255
+ pages: PublishedDocPage.array()
4256
+ });
4257
+
4258
+ // src/data-dumps/design-system-version-dump.ts
4259
+ var DocumentationThreadDump = z129.object({
4260
+ thread: DocumentationCommentThread,
4261
+ comments: DocumentationComment.array()
4262
+ });
4263
+ var DocumentationPageRoomDump = z129.object({
4264
+ room: DocumentationPageRoom,
4265
+ threads: DocumentationThreadDump.array()
4266
+ });
4267
+ var DesignSystemVersionMultiplayerDump = z129.object({
4268
+ documentationPages: DocumentationPageRoomDump.array()
4269
+ });
4270
+ var DesignSystemVersionDump = z129.object({
4271
+ version: DesignSystemVersion,
4272
+ brands: Brand.array(),
4273
+ elements: DesignElement.array(),
4274
+ elementPropertyDefinitions: ElementPropertyDefinition.array(),
4275
+ elementPropertyValues: ElementPropertyValue.array(),
4276
+ elementViews: ElementView.array(),
4277
+ elementColumns: ElementViewColumn.array(),
4278
+ documentationPageContents: DocumentationPageContent.array(),
4279
+ documentationPageRooms: DocumentationPageRoomDump.array(),
4280
+ publishedDocumentations: PublishedDocsDump.array(),
4281
+ assetReferences: AssetReference.array()
4282
+ });
4283
+
4284
+ // src/data-dumps/design-system-dump.ts
4285
+ var DesignSystemDump = z130.object({
4286
+ designSystem: DesignSystem,
4287
+ dataSources: DataSource.array(),
4288
+ versions: DesignSystemVersionDump.array(),
4289
+ customDomain: CustomDomain.optional(),
4290
+ files: Asset.array()
4291
+ });
4292
+
4293
+ // src/data-dumps/user-data-dump.ts
4294
+ import { z as z142 } from "zod";
4295
+
4296
+ // src/users/linked-integrations.ts
4297
+ import { z as z131 } from "zod";
4298
+ var IntegrationAuthType = z131.union([z131.literal("OAuth2"), z131.literal("PAT")]);
4299
+ var ExternalServiceType = z131.union([
4300
+ z131.literal("figma"),
4301
+ z131.literal("github"),
4302
+ z131.literal("azure"),
4303
+ z131.literal("gitlab"),
4304
+ z131.literal("bitbucket")
4305
+ ]);
4306
+ var IntegrationUserInfo = z131.object({
4307
+ id: z131.string(),
4308
+ handle: z131.string().optional(),
4309
+ avatarUrl: z131.string().optional(),
4310
+ email: z131.string().optional(),
4311
+ authType: IntegrationAuthType.optional(),
4312
+ customUrl: z131.string().optional()
4313
+ });
4314
+ var UserLinkedIntegrations = z131.object({
4315
+ figma: IntegrationUserInfo.optional(),
4316
+ github: IntegrationUserInfo.array().optional(),
4317
+ azure: IntegrationUserInfo.array().optional(),
4318
+ gitlab: IntegrationUserInfo.array().optional(),
4319
+ bitbucket: IntegrationUserInfo.array().optional()
4320
+ });
4321
+
4322
+ // src/users/user-analytics-cleanup-schedule.ts
4323
+ import { z as z132 } from "zod";
4324
+ var UserAnalyticsCleanupSchedule = z132.object({
4325
+ userId: z132.string(),
4326
+ createdAt: z132.coerce.date(),
4327
+ deleteAt: z132.coerce.date()
4328
+ });
4329
+ var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
4330
+ createdAt: true
4331
+ });
4332
+
4333
+ // src/users/user-create.ts
4334
+ import { z as z133 } from "zod";
4335
+ var CreateUserInput = z133.object({
4336
+ email: z133.string(),
4337
+ name: z133.string(),
4338
+ username: z133.string()
4339
+ });
4340
+
4341
+ // src/users/user-identity.ts
4342
+ import { z as z134 } from "zod";
4343
+ var UserIdentity = z134.object({
4344
+ id: z134.string(),
4345
+ userId: z134.string()
4346
+ });
4347
+
4348
+ // src/users/user-minified.ts
4349
+ import { z as z135 } from "zod";
4350
+ var UserMinified = z135.object({
4351
+ id: z135.string(),
4352
+ name: z135.string(),
4353
+ email: z135.string(),
4354
+ avatar: z135.string().optional()
4355
+ });
4356
+
4357
+ // src/users/user-notification-settings.ts
4358
+ import { z as z136 } from "zod";
4359
+ var LiveblocksNotificationSettings = z136.object({
4360
+ sendCommentNotificationEmails: z136.boolean()
4361
+ });
4362
+ var UserNotificationSettings = z136.object({
4363
+ liveblocksNotificationSettings: LiveblocksNotificationSettings
4364
+ });
4365
+ var defaultNotificationSettings = {
4366
+ liveblocksNotificationSettings: {
4367
+ sendCommentNotificationEmails: true
4368
+ }
4369
+ };
4370
+
4371
+ // src/users/user-profile.ts
4372
+ import { z as z137 } from "zod";
4373
+ var UserOnboardingDepartment = z137.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
4374
+ var UserOnboardingJobLevel = z137.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
4375
+ var UserOnboarding = z137.object({
4376
+ companyName: z137.string().optional(),
4377
+ numberOfPeopleInOrg: z137.string().optional(),
4378
+ numberOfPeopleInDesignTeam: z137.string().optional(),
4379
+ department: UserOnboardingDepartment.optional(),
4380
+ jobTitle: z137.string().optional(),
4381
+ phase: z137.string().optional(),
4382
+ jobLevel: UserOnboardingJobLevel.optional(),
4383
+ designSystemName: z137.string().optional(),
4384
+ defaultDestination: z137.string().optional(),
4385
+ figmaUrl: z137.string().optional()
4386
+ });
4387
+ var UserProfile = z137.object({
4388
+ name: z137.string(),
4389
+ avatar: z137.string().optional(),
4390
+ nickname: z137.string().optional(),
4391
+ onboarding: UserOnboarding.optional()
4392
+ });
4393
+ var UserProfileUpdate = UserProfile.partial().omit({
4394
+ avatar: true
4395
+ });
4396
+
4397
+ // src/users/user-test.ts
4398
+ import { z as z138 } from "zod";
4399
+ var UserTest = z138.object({
4400
+ id: z138.string(),
4401
+ email: z138.string()
4402
+ });
4403
+
4404
+ // src/users/user.ts
4405
+ import { z as z139 } from "zod";
4406
+ var User = z139.object({
4407
+ id: z139.string(),
4408
+ email: z139.string(),
4409
+ emailVerified: z139.boolean(),
4410
+ createdAt: z139.coerce.date(),
4411
+ trialExpiresAt: z139.coerce.date().optional(),
4412
+ profile: UserProfile,
4413
+ linkedIntegrations: UserLinkedIntegrations.optional(),
4414
+ loggedOutAt: z139.coerce.date().optional(),
4415
+ isProtected: z139.boolean()
4416
+ });
4417
+
4418
+ // src/data-dumps/workspace-dump.ts
4419
+ import { z as z141 } from "zod";
4407
4420
 
4408
4421
  // src/integrations/integration.ts
4422
+ import { z as z140 } from "zod";
4409
4423
  var IntegrationDesignSystem = z140.object({
4410
4424
  designSystemId: z140.string(),
4411
4425
  brandId: z140.string(),
@@ -5508,6 +5522,9 @@ export {
5508
5522
  nonNullishFilter,
5509
5523
  nullishToOptional,
5510
5524
  parseUrl,
5525
+ pickLatestGroupSnapshots,
5526
+ pickLatestPageSnapshots,
5527
+ pickLatestSnapshots,
5511
5528
  promiseWithTimeout,
5512
5529
  publishedDocEnvironments,
5513
5530
  sleep,