@supernova-studio/client 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
@@ -182,8 +182,8 @@ import { z as z172 } from "zod";
182
182
  import { z as z171 } from "zod";
183
183
  import { z as z173 } from "zod";
184
184
  import { z as z176 } from "zod";
185
- import { z as z174 } from "zod";
186
- import z175 from "zod";
185
+ import z174 from "zod";
186
+ import { z as z175 } from "zod";
187
187
  import { z as z177 } from "zod";
188
188
  import { z as z178 } from "zod";
189
189
  import { z as z179 } from "zod";
@@ -4423,6 +4423,14 @@ var WorkspaceUntypedData = z130.object({
4423
4423
  var WorkspaceRoleSchema = z131.enum(["Owner", "Admin", "Creator", "Viewer", "Billing", "Guest", "Contributor"]);
4424
4424
  var WorkspaceRole = WorkspaceRoleSchema.enum;
4425
4425
  var WorkspaceSeatType = z131.enum(["Full", "Builder", "None"]);
4426
+ var fullSeatTypeRoles = /* @__PURE__ */ new Set([
4427
+ WorkspaceRole.Owner,
4428
+ WorkspaceRole.Admin,
4429
+ WorkspaceRole.Creator,
4430
+ WorkspaceRole.Contributor
4431
+ ]);
4432
+ var builderSeatTypeRoles = /* @__PURE__ */ new Set([WorkspaceRole.Owner, WorkspaceRole.Admin, WorkspaceRole.Creator]);
4433
+ var noneSeatTypeRoles = /* @__PURE__ */ new Set([WorkspaceRole.Viewer, WorkspaceRole.Billing]);
4426
4434
  var MAX_MEMBERS_COUNT = 100;
4427
4435
  var UserInvite = z132.object({
4428
4436
  email: z132.string().email().trim().transform((value) => value.toLowerCase()),
@@ -5181,35 +5189,24 @@ var ForgeProjectArtifactContent = z173.object({
5181
5189
  updatedAt: z173.coerce.date(),
5182
5190
  data: ForgeProjectArtifactContentData
5183
5191
  });
5184
- var ForgeProjectSectionChildType = z174.enum(["Artifact", "Feature"]);
5185
- var SortOrder = z174.number().int();
5186
- var ForgeSection = z174.object({
5187
- id: Id,
5188
- projectId: z174.string(),
5189
- name: z174.string(),
5190
- sortOrder: SortOrder.default(0),
5191
- createdAt: z174.coerce.date(),
5192
- updatedAt: z174.coerce.date(),
5193
- childType: ForgeProjectSectionChildType
5192
+ var FileFigmaRenderMode = z174.enum(["Image", "HTML", "JSON"]);
5193
+ var FileSourceUpload = z174.object({
5194
+ type: z174.literal("UserUpload"),
5195
+ userId: z174.string()
5194
5196
  });
5195
- var FileFigmaRenderMode = z175.enum(["Image", "HTML", "JSON"]);
5196
- var FileSourceUpload = z175.object({
5197
- type: z175.literal("UserUpload"),
5198
- userId: z175.string()
5199
- });
5200
- var FileSourceFigma = z175.object({
5201
- type: z175.literal("Figma"),
5197
+ var FileSourceFigma = z174.object({
5198
+ type: z174.literal("Figma"),
5202
5199
  renderMode: FileFigmaRenderMode
5203
5200
  });
5204
- var FileSource = z175.discriminatedUnion("type", [FileSourceUpload, FileSourceFigma]);
5205
- var File = z175.object({
5206
- id: z175.string(),
5207
- name: z175.string(),
5208
- deduplicationKey: z175.string(),
5209
- pendingUpload: z175.boolean().optional(),
5210
- storagePath: z175.string(),
5211
- url: z175.string(),
5212
- size: z175.number(),
5201
+ var FileSource = z174.discriminatedUnion("type", [FileSourceUpload, FileSourceFigma]);
5202
+ var File = z174.object({
5203
+ id: z174.string(),
5204
+ name: z174.string(),
5205
+ deduplicationKey: z174.string(),
5206
+ pendingUpload: z174.boolean().optional(),
5207
+ storagePath: z174.string(),
5208
+ url: z174.string(),
5209
+ size: z174.number(),
5213
5210
  /**
5214
5211
  * Object describing where did the file come from. Undefined source indicates a file produced by the
5215
5212
  * system (e.g. thumbnails, etc)
@@ -5223,6 +5220,17 @@ var FileReference = File.pick({
5223
5220
  }).extend({
5224
5221
  name: File.shape.name.optional()
5225
5222
  });
5223
+ var ForgeProjectSectionChildType = z175.enum(["Artifact", "Feature"]);
5224
+ var SortOrder = z175.number().int();
5225
+ var ForgeSection = z175.object({
5226
+ id: Id,
5227
+ projectId: z175.string(),
5228
+ name: z175.string(),
5229
+ sortOrder: SortOrder.default(0),
5230
+ createdAt: z175.coerce.date(),
5231
+ updatedAt: z175.coerce.date(),
5232
+ childType: ForgeProjectSectionChildType
5233
+ });
5226
5234
  var ForgeProjectArtifact = z176.object({
5227
5235
  id: Id,
5228
5236
  projectId: z176.string(),
@@ -5235,7 +5243,10 @@ var ForgeProjectArtifact = z176.object({
5235
5243
  createdByUserId: z176.string(),
5236
5244
  sectionId: Id.optional(),
5237
5245
  threadId: z176.string().optional(),
5238
- thumbnail: FileReference.optional()
5246
+ thumbnail: FileReference.optional(),
5247
+ // Default value here is important for backward compatibility for parsing artifacts
5248
+ // from project rooms!
5249
+ isArchived: z176.boolean().default(false)
5239
5250
  });
5240
5251
  var ProjectFeatureStatus = z177.enum(["Draft", "ReadyForDevelopment"]);
5241
5252
  var ProjectFeature = z177.object({
@@ -5243,7 +5254,7 @@ var ProjectFeature = z177.object({
5243
5254
  createdByUserId: z177.string(),
5244
5255
  description: z177.string(),
5245
5256
  id: Id,
5246
- isArchived: z177.boolean().optional(),
5257
+ isArchived: z177.boolean(),
5247
5258
  name: z177.string(),
5248
5259
  projectId: z177.string(),
5249
5260
  sectionId: Id.optional(),
@@ -9932,7 +9943,8 @@ var DTOForgeSectionItemMoveInput = z319.object({
9932
9943
  var DTOForgeProjectArtifact = ForgeProjectArtifact;
9933
9944
  var DTOForgeProjectArtifactUpdateInput = z320.object({
9934
9945
  id: z320.string(),
9935
- title: z320.string().optional()
9946
+ title: z320.string().optional(),
9947
+ isArchived: z320.boolean().optional()
9936
9948
  });
9937
9949
  var DTOForgeProjectArtifactCreateInput = z320.object({
9938
9950
  id: z320.string(),
@@ -10442,7 +10454,7 @@ var DTOForgeProject = z331.object({
10442
10454
  tags: z331.array(z331.string()).default([]),
10443
10455
  accessMode: DTOForgeProjectAccessMode,
10444
10456
  defaultRole: DTOForgeProjectDefaultRole.default("Viewer"),
10445
- isArchived: z331.boolean().optional(),
10457
+ isArchived: z331.boolean(),
10446
10458
  emoji: z331.string().optional(),
10447
10459
  createdAt: z331.coerce.date(),
10448
10460
  createdByUserId: z331.string().optional(),
@@ -18929,7 +18941,8 @@ var LocalProjectActionExecutor = class {
18929
18941
  title: input.title,
18930
18942
  updatedAt: /* @__PURE__ */ new Date(),
18931
18943
  createdAt: /* @__PURE__ */ new Date(),
18932
- createdByUserId: this.userId
18944
+ createdByUserId: this.userId,
18945
+ isArchived: false
18933
18946
  });
18934
18947
  }
18935
18948
  //
@@ -18945,6 +18958,7 @@ var LocalProjectActionExecutor = class {
18945
18958
  const mergedArtifact = {
18946
18959
  ...existingArtifact,
18947
18960
  title: input.title ?? existingArtifact.title,
18961
+ isArchived: input.isArchived ?? existingArtifact.isArchived,
18948
18962
  updatedAt: /* @__PURE__ */ new Date()
18949
18963
  };
18950
18964
  this.artifacts.set(id, mergedArtifact);