@powerhousedao/vetra 5.1.0 → 5.2.0-staging.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/document-models/app-module/actions.d.ts.map +1 -1
  2. package/dist/document-models/app-module/gen/base-operations/actions.d.ts +1 -1
  3. package/dist/document-models/app-module/gen/base-operations/actions.d.ts.map +1 -1
  4. package/dist/document-models/app-module/gen/base-operations/actions.js +1 -1
  5. package/dist/document-models/app-module/gen/base-operations/operations.d.ts +2 -2
  6. package/dist/document-models/app-module/gen/base-operations/operations.d.ts.map +1 -1
  7. package/dist/document-models/app-module/gen/base-operations/operations.js +0 -2
  8. package/dist/document-models/app-module/gen/dnd-operations/actions.d.ts +1 -1
  9. package/dist/document-models/app-module/gen/dnd-operations/actions.d.ts.map +1 -1
  10. package/dist/document-models/app-module/gen/dnd-operations/actions.js +1 -1
  11. package/dist/document-models/app-module/gen/dnd-operations/operations.d.ts +2 -2
  12. package/dist/document-models/app-module/gen/dnd-operations/operations.d.ts.map +1 -1
  13. package/dist/document-models/app-module/gen/dnd-operations/operations.js +0 -2
  14. package/dist/document-models/app-module/gen/document-model.js +2 -2
  15. package/dist/document-models/app-module/gen/document-schema.d.ts +24 -170
  16. package/dist/document-models/app-module/gen/document-schema.d.ts.map +1 -1
  17. package/dist/document-models/app-module/gen/reducer.d.ts.map +1 -1
  18. package/dist/document-models/app-module/gen/reducer.js +12 -6
  19. package/dist/document-models/app-module/gen/schema/types.d.ts +15 -3
  20. package/dist/document-models/app-module/gen/schema/types.d.ts.map +1 -1
  21. package/dist/document-models/app-module/gen/schema/zod.d.ts +7 -4
  22. package/dist/document-models/app-module/gen/schema/zod.d.ts.map +1 -1
  23. package/dist/document-models/app-module/gen/schema/zod.js +2 -2
  24. package/dist/document-models/app-module/gen/types.d.ts.map +1 -1
  25. package/dist/document-models/app-module/index.d.ts +0 -4
  26. package/dist/document-models/app-module/index.d.ts.map +1 -1
  27. package/dist/document-models/app-module/index.js +0 -4
  28. package/dist/document-models/app-module/src/tests/base-operations.test.js +52 -1
  29. package/dist/document-models/document-editor/actions.d.ts.map +1 -1
  30. package/dist/document-models/document-editor/gen/base-operations/actions.d.ts +1 -1
  31. package/dist/document-models/document-editor/gen/base-operations/actions.d.ts.map +1 -1
  32. package/dist/document-models/document-editor/gen/base-operations/actions.js +1 -1
  33. package/dist/document-models/document-editor/gen/base-operations/operations.d.ts +2 -2
  34. package/dist/document-models/document-editor/gen/base-operations/operations.d.ts.map +1 -1
  35. package/dist/document-models/document-editor/gen/base-operations/operations.js +0 -2
  36. package/dist/document-models/document-editor/gen/document-model.js +2 -2
  37. package/dist/document-models/document-editor/gen/document-schema.d.ts +21 -151
  38. package/dist/document-models/document-editor/gen/document-schema.d.ts.map +1 -1
  39. package/dist/document-models/document-editor/gen/reducer.d.ts.map +1 -1
  40. package/dist/document-models/document-editor/gen/reducer.js +8 -4
  41. package/dist/document-models/document-editor/gen/schema/types.d.ts +15 -3
  42. package/dist/document-models/document-editor/gen/schema/types.d.ts.map +1 -1
  43. package/dist/document-models/document-editor/gen/schema/zod.d.ts +7 -4
  44. package/dist/document-models/document-editor/gen/schema/zod.d.ts.map +1 -1
  45. package/dist/document-models/document-editor/gen/schema/zod.js +2 -2
  46. package/dist/document-models/document-editor/gen/types.d.ts.map +1 -1
  47. package/dist/document-models/document-editor/index.d.ts +0 -4
  48. package/dist/document-models/document-editor/index.d.ts.map +1 -1
  49. package/dist/document-models/document-editor/index.js +0 -4
  50. package/dist/document-models/document-editor/src/tests/base-operations.test.js +42 -1
  51. package/dist/document-models/index.d.ts +0 -4
  52. package/dist/document-models/index.d.ts.map +1 -1
  53. package/dist/document-models/index.js +0 -4
  54. package/dist/document-models/processor-module/actions.d.ts.map +1 -1
  55. package/dist/document-models/processor-module/gen/base-operations/actions.d.ts +1 -1
  56. package/dist/document-models/processor-module/gen/base-operations/actions.d.ts.map +1 -1
  57. package/dist/document-models/processor-module/gen/base-operations/actions.js +1 -1
  58. package/dist/document-models/processor-module/gen/base-operations/operations.d.ts +2 -2
  59. package/dist/document-models/processor-module/gen/base-operations/operations.d.ts.map +1 -1
  60. package/dist/document-models/processor-module/gen/base-operations/operations.js +0 -2
  61. package/dist/document-models/processor-module/gen/document-model.js +2 -2
  62. package/dist/document-models/processor-module/gen/document-schema.d.ts +24 -170
  63. package/dist/document-models/processor-module/gen/document-schema.d.ts.map +1 -1
  64. package/dist/document-models/processor-module/gen/reducer.d.ts.map +1 -1
  65. package/dist/document-models/processor-module/gen/reducer.js +10 -5
  66. package/dist/document-models/processor-module/gen/schema/types.d.ts +15 -3
  67. package/dist/document-models/processor-module/gen/schema/types.d.ts.map +1 -1
  68. package/dist/document-models/processor-module/gen/schema/zod.d.ts +7 -4
  69. package/dist/document-models/processor-module/gen/schema/zod.d.ts.map +1 -1
  70. package/dist/document-models/processor-module/gen/schema/zod.js +2 -2
  71. package/dist/document-models/processor-module/gen/types.d.ts.map +1 -1
  72. package/dist/document-models/processor-module/index.d.ts +0 -4
  73. package/dist/document-models/processor-module/index.d.ts.map +1 -1
  74. package/dist/document-models/processor-module/index.js +0 -4
  75. package/dist/document-models/processor-module/src/tests/base-operations.test.js +52 -1
  76. package/dist/document-models/subgraph-module/actions.d.ts.map +1 -1
  77. package/dist/document-models/subgraph-module/gen/base-operations/actions.d.ts +1 -1
  78. package/dist/document-models/subgraph-module/gen/base-operations/actions.d.ts.map +1 -1
  79. package/dist/document-models/subgraph-module/gen/base-operations/actions.js +1 -1
  80. package/dist/document-models/subgraph-module/gen/base-operations/operations.d.ts +2 -2
  81. package/dist/document-models/subgraph-module/gen/base-operations/operations.d.ts.map +1 -1
  82. package/dist/document-models/subgraph-module/gen/base-operations/operations.js +0 -2
  83. package/dist/document-models/subgraph-module/gen/document-model.d.ts.map +1 -1
  84. package/dist/document-models/subgraph-module/gen/document-model.js +2 -2
  85. package/dist/document-models/subgraph-module/gen/document-schema.d.ts +18 -132
  86. package/dist/document-models/subgraph-module/gen/document-schema.d.ts.map +1 -1
  87. package/dist/document-models/subgraph-module/gen/reducer.d.ts.map +1 -1
  88. package/dist/document-models/subgraph-module/gen/reducer.js +4 -2
  89. package/dist/document-models/subgraph-module/gen/schema/types.d.ts +15 -3
  90. package/dist/document-models/subgraph-module/gen/schema/types.d.ts.map +1 -1
  91. package/dist/document-models/subgraph-module/gen/schema/zod.d.ts +7 -4
  92. package/dist/document-models/subgraph-module/gen/schema/zod.d.ts.map +1 -1
  93. package/dist/document-models/subgraph-module/gen/schema/zod.js +1 -1
  94. package/dist/document-models/subgraph-module/gen/types.d.ts.map +1 -1
  95. package/dist/document-models/subgraph-module/index.d.ts +0 -4
  96. package/dist/document-models/subgraph-module/index.d.ts.map +1 -1
  97. package/dist/document-models/subgraph-module/index.js +0 -4
  98. package/dist/document-models/subgraph-module/src/tests/base-operations.test.js +22 -1
  99. package/dist/document-models/vetra-package/actions.d.ts.map +1 -1
  100. package/dist/document-models/vetra-package/gen/base-operations/actions.d.ts +1 -1
  101. package/dist/document-models/vetra-package/gen/base-operations/actions.d.ts.map +1 -1
  102. package/dist/document-models/vetra-package/gen/base-operations/actions.js +1 -1
  103. package/dist/document-models/vetra-package/gen/base-operations/operations.d.ts +2 -2
  104. package/dist/document-models/vetra-package/gen/base-operations/operations.d.ts.map +1 -1
  105. package/dist/document-models/vetra-package/gen/base-operations/operations.js +0 -2
  106. package/dist/document-models/vetra-package/gen/document-model.js +2 -2
  107. package/dist/document-models/vetra-package/gen/document-schema.d.ts +33 -227
  108. package/dist/document-models/vetra-package/gen/document-schema.d.ts.map +1 -1
  109. package/dist/document-models/vetra-package/gen/reducer.d.ts.map +1 -1
  110. package/dist/document-models/vetra-package/gen/reducer.js +20 -10
  111. package/dist/document-models/vetra-package/gen/schema/types.d.ts +17 -1
  112. package/dist/document-models/vetra-package/gen/schema/types.d.ts.map +1 -1
  113. package/dist/document-models/vetra-package/gen/schema/zod.d.ts +3 -3
  114. package/dist/document-models/vetra-package/gen/schema/zod.d.ts.map +1 -1
  115. package/dist/document-models/vetra-package/gen/schema/zod.js +10 -10
  116. package/dist/document-models/vetra-package/gen/types.d.ts.map +1 -1
  117. package/dist/document-models/vetra-package/index.d.ts +0 -4
  118. package/dist/document-models/vetra-package/index.d.ts.map +1 -1
  119. package/dist/document-models/vetra-package/index.js +0 -4
  120. package/dist/document-models/vetra-package/src/tests/base-operations.test.js +127 -28
  121. package/dist/editors/app-editor/module.d.ts +1 -1
  122. package/dist/editors/app-editor/module.d.ts.map +1 -1
  123. package/dist/editors/app-editor/module.js +1 -1
  124. package/dist/processors/codegen/__tests__/codegen-processor-e2e.test.js +96 -38
  125. package/dist/processors/codegen/document-handlers/generators/app-generator.d.ts.map +1 -1
  126. package/dist/processors/codegen/document-handlers/generators/app-generator.js +2 -0
  127. package/dist/processors/codegen/document-handlers/generators/constants.d.ts +3 -0
  128. package/dist/processors/codegen/document-handlers/generators/constants.d.ts.map +1 -0
  129. package/dist/processors/codegen/document-handlers/generators/constants.js +2 -0
  130. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.d.ts.map +1 -1
  131. package/dist/processors/codegen/document-handlers/generators/document-editor-generator.js +2 -0
  132. package/dist/processors/codegen/document-handlers/generators/document-model-generator.d.ts.map +1 -1
  133. package/dist/processors/codegen/document-handlers/generators/document-model-generator.js +7 -2
  134. package/dist/subgraphs/app-module/resolvers.d.ts.map +1 -1
  135. package/dist/subgraphs/app-module/resolvers.js +4 -4
  136. package/dist/subgraphs/app-module/schema.d.ts.map +1 -1
  137. package/dist/subgraphs/app-module/schema.js +2 -17
  138. package/dist/subgraphs/document-editor/index.d.ts +3 -2
  139. package/dist/subgraphs/document-editor/index.d.ts.map +1 -1
  140. package/dist/subgraphs/document-editor/index.js +1 -1
  141. package/dist/subgraphs/document-editor/resolvers.d.ts +1 -1
  142. package/dist/subgraphs/document-editor/resolvers.d.ts.map +1 -1
  143. package/dist/subgraphs/document-editor/resolvers.js +12 -16
  144. package/dist/subgraphs/document-editor/schema.d.ts.map +1 -1
  145. package/dist/subgraphs/document-editor/schema.js +2 -21
  146. package/dist/subgraphs/index.d.ts +4 -4
  147. package/dist/subgraphs/index.d.ts.map +1 -1
  148. package/dist/subgraphs/index.js +4 -4
  149. package/dist/subgraphs/processor-module/index.d.ts +1 -1
  150. package/dist/subgraphs/processor-module/index.d.ts.map +1 -1
  151. package/dist/subgraphs/processor-module/resolvers.d.ts +1 -1
  152. package/dist/subgraphs/processor-module/resolvers.d.ts.map +1 -1
  153. package/dist/subgraphs/processor-module/resolvers.js +12 -16
  154. package/dist/subgraphs/processor-module/schema.d.ts.map +1 -1
  155. package/dist/subgraphs/processor-module/schema.js +2 -22
  156. package/dist/subgraphs/subgraph-module/index.d.ts +1 -1
  157. package/dist/subgraphs/subgraph-module/index.d.ts.map +1 -1
  158. package/dist/subgraphs/subgraph-module/resolvers.d.ts +1 -1
  159. package/dist/subgraphs/subgraph-module/resolvers.d.ts.map +1 -1
  160. package/dist/subgraphs/subgraph-module/resolvers.js +12 -16
  161. package/dist/subgraphs/subgraph-module/schema.d.ts.map +1 -1
  162. package/dist/subgraphs/subgraph-module/schema.js +2 -15
  163. package/dist/subgraphs/vetra-package/index.d.ts +1 -1
  164. package/dist/subgraphs/vetra-package/index.d.ts.map +1 -1
  165. package/dist/subgraphs/vetra-package/resolvers.d.ts +1 -1
  166. package/dist/subgraphs/vetra-package/resolvers.d.ts.map +1 -1
  167. package/dist/subgraphs/vetra-package/resolvers.js +137 -94
  168. package/dist/subgraphs/vetra-package/schema.d.ts.map +1 -1
  169. package/dist/subgraphs/vetra-package/schema.js +3 -26
  170. package/dist/tsconfig.tsbuildinfo +1 -1
  171. package/package.json +16 -18
