@powerhousedao/common 4.1.0-dev.93 → 4.1.0-dev.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/vetra-gql.d.ts +7 -0
- package/dist/utils/vetra-gql.d.ts.map +1 -0
- package/dist/utils/vetra-gql.js +52 -0
- package/dist/utils/vetra-gql.js.map +1 -0
- package/package.json +19 -9
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./vetra-gql.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./vetra-gql.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface VetraDocumentInfo {
|
|
2
|
+
id: string;
|
|
3
|
+
githubUrl: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function getVetraDocuments(graphqlEndpoint: string, driveId: string): Promise<VetraDocumentInfo[]>;
|
|
6
|
+
export declare function setPackageGithubUrl(graphqlEndpoint: string, driveId: string, documentId: string, url: string): Promise<number>;
|
|
7
|
+
//# sourceMappingURL=vetra-gql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vetra-gql.d.ts","sourceRoot":"","sources":["../../utils/vetra-gql.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA0B9B;AAED,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CA4BjB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { GraphQLClient, gql } from "graphql-request";
|
|
2
|
+
export async function getVetraDocuments(graphqlEndpoint, driveId) {
|
|
3
|
+
const client = new GraphQLClient(graphqlEndpoint, {
|
|
4
|
+
fetch,
|
|
5
|
+
});
|
|
6
|
+
const query = gql `
|
|
7
|
+
query GetDocuments($driveId: String!) {
|
|
8
|
+
VetraPackage {
|
|
9
|
+
getDocuments(driveId: $driveId) {
|
|
10
|
+
id
|
|
11
|
+
state {
|
|
12
|
+
githubUrl
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const response = await client.request(query, {
|
|
19
|
+
driveId,
|
|
20
|
+
});
|
|
21
|
+
return response.VetraPackage.getDocuments.map((doc) => ({
|
|
22
|
+
id: doc.id,
|
|
23
|
+
githubUrl: doc.state.githubUrl,
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
export async function setPackageGithubUrl(graphqlEndpoint, driveId, documentId, url) {
|
|
27
|
+
const client = new GraphQLClient(graphqlEndpoint, {
|
|
28
|
+
fetch,
|
|
29
|
+
});
|
|
30
|
+
const mutation = gql `
|
|
31
|
+
mutation SetPackageGithubUrl(
|
|
32
|
+
$driveId: String
|
|
33
|
+
$docId: PHID
|
|
34
|
+
$input: VetraPackage_SetPackageGithubUrlInput!
|
|
35
|
+
) {
|
|
36
|
+
VetraPackage_setPackageGithubUrl(
|
|
37
|
+
driveId: $driveId
|
|
38
|
+
docId: $docId
|
|
39
|
+
input: $input
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
const response = await client.request(mutation, {
|
|
44
|
+
driveId,
|
|
45
|
+
docId: documentId,
|
|
46
|
+
input: {
|
|
47
|
+
url,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return response.VetraPackage_setPackageGithubUrl;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=vetra-gql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vetra-gql.js","sourceRoot":"","sources":["../../utils/vetra-gql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAwBrD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,eAAuB,EACvB,OAAe;IAEf,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,eAAe,EAAE;QAChD,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;GAWhB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAuB,KAAK,EAAE;QACjE,OAAO;KACR,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACtD,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,SAAS;KAC/B,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,eAAuB,EACvB,OAAe,EACf,UAAkB,EAClB,GAAW;IAEX,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,eAAe,EAAE;QAChD,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;GAYnB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAA8B,QAAQ,EAAE;QAC3E,OAAO;QACP,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE;YACL,GAAG;SACJ;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,gCAAgC,CAAC;AACnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/common",
|
|
3
|
-
"version": "4.1.0-dev.
|
|
3
|
+
"version": "4.1.0-dev.95",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,16 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/powerhouse-inc/powerhouse"
|
|
12
12
|
},
|
|
13
|
-
"exports":
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./utils": {
|
|
19
|
+
"import": "./dist/utils/index.js",
|
|
20
|
+
"types": "./dist/utils/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
14
23
|
"types": "./dist/index.d.ts",
|
|
15
24
|
"description": "The Powerhouse Common package contains the basic document model and drive UI (App) that is required to get started with Connect and visualize private & public apps.",
|
|
16
25
|
"peerDependencies": {
|
|
@@ -21,12 +30,13 @@
|
|
|
21
30
|
"@powerhousedao/analytics-engine-core": "^0.5.0",
|
|
22
31
|
"@tanstack/react-virtual": "^3.8.1",
|
|
23
32
|
"@types/luxon": "^3.7.1",
|
|
33
|
+
"graphql-request": "^7.2.0",
|
|
24
34
|
"luxon": "^3.7.1",
|
|
25
35
|
"react-i18next": "^13.5.0",
|
|
26
|
-
"@powerhousedao/
|
|
27
|
-
"@powerhousedao/
|
|
28
|
-
"document-
|
|
29
|
-
"document-
|
|
36
|
+
"@powerhousedao/builder-tools": "4.1.0-dev.95",
|
|
37
|
+
"@powerhousedao/design-system": "4.1.0-dev.95",
|
|
38
|
+
"document-model": "4.1.0-dev.95",
|
|
39
|
+
"document-drive": "4.1.0-dev.95"
|
|
30
40
|
},
|
|
31
41
|
"devDependencies": {
|
|
32
42
|
"@storybook/addon-actions": "^8.6.7",
|
|
@@ -65,9 +75,9 @@
|
|
|
65
75
|
"vite-plugin-node-polyfills": "^0.24.0",
|
|
66
76
|
"vitest": "^3.2.4",
|
|
67
77
|
"zod": "^3.24.3",
|
|
68
|
-
"@powerhousedao/config": "4.1.0-dev.
|
|
69
|
-
"@powerhousedao/reactor-browser": "4.1.0-dev.
|
|
70
|
-
"document-model": "4.1.0-dev.
|
|
78
|
+
"@powerhousedao/config": "4.1.0-dev.95",
|
|
79
|
+
"@powerhousedao/reactor-browser": "4.1.0-dev.95",
|
|
80
|
+
"document-model": "4.1.0-dev.95"
|
|
71
81
|
},
|
|
72
82
|
"scripts": {
|
|
73
83
|
"tsc": "tsc",
|