@supernova-studio/model 0.48.13 → 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,884 +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
- createdByUserId: z105.string()
2845
- });
2846
-
2847
- // src/dsm/element-snapshots/documentation-page-snapshot.ts
2848
2835
  import { z as z106 } from "zod";
2849
- var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
2850
- page: DocumentationPageV2,
2851
- pageContentHash: z106.string(),
2852
- pageContentStorageKey: z106.string()
2853
- });
2854
-
2855
- // src/dsm/element-snapshots/group-snapshot.ts
2856
- var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
2857
- group: ElementGroup
2858
- });
2859
-
2860
- // src/dsm/views/column.ts
2861
- import { z as z107 } from "zod";
2862
- var ElementViewBaseColumnType = z107.enum(["Name", "Description", "Value", "UpdatedAt"]);
2863
- var ElementViewColumnType = z107.union([
2864
- z107.literal("BaseProperty"),
2865
- z107.literal("PropertyDefinition"),
2866
- z107.literal("Theme")
2867
- ]);
2868
- var ElementViewColumnSharedAttributes = z107.object({
2869
- id: z107.string(),
2870
- persistentId: z107.string(),
2871
- elementDataViewId: z107.string(),
2872
- sortPosition: z107.number(),
2873
- width: z107.number()
2874
- });
2875
- var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
2876
- type: z107.literal("BaseProperty"),
2877
- basePropertyType: ElementViewBaseColumnType
2878
- });
2879
- var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
2880
- type: z107.literal("PropertyDefinition"),
2881
- propertyDefinitionId: z107.string()
2882
- });
2883
- var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
2884
- type: z107.literal("Theme"),
2885
- themeId: z107.string()
2886
- });
2887
- var ElementViewColumn = z107.discriminatedUnion("type", [
2888
- ElementViewBasePropertyColumn,
2889
- ElementViewPropertyDefinitionColumn,
2890
- ElementViewThemeColumn
2891
- ]);
2892
-
2893
- // src/dsm/views/view.ts
2894
- import { z as z108 } from "zod";
2895
- var ElementView = z108.object({
2896
- id: z108.string(),
2897
- persistentId: z108.string(),
2898
- designSystemVersionId: z108.string(),
2899
- name: z108.string(),
2900
- description: z108.string(),
2901
- targetElementType: ElementPropertyTargetType,
2902
- isDefault: z108.boolean()
2903
- });
2904
-
2905
- // src/dsm/brand.ts
2906
- import { z as z109 } from "zod";
2907
- var Brand = z109.object({
2908
- id: z109.string(),
2909
- designSystemVersionId: z109.string(),
2910
- persistentId: z109.string(),
2911
- name: z109.string(),
2912
- description: z109.string()
2913
- });
2914
-
2915
- // src/dsm/design-system-update.ts
2916
- import { z as z114 } from "zod";
2917
-
2918
- // src/dsm/design-system.ts
2919
- import { z as z113 } from "zod";
2920
2836
 
2921
- // src/workspace/workspace.ts
2922
- import IPCIDR from "ip-cidr";
2923
- import { z as z112 } from "zod";
2924
-
2925
- // src/workspace/npm-registry-settings.ts
2926
- import { z as z110 } from "zod";
2927
- var NpmRegistryAuthType = z110.enum(["Basic", "Bearer", "None", "Custom"]);
2928
- var NpmRegistryType = z110.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
2929
- var NpmRegistryBasicAuthConfig = z110.object({
2930
- authType: z110.literal(NpmRegistryAuthType.Enum.Basic),
2931
- username: z110.string(),
2932
- password: z110.string()
2933
- });
2934
- var NpmRegistryBearerAuthConfig = z110.object({
2935
- authType: z110.literal(NpmRegistryAuthType.Enum.Bearer),
2936
- accessToken: z110.string()
2937
- });
2938
- var NpmRegistryNoAuthConfig = z110.object({
2939
- authType: z110.literal(NpmRegistryAuthType.Enum.None)
2940
- });
2941
- var NpmRegistrCustomAuthConfig = z110.object({
2942
- authType: z110.literal(NpmRegistryAuthType.Enum.Custom),
2943
- authHeaderName: z110.string(),
2944
- authHeaderValue: z110.string()
2945
- });
2946
- var NpmRegistryAuthConfig = z110.discriminatedUnion("authType", [
2947
- NpmRegistryBasicAuthConfig,
2948
- NpmRegistryBearerAuthConfig,
2949
- NpmRegistryNoAuthConfig,
2950
- NpmRegistrCustomAuthConfig
2951
- ]);
2952
- var NpmRegistryConfigBase = z110.object({
2953
- registryType: NpmRegistryType,
2954
- enabledScopes: z110.array(z110.string()),
2955
- customRegistryUrl: z110.string().optional(),
2956
- bypassProxy: z110.boolean().default(false),
2957
- npmProxyRegistryConfigId: z110.string().optional(),
2958
- npmProxyVersion: z110.number().optional()
2959
- });
2960
- 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
+ };
2961
2913
 
