@supernova-studio/client 1.48.16 → 1.48.18

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.d.mts CHANGED
@@ -347812,6 +347812,7 @@ declare class RequestExecutorError extends Error {
347812
347812
  type RequestExecutorConfig = {
347813
347813
  host: string;
347814
347814
  accessToken?: string;
347815
+ apiSecret?: string;
347815
347816
  };
347816
347817
  type RequestExecutorJSONRequest = Omit<RequestInit, "body"> & {
347817
347818
  body?: object;
@@ -358237,7 +358238,53 @@ declare class ForgeFeatureIterationsEndpoint {
358237
358238
  } | null | undefined;
358238
358239
  }[];
358239
358240
  }>;
358240
- updateArtifacts(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationUpdateArtifactsInput): Promise<any>;
358241
+ updateArtifacts(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationUpdateArtifactsInput): Promise<{
358242
+ iteration: {
358243
+ id: string;
358244
+ createdAt: string;
358245
+ name: string;
358246
+ startedFromMessageId: string;
358247
+ updatedAt?: string | undefined;
358248
+ state?: "InProgress" | "Success" | "Error" | "Timeout" | undefined;
358249
+ error?: {
358250
+ type: "Unknown" | "Build" | "PackageInstall" | "Compile";
358251
+ description: string;
358252
+ } | undefined;
358253
+ thumbnailUrl?: string | undefined;
358254
+ baseIterationId?: string | undefined;
358255
+ isInProgress?: boolean | undefined;
358256
+ errorDescription?: string | null | undefined;
358257
+ creditsCost?: number | undefined;
358258
+ staticPreviewUrl?: string | undefined;
358259
+ isBookmarked?: boolean | undefined;
358260
+ thumbnail?: {
358261
+ id: string;
358262
+ url: string;
358263
+ name?: string | undefined;
358264
+ source?: {
358265
+ type: "UserUpload";
358266
+ userId: string;
358267
+ } | {
358268
+ type: "Figma";
358269
+ renderMode: "Image" | "HTML" | "JSON";
358270
+ } | undefined;
358271
+ } | undefined;
358272
+ artifactsDiff?: {
358273
+ created: string[];
358274
+ updated: string[];
358275
+ deleted: string[];
358276
+ } | null | undefined;
358277
+ };
358278
+ }>;
358279
+ validateIteration(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationValidateInput): Promise<{
358280
+ success: true;
358281
+ } | {
358282
+ success: false;
358283
+ error: {
358284
+ type: "Unknown" | "Build" | "PackageInstall" | "Compile";
358285
+ description: string;
358286
+ };
358287
+ }>;
358241
358288
  }
358242
358289
 
358243
358290
  declare class ForgeFeatureMessagesEndpoint {
@@ -368159,6 +368206,17 @@ declare class WorkspaceSubscriptionEndpoint {
368159
368206
  }>;
368160
368207
  }
368161
368208
 