@@ -1,6 +1,6 @@
1
1
  import { addFile } from "document-drive";
2
- import { actions, } from "../../document-models/app-module/index.js";
3
2
  import { setName } from "document-model";
3
+ import { actions, appModuleDocumentType, } from "@powerhousedao/vetra/document-models/app-module";
4
4
  export const getResolvers = (subgraph) => {
5
5
  const reactor = subgraph.reactor;
6
6
  return {
@@ -46,7 +46,7 @@ export const getResolvers = (subgraph) => {
46
46
  revision: doc.header?.revision?.global ?? 0,
47
47
  };
48
48
  }));
49
- return docs.filter((doc) => doc.header.documentType === "powerhouse/app");
49
+ return docs.filter((doc) => doc.header.documentType === appModuleDocumentType);
50
50
  },
51
51
  };
52
52
  },
@@ -54,12 +54,12 @@ export const getResolvers = (subgraph) => {
54
54
  Mutation: {
55
55
  AppModule_createDocument: async (_, args) => {
56
56
  const { driveId, name } = args;
57
- const document = await reactor.addDocument("powerhouse/app");
57
+ const document = await reactor.addDocument(appModuleDocumentType);
58
58
  if (driveId) {
59
59
  await reactor.addAction(driveId, addFile({
60
60
  name,
61
61
  id: document.header.id,
62
- documentType: "powerhouse/app",
62
+ documentType: appModuleDocumentType,
63
63
  }));
64
64
  }
65
65
  if (name) {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA2FpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/app-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA4EpB,CAAC"}
@@ -1,22 +1,7 @@
1
1
  import { gql } from "graphql-tag";
2
2
  export const schema = gql `
3
3
  """
4
- Subgraph definition for AppModule (powerhouse/app)
5
- """
6
- type AppModuleState {
7
- name: String!
8
- status: StatusType!
9
- allowedDocumentTypes: [String!]
10
- isDragAndDropEnabled: Boolean!
11
- }
12
-
13
- enum StatusType {
14
- DRAFT
15
- CONFIRMED
16
- }
17
-
18
- """
19
- Queries: AppModule
4
+ Queries: AppModule Document
20
5
  """
21
6
  type AppModuleQueries {
22
7
  getDocument(docId: PHID!, driveId: PHID): AppModule
@@ -72,7 +57,7 @@ export const schema = gql `
72
57
  name: String!
73
58
  }
74
59
  input AppModule_SetAppStatusInput {
75
- status: StatusType!
60
+ status: AppModule_StatusType!
76
61
  }
77
62
  input AppModule_AddDocumentTypeInput {
78
63
  documentType: String!
@@ -1,8 +1,9 @@
1
1
  import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
+ import type { DocumentNode } from "graphql";
2
3
  export declare class DocumentEditorSubgraph extends BaseSubgraph {
3
4
  name: string;
4
- typeDefs: import("graphql").DocumentNode;
5
- resolvers: Record<string, any>;
5
+ typeDefs: DocumentNode;
6
+ resolvers: Record<string, unknown>;
6
7
  additionalContextFields: {};
7
8
  onSetup(): Promise<void>;
8
9
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,IAAI,SAAqB;IACzB,QAAQ,iCAAU;IAClB,SAAS,sBAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,IAAI,SAAqB;IACzB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,6 +1,6 @@
1
1
  import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
- import { getResolvers } from "./resolvers.js";
3
2
  import { schema } from "./schema.js";
3
+ import { getResolvers } from "./resolvers.js";
4
4
  export class DocumentEditorSubgraph extends BaseSubgraph {
5
5
  name = "document-editor";
6
6
  typeDefs = schema;
@@ -1,3 +1,3 @@
1
1
  import type { BaseSubgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAW/D,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAwLvE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAgB/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAoLxB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { addFile } from "document-drive";
2
2
  import { setName } from "document-model";
3
- import { actions } from "../../document-models/document-editor/index.js";
3
+ import { actions, documentEditorDocumentType, } from "@powerhousedao/vetra/document-models/document-editor";
4
4
  export const getResolvers = (subgraph) => {
5
5
  const reactor = subgraph.reactor;
6
6
  return {
@@ -23,12 +23,10 @@ export const getResolvers = (subgraph) => {
23
23
  driveId: driveId,
24
24
  ...doc,
25
25
  ...doc.header,
26
- // these will be ripped out in the future, but for now all doc models have global state
27
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
28
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
29
- state: doc.state.global ?? {},
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
31
- stateJSON: doc.state.global ?? "{}",
26
+ created: doc.header.createdAtUtcIso,
27
+ lastModified: doc.header.lastModifiedAtUtcIso,
28
+ state: doc.state.global,
29
+ stateJSON: doc.state.global,
32
30
  revision: doc.header?.revision?.global ?? 0,
33
31
  };
34
32
  },
@@ -41,16 +39,14 @@ export const getResolvers = (subgraph) => {
41
39
  driveId: driveId,
42
40
  ...doc,
43
41
  ...doc.header,
44
- // these will be ripped out in the future, but for now all doc models have global state
45
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
46
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
47
- state: doc.state.global ?? {},
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
49
- stateJSON: doc.state.global ?? "{}",
42
+ created: doc.header.createdAtUtcIso,
43
+ lastModified: doc.header.lastModifiedAtUtcIso,
44
+ state: doc.state.global,
45
+ stateJSON: doc.state.global,
50
46
  revision: doc.header?.revision?.global ?? 0,
51
47
  };
52
48
  }));
53
- return docs.filter((doc) => doc.header.documentType === "powerhouse/document-editor");
49
+ return docs.filter((doc) => doc.header.documentType === documentEditorDocumentType);
54
50
  },
55
51
  };
56
52
  },
@@ -58,12 +54,12 @@ export const getResolvers = (subgraph) => {
58
54
  Mutation: {
59
55
  DocumentEditor_createDocument: async (_, args) => {
60
56
  const { driveId, name } = args;
61
- const document = await reactor.addDocument("powerhouse/document-editor");
57
+ const document = await reactor.addDocument(documentEditorDocumentType);
62
58
  if (driveId) {
63
59
  await reactor.addAction(driveId, addFile({
64
60
  name,
65
61
  id: document.header.id,
66
- documentType: "powerhouse/document-editor",
62
+ documentType: documentEditorDocumentType,
67
63
  }));
68
64
  }
69
65
  if (name) {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA4EpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/document-editor/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAyDpB,CAAC"}
@@ -1,26 +1,7 @@
1
1
  import { gql } from "graphql-tag";
2
2
  export const schema = gql `
3
3
  """
4
- Subgraph definition for DocumentEditor (powerhouse/document-editor)
5
- """
6
- type DocumentEditorState {
7
- name: String!
8
- documentTypes: [DocumentTypeItem!]!
9
- status: StatusType!
10
- }
11
-
12
- type DocumentTypeItem {
13
- id: OID!
14
- documentType: String!
15
- }
16
-
17
- enum StatusType {
18
- DRAFT
19
- CONFIRMED
20
- }
21
-
22
- """
23
- Queries: DocumentEditor
4
+ Queries: DocumentEditor Document
24
5
  """
25
6
  type DocumentEditorQueries {
26
7
  getDocument(docId: PHID!, driveId: PHID): DocumentEditor
@@ -73,6 +54,6 @@ export const schema = gql `
73
54
  id: OID!
74
55
  }
75
56
  input DocumentEditor_SetEditorStatusInput {
76
- status: StatusType!
57
+ status: DocumentEditor_StatusType!
77
58
  }
78
59
  `;
@@ -1,7 +1,7 @@
1
- export * as DocumentEditorSubgraph from "./document-editor/index.js";
2
- export * as VetraPackageSubgraph from "./vetra-package/index.js";
3
- export * as SubgraphModuleSubgraph from "./subgraph-module/index.js";
4
- export * as ProcessorModuleSubgraph from "./processor-module/index.js";
5
1
  export * as AppModuleSubgraph from "./app-module/index.js";
2
+ export * as ProcessorModuleSubgraph from "./processor-module/index.js";
3
+ export * as SubgraphModuleSubgraph from "./subgraph-module/index.js";
4
+ export * as VetraPackageSubgraph from "./vetra-package/index.js";
6
5
  export * as VetraReadModelSubgraph from "./vetra-read-model/index.js";
6
+ export * as DocumentEditorSubgraph from "./document-editor/index.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../subgraphs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,sBAAsB,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,sBAAsB,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,uBAAuB,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../subgraphs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,uBAAuB,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,sBAAsB,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,sBAAsB,MAAM,4BAA4B,CAAC"}
@@ -1,6 +1,6 @@
1
- export * as DocumentEditorSubgraph from "./document-editor/index.js";
2
- export * as VetraPackageSubgraph from "./vetra-package/index.js";
3
- export * as SubgraphModuleSubgraph from "./subgraph-module/index.js";
4
- export * as ProcessorModuleSubgraph from "./processor-module/index.js";
5
1
  export * as AppModuleSubgraph from "./app-module/index.js";
2
+ export * as ProcessorModuleSubgraph from "./processor-module/index.js";
3
+ export * as SubgraphModuleSubgraph from "./subgraph-module/index.js";
4
+ export * as VetraPackageSubgraph from "./vetra-package/index.js";
6
5
  export * as VetraReadModelSubgraph from "./vetra-read-model/index.js";
6
+ export * as DocumentEditorSubgraph from "./document-editor/index.js";
@@ -2,7 +2,7 @@ import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
2
  export declare class ProcessorModuleSubgraph extends BaseSubgraph {
3
3
  name: string;
4
4
  typeDefs: import("graphql").DocumentNode;
5
- resolvers: Record<string, any>;
5
+ resolvers: Record<string, unknown>;
6
6
  additionalContextFields: {};
7
7
  onSetup(): Promise<void>;
8
8
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBAAa,uBAAwB,SAAQ,YAAY;IACvD,IAAI,SAAsB;IAC1B,QAAQ,iCAAU;IAClB,SAAS,sBAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBAAa,uBAAwB,SAAQ,YAAY;IACvD,IAAI,SAAsB;IAC1B,QAAQ,iCAAU;IAClB,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import type { BaseSubgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAY/D,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAkNvE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAiB/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAgNxB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { addFile } from "document-drive";
2
2
  import { setName } from "document-model";
3
- import { actions } from "../../document-models/processor-module/index.js";
3
+ import { actions, processorModuleDocumentType, } from "@powerhousedao/vetra/document-models/processor-module";
4
4
  export const getResolvers = (subgraph) => {
5
5
  const reactor = subgraph.reactor;
6
6
  return {
@@ -23,12 +23,10 @@ export const getResolvers = (subgraph) => {
23
23
  driveId: driveId,
24
24
  ...doc,
25
25
  ...doc.header,
26
- // these will be ripped out in the future, but for now all doc models have global state
27
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
28
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
29
- state: doc.state.global ?? {},
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
31
- stateJSON: doc.state.global ?? "{}",
26
+ created: doc.header.createdAtUtcIso,
27
+ lastModified: doc.header.lastModifiedAtUtcIso,
28
+ state: doc.state.global,
29
+ stateJSON: doc.state.global,
32
30
  revision: doc.header?.revision?.global ?? 0,
33
31
  };
34
32
  },
@@ -41,16 +39,14 @@ export const getResolvers = (subgraph) => {
41
39
  driveId: driveId,
42
40
  ...doc,
43
41
  ...doc.header,
44
- // these will be ripped out in the future, but for now all doc models have global state
45
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
46
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
47
- state: doc.state.global ?? {},
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
49
- stateJSON: doc.state.global ?? "{}",
42
+ created: doc.header.createdAtUtcIso,
43
+ lastModified: doc.header.lastModifiedAtUtcIso,
44
+ state: doc.state.global,
45
+ stateJSON: doc.state.global,
50
46
  revision: doc.header?.revision?.global ?? 0,
51
47
  };
52
48
  }));
53
- return docs.filter((doc) => doc.header.documentType === "powerhouse/processor");
49
+ return docs.filter((doc) => doc.header.documentType === processorModuleDocumentType);
54
50
  },
55
51
  };
56
52
  },
@@ -58,12 +54,12 @@ export const getResolvers = (subgraph) => {
58
54
  Mutation: {
59
55
  ProcessorModule_createDocument: async (_, args) => {
60
56
  const { driveId, name } = args;
61
- const document = await reactor.addDocument("powerhouse/processor");
57
+ const document = await reactor.addDocument(processorModuleDocumentType);
62
58
  if (driveId) {
63
59
  await reactor.addAction(driveId, addFile({
64
60
  name,
65
61
  id: document.header.id,
66
- documentType: "powerhouse/processor",
62
+ documentType: processorModuleDocumentType,
67
63
  }));
68
64
  }
69
65
  if (name) {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAqFpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/processor-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAiEpB,CAAC"}
@@ -1,27 +1,7 @@
1
1
  import { gql } from "graphql-tag";
2
2
  export const schema = gql `
3
3
  """
4
- Subgraph definition for ProcessorModule (powerhouse/processor)
5
- """
6
- type ProcessorModuleState {
7
- name: String!
8
- type: String!
9
- documentTypes: [DocumentTypeItem!]!
10
- status: StatusType!
11
- }
12
-
13
- type DocumentTypeItem {
14
- id: OID!
15
- documentType: String!
16
- }
17
-
18
- enum StatusType {
19
- DRAFT
20
- CONFIRMED
21
- }
22
-
23
- """
24
- Queries: ProcessorModule
4
+ Queries: ProcessorModule Document
25
5
  """
26
6
  type ProcessorModuleQueries {
27
7
  getDocument(docId: PHID!, driveId: PHID): ProcessorModule
@@ -82,6 +62,6 @@ export const schema = gql `
82
62
  id: OID!
83
63
  }
84
64
  input ProcessorModule_SetProcessorStatusInput {
85
- status: StatusType!
65
+ status: ProcessorModule_StatusType!
86
66
  }
87
67
  `;
@@ -2,7 +2,7 @@ import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
2
  export declare class SubgraphModuleSubgraph extends BaseSubgraph {
3
3
  name: string;
4
4
  typeDefs: import("graphql").DocumentNode;
5
- resolvers: Record<string, any>;
5
+ resolvers: Record<string, unknown>;
6
6
  additionalContextFields: {};
7
7
  onSetup(): Promise<void>;
8
8
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,IAAI,SAAqB;IACzB,QAAQ,iCAAU;IAClB,SAAS,sBAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,IAAI,SAAqB;IACzB,QAAQ,iCAAU;IAClB,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import type { BaseSubgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS/D,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CA0IvE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAc/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAwIxB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { addFile } from "document-drive";
2
2
  import { setName } from "document-model";
3
- import { actions } from "../../document-models/subgraph-module/index.js";
3
+ import { actions, subgraphModuleDocumentType, } from "@powerhousedao/vetra/document-models/subgraph-module";
4
4
  export const getResolvers = (subgraph) => {
5
5
  const reactor = subgraph.reactor;
6
6
  return {
@@ -23,12 +23,10 @@ export const getResolvers = (subgraph) => {
23
23
  driveId: driveId,
24
24
  ...doc,
25
25
  ...doc.header,
26
- // these will be ripped out in the future, but for now all doc models have global state
27
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
28
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
29
- state: doc.state.global ?? {},
30
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
31
- stateJSON: doc.state.global ?? "{}",
26
+ created: doc.header.createdAtUtcIso,
27
+ lastModified: doc.header.lastModifiedAtUtcIso,
28
+ state: doc.state.global,
29
+ stateJSON: doc.state.global,
32
30
  revision: doc.header?.revision?.global ?? 0,
33
31
  };
34
32
  },
@@ -41,16 +39,14 @@ export const getResolvers = (subgraph) => {
41
39
  driveId: driveId,
42
40
  ...doc,
43
41
  ...doc.header,
44
- // these will be ripped out in the future, but for now all doc models have global state
45
- // TODO (thegoldenmule): once the gql interface is updated for arbitrary state, we can remove this
46
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
47
- state: doc.state.global ?? {},
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
49
- stateJSON: doc.state.global ?? "{}",
42
+ created: doc.header.createdAtUtcIso,
43
+ lastModified: doc.header.lastModifiedAtUtcIso,
44
+ state: doc.state.global,
45
+ stateJSON: doc.state.global,
50
46
  revision: doc.header?.revision?.global ?? 0,
51
47
  };
52
48
  }));
53
- return docs.filter((doc) => doc.header.documentType === "powerhouse/subgraph");
49
+ return docs.filter((doc) => doc.header.documentType === subgraphModuleDocumentType);
54
50
  },
55
51
  };
56
52
  },
@@ -58,12 +54,12 @@ export const getResolvers = (subgraph) => {
58
54
  Mutation: {
59
55
  SubgraphModule_createDocument: async (_, args) => {
60
56
  const { driveId, name } = args;
61
- const document = await reactor.addDocument("powerhouse/subgraph");
57
+ const document = await reactor.addDocument(subgraphModuleDocumentType);
62
58
  if (driveId) {
63
59
  await reactor.addAction(driveId, addFile({
64
60
  name,
65
61
  id: document.header.id,
66
- documentType: "powerhouse/subgraph",
62
+ documentType: subgraphModuleDocumentType,
67
63
  }));
68
64
  }
69
65
  if (name) {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAqDpB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/subgraph-module/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YAwCpB,CAAC"}
@@ -1,20 +1,7 @@
1
1
  import { gql } from "graphql-tag";
2
2
  export const schema = gql `
3
3
  """
4
- Subgraph definition for SubgraphModule (powerhouse/subgraph)
5
- """
6
- type SubgraphModuleState {
7
- name: String!
8
- status: StatusType!
9
- }
10
-
11
- enum StatusType {
12
- DRAFT
13
- CONFIRMED
14
- }
15
-
16
- """
17
- Queries: SubgraphModule
4
+ Queries: SubgraphModule Document
18
5
  """
19
6
  type SubgraphModuleQueries {
20
7
  getDocument(docId: PHID!, driveId: PHID): SubgraphModule
@@ -50,6 +37,6 @@ export const schema = gql `
50
37
  name: String!
51
38
  }
52
39
  input SubgraphModule_SetSubgraphStatusInput {
53
- status: StatusType!
40
+ status: SubgraphModule_StatusType!
54
41
  }
55
42
  `;
@@ -2,7 +2,7 @@ import { BaseSubgraph } from "@powerhousedao/reactor-api";
2
2
  export declare class VetraPackageSubgraph extends BaseSubgraph {
3
3
  name: string;
4
4
  typeDefs: import("graphql").DocumentNode;
5
- resolvers: Record<string, any>;
5
+ resolvers: Record<string, unknown>;
6
6
  additionalContextFields: {};
7
7
  onSetup(): Promise<void>;
8
8
  onDisconnect(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/vetra-package/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK1D,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,IAAI,SAAmB;IAEvB,QAAQ,iCAAU;IAClB,SAAS,sBAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/vetra-package/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK1D,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,IAAI,SAAmB;IAEvB,QAAQ,iCAAU;IAClB,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1,3 +1,3 @@
1
1
  import type { BaseSubgraph } from "@powerhousedao/reactor-api";
2
- export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, any>;
2
+ export declare const getResolvers: (subgraph: BaseSubgraph) => Record<string, unknown>;
3
3
  //# sourceMappingURL=resolvers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/vetra-package/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS/D,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAuOvE,CAAC"}
1
+ {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/vetra-package/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAsB/D,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,KACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAuUxB,CAAC"}