2962
- // src/workspace/sso-provider.ts
2963
- import { z as z111 } from "zod";
2964
- var SsoProvider = z111.object({
2965
- providerId: z111.string(),
2966
- defaultAutoInviteValue: z111.boolean(),
2967
- autoInviteDomains: z111.record(z111.string(), z111.boolean()),
2968
- skipDocsSupernovaLogin: z111.boolean(),
2969
- areInvitesDisabled: z111.boolean(),
2970
- isTestMode: z111.boolean(),
2971
- emailDomains: z111.array(z111.string()),
2972
- metadataXml: z111.string().nullish()
2973
- });
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
+ }
2974
2988
 
2975
- // src/workspace/workspace.ts
2976
- var isValidCIDR = (value) => {
2977
- return IPCIDR.isValidAddress(value);
2978
- };
2979
- var WorkspaceIpWhitelistEntry = z112.object({
2980
- isEnabled: z112.boolean(),
2981
- name: z112.string(),
2982
- range: z112.string().refine(isValidCIDR, {
2983
- 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)
2984
3005
  })
2985
- });
2986
- var WorkspaceIpSettings = z112.object({
2987
- isEnabledForCloud: z112.boolean(),
2988
- isEnabledForDocs: z112.boolean(),
2989
- entries: z112.array(WorkspaceIpWhitelistEntry)
2990
- });
2991
- var WorkspaceProfile = z112.object({
2992
- name: z112.string(),
2993
- handle: z112.string(),
2994
- color: z112.string(),
2995
- avatar: nullishToOptional(z112.string()),
2996
- billingDetails: nullishToOptional(BillingDetails)
2997
- });
2998
- var WorkspaceProfileUpdate = WorkspaceProfile.omit({
2999
- avatar: true
3000
- });
3001
- var Workspace = z112.object({
3002
- id: z112.string(),
3003
- profile: WorkspaceProfile,
3004
- subscription: Subscription,
3005
- ipWhitelist: nullishToOptional(WorkspaceIpSettings),
3006
- sso: nullishToOptional(SsoProvider),
3007
- npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
3008
- });
3009
- var WorkspaceWithDesignSystems = z112.object({
3010
- workspace: Workspace,
3011
- designSystems: z112.array(DesignSystem)
3012
- });
3013
-
3014
- // src/dsm/design-system.ts
3015
- var DesignSystemSwitcher = z113.object({
3016
- isEnabled: z113.boolean(),
3017
- designSystemIds: z113.array(z113.string())
3018
- });
3019
- var DesignSystem = z113.object({
3020
- id: z113.string(),
3021
- workspaceId: z113.string(),
3022
- name: z113.string(),
3023
- description: z113.string(),
3024
- docExporterId: nullishToOptional(z113.string()),
3025
- docSlug: z113.string(),
3026
- docUserSlug: nullishToOptional(z113.string()),
3027
- docSlugDeprecated: z113.string(),
3028
- isPublic: z113.boolean(),
3029
- isMultibrand: z113.boolean(),
3030
- docViewUrl: nullishToOptional(z113.string()),
3031
- basePrefixes: z113.array(z113.string()),
3032
- designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
3033
- createdAt: z113.coerce.date(),
3034
- updatedAt: z113.coerce.date()
3035
- });
3036
- var DesignSystemWithWorkspace = z113.object({
3037
- designSystem: DesignSystem,
3038
- workspace: Workspace
3039
- });
3040
-
3041
- // src/dsm/design-system-update.ts
3042
- var DS_NAME_MIN_LENGTH = 2;
3043
- var DS_NAME_MAX_LENGTH = 64;
3044
- var DS_DESC_MAX_LENGTH = 64;
3045
- var DesignSystemUpdateInputMetadata = z114.object({
3046
- name: z114.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
3047
- description: z114.string().max(DS_DESC_MAX_LENGTH).trim().optional()
3048
- });
3049
- var DesignSystemUpdateInput = DesignSystem.partial().omit({
3050
- id: true,
3051
- createdAt: true,
3052
- updatedAt: true,
3053
- docSlug: true,
3054
- docViewUrl: true,
3055
- designSystemSwitcher: true
3056
- }).extend({
3057
- meta: DesignSystemUpdateInputMetadata.optional()
3058
- });
3059
-
3060
- // src/dsm/desing-system-create.ts
3061
- import { z as z115 } from "zod";
3062
- var DS_NAME_MIN_LENGTH2 = 2;
3063
- var DS_NAME_MAX_LENGTH2 = 64;
3064
- var DS_DESC_MAX_LENGTH2 = 64;
3065
- var DesignSystemCreateInputMetadata = z115.object({
3066
- name: z115.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
3067
- description: z115.string().max(DS_DESC_MAX_LENGTH2).trim()
3068
- });
3069
- var DesignSystemCreateInput = z115.object({
3070
- meta: DesignSystemCreateInputMetadata,
3071
- workspaceId: z115.string(),
3072
- isPublic: z115.boolean().optional(),
3073
- basePrefixes: z115.array(z115.string()).optional(),
3074
- docUserSlug: z115.string().nullish().optional(),
3075
- source: z115.array(z115.string()).optional()
3076
- });
3077
-
3078
- // src/dsm/exporter-property-values-collection.ts
3079
- import { z as z116 } from "zod";
3080
- var ExporterPropertyImageValue = z116.object({
3081
- asset: PageBlockAsset.optional(),
3082
- assetId: z116.string().optional(),
3083
- assetUrl: z116.string().optional()
3084
- });
3085
- var ExporterPropertyValue = z116.object({
3086
- key: z116.string(),
3087
- value: z116.union([
3088
- z116.number(),
3089
- z116.string(),
3090
- z116.boolean(),
3091
- ExporterPropertyImageValue,
3092
- ColorTokenData,
3093
- TypographyTokenData
3094
- ])
3095
- });
3096
- var ExporterPropertyValuesCollection = z116.object({
3097
- id: z116.string(),
3098
- designSystemId: z116.string(),
3099
- exporterId: z116.string(),
3100
- values: z116.array(ExporterPropertyValue)
3101
- });
3102
-
3103
- // src/dsm/published-doc-page.ts
3104
- import { z as z117 } from "zod";
3105
- var SHORT_PERSISTENT_ID_LENGTH = 8;
3106
- function tryParseShortPersistentId(url = "/") {
3107
- const lastUrlPart = url.split("/").pop() || "";
3108
- const shortPersistentId = lastUrlPart.split("-").pop()?.replaceAll(".html", "") || null;
3109
- return shortPersistentId?.length === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;
3110
- }
3111
- var PublishedDocPage = z117.object({
3112
- id: z117.string(),
3113
- publishedDocId: z117.string(),
3114
- pageShortPersistentId: z117.string(),
3115
- pathV1: z117.string(),
3116
- pathV2: z117.string(),
3117
- storagePath: z117.string(),
3118
- locale: z117.string().optional(),
3119
- isPrivate: z117.boolean(),
3120
- isHidden: z117.boolean(),
3121
- createdAt: z117.coerce.date(),
3122
- updatedAt: z117.coerce.date()
3123
- });
3124
-
3125
- // src/dsm/published-doc.ts
3126
- import { z as z118 } from "zod";
3127
- var publishedDocEnvironments = ["Live", "Preview"];
3128
- var PublishedDocEnvironment = z118.enum(publishedDocEnvironments);
3129
- var PublishedDocsChecksums = z118.record(z118.string());
3130
- var PublishedDocRoutingVersion = z118.enum(["1", "2"]);
3131
- var PublishedDoc = z118.object({
3132
- id: z118.string(),
3133
- designSystemVersionId: z118.string(),
3134
- createdAt: z118.coerce.date(),
3135
- updatedAt: z118.coerce.date(),
3136
- lastPublishedAt: z118.coerce.date(),
3137
- isDefault: z118.boolean(),
3138
- isPublic: z118.boolean(),
3139
- environment: PublishedDocEnvironment,
3140
- checksums: PublishedDocsChecksums,
3141
- storagePath: z118.string(),
3142
- wasMigrated: z118.boolean(),
3143
- routingVersion: PublishedDocRoutingVersion,
3144
- usesLocalizations: z118.boolean(),
3145
- wasPublishedWithLocalizations: z118.boolean(),
3146
- tokenCount: z118.number(),
3147
- assetCount: z118.number()
3148
- });
3149
-
3150
- // src/dsm/version.ts
3151
- import { z as z119 } from "zod";
3152
- var DesignSystemVersion = z119.object({
3153
- id: z119.string(),
3154
- version: z119.string(),
3155
- createdAt: z119.date(),
3156
- designSystemId: z119.string(),
3157
- name: z119.string(),
3158
- comment: z119.string(),
3159
- isReadonly: z119.boolean(),
3160
- changeLog: z119.string(),
3161
- parentId: z119.string().optional(),
3162
- isDraftsFeatureAdopted: z119.boolean()
3163
- });
3164
- var VersionCreationJobStatus = z119.enum(["Success", "InProgress", "Error"]);
3165
- var VersionCreationJob = z119.object({
3166
- id: z119.string(),
3167
- version: z119.string(),
3168
- designSystemId: z119.string(),
3169
- designSystemVersionId: nullishToOptional(z119.string()),
3170
- status: VersionCreationJobStatus,
3171
- errorMessage: nullishToOptional(z119.string())
3172
- });
3173
-
3174
- // src/export/export-destinations.ts
3175
- var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
3176
- var BITBUCKET_MAX_LENGTH = 64;
3177
- var ExportJobDocumentationChanges = z120.object({
3178
- pagePersistentIds: z120.string().array(),
3179
- groupPersistentIds: z120.string().array()
3180
- });
3181
- var ExporterDestinationDocs = z120.object({
3182
- environment: PublishedDocEnvironment,
3183
- changes: nullishToOptional(ExportJobDocumentationChanges)
3184
- });
3185
- var ExporterDestinationS3 = z120.object({});
3186
- var ExporterDestinationGithub = z120.object({
3187
- credentialId: z120.string().optional(),
3188
- // Repository
3189
- url: z120.string(),
3190
- // Location
3191
- branch: z120.string(),
3192
- relativePath: nullishToOptional(z120.string()),
3193
- // Legacy deprecated fields. Use `credentialId` instead
3194
- connectionId: nullishToOptional(z120.string()),
3195
- userId: nullishToOptional(z120.number())
3196
- });
3197
- var ExporterDestinationAzure = z120.object({
3198
- credentialId: z120.string().optional(),
3199
- // Repository
3200
- organizationId: z120.string(),
3201
- projectId: z120.string(),
3202
- repositoryId: z120.string(),
3203
- // Location
3204
- branch: z120.string(),
3205
- relativePath: nullishToOptional(z120.string()),
3206
- // Maybe not needed
3207
- url: nullishToOptional(z120.string()),
3208
- // Legacy deprecated fields. Use `credentialId` instead
3209
- connectionId: nullishToOptional(z120.string()),
3210
- userId: nullishToOptional(z120.number())
3211
- });
3212
- var ExporterDestinationGitlab = z120.object({
3213
- credentialId: z120.string().optional(),
3214
- // Repository
3215
- projectId: z120.string(),
3216
- // Location
3217
- branch: z120.string(),
3218
- relativePath: nullishToOptional(z120.string()),
3219
- // Maybe not needed
3220
- url: nullishToOptional(z120.string()),
3221
- // Legacy deprecated fields. Use `credentialId` instead
3222
- connectionId: nullishToOptional(z120.string()),
3223
- userId: nullishToOptional(z120.number())
3224
- });
3225
- var ExporterDestinationBitbucket = z120.object({
3226
- credentialId: z120.string().optional(),
3227
- // Repository
3228
- workspaceSlug: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3229
- projectKey: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3230
- repoSlug: z120.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3231
- // Location
3232
- branch: z120.string(),
3233
- relativePath: nullishToOptional(z120.string()),
3234
- // Legacy deprecated fields. Use `credentialId` instead
3235
- connectionId: nullishToOptional(z120.string()),
3236
- userId: nullishToOptional(z120.number())
3237
- });
3238
- var ExportDestinationsMap = z120.object({
3239
- webhookUrl: z120.string().optional(),
3240
- destinationSnDocs: ExporterDestinationDocs.optional(),
3241
- destinationS3: ExporterDestinationS3.optional(),
3242
- destinationGithub: ExporterDestinationGithub.optional(),
3243
- destinationAzure: ExporterDestinationAzure.optional(),
3244
- destinationGitlab: ExporterDestinationGitlab.optional(),
3245
- destinationBitbucket: ExporterDestinationBitbucket.optional()
3246
- });
3247
-
3248
- // src/export/pipeline.ts
3249
- var PipelineEventType = z121.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
3250
- var PipelineDestinationGitType = z121.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
3251
- var PipelineDestinationExtraType = z121.enum(["WebhookUrl", "S3", "Documentation"]);
3252
- var PipelineDestinationType = z121.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
3253
- var Pipeline = z121.object({
3254
- id: z121.string(),
3255
- name: z121.string(),
3256
- eventType: PipelineEventType,
3257
- isEnabled: z121.boolean(),
3258
- workspaceId: z121.string(),
3259
- designSystemId: z121.string(),
3260
- exporterId: z121.string(),
3261
- brandPersistentId: z121.string().optional(),
3262
- themePersistentId: z121.string().optional(),
3263
- // Destinations
3264
- ...ExportDestinationsMap.shape
3265
- });
3266
-
3267
- // src/data-dumps/code-integration-dump.ts
3268
- var ExportJobDump = z122.object({
3269
- id: z122.string(),
3270
- createdAt: z122.coerce.date(),
3271
- finishedAt: z122.coerce.date(),
3272
- exportArtefacts: z122.string()
3273
- });
3274
- var CodeIntegrationDump = z122.object({
3275
- exporters: Exporter.array(),
3276
- pipelines: Pipeline.array(),
3277
- exportJobs: ExportJobDump.array()
3278
- });
3279
-
3280
- // src/data-dumps/design-system-dump.ts
3281
- import { z as z129 } from "zod";
3282
-
3283
- // src/data-dumps/design-system-version-dump.ts
3284
- import { z as z128 } from "zod";
3285
-
3286
- // src/liveblocks/rooms/design-system-version-room.ts
3287
- import { z as z123 } from "zod";
3288
- var DesignSystemVersionRoom = Entity.extend({
3289
- designSystemVersionId: z123.string(),
3290
- liveblocksId: z123.string()
3291
- });
3292
- var DesignSystemVersionRoomInternalSettings = z123.object({
3293
- routingVersion: z123.string(),
3294
- isDraftFeatureAdopted: z123.boolean()
3295
- });
3296
- var DesignSystemVersionRoomInitialState = z123.object({
3297
- pages: z123.array(DocumentationPageV2),
3298
- groups: z123.array(ElementGroup),
3299
- pageSnapshots: z123.array(DocumentationPageSnapshot),
3300
- groupSnapshots: z123.array(ElementGroupSnapshot),
3301
- internalSettings: DesignSystemVersionRoomInternalSettings
3302
- });
3303
- var DesignSystemVersionRoomUpdate = z123.object({
3304
- pages: z123.array(DocumentationPageV2),
3305
- groups: z123.array(ElementGroup),
3306
- pageIdsToDelete: z123.array(z123.string()),
3307
- groupIdsToDelete: z123.array(z123.string()),
3308
- pageSnapshots: z123.array(DocumentationPageSnapshot),
3309
- groupSnapshots: z123.array(ElementGroupSnapshot),
3310
- pageSnapshotIdsToDelete: z123.array(z123.string()),
3311
- groupSnapshotIdsToDelete: z123.array(z123.string()),
3312
- pageHashesToUpdate: z123.record(z123.string(), z123.string())
3313
- });
3314
-
3315
- // src/liveblocks/rooms/documentation-page-room.ts
3316
- import { z as z124 } from "zod";
3317
- var DocumentationPageRoom = Entity.extend({
3318
- designSystemVersionId: z124.string(),
3319
- documentationPageId: z124.string(),
3320
- liveblocksId: z124.string(),
3321
- isDirty: z124.boolean()
3322
- });
3323
- var DocumentationPageRoomState = z124.object({
3324
- pageItems: z124.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3325
- itemConfiguration: DocumentationItemConfigurationV2
3326
- });
3327
- var DocumentationPageRoomRoomUpdate = z124.object({
3328
- page: DocumentationPageV2,
3329
- pageParent: ElementGroup
3330
- });
3331
- var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
3332
- pageItems: z124.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3333
- blockDefinitions: z124.array(PageBlockDefinition)
3334
- });
3335
- var RestoredDocumentationPage = z124.object({
3336
- page: DocumentationPageV2,
3337
- pageParent: ElementGroup,
3338
- pageContent: DocumentationPageContentData,
3339
- contentHash: z124.string(),
3340
- roomId: z124.string().optional()
3341
- });
3342
- var RestoredDocumentationGroup = z124.object({
3343
- group: ElementGroup,
3344
- parent: ElementGroup
3345
- });
3346
-
3347
- // src/liveblocks/rooms/room-type.ts
3348
- import { z as z125 } from "zod";
3349
- var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
3350
- RoomTypeEnum2["DocumentationPage"] = "documentation-page";
3351
- RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
3352
- RoomTypeEnum2["Workspace"] = "workspace";
3353
- return RoomTypeEnum2;
3354
- })(RoomTypeEnum || {});
3355
- var RoomTypeSchema = z125.nativeEnum(RoomTypeEnum);
3356
- var RoomType = RoomTypeSchema.enum;
3357
-
3358
- // src/liveblocks/rooms/workspace-room.ts
3359
- import { z as z126 } from "zod";
3360
- var WorkspaceRoom = Entity.extend({
3361
- workspaceId: z126.string(),
3362
- liveblocksId: z126.string()
3363
- });
3364
-
3365
- // src/data-dumps/published-docs-dump.ts
3366
- import { z as z127 } from "zod";
3367
- var PublishedDocsDump = z127.object({
3368
- documentation: PublishedDoc,
3369
- pages: PublishedDocPage.array()
3370
- });
3371
-
3372
- // src/data-dumps/design-system-version-dump.ts
3373
- var DocumentationThreadDump = z128.object({
3374
- thread: DocumentationCommentThread,
3375
- comments: DocumentationComment.array()
3376
- });
3377
- var DocumentationPageRoomDump = z128.object({
3378
- room: DocumentationPageRoom,
3379
- threads: DocumentationThreadDump.array()
3380
- });
3381
- var DesignSystemVersionMultiplayerDump = z128.object({
3382
- documentationPages: DocumentationPageRoomDump.array()
3383
- });
3384
- var DesignSystemVersionDump = z128.object({
3385
- version: DesignSystemVersion,
3386
- brands: Brand.array(),
3387
- elements: DesignElement.array(),
3388
- elementPropertyDefinitions: ElementPropertyDefinition.array(),
3389
- elementPropertyValues: ElementPropertyValue.array(),
3390
- elementViews: ElementView.array(),
3391
- elementColumns: ElementViewColumn.array(),
3392
- documentationPageContents: DocumentationPageContent.array(),
3393
- documentationPageRooms: DocumentationPageRoomDump.array(),
3394
- publishedDocumentations: PublishedDocsDump.array(),
3395
- assetReferences: AssetReference.array()
3396
- });
3397
-
3398
- // src/data-dumps/design-system-dump.ts
3399
- var DesignSystemDump = z129.object({
3400
- designSystem: DesignSystem,
3401
- dataSources: DataSource.array(),
3402
- versions: DesignSystemVersionDump.array(),
3403
- customDomain: CustomDomain.optional(),
3404
- files: Asset.array()
3405
- });
3406
-
3407
- // src/data-dumps/user-data-dump.ts
3408
- import { z as z142 } from "zod";
3409
-
3410
- // src/users/linked-integrations.ts
3411
- import { z as z130 } from "zod";
3412
- var IntegrationAuthType = z130.union([z130.literal("OAuth2"), z130.literal("PAT")]);
3413
- var ExternalServiceType = z130.union([
3414
- z130.literal("figma"),
3415
- z130.literal("github"),
3416
- z130.literal("azure"),
3417
- z130.literal("gitlab"),
3418
- z130.literal("bitbucket")
3419
- ]);
3420
- var IntegrationUserInfo = z130.object({
3421
- id: z130.string(),
3422
- handle: z130.string().optional(),
3423
- avatarUrl: z130.string().optional(),
3424
- email: z130.string().optional(),
3425
- authType: IntegrationAuthType.optional(),
3426
- customUrl: z130.string().optional()
3427
- });
3428
- var UserLinkedIntegrations = z130.object({
3429
- figma: IntegrationUserInfo.optional(),
3430
- github: IntegrationUserInfo.array().optional(),
3431
- azure: IntegrationUserInfo.array().optional(),
3432
- gitlab: IntegrationUserInfo.array().optional(),
3433
- bitbucket: IntegrationUserInfo.array().optional()
3434
- });
3435
-
3436
- // src/users/user-analytics-cleanup-schedule.ts
3437
- import { z as z131 } from "zod";
3438
- var UserAnalyticsCleanupSchedule = z131.object({
3439
- userId: z131.string(),
3440
- createdAt: z131.coerce.date(),
3441
- deleteAt: z131.coerce.date()
3442
- });
3443
- var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
3444
- createdAt: true
3445
- });
3446
-
3447
- // src/users/user-create.ts
3448
- import { z as z132 } from "zod";
3449
- var CreateUserInput = z132.object({
3450
- email: z132.string(),
3451
- name: z132.string(),
3452
- username: z132.string()
3453
- });
3454
-
3455
- // src/users/user-identity.ts
3456
- import { z as z133 } from "zod";
3457
- var UserIdentity = z133.object({
3458
- id: z133.string(),
3459
- userId: z133.string()
3460
- });
3461
-
3462
- // src/users/user-minified.ts
3463
- import { z as z134 } from "zod";
3464
- var UserMinified = z134.object({
3465
- id: z134.string(),
3466
- name: z134.string(),
3467
- email: z134.string(),
3468
- avatar: z134.string().optional()
3469
- });
3470
-
3471
- // src/users/user-notification-settings.ts
3472
- import { z as z135 } from "zod";
3473
- var LiveblocksNotificationSettings = z135.object({
3474
- sendCommentNotificationEmails: z135.boolean()
3475
- });
3476
- var UserNotificationSettings = z135.object({
3477
- liveblocksNotificationSettings: LiveblocksNotificationSettings
3478
- });
3479
- var defaultNotificationSettings = {
3480
- liveblocksNotificationSettings: {
3481
- sendCommentNotificationEmails: true
3482
- }
3483
- };
3484
-
3485
- // src/users/user-profile.ts
3486
- import { z as z136 } from "zod";
3487
- var UserOnboardingDepartment = z136.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
3488
- var UserOnboardingJobLevel = z136.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
3489
- var UserOnboarding = z136.object({
3490
- companyName: z136.string().optional(),
3491
- numberOfPeopleInOrg: z136.string().optional(),
3492
- numberOfPeopleInDesignTeam: z136.string().optional(),
3493
- department: UserOnboardingDepartment.optional(),
3494
- jobTitle: z136.string().optional(),
3495
- phase: z136.string().optional(),
3496
- jobLevel: UserOnboardingJobLevel.optional(),
3497
- designSystemName: z136.string().optional(),
3498
- defaultDestination: z136.string().optional(),
3499
- figmaUrl: z136.string().optional()
3500
- });
3501
- var UserProfile = z136.object({
3502
- name: z136.string(),
3503
- avatar: z136.string().optional(),
3504
- nickname: z136.string().optional(),
3505
- onboarding: UserOnboarding.optional()
3506
- });
3507
- var UserProfileUpdate = UserProfile.partial().omit({
3508
- avatar: true
3509
- });
3510
-
3511
- // src/users/user-test.ts
3512
- import { z as z137 } from "zod";
3513
- var UserTest = z137.object({
3514
- id: z137.string(),
3515
- email: z137.string()
3516
- });
3517
-
3518
- // src/users/user.ts
3519
- import { z as z138 } from "zod";
3520
- var User = z138.object({
3521
- id: z138.string(),
3522
- email: z138.string(),
3523
- emailVerified: z138.boolean(),
3524
- createdAt: z138.coerce.date(),
3525
- trialExpiresAt: z138.coerce.date().optional(),
3526
- profile: UserProfile,
3527
- linkedIntegrations: UserLinkedIntegrations.optional(),
3528
- loggedOutAt: z138.coerce.date().optional(),
3529
- isProtected: z138.boolean()
3530
- });
3531
-
3532
- // src/data-dumps/workspace-dump.ts
3533
- import { z as z141 } from "zod";
3534
-
3535
- // src/integrations/integration.ts
3536
- import { z as z140 } from "zod";
3537
-
3538
- // src/utils/errors.ts
3539
- var SupernovaException = class _SupernovaException extends Error {
3540
- //
3541
- // Properties
3542
- //
3543
- constructor(type, message) {
3544
- super(`${type}: ${message}`);
3545
- this.type = type;
3546
- }
3547
- static wrongFormat(message) {
3548
- return new _SupernovaException("WrongFormat", message);
3549
- }
3550
- static validationError(message) {
3551
- return new _SupernovaException("ValidationError", message);
3552
- }
3553
- static accessDenied(message) {
3554
- return new _SupernovaException("AccessDenied", message);
3555
- }
3556
- static tooMuchWork(message) {
3557
- return new _SupernovaException("TooMuchWork", message);
3558
- }
3559
- static notFound(message) {
3560
- return new _SupernovaException("ResourceNotFound", message);
3561
- }
3562
- static timeout(message) {
3563
- return new _SupernovaException("Timeout", message);
3564
- }
3565
- static conflict(message) {
3566
- return new _SupernovaException("Conflict", message);
3567
- }
3568
- static notImplemented(message) {
3569
- return new _SupernovaException("NotImplemented", message);
3570
- }
3571
- static wrongActionOrder(message) {
3572
- return new _SupernovaException("WrongActionOrder", message);
3573
- }
3574
- static invalidOperation(message) {
3575
- return new _SupernovaException("InvalidOperation", message);
3576
- }
3577
- static shouldNotHappen(message) {
3578
- return new _SupernovaException("UnexpectedError", message);
3579
- }
3580
- static ipRestricted(message) {
3581
- return new _SupernovaException("IPRestricted", message);
3582
- }
3583
- static planRestricted(message) {
3584
- return new _SupernovaException("PlanRestricted", message);
3585
- }
3586
- static missingWorkspacePermission(message) {
3587
- return new _SupernovaException("MissingWorkspacePermission", message);
3588
- }
3589
- static missingExporterPermission(message) {
3590
- return new _SupernovaException("MissingExporterPermission", message);
3591
- }
3592
- static missingIntegration(message) {
3593
- return new _SupernovaException("MissingIntegration", message);
3594
- }
3595
- static missingIntegrationAccess(message) {
3596
- return new _SupernovaException("MissingIntegrationAccess", message);
3597
- }
3598
- static noAccess(message) {
3599
- return new _SupernovaException("NoAccess", message);
3600
- }
3601
- static missingCredentials(message) {
3602
- return new _SupernovaException("MissingCredentials", message);
3603
- }
3604
- static thirdPartyError(message) {
3605
- return new _SupernovaException("ThirdPartyError", message);
3606
- }
3607
- //
3608
- // To refactor
3609
- //
3610
- static badRequest(message) {
3611
- return new _SupernovaException("BadRequest", message);
3612
- }
3613
- };
3614
-
3615
- // src/utils/common.ts
3616
- function forceUnwrapNullish(value) {
3617
- if (value === null)
3618
- throw new Error("Illegal null");
3619
- if (value === void 0)
3620
- throw new Error("Illegal undefined");
3621
- return value;
3622
- }
3623
- function trimLeadingSlash(string) {
3624
- return string.startsWith("/") ? string.substring(1) : string;
3625
- }
3626
- function trimTrailingSlash(string) {
3627
- return string.endsWith("/") ? string.substring(0, string.length - 1) : string;
3628
- }
3629
- function tryParseUrl(url) {
3630
- try {
3631
- return parseUrl(url);
3632
- } catch (e) {
3633
- console.error(`Error parsing URL ${url}`);
3634
- console.error(e);
3635
- return null;
3636
- }
3637
- }
3638
- function parseUrl(url) {
3639
- return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
3640
- }
3641
- function mapByUnique(items, keyFn) {
3642
- const result = /* @__PURE__ */ new Map();
3643
- for (const item of items) {
3644
- result.set(keyFn(item), item);
3645
- }
3646
- return result;
3647
- }
3648
- function groupBy(items, keyFn) {
3649
- const result = /* @__PURE__ */ new Map();
3650
- for (const item of items) {
3651
- const key = keyFn(item);
3652
- const array = result.get(key);
3653
- if (array) {
3654
- array.push(item);
3655
- } else {
3656
- result.set(key, [item]);
3657
- }
3658
- }
3659
- return result;
3660
- }
3661
- function filterNonNullish(items) {
3662
- return items.filter(Boolean);
3663
- }
3664
- function nonNullishFilter(item) {
3665
- return !!item;
3666
- }
3667
- function nonNullFilter(item) {
3668
- return item !== null;
3669
- }
3670
- function buildConstantEnum(values) {
3671
- const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});
3672
- return constMap;
3673
- }
3674
- async function promiseWithTimeout(timeoutMs, promise) {
3675
- let timeoutHandle;
3676
- const timeoutPromise = new Promise((_, reject) => {
3677
- timeoutHandle = setTimeout(() => reject(SupernovaException.timeout()), timeoutMs);
3678
- });
3679
- const result = await Promise.race([promise(), timeoutPromise]);
3680
- clearTimeout(timeoutHandle);
3681
- return result;
3682
- }
3683
- async function sleep(ms) {
3684
- return new Promise((resolve) => setTimeout(resolve, ms));
3685
- }
3686
- function uniqueBy(items, prop) {
3687
- return Array.from(mapByUnique(items, prop).values());
3688
- }
3689
-
3690
- // src/utils/content-loader-instruction.ts
3691
- import { z as z139 } from "zod";
3692
- var ContentLoadInstruction = z139.object({
3693
- from: z139.string(),
3694
- to: z139.string(),
3695
- authorizationHeaderKvsId: z139.string().optional(),
3696
- timeout: z139.number().optional()
3697
- });
3698
- var ContentLoaderPayload = z139.object({
3699
- type: z139.literal("Single"),
3700
- instruction: ContentLoadInstruction
3701
- }).or(
3702
- z139.object({
3703
- type: z139.literal("Multiple"),
3704
- loadingChunkSize: z139.number().optional(),
3705
- instructions: z139.array(ContentLoadInstruction)
3706
- })
3707
- ).or(
3708
- z139.object({
3709
- type: z139.literal("S3"),
3710
- location: z139.string()
3711
- })
3712
- );
3006
+ ).or(
3007
+ z105.object({
3008
+ type: z105.literal("S3"),
3009
+ location: z105.string()
3010
+ })
3011
+ );
3713
3012
 
3714
3013
  // src/utils/naming.ts
3715
3014
  function getCodenameFromText(name) {
@@ -4403,10 +3702,724 @@ function isSlugReserved(slug) {
4403
3702
  return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);
4404
3703
  }
4405
3704
 
4406
- // src/utils/validation.ts
4407
- 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";
4408
4420
 
4409
4421
  // src/integrations/integration.ts
4422
+ import { z as z140 } from "zod";
4410
4423
  var IntegrationDesignSystem = z140.object({
4411
4424
  designSystemId: z140.string(),
4412
4425
  brandId: z140.string(),
@@ -5509,6 +5522,9 @@ export {
5509
5522
  nonNullishFilter,
5510
5523
  nullishToOptional,
5511
5524
  parseUrl,
5525
+ pickLatestGroupSnapshots,
5526
+ pickLatestPageSnapshots,
5527
+ pickLatestSnapshots,
5512
5528
  promiseWithTimeout,
5513
5529
  publishedDocEnvironments,
5514
5530
  sleep,