@powerhousedao/network-admin 0.0.27 → 0.0.29

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 (148) hide show
  1. package/dist/document-models/request-for-proposals/gen/document-model.js +36 -36
  2. package/dist/document-models/request-for-proposals/gen/object.d.ts.map +1 -1
  3. package/dist/document-models/request-for-proposals/gen/object.js +1 -1
  4. package/dist/document-models/request-for-proposals/gen/ph-factories.js +1 -1
  5. package/dist/document-models/request-for-proposals/gen/utils.js +3 -3
  6. package/dist/document-models/request-for-proposals/src/reducers/rfp-state.d.ts.map +1 -1
  7. package/dist/document-models/request-for-proposals/src/reducers/rfp-state.js +7 -5
  8. package/dist/document-models/workstream/gen/document-model.d.ts.map +1 -1
  9. package/dist/document-models/workstream/gen/document-model.js +52 -52
  10. package/dist/document-models/workstream/gen/object.d.ts.map +1 -1
  11. package/dist/document-models/workstream/gen/object.js +1 -1
  12. package/dist/document-models/workstream/gen/schema/types.d.ts +1 -1
  13. package/dist/document-models/workstream/gen/schema/types.d.ts.map +1 -1
  14. package/dist/document-models/workstream/gen/utils.js +2 -2
  15. package/dist/editors/network-admin/components/DriveExplorer.d.ts.map +1 -1
  16. package/dist/editors/network-admin/components/DriveExplorer.js +23 -5
  17. package/dist/editors/network-profile/editor.js +1 -1
  18. package/dist/editors/request-for-proposals/editor.d.ts.map +1 -1
  19. package/dist/editors/request-for-proposals/editor.js +61 -13
  20. package/dist/editors/workstream/editor.d.ts.map +1 -1
  21. package/dist/editors/workstream/editor.js +167 -13
  22. package/dist/powerhouse.manifest.json +1 -1
  23. package/dist/processors/factory.d.ts +8 -0
  24. package/dist/processors/factory.d.ts.map +1 -0
  25. package/dist/processors/factory.js +22 -0
  26. package/dist/processors/index.d.ts +3 -0
  27. package/dist/processors/index.d.ts.map +1 -1
  28. package/dist/processors/index.js +3 -1
  29. package/dist/processors/workstreams/factory.d.ts +4 -0
  30. package/dist/processors/workstreams/factory.d.ts.map +1 -0
  31. package/dist/processors/workstreams/factory.js +22 -0
  32. package/dist/processors/workstreams/index.d.ts +14 -0
  33. package/dist/processors/workstreams/index.d.ts.map +1 -0
  34. package/dist/processors/workstreams/index.js +182 -0
  35. package/dist/processors/workstreams/migrations.d.ts +4 -0
  36. package/dist/processors/workstreams/migrations.d.ts.map +1 -0
  37. package/dist/processors/workstreams/migrations.js +40 -0
  38. package/dist/processors/workstreams/schema.d.ts +19 -0
  39. package/dist/processors/workstreams/schema.d.ts.map +1 -0
  40. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts +3 -0
  41. package/dist/scripts/sow-mirror/mirror_sow_state.d.ts.map +1 -0
  42. package/dist/scripts/sow-mirror/mirror_sow_state.js +441 -0
  43. package/dist/style.css +164 -5396
  44. package/dist/subgraphs/index.d.ts +2 -0
  45. package/dist/subgraphs/index.d.ts.map +1 -1
  46. package/dist/subgraphs/index.js +2 -0
  47. package/dist/subgraphs/{builder-profile → networks}/index.d.ts +1 -1
  48. package/dist/subgraphs/networks/index.d.ts.map +1 -0
  49. package/dist/subgraphs/{builder-profile → networks}/index.js +2 -2
  50. package/dist/subgraphs/networks/resolvers.d.ts.map +1 -0
  51. package/dist/subgraphs/networks/resolvers.js +41 -0
  52. package/dist/subgraphs/networks/schema.d.ts.map +1 -0
  53. package/dist/subgraphs/networks/schema.js +39 -0
  54. package/dist/subgraphs/request-for-proposals/index.d.ts.map +1 -1
  55. package/dist/subgraphs/workstream/index.d.ts.map +1 -1
  56. package/dist/subgraphs/workstream/schema.js +1 -1
  57. package/dist/subgraphs/workstreams/index.d.ts +11 -0
  58. package/dist/subgraphs/workstreams/index.d.ts.map +1 -0
  59. package/dist/subgraphs/workstreams/index.js +11 -0
  60. package/dist/subgraphs/workstreams/resolvers.d.ts +3 -0
  61. package/dist/subgraphs/workstreams/resolvers.d.ts.map +1 -0
  62. package/dist/subgraphs/workstreams/resolvers.js +377 -0
  63. package/dist/subgraphs/workstreams/schema.d.ts +3 -0
  64. package/dist/subgraphs/workstreams/schema.d.ts.map +1 -0
  65. package/dist/subgraphs/workstreams/schema.js +326 -0
  66. package/package.json +15 -15
  67. package/dist/document-models/builder-profile/gen/actions.d.ts +0 -4
  68. package/dist/document-models/builder-profile/gen/actions.d.ts.map +0 -1
  69. package/dist/document-models/builder-profile/gen/actions.js +0 -1
  70. package/dist/document-models/builder-profile/gen/builder/actions.d.ts +0 -8
  71. package/dist/document-models/builder-profile/gen/builder/actions.d.ts.map +0 -1
  72. package/dist/document-models/builder-profile/gen/builder/creators.d.ts +0 -4
  73. package/dist/document-models/builder-profile/gen/builder/creators.d.ts.map +0 -1
  74. package/dist/document-models/builder-profile/gen/builder/creators.js +0 -3
  75. package/dist/document-models/builder-profile/gen/builder/error.d.ts +0 -2
  76. package/dist/document-models/builder-profile/gen/builder/error.d.ts.map +0 -1
  77. package/dist/document-models/builder-profile/gen/builder/error.js +0 -1
  78. package/dist/document-models/builder-profile/gen/builder/object.d.ts +0 -7
  79. package/dist/document-models/builder-profile/gen/builder/object.d.ts.map +0 -1
  80. package/dist/document-models/builder-profile/gen/builder/object.js +0 -7
  81. package/dist/document-models/builder-profile/gen/builder/operations.d.ts +0 -7
  82. package/dist/document-models/builder-profile/gen/builder/operations.d.ts.map +0 -1
  83. package/dist/document-models/builder-profile/gen/builder/operations.js +0 -1
  84. package/dist/document-models/builder-profile/gen/creators.d.ts +0 -2
  85. package/dist/document-models/builder-profile/gen/creators.d.ts.map +0 -1
  86. package/dist/document-models/builder-profile/gen/creators.js +0 -1
  87. package/dist/document-models/builder-profile/gen/document-model.d.ts +0 -3
  88. package/dist/document-models/builder-profile/gen/document-model.d.ts.map +0 -1
  89. package/dist/document-models/builder-profile/gen/document-model.js +0 -48
  90. package/dist/document-models/builder-profile/gen/index.d.ts +0 -8
  91. package/dist/document-models/builder-profile/gen/index.d.ts.map +0 -1
  92. package/dist/document-models/builder-profile/gen/index.js +0 -6
  93. package/dist/document-models/builder-profile/gen/object.d.ts +0 -15
  94. package/dist/document-models/builder-profile/gen/object.d.ts.map +0 -1
  95. package/dist/document-models/builder-profile/gen/object.js +0 -25
  96. package/dist/document-models/builder-profile/gen/ph-factories.d.ts +0 -27
  97. package/dist/document-models/builder-profile/gen/ph-factories.d.ts.map +0 -1
  98. package/dist/document-models/builder-profile/gen/ph-factories.js +0 -54
  99. package/dist/document-models/builder-profile/gen/reducer.d.ts +0 -5
  100. package/dist/document-models/builder-profile/gen/reducer.d.ts.map +0 -1
  101. package/dist/document-models/builder-profile/gen/reducer.js +0 -20
  102. package/dist/document-models/builder-profile/gen/schema/index.d.ts +0 -3
  103. package/dist/document-models/builder-profile/gen/schema/index.d.ts.map +0 -1
  104. package/dist/document-models/builder-profile/gen/schema/index.js +0 -2
  105. package/dist/document-models/builder-profile/gen/schema/types.d.ts +0 -151
  106. package/dist/document-models/builder-profile/gen/schema/types.d.ts.map +0 -1
  107. package/dist/document-models/builder-profile/gen/schema/types.js +0 -1
  108. package/dist/document-models/builder-profile/gen/schema/zod.d.ts +0 -12
  109. package/dist/document-models/builder-profile/gen/schema/zod.d.ts.map +0 -1
  110. package/dist/document-models/builder-profile/gen/schema/zod.js +0 -24
  111. package/dist/document-models/builder-profile/gen/types.d.ts +0 -10
  112. package/dist/document-models/builder-profile/gen/types.d.ts.map +0 -1
  113. package/dist/document-models/builder-profile/gen/types.js +0 -1
  114. package/dist/document-models/builder-profile/gen/utils.d.ts +0 -22
  115. package/dist/document-models/builder-profile/gen/utils.d.ts.map +0 -1
  116. package/dist/document-models/builder-profile/gen/utils.js +0 -46
  117. package/dist/document-models/builder-profile/index.d.ts +0 -25
  118. package/dist/document-models/builder-profile/index.d.ts.map +0 -1
  119. package/dist/document-models/builder-profile/index.js +0 -21
  120. package/dist/document-models/builder-profile/src/reducers/builder.d.ts +0 -3
  121. package/dist/document-models/builder-profile/src/reducers/builder.d.ts.map +0 -1
  122. package/dist/document-models/builder-profile/src/reducers/builder.js +0 -9
  123. package/dist/document-models/builder-profile/src/tests/builder.test.d.ts +0 -2
  124. package/dist/document-models/builder-profile/src/tests/builder.test.d.ts.map +0 -1
  125. package/dist/document-models/builder-profile/src/tests/builder.test.js +0 -116
  126. package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts +0 -6
  127. package/dist/document-models/builder-profile/src/tests/document-model.test.d.ts.map +0 -1
  128. package/dist/document-models/builder-profile/src/tests/document-model.test.js +0 -18
  129. package/dist/document-models/builder-profile/src/utils.d.ts +0 -2
  130. package/dist/document-models/builder-profile/src/utils.d.ts.map +0 -1
  131. package/dist/document-models/builder-profile/src/utils.js +0 -1
  132. package/dist/editors/builder-profile/editor.d.ts +0 -4
  133. package/dist/editors/builder-profile/editor.d.ts.map +0 -1
  134. package/dist/editors/builder-profile/editor.js +0 -101
  135. package/dist/editors/builder-profile/index.d.ts +0 -3
  136. package/dist/editors/builder-profile/index.d.ts.map +0 -1
  137. package/dist/editors/builder-profile/index.js +0 -11
  138. package/dist/editors/hooks/useBuilderProfileDocument.d.ts +0 -3
  139. package/dist/editors/hooks/useBuilderProfileDocument.d.ts.map +0 -1
  140. package/dist/editors/hooks/useBuilderProfileDocument.js +0 -8
  141. package/dist/subgraphs/builder-profile/index.d.ts.map +0 -1
  142. package/dist/subgraphs/builder-profile/resolvers.d.ts.map +0 -1
  143. package/dist/subgraphs/builder-profile/resolvers.js +0 -84
  144. package/dist/subgraphs/builder-profile/schema.d.ts.map +0 -1
  145. package/dist/subgraphs/builder-profile/schema.js +0 -49
  146. /package/dist/{document-models/builder-profile/gen/builder/actions.js → processors/workstreams/schema.js} +0 -0
  147. /package/dist/subgraphs/{builder-profile → networks}/resolvers.d.ts +0 -0
  148. /package/dist/subgraphs/{builder-profile → networks}/schema.d.ts +0 -0
