@supernova-studio/model 1.0.0 → 1.0.2

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.
Files changed (237) hide show
  1. package/dist/index.d.mts +26740 -18977
  2. package/dist/index.d.ts +26740 -18977
  3. package/dist/index.js +275 -47
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2201 -1973
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +3 -4
  8. package/src/asset-delete-schedule/asset-delete-schedule.ts +0 -20
  9. package/src/asset-delete-schedule/index.ts +0 -1
  10. package/src/auth/index.ts +0 -1
  11. package/src/auth/plugin-oauth-request.ts +0 -14
  12. package/src/billing/card.ts +0 -12
  13. package/src/billing/checkoutSession.ts +0 -16
  14. package/src/billing/customer.ts +0 -29
  15. package/src/billing/features.ts +0 -48
  16. package/src/billing/index.ts +0 -9
  17. package/src/billing/invoice.ts +0 -34
  18. package/src/billing/portalSession.ts +0 -19
  19. package/src/billing/price.ts +0 -24
  20. package/src/billing/product.ts +0 -5
  21. package/src/billing/subscription.ts +0 -65
  22. package/src/common/entity.ts +0 -9
  23. package/src/common/index.ts +0 -2
  24. package/src/common/object-meta.ts +0 -8
  25. package/src/custom-domains/custom-domains.ts +0 -24
  26. package/src/custom-domains/index.ts +0 -1
  27. package/src/data-dumps/code-integration-dump.ts +0 -19
  28. package/src/data-dumps/design-system-dump.ts +0 -16
  29. package/src/data-dumps/design-system-version-dump.ts +0 -45
  30. package/src/data-dumps/index.ts +0 -6
  31. package/src/data-dumps/published-docs-dump.ts +0 -10
  32. package/src/data-dumps/user-data-dump.ts +0 -10
  33. package/src/data-dumps/workspace-dump.ts +0 -14
  34. package/src/docs-server/index.ts +0 -1
  35. package/src/docs-server/session.ts +0 -39
  36. package/src/dsm/assets/asset-dynamo-record.ts +0 -10
  37. package/src/dsm/assets/asset-reference.ts +0 -18
  38. package/src/dsm/assets/asset-value.ts +0 -3
  39. package/src/dsm/assets/asset.ts +0 -60
  40. package/src/dsm/assets/index.ts +0 -4
  41. package/src/dsm/brand.ts +0 -13
  42. package/src/dsm/collection.ts +0 -51
  43. package/src/dsm/components/asset-rendering.ts +0 -22
  44. package/src/dsm/components/index.ts +0 -1
  45. package/src/dsm/data-sources/data-source.ts +0 -167
  46. package/src/dsm/data-sources/import-job.ts +0 -30
  47. package/src/dsm/data-sources/import-summary.ts +0 -70
  48. package/src/dsm/data-sources/index.ts +0 -3
  49. package/src/dsm/design-system.ts +0 -47
  50. package/src/dsm/documentation/approvals/approval-state.ts +0 -4
  51. package/src/dsm/documentation/approvals/approval.ts +0 -18
  52. package/src/dsm/documentation/approvals/index.ts +0 -2
  53. package/src/dsm/documentation/block-definitions/aux.ts +0 -10
  54. package/src/dsm/documentation/block-definitions/definition.ts +0 -76
  55. package/src/dsm/documentation/block-definitions/index.ts +0 -4
  56. package/src/dsm/documentation/block-definitions/item.ts +0 -233
  57. package/src/dsm/documentation/block-definitions/variant.ts +0 -49
  58. package/src/dsm/documentation/group.ts +0 -19
  59. package/src/dsm/documentation/index.ts +0 -10
  60. package/src/dsm/documentation/link-preview.ts +0 -10
  61. package/src/dsm/documentation/page-anchor.ts +0 -9
  62. package/src/dsm/documentation/page-content-backup.ts +0 -13
  63. package/src/dsm/documentation/page-content.ts +0 -32
  64. package/src/dsm/documentation/page.ts +0 -18
  65. package/src/dsm/documentation/settings.ts +0 -18
  66. package/src/dsm/documentation/thread.ts +0 -35
  67. package/src/dsm/element-snapshots/base.ts +0 -34
  68. package/src/dsm/element-snapshots/documentation-page-snapshot.ts +0 -29
  69. package/src/dsm/element-snapshots/group-snapshot.ts +0 -27
  70. package/src/dsm/element-snapshots/index.ts +0 -3
  71. package/src/dsm/elements/base.ts +0 -49
  72. package/src/dsm/elements/component-properties.ts +0 -63
  73. package/src/dsm/elements/data/base.ts +0 -18
  74. package/src/dsm/elements/data/blur.ts +0 -16
  75. package/src/dsm/elements/data/border-radius.ts +0 -16
  76. package/src/dsm/elements/data/border-width.ts +0 -16
  77. package/src/dsm/elements/data/border.ts +0 -21
  78. package/src/dsm/elements/data/color.ts +0 -13
  79. package/src/dsm/elements/data/component.ts +0 -30
  80. package/src/dsm/elements/data/dimension.ts +0 -15
  81. package/src/dsm/elements/data/documentation-block-v1.ts +0 -498
  82. package/src/dsm/elements/data/documentation-block-v2.ts +0 -429
  83. package/src/dsm/elements/data/documentation-page-v1.ts +0 -9
  84. package/src/dsm/elements/data/documentation-page-v2.ts +0 -7
  85. package/src/dsm/elements/data/documentation-section-v2.ts +0 -47
  86. package/src/dsm/elements/data/documentation-v1.ts +0 -16
  87. package/src/dsm/elements/data/documentation-v2.ts +0 -18
  88. package/src/dsm/elements/data/duration.ts +0 -16
  89. package/src/dsm/elements/data/figma-file-structure.ts +0 -65
  90. package/src/dsm/elements/data/figma-node-reference.ts +0 -27
  91. package/src/dsm/elements/data/font-family.ts +0 -8
  92. package/src/dsm/elements/data/font-size.ts +0 -16
  93. package/src/dsm/elements/data/font-weight.ts +0 -8
  94. package/src/dsm/elements/data/font.ts +0 -9
  95. package/src/dsm/elements/data/gradient.ts +0 -32
  96. package/src/dsm/elements/data/group.ts +0 -20
  97. package/src/dsm/elements/data/index.ts +0 -43
  98. package/src/dsm/elements/data/item-header-v1.ts +0 -35
  99. package/src/dsm/elements/data/item-header-v2.ts +0 -34
  100. package/src/dsm/elements/data/item-header.ts +0 -14
  101. package/src/dsm/elements/data/letter-spacing.ts +0 -16
  102. package/src/dsm/elements/data/line-height.ts +0 -16
  103. package/src/dsm/elements/data/opacity.ts +0 -13
  104. package/src/dsm/elements/data/paragraph-indent.ts +0 -16
  105. package/src/dsm/elements/data/paragraph-spacing.ts +0 -16
  106. package/src/dsm/elements/data/product-copy.ts +0 -8
  107. package/src/dsm/elements/data/safe-id.ts +0 -13
  108. package/src/dsm/elements/data/shadow.ts +0 -23
  109. package/src/dsm/elements/data/size.ts +0 -16
  110. package/src/dsm/elements/data/space.ts +0 -16
  111. package/src/dsm/elements/data/string.ts +0 -8
  112. package/src/dsm/elements/data/text-case.ts +0 -10
  113. package/src/dsm/elements/data/text-decoration.ts +0 -10
  114. package/src/dsm/elements/data/typography.ts +0 -28
  115. package/src/dsm/elements/data/visibility.ts +0 -10
  116. package/src/dsm/elements/data/z-index.ts +0 -16
  117. package/src/dsm/elements/documentation-page-v1.ts +0 -34
  118. package/src/dsm/elements/documentation-page-v2.ts +0 -21
  119. package/src/dsm/elements/figma-component.ts +0 -67
  120. package/src/dsm/elements/figma-file-structures.ts +0 -40
  121. package/src/dsm/elements/figma-node-reference.ts +0 -25
  122. package/src/dsm/elements/group.ts +0 -40
  123. package/src/dsm/elements/index.ts +0 -15
  124. package/src/dsm/elements/page-block-v2.ts +0 -25
  125. package/src/dsm/elements/primitives/index.ts +0 -2
  126. package/src/dsm/elements/primitives/point.ts +0 -8
  127. package/src/dsm/elements/primitives/size.ts +0 -28
  128. package/src/dsm/elements/raw-element.ts +0 -164
  129. package/src/dsm/elements/theme.ts +0 -76
  130. package/src/dsm/elements/tokens.ts +0 -311
  131. package/src/dsm/elements/utils.ts +0 -114
  132. package/src/dsm/exporter-property-values-collection.ts +0 -31
  133. package/src/dsm/import/asset.ts +0 -6
  134. package/src/dsm/import/base.ts +0 -24
  135. package/src/dsm/import/collection.ts +0 -16
  136. package/src/dsm/import/component.ts +0 -40
  137. package/src/dsm/import/data-source.ts +0 -9
  138. package/src/dsm/import/figma-frames.ts +0 -74
  139. package/src/dsm/import/image.ts +0 -87
  140. package/src/dsm/import/index.ts +0 -12
  141. package/src/dsm/import/origin.ts +0 -5
  142. package/src/dsm/import/support/figma-files.ts +0 -19
  143. package/src/dsm/import/support/import-context.ts +0 -94
  144. package/src/dsm/import/support/import-model-collections.ts +0 -50
  145. package/src/dsm/import/support/index.ts +0 -3
  146. package/src/dsm/import/theme.ts +0 -76
  147. package/src/dsm/import/tokens.ts +0 -50
  148. package/src/dsm/import/warning.ts +0 -38
  149. package/src/dsm/index.ts +0 -19
  150. package/src/dsm/membership/additions.ts +0 -13
  151. package/src/dsm/membership/design-system-membership.ts +0 -92
  152. package/src/dsm/membership/ds-role.ts +0 -28
  153. package/src/dsm/membership/index.ts +0 -4
  154. package/src/dsm/membership/invitations.ts +0 -21
  155. package/src/dsm/properties/index.ts +0 -3
  156. package/src/dsm/properties/property-definition.ts +0 -57
  157. package/src/dsm/properties/property-reference.ts +0 -5
  158. package/src/dsm/properties/property-value.ts +0 -29
  159. package/src/dsm/published-doc-page-visits.ts +0 -15
  160. package/src/dsm/published-doc-page.ts +0 -37
  161. package/src/dsm/published-doc.ts +0 -32
  162. package/src/dsm/reference.ts +0 -9
  163. package/src/dsm/version.ts +0 -41
  164. package/src/dsm/views/column.ts +0 -58
  165. package/src/dsm/views/index.ts +0 -2
  166. package/src/dsm/views/view.ts +0 -19
  167. package/src/emails/design-system-invite.ts +0 -31
  168. package/src/emails/index.ts +0 -2
  169. package/src/emails/workspace-invite.ts +0 -29
  170. package/src/events/base.ts +0 -7
  171. package/src/events/data-source-imported.ts +0 -9
  172. package/src/events/index.ts +0 -3
  173. package/src/events/version-released.ts +0 -10
  174. package/src/export/export-destinations.ts +0 -127
  175. package/src/export/export-jobs.ts +0 -122
  176. package/src/export/export-runner/export-context.ts +0 -34
  177. package/src/export/export-runner/exporter-payload.ts +0 -10
  178. package/src/export/export-runner/index.ts +0 -2
  179. package/src/export/exporter-workspace-membership-role.ts +0 -4
  180. package/src/export/exporter-workspace-membership.ts +0 -14
  181. package/src/export/exporter.ts +0 -55
  182. package/src/export/git-providers.ts +0 -11
  183. package/src/export/index.ts +0 -9
  184. package/src/export/pipeline.ts +0 -34
  185. package/src/export/pulsar.ts +0 -71
  186. package/src/feature-flags/feature-flags.ts +0 -21
  187. package/src/feature-flags/index.ts +0 -1
  188. package/src/helpers/db.ts +0 -82
  189. package/src/helpers/index.ts +0 -2
  190. package/src/helpers/nullish-to-optional.ts +0 -9
  191. package/src/index.ts +0 -20
  192. package/src/integrations/external-oauth-request.ts +0 -12
  193. package/src/integrations/git.ts +0 -49
  194. package/src/integrations/index.ts +0 -6
  195. package/src/integrations/integration.ts +0 -143
  196. package/src/integrations/oauth-providers.ts +0 -13
  197. package/src/integrations/oauth-token.ts +0 -16
  198. package/src/integrations/workspace-oauth-requests.ts +0 -12
  199. package/src/liveblocks/index.ts +0 -1
  200. package/src/liveblocks/rooms/design-system-version-room.ts +0 -62
  201. package/src/liveblocks/rooms/documentation-page-room.ts +0 -65
  202. package/src/liveblocks/rooms/index.ts +0 -4
  203. package/src/liveblocks/rooms/room-type.ts +0 -12
  204. package/src/liveblocks/rooms/workspace-room.ts +0 -16
  205. package/src/npm/index.ts +0 -2
  206. package/src/npm/npm-package.ts +0 -30
  207. package/src/npm/npm-proxy-token-payload.ts +0 -7
  208. package/src/tokens/index.ts +0 -1
  209. package/src/tokens/personal-access-token.ts +0 -25
  210. package/src/users/index.ts +0 -9
  211. package/src/users/linked-integrations.ts +0 -36
  212. package/src/users/user-analytics-cleanup-schedule.ts +0 -15
  213. package/src/users/user-identity.ts +0 -8
  214. package/src/users/user-minified.ts +0 -10
  215. package/src/users/user-notification-settings.ts +0 -18
  216. package/src/users/user-profile.ts +0 -41
  217. package/src/users/user-test.ts +0 -8
  218. package/src/users/user-with-pat.ts +0 -7
  219. package/src/users/user.ts +0 -21
  220. package/src/utils/common.ts +0 -172
  221. package/src/utils/content-loader-instruction.ts +0 -31
  222. package/src/utils/errors.ts +0 -120
  223. package/src/utils/index.ts +0 -6
  224. package/src/utils/naming.ts +0 -73
  225. package/src/utils/slugify.ts +0 -636
  226. package/src/utils/validation.ts +0 -4
  227. package/src/workspace/index.ts +0 -10
  228. package/src/workspace/npm-registry-settings.ts +0 -45
  229. package/src/workspace/sso-provider.ts +0 -13
  230. package/src/workspace/user-invite.ts +0 -18
  231. package/src/workspace/workspace-configuration.ts +0 -14
  232. package/src/workspace/workspace-context.ts +0 -13
  233. package/src/workspace/workspace-create.ts +0 -25
  234. package/src/workspace/workspace-invitations.ts +0 -22
  235. package/src/workspace/workspace-membership.ts +0 -31
  236. package/src/workspace/workspace-role.ts +0 -6
  237. package/src/workspace/workspace.ts +0 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/model",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,8 +18,7 @@
