@supernova-studio/model 1.46.6 → 1.47.1

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
@@ -4979,6 +4979,25 @@ function deriveWorkspaceSeatTypeFromRole(role) {
4979
4979
  return "None";
4980
4980
  }
4981
4981
  }
4982
+ var fullSeatTypeRoles = /* @__PURE__ */ new Set([
4983
+ WorkspaceRole.Owner,
4984
+ WorkspaceRole.Admin,
4985
+ WorkspaceRole.Creator,
4986
+ WorkspaceRole.Contributor
4987
+ ]);
4988
+ var builderSeatTypeRoles = /* @__PURE__ */ new Set([WorkspaceRole.Owner, WorkspaceRole.Admin, WorkspaceRole.Creator]);
4989
+ var noneSeatTypeRoles = /* @__PURE__ */ new Set([WorkspaceRole.Viewer, WorkspaceRole.Billing]);
4990
+ function isValidRoleSeatPair(role, seatType) {
4991
+ switch (seatType) {
4992
+ case "Full":
4993
+ return fullSeatTypeRoles.has(role);
4994
+ case "Builder":
4995
+ return builderSeatTypeRoles.has(role);
4996
+ case "None":
4997
+ return noneSeatTypeRoles.has(role);
4998
+ }
4999
+ return true;
5000
+ }
4982
5001
 
4983
5002
  // src/workspace/user-invite.ts
4984
5003
  var MAX_MEMBERS_COUNT = 100;
@@ -5905,40 +5924,26 @@ var ForgeProjectArtifactContent = z173.object({
5905
5924
  // src/forge/project-artifact.ts
5906
5925
  import { z as z176 } from "zod";
5907
5926
 
5908
- // src/forge/project-section.ts
5909
- import { z as z174 } from "zod";
5910
- var ForgeProjectSectionChildType = z174.enum(["Artifact", "Feature"]);
5911
- var SortOrder = z174.number().int();
5912
- var ForgeSection = z174.object({
5913
- id: Id,
5914
- projectId: z174.string(),
5915
- name: z174.string(),
5916
- sortOrder: SortOrder.default(0),
5917
- createdAt: z174.coerce.date(),
5918
- updatedAt: z174.coerce.date(),
5919
- childType: ForgeProjectSectionChildType
5920
- });
5921
-
5922
5927
  // src/files/files.ts
5923
- import z175 from "zod";
5924
- var FileFigmaRenderMode = z175.enum(["Image", "HTML", "JSON"]);
5925
- var FileSourceUpload = z175.object({
5926
- type: z175.literal("UserUpload"),
5927
- userId: z175.string()
5928
- });
5929
- var FileSourceFigma = z175.object({
5930
- type: z175.literal("Figma"),
5928
+ import z174 from "zod";
5929
+ var FileFigmaRenderMode = z174.enum(["Image", "HTML", "JSON"]);
5930
+ var FileSourceUpload = z174.object({
5931
+ type: z174.literal("UserUpload"),
5932
+ userId: z174.string()
5933
+ });
5934
+ var FileSourceFigma = z174.object({
5935
+ type: z174.literal("Figma"),
5931
5936
  renderMode: FileFigmaRenderMode
5932
5937
  });
5933
- var FileSource = z175.discriminatedUnion("type", [FileSourceUpload, FileSourceFigma]);
5934
- var File = z175.object({
5935
- id: z175.string(),
5936
- name: z175.string(),
5937
- deduplicationKey: z175.string(),
5938
- pendingUpload: z175.boolean().optional(),
5939
- storagePath: z175.string(),
5940
- url: z175.string(),
5941
- size: z175.number(),
5938
+ var FileSource = z174.discriminatedUnion("type", [FileSourceUpload, FileSourceFigma]);
5939
+ var File = z174.object({
5940
+ id: z174.string(),
5941
+ name: z174.string(),
5942
+ deduplicationKey: z174.string(),
5943
+ pendingUpload: z174.boolean().optional(),
5944
+ storagePath: z174.string(),
5945
+ url: z174.string(),
5946
+ size: z174.number(),
5942
5947
  /**
5943
5948
  * Object describing where did the file come from. Undefined source indicates a file produced by the
5944
5949
  * system (e.g. thumbnails, etc)
@@ -5953,6 +5958,20 @@ var FileReference = File.pick({
5953
5958
  name: File.shape.name.optional()
5954
5959
  });
5955
5960
 
5961
+ // src/forge/project-section.ts
5962
+ import { z as z175 } from "zod";
5963
+ var ForgeProjectSectionChildType = z175.enum(["Artifact", "Feature"]);
5964
+ var SortOrder = z175.number().int();
5965
+ var ForgeSection = z175.object({
5966
+ id: Id,
5967
+ projectId: z175.string(),
5968
+ name: z175.string(),
5969
+ sortOrder: SortOrder.default(0),
5970
+ createdAt: z175.coerce.date(),
5971
+ updatedAt: z175.coerce.date(),
5972
+ childType: ForgeProjectSectionChildType
5973
+ });
5974
+
5956
5975
  // src/forge/project-artifact.ts
5957
5976
  var ForgeProjectArtifact = z176.object({
5958
5977
  id: Id,
@@ -5966,7 +5985,10 @@ var ForgeProjectArtifact = z176.object({
5966
5985
  createdByUserId: z176.string(),
5967
5986
  sectionId: Id.optional(),
5968
5987
  threadId: z176.string().optional(),
5969
- thumbnail: FileReference.optional()
5988
+ thumbnail: FileReference.optional(),
5989
+ // Default value here is important for backward compatibility for parsing artifacts
5990
+ // from project rooms!
5991
+ isArchived: z176.boolean().default(false)
5970
5992
  });
5971
5993
 
5972
5994
  // src/forge/project-feature.ts
@@ -5977,7 +5999,7 @@ var ProjectFeature = z177.object({
5977
5999
  createdByUserId: z177.string(),
5978
6000
  description: z177.string(),
5979
6001
  id: Id,
5980
- isArchived: z177.boolean().optional(),
6002
+ isArchived: z177.boolean(),
5981
6003
  name: z177.string(),
5982
6004
  projectId: z177.string(),
5983
6005
  sectionId: Id.optional(),
@@ -7539,6 +7561,7 @@ export {
7539
7561
  isNullish,
7540
7562
  isSlugReserved,
7541
7563
  isTokenType,
7564
+ isValidRoleSeatPair,
7542
7565
  joinRepeatingSpans,
7543
7566
  mapByUnique,
7544
7567
  mapPageBlockItemValuesV2,