@@ -1,101 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { TextInput, Textarea, Icon, } from "@powerhousedao/document-engineering";
3
- import { toast, ToastContainer } from "@powerhousedao/design-system";
4
- import { actions } from "../../document-models/builder-profile/index.js";
5
- import { useCallback, useState, useEffect } from "react";
6
- import { useSelectedBuilderProfileDocument } from "../hooks/useBuilderProfileDocument.js";
7
- // Image Modal Component
8
- function ImageModal({ isOpen, onClose, imageUrl, imageAlt, }) {
9
- const [imageLoaded, setImageLoaded] = useState(false);
10
- const [imageDimensions, setImageDimensions] = useState({
11
- width: 0,
12
- height: 0,
13
- });
14
- if (!isOpen)
15
- return null;
16
- const handleImageLoad = (e) => {
17
- const img = e.target;
18
- setImageDimensions({ width: img.naturalWidth, height: img.naturalHeight });
19
- setImageLoaded(true);
20
- };
21
- // Calculate modal size based on image dimensions with padding
22
- const getModalSize = () => {
23
- if (!imageLoaded)
24
- return { width: "auto", height: "auto" };
25
- const maxWidth = Math.min(imageDimensions.width + 100, window.innerWidth * 0.8);
26
- const maxHeight = Math.min(imageDimensions.height + 100, window.innerHeight * 0.8);
27
- return {
28
- width: `${maxWidth}px`,
29
- height: `${maxHeight}px`,
30
- };
31
- };
32
- return (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm", onClick: onClose, children: _jsxs("div", { className: "relative bg-gray-900 rounded-lg shadow-2xl border-2 border-gray-700", style: getModalSize(), children: [_jsx("button", { onClick: onClose, className: "absolute -top-3 -right-3 z-10 w-8 h-8 bg-gray-800 hover:bg-gray-900 rounded-full flex items-center justify-center text-white transition-all duration-200 shadow-lg", children: _jsx(Icon, { name: "ArrowLeft", size: 16 }) }), _jsx("div", { className: "w-full h-full flex items-center justify-center p-8", children: _jsx("img", { src: imageUrl, alt: imageAlt, className: `max-w-full max-h-full object-contain rounded-lg ${imageLoaded ? "opacity-100" : "opacity-0"} transition-opacity duration-200`, onClick: (e) => e.stopPropagation(), onLoad: handleImageLoad }) })] }) }));
33
- }
34
- // Image URL input component with preview
35
- function ImageUrlInput({ label, value, onChange, placeholder, fileSize = "200KB", }) {
36
- const [imageError, setImageError] = useState(false);
37
- const [isModalOpen, setIsModalOpen] = useState(false);
38
- // Reset image error when value changes
39
- useEffect(() => {
40
- setImageError(false);
41
- }, [value]);
42
- const handleImageClick = () => {
43
- if (value &&
44
- !imageError &&
45
- (value.startsWith("http://") || value.startsWith("https://"))) {
46
- setIsModalOpen(true);
47
- }
48
- };
49
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "block text-sm font-medium text-gray-700", children: label }), _jsxs("div", { className: "border border-gray-300 rounded-lg p-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center space-x-3", children: [_jsx("div", { className: `flex-shrink-0 w-12 h-12 bg-gray-100 rounded border flex items-center justify-center overflow-hidden ${value &&
50
- !imageError &&
51
- (value.startsWith("http://") || value.startsWith("https://"))
52
- ? "cursor-pointer hover:opacity-80 transition-opacity duration-200"
53
- : ""}`, onClick: handleImageClick, children: value &&
54
- !imageError &&
55
- (value.startsWith("http://") ||
56
- value.startsWith("https://")) ? (_jsx("img", { src: value, alt: `${label} preview`, className: "w-full h-full object-cover", onError: () => setImageError(true), onLoad: () => setImageError(false) })) : (_jsx(Icon, { name: "Image", size: 24, className: "text-gray-400" })) }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { className: "text-sm font-medium text-gray-900", children: value || placeholder || `${label.replace(":", "")}.jpg` }), _jsxs("div", { className: "text-xs text-gray-500", children: ["File Type: jpg | File Size: ", value ? fileSize : "0KB", imageError && value && (_jsx("div", { className: "text-red-500 mt-1", children: "\u26A0 Failed to load image" })), value &&
57
- !imageError &&
58
- (value.startsWith("http://") ||
59
- value.startsWith("https://")) && (_jsx("div", { className: "text-blue-600 mt-1", children: "\uD83D\uDCA1 Click image to view full size" }))] })] })] }), _jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "w-6 h-6 rounded-full bg-gray-200 flex items-center justify-center", children: _jsx(Icon, { name: "Image", size: 16, className: "text-gray-600" }) }) })] }), _jsx("div", { className: "mt-3", children: _jsx(TextInput, { className: "w-full", defaultValue: value || "", onBlur: (e) => {
60
- if (e.target.value !== value) {
61
- onChange(e.target.value);
62
- }
63
- }, placeholder: placeholder || "Enter image URL" }) })] })] }), _jsx(ImageModal, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), imageUrl: value, imageAlt: `${label} full size` })] }));
64
- }
65
- export default function Editor() {
66
- // Getting dispatch from selected document
67
- const [doc, dispatch] = useSelectedBuilderProfileDocument();
68
- const state = doc.state.global;
69
- // Handle field changes using the UPDATE_PROFILE operation
70
- const handleFieldChange = useCallback((field, value) => {
71
- if (!dispatch) {
72
- console.error("Dispatch function not available");
73
- toast(`Failed to update ${field} - no dispatch function`, {
74
- type: "error",
75
- });
76
- return;
77
- }
78
- // Create the update action with current state values and the new field value
79
- const updateAction = actions.updateProfile({
80
- id: state?.id || null,
81
- slug: field === "slug" ? value : state?.slug || null,
82
- name: field === "name" ? value : state?.name || null,
83
- icon: field === "icon" ? value : state?.icon || null,
84
- description: field === "description" ? value : state?.description || null,
85
- });
86
- dispatch(updateAction);
87
- }, [dispatch, state]);
88
- return (_jsx("div", { className: "w-full bg-gray-50 min-h-screen", children: _jsxs("div", { className: "p-6 max-w-4xl mx-auto", children: [_jsxs("div", { className: "bg-white rounded-lg p-6 mb-6 shadow-sm", children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: "Builder Profile" }), _jsx("p", { className: "text-gray-600", children: "Create and manage your builder profile information" })] }), _jsx("div", { className: "bg-white rounded-lg p-6 shadow-sm", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Builder Name:" }), _jsx(TextInput, { className: "w-full", defaultValue: state?.name || "", onBlur: (e) => {
89
- if (e.target.value !== state?.name) {
90
- handleFieldChange("name", e.target.value);
91
- }
92
- }, placeholder: "Enter your name" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Profile Slug:" }), _jsx(TextInput, { className: "w-full", defaultValue: state?.slug || "", onBlur: (e) => {
93
- if (e.target.value !== state?.slug) {
94
- handleFieldChange("slug", e.target.value);
95
- }
96
- }, placeholder: "your-profile-slug" }), _jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Used for your profile URL (lowercase, no spaces)" })] }), _jsx(ImageUrlInput, { label: "Profile Icon:", value: state?.icon || "", onChange: (value) => handleFieldChange("icon", value), placeholder: "BuilderIcon.jpg", fileSize: "200KB" }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Description:" }), _jsx(Textarea, { className: "w-full", defaultValue: state?.description || "", onBlur: (e) => {
97
- if (e.target.value !== state?.description) {
98
- handleFieldChange("description", e.target.value);
99
- }
100
- }, placeholder: "Tell us about yourself as a builder...", rows: 4 })] })] }) }), state && (state.name || state.icon || state.description) && (_jsxs("div", { className: "bg-white rounded-lg p-6 shadow-sm mt-6", children: [_jsx("h3", { className: "text-lg font-medium text-gray-900 mb-4", children: "Profile Preview" }), _jsx("div", { className: "border border-gray-200 rounded-lg p-4", children: _jsxs("div", { className: "flex items-start space-x-4", children: [_jsx("div", { className: "flex-shrink-0", children: state.icon ? (_jsx("img", { src: state.icon, alt: "Profile icon", className: "w-16 h-16 rounded-full object-cover border-2 border-gray-200" })) : (_jsx("div", { className: "w-16 h-16 rounded-full bg-gray-200 flex items-center justify-center", children: _jsx(Icon, { name: "Image", size: 24, className: "text-gray-400" }) })) }), _jsxs("div", { className: "flex-1", children: [_jsx("h4", { className: "text-lg font-semibold text-gray-900", children: state.name || "Unnamed Builder" }), state.slug && (_jsxs("p", { className: "text-sm text-gray-500 mb-2", children: ["@", state.slug] })), state.description && (_jsx("p", { className: "text-gray-700", children: state.description }))] })] }) })] })), _jsx(ToastContainer, {})] }) }));
101
- }
@@ -1,3 +0,0 @@
1
- import type { EditorModule } from "document-model";
2
- export declare const module: EditorModule;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../editors/builder-profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,MAAM,EAAE,YASpB,CAAC"}
@@ -1,11 +0,0 @@
1
- import Editor from "./editor.js";
2
- export const module = {
3
- Component: Editor,
4
- documentTypes: ["powerhouse/builder-profile"],
5
- config: {
6
- id: "builder-profile-editor",
7
- disableExternalControls: true,
8
- documentToolbarEnabled: true,
9
- showSwitchboardLink: true,
10
- },
11
- };
@@ -1,3 +0,0 @@
1
- export declare function useBuilderProfileDocument(documentId: string | null | undefined): never[] | [BuilderProfileDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<BuilderProfileAction>];
2
- export declare function useSelectedBuilderProfileDocument(): never[] | [BuilderProfileDocument, import("@powerhousedao/reactor-browser").DocumentDispatch<BuilderProfileAction>];
3
- //# sourceMappingURL=useBuilderProfileDocument.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBuilderProfileDocument.d.ts","sourceRoot":"","sources":["../../../editors/hooks/useBuilderProfileDocument.ts"],"names":[],"mappings":"AASA,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,uHAMtC;AAED,wBAAgB,iCAAiC,wHAGhD"}
@@ -1,8 +0,0 @@
1
- import { useDocumentOfType, useSelectedDocumentId, } from "@powerhousedao/reactor-browser";
2
- export function useBuilderProfileDocument(documentId) {
3
- return useDocumentOfType(documentId, "powerhouse/builder-profile");
4
- }
5
- export function useSelectedBuilderProfileDocument() {
6
- const selectedDocumentId = useSelectedDocumentId();
7
- return useBuilderProfileDocument(selectedDocumentId);
8
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-profile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,qBAAa,sBAAuB,SAAQ,QAAQ;IAClD,IAAI,SAAqB;IACzB,QAAQ,EAAE,YAAY,CAAU;IAChC,SAAS,0BAAsB;IAC/B,uBAAuB,KAAM;IACvB,OAAO;IACP,YAAY;CACnB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-profile/resolvers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAS3D,eAAO,MAAM,YAAY,GAAI,UAAU,QAAQ,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAkHvE,CAAC"}
@@ -1,84 +0,0 @@
1
- import { addFile } from "document-drive";
2
- import { actions, } from "../../document-models/builder-profile/index.js";
3
- import { setName } from "document-model";
4
- export const getResolvers = (subgraph) => {
5
- const reactor = subgraph.reactor;
6
- return {
7
- Query: {
8
- BuilderProfile: async () => {
9
- return {
10
- getDocument: async (args) => {
11
- const { docId, driveId } = args;
12
- if (!docId) {
13
- throw new Error("Document id is required");
14
- }
15
- if (driveId) {
16
- const docIds = await reactor.getDocuments(driveId);
17
- if (!docIds.includes(docId)) {
18
- throw new Error(`Document with id ${docId} is not part of ${driveId}`);
19
- }
20
- }
21
- const doc = await reactor.getDocument(docId);
22
- return {
23
- driveId: driveId,
24
- ...doc,
25
- ...doc.header,
26
- created: doc.header.createdAtUtcIso,
27
- lastModified: doc.header.lastModifiedAtUtcIso,
28
- state: doc.state.global,
29
- stateJSON: doc.state.global,
30
- revision: doc.header?.revision?.global ?? 0,
31
- };
32
- },
33
- getDocuments: async (args) => {
34
- const { driveId } = args;
35
- const docsIds = await reactor.getDocuments(driveId);
36
- const docs = await Promise.all(docsIds.map(async (docId) => {
37
- const doc = await reactor.getDocument(docId);
38
- return {
39
- driveId: driveId,
40
- ...doc,
41
- ...doc.header,
42
- created: doc.header.createdAtUtcIso,
43
- lastModified: doc.header.lastModifiedAtUtcIso,
44
- state: doc.state.global,
45
- stateJSON: doc.state.global,
46
- revision: doc.header?.revision?.global ?? 0,
47
- };
48
- }));
49
- return docs.filter((doc) => doc.header.documentType === "powerhouse/builder-profile");
50
- },
51
- };
52
- },
53
- },
54
- Mutation: {
55
- BuilderProfile_createDocument: async (_, args) => {
56
- const { driveId, name } = args;
57
- const document = await reactor.addDocument("powerhouse/builder-profile");
58
- if (driveId) {
59
- await reactor.addAction(driveId, addFile({
60
- name,
61
- id: document.header.id,
62
- documentType: "powerhouse/builder-profile",
63
- }));
64
- }
65
- if (name) {
66
- await reactor.addAction(document.header.id, setName(name));
67
- }
68
- return document.header.id;
69
- },
70
- BuilderProfile_updateProfile: async (_, args) => {
71
- const { docId, input } = args;
72
- const doc = await reactor.getDocument(docId);
73
- if (!doc) {
74
- throw new Error("Document not found");
75
- }
76
- const result = await reactor.addAction(docId, actions.updateProfile(input));
77
- if (result.status !== "SUCCESS") {
78
- throw new Error(result.error?.message ?? "Failed to updateProfile");
79
- }
80
- return true;
81
- },
82
- },
83
- };
84
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../subgraphs/builder-profile/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,MAAM,EAAE,YA+CpB,CAAC"}
@@ -1,49 +0,0 @@
1
- import { gql } from "graphql-tag";
2
- export const schema = gql `
3
- """
4
- Subgraph definition for BuilderProfile (powerhouse/builder-profile)
5
- """
6
- type BuilderProfileState {
7
- id: PHID
8
- slug: String
9
- name: String
10
- icon: URL
11
- description: String
12
- }
13
-
14
- """
15
- Queries: BuilderProfile
16
- """
17
- type BuilderProfileQueries {
18
- getDocument(docId: PHID!, driveId: PHID): BuilderProfile
19
- getDocuments(driveId: String!): [BuilderProfile!]
20
- }
21
-
22
- type Query {
23
- BuilderProfile: BuilderProfileQueries
24
- }
25
-
26
- """
27
- Mutations: BuilderProfile
28
- """
29
- type Mutation {
30
- BuilderProfile_createDocument(name: String!, driveId: String): String
31
-
32
- BuilderProfile_updateProfile(
33
- driveId: String
34
- docId: PHID
35
- input: BuilderProfile_UpdateProfileInput
36
- ): Int
37
- }
38
-
39
- """
40
- Module: Builder
41
- """
42
- input BuilderProfile_UpdateProfileInput {
43
- id: PHID
44
- slug: String
45
- name: String
46
- icon: URL
47
- description: String
48
- }
49
- `;