@powerhousedao/network-admin 1.0.0-dev.7 → 1.0.0-dev.8
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.
|
@@ -16,7 +16,7 @@ export interface RemoteBuilderProfile {
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function fetchBuilderProfileById(docId: string): Promise<RemoteBuilderProfile | null>;
|
|
18
18
|
/**
|
|
19
|
-
* Fetches all builder profiles using
|
|
19
|
+
* Fetches all builder profiles using findDocuments.
|
|
20
20
|
*/
|
|
21
21
|
export declare function fetchAllRemoteBuilderProfiles(): Promise<RemoteBuilderProfile[]>;
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/builders-editor/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../../../editors/builders-editor/utils/graphql-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwGH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;CACH;AA2CD;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAOtC;AAED;;GAEG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAC5D,oBAAoB,EAAE,CACvB,CAUA;AAED;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CA+B5C;AAYD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAMD;;;;;;GAMG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,OAAO,CAAC,CAgBlB"}
|
|
@@ -57,19 +57,11 @@ async function graphqlRequest(query, variables, options) {
|
|
|
57
57
|
// Query to find all builder profile documents
|
|
58
58
|
const FIND_BUILDER_PROFILES_QUERY = `
|
|
59
59
|
query FindBuilderProfiles {
|
|
60
|
-
|
|
60
|
+
findDocuments(search: { type: "powerhouse/builder-profile" }) {
|
|
61
61
|
items {
|
|
62
62
|
id
|
|
63
63
|
name
|
|
64
|
-
state
|
|
65
|
-
global {
|
|
66
|
-
id
|
|
67
|
-
name
|
|
68
|
-
slug
|
|
69
|
-
icon
|
|
70
|
-
description
|
|
71
|
-
}
|
|
72
|
-
}
|
|
64
|
+
state
|
|
73
65
|
}
|
|
74
66
|
totalCount
|
|
75
67
|
}
|
|
@@ -78,31 +70,30 @@ const FIND_BUILDER_PROFILES_QUERY = `
|
|
|
78
70
|
// Query to get a single builder profile by identifier
|
|
79
71
|
const GET_BUILDER_PROFILE_QUERY = `
|
|
80
72
|
query GetBuilderProfile($identifier: String!) {
|
|
81
|
-
|
|
73
|
+
document(identifier: $identifier) {
|
|
82
74
|
document {
|
|
83
75
|
id
|
|
84
76
|
name
|
|
85
|
-
state
|
|
86
|
-
global {
|
|
87
|
-
id
|
|
88
|
-
name
|
|
89
|
-
slug
|
|
90
|
-
icon
|
|
91
|
-
description
|
|
92
|
-
}
|
|
93
|
-
}
|
|
77
|
+
state
|
|
94
78
|
}
|
|
95
79
|
}
|
|
96
80
|
}
|
|
97
81
|
`;
|
|
82
|
+
function getGlobalState(state) {
|
|
83
|
+
if (state && typeof state === "object" && "global" in state) {
|
|
84
|
+
return state.global;
|
|
85
|
+
}
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
98
88
|
function toRemoteProfile(item) {
|
|
89
|
+
const global = getGlobalState(item.state);
|
|
99
90
|
return {
|
|
100
91
|
id: item.id,
|
|
101
92
|
state: {
|
|
102
|
-
name:
|
|
103
|
-
slug:
|
|
104
|
-
icon:
|
|
105
|
-
description:
|
|
93
|
+
name: global.name ?? null,
|
|
94
|
+
slug: global.slug ?? null,
|
|
95
|
+
icon: global.icon ?? null,
|
|
96
|
+
description: global.description ?? null,
|
|
106
97
|
},
|
|
107
98
|
};
|
|
108
99
|
}
|
|
@@ -111,16 +102,16 @@ function toRemoteProfile(item) {
|
|
|
111
102
|
*/
|
|
112
103
|
export async function fetchBuilderProfileById(docId) {
|
|
113
104
|
const data = await graphqlRequest(GET_BUILDER_PROFILE_QUERY, { identifier: docId });
|
|
114
|
-
const item = data?.
|
|
105
|
+
const item = data?.document?.document;
|
|
115
106
|
return item ? toRemoteProfile(item) : null;
|
|
116
107
|
}
|
|
117
108
|
/**
|
|
118
|
-
* Fetches all builder profiles using
|
|
109
|
+
* Fetches all builder profiles using findDocuments.
|
|
119
110
|
*/
|
|
120
111
|
export async function fetchAllRemoteBuilderProfiles() {
|
|
121
112
|
try {
|
|
122
113
|
const data = await graphqlRequest(FIND_BUILDER_PROFILES_QUERY);
|
|
123
|
-
const items = data?.
|
|
114
|
+
const items = data?.findDocuments?.items ?? [];
|
|
124
115
|
return items.map(toRemoteProfile);
|
|
125
116
|
}
|
|
126
117
|
catch {
|
|
@@ -161,8 +152,11 @@ export async function fetchRemoteBuilderProfilesByIds(phids) {
|
|
|
161
152
|
}
|
|
162
153
|
// Mutation to set operational hub member on a builder profile
|
|
163
154
|
const SET_OP_HUB_MEMBER_MUTATION = `
|
|
164
|
-
mutation
|
|
165
|
-
|
|
155
|
+
mutation SetOpHubMember($documentIdentifier: String!, $actions: [JSONObject!]!) {
|
|
156
|
+
mutateDocument(documentIdentifier: $documentIdentifier, actions: $actions) {
|
|
157
|
+
id
|
|
158
|
+
name
|
|
159
|
+
}
|
|
166
160
|
}
|
|
167
161
|
`;
|
|
168
162
|
/**
|
|
@@ -174,8 +168,13 @@ const SET_OP_HUB_MEMBER_MUTATION = `
|
|
|
174
168
|
*/
|
|
175
169
|
export async function setOpHubMemberOnBuilderProfile(docId, input) {
|
|
176
170
|
try {
|
|
177
|
-
const data = await graphqlRequest(SET_OP_HUB_MEMBER_MUTATION, {
|
|
178
|
-
|
|
171
|
+
const data = await graphqlRequest(SET_OP_HUB_MEMBER_MUTATION, {
|
|
172
|
+
documentIdentifier: docId,
|
|
173
|
+
actions: [
|
|
174
|
+
{ type: "SET_OP_HUB_MEMBER", input, scope: "global" },
|
|
175
|
+
],
|
|
176
|
+
});
|
|
177
|
+
return data?.mutateDocument != null;
|
|
179
178
|
}
|
|
180
179
|
catch (error) {
|
|
181
180
|
console.warn("[graphql-client] Failed to set op hub member:", error);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/network-admin",
|
|
3
3
|
"description": "Network Admin package for Powerhouse",
|
|
4
|
-
"version": "1.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.8",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -75,35 +75,34 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@electric-sql/pglite": "0.3.15",
|
|
78
|
-
"@powerhousedao/builder-profile": "1.1.0-dev.
|
|
79
|
-
"@powerhousedao/builder-tools": "6.0.0-
|
|
80
|
-
"@powerhousedao/common": "6.0.0-
|
|
81
|
-
"@powerhousedao/design-system": "6.0.0-
|
|
78
|
+
"@powerhousedao/builder-profile": "1.1.0-dev.6",
|
|
79
|
+
"@powerhousedao/builder-tools": "6.0.0-dev.105",
|
|
80
|
+
"@powerhousedao/common": "6.0.0-dev.105",
|
|
81
|
+
"@powerhousedao/design-system": "6.0.0-dev.105",
|
|
82
82
|
"@powerhousedao/document-engineering": "1.40.1",
|
|
83
|
-
"@powerhousedao/project-management": "1.0.0-dev.
|
|
84
|
-
"@powerhousedao/vetra": "6.0.0-
|
|
85
|
-
"document-model": "6.0.0-
|
|
86
|
-
"graphql": "
|
|
83
|
+
"@powerhousedao/project-management": "1.0.0-dev.8",
|
|
84
|
+
"@powerhousedao/vetra": "6.0.0-dev.105",
|
|
85
|
+
"document-model": "6.0.0-dev.105",
|
|
86
|
+
"graphql": "16.12.0",
|
|
87
87
|
"graphql-tag": "^2.12.6",
|
|
88
88
|
"zod": "^4.3.5"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@eslint/js": "^9.38.0",
|
|
92
|
-
"@powerhousedao/analytics-engine-core": "6.0.0-
|
|
93
|
-
"@powerhousedao/config": "6.0.0-
|
|
94
|
-
"@powerhousedao/connect": "6.0.0-
|
|
95
|
-
"@powerhousedao/ph-cli": "6.0.0-
|
|
96
|
-
"@powerhousedao/reactor-api": "6.0.0-
|
|
97
|
-
"@powerhousedao/reactor-browser": "6.0.0-
|
|
98
|
-
"@powerhousedao/reactor-local": "6.0.0-
|
|
99
|
-
"@powerhousedao/switchboard": "6.0.0-
|
|
92
|
+
"@powerhousedao/analytics-engine-core": "6.0.0-dev.105",
|
|
93
|
+
"@powerhousedao/config": "6.0.0-dev.105",
|
|
94
|
+
"@powerhousedao/connect": "6.0.0-dev.105",
|
|
95
|
+
"@powerhousedao/ph-cli": "6.0.0-dev.105",
|
|
96
|
+
"@powerhousedao/reactor-api": "6.0.0-dev.105",
|
|
97
|
+
"@powerhousedao/reactor-browser": "6.0.0-dev.105",
|
|
98
|
+
"@powerhousedao/reactor-local": "6.0.0-dev.105",
|
|
99
|
+
"@powerhousedao/switchboard": "6.0.0-dev.105",
|
|
100
100
|
"@tailwindcss/cli": "^4.1.18",
|
|
101
|
-
"@tailwindcss/vite": "4.1.18",
|
|
102
101
|
"@testing-library/react": "^16.3.0",
|
|
103
102
|
"@types/node": "^24.9.2",
|
|
104
103
|
"@types/react": "^19.2.3",
|
|
105
104
|
"@vitejs/plugin-react": "^5.1.0",
|
|
106
|
-
"document-drive": "6.0.0-
|
|
105
|
+
"document-drive": "6.0.0-dev.105",
|
|
107
106
|
"eslint": "^9.38.0",
|
|
108
107
|
"eslint-config-prettier": "^10.1.8",
|
|
109
108
|
"eslint-plugin-prettier": "^5.5.4",
|
|
@@ -118,9 +117,7 @@
|
|
|
118
117
|
"typescript": "^5.9.3",
|
|
119
118
|
"typescript-eslint": "^8.46.2",
|
|
120
119
|
"vite": "^6.2.3",
|
|
121
|
-
"vite-plugin-html": "3.2.2",
|
|
122
120
|
"vite-plugin-node-polyfills": "^0.24.0",
|
|
123
|
-
"vite-plugin-svgr": "4.5.0",
|
|
124
121
|
"vitest": "^3.0.9"
|
|
125
122
|
},
|
|
126
123
|
"peerDependencies": {
|
|
@@ -128,11 +125,12 @@
|
|
|
128
125
|
"react-dom": ">=19.0.0"
|
|
129
126
|
},
|
|
130
127
|
"overrides": {
|
|
131
|
-
"graphql": "
|
|
128
|
+
"graphql": "$graphql"
|
|
132
129
|
},
|
|
133
130
|
"bugs": {
|
|
134
131
|
"url": "https://github.com/powerhouse-inc/network-admin/issues"
|
|
135
132
|
},
|
|
136
133
|
"readme": "ERROR: No README data found!",
|
|
137
|
-
"homepage": "https://github.com/powerhouse-inc/network-admin#readme"
|
|
134
|
+
"homepage": "https://github.com/powerhouse-inc/network-admin#readme",
|
|
135
|
+
"_id": "@powerhousedao/network-admin@1.0.0-dev.6"
|
|
138
136
|
}
|