18
18
  }
19
19
  },
20
20
  "files": [
21
- "dist/**",
22
- "src/**"
21
+ "dist/**"
23
22
  ],
24
23
  "scripts": {
25
24
  "build": "tsup",
@@ -37,6 +36,6 @@
37
36
  "devDependencies": {
38
37
  "fs": "0.0.1-security",
39
38
  "tsup": "8.0.2",
40
- "typescript": "5.0.4"
39
+ "typescript": "5.7.3"
41
40
  }
42
41
  }
@@ -1,20 +0,0 @@
1
- import { z } from "zod";
2
- import { DbCreateInputOmit } from "../helpers";
3
-
4
- const AssetDeleteScheduleStatus = z.enum(["InProgress", "Pending"]);
5
- export type AssetDeleteScheduleStatus = z.infer<typeof AssetDeleteScheduleStatus>;
6
-
7
-
8
- export const AssetDeleteSchedule = z.object({
9
- id: z.string(),
10
- path: z.string(),
11
- createdAt: z.date(),
12
- deleteAt: z.date(),
13
- isFolder: z.boolean(),
14
- status: AssetDeleteScheduleStatus,
15
- });
16
-
17
- export type AssetDeleteSchedule = z.infer<typeof AssetDeleteSchedule>;
18
-
19
- export type AssetDeleteScheduleDbInput = DbCreateInputOmit<AssetDeleteSchedule>;
20
-
@@ -1 +0,0 @@
1
- export * from "./asset-delete-schedule";
package/src/auth/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./plugin-oauth-request";
@@ -1,14 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const PluginOAuthRequestSchema = z.object({
4
- id: z.string(),
5
- codeChallenge: z.string(),
6
- readKey: z.string(),
7
- writeKey: z.string(),
8
- readKeyConsumed: z.boolean(),
9
- writeKeyConsumed: z.boolean(),
10
- oAuthCode: z.string().optional(),
11
- createdAt: z.coerce.date(),
12
- });
13
-
14
- export type PluginOAuthRequest = z.infer<typeof PluginOAuthRequestSchema>;
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const CardSchema = z.object({
4
- cardId: z.string().nullish(),
5
- last4: z.string().length(4).nullish(),
6
- expiryMonth: z.string().nullish(),
7
- expiryYear: z.string().nullish(),
8
- brand: z.string().nullish(),
9
- name: z.string().nullish(),
10
- });
11
-
12
- export type Card = z.infer<typeof CardSchema>;
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const PostStripeCheckoutBodyInputSchema = z.object({
4
- priceId: z.string(),
5
- successUrl: z.string().url(),
6
- cancelUrl: z.string().url(),
7
- quantity: z.number().int().min(1).optional(),
8
- });
9
-
10
- export const PostStripeCheckoutOutputSchema = z.object({
11
- id: z.string(),
12
- url: z.string().nullish(),
13
- });
14
-
15
- export type StripeCheckoutInput = z.infer<typeof PostStripeCheckoutBodyInputSchema>;
16
- export type StripeCheckoutOutput = z.infer<typeof PostStripeCheckoutOutputSchema>;
@@ -1,29 +0,0 @@
1
- import { z } from "zod";
2
- import { nullishToOptional } from "../helpers";
3
-
4
- export const Customer = z.object({
5
- id: z.string(),
6
- });
7
-
8
- export const Address = z.object({
9
- street1: nullishToOptional(z.string()),
10
- street2: nullishToOptional(z.string()),
11
- city: nullishToOptional(z.string()),
12
- postal: nullishToOptional(z.string()),
13
- country: nullishToOptional(z.string()),
14
- state: nullishToOptional(z.string()),
15
- });
16
-
17
- export const BillingDetails = z.object({
18
- address: nullishToOptional(Address),
19
- email: nullishToOptional(z.string()),
20
- companyName: nullishToOptional(z.string()),
21
- companyId: nullishToOptional(z.string()),
22
- notes: nullishToOptional(z.string()),
23
- vat: nullishToOptional(z.string()),
24
- poNumber: nullishToOptional(z.string()),
25
- });
26
-
27
- export type Customer = z.infer<typeof Customer>;
28
- export type Address = z.infer<typeof Address>;
29
- export type BillingDetails = z.infer<typeof BillingDetails>;
@@ -1,48 +0,0 @@
1
- import { z } from "zod";
2
-
3
- const featureLimitedSchema = z.object({
4
- max: z.number(),
5
- errorMessage: z.string(),
6
- errorReason: z.string(),
7
- });
8
-
9
- const featureToggleSchema = z.object({
10
- enabled: z.boolean(),
11
- errorMessage: z.string(),
12
- errorReason: z.string(),
13
- });
14
-
15
- const featureWithImportJobsSchema = featureLimitedSchema.extend({
16
- noImportJobsErrorMessage: z.string(),
17
- noImportJobsErrorReason: z.string(),
18
- });
19
-
20
- export const FeaturesSummary = z.object({
21
- designSystems: featureLimitedSchema,
22
- designSystemSources: featureWithImportJobsSchema,
23
- designSystemVersions: featureLimitedSchema,
24
- themes: featureLimitedSchema,
25
- brands: featureLimitedSchema,
26
- codegenSchedules: featureLimitedSchema,
27
- publicDocumentation: featureToggleSchema,
28
- customDocumentationUrl: featureToggleSchema,
29
- customDocumentationViewButton: featureToggleSchema,
30
- designSystemSourceAutoImport: featureToggleSchema,
31
- designSystemSlug: featureToggleSchema,
32
- ipWhitelisting: featureToggleSchema,
33
- npmRegistry: featureToggleSchema,
34
- sso: featureToggleSchema,
35
- workspacePaidSeats: featureLimitedSchema,
36
- workspaceViewers: featureLimitedSchema,
37
- customDocumentationExporter: featureToggleSchema,
38
- protectedPages: featureToggleSchema,
39
- approvals: featureToggleSchema,
40
- selectivePublishing: featureToggleSchema,
41
- designSystemAccessModes: featureToggleSchema,
42
- designSystemRoles: featureToggleSchema,
43
- });
44
-
45
- export type FeatureLimitedDetails = z.infer<typeof featureLimitedSchema>;
46
- export type FeatureToggleDetails = z.infer<typeof featureToggleSchema>;
47
- export type FeatureWithImportJobsDetails = z.infer<typeof featureWithImportJobsSchema>;
48
- export type FeaturesSummary = z.infer<typeof FeaturesSummary>;
@@ -1,9 +0,0 @@
1
- export * from "./card";
2
- export * from "./checkoutSession";
3
- export * from "./customer";
4
- export * from "./features";
5
- export * from "./invoice";
6
- export * from "./portalSession";
7
- export * from "./price";
8
- export * from "./product";
9
- export * from "./subscription";
@@ -1,34 +0,0 @@
1
- import { z } from "zod";
2
- import { CardSchema } from "./card";
3
-
4
- export const InvoiceSchema = z.object({
5
- id: z.string(),
6
- number: z.string(),
7
- amount_due: z.number(),
8
- date: z.coerce.date(),
9
- hostedUrl: z.string().url(),
10
- card: CardSchema.nullish(),
11
- });
12
-
13
- export const PeriodSchema = z.object({
14
- start: z.coerce.date(),
15
- end: z.coerce.date(),
16
- });
17
-
18
- export const InvoiceLineSchema = z.object({
19
- amount: z.number(),
20
- period: PeriodSchema,
21
- proration: z.boolean(),
22
- description: z.string(),
23
- type: z.string(),
24
- });
25
-
26
- export const InvoiceCouponSchema = z.object({
27
- amount_off: z.number(),
28
- percent_off: z.number(),
29
- name: z.string(),
30
- });
31
-
32
- export type Invoice = z.infer<typeof InvoiceSchema>;
33
- export type InvoiceLine = z.infer<typeof InvoiceLineSchema>;
34
- export type InvoiceCoupon = z.infer<typeof InvoiceCouponSchema>;
@@ -1,19 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const PostStripePortalUpdateSessionBodyInputSchema = z.object({
4
- priceId: z.string(),
5
- numberOfSeats: z.number().int(),
6
- });
7
- export const PostStripePortalSessionBodyInputSchema = z.object({
8
- returnUrl: z.string().url(),
9
- update: PostStripePortalUpdateSessionBodyInputSchema.optional(),
10
- cancel: z.boolean().optional(),
11
- });
12
-
13
- export const PostStripePortalSessionOutputSchema = z.object({
14
- id: z.string(),
15
- url: z.string().nullish(),
16
- });
17
-
18
- export type StripePortalSessionInput = z.infer<typeof PostStripePortalSessionBodyInputSchema>;
19
- export type StripePortalSessionOutput = z.infer<typeof PostStripePortalSessionOutputSchema>;
@@ -1,24 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const BillingIntervalSchema = z.enum(["daily", "monthly", "weekly", "yearly"]);
4
-
5
- export const PriceSchema = z.object({
6
- stripePriceId: z.string(),
7
- stripeProductId: z.string(),
8
- stripeProductName: z.string().optional(),
9
- stripeProductDescription: z.string().optional(),
10
- active: z.boolean(),
11
- amount: z.number(),
12
- interval: BillingIntervalSchema,
13
- isPricePerCreator: z.boolean().optional(),
14
- isTrial: z.boolean().optional(),
15
- isHidden: z.boolean().optional(),
16
- minimumSeats: z.number().optional(),
17
- legacyVersion: z.string().optional(),
18
- featuresSet: z.string().optional(),
19
- stripeProductFeatures: z.array(z.string()).optional(),
20
- stripeProductAdditionalFeatures: z.array(z.string()).optional(),
21
- });
22
-
23
- export type BillingInterval = z.infer<typeof BillingIntervalSchema>;
24
- export type Price = z.infer<typeof PriceSchema>;
@@ -1,5 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const ProductCodeSchema = z.enum(["free", "team", "company", "enterprise"]);
4
- export type ProductCode = z.infer<typeof ProductCodeSchema>;
5
- export const ProductCode = ProductCodeSchema.enum;
@@ -1,65 +0,0 @@
1
- import { CardSchema } from "./card";
2
- import { ProductCodeSchema } from "./product";
3
- import { FeaturesSummary } from "./features";
4
- import { BillingIntervalSchema } from "./price";
5
- import { z } from "zod";
6
- export const StripeSubscriptionStatusSchema = z.enum([
7
- "trialing",
8
- "active",
9
- "past_due",
10
- "canceled",
11
- "unpaid",
12
- "incomplete_expired",
13
- "incomplete",
14
- "unknown",
15
- ]);
16
-
17
- export const InternalStatusSchema = z.enum(["active", "suspended", "gracePeriod", "cancelled", "downgraded_to_free"]);
18
-
19
- export const BillingTypeSchema = z.enum(["Auto", "Invoice"]);
20
-
21
- export type StripeSubscriptionStatus = z.infer<typeof StripeSubscriptionStatusSchema>;
22
- export type InternalStatus = z.infer<typeof InternalStatusSchema>;
23
- export type BillingType = z.infer<typeof BillingTypeSchema>;
24
-
25
- export const StripeSubscriptionStatus = StripeSubscriptionStatusSchema.enum;
26
- export const InternalStatus = InternalStatusSchema.enum;
27
- export const BillingType = BillingTypeSchema.enum;
28
-
29
- export const Subscription = z.object({
30
- stripeSubscriptionId: z.string().nullish(),
31
- stripeCustomerId: z.string().nullish(),
32
-
33
- status: InternalStatusSchema.optional(),
34
- subscriptionStatus: StripeSubscriptionStatusSchema.optional(), // the stripe API official status
35
- internalStatus: InternalStatusSchema.optional(), // TODO: delete when create/get workspace will stop using it in the former API
36
-
37
- product: ProductCodeSchema,
38
- featuresSummary: FeaturesSummary.optional(),
39
- stripeProductDescription: z.string().optional(),
40
- stripeProductFeatures: z.array(z.string()).optional(),
41
- stripeProductAdditionalFeatures: z.array(z.string()).optional(),
42
- stripeSubscriptionMainItemId: z.string().optional(),
43
- planPriceId: z.string(),
44
- planInterval: BillingIntervalSchema,
45
- isPricePerCreator: z.boolean().optional(),
46
- legacyVersion: z.string().optional(),
47
-
48
- seats: z.number(),
49
- seatLimit: z.number(),
50
-
51
- currentPeriodStart: z.string().optional(),
52
- currentPeriodEnd: z.string().optional(),
53
- subscriptionStatusUpdatedAt: z.string().optional(),
54
- cancelAt: z.string().nullish(),
55
-
56
- card: CardSchema.optional(),
57
-
58
- // New
59
- amount: z.number().nullish(),
60
- isTrial: z.boolean().optional(),
61
- billingType: BillingTypeSchema.optional(),
62
- daysUntilDue: z.number().optional(),
63
- });
64
-
65
- export type Subscription = z.infer<typeof Subscription>;
@@ -1,9 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const Entity = z.object({
4
- id: z.string(),
5
- createdAt: z.coerce.date(),
6
- updatedAt: z.coerce.date(),
7
- });
8
-
9
- export type Entity = z.infer<typeof Entity>;
@@ -1,2 +0,0 @@
1
- export * from "./entity";
2
- export * from "./object-meta";
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const ObjectMeta = z.object({
4
- name: z.string(),
5
- description: z.string().optional(),
6
- });
7
-
8
- export type ObjectMeta = z.infer<typeof ObjectMeta>;
@@ -1,24 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export type CustomDomainState =
4
- | "Initial"
5
- | "DomainSetupInProgress"
6
- | "DomainSetupFailed"
7
- | "DomainSetupSuccess"
8
- | "SSLSetupInProgress"
9
- | "SSLSetupFailed"
10
- | "SSLSetupSuccess";
11
-
12
- export const CustomDomain = z.object({
13
- id: z.string(),
14
- designSystemId: z.string(),
15
- state: z.string(),
16
-
17
- supernovaDomain: z.string(),
18
- customerDomain: z.string().nullish(),
19
-
20
- error: z.string().nullish(),
21
- errorCode: z.string().nullish(),
22
- });
23
-
24
- export type CustomDomain = z.infer<typeof CustomDomain>;
@@ -1 +0,0 @@
1
- export * from "./custom-domains";
@@ -1,19 +0,0 @@
1
- import { z } from "zod";
2
- import { Exporter } from "../export/exporter";
3
- import { Pipeline } from "../export/pipeline";
4
-
5
- export const ExportJobDump = z.object({
6
- id: z.string(),
7
- createdAt: z.coerce.date(),
8
- finishedAt: z.coerce.date(),
9
- exportArtefacts: z.string(),
10
- });
11
-
12
- export const CodeIntegrationDump = z.object({
13
- exporters: Exporter.array(),
14
- pipelines: Pipeline.array(),
15
- exportJobs: ExportJobDump.array(),
16
- });
17
-
18
- export type ExportJobDump = z.infer<typeof ExportJobDump>;
19
- export type CodeIntegrationDump = z.infer<typeof CodeIntegrationDump>;
@@ -1,16 +0,0 @@
1
- import { z } from "zod";
2
- import { CustomDomain } from "../custom-domains";
3
- import { Asset } from "../dsm/assets/asset";
4
- import { DataSource } from "../dsm/data-sources/data-source";
5
- import { DesignSystem } from "../dsm/design-system";
6
- import { DesignSystemVersionDump } from "./design-system-version-dump";
7
-
8
- export const DesignSystemDump = z.object({
9
- designSystem: DesignSystem,
10
- dataSources: DataSource.array(),
11
- versions: DesignSystemVersionDump.array(),
12
- customDomain: CustomDomain.optional(),
13
- files: Asset.array(),
14
- });
15
-
16
- export type DesignSystemDump = z.infer<typeof DesignSystemDump>;
@@ -1,45 +0,0 @@
1
- import { z } from "zod";
2
- import { AssetReference } from "../dsm/assets/asset-reference";
3
- import { Brand } from "../dsm/brand";
4
- import { DocumentationPageContent } from "../dsm/documentation/page-content";
5
- import { DocumentationComment, DocumentationCommentThread } from "../dsm/documentation/thread";
6
- import { DesignElement } from "../dsm/elements/raw-element";
7
- import { ElementPropertyDefinition } from "../dsm/properties/property-definition";
8
- import { ElementPropertyValue } from "../dsm/properties/property-value";
9
- import { DesignSystemVersion } from "../dsm/version";
10
- import { ElementViewColumn } from "../dsm/views/column";
11
- import { ElementView } from "../dsm/views/view";
12
- import { DocumentationPageRoom } from "../liveblocks";
13
- import { PublishedDocsDump } from "./published-docs-dump";
14
-
15
- export const DocumentationThreadDump = z.object({
16
- thread: DocumentationCommentThread,
17
- comments: DocumentationComment.array(),
18
- });
19
-
20
- export const DocumentationPageRoomDump = z.object({
21
- room: DocumentationPageRoom,
22
- threads: DocumentationThreadDump.array(),
23
- });
24
-
25
- export const DesignSystemVersionMultiplayerDump = z.object({
26
- documentationPages: DocumentationPageRoomDump.array(),
27
- });
28
-
29
- export const DesignSystemVersionDump = z.object({
30
- version: DesignSystemVersion,
31
- brands: Brand.array(),
32
- elements: DesignElement.array(),
33
- elementPropertyDefinitions: ElementPropertyDefinition.array(),
34
- elementPropertyValues: ElementPropertyValue.array(),
35
- elementViews: ElementView.array(),
36
- elementColumns: ElementViewColumn.array(),
37
- documentationPageContents: DocumentationPageContent.array(),
38
- documentationPageRooms: DocumentationPageRoomDump.array(),
39
- publishedDocumentations: PublishedDocsDump.array(),
40
- assetReferences: AssetReference.array(),
41
- });
42
-
43
- export type DocumentationThreadDump = z.infer<typeof DocumentationThreadDump>;
44
- export type DocumentationPageRoomDump = z.infer<typeof DocumentationPageRoomDump>;
45
- export type DesignSystemVersionDump = z.infer<typeof DesignSystemVersionDump>;
@@ -1,6 +0,0 @@
1
- export * from "./code-integration-dump";
2
- export * from "./design-system-dump";
3
- export * from "./design-system-version-dump";
4
- export * from "./published-docs-dump";
5
- export * from "./user-data-dump";
6
- export * from "./workspace-dump";
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- import { PublishedDoc } from "../dsm/published-doc";
3
- import { PublishedDocPage } from "../dsm/published-doc-page";
4
-
5
- export const PublishedDocsDump = z.object({
6
- documentation: PublishedDoc,
7
- pages: PublishedDocPage.array(),
8
- });
9
-
10
- export type PublishedDocsDump = z.infer<typeof PublishedDocsDump>;
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- import { User } from "../users";
3
- import { WorkspaceDump } from "./workspace-dump";
4
-
5
- export const UserDump = z.object({
6
- user: User,
7
- workspaces: WorkspaceDump.array(),
8
- });
9
-
10
- export type UserDump = z.infer<typeof UserDump>;
@@ -1,14 +0,0 @@
1
- import { z } from "zod";
2
- import { Integration } from "../integrations/integration";
3
- import { Workspace } from "../workspace/workspace";
4
- import { CodeIntegrationDump } from "./code-integration-dump";
5
- import { DesignSystemDump } from "./design-system-dump";
6
-
7
- export const WorkspaceDump = z.object({
8
- workspace: Workspace,
9
- designSystems: DesignSystemDump.array(),
10
- codeIntegration: CodeIntegrationDump,
11
- integrations: Integration.array(),
12
- });
13
-
14
- export type WorkspaceDump = z.infer<typeof WorkspaceDump>;
@@ -1 +0,0 @@
1
- export * from "./session";
@@ -1,39 +0,0 @@
1
- import { z } from "zod";
2
- import { User } from "../users";
3
-
4
- export const NpmProxyToken = z.object({
5
- access: z.string(),
6
- expiresAt: z.number(),
7
- });
8
-
9
- export type NpmProxyToken = z.infer<typeof NpmProxyToken>;
10
-
11
- export const SessionData = z.object({
12
- returnToUrl: z.string().optional(),
13
- npmProxyToken: NpmProxyToken.optional(),
14
- });
15
-
16
- export type SessionData = z.infer<typeof SessionData>;
17
-
18
- export const Session = z.object({
19
- id: z.string(),
20
- expiresAt: z.coerce.date(),
21
- userId: z.string().nullable(),
22
- data: SessionData,
23
- });
24
-
25
- export type Session = z.infer<typeof Session>;
26
-
27
- export const AuthTokens = z.object({
28
- access: z.string(),
29
- refresh: z.string(),
30
- });
31
-
32
- export type AuthTokens = z.infer<typeof AuthTokens>;
33
-
34
- export const UserSession = z.object({
35
- session: Session,
36
- user: User.nullable(),
37
- });
38
-
39
- export type UserSession = z.infer<typeof UserSession>;
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const AssetDynamoRecord = z.object({
4
- path: z.string(),
5
- id: z.string(),
6
- designSystemId: z.string(),
7
- expiresAt: z.number(),
8
- });
9
-
10
- export type AssetDynamoRecord = z.infer<typeof AssetDynamoRecord>;
@@ -1,18 +0,0 @@
1
- import { z } from "zod";
2
- import { DbCreateInputOmit } from "../../helpers";
3
-
4
- export const AssetReference = z.object({
5
- id: z.string(),
6
- designSystemVersionId: z.string(),
7
- assetId: z.string(),
8
- persistentId: z.string(),
9
- });
10
-
11
- export type AssetReference = z.infer<typeof AssetReference>;
12
-
13
- export type CreateAssetReference = DbCreateInputOmit<AssetReference>;
14
-
15
- export type AssetReferenceDiff = {
16
- toCreate: CreateAssetReference[];
17
- toDelete: string[];
18
- };
@@ -1,3 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const AssetValue = z.object({});
@@ -1,60 +0,0 @@
1
- import { z } from "zod";
2
- import { OmitStrict } from "../../utils";
3
-
4
- export const AssetType = z.enum(["Image", "Font"]);
5
- export const AssetScope = z.enum(["DocumentationFrame", "ComponentThumbnail", "DesignSystem", "Documentation"]);
6
-
7
- export const AssetFontProperties = z.object({
8
- family: z.string(),
9
- subfamily: z.string(),
10
- });
11
-
12
- export const AssetProperties = z.union([
13
- z.object({
14
- fontProperties: z.array(AssetFontProperties),
15
- }),
16
- z.object({
17
- width: z.number(),
18
- height: z.number(),
19
- }),
20
- ]);
21
-
22
- export const AssetOrigin = z.object({
23
- originKey: z.string(),
24
- });
25
-
26
- export const AssetProcessStatus = z.enum(["Pending", "Uploaded", "Processed"]);
27
-
28
- export const Asset = z.object({
29
- id: z.string(),
30
- designSystemId: z.string().nullish(),
31
- type: AssetType,
32
- originalFileName: z.string().nullish(),
33
- filePath: z.string(),
34
- scope: AssetScope,
35
- properties: AssetProperties.nullish(),
36
- state: AssetProcessStatus.optional(),
37
- origin: AssetOrigin.optional(),
38
- originKey: z.string().optional(),
39
- createdByImportJobId: z.string().optional(),
40
- });
41
-
42
- export const ResolvedAsset = Asset.extend({
43
- url: z.string(),
44
- });
45
-
46
- export type AssetType = z.infer<typeof AssetType>;
47
- export type AssetScope = z.infer<typeof AssetScope>;
48
- export type AssetFontProperties = z.infer<typeof AssetFontProperties>;
49
- export type AssetProperties = z.infer<typeof AssetProperties>;
50
- export type AssetOrigin = z.infer<typeof AssetOrigin>;
51
- export type Asset = z.infer<typeof Asset>;
52
- export type ResolvedAsset = z.infer<typeof ResolvedAsset>;
53
-
54
- export type ImportedAsset = OmitStrict<Asset, "originKey"> & {
55
- originKey: string;
56
- };
57
-
58
- export function isImportedAsset(asset: Asset): asset is ImportedAsset {
59
- return !!asset.originKey;
60
- }