@powerhousedao/vetra-builder-package 5.0.2 → 5.2.0-staging.10

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.
Files changed (170) hide show
  1. package/dist/document-models/builder-team/actions.d.ts +28 -0
  2. package/dist/document-models/builder-team/actions.d.ts.map +1 -0
  3. package/dist/document-models/builder-team/actions.js +10 -0
  4. package/dist/document-models/builder-team/builder-team.json +234 -0
  5. package/dist/document-models/builder-team/gen/actions.d.ts +8 -8
  6. package/dist/document-models/builder-team/gen/actions.d.ts.map +1 -1
  7. package/dist/document-models/builder-team/gen/actions.js +4 -4
  8. package/dist/document-models/builder-team/gen/creators.d.ts +8 -4
  9. package/dist/document-models/builder-team/gen/creators.d.ts.map +1 -1
  10. package/dist/document-models/builder-team/gen/creators.js +8 -4
  11. package/dist/document-models/builder-team/gen/document-model.d.ts.map +1 -1
  12. package/dist/document-models/builder-team/gen/document-model.js +220 -220
  13. package/dist/document-models/builder-team/gen/document-schema.d.ts +50 -0
  14. package/dist/document-models/builder-team/gen/document-schema.d.ts.map +1 -0
  15. package/dist/document-models/builder-team/gen/document-schema.js +33 -0
  16. package/dist/document-models/builder-team/gen/document-type.d.ts +2 -0
  17. package/dist/document-models/builder-team/gen/document-type.d.ts.map +1 -0
  18. package/dist/document-models/builder-team/gen/document-type.js +1 -0
  19. package/dist/document-models/builder-team/gen/index.d.ts +14 -5
  20. package/dist/document-models/builder-team/gen/index.d.ts.map +1 -1
  21. package/dist/document-models/builder-team/gen/index.js +14 -5
  22. package/dist/document-models/builder-team/gen/member/actions.d.ts +5 -5
  23. package/dist/document-models/builder-team/gen/member/actions.d.ts.map +1 -1
  24. package/dist/document-models/builder-team/gen/member/actions.js +1 -1
  25. package/dist/document-models/builder-team/gen/member/creators.d.ts +2 -2
  26. package/dist/document-models/builder-team/gen/member/creators.d.ts.map +1 -1
  27. package/dist/document-models/builder-team/gen/member/creators.js +5 -6
  28. package/dist/document-models/builder-team/gen/member/error.d.ts.map +1 -1
  29. package/dist/document-models/builder-team/gen/member/operations.d.ts +3 -3
  30. package/dist/document-models/builder-team/gen/member/operations.d.ts.map +1 -1
  31. package/dist/document-models/builder-team/gen/member/operations.js +1 -3
  32. package/dist/document-models/builder-team/gen/packages/actions.d.ts +6 -6
  33. package/dist/document-models/builder-team/gen/packages/actions.d.ts.map +1 -1
  34. package/dist/document-models/builder-team/gen/packages/actions.js +1 -1
  35. package/dist/document-models/builder-team/gen/packages/creators.d.ts +2 -2
  36. package/dist/document-models/builder-team/gen/packages/creators.d.ts.map +1 -1
  37. package/dist/document-models/builder-team/gen/packages/creators.js +6 -7
  38. package/dist/document-models/builder-team/gen/packages/error.d.ts.map +1 -1
  39. package/dist/document-models/builder-team/gen/packages/operations.d.ts +3 -3
  40. package/dist/document-models/builder-team/gen/packages/operations.d.ts.map +1 -1
  41. package/dist/document-models/builder-team/gen/packages/operations.js +1 -3
  42. package/dist/document-models/builder-team/gen/ph-factories.d.ts.map +1 -1
  43. package/dist/document-models/builder-team/gen/ph-factories.js +16 -14
  44. package/dist/document-models/builder-team/gen/profile/actions.d.ts +7 -7
  45. package/dist/document-models/builder-team/gen/profile/actions.d.ts.map +1 -1
  46. package/dist/document-models/builder-team/gen/profile/actions.js +1 -1
  47. package/dist/document-models/builder-team/gen/profile/creators.d.ts +2 -2
  48. package/dist/document-models/builder-team/gen/profile/creators.d.ts.map +1 -1
  49. package/dist/document-models/builder-team/gen/profile/creators.js +7 -8
  50. package/dist/document-models/builder-team/gen/profile/error.d.ts.map +1 -1
  51. package/dist/document-models/builder-team/gen/profile/operations.d.ts +3 -3
  52. package/dist/document-models/builder-team/gen/profile/operations.d.ts.map +1 -1
  53. package/dist/document-models/builder-team/gen/profile/operations.js +1 -3
  54. package/dist/document-models/builder-team/gen/reducer.d.ts +1 -3
  55. package/dist/document-models/builder-team/gen/reducer.d.ts.map +1 -1
  56. package/dist/document-models/builder-team/gen/reducer.js +86 -70
  57. package/dist/document-models/builder-team/gen/schema/index.d.ts +1 -1
  58. package/dist/document-models/builder-team/gen/schema/index.d.ts.map +1 -1
  59. package/dist/document-models/builder-team/gen/schema/index.js +1 -1
  60. package/dist/document-models/builder-team/gen/schema/types.d.ts +13 -1
  61. package/dist/document-models/builder-team/gen/schema/types.d.ts.map +1 -1
  62. package/dist/document-models/builder-team/gen/schema/zod.d.ts +3 -3
  63. package/dist/document-models/builder-team/gen/schema/zod.d.ts.map +1 -1
  64. package/dist/document-models/builder-team/gen/schema/zod.js +22 -22
  65. package/dist/document-models/builder-team/gen/spaces/actions.d.ts +6 -6
  66. package/dist/document-models/builder-team/gen/spaces/actions.d.ts.map +1 -1
  67. package/dist/document-models/builder-team/gen/spaces/actions.js +1 -1
  68. package/dist/document-models/builder-team/gen/spaces/creators.d.ts +2 -2
  69. package/dist/document-models/builder-team/gen/spaces/creators.d.ts.map +1 -1
  70. package/dist/document-models/builder-team/gen/spaces/creators.js +6 -7
  71. package/dist/document-models/builder-team/gen/spaces/error.d.ts.map +1 -1
  72. package/dist/document-models/builder-team/gen/spaces/operations.d.ts +3 -3
  73. package/dist/document-models/builder-team/gen/spaces/operations.d.ts.map +1 -1
  74. package/dist/document-models/builder-team/gen/spaces/operations.js +1 -3
  75. package/dist/document-models/builder-team/gen/types.d.ts +4 -5
  76. package/dist/document-models/builder-team/gen/types.d.ts.map +1 -1
  77. package/dist/document-models/builder-team/gen/types.js +1 -2
  78. package/dist/document-models/builder-team/gen/utils.d.ts +7 -4
  79. package/dist/document-models/builder-team/gen/utils.d.ts.map +1 -1
  80. package/dist/document-models/builder-team/gen/utils.js +41 -20
  81. package/dist/document-models/builder-team/hooks.d.ts +11 -0
  82. package/dist/document-models/builder-team/hooks.d.ts.map +1 -0
  83. package/dist/document-models/builder-team/hooks.js +26 -0
  84. package/dist/document-models/builder-team/index.d.ts +5 -45
  85. package/dist/document-models/builder-team/index.d.ts.map +1 -1
  86. package/dist/document-models/builder-team/index.js +5 -22
  87. package/dist/document-models/builder-team/module.d.ts +5 -0
  88. package/dist/document-models/builder-team/module.d.ts.map +1 -0
  89. package/dist/document-models/builder-team/module.js +10 -0
  90. package/dist/document-models/builder-team/src/index.d.ts +2 -0
  91. package/dist/document-models/builder-team/src/index.d.ts.map +1 -0
  92. package/dist/document-models/builder-team/src/index.js +1 -0
  93. package/dist/document-models/builder-team/src/reducers/member.d.ts +2 -2
  94. package/dist/document-models/builder-team/src/reducers/member.d.ts.map +1 -1
  95. package/dist/document-models/builder-team/src/reducers/member.js +8 -5
  96. package/dist/document-models/builder-team/src/reducers/packages.d.ts +2 -2
  97. package/dist/document-models/builder-team/src/reducers/packages.d.ts.map +1 -1
  98. package/dist/document-models/builder-team/src/reducers/packages.js +8 -8
  99. package/dist/document-models/builder-team/src/reducers/profile.d.ts +2 -2
  100. package/dist/document-models/builder-team/src/reducers/profile.d.ts.map +1 -1
  101. package/dist/document-models/builder-team/src/reducers/profile.js +6 -6
  102. package/dist/document-models/builder-team/src/reducers/spaces.d.ts +2 -2
  103. package/dist/document-models/builder-team/src/reducers/spaces.d.ts.map +1 -1
  104. package/dist/document-models/builder-team/src/reducers/spaces.js +7 -7
  105. package/dist/document-models/builder-team/src/tests/document-model.test.d.ts +4 -0
  106. package/dist/document-models/builder-team/src/tests/document-model.test.d.ts.map +1 -1
  107. package/dist/document-models/builder-team/src/tests/document-model.test.js +92 -6
  108. package/dist/document-models/builder-team/src/tests/member.test.d.ts +0 -4
  109. package/dist/document-models/builder-team/src/tests/member.test.d.ts.map +1 -1
  110. package/dist/document-models/builder-team/src/tests/member.test.js +15 -20
  111. package/dist/document-models/builder-team/src/tests/packages.test.d.ts +0 -4
  112. package/dist/document-models/builder-team/src/tests/packages.test.d.ts.map +1 -1
  113. package/dist/document-models/builder-team/src/tests/packages.test.js +25 -20
  114. package/dist/document-models/builder-team/src/tests/profile.test.d.ts +0 -4
  115. package/dist/document-models/builder-team/src/tests/profile.test.d.ts.map +1 -1
  116. package/dist/document-models/builder-team/src/tests/profile.test.js +23 -24
  117. package/dist/document-models/builder-team/src/tests/spaces.test.d.ts +0 -4
  118. package/dist/document-models/builder-team/src/tests/spaces.test.d.ts.map +1 -1
  119. package/dist/document-models/builder-team/src/tests/spaces.test.js +25 -20
  120. package/dist/document-models/builder-team/utils.d.ts +14 -0
  121. package/dist/document-models/builder-team/utils.d.ts.map +1 -0
  122. package/dist/document-models/builder-team/utils.js +7 -0
  123. package/dist/document-models/document-models.d.ts +3 -0
  124. package/dist/document-models/document-models.d.ts.map +1 -0
  125. package/dist/document-models/document-models.js +4 -0
  126. package/dist/document-models/index.d.ts +1 -2
  127. package/dist/document-models/index.d.ts.map +1 -1
  128. package/dist/document-models/index.js +1 -2
  129. package/dist/editors/builder-team-editor/components/EditName.d.ts +3 -0
  130. package/dist/editors/builder-team-editor/components/EditName.d.ts.map +1 -0
  131. package/dist/editors/builder-team-editor/components/EditName.js +31 -0
  132. package/dist/editors/builder-team-editor/components/PackagesTable.d.ts.map +1 -1
  133. package/dist/editors/builder-team-editor/components/PackagesTable.js +0 -1
  134. package/dist/editors/builder-team-editor/editor.d.ts +1 -1
  135. package/dist/editors/builder-team-editor/editor.d.ts.map +1 -1
  136. package/dist/editors/builder-team-editor/editor.js +2 -4
  137. package/dist/editors/builder-team-editor/hooks/usePackageHandlers.d.ts +1 -2
  138. package/dist/editors/builder-team-editor/hooks/usePackageHandlers.d.ts.map +1 -1
  139. package/dist/editors/builder-team-editor/hooks/usePackageHandlers.js +1 -1
  140. package/dist/editors/builder-team-editor/module.d.ts +4 -0
  141. package/dist/editors/builder-team-editor/module.d.ts.map +1 -0
  142. package/dist/editors/builder-team-editor/module.js +10 -0
  143. package/dist/editors/editors.d.ts +3 -0
  144. package/dist/editors/editors.d.ts.map +1 -0
  145. package/dist/editors/editors.js +4 -0
  146. package/dist/editors/index.d.ts +1 -2
  147. package/dist/editors/index.d.ts.map +1 -1
  148. package/dist/editors/index.js +1 -2
  149. package/dist/index.d.ts +2 -2
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +2 -4
  152. package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts +1 -1
  153. package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.d.ts.map +1 -1
  154. package/dist/processors/vetra-builder-relational-db-processor/builder-team-handlers.js +1 -1
  155. package/dist/processors/vetra-builder-relational-db-processor/migrations.d.ts.map +1 -1
  156. package/dist/processors/vetra-builder-relational-db-processor/migrations.js +0 -3
  157. package/dist/scripts/add-builder-team-model.d.ts +2 -0
  158. package/dist/scripts/add-builder-team-model.d.ts.map +1 -0
  159. package/dist/scripts/add-builder-team-model.js +122 -0
  160. package/dist/scripts/create-remote-drives.d.ts +17 -0
  161. package/dist/scripts/create-remote-drives.d.ts.map +1 -0
  162. package/dist/scripts/create-remote-drives.js +946 -0
  163. package/dist/scripts/introspect-schema.d.ts +8 -0
  164. package/dist/scripts/introspect-schema.d.ts.map +1 -0
  165. package/dist/scripts/introspect-schema.js +216 -0
  166. package/dist/scripts/upload-to-drive.js +0 -2
  167. package/dist/style.css +8 -1
  168. package/dist/subgraphs/vetra-builders/resolvers.d.ts.map +1 -1
  169. package/dist/subgraphs/vetra-builders/resolvers.js +0 -1
  170. package/package.json +71 -54
