@supernova-studio/client 1.16.2 → 1.17.0
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 +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +101 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyzeCodeComponentsInPackage, DependencyDefinition, Registry, PageBlockDefinitionLayout as PageBlockDefinitionLayout$1, PageBlockV1, FigmaFileStructureNode as FigmaFileStructureNode$1, FigmaExporter, PublishedDocPageVisitsEntry, DocumentationGroupV1, DocumentationPageV1, DocumentationPageV2, ElementGroup, DocumentationPageSnapshot, ElementGroupSnapshot, DocumentationPageApproval, OmitStrict, DocumentationItemConfigurationV1, DocumentationItemConfigurationV2, Pipeline, GitOrganization, GitProject, GitRepository, GitBranch, ExtendedIntegration, IntegrationCredentials, SupernovaExceptionType, SsoProvider, UpdateMembershipRolesInput, PageBlockItemUntypedValue, PageBlockDefinition, PageBlockItemRichTextEditorValue, PageBlockText, PageBlockDefinitionProperty, PageBlockDefinitionMultiRichTextPropertyStyle, PageBlockItemV2, PageBlockItemRichTextValue, PageBlockItemMultiRichTextValue, PageBlockItemTableValue, PageBlockItemEmbedValue, PageBlockDefinitionPropertyType, ForgeProjectArtifact, ProjectFeature } from '@supernova-studio/model';
|
|
1
|
+
import { AnalyzeCodeComponentsInPackage, DependencyDefinition, Registry, PageBlockDefinitionLayout as PageBlockDefinitionLayout$1, PageBlockV1, FigmaFileStructureNode as FigmaFileStructureNode$1, FigmaExporter, PublishedDocPageVisitsEntry, DocumentationGroupV1, DocumentationPageV1, DocumentationPageV2, ElementGroup, DocumentationPageSnapshot, ElementGroupSnapshot, DocumentationPageApproval, OmitStrict, DocumentationItemConfigurationV1, DocumentationItemConfigurationV2, Pipeline, GitOrganization, GitProject, GitRepository, GitBranch, ExtendedIntegration, IntegrationCredentials, SupernovaExceptionType, SsoProvider, UpdateMembershipRolesInput, PageBlockItemUntypedValue, PageBlockDefinition, PageBlockItemRichTextEditorValue, PageBlockText, PageBlockDefinitionProperty, PageBlockDefinitionMultiRichTextPropertyStyle, PageBlockItemV2, PageBlockItemRichTextValue, PageBlockItemMultiRichTextValue, PageBlockItemTableValue, PageBlockItemEmbedValue, PageBlockDefinitionPropertyType, ForgeProjectArtifact, ProjectFeature, ForgeSection } from '@supernova-studio/model';
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import z__default, { z as z$1, ZodSchema, ZodTypeDef } from 'zod';
|
|
4
4
|
import * as Y from 'yjs';
|
|
@@ -128992,6 +128992,8 @@ type SupportedElementActionType = NarrowedUnion<DTOElementActionInput["type"], "
|
|
|
128992
128992
|
type ProjectContentState = {
|
|
128993
128993
|
artifacts: DTOForgeProjectArtifact[];
|
|
128994
128994
|
features: DTOForgeProjectFeature[];
|
|
128995
|
+
artifactSections: DTOForgeSection[];
|
|
128996
|
+
featureSections: DTOForgeSection[];
|
|
128995
128997
|
};
|
|
128996
128998
|
|
|
128997
128999
|
type DocsPage$3 = LocalDocsPage | VersionRoomDocsPage;
|
|
@@ -143553,6 +143555,10 @@ type ForgeProjectRoomTransaction = {
|
|
|
143553
143555
|
artifactIdsToDelete?: string[];
|
|
143554
143556
|
features?: ProjectFeature[];
|
|
143555
143557
|
featureIdsToDelete?: string[];
|
|
143558
|
+
artifactSections?: ForgeSection[];
|
|
143559
|
+
artifactSectionIdsToDelete?: string[];
|
|
143560
|
+
featureSections?: ForgeSection[];
|
|
143561
|
+
featureSectionIdsToDelete?: string[];
|
|
143556
143562
|
executedTransactionIds?: string[];
|
|
143557
143563
|
};
|
|
143558
143564
|
declare class BackendForgeProjectRoomYDoc {
|
|
@@ -143565,6 +143571,8 @@ interface ForgeProjectRoomBaseYDocState {
|
|
|
143565
143571
|
isLoaded: boolean;
|
|
143566
143572
|
artifacts: ForgeProjectArtifact[];
|
|
143567
143573
|
features: ProjectFeature[];
|
|
143574
|
+
artifactSections: ForgeSection[];
|
|
143575
|
+
featureSections: ForgeSection[];
|
|
143568
143576
|
executedTransactionIds: string[];
|
|
143569
143577
|
}
|
|
143570
143578
|
declare class ForgeProjectRoomBaseYDoc {
|
|
@@ -143579,6 +143587,14 @@ declare class ForgeProjectRoomBaseYDoc {
|
|
|
143579
143587
|
updateFeatures(features: ProjectFeature[]): void;
|
|
143580
143588
|
deleteFeatures(ids: string[]): void;
|
|
143581
143589
|
private get featuresYMap();
|
|
143590
|
+
getArtifactSections(): ForgeSection[];
|
|
143591
|
+
updateArtifactSections(sections: ForgeSection[]): void;
|
|
143592
|
+
deleteArtifactSections(ids: string[]): void;
|
|
143593
|
+
private get artifactSectionsYMap();
|
|
143594
|
+
getFeatureSections(): ForgeSection[];
|
|
143595
|
+
updateFeatureSections(sections: ForgeSection[]): void;
|
|
143596
|
+
deleteFeatureSections(ids: string[]): void;
|
|
143597
|
+
private get featureSectionsYMap();
|
|
143582
143598
|
updateExecutedTransactionIds(transactionIds: string[]): void;
|
|
143583
143599
|
getExecutedTransactionIds(): string[];
|
|
143584
143600
|
private get executedTransactionIdsArray();
|
|
@@ -143864,6 +143880,24 @@ declare function applyProjectActionsLocally(input: Input): {
|
|
|
143864
143880
|
sectionId?: string | undefined;
|
|
143865
143881
|
isArchived?: boolean | undefined;
|
|
143866
143882
|
}[];
|
|
143883
|
+
artifactSections: {
|
|
143884
|
+
id: string;
|
|
143885
|
+
name: string;
|
|
143886
|
+
createdAt: Date;
|
|
143887
|
+
updatedAt: Date;
|
|
143888
|
+
childType: "Artifact" | "Feature";
|
|
143889
|
+
sortOrder: number;
|
|
143890
|
+
projectId: string;
|
|
143891
|
+
}[];
|
|
143892
|
+
featureSections: {
|
|
143893
|
+
id: string;
|
|
143894
|
+
name: string;
|
|
143895
|
+
createdAt: Date;
|
|
143896
|
+
updatedAt: Date;
|
|
143897
|
+
childType: "Artifact" | "Feature";
|
|
143898
|
+
sortOrder: number;
|
|
143899
|
+
projectId: string;
|
|
143900
|
+
}[];
|
|
143867
143901
|
};
|
|
143868
143902
|
type LocalExecutorConfig = {
|
|
143869
143903
|
userId: string;
|
|
@@ -143873,12 +143907,16 @@ type LocalExecutorConfig = {
|
|
|
143873
143907
|
type ForgeProjectYDocState = {
|
|
143874
143908
|
artifacts: DTOForgeProjectArtifact[];
|
|
143875
143909
|
features: DTOForgeProjectFeature[];
|
|
143910
|
+
artifactSections: DTOForgeSection[];
|
|
143911
|
+
featureSections: DTOForgeSection[];
|
|
143876
143912
|
};
|
|
143877
143913
|
declare class LocalProjectActionExecutor {
|
|
143878
143914
|
private readonly userId;
|
|
143879
143915
|
private readonly projectId;
|
|
143880
143916
|
private readonly artifacts;
|
|
143881
143917
|
private readonly features;
|
|
143918
|
+
private readonly artifactSections;
|
|
143919
|
+
private readonly featureSections;
|
|
143882
143920
|
constructor(config: LocalExecutorConfig);
|
|
143883
143921
|
get localState(): {
|
|
143884
143922
|
artifacts: {
|
|
@@ -143905,6 +143943,24 @@ declare class LocalProjectActionExecutor {
|
|
|
143905
143943
|
sectionId?: string | undefined;
|
|
143906
143944
|
isArchived?: boolean | undefined;
|
|
143907
143945
|
}[];
|
|
143946
|
+
artifactSections: {
|
|
143947
|
+
id: string;
|
|
143948
|
+
name: string;
|
|
143949
|
+
createdAt: Date;
|
|
143950
|
+
updatedAt: Date;
|
|
143951
|
+
childType: "Artifact" | "Feature";
|
|
143952
|
+
sortOrder: number;
|
|
143953
|
+
projectId: string;
|
|
143954
|
+
}[];
|
|
143955
|
+
featureSections: {
|
|
143956
|
+
id: string;
|
|
143957
|
+
name: string;
|
|
143958
|
+
createdAt: Date;
|
|
143959
|
+
updatedAt: Date;
|
|
143960
|
+
childType: "Artifact" | "Feature";
|
|
143961
|
+
sortOrder: number;
|
|
143962
|
+
projectId: string;
|
|
143963
|
+
}[];
|
|
143908
143964
|
};
|
|
143909
143965
|
applyActions(trx: DTOForgeProjectAction[]): void;
|
|
143910
143966
|
applyTransaction(trx: DTOForgeProjectAction): void;
|
|
@@ -143914,6 +143970,9 @@ declare class LocalProjectActionExecutor {
|
|
|
143914
143970
|
private featureCreate;
|
|
143915
143971
|
private featureUpdate;
|
|
143916
143972
|
private featureDelete;
|
|
143973
|
+
private sectionCreate;
|
|
143974
|
+
private sectionUpdate;
|
|
143975
|
+
private sectionDelete;
|
|
143917
143976
|
}
|
|
143918
143977
|
|
|
143919
143978
|
declare enum ParsedFigmaFileURLError {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyzeCodeComponentsInPackage, DependencyDefinition, Registry, PageBlockDefinitionLayout as PageBlockDefinitionLayout$1, PageBlockV1, FigmaFileStructureNode as FigmaFileStructureNode$1, FigmaExporter, PublishedDocPageVisitsEntry, DocumentationGroupV1, DocumentationPageV1, DocumentationPageV2, ElementGroup, DocumentationPageSnapshot, ElementGroupSnapshot, DocumentationPageApproval, OmitStrict, DocumentationItemConfigurationV1, DocumentationItemConfigurationV2, Pipeline, GitOrganization, GitProject, GitRepository, GitBranch, ExtendedIntegration, IntegrationCredentials, SupernovaExceptionType, SsoProvider, UpdateMembershipRolesInput, PageBlockItemUntypedValue, PageBlockDefinition, PageBlockItemRichTextEditorValue, PageBlockText, PageBlockDefinitionProperty, PageBlockDefinitionMultiRichTextPropertyStyle, PageBlockItemV2, PageBlockItemRichTextValue, PageBlockItemMultiRichTextValue, PageBlockItemTableValue, PageBlockItemEmbedValue, PageBlockDefinitionPropertyType, ForgeProjectArtifact, ProjectFeature } from '@supernova-studio/model';
|
|
1
|
+
import { AnalyzeCodeComponentsInPackage, DependencyDefinition, Registry, PageBlockDefinitionLayout as PageBlockDefinitionLayout$1, PageBlockV1, FigmaFileStructureNode as FigmaFileStructureNode$1, FigmaExporter, PublishedDocPageVisitsEntry, DocumentationGroupV1, DocumentationPageV1, DocumentationPageV2, ElementGroup, DocumentationPageSnapshot, ElementGroupSnapshot, DocumentationPageApproval, OmitStrict, DocumentationItemConfigurationV1, DocumentationItemConfigurationV2, Pipeline, GitOrganization, GitProject, GitRepository, GitBranch, ExtendedIntegration, IntegrationCredentials, SupernovaExceptionType, SsoProvider, UpdateMembershipRolesInput, PageBlockItemUntypedValue, PageBlockDefinition, PageBlockItemRichTextEditorValue, PageBlockText, PageBlockDefinitionProperty, PageBlockDefinitionMultiRichTextPropertyStyle, PageBlockItemV2, PageBlockItemRichTextValue, PageBlockItemMultiRichTextValue, PageBlockItemTableValue, PageBlockItemEmbedValue, PageBlockDefinitionPropertyType, ForgeProjectArtifact, ProjectFeature, ForgeSection } from '@supernova-studio/model';
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import z__default, { z as z$1, ZodSchema, ZodTypeDef } from 'zod';
|
|
4
4
|
import * as Y from 'yjs';
|
|
@@ -128992,6 +128992,8 @@ type SupportedElementActionType = NarrowedUnion<DTOElementActionInput["type"], "
|
|
|
128992
128992
|
type ProjectContentState = {
|
|
128993
128993
|
artifacts: DTOForgeProjectArtifact[];
|
|
128994
128994
|
features: DTOForgeProjectFeature[];
|
|
128995
|
+
artifactSections: DTOForgeSection[];
|
|
128996
|
+
featureSections: DTOForgeSection[];
|
|
128995
128997
|
};
|
|
128996
128998
|
|
|
128997
128999
|
type DocsPage$3 = LocalDocsPage | VersionRoomDocsPage;
|
|
@@ -143553,6 +143555,10 @@ type ForgeProjectRoomTransaction = {
|
|
|
143553
143555
|
artifactIdsToDelete?: string[];
|
|
143554
143556
|
features?: ProjectFeature[];
|
|
143555
143557
|
featureIdsToDelete?: string[];
|
|
143558
|
+
artifactSections?: ForgeSection[];
|
|
143559
|
+
artifactSectionIdsToDelete?: string[];
|
|
143560
|
+
featureSections?: ForgeSection[];
|
|
143561
|
+
featureSectionIdsToDelete?: string[];
|
|
143556
143562
|
executedTransactionIds?: string[];
|
|
143557
143563
|
};
|
|
143558
143564
|
declare class BackendForgeProjectRoomYDoc {
|
|
@@ -143565,6 +143571,8 @@ interface ForgeProjectRoomBaseYDocState {
|
|
|
143565
143571
|
isLoaded: boolean;
|
|
143566
143572
|
artifacts: ForgeProjectArtifact[];
|
|
143567
143573
|
features: ProjectFeature[];
|
|
143574
|
+
artifactSections: ForgeSection[];
|
|
143575
|
+
featureSections: ForgeSection[];
|
|
143568
143576
|
executedTransactionIds: string[];
|
|
143569
143577
|
}
|
|
143570
143578
|
declare class ForgeProjectRoomBaseYDoc {
|
|
@@ -143579,6 +143587,14 @@ declare class ForgeProjectRoomBaseYDoc {
|
|
|
143579
143587
|
updateFeatures(features: ProjectFeature[]): void;
|
|
143580
143588
|
deleteFeatures(ids: string[]): void;
|
|
143581
143589
|
private get featuresYMap();
|
|
143590
|
+
getArtifactSections(): ForgeSection[];
|
|
143591
|
+
updateArtifactSections(sections: ForgeSection[]): void;
|
|
143592
|
+
deleteArtifactSections(ids: string[]): void;
|
|
143593
|
+
private get artifactSectionsYMap();
|
|
143594
|
+
getFeatureSections(): ForgeSection[];
|
|
143595
|
+
updateFeatureSections(sections: ForgeSection[]): void;
|
|
143596
|
+
deleteFeatureSections(ids: string[]): void;
|
|
143597
|
+
private get featureSectionsYMap();
|
|
143582
143598
|
updateExecutedTransactionIds(transactionIds: string[]): void;
|
|
143583
143599
|
getExecutedTransactionIds(): string[];
|
|
143584
143600
|
private get executedTransactionIdsArray();
|
|
@@ -143864,6 +143880,24 @@ declare function applyProjectActionsLocally(input: Input): {
|
|
|
143864
143880
|
sectionId?: string | undefined;
|
|
143865
143881
|
isArchived?: boolean | undefined;
|
|
143866
143882
|
}[];
|
|
143883
|
+
artifactSections: {
|
|
143884
|
+
id: string;
|
|
143885
|
+
name: string;
|
|
143886
|
+
createdAt: Date;
|
|
143887
|
+
updatedAt: Date;
|
|
143888
|
+
childType: "Artifact" | "Feature";
|
|
143889
|
+
sortOrder: number;
|
|
143890
|
+
projectId: string;
|
|
143891
|
+
}[];
|
|
143892
|
+
featureSections: {
|
|
143893
|
+
id: string;
|
|
143894
|
+
name: string;
|
|
143895
|
+
createdAt: Date;
|
|
143896
|
+
updatedAt: Date;
|
|
143897
|
+
childType: "Artifact" | "Feature";
|
|
143898
|
+
sortOrder: number;
|
|
143899
|
+
projectId: string;
|
|
143900
|
+
}[];
|
|
143867
143901
|
};
|
|
143868
143902
|
type LocalExecutorConfig = {
|
|
143869
143903
|
userId: string;
|
|
@@ -143873,12 +143907,16 @@ type LocalExecutorConfig = {
|
|
|
143873
143907
|
type ForgeProjectYDocState = {
|
|
143874
143908
|
artifacts: DTOForgeProjectArtifact[];
|
|
143875
143909
|
features: DTOForgeProjectFeature[];
|
|
143910
|
+
artifactSections: DTOForgeSection[];
|
|
143911
|
+
featureSections: DTOForgeSection[];
|
|
143876
143912
|
};
|
|
143877
143913
|
declare class LocalProjectActionExecutor {
|
|
143878
143914
|
private readonly userId;
|
|
143879
143915
|
private readonly projectId;
|
|
143880
143916
|
private readonly artifacts;
|
|
143881
143917
|
private readonly features;
|
|
143918
|
+
private readonly artifactSections;
|
|
143919
|
+
private readonly featureSections;
|
|
143882
143920
|
constructor(config: LocalExecutorConfig);
|
|
143883
143921
|
get localState(): {
|
|
143884
143922
|
artifacts: {
|
|
@@ -143905,6 +143943,24 @@ declare class LocalProjectActionExecutor {
|
|
|
143905
143943
|
sectionId?: string | undefined;
|
|
143906
143944
|
isArchived?: boolean | undefined;
|
|
143907
143945
|
}[];
|
|
143946
|
+
artifactSections: {
|
|
143947
|
+
id: string;
|
|
143948
|
+
name: string;
|
|
143949
|
+
createdAt: Date;
|
|
143950
|
+
updatedAt: Date;
|
|
143951
|
+
childType: "Artifact" | "Feature";
|
|
143952
|
+
sortOrder: number;
|
|
143953
|
+
projectId: string;
|
|
143954
|
+
}[];
|
|
143955
|
+
featureSections: {
|
|
143956
|
+
id: string;
|
|
143957
|
+
name: string;
|
|
143958
|
+
createdAt: Date;
|
|
143959
|
+
updatedAt: Date;
|
|
143960
|
+
childType: "Artifact" | "Feature";
|
|
143961
|
+
sortOrder: number;
|
|
143962
|
+
projectId: string;
|
|
143963
|
+
}[];
|
|
143908
143964
|
};
|
|
143909
143965
|
applyActions(trx: DTOForgeProjectAction[]): void;
|
|
143910
143966
|
applyTransaction(trx: DTOForgeProjectAction): void;
|
|
@@ -143914,6 +143970,9 @@ declare class LocalProjectActionExecutor {
|
|
|
143914
143970
|
private featureCreate;
|
|
143915
143971
|
private featureUpdate;
|
|
143916
143972
|
private featureDelete;
|
|
143973
|
+
private sectionCreate;
|
|
143974
|
+
private sectionUpdate;
|
|
143975
|
+
private sectionDelete;
|
|
143917
143976
|
}
|
|
143918
143977
|
|
|
143919
143978
|
declare enum ParsedFigmaFileURLError {
|
package/dist/index.js
CHANGED
|
@@ -5263,13 +5263,19 @@ var ForgeProjectRoom = Entity.extend({
|
|
|
5263
5263
|
});
|
|
5264
5264
|
var ForgeProjectRoomInitialState = _zod.z.object({
|
|
5265
5265
|
artifacts: _zod.z.array(ForgeProjectArtifact),
|
|
5266
|
-
features: _zod.z.array(ProjectFeature)
|
|
5266
|
+
features: _zod.z.array(ProjectFeature),
|
|
5267
|
+
artifactSections: _zod.z.array(ForgeSection),
|
|
5268
|
+
featureSections: _zod.z.array(ForgeSection)
|
|
5267
5269
|
});
|
|
5268
5270
|
var ForgeProjectRoomUpdate = _zod.z.object({
|
|
5269
5271
|
artifacts: _zod.z.array(ForgeProjectArtifact).optional(),
|
|
5270
5272
|
artifactIdsToDelete: _zod.z.array(_zod.z.string()).optional(),
|
|
5271
5273
|
features: _zod.z.array(ProjectFeature).optional(),
|
|
5272
5274
|
featureIdsToDelete: _zod.z.array(_zod.z.string()).optional(),
|
|
5275
|
+
artifactSections: _zod.z.array(ForgeSection).optional(),
|
|
5276
|
+
artifactSectionIdsToDelete: _zod.z.array(_zod.z.string()).optional(),
|
|
5277
|
+
featureSections: _zod.z.array(ForgeSection).optional(),
|
|
5278
|
+
featureSectionIdsToDelete: _zod.z.array(_zod.z.string()).optional(),
|
|
5273
5279
|
executedTransactionIds: _zod.z.string().array().optional()
|
|
5274
5280
|
});
|
|
5275
5281
|
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
@@ -16794,12 +16800,16 @@ var ForgeProjectRoomBaseYDoc = class {
|
|
|
16794
16800
|
getState() {
|
|
16795
16801
|
const artifacts = this.getArtifacts();
|
|
16796
16802
|
const features = this.getFeatures();
|
|
16803
|
+
const artifactSections = this.getArtifactSections();
|
|
16804
|
+
const featureSections = this.getFeatureSections();
|
|
16797
16805
|
const executedTransactionIds = this.getExecutedTransactionIds();
|
|
16798
16806
|
const isLoaded = true;
|
|
16799
16807
|
return {
|
|
16800
16808
|
isLoaded,
|
|
16801
16809
|
artifacts,
|
|
16802
16810
|
features,
|
|
16811
|
+
artifactSections,
|
|
16812
|
+
featureSections,
|
|
16803
16813
|
executedTransactionIds
|
|
16804
16814
|
};
|
|
16805
16815
|
}
|
|
@@ -16834,6 +16844,33 @@ var ForgeProjectRoomBaseYDoc = class {
|
|
|
16834
16844
|
return this.yDoc.getMap("forgeProjectFeatures");
|
|
16835
16845
|
}
|
|
16836
16846
|
//
|
|
16847
|
+
// Sections
|
|
16848
|
+
//
|
|
16849
|
+
getArtifactSections() {
|
|
16850
|
+
return this.getObjects(this.artifactSectionsYMap, ForgeSection);
|
|
16851
|
+
}
|
|
16852
|
+
updateArtifactSections(sections) {
|
|
16853
|
+
this.setObjects(this.artifactSectionsYMap, sections);
|
|
16854
|
+
}
|
|
16855
|
+
deleteArtifactSections(ids) {
|
|
16856
|
+
this.deleteObjects(this.artifactSectionsYMap, ids);
|
|
16857
|
+
}
|
|
16858
|
+
get artifactSectionsYMap() {
|
|
16859
|
+
return this.yDoc.getMap("forgeProjectArtifactSections");
|
|
16860
|
+
}
|
|
16861
|
+
getFeatureSections() {
|
|
16862
|
+
return this.getObjects(this.featureSectionsYMap, ForgeSection);
|
|
16863
|
+
}
|
|
16864
|
+
updateFeatureSections(sections) {
|
|
16865
|
+
this.setObjects(this.featureSectionsYMap, sections);
|
|
16866
|
+
}
|
|
16867
|
+
deleteFeatureSections(ids) {
|
|
16868
|
+
this.deleteObjects(this.featureSectionsYMap, ids);
|
|
16869
|
+
}
|
|
16870
|
+
get featureSectionsYMap() {
|
|
16871
|
+
return this.yDoc.getMap("forgeProjectFeatureSections");
|
|
16872
|
+
}
|
|
16873
|
+
//
|
|
16837
16874
|
// Executed transactions
|
|
16838
16875
|
//
|
|
16839
16876
|
updateExecutedTransactionIds(transactionIds) {
|
|
@@ -16863,7 +16900,7 @@ var ForgeProjectRoomBaseYDoc = class {
|
|
|
16863
16900
|
return objects;
|
|
16864
16901
|
}
|
|
16865
16902
|
setObjects(map, objects) {
|
|
16866
|
-
objects.forEach((
|
|
16903
|
+
objects.forEach((o) => map.set(o.id, JSON.parse(JSON.stringify(o))));
|
|
16867
16904
|
}
|
|
16868
16905
|
deleteObjects(map, ids) {
|
|
16869
16906
|
ids.forEach((id) => map.delete(id));
|
|
@@ -16883,6 +16920,10 @@ var BackendForgeProjectRoomYDoc = class {
|
|
|
16883
16920
|
transaction.artifacts && yDoc.updateArtifacts(transaction.artifacts);
|
|
16884
16921
|
transaction.featureIdsToDelete && yDoc.deleteFeatures(transaction.featureIdsToDelete);
|
|
16885
16922
|
transaction.features && yDoc.updateFeatures(transaction.features);
|
|
16923
|
+
transaction.artifactSectionIdsToDelete && yDoc.deleteArtifactSections(transaction.artifactSectionIdsToDelete);
|
|
16924
|
+
transaction.artifactSections && yDoc.updateArtifactSections(transaction.artifactSections);
|
|
16925
|
+
transaction.featureSectionIdsToDelete && yDoc.deleteFeatureSections(transaction.featureSectionIdsToDelete);
|
|
16926
|
+
transaction.featureSections && yDoc.updateFeatureSections(transaction.featureSections);
|
|
16886
16927
|
transaction.executedTransactionIds && yDoc.updateExecutedTransactionIds(transaction.executedTransactionIds);
|
|
16887
16928
|
});
|
|
16888
16929
|
}
|
|
@@ -17121,16 +17162,22 @@ var LocalProjectActionExecutor = class {
|
|
|
17121
17162
|
__publicField(this, "projectId");
|
|
17122
17163
|
__publicField(this, "artifacts");
|
|
17123
17164
|
__publicField(this, "features");
|
|
17165
|
+
__publicField(this, "artifactSections");
|
|
17166
|
+
__publicField(this, "featureSections");
|
|
17124
17167
|
const { projectId, remoteState, userId } = config;
|
|
17125
17168
|
this.userId = userId;
|
|
17126
17169
|
this.projectId = projectId;
|
|
17127
17170
|
this.artifacts = mapByUnique(remoteState.artifacts, (p) => p.id);
|
|
17128
17171
|
this.features = mapByUnique(remoteState.features, (p) => p.id);
|
|
17172
|
+
this.artifactSections = mapByUnique(remoteState.artifactSections, (p) => p.id);
|
|
17173
|
+
this.featureSections = mapByUnique(remoteState.featureSections, (p) => p.id);
|
|
17129
17174
|
}
|
|
17130
17175
|
get localState() {
|
|
17131
17176
|
return {
|
|
17132
17177
|
artifacts: Array.from(this.artifacts.values()),
|
|
17133
|
-
features: Array.from(this.features.values())
|
|
17178
|
+
features: Array.from(this.features.values()),
|
|
17179
|
+
artifactSections: Array.from(this.artifactSections.values()),
|
|
17180
|
+
featureSections: Array.from(this.featureSections.values())
|
|
17134
17181
|
};
|
|
17135
17182
|
}
|
|
17136
17183
|
applyActions(trx) {
|
|
@@ -17150,6 +17197,12 @@ var LocalProjectActionExecutor = class {
|
|
|
17150
17197
|
return this.featureDelete(trx);
|
|
17151
17198
|
case "FeatureUpdate":
|
|
17152
17199
|
return this.featureUpdate(trx);
|
|
17200
|
+
case "SectionCreate":
|
|
17201
|
+
return this.sectionCreate(trx);
|
|
17202
|
+
case "SectionUpdate":
|
|
17203
|
+
return this.sectionUpdate(trx);
|
|
17204
|
+
case "SectionDelete":
|
|
17205
|
+
return this.sectionDelete(trx);
|
|
17153
17206
|
}
|
|
17154
17207
|
}
|
|
17155
17208
|
//
|
|
@@ -17231,6 +17284,48 @@ var LocalProjectActionExecutor = class {
|
|
|
17231
17284
|
throw new Error(`Cannot delete feature: feature ${id} was not found in local storage`);
|
|
17232
17285
|
}
|
|
17233
17286
|
}
|
|
17287
|
+
//
|
|
17288
|
+
// Sections
|
|
17289
|
+
//
|
|
17290
|
+
sectionCreate(trx) {
|
|
17291
|
+
const { input } = trx;
|
|
17292
|
+
const { id } = input;
|
|
17293
|
+
const sections = input.childType === "Artifact" ? this.artifactSections : this.featureSections;
|
|
17294
|
+
sections.set(id, {
|
|
17295
|
+
id,
|
|
17296
|
+
projectId: this.projectId,
|
|
17297
|
+
name: input.name,
|
|
17298
|
+
childType: input.childType,
|
|
17299
|
+
sortOrder: 0,
|
|
17300
|
+
// TODO: Use Roman's calculate functions
|
|
17301
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
17302
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
17303
|
+
});
|
|
17304
|
+
}
|
|
17305
|
+
sectionUpdate(trx) {
|
|
17306
|
+
const { input } = trx;
|
|
17307
|
+
const { id } = input;
|
|
17308
|
+
const existingSection = _nullishCoalesce(this.artifactSections.get(id), () => ( this.featureSections.get(id)));
|
|
17309
|
+
if (!existingSection) {
|
|
17310
|
+
throw new Error(`Cannot update section: section ${id} was not found in local storage`);
|
|
17311
|
+
}
|
|
17312
|
+
const mergedSection = {
|
|
17313
|
+
...existingSection,
|
|
17314
|
+
name: _nullishCoalesce(input.name, () => ( existingSection.name)),
|
|
17315
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
17316
|
+
};
|
|
17317
|
+
const sections = existingSection.childType === "Artifact" ? this.artifactSections : this.featureSections;
|
|
17318
|
+
sections.set(id, mergedSection);
|
|
17319
|
+
}
|
|
17320
|
+
sectionDelete(trx) {
|
|
17321
|
+
const { input } = trx;
|
|
17322
|
+
const { id } = input;
|
|
17323
|
+
const isArtifactSection = this.artifactSections.delete(id);
|
|
17324
|
+
const isFeatureSection = this.featureSections.delete(id);
|
|
17325
|
+
if (!isArtifactSection && !isFeatureSection) {
|
|
17326
|
+
throw new Error(`Cannot delete section: section ${id} was not found in local storage`);
|
|
17327
|
+
}
|
|
17328
|
+
}
|
|
17234
17329
|
};
|
|
17235
17330
|
|
|
17236
17331
|
// src/sync/project-content-repo.ts
|
|
@@ -17344,7 +17439,9 @@ var ForgeProjectContentRepository = class {
|
|
|
17344
17439
|
});
|
|
17345
17440
|
return {
|
|
17346
17441
|
artifacts: state.artifacts,
|
|
17347
|
-
features: state.features
|
|
17442
|
+
features: state.features,
|
|
17443
|
+
artifactSections: state.artifactSections,
|
|
17444
|
+
featureSections: state.featureSections
|
|
17348
17445
|
};
|
|
17349
17446
|
}
|
|
17350
17447
|
onYUpdate() {
|