@powerhousedao/vetra-builder-package 5.0.2 → 5.2.0-dev.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/document-models/builder-team/actions.d.ts +30 -0
- package/dist/document-models/builder-team/actions.d.ts.map +1 -0
- package/dist/document-models/builder-team/actions.js +10 -0
- package/dist/document-models/builder-team/gen/actions.d.ts +8 -8
- package/dist/document-models/builder-team/gen/actions.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/actions.js +4 -4
- package/dist/document-models/builder-team/gen/creators.d.ts +8 -4
- package/dist/document-models/builder-team/gen/creators.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/creators.js +8 -4
- package/dist/document-models/builder-team/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/document-model.js +220 -220
- package/dist/document-models/builder-team/gen/document-schema.d.ts +50 -0
- package/dist/document-models/builder-team/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/builder-team/gen/document-schema.js +33 -0
- package/dist/document-models/builder-team/gen/document-type.d.ts +2 -0
- package/dist/document-models/builder-team/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/builder-team/gen/document-type.js +1 -0
- package/dist/document-models/builder-team/gen/index.d.ts +14 -5
- package/dist/document-models/builder-team/gen/index.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/index.js +14 -5
- package/dist/document-models/builder-team/gen/member/actions.d.ts +5 -5
- package/dist/document-models/builder-team/gen/member/actions.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/member/actions.js +1 -1
- package/dist/document-models/builder-team/gen/member/creators.d.ts +2 -2
- package/dist/document-models/builder-team/gen/member/creators.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/member/creators.js +5 -6
- package/dist/document-models/builder-team/gen/member/error.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/member/operations.d.ts +3 -3
- package/dist/document-models/builder-team/gen/member/operations.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/member/operations.js +1 -3
- package/dist/document-models/builder-team/gen/packages/actions.d.ts +6 -6
- package/dist/document-models/builder-team/gen/packages/actions.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/packages/actions.js +1 -1
- package/dist/document-models/builder-team/gen/packages/creators.d.ts +2 -2
- package/dist/document-models/builder-team/gen/packages/creators.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/packages/creators.js +6 -7
- package/dist/document-models/builder-team/gen/packages/error.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/packages/operations.d.ts +3 -3
- package/dist/document-models/builder-team/gen/packages/operations.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/packages/operations.js +1 -3
- package/dist/document-models/builder-team/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/ph-factories.js +16 -14
- package/dist/document-models/builder-team/gen/profile/actions.d.ts +7 -7
- package/dist/document-models/builder-team/gen/profile/actions.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/profile/actions.js +1 -1
- package/dist/document-models/builder-team/gen/profile/creators.d.ts +2 -2
- package/dist/document-models/builder-team/gen/profile/creators.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/profile/creators.js +7 -8
- package/dist/document-models/builder-team/gen/profile/error.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/profile/operations.d.ts +3 -3
- package/dist/document-models/builder-team/gen/profile/operations.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/profile/operations.js +1 -3
- package/dist/document-models/builder-team/gen/reducer.d.ts +1 -3
- package/dist/document-models/builder-team/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/reducer.js +86 -70
- package/dist/document-models/builder-team/gen/schema/index.d.ts +1 -1
- package/dist/document-models/builder-team/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/schema/index.js +1 -1
- package/dist/document-models/builder-team/gen/schema/types.d.ts +13 -1
- package/dist/document-models/builder-team/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/schema/zod.d.ts +3 -3
- package/dist/document-models/builder-team/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/schema/zod.js +22 -22
- package/dist/document-models/builder-team/gen/spaces/actions.d.ts +6 -6
- package/dist/document-models/builder-team/gen/spaces/actions.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/spaces/actions.js +1 -1
- package/dist/document-models/builder-team/gen/spaces/creators.d.ts +2 -2
- package/dist/document-models/builder-team/gen/spaces/creators.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/spaces/creators.js +6 -7
- package/dist/document-models/builder-team/gen/spaces/error.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/spaces/operations.d.ts +3 -3
- package/dist/document-models/builder-team/gen/spaces/operations.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/spaces/operations.js +1 -3
- package/dist/document-models/builder-team/gen/types.d.ts +4 -5
- package/dist/document-models/builder-team/gen/types.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/types.js +1 -2
- package/dist/document-models/builder-team/gen/utils.d.ts +7 -4
- package/dist/document-models/builder-team/gen/utils.d.ts.map +1 -1
- package/dist/document-models/builder-team/gen/utils.js +41 -20
- package/dist/document-models/builder-team/hooks.d.ts +11 -0
- package/dist/document-models/builder-team/hooks.d.ts.map +1 -0
- package/dist/document-models/builder-team/hooks.js +26 -0
- package/dist/document-models/builder-team/index.d.ts +5 -45
- package/dist/document-models/builder-team/index.d.ts.map +1 -1
- package/dist/document-models/builder-team/index.js +5 -22
- package/dist/document-models/builder-team/module.d.ts +5 -0
- package/dist/document-models/builder-team/module.d.ts.map +1 -0
- package/dist/document-models/builder-team/module.js +10 -0
- package/dist/document-models/builder-team/src/index.d.ts +2 -0
- package/dist/document-models/builder-team/src/index.d.ts.map +1 -0
- package/dist/document-models/builder-team/src/index.js +1 -0
- package/dist/document-models/builder-team/src/reducers/member.d.ts +2 -2
- package/dist/document-models/builder-team/src/reducers/member.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/reducers/member.js +8 -5
- package/dist/document-models/builder-team/src/reducers/packages.d.ts +2 -2
- package/dist/document-models/builder-team/src/reducers/packages.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/reducers/packages.js +8 -8
- package/dist/document-models/builder-team/src/reducers/profile.d.ts +2 -2
- package/dist/document-models/builder-team/src/reducers/profile.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/reducers/profile.js +6 -6
- package/dist/document-models/builder-team/src/reducers/spaces.d.ts +2 -2
- package/dist/document-models/builder-team/src/reducers/spaces.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/reducers/spaces.js +7 -7
- package/dist/document-models/builder-team/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/builder-team/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/tests/document-model.test.js +92 -6
- package/dist/document-models/builder-team/src/tests/member.test.d.ts +0 -4
- package/dist/document-models/builder-team/src/tests/member.test.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/tests/member.test.js +15 -20
- package/dist/document-models/builder-team/src/tests/packages.test.d.ts +0 -4
- package/dist/document-models/builder-team/src/tests/packages.test.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/tests/packages.test.js +25 -20
- package/dist/document-models/builder-team/src/tests/profile.test.d.ts +0 -4
- package/dist/document-models/builder-team/src/tests/profile.test.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/tests/profile.test.js +23 -24
- package/dist/document-models/builder-team/src/tests/spaces.test.d.ts +0 -4
- package/dist/document-models/builder-team/src/tests/spaces.test.d.ts.map +1 -1
- package/dist/document-models/builder-team/src/tests/spaces.test.js +25 -20
- package/dist/document-models/builder-team/utils.d.ts +14 -0
- package/dist/document-models/builder-team/utils.d.ts.map +1 -0
- package/dist/document-models/builder-team/utils.js +7 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +4 -0
- package/dist/document-models/index.d.ts +1 -2
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +1 -2
- package/dist/editors/builder-team-editor/components/EditName.d.ts +3 -0
- package/dist/editors/builder-team-editor/components/EditName.d.ts.map +1 -0
- package/dist/editors/builder-team-editor/components/EditName.js +31 -0
- package/dist/editors/builder-team-editor/components/PackagesTable.d.ts.map +1 -1
- package/dist/editors/builder-team-editor/components/PackagesTable.js +0 -1
- package/dist/editors/builder-team-editor/editor.d.ts +1 -1
- package/dist/editors/builder-team-editor/editor.d.ts.map +1 -1
- package/dist/editors/builder-team-editor/editor.js +2 -4
- package/dist/editors/builder-team-editor/hooks/usePackageHandlers.d.ts +1 -2
- package/dist/editors/builder-team-editor/hooks/usePackageHandlers.d.ts.map +1 -1
- package/dist/editors/builder-team-editor/hooks/usePackageHandlers.js +1 -1
- package/dist/editors/builder-team-editor/module.d.ts +4 -0
- package/dist/editors/builder-team-editor/module.d.ts.map +1 -0
- package/dist/editors/builder-team-editor/module.js +10 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +4 -0
- package/dist/editors/index.d.ts +1 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +1 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/processors/factory.d.ts +1 -1
- package/dist/processors/factory.d.ts.map +1 -1
- package/dist/processors/factory.js +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts +2 -2
- package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts.map +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.js +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/database-helpers.d.ts +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/database-helpers.d.ts.map +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/factory.d.ts +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/factory.d.ts.map +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/factory.js +1 -2
- package/dist/processors/vetra-builder-relational-db-processor/index.d.ts +3 -5
- package/dist/processors/vetra-builder-relational-db-processor/index.d.ts.map +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/index.js +18 -20
- package/dist/processors/vetra-builder-relational-db-processor/migrations.d.ts +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/migrations.d.ts.map +1 -1
- package/dist/processors/vetra-builder-relational-db-processor/migrations.js +1 -4
- package/dist/scripts/upload-to-drive.js +0 -2
- package/dist/style.css +11 -1
- package/dist/subgraphs/index.d.ts +0 -1
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +0 -2
- package/dist/subgraphs/vetra-builders/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/vetra-builders/resolvers.js +1 -1
- package/dist/vite.config.d.ts +1 -0
- package/dist/vite.config.d.ts.map +1 -1
- package/dist/vite.config.js +1 -0
- package/package.json +65 -44
- package/dist/document-models/builder-team/gen/member/object.d.ts +0 -9
- package/dist/document-models/builder-team/gen/member/object.d.ts.map +0 -1
- package/dist/document-models/builder-team/gen/member/object.js +0 -16
- package/dist/document-models/builder-team/gen/object.d.ts +0 -21
- package/dist/document-models/builder-team/gen/object.d.ts.map +0 -1
- package/dist/document-models/builder-team/gen/object.js +0 -38
- package/dist/document-models/builder-team/gen/packages/object.d.ts +0 -10
- package/dist/document-models/builder-team/gen/packages/object.d.ts.map +0 -1
- package/dist/document-models/builder-team/gen/packages/object.js +0 -19
- package/dist/document-models/builder-team/gen/profile/object.d.ts +0 -11
- package/dist/document-models/builder-team/gen/profile/object.d.ts.map +0 -1
- package/dist/document-models/builder-team/gen/profile/object.js +0 -22
- package/dist/document-models/builder-team/gen/spaces/object.d.ts +0 -10
- package/dist/document-models/builder-team/gen/spaces/object.d.ts.map +0 -1
- package/dist/document-models/builder-team/gen/spaces/object.js +0 -19
- package/dist/editors/builder-team-editor/index.d.ts +0 -3
- package/dist/editors/builder-team-editor/index.d.ts.map +0 -1
- package/dist/editors/builder-team-editor/index.js +0 -9
- package/dist/processors/testprocessor/factory.d.ts +0 -4
- package/dist/processors/testprocessor/factory.d.ts.map +0 -1
- package/dist/processors/testprocessor/factory.js +0 -25
- package/dist/processors/testprocessor/index.d.ts +0 -10
- package/dist/processors/testprocessor/index.d.ts.map +0 -1
- package/dist/processors/testprocessor/index.js +0 -32
- package/dist/processors/testprocessor/migrations.d.ts +0 -4
- package/dist/processors/testprocessor/migrations.d.ts.map +0 -1
- package/dist/processors/testprocessor/migrations.js +0 -15
- package/dist/processors/testprocessor/schema.d.ts +0 -8
- package/dist/processors/testprocessor/schema.d.ts.map +0 -1
- package/dist/processors/testprocessor/schema.js +0 -1
- package/dist/subgraphs/builder-team/index.d.ts +0 -11
- package/dist/subgraphs/builder-team/index.d.ts.map +0 -1
- package/dist/subgraphs/builder-team/index.js +0 -11
- package/dist/subgraphs/builder-team/resolvers.d.ts +0 -3
- package/dist/subgraphs/builder-team/resolvers.d.ts.map +0 -1
- package/dist/subgraphs/builder-team/resolvers.js +0 -289
- package/dist/subgraphs/builder-team/schema.d.ts +0 -3
- package/dist/subgraphs/builder-team/schema.d.ts.map +0 -1
- package/dist/subgraphs/builder-team/schema.js +0 -235
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { BaseDocumentClass } from "document-model";
|
|
2
|
-
import { BuilderTeamPHState } from "../ph-factories.js";
|
|
3
|
-
import {} from "../types.js";
|
|
4
|
-
import { setLogo, setTeamName, setSlug, setDescription, setSocials, } from "./creators.js";
|
|
5
|
-
import {} from "../actions.js";
|
|
6
|
-
export default class BuilderTeam_Profile extends BaseDocumentClass {
|
|
7
|
-
setLogo(input) {
|
|
8
|
-
return this.dispatch(setLogo(input));
|
|
9
|
-
}
|
|
10
|
-
setTeamName(input) {
|
|
11
|
-
return this.dispatch(setTeamName(input));
|
|
12
|
-
}
|
|
13
|
-
setSlug(input) {
|
|
14
|
-
return this.dispatch(setSlug(input));
|
|
15
|
-
}
|
|
16
|
-
setDescription(input) {
|
|
17
|
-
return this.dispatch(setDescription(input));
|
|
18
|
-
}
|
|
19
|
-
setSocials(input) {
|
|
20
|
-
return this.dispatch(setSocials(input));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BaseDocumentClass } from "document-model";
|
|
2
|
-
import { BuilderTeamPHState } from "../ph-factories.js";
|
|
3
|
-
import { type AddSpaceInput, type UpdateSpaceInfoInput, type RemoveSpaceInput, type ReorderSpacesInput } from "../types.js";
|
|
4
|
-
export default class BuilderTeam_Spaces extends BaseDocumentClass<BuilderTeamPHState> {
|
|
5
|
-
addSpace(input: AddSpaceInput): any;
|
|
6
|
-
updateSpaceInfo(input: UpdateSpaceInfoInput): any;
|
|
7
|
-
removeSpace(input: RemoveSpaceInput): any;
|
|
8
|
-
reorderSpaces(input: ReorderSpacesInput): any;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=object.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../../document-models/builder-team/gen/spaces/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AASrB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;IAC5E,QAAQ,CAAC,KAAK,EAAE,aAAa;IAI7B,eAAe,CAAC,KAAK,EAAE,oBAAoB;IAI3C,WAAW,CAAC,KAAK,EAAE,gBAAgB;IAInC,aAAa,CAAC,KAAK,EAAE,kBAAkB;CAG/C"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseDocumentClass } from "document-model";
|
|
2
|
-
import { BuilderTeamPHState } from "../ph-factories.js";
|
|
3
|
-
import {} from "../types.js";
|
|
4
|
-
import { addSpace, updateSpaceInfo, removeSpace, reorderSpaces, } from "./creators.js";
|
|
5
|
-
import {} from "../actions.js";
|
|
6
|
-
export default class BuilderTeam_Spaces extends BaseDocumentClass {
|
|
7
|
-
addSpace(input) {
|
|
8
|
-
return this.dispatch(addSpace(input));
|
|
9
|
-
}
|
|
10
|
-
updateSpaceInfo(input) {
|
|
11
|
-
return this.dispatch(updateSpaceInfo(input));
|
|
12
|
-
}
|
|
13
|
-
removeSpace(input) {
|
|
14
|
-
return this.dispatch(removeSpace(input));
|
|
15
|
-
}
|
|
16
|
-
reorderSpaces(input) {
|
|
17
|
-
return this.dispatch(reorderSpaces(input));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/builder-team-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YAOpB,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ProcessorRecord, type IProcessorHostModule } from "document-drive";
|
|
2
|
-
import { type PHDocumentHeader } from "document-model";
|
|
3
|
-
export declare const testprocessorProcessorFactory: (module: IProcessorHostModule) => (driveHeader: PHDocumentHeader) => Promise<ProcessorRecord[]>;
|
|
4
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../processors/testprocessor/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,6BAA6B,GACvC,QAAQ,oBAAoB,MACtB,aAAa,gBAAgB,KAAG,OAAO,CAAC,eAAe,EAAE,CA0B/D,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {} from "document-drive";
|
|
2
|
-
import {} from "document-drive";
|
|
3
|
-
import {} from "document-model";
|
|
4
|
-
import { TestprocessorProcessor } from "./index.js";
|
|
5
|
-
export const testprocessorProcessorFactory = (module) => async (driveHeader) => {
|
|
6
|
-
// Create a namespace for the processor and the provided drive id
|
|
7
|
-
const namespace = TestprocessorProcessor.getNamespace(driveHeader.id);
|
|
8
|
-
// Create a namespaced db for the processor
|
|
9
|
-
const store = await module.relationalDb.createNamespace(namespace);
|
|
10
|
-
// Create a filter for the processor
|
|
11
|
-
const filter = {
|
|
12
|
-
branch: ["main"],
|
|
13
|
-
documentId: ["*"],
|
|
14
|
-
documentType: ["*"],
|
|
15
|
-
scope: ["global"],
|
|
16
|
-
};
|
|
17
|
-
// Create the processor
|
|
18
|
-
const processor = new TestprocessorProcessor(namespace, filter, store);
|
|
19
|
-
return [
|
|
20
|
-
{
|
|
21
|
-
processor,
|
|
22
|
-
filter,
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RelationalDbProcessor } from "document-drive";
|
|
2
|
-
import type { InternalTransmitterUpdate } from "document-drive";
|
|
3
|
-
import type { DB } from "./schema.js";
|
|
4
|
-
export declare class TestprocessorProcessor extends RelationalDbProcessor<DB> {
|
|
5
|
-
static getNamespace(driveId: string): string;
|
|
6
|
-
initAndUpgrade(): Promise<void>;
|
|
7
|
-
onStrands(strands: InternalTransmitterUpdate[]): Promise<void>;
|
|
8
|
-
onDisconnect(): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../processors/testprocessor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,qBAAa,sBAAuB,SAAQ,qBAAqB,CAAC,EAAE,CAAC;WACnD,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAKtC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,SAAS,CACtB,OAAO,EAAE,yBAAyB,EAAE,GACnC,OAAO,CAAC,IAAI,CAAC;IAuBV,YAAY;CACnB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { RelationalDbProcessor } from "document-drive";
|
|
2
|
-
import { up } from "./migrations.js";
|
|
3
|
-
export class TestprocessorProcessor extends RelationalDbProcessor {
|
|
4
|
-
static getNamespace(driveId) {
|
|
5
|
-
// Default namespace: `${this.name}_${driveId.replaceAll("-", "_")}`
|
|
6
|
-
return super.getNamespace(driveId);
|
|
7
|
-
}
|
|
8
|
-
async initAndUpgrade() {
|
|
9
|
-
await up(this.relationalDb);
|
|
10
|
-
}
|
|
11
|
-
async onStrands(strands) {
|
|
12
|
-
if (strands.length === 0) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
for (const strand of strands) {
|
|
16
|
-
if (strand.operations.length === 0) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
for (const operation of strand.operations) {
|
|
20
|
-
await this.relationalDb
|
|
21
|
-
.insertInto("todo")
|
|
22
|
-
.values({
|
|
23
|
-
task: `${strand.documentId}-${operation.index}: ${operation.action.type}`,
|
|
24
|
-
status: true,
|
|
25
|
-
})
|
|
26
|
-
.onConflict((oc) => oc.column("task").doNothing())
|
|
27
|
-
.execute();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
async onDisconnect() { }
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../processors/testprocessor/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,wBAAsB,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAS9D;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {} from "document-drive";
|
|
2
|
-
export async function up(db) {
|
|
3
|
-
// Create table
|
|
4
|
-
await db.schema
|
|
5
|
-
.createTable("todo")
|
|
6
|
-
.addColumn("task", "varchar(255)")
|
|
7
|
-
.addColumn("status", "boolean")
|
|
8
|
-
.addPrimaryKeyConstraint("todo_pkey", ["task"])
|
|
9
|
-
.ifNotExists()
|
|
10
|
-
.execute();
|
|
11
|
-
}
|
|
12
|
-
export async function down(db) {
|
|
13
|
-
// drop table
|
|
14
|
-
await db.schema.dropTable("todo").execute();
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../processors/testprocessor/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,EAAE;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
|
-
import type { DocumentNode } from "graphql";
|
|
3
|
-
export declare class BuilderTeamSubgraph extends BaseSubgraph {
|
|
4
|
-
name: string;
|
|
5
|
-
typeDefs: DocumentNode;
|
|
6
|
-
resolvers: Record<string, unknown>;
|
|
7
|
-
additionalContextFields: {};
|
|
8
|
-
onSetup(): Promise<void>;
|
|
9
|
-
onDisconnect(): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-team/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,IAAI,SAAkB;IACtB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseSubgraph } from "@powerhousedao/reactor-api";
|
|
2
|
-
import { schema } from "./schema.js";
|
|
3
|
-
import { getResolvers } from "./resolvers.js";
|
|
4
|
-
export class BuilderTeamSubgraph extends BaseSubgraph {
|
|
5
|
-
name = "builder-team";
|
|
6
|
-
typeDefs = schema;
|
|
7
|
-
resolvers = getResolvers(this);
|
|
8
|
-
additionalContextFields = {};
|
|
9
|
-
async onSetup() { }
|
|
10
|
-
async onDisconnect() { }
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-team/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,4BAA4B,CAAC;AA8B5D,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAsdxE,CAAC"}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import {} from "@powerhousedao/reactor-api";
|
|
2
|
-
import { addFile } from "document-drive";
|
|
3
|
-
import { actions, } from "../../document-models/builder-team/index.js";
|
|
4
|
-
import { setName } from "document-model";
|
|
5
|
-
export const getResolvers = (subgraph) => {
|
|
6
|
-
const reactor = subgraph.reactor;
|
|
7
|
-
return {
|
|
8
|
-
Query: {
|
|
9
|
-
BuilderTeam: async () => {
|
|
10
|
-
return {
|
|
11
|
-
getDocument: async (args) => {
|
|
12
|
-
const { docId, driveId } = args;
|
|
13
|
-
if (!docId) {
|
|
14
|
-
throw new Error("Document id is required");
|
|
15
|
-
}
|
|
16
|
-
if (driveId) {
|
|
17
|
-
const docIds = await reactor.getDocuments(driveId);
|
|
18
|
-
if (!docIds.includes(docId)) {
|
|
19
|
-
throw new Error(`Document with id ${docId} is not part of ${driveId}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const doc = await reactor.getDocument(docId);
|
|
23
|
-
// Sort spaces and packages by sortOrder
|
|
24
|
-
const sortedState = {
|
|
25
|
-
...doc.state.global,
|
|
26
|
-
spaces: [...doc.state.global.spaces]
|
|
27
|
-
.sort((a, b) => a.sortOrder -
|
|
28
|
-
b.sortOrder)
|
|
29
|
-
.map((space) => ({
|
|
30
|
-
...space,
|
|
31
|
-
packages: [...space.packages].sort((a, b) => a.sortOrder -
|
|
32
|
-
b.sortOrder),
|
|
33
|
-
})),
|
|
34
|
-
};
|
|
35
|
-
return {
|
|
36
|
-
driveId: driveId,
|
|
37
|
-
...doc,
|
|
38
|
-
...doc.header,
|
|
39
|
-
created: doc.header.createdAtUtcIso,
|
|
40
|
-
lastModified: doc.header.lastModifiedAtUtcIso,
|
|
41
|
-
state: sortedState,
|
|
42
|
-
stateJSON: sortedState,
|
|
43
|
-
revision: doc.header?.revision?.global ?? 0,
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
getDocuments: async (args) => {
|
|
47
|
-
const { driveId } = args;
|
|
48
|
-
const docsIds = await reactor.getDocuments(driveId);
|
|
49
|
-
const docs = await Promise.all(docsIds.map(async (docId) => {
|
|
50
|
-
const doc = await reactor.getDocument(docId);
|
|
51
|
-
// Sort spaces and packages by sortOrder
|
|
52
|
-
const sortedState = {
|
|
53
|
-
...doc.state.global,
|
|
54
|
-
spaces: [...doc.state.global.spaces]
|
|
55
|
-
.sort((a, b) => a.sortOrder -
|
|
56
|
-
b.sortOrder)
|
|
57
|
-
.map((space) => ({
|
|
58
|
-
...space,
|
|
59
|
-
packages: [...space.packages].sort((a, b) => a.sortOrder -
|
|
60
|
-
b.sortOrder),
|
|
61
|
-
})),
|
|
62
|
-
};
|
|
63
|
-
return {
|
|
64
|
-
driveId: driveId,
|
|
65
|
-
...doc,
|
|
66
|
-
...doc.header,
|
|
67
|
-
created: doc.header.createdAtUtcIso,
|
|
68
|
-
lastModified: doc.header.lastModifiedAtUtcIso,
|
|
69
|
-
state: sortedState,
|
|
70
|
-
stateJSON: sortedState,
|
|
71
|
-
revision: doc.header?.revision?.global ?? 0,
|
|
72
|
-
};
|
|
73
|
-
}));
|
|
74
|
-
return docs.filter((doc) => doc.header.documentType === "powerhouse/builder-team");
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
Mutation: {
|
|
80
|
-
BuilderTeam_createDocument: async (_, args) => {
|
|
81
|
-
const { driveId, name } = args;
|
|
82
|
-
const document = await reactor.addDocument("powerhouse/builder-team");
|
|
83
|
-
if (driveId) {
|
|
84
|
-
await reactor.addAction(driveId, addFile({
|
|
85
|
-
name,
|
|
86
|
-
id: document.header.id,
|
|
87
|
-
documentType: "powerhouse/builder-team",
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
if (name) {
|
|
91
|
-
await reactor.addAction(document.header.id, setName(name));
|
|
92
|
-
}
|
|
93
|
-
return document.header.id;
|
|
94
|
-
},
|
|
95
|
-
BuilderTeam_setLogo: async (_, args) => {
|
|
96
|
-
const { docId, input } = args;
|
|
97
|
-
const doc = await reactor.getDocument(docId);
|
|
98
|
-
if (!doc) {
|
|
99
|
-
throw new Error("Document not found");
|
|
100
|
-
}
|
|
101
|
-
const result = await reactor.addAction(docId, actions.setLogo(input));
|
|
102
|
-
if (result.status !== "SUCCESS") {
|
|
103
|
-
throw new Error(result.error?.message ?? "Failed to setLogo");
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
},
|
|
107
|
-
BuilderTeam_setTeamName: async (_, args) => {
|
|
108
|
-
const { docId, input } = args;
|
|
109
|
-
const doc = await reactor.getDocument(docId);
|
|
110
|
-
if (!doc) {
|
|
111
|
-
throw new Error("Document not found");
|
|
112
|
-
}
|
|
113
|
-
const result = await reactor.addAction(docId, actions.setTeamName(input));
|
|
114
|
-
if (result.status !== "SUCCESS") {
|
|
115
|
-
throw new Error(result.error?.message ?? "Failed to setTeamName");
|
|
116
|
-
}
|
|
117
|
-
return true;
|
|
118
|
-
},
|
|
119
|
-
BuilderTeam_setSlug: async (_, args) => {
|
|
120
|
-
const { docId, input } = args;
|
|
121
|
-
const doc = await reactor.getDocument(docId);
|
|
122
|
-
if (!doc) {
|
|
123
|
-
throw new Error("Document not found");
|
|
124
|
-
}
|
|
125
|
-
const result = await reactor.addAction(docId, actions.setSlug(input));
|
|
126
|
-
if (result.status !== "SUCCESS") {
|
|
127
|
-
throw new Error(result.error?.message ?? "Failed to setSlug");
|
|
128
|
-
}
|
|
129
|
-
return true;
|
|
130
|
-
},
|
|
131
|
-
BuilderTeam_setDescription: async (_, args) => {
|
|
132
|
-
const { docId, input } = args;
|
|
133
|
-
const doc = await reactor.getDocument(docId);
|
|
134
|
-
if (!doc) {
|
|
135
|
-
throw new Error("Document not found");
|
|
136
|
-
}
|
|
137
|
-
const result = await reactor.addAction(docId, actions.setDescription(input));
|
|
138
|
-
if (result.status !== "SUCCESS") {
|
|
139
|
-
throw new Error(result.error?.message ?? "Failed to setDescription");
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
},
|
|
143
|
-
BuilderTeam_setSocials: async (_, args) => {
|
|
144
|
-
const { docId, input } = args;
|
|
145
|
-
const doc = await reactor.getDocument(docId);
|
|
146
|
-
if (!doc) {
|
|
147
|
-
throw new Error("Document not found");
|
|
148
|
-
}
|
|
149
|
-
const result = await reactor.addAction(docId, actions.setSocials(input));
|
|
150
|
-
if (result.status !== "SUCCESS") {
|
|
151
|
-
throw new Error(result.error?.message ?? "Failed to setSocials");
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
154
|
-
},
|
|
155
|
-
BuilderTeam_addMember: async (_, args) => {
|
|
156
|
-
const { docId, input } = args;
|
|
157
|
-
const doc = await reactor.getDocument(docId);
|
|
158
|
-
if (!doc) {
|
|
159
|
-
throw new Error("Document not found");
|
|
160
|
-
}
|
|
161
|
-
const result = await reactor.addAction(docId, actions.addMember(input));
|
|
162
|
-
if (result.status !== "SUCCESS") {
|
|
163
|
-
throw new Error(result.error?.message ?? "Failed to addMember");
|
|
164
|
-
}
|
|
165
|
-
return true;
|
|
166
|
-
},
|
|
167
|
-
BuilderTeam_updateMemberInfo: async (_, args) => {
|
|
168
|
-
const { docId, input } = args;
|
|
169
|
-
const doc = await reactor.getDocument(docId);
|
|
170
|
-
if (!doc) {
|
|
171
|
-
throw new Error("Document not found");
|
|
172
|
-
}
|
|
173
|
-
const result = await reactor.addAction(docId, actions.updateMemberInfo(input));
|
|
174
|
-
if (result.status !== "SUCCESS") {
|
|
175
|
-
throw new Error(result.error?.message ?? "Failed to updateMemberInfo");
|
|
176
|
-
}
|
|
177
|
-
return true;
|
|
178
|
-
},
|
|
179
|
-
BuilderTeam_removeMember: async (_, args) => {
|
|
180
|
-
const { docId, input } = args;
|
|
181
|
-
const doc = await reactor.getDocument(docId);
|
|
182
|
-
if (!doc) {
|
|
183
|
-
throw new Error("Document not found");
|
|
184
|
-
}
|
|
185
|
-
const result = await reactor.addAction(docId, actions.removeMember(input));
|
|
186
|
-
if (result.status !== "SUCCESS") {
|
|
187
|
-
throw new Error(result.error?.message ?? "Failed to removeMember");
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
},
|
|
191
|
-
BuilderTeam_addSpace: async (_, args) => {
|
|
192
|
-
const { docId, input } = args;
|
|
193
|
-
const doc = await reactor.getDocument(docId);
|
|
194
|
-
if (!doc) {
|
|
195
|
-
throw new Error("Document not found");
|
|
196
|
-
}
|
|
197
|
-
const result = await reactor.addAction(docId, actions.addSpace(input));
|
|
198
|
-
if (result.status !== "SUCCESS") {
|
|
199
|
-
throw new Error(result.error?.message ?? "Failed to addSpace");
|
|
200
|
-
}
|
|
201
|
-
return true;
|
|
202
|
-
},
|
|
203
|
-
BuilderTeam_updateSpaceInfo: async (_, args) => {
|
|
204
|
-
const { docId, input } = args;
|
|
205
|
-
const doc = await reactor.getDocument(docId);
|
|
206
|
-
if (!doc) {
|
|
207
|
-
throw new Error("Document not found");
|
|
208
|
-
}
|
|
209
|
-
const result = await reactor.addAction(docId, actions.updateSpaceInfo(input));
|
|
210
|
-
if (result.status !== "SUCCESS") {
|
|
211
|
-
throw new Error(result.error?.message ?? "Failed to updateSpaceInfo");
|
|
212
|
-
}
|
|
213
|
-
return true;
|
|
214
|
-
},
|
|
215
|
-
BuilderTeam_removeSpace: async (_, args) => {
|
|
216
|
-
const { docId, input } = args;
|
|
217
|
-
const doc = await reactor.getDocument(docId);
|
|
218
|
-
if (!doc) {
|
|
219
|
-
throw new Error("Document not found");
|
|
220
|
-
}
|
|
221
|
-
const result = await reactor.addAction(docId, actions.removeSpace(input));
|
|
222
|
-
if (result.status !== "SUCCESS") {
|
|
223
|
-
throw new Error(result.error?.message ?? "Failed to removeSpace");
|
|
224
|
-
}
|
|
225
|
-
return true;
|
|
226
|
-
},
|
|
227
|
-
BuilderTeam_reorderSpaces: async (_, args) => {
|
|
228
|
-
const { docId, input } = args;
|
|
229
|
-
const doc = await reactor.getDocument(docId);
|
|
230
|
-
if (!doc) {
|
|
231
|
-
throw new Error("Document not found");
|
|
232
|
-
}
|
|
233
|
-
const result = await reactor.addAction(docId, actions.reorderSpaces(input));
|
|
234
|
-
if (result.status !== "SUCCESS") {
|
|
235
|
-
throw new Error(result.error?.message ?? "Failed to reorderSpaces");
|
|
236
|
-
}
|
|
237
|
-
return true;
|
|
238
|
-
},
|
|
239
|
-
BuilderTeam_addPackage: async (_, args) => {
|
|
240
|
-
const { docId, input } = args;
|
|
241
|
-
const doc = await reactor.getDocument(docId);
|
|
242
|
-
if (!doc) {
|
|
243
|
-
throw new Error("Document not found");
|
|
244
|
-
}
|
|
245
|
-
const result = await reactor.addAction(docId, actions.addPackage(input));
|
|
246
|
-
if (result.status !== "SUCCESS") {
|
|
247
|
-
throw new Error(result.error?.message ?? "Failed to addPackage");
|
|
248
|
-
}
|
|
249
|
-
return true;
|
|
250
|
-
},
|
|
251
|
-
BuilderTeam_updatePackageInfo: async (_, args) => {
|
|
252
|
-
const { docId, input } = args;
|
|
253
|
-
const doc = await reactor.getDocument(docId);
|
|
254
|
-
if (!doc) {
|
|
255
|
-
throw new Error("Document not found");
|
|
256
|
-
}
|
|
257
|
-
const result = await reactor.addAction(docId, actions.updatePackageInfo(input));
|
|
258
|
-
if (result.status !== "SUCCESS") {
|
|
259
|
-
throw new Error(result.error?.message ?? "Failed to updatePackageInfo");
|
|
260
|
-
}
|
|
261
|
-
return true;
|
|
262
|
-
},
|
|
263
|
-
BuilderTeam_removePackage: async (_, args) => {
|
|
264
|
-
const { docId, input } = args;
|
|
265
|
-
const doc = await reactor.getDocument(docId);
|
|
266
|
-
if (!doc) {
|
|
267
|
-
throw new Error("Document not found");
|
|
268
|
-
}
|
|
269
|
-
const result = await reactor.addAction(docId, actions.removePackage(input));
|
|
270
|
-
if (result.status !== "SUCCESS") {
|
|
271
|
-
throw new Error(result.error?.message ?? "Failed to removePackage");
|
|
272
|
-
}
|
|
273
|
-
return true;
|
|
274
|
-
},
|
|
275
|
-
BuilderTeam_reorderPackages: async (_, args) => {
|
|
276
|
-
const { docId, input } = args;
|
|
277
|
-
const doc = await reactor.getDocument(docId);
|
|
278
|
-
if (!doc) {
|
|
279
|
-
throw new Error("Document not found");
|
|
280
|
-
}
|
|
281
|
-
const result = await reactor.addAction(docId, actions.reorderPackages(input));
|
|
282
|
-
if (result.status !== "SUCCESS") {
|
|
283
|
-
throw new Error(result.error?.message ?? "Failed to reorderPackages");
|
|
284
|
-
}
|
|
285
|
-
return true;
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
};
|
|
289
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-team/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAyOpB,CAAC"}
|