@@ -1,40 +1,45 @@
1
- /**
2
- * This is a scaffold file meant for customization:
3
- * - change it by adding new tests or modifying the existing ones
4
- */
5
- import { describe, it, expect, beforeEach } from "vitest";
6
1
  import { generateMock } from "@powerhousedao/codegen";
7
- import utils from "../../gen/utils.js";
8
- import { z, } from "../../gen/schema/index.js";
9
- import { reducer } from "../../gen/reducer.js";
10
- import * as creators from "../../gen/spaces/creators.js";
11
- describe("Spaces Operations", () => {
12
- let document;
13
- beforeEach(() => {
14
- document = utils.createDocument();
15
- });
2
+ import { describe, expect, it } from "vitest";
3
+ import { reducer, utils, isBuilderTeamDocument, addSpace, updateSpaceInfo, removeSpace, reorderSpaces, AddSpaceInputSchema, UpdateSpaceInfoInputSchema, RemoveSpaceInputSchema, ReorderSpacesInputSchema, } from "@powerhousedao/vetra-builder-package/document-models/builder-team";
4
+ describe("SpacesOperations", () => {
16
5
  it("should handle addSpace operation", () => {
17
- const input = generateMock(z.AddSpaceInputSchema());
18
- const updatedDocument = reducer(document, creators.addSpace(input));
6
+ const document = utils.createDocument();
7
+ const input = generateMock(AddSpaceInputSchema());
8
+ const updatedDocument = reducer(document, addSpace(input));
9
+ expect(isBuilderTeamDocument(updatedDocument)).toBe(true);
19
10
  expect(updatedDocument.operations.global).toHaveLength(1);
20
11
  expect(updatedDocument.operations.global[0].action.type).toBe("ADD_SPACE");
21
12
  expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
22
13
  expect(updatedDocument.operations.global[0].index).toEqual(0);
23
14
  });
24
15
  it("should handle updateSpaceInfo operation", () => {
25
- const input = generateMock(z.UpdateSpaceInfoInputSchema());
26
- const updatedDocument = reducer(document, creators.updateSpaceInfo(input));
16
+ const document = utils.createDocument();
17
+ const input = generateMock(UpdateSpaceInfoInputSchema());
18
+ const updatedDocument = reducer(document, updateSpaceInfo(input));
19
+ expect(isBuilderTeamDocument(updatedDocument)).toBe(true);
27
20
  expect(updatedDocument.operations.global).toHaveLength(1);
28
21
  expect(updatedDocument.operations.global[0].action.type).toBe("UPDATE_SPACE_INFO");
29
22
  expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
30
23
  expect(updatedDocument.operations.global[0].index).toEqual(0);
31
24
  });
32
25
  it("should handle removeSpace operation", () => {
33
- const input = generateMock(z.RemoveSpaceInputSchema());
34
- const updatedDocument = reducer(document, creators.removeSpace(input));
26
+ const document = utils.createDocument();
27
+ const input = generateMock(RemoveSpaceInputSchema());
28
+ const updatedDocument = reducer(document, removeSpace(input));
29
+ expect(isBuilderTeamDocument(updatedDocument)).toBe(true);
35
30
  expect(updatedDocument.operations.global).toHaveLength(1);
36
31
  expect(updatedDocument.operations.global[0].action.type).toBe("REMOVE_SPACE");
37
32
  expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
38
33
  expect(updatedDocument.operations.global[0].index).toEqual(0);
39
34
  });
35
+ it("should handle reorderSpaces operation", () => {
36
+ const document = utils.createDocument();
37
+ const input = generateMock(ReorderSpacesInputSchema());
38
+ const updatedDocument = reducer(document, reorderSpaces(input));
39
+ expect(isBuilderTeamDocument(updatedDocument)).toBe(true);
40
+ expect(updatedDocument.operations.global).toHaveLength(1);
41
+ expect(updatedDocument.operations.global[0].action.type).toBe("REORDER_SPACES");
42
+ expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
43
+ expect(updatedDocument.operations.global[0].index).toEqual(0);
44
+ });
40
45
  });
@@ -0,0 +1,14 @@
1
+ import type { BuilderTeamPHState } from "./gen/types.js";
2
+ /** Utils for the BuilderTeam document model */
3
+ export declare const utils: {
4
+ fileExtension: string;
5
+ createState: import("document-model").CreateState<BuilderTeamPHState>;
6
+ createDocument: import("document-model").CreateDocument<BuilderTeamPHState>;
7
+ loadFromInput: import("document-model").LoadFromInput<BuilderTeamPHState>;
8
+ saveToFileHandle: import("document-model").SaveToFileHandle;
9
+ isStateOfType: import("document-model").IsStateOfType<BuilderTeamPHState>;
10
+ assertIsStateOfType: import("document-model").AssertIsStateOfType<BuilderTeamPHState>;
11
+ isDocumentOfType: import("document-model").IsDocumentOfType<BuilderTeamPHState>;
12
+ assertIsDocumentOfType: import("document-model").AssertIsDocumentOfType<BuilderTeamPHState>;
13
+ };
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../document-models/builder-team/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,+CAA+C;AAC/C,eAAO,MAAM,KAAK;;;;;;;;;;CAGgC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { utils as genUtils } from "./gen/utils.js";
2
+ import * as customUtils from "./src/utils.js";
3
+ /** Utils for the BuilderTeam document model */
4
+ export const utils = {
5
+ ...genUtils,
6
+ ...customUtils,
7
+ };
@@ -0,0 +1,3 @@
1
+ import type { DocumentModelModule } from "document-model";
2
+ export declare const documentModels: DocumentModelModule<any>[];
3
+ //# sourceMappingURL=document-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-models.d.ts","sourceRoot":"","sources":["../../document-models/document-models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,eAAO,MAAM,cAAc,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAEpD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BuilderTeam } from "./builder-team/module.js";
2
+ export const documentModels = [
3
+ BuilderTeam,
4
+ ];
@@ -1,3 +1,2 @@
1
- export {};
2
- export { module as BuilderTeam } from "./builder-team/index.js";
1
+ export { BuilderTeam } from "./builder-team/module.js";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,2 +1 @@
1
- export {};
2
- export { module as BuilderTeam } from "./builder-team/index.js";
1
+ export { BuilderTeam } from "./builder-team/module.js";
@@ -0,0 +1,3 @@
1
+ /** Displays the name of the selected BuilderTeam document and allows editing it */
2
+ export declare function EditName(): import("react/jsx-runtime").JSX.Element | null;
3
+ //# sourceMappingURL=EditName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditName.d.ts","sourceRoot":"","sources":["../../../../editors/builder-team-editor/components/EditName.tsx"],"names":[],"mappings":"AAKA,mFAAmF;AACnF,wBAAgB,QAAQ,mDAuEvB"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { setName } from "document-model";
3
+ import { useState } from "react";
4
+ import { useSelectedBuilderTeamDocument } from "@powerhousedao/vetra-builder-package/document-models/builder-team";
5
+ /** Displays the name of the selected BuilderTeam document and allows editing it */
6
+ export function EditName() {
7
+ const [builderTeamDocument, dispatch] = useSelectedBuilderTeamDocument();
8
+ const [isEditing, setIsEditing] = useState(false);
9
+ if (!builderTeamDocument)
10
+ return null;
11
+ const builderTeamDocumentName = builderTeamDocument.header.name;
12
+ const onClickEditBuilderTeamName = () => {
13
+ setIsEditing(true);
14
+ };
15
+ const onClickCancelEditBuilderTeamName = () => {
16
+ setIsEditing(false);
17
+ };
18
+ const onSubmitSetName = (event) => {
19
+ event.preventDefault();
20
+ const form = event.currentTarget;
21
+ const nameInput = form.elements.namedItem("name");
22
+ const name = nameInput.value;
23
+ if (!name)
24
+ return;
25
+ dispatch(setName(name));
26
+ setIsEditing(false);
27
+ };
28
+ if (isEditing)
29
+ return (_jsxs("form", { className: "flex gap-2 items-center justify-between", onSubmit: onSubmitSetName, children: [_jsx("input", { className: "text-lg font-semibold text-gray-900 p-1", type: "text", name: "name", defaultValue: builderTeamDocumentName, autoFocus: true }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "submit", className: "text-sm text-gray-600", children: "Save" }), _jsx("button", { className: "text-sm text-red-800", onClick: onClickCancelEditBuilderTeamName, children: "Cancel" })] })] }));
30
+ return (_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h2", { className: "text-lg font-semibold text-gray-900", children: builderTeamDocumentName }), _jsx("button", { className: "text-sm text-gray-600", onClick: onClickEditBuilderTeamName, children: "Edit Name" })] }));
31
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PackagesTable.d.ts","sourceRoot":"","sources":["../../../../editors/builder-team-editor/components/PackagesTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAIvF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,2CAgLpB"}
1
+ {"version":3,"file":"PackagesTable.d.ts","sourceRoot":"","sources":["../../../../editors/builder-team-editor/components/PackagesTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAIvF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,2CA+KpB"}
@@ -11,7 +11,6 @@ export function PackagesTable({ packages, onEdit, onDelete, onReorder, }) {
11
11
  width: "250px",
12
12
  renderHeader: () => _jsx("div", { className: "px-4", children: "Package Name" }),
13
13
  renderCell: (value, context) => {
14
- const pkg = context.row;
15
14
  return (_jsxs("div", { className: "flex items-center gap-2 px-4", children: [_jsx(Icon, { name: "PackageManager", size: "16px", color: "rgb(75 85 99)" }), _jsx("span", { className: "font-medium text-gray-900", children: value || "Untitled Package" })] }));
16
15
  },
17
16
  },
@@ -1,4 +1,4 @@
1
1
  import type { EditorProps } from "document-model";
2
2
  export type IProps = EditorProps;
3
- export declare function Editor(props: IProps): import("react/jsx-runtime").JSX.Element;
3
+ export default function Editor(): import("react/jsx-runtime").JSX.Element;
4
4
  //# sourceMappingURL=editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/builder-team-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAmBlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,2CA8JnC"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/builder-team-editor/editor.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAkBlD,MAAM,MAAM,MAAM,GAAG,WAAW,CAAC;AAEjC,MAAM,CAAC,OAAO,UAAU,MAAM,4CA6J7B"}
@@ -8,12 +8,11 @@ import { SpacesSection } from "./components/SpacesSection.js";
8
8
  import { PackageForm } from "./components/PackageForm.js";
9
9
  import { MembersSection } from "./components/MembersSection.js";
10
10
  import { QuickStats } from "./components/QuickStats.js";
11
- import { useProfileHandlers } from "./hooks/useProfileHandlers.js";
12
11
  import { useSpaceHandlers } from "./hooks/useSpaceHandlers.js";
13
12
  import { usePackageHandlers } from "./hooks/usePackageHandlers.js";
14
13
  import { useMemberHandlers } from "./hooks/useMemberHandlers.js";
15
14
  import { generateNanoId } from "../../utils/nano-id.js";
16
- export function Editor(props) {
15
+ export default function Editor() {
17
16
  const [document, dispatch] = useSelectedDocument();
18
17
  const typedDocument = document;
19
18
  // Local UI state
@@ -23,9 +22,8 @@ export function Editor(props) {
23
22
  const { state: { global }, } = typedDocument;
24
23
  const { profile, spaces, members } = global;
25
24
  // Custom hooks for handlers
26
- const profileHandlers = useProfileHandlers(profile, dispatch);
27
25
  const spaceHandlers = useSpaceHandlers(spaces, dispatch);
28
- const packageHandlers = usePackageHandlers(spaces, dispatch);
26
+ const packageHandlers = usePackageHandlers(dispatch);
29
27
  const memberHandlers = useMemberHandlers(dispatch);
30
28
  // Wrapper handlers for components
31
29
  const handleAddPackageToSpace = (spaceId) => {
@@ -1,7 +1,6 @@
1
- import { type BuilderTeamDocument } from "../../../document-models/builder-team/index.js";
2
1
  import { type DocumentDispatch } from "@powerhousedao/reactor-browser";
3
2
  import { type Action } from "document-model";
4
- export declare function usePackageHandlers(spaces: BuilderTeamDocument["state"]["global"]["spaces"], dispatch: DocumentDispatch<Action>): {
3
+ export declare function usePackageHandlers(dispatch: DocumentDispatch<Action>): {
5
4
  editingPackageId: string | null;
6
5
  handleAddPackage: (spaceId: string, name: string, description: string) => boolean;
7
6
  handleDeletePackage: (packageId: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"usePackageHandlers.d.ts","sourceRoot":"","sources":["../../../../editors/builder-team-editor/hooks/usePackageHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,gDAAgD,CAAC;AAExD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACxD,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC;;gCAKtB,MAAM,QAAQ,MAAM,eAAe,MAAM;qCAmBvC,MAAM;2CAMsC,MAAM;uCAKlD,MAAM,QAAQ,MAAM,eAAe,MAAM;;EA6BxD"}
1
+ {"version":3,"file":"usePackageHandlers.d.ts","sourceRoot":"","sources":["../../../../editors/builder-team-editor/hooks/usePackageHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC;;gCAKtB,MAAM,QAAQ,MAAM,eAAe,MAAM;qCAmBvC,MAAM;2CAMsC,MAAM;uCAKlD,MAAM,QAAQ,MAAM,eAAe,MAAM;;EA6BxD"}
@@ -3,7 +3,7 @@ import { actions, } from "../../../document-models/builder-team/index.js";
3
3
  import { generateNanoId } from "../../../utils/nano-id.js";
4
4
  import {} from "@powerhousedao/reactor-browser";
5
5
  import {} from "document-model";
6
- export function usePackageHandlers(spaces, dispatch) {
6
+ export function usePackageHandlers(dispatch) {
7
7
  const [editingPackageId, setEditingPackageId] = useState(null);
8
8
  const handleAddPackage = useCallback((spaceId, name, description) => {
9
9
  if (name.trim() && spaceId) {
@@ -0,0 +1,4 @@
1
+ import type { EditorModule } from "document-model";
2
+ /** Document editor module for the Todo List document type */
3
+ export declare const BuilderTeamEditor: EditorModule;
4
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/builder-team-editor/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,EAAE,YAO/B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { lazy } from "react";
2
+ /** Document editor module for the Todo List document type */
3
+ export const BuilderTeamEditor = {
4
+ Component: lazy(() => import("./editor.js")),
5
+ documentTypes: ["powerhouse/builder-team"],
6
+ config: {
7
+ id: "builder-team-editor",
8
+ name: "Builder Team Editor",
9
+ },
10
+ };
@@ -0,0 +1,3 @@
1
+ import type { EditorModule } from "document-model";
2
+ export declare const editors: EditorModule[];
3
+ //# sourceMappingURL=editors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../editors/editors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,OAAO,EAAE,YAAY,EAEjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BuilderTeamEditor } from "./builder-team-editor/module.js";
2
+ export const editors = [
3
+ BuilderTeamEditor,
4
+ ];
@@ -1,3 +1,2 @@
1
- export {};
2
- export { module as BuilderTeamEditor } from "./builder-team-editor/index.js";
1
+ export { BuilderTeamEditor } from "./builder-team-editor/module.js";
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AACV,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -1,2 +1 @@
1
- export {};
2
- export { module as BuilderTeamEditor } from "./builder-team-editor/index.js";
1
+ export { BuilderTeamEditor } from "./builder-team-editor/module.js";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Manifest } from "document-model";
2
+ export { documentModels } from "./document-models/document-models.js";
3
+ export { editors } from "./editors/editors.js";
2
4
  export declare const manifest: Manifest;
3
- export declare const documentModels: import("document-model").DocumentModelModule<import("./document-models/builder-team/index.js").BuilderTeamPHState>[];
4
- export declare const editors: import("document-model").EditorModule[];
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,QAAQ,EAAE,QAAuB,CAAC;AAC/C,eAAO,MAAM,cAAc,sHAAuC,CAAC;AACnE,eAAO,MAAM,OAAO,yCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,eAAO,MAAM,QAAQ,EAAE,QAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import manifestJson from "./powerhouse.manifest.json" with { type: "json" };
2
- import * as documentModelsExports from './document-models/index.js';
3
- import * as editorsExports from './editors/index.js';
2
+ export { documentModels } from "./document-models/document-models.js";
3
+ export { editors } from "./editors/editors.js";
4
4
  export const manifest = manifestJson;
5
- export const documentModels = Object.values(documentModelsExports);
6
- export const editors = Object.values(editorsExports);
@@ -5,7 +5,7 @@ export declare class BuilderTeamHandlers {
5
5
  private db;
6
6
  private dbHelpers;
7
7
  constructor(db: IRelationalDb<DB>);
8
- handleBuilderTeamOperation(documentId: string, action: BuilderTeamAction, state: BuilderTeamState, driveId?: string): Promise<void>;
8
+ handleBuilderTeamOperation(documentId: string, action: BuilderTeamAction, state: BuilderTeamState): Promise<void>;
9
9
  private handleSetLogo;
10
10
  private handleSetProfileName;
11
11
  private handleSetSlug;
@@ -1 +1 @@
1
- {"version":3,"file":"builder-team-handlers.d.ts","sourceRoot":"","sources":["../../../processors/vetra-builder-relational-db-processor/builder-team-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAmBpD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAMtC,qBAAa,mBAAmB;IAGlB,OAAO,CAAC,EAAE;IAFtB,OAAO,CAAC,SAAS,CAAkB;gBAEf,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC;IAInC,0BAA0B,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;YA6DF,aAAa;YAWb,oBAAoB;YAWpB,aAAa;YAWb,2BAA2B;YAW3B,mBAAmB;YAcnB,eAAe;YAmDf,kBAAkB;YAclB,sBAAsB;YA4CtB,cAAc;YA0Bd,iBAAiB;YAYjB,qBAAqB;YA4BrB,mBAAmB;YAcnB,gBAAgB;YAoDhB,uBAAuB;YA2DvB,qBAAqB;YAyBrB,mBAAmB;CAUlC"}
1
+ {"version":3,"file":"builder-team-handlers.d.ts","sourceRoot":"","sources":["../../../processors/vetra-builder-relational-db-processor/builder-team-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAmBpD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAMtC,qBAAa,mBAAmB;IAGlB,OAAO,CAAC,EAAE;IAFtB,OAAO,CAAC,SAAS,CAAkB;gBAEf,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC;IAInC,0BAA0B,CAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,gBAAgB,GAAK,OAAO,CAAC,IAAI,CAAC;YA6D7B,aAAa;YAWb,oBAAoB;YAWpB,aAAa;YAWb,2BAA2B;YAW3B,mBAAmB;YAcnB,eAAe;YAmDf,kBAAkB;YAclB,sBAAsB;YA4CtB,cAAc;YA0Bd,iBAAiB;YAYjB,qBAAqB;YA4BrB,mBAAmB;YAcnB,gBAAgB;YAoDhB,uBAAuB;YA2DvB,qBAAqB;YAyBrB,mBAAmB;CAUlC"}
@@ -7,7 +7,7 @@ export class BuilderTeamHandlers {
7
7
  this.db = db;
8
8
  this.dbHelpers = new DatabaseHelpers(db);
9
9
  }
10
- async handleBuilderTeamOperation(documentId, action, state, driveId) {
10
+ async handleBuilderTeamOperation(documentId, action, state) {
11
11
  switch (action.type) {
12
12
  // Profile operations
13
13
  case "SET_LOGO":
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../processors/vetra-builder-relational-db-processor/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,wBAAsB,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkN7D;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/D"}
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../processors/vetra-builder-relational-db-processor/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEtC,wBAAsB,EAAE,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA8M7D;AAED,wBAAsB,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAW/D"}
@@ -1,8 +1,5 @@
1
1
  import {} from "document-drive";
2
2
  export async function up(db) {
3
- if (process.env.NODE_ENV !== "production") {
4
- await down(db);
5
- }
6
3
  // Create builder_teams table
7
4
  await db.schema
8
5
  .createTable("builder_teams")
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=add-builder-team-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-builder-team-model.d.ts","sourceRoot":"","sources":["../../scripts/add-builder-team-model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,122 @@
1
+ import { generateId } from 'document-model/core';
2
+ const GRAPHQL_ENDPOINT = 'http://localhost:4001/graphql';
3
+ const DRIVE_ID = 'vetra-builder-package';
4
+ async function graphqlRequest(query, variables) {
5
+ const response = await fetch(GRAPHQL_ENDPOINT, {
6
+ method: 'POST',
7
+ headers: { 'Content-Type': 'application/json' },
8
+ body: JSON.stringify({ query, variables }),
9
+ });
10
+ const result = await response.json();
11
+ if (result.errors) {
12
+ throw new Error(`GraphQL errors: ${JSON.stringify(result.errors, null, 2)}`);
13
+ }
14
+ return result.data;
15
+ }
16
+ async function createDocumentModelDocument(driveId, name, spec) {
17
+ console.log(`šŸ“„ Creating ${name} document model document...`);
18
+ // Create the document
19
+ const createMutation = `
20
+ mutation CreateDocumentModel($driveId: String, $name: String!) {
21
+ DocumentModel_createDocument(driveId: $driveId, name: $name)
22
+ }
23
+ `;
24
+ const result = await graphqlRequest(createMutation, {
25
+ driveId,
26
+ name,
27
+ });
28
+ const documentId = result.DocumentModel_createDocument;
29
+ console.log(` āœ“ Document created: ${documentId}`);
30
+ return documentId;
31
+ }
32
+ async function applyOperation(driveId, docId, operationType, input) {
33
+ const mutation = `
34
+ mutation Apply${operationType}($driveId: String, $docId: PHID, $input: DocumentModel_${operationType}Input!) {
35
+ DocumentModel_${operationType.toLowerCase()}(driveId: $driveId, docId: $docId, input: $input)
36
+ }
37
+ `;
38
+ await graphqlRequest(mutation, { driveId, docId, input });
39
+ }
40
+ async function main() {
41
+ console.log('=== Adding BuilderTeam Document Model to Remote Drive ===\n');
42
+ // Read the BuilderTeam specification
43
+ const spec = await import('../document-models/builder-team/builder-team.json', {
44
+ assert: { type: 'json' }
45
+ });
46
+ console.log('šŸ“‹ Loaded BuilderTeam specification');
47
+ console.log(` Version: ${spec.default.specifications[0].version}`);
48
+ console.log(` Modules: ${spec.default.specifications[0].modules.length}\n`);
49
+ // Create the document model document
50
+ const documentId = await createDocumentModelDocument(DRIVE_ID, spec.default.name, spec.default);
51
+ console.log('\nāš™ļø Populating document with specification...');
52
+ const specification = spec.default.specifications[0];
53
+ let operationCount = 0;
54
+ // Set basic metadata
55
+ console.log(' Setting metadata...');
56
+ await applyOperation(DRIVE_ID, documentId, 'SetModelName', { name: spec.default.name });
57
+ await applyOperation(DRIVE_ID, documentId, 'SetModelId', { id: spec.default.id });
58
+ await applyOperation(DRIVE_ID, documentId, 'SetModelExtension', { extension: spec.default.extension });
59
+ await applyOperation(DRIVE_ID, documentId, 'SetModelDescription', { description: spec.default.description });
60
+ await applyOperation(DRIVE_ID, documentId, 'SetAuthorName', { name: spec.default.author.name });
61
+ await applyOperation(DRIVE_ID, documentId, 'SetAuthorWebsite', { website: spec.default.author.website });
62
+ operationCount += 6;
63
+ // Set state schema
64
+ if (specification.state?.global?.schema) {
65
+ console.log(' Setting state schema...');
66
+ await applyOperation(DRIVE_ID, documentId, 'SetStateSchema', {
67
+ schema: specification.state.global.schema,
68
+ scope: 'global'
69
+ });
70
+ operationCount++;
71
+ }
72
+ if (specification.state?.global?.initialValue) {
73
+ await applyOperation(DRIVE_ID, documentId, 'SetInitialState', {
74
+ initialValue: specification.state.global.initialValue,
75
+ scope: 'global'
76
+ });
77
+ operationCount++;
78
+ }
79
+ // Add modules and operations
80
+ for (const module of specification.modules) {
81
+ console.log(` Adding module: ${module.name}`);
82
+ await applyOperation(DRIVE_ID, documentId, 'AddModule', {
83
+ id: module.id,
84
+ name: module.name,
85
+ description: module.description || ''
86
+ });
87
+ operationCount++;
88
+ if (module.operations) {
89
+ for (const operation of module.operations) {
90
+ await applyOperation(DRIVE_ID, documentId, 'AddOperation', {
91
+ id: operation.id,
92
+ moduleId: module.id,
93
+ name: operation.name,
94
+ description: operation.description || '',
95
+ scope: operation.scope
96
+ });
97
+ operationCount++;
98
+ if (operation.schema) {
99
+ await applyOperation(DRIVE_ID, documentId, 'SetOperationSchema', {
100
+ id: operation.id,
101
+ schema: operation.schema
102
+ });
103
+ operationCount++;
104
+ }
105
+ if (operation.reducer) {
106
+ await applyOperation(DRIVE_ID, documentId, 'SetOperationReducer', {
107
+ id: operation.id,
108
+ reducer: operation.reducer
109
+ });
110
+ operationCount++;
111
+ }
112
+ console.log(` āœ“ ${operation.name}`);
113
+ }
114
+ }
115
+ }
116
+ console.log(`\n āœ“ Applied ${operationCount} operations`);
117
+ console.log('\nāœ… BuilderTeam document model created successfully!');
118
+ console.log(` Drive: ${DRIVE_ID}`);
119
+ console.log(` Document ID: ${documentId}`);
120
+ console.log(` URL: http://localhost:4001/d/${DRIVE_ID}`);
121
+ }
122
+ main().catch(console.error);
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Create Remote Drives from GitHub Repositories
4
+ *
5
+ * This script:
6
+ * 1. Fetches powerhouse.manifest.json from GitHub repositories
7
+ * 2. Creates remote drives at localhost:4001/graphql
8
+ * 3. Creates package documents in each drive with manifest data
9
+ * 4. Creates document model documents with full specifications
10
+ *
11
+ * Usage (from project root):
12
+ * npm run create-drives
13
+ * OR
14
+ * npx tsx scripts/create-remote-drives.ts
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=create-remote-drives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-remote-drives.d.ts","sourceRoot":"","sources":["../../scripts/create-remote-drives.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}