368209
+ declare class WorkspaceBillingEndpoint {
368210
+ private readonly requestExecutor;
368211
+ constructor(requestExecutor: RequestExecutor);
368212
+ creditsSpend(wsId: string, body: DTOBillingCreditsSpendInput): Promise<{
368213
+ hasOverspend: boolean;
368214
+ }>;
368215
+ creditsCheck(wsId: string): Promise<{
368216
+ canSpendCredits: boolean;
368217
+ }>;
368218
+ }
368219
+
368162
368220
  declare class WorkspacesEndpoint {
368163
368221
  private readonly requestExecutor;
368164
368222
  members: WorkspaceMembersEndpoint;
@@ -368167,6 +368225,7 @@ declare class WorkspacesEndpoint {
368167
368225
  chatThreads: WorkspaceChatThreadsEndpoint;
368168
368226
  integrations: WorkspaceIntegrationsEndpoint;
368169
368227
  subscription: WorkspaceSubscriptionEndpoint;
368228
+ billing: WorkspaceBillingEndpoint;
368170
368229
  constructor(requestExecutor: RequestExecutor);
368171
368230
  create(body: DTOWorkspaceCreateInput): Promise<{
368172
368231
  workspace: {
@@ -368967,6 +369026,7 @@ declare class UsersEndpoint {
368967
369026
  type SupernovaApiClientConfig = {
368968
369027
  host: string;
368969
369028
  accessToken: string;
369029
+ apiSecret?: string;
368970
369030
  };
368971
369031
  declare class SupernovaApiClient {
368972
369032
  readonly config: SupernovaApiClientConfig;
package/dist/index.d.ts CHANGED
@@ -347812,6 +347812,7 @@ declare class RequestExecutorError extends Error {
347812
347812
  type RequestExecutorConfig = {
347813
347813
  host: string;
347814
347814
  accessToken?: string;
347815
+ apiSecret?: string;
347815
347816
  };
347816
347817
  type RequestExecutorJSONRequest = Omit<RequestInit, "body"> & {
347817
347818
  body?: object;
@@ -358237,7 +358238,53 @@ declare class ForgeFeatureIterationsEndpoint {
358237
358238
  } | null | undefined;
358238
358239
  }[];
358239
358240
  }>;
358240
- updateArtifacts(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationUpdateArtifactsInput): Promise<any>;
358241
+ updateArtifacts(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationUpdateArtifactsInput): Promise<{
358242
+ iteration: {
358243
+ id: string;
358244
+ createdAt: string;
358245
+ name: string;
358246
+ startedFromMessageId: string;
358247
+ updatedAt?: string | undefined;
358248
+ state?: "InProgress" | "Success" | "Error" | "Timeout" | undefined;
358249
+ error?: {
358250
+ type: "Unknown" | "Build" | "PackageInstall" | "Compile";
358251
+ description: string;
358252
+ } | undefined;
358253
+ thumbnailUrl?: string | undefined;
358254
+ baseIterationId?: string | undefined;
358255
+ isInProgress?: boolean | undefined;
358256
+ errorDescription?: string | null | undefined;
358257
+ creditsCost?: number | undefined;
358258
+ staticPreviewUrl?: string | undefined;
358259
+ isBookmarked?: boolean | undefined;
358260
+ thumbnail?: {
358261
+ id: string;
358262
+ url: string;
358263
+ name?: string | undefined;
358264
+ source?: {
358265
+ type: "UserUpload";
358266
+ userId: string;
358267
+ } | {
358268
+ type: "Figma";
358269
+ renderMode: "Image" | "HTML" | "JSON";
358270
+ } | undefined;
358271
+ } | undefined;
358272
+ artifactsDiff?: {
358273
+ created: string[];
358274
+ updated: string[];
358275
+ deleted: string[];
358276
+ } | null | undefined;
358277
+ };
358278
+ }>;
358279
+ validateIteration(workspaceId: string, projectId: string, featureId: string, body: DTOFeatureIterationValidateInput): Promise<{
358280
+ success: true;
358281
+ } | {
358282
+ success: false;
358283
+ error: {
358284
+ type: "Unknown" | "Build" | "PackageInstall" | "Compile";
358285
+ description: string;
358286
+ };
358287
+ }>;
358241
358288
  }
358242
358289
 
358243
358290
  declare class ForgeFeatureMessagesEndpoint {
@@ -368159,6 +368206,17 @@ declare class WorkspaceSubscriptionEndpoint {
368159
368206
  }>;
368160
368207
  }
368161
368208
 
368209
+ declare class WorkspaceBillingEndpoint {
368210
+ private readonly requestExecutor;
368211
+ constructor(requestExecutor: RequestExecutor);
368212
+ creditsSpend(wsId: string, body: DTOBillingCreditsSpendInput): Promise<{
368213
+ hasOverspend: boolean;
368214
+ }>;
368215
+ creditsCheck(wsId: string): Promise<{
368216
+ canSpendCredits: boolean;
368217
+ }>;
368218
+ }
368219
+
368162
368220
  declare class WorkspacesEndpoint {
368163
368221
  private readonly requestExecutor;
368164
368222
  members: WorkspaceMembersEndpoint;
@@ -368167,6 +368225,7 @@ declare class WorkspacesEndpoint {
368167
368225
  chatThreads: WorkspaceChatThreadsEndpoint;
368168
368226
  integrations: WorkspaceIntegrationsEndpoint;
368169
368227
  subscription: WorkspaceSubscriptionEndpoint;
368228
+ billing: WorkspaceBillingEndpoint;
368170
368229
  constructor(requestExecutor: RequestExecutor);
368171
368230
  create(body: DTOWorkspaceCreateInput): Promise<{
368172
368231
  workspace: {
@@ -368967,6 +369026,7 @@ declare class UsersEndpoint {
368967
369026
  type SupernovaApiClientConfig = {
368968
369027
  host: string;
368969
369028
  accessToken: string;
369029
+ apiSecret?: string;
368970
369030
  };
368971
369031
  declare class SupernovaApiClient {
368972
369032
  readonly config: SupernovaApiClientConfig;
package/dist/index.js CHANGED
@@ -12285,7 +12285,6 @@ var ForgeFeatureArtifactsEndpoint = class {
12285
12285
  };
12286
12286
 
12287
12287
  // src/api/endpoints/forge/feature-iterations.ts
12288
-
12289
12288
  var ForgeFeatureIterationsEndpoint = class {
12290
12289
  constructor(requestExecutor) {
12291
12290
  this.requestExecutor = requestExecutor;
@@ -12302,7 +12301,17 @@ var ForgeFeatureIterationsEndpoint = class {
12302
12301
  updateArtifacts(workspaceId, projectId, featureId, body) {
12303
12302
  return this.requestExecutor.json(
12304
12303
  `/workspaces/${workspaceId}/forge/projects/${projectId}/features/${featureId}/iterations/update-artifacts`,
12305
- _zod2.default.any(),
12304
+ DTOFeatureIterationResponse,
12305
+ {
12306
+ body,
12307
+ method: "POST"
12308
+ }
12309
+ );
12310
+ }
12311
+ validateIteration(workspaceId, projectId, featureId, body) {
12312
+ return this.requestExecutor.json(
12313
+ `/workspaces/${workspaceId}/forge/projects/${projectId}/features/${featureId}/iterations/validate-iteration`,
12314
+ DTOFeatureIterationValidateResponse,
12306
12315
  {
12307
12316
  body,
12308
12317
  method: "POST"
@@ -12906,6 +12915,27 @@ var WorkspaceSubscriptionEndpoint = class {
12906
12915
 
12907
12916
  // src/api/endpoints/workspaces/workspaces.ts
12908
12917
 
12918
+
12919
+ // src/api/endpoints/workspaces/billing.ts
12920
+ var WorkspaceBillingEndpoint = class {
12921
+ constructor(requestExecutor) {
12922
+ this.requestExecutor = requestExecutor;
12923
+ }
12924
+ creditsSpend(wsId, body) {
12925
+ return this.requestExecutor.json(`/workspaces/${wsId}/billing/credits/spend`, DTOBillingCreditsSpendResponse, {
12926
+ body,
12927
+ method: "POST"
12928
+ });
12929
+ }
12930
+ creditsCheck(wsId) {
12931
+ return this.requestExecutor.json(
12932
+ `/workspaces/${wsId}/billing/credits/check`,
12933
+ DTOBillingCreditsCheckIfCanSpendResponse
12934
+ );
12935
+ }
12936
+ };
12937
+
12938
+ // src/api/endpoints/workspaces/workspaces.ts
12909
12939
  var WorkspacesEndpoint = class {
12910
12940
  constructor(requestExecutor) {
12911
12941
  this.requestExecutor = requestExecutor;
@@ -12915,12 +12945,14 @@ var WorkspacesEndpoint = class {
12915
12945
  __publicField(this, "chatThreads");
12916
12946
  __publicField(this, "integrations");
12917
12947
  __publicField(this, "subscription");
12948
+ __publicField(this, "billing");
12918
12949
  this.members = new WorkspaceMembersEndpoint(requestExecutor);
12919
12950
  this.invitations = new WorkspaceInvitationsEndpoint(requestExecutor);
12920
12951
  this.integrations = new WorkspaceIntegrationsEndpoint(requestExecutor);
12921
12952
  this.npmRegistry = new WorkspaceNpmRegistryEndpoint(requestExecutor);
12922
12953
  this.chatThreads = new WorkspaceChatThreadsEndpoint(requestExecutor);
12923
12954
  this.subscription = new WorkspaceSubscriptionEndpoint(requestExecutor);
12955
+ this.billing = new WorkspaceBillingEndpoint(requestExecutor);
12924
12956
  }
12925
12957
  create(body) {
12926
12958
  return this.requestExecutor.json("/workspaces", DTOWorkspaceResponse, {
@@ -13114,6 +13146,9 @@ var RequestExecutor = class {
13114
13146
  if (this.testServerConfig.accessToken) {
13115
13147
  defaultHeaders["Authorization"] = `Bearer ${this.testServerConfig.accessToken}`;
13116
13148
  }
13149
+ if (this.testServerConfig.apiSecret) {
13150
+ defaultHeaders["x-sn-api-secret"] = this.testServerConfig.apiSecret;
13151
+ }
13117
13152
  let body;
13118
13153
  if (requestInit.body && typeof requestInit.body === "object") body = JSON.stringify(requestInit.body);
13119
13154
  const response = await _nodefetch2.default.call(void 0, this.fullUrl(path, requestInit.query), {
@@ -13165,7 +13200,9 @@ var SupernovaApiClient = class {
13165
13200
  __publicField(this, "files");
13166
13201
  __publicField(this, "threads");
13167
13202
  __publicField(this, "mcpStreams");
13203
+ const apiSecret = _nullishCoalesce(config.apiSecret, () => ( _optionalChain([process, 'optionalAccess', _40 => _40.env, 'optionalAccess', _41 => _41.SUPERNOVA_API_SECRET])));
13168
13204
  const requestExecutor = new RequestExecutor({
13205
+ apiSecret,
13169
13206
  host: config.host,
13170
13207
  accessToken: config.accessToken
13171
13208
  });
@@ -13392,9 +13429,9 @@ var LocalDocsElementActionExecutor = class {
13392
13429
  ...existingGroup.data,
13393
13430
  // TODO Artem: move somewhere reusable
13394
13431
  configuration: input.configuration ? {
13395
- ..._nullishCoalesce(_optionalChain([existingGroup, 'access', _40 => _40.data, 'optionalAccess', _41 => _41.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
13432
+ ..._nullishCoalesce(_optionalChain([existingGroup, 'access', _42 => _42.data, 'optionalAccess', _43 => _43.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
13396
13433
  ...input.configuration
13397
- } : _optionalChain([existingGroup, 'access', _42 => _42.data, 'optionalAccess', _43 => _43.configuration])
13434
+ } : _optionalChain([existingGroup, 'access', _44 => _44.data, 'optionalAccess', _45 => _45.configuration])
13398
13435
  }
13399
13436
  };
13400
13437
  this.groups.set(localGroup.persistentId, localGroup);
@@ -13435,7 +13472,7 @@ var LocalDocsElementActionExecutor = class {
13435
13472
  updatedAt: /* @__PURE__ */ new Date(),
13436
13473
  data: {
13437
13474
  behavior: "Tabs",
13438
- configuration: _optionalChain([page, 'optionalAccess', _44 => _44.data, 'access', _45 => _45.configuration])
13475
+ configuration: _optionalChain([page, 'optionalAccess', _46 => _46.data, 'access', _47 => _47.configuration])
13439
13476
  },
13440
13477
  sortOrder: page.sortOrder,
13441
13478
  designSystemVersionId: this.designSystemVersionId
@@ -13459,7 +13496,7 @@ var LocalDocsElementActionExecutor = class {
13459
13496
  if (input.approvalState) {
13460
13497
  this.approvalStates.set(input.persistentId, {
13461
13498
  approvalState: input.approvalState,
13462
- createdAt: _nullishCoalesce(_optionalChain([existingApproval, 'optionalAccess', _46 => _46.createdAt]), () => ( /* @__PURE__ */ new Date())),
13499
+ createdAt: _nullishCoalesce(_optionalChain([existingApproval, 'optionalAccess', _48 => _48.createdAt]), () => ( /* @__PURE__ */ new Date())),
13463
13500
  designSystemVersionId: this.designSystemVersionId,
13464
13501
  pagePersistentId: input.persistentId,
13465
13502
  updatedAt: /* @__PURE__ */ new Date(),
@@ -13487,7 +13524,7 @@ var LocalDocsElementActionExecutor = class {
13487
13524
  return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13488
13525
  }
13489
13526
  const left = neighbours[index].sortOrder;
13490
- const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _47 => _47[index + 1], 'optionalAccess', _48 => _48.sortOrder]), () => ( left + sortOrderStep * 2));
13527
+ const right = _nullishCoalesce(_optionalChain([neighbours, 'access', _49 => _49[index + 1], 'optionalAccess', _50 => _50.sortOrder]), () => ( left + sortOrderStep * 2));
13491
13528
  return (right + left) / 2;
13492
13529
  }
13493
13530
  };
@@ -13775,7 +13812,7 @@ function buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageHashes,
13775
13812
  if (snapshot) {
13776
13813
  publishedState = itemStateFromPage(snapshot.page, snapshot.pageContentHash);
13777
13814
  }
13778
- const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _49 => _49.pageContentHash]))), () => ( ""));
13815
+ const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _51 => _51.pageContentHash]))), () => ( ""));
13779
13816
  const currentState = itemStateFromPage(page, currentPageContentHash);
13780
13817
  const draftState = createDraftState(page.persistentId, currentState, publishedState, debug);
13781
13818
  if (draftState) result.set(page.persistentId, draftState);
@@ -13908,7 +13945,7 @@ function buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug) {
13908
13945
  function itemStateFromGroup(group) {
13909
13946
  return {
13910
13947
  title: group.meta.name,
13911
- configuration: _nullishCoalesce(_optionalChain([group, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
13948
+ configuration: _nullishCoalesce(_optionalChain([group, 'access', _52 => _52.data, 'optionalAccess', _53 => _53.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
13912
13949
  contentHash: "-"
13913
13950
  };
13914
13951
  }
@@ -14069,7 +14106,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
14069
14106
  function itemConfigurationToYjs(yDoc, item) {
14070
14107
  yDoc.transact((trx) => {
14071
14108
  const { title, configuration } = item;
14072
- const header = _optionalChain([configuration, 'optionalAccess', _52 => _52.header]);
14109
+ const header = _optionalChain([configuration, 'optionalAccess', _54 => _54.header]);
14073
14110
  if (title !== void 0) {
14074
14111
  const headerYMap = trx.doc.getMap("itemTitle");
14075
14112
  headerYMap.set("title", title);
@@ -14087,9 +14124,9 @@ function itemConfigurationToYjs(yDoc, item) {
14087
14124
  header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
14088
14125
  }
14089
14126
  const configYMap = trx.doc.getMap("itemConfiguration");
14090
- _optionalChain([configuration, 'optionalAccess', _53 => _53.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
14091
- _optionalChain([configuration, 'optionalAccess', _54 => _54.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
14092
- _optionalChain([configuration, 'optionalAccess', _55 => _55.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
14127
+ _optionalChain([configuration, 'optionalAccess', _55 => _55.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
14128
+ _optionalChain([configuration, 'optionalAccess', _56 => _56.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
14129
+ _optionalChain([configuration, 'optionalAccess', _57 => _57.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
14093
14130
  });
14094
14131
  }
14095
14132
 
@@ -14913,7 +14950,7 @@ var ListTreeBuilder = class {
14913
14950
  }
14914
14951
  addWithProperty(block, multiRichTextProperty) {
14915
14952
  const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
14916
- return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _56 => _56.multiRichTextStyle]) || "OL");
14953
+ return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _58 => _58.multiRichTextStyle]) || "OL");
14917
14954
  }
14918
14955
  add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
14919
14956
  const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
@@ -14928,7 +14965,7 @@ var ListTreeBuilder = class {
14928
14965
  }
14929
14966
  const listParent = this.getParentOfDepth(block.data.indentLevel);
14930
14967
  const lastChild = listParent.children[listParent.children.length - 1];
14931
- if (_optionalChain([lastChild, 'optionalAccess', _57 => _57.type]) === "List") {
14968
+ if (_optionalChain([lastChild, 'optionalAccess', _59 => _59.type]) === "List") {
14932
14969
  lastChild.children.push(...list.leadingChildren);
14933
14970
  return;
14934
14971
  } else {
@@ -15157,7 +15194,7 @@ function serializeAsRichTextBlock(input) {
15157
15194
  const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
15158
15195
  const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
15159
15196
  const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
15160
- const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _58 => _58.richTextStyle]), () => ( "Default"));
15197
+ const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _60 => _60.richTextStyle]), () => ( "Default"));
15161
15198
  switch (style) {
15162
15199
  case "Callout":
15163
15200
  return serializeAsCallout(enrichedInput);
@@ -15381,7 +15418,7 @@ function serializeBlockNodeAttributes(block) {
15381
15418
  };
15382
15419
  }
15383
15420
  function richTextHeadingLevel(property) {
15384
- const style = _optionalChain([property, 'access', _59 => _59.options, 'optionalAccess', _60 => _60.richTextStyle]);
15421
+ const style = _optionalChain([property, 'access', _61 => _61.options, 'optionalAccess', _62 => _62.richTextStyle]);
15385
15422
  if (!style) return void 0;
15386
15423
  switch (style) {
15387
15424
  case "Title1":
@@ -15500,7 +15537,7 @@ function serializeAsCustomBlock(block, definition) {
15500
15537
  linksTo: i.linksTo
15501
15538
  };
15502
15539
  });
15503
- const columns = _optionalChain([block, 'access', _61 => _61.data, 'access', _62 => _62.appearance, 'optionalAccess', _63 => _63.numberOfColumns]);
15540
+ const columns = _optionalChain([block, 'access', _63 => _63.data, 'access', _64 => _64.appearance, 'optionalAccess', _65 => _65.numberOfColumns]);
15504
15541
  return {
15505
15542
  type: serializeCustomBlockNodeType(block, definition),
15506
15543
  attrs: {
@@ -17825,7 +17862,7 @@ function parseAsListNode(prosemirrorNode) {
17825
17862
  }
17826
17863
  function parseAsListNodeItem(prosemirrorNode) {
17827
17864
  if (prosemirrorNode.type !== "listItem") return null;
17828
- const firstChild = _optionalChain([prosemirrorNode, 'access', _64 => _64.content, 'optionalAccess', _65 => _65[0]]);
17865
+ const firstChild = _optionalChain([prosemirrorNode, 'access', _66 => _66.content, 'optionalAccess', _67 => _67[0]]);
17829
17866
  if (!firstChild || firstChild.type !== "paragraph") return null;
17830
17867
  return parseRichText(_nullishCoalesce(firstChild.content, () => ( [])));
17831
17868
  }
@@ -17973,9 +18010,9 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
17973
18010
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
17974
18011
  const result = [];
17975
18012
  const listItems = [];
17976
- _optionalChain([prosemirrorNode, 'access', _66 => _66.content, 'optionalAccess', _67 => _67.forEach, 'call', _68 => _68((c) => {
18013
+ _optionalChain([prosemirrorNode, 'access', _68 => _68.content, 'optionalAccess', _69 => _69.forEach, 'call', _70 => _70((c) => {
17977
18014
  if (c.type !== "listItem") return;
17978
- _optionalChain([c, 'access', _69 => _69.content, 'optionalAccess', _70 => _70.forEach, 'call', _71 => _71((cc) => {
18015
+ _optionalChain([c, 'access', _71 => _71.content, 'optionalAccess', _72 => _72.forEach, 'call', _73 => _73((cc) => {
17979
18016
  listItems.push(cc);
17980
18017
  })]);
17981
18018
  })]);
@@ -18086,17 +18123,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
18086
18123
  if (!id) return null;
18087
18124
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
18088
18125
  const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
18089
- const tableChild = _optionalChain([prosemirrorNode, 'access', _72 => _72.content, 'optionalAccess', _73 => _73.find, 'call', _74 => _74((c) => c.type === "table")]);
18126
+ const tableChild = _optionalChain([prosemirrorNode, 'access', _74 => _74.content, 'optionalAccess', _75 => _75.find, 'call', _76 => _76((c) => c.type === "table")]);
18090
18127
  if (!tableChild) {
18091
18128
  return emptyTable(id, variantId, 0);
18092
18129
  }
18093
- const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _75 => _75.content, 'optionalAccess', _76 => _76.filter, 'call', _77 => _77((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _78 => _78.content, 'optionalAccess', _79 => _79.length]))]), () => ( []));
18130
+ const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _77 => _77.content, 'optionalAccess', _78 => _78.filter, 'call', _79 => _79((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _80 => _80.content, 'optionalAccess', _81 => _81.length]))]), () => ( []));
18094
18131
  if (!rows.length) {
18095
18132
  return emptyTable(id, variantId, 0);
18096
18133
  }
18097
- const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _80 => _80[0], 'access', _81 => _81.content, 'optionalAccess', _82 => _82.filter, 'call', _83 => _83((c) => c.type === "tableHeader"), 'access', _84 => _84.length]), () => ( 0));
18098
- const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _85 => _85.content, 'optionalAccess', _86 => _86[0], 'optionalAccess', _87 => _87.type]) === "tableHeader").length;
18099
- const hasHeaderRow = _optionalChain([rows, 'access', _88 => _88[0], 'access', _89 => _89.content, 'optionalAccess', _90 => _90.length]) === rowHeaderCells;
18134
+ const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _82 => _82[0], 'access', _83 => _83.content, 'optionalAccess', _84 => _84.filter, 'call', _85 => _85((c) => c.type === "tableHeader"), 'access', _86 => _86.length]), () => ( 0));
18135
+ const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _87 => _87.content, 'optionalAccess', _88 => _88[0], 'optionalAccess', _89 => _89.type]) === "tableHeader").length;
18136
+ const hasHeaderRow = _optionalChain([rows, 'access', _90 => _90[0], 'access', _91 => _91.content, 'optionalAccess', _92 => _92.length]) === rowHeaderCells;
18100
18137
  const hasHeaderColumn = rows.length === columnHeaderCells;
18101
18138
  const tableValue = {
18102
18139
  showBorder: hasBorder,
@@ -18173,7 +18210,7 @@ function parseAsTableNode(prosemirrorNode) {
18173
18210
  if (!items) return null;
18174
18211
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
18175
18212
  if (!parsedItems.success) return null;
18176
- const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _91 => _91.data, 'access', _92 => _92[0], 'optionalAccess', _93 => _93.props, 'access', _94 => _94.image]);
18213
+ const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _93 => _93.data, 'access', _94 => _94[0], 'optionalAccess', _95 => _95.props, 'access', _96 => _96.image]);
18177
18214
  if (!rawImagePropertyValue) return null;
18178
18215
  const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
18179
18216
  if (!imagePropertyValueParseResult.success) return null;
@@ -18414,7 +18451,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
18414
18451
  return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
18415
18452
  }
18416
18453
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
18417
- const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _95 => _95.attrs, 'optionalAccess', _96 => _96[attributeName]]));
18454
+ const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _97 => _97.attrs, 'optionalAccess', _98 => _98[attributeName]]));
18418
18455
  if (parsedAttr.success) {
18419
18456
  return parsedAttr.data;
18420
18457
  } else {
@@ -19242,10 +19279,10 @@ var LocalProjectActionExecutor = class {
19242
19279
  const SORT_ORDER_STEP = 1e3;
19243
19280
  if (afterItemId === void 0) {
19244
19281
  const lastSection = findLast(projectId, sectionId);
19245
- return (_nullishCoalesce(_optionalChain([lastSection, 'optionalAccess', _97 => _97.sortOrder]), () => ( 0))) + SORT_ORDER_STEP;
19282
+ return (_nullishCoalesce(_optionalChain([lastSection, 'optionalAccess', _99 => _99.sortOrder]), () => ( 0))) + SORT_ORDER_STEP;
19246
19283
  } else if (afterItemId === null) {
19247
19284
  const firstSection = findFirst(projectId, sectionId);
19248
- return (_nullishCoalesce(_optionalChain([firstSection, 'optionalAccess', _98 => _98.sortOrder]), () => ( SORT_ORDER_STEP))) - SORT_ORDER_STEP;
19285
+ return (_nullishCoalesce(_optionalChain([firstSection, 'optionalAccess', _100 => _100.sortOrder]), () => ( SORT_ORDER_STEP))) - SORT_ORDER_STEP;
19249
19286
  } else {
19250
19287
  const targetSection = findUnique(projectId, afterItemId, sectionId);
19251
19288
  if (!targetSection) return null;