@manta-eu/client 0.1.0 → 0.1.2
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/README.md +43 -0
- package/dist/generated/graphql.d.ts +169 -3
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +73 -0
- package/dist/graphql-clients.d.ts +2 -2
- package/dist/graphql-clients.d.ts.map +1 -1
- package/dist/graphql-clients.js +4 -4
- package/package.json +8 -12
- package/dist/shared/datastore-route-table.d.ts +0 -36
- package/dist/shared/datastore-route-table.d.ts.map +0 -1
- package/dist/shared/datastore-route-table.js +0 -43
- package/dist/shared/spa-routes.d.ts +0 -3
- package/dist/shared/spa-routes.d.ts.map +0 -1
- package/dist/shared/spa-routes.js +0 -5
|
@@ -207,6 +207,10 @@ export var GQLSelfServeInvitationOutcome;
|
|
|
207
207
|
GQLSelfServeInvitationOutcome["Failed"] = "FAILED";
|
|
208
208
|
GQLSelfServeInvitationOutcome["Invited"] = "INVITED";
|
|
209
209
|
})(GQLSelfServeInvitationOutcome || (GQLSelfServeInvitationOutcome = {}));
|
|
210
|
+
export var GQLSetupAccountUnavailableReason;
|
|
211
|
+
(function (GQLSetupAccountUnavailableReason) {
|
|
212
|
+
GQLSetupAccountUnavailableReason["InsufficientPermissions"] = "INSUFFICIENT_PERMISSIONS";
|
|
213
|
+
})(GQLSetupAccountUnavailableReason || (GQLSetupAccountUnavailableReason = {}));
|
|
210
214
|
export var GQLShaclSeverity;
|
|
211
215
|
(function (GQLShaclSeverity) {
|
|
212
216
|
GQLShaclSeverity["Info"] = "INFO";
|
|
@@ -487,6 +491,31 @@ export const useCreateMemoryMutation = (client, options, headers) => {
|
|
|
487
491
|
...options,
|
|
488
492
|
});
|
|
489
493
|
};
|
|
494
|
+
export const DashSetupConnectDocument = `
|
|
495
|
+
mutation DashSetupConnect($folderIds: [String!]!) {
|
|
496
|
+
dashSetupConnect(folderIds: $folderIds) {
|
|
497
|
+
state
|
|
498
|
+
folders {
|
|
499
|
+
id
|
|
500
|
+
name
|
|
501
|
+
parent
|
|
502
|
+
position
|
|
503
|
+
}
|
|
504
|
+
lastError {
|
|
505
|
+
severity
|
|
506
|
+
title
|
|
507
|
+
message
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
`;
|
|
512
|
+
export const useDashSetupConnectMutation = (client, options, headers) => {
|
|
513
|
+
return useMutation({
|
|
514
|
+
mutationKey: ["DashSetupConnect"],
|
|
515
|
+
mutationFn: (variables) => fetcher(client, DashSetupConnectDocument, variables, headers)(),
|
|
516
|
+
...options,
|
|
517
|
+
});
|
|
518
|
+
};
|
|
490
519
|
export const DeleteActionPlanDocument = `
|
|
491
520
|
mutation DeleteActionPlan($input: DeleteActionPlanInput!) {
|
|
492
521
|
deleteActionPlan(input: $input) {
|
|
@@ -885,6 +914,9 @@ export const MetaSetupConnectDocument = `
|
|
|
885
914
|
id
|
|
886
915
|
name
|
|
887
916
|
parent
|
|
917
|
+
externalId
|
|
918
|
+
isConnectable
|
|
919
|
+
unavailableReason
|
|
888
920
|
}
|
|
889
921
|
lastError {
|
|
890
922
|
severity
|
|
@@ -1503,6 +1535,10 @@ export const ConnectedAccountsDocument = `
|
|
|
1503
1535
|
id
|
|
1504
1536
|
integration
|
|
1505
1537
|
externalId
|
|
1538
|
+
includedResources {
|
|
1539
|
+
id
|
|
1540
|
+
name
|
|
1541
|
+
}
|
|
1506
1542
|
}
|
|
1507
1543
|
}
|
|
1508
1544
|
`;
|
|
@@ -1624,6 +1660,40 @@ useSuspenseCurrentFactValueQuery.getKey = (variables) => [
|
|
|
1624
1660
|
"CurrentFactValueSuspense",
|
|
1625
1661
|
variables,
|
|
1626
1662
|
];
|
|
1663
|
+
export const DashSetupProgressDocument = `
|
|
1664
|
+
query DashSetupProgress {
|
|
1665
|
+
dashSetupProgress {
|
|
1666
|
+
state
|
|
1667
|
+
folders {
|
|
1668
|
+
id
|
|
1669
|
+
name
|
|
1670
|
+
parent
|
|
1671
|
+
position
|
|
1672
|
+
}
|
|
1673
|
+
lastError {
|
|
1674
|
+
severity
|
|
1675
|
+
title
|
|
1676
|
+
message
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
`;
|
|
1681
|
+
export const useDashSetupProgressQuery = (client, variables, options, headers) => {
|
|
1682
|
+
return useQuery({
|
|
1683
|
+
queryKey: variables === undefined ? ["DashSetupProgress"] : ["DashSetupProgress", variables],
|
|
1684
|
+
queryFn: fetcher(client, DashSetupProgressDocument, variables, headers),
|
|
1685
|
+
...options,
|
|
1686
|
+
});
|
|
1687
|
+
};
|
|
1688
|
+
useDashSetupProgressQuery.getKey = (variables) => variables === undefined ? ["DashSetupProgress"] : ["DashSetupProgress", variables];
|
|
1689
|
+
export const useSuspenseDashSetupProgressQuery = (client, variables, options, headers) => {
|
|
1690
|
+
return useSuspenseQuery({
|
|
1691
|
+
queryKey: variables === undefined ? ["DashSetupProgressSuspense"] : ["DashSetupProgressSuspense", variables],
|
|
1692
|
+
queryFn: fetcher(client, DashSetupProgressDocument, variables, headers),
|
|
1693
|
+
...options,
|
|
1694
|
+
});
|
|
1695
|
+
};
|
|
1696
|
+
useSuspenseDashSetupProgressQuery.getKey = (variables) => variables === undefined ? ["DashSetupProgressSuspense"] : ["DashSetupProgressSuspense", variables];
|
|
1627
1697
|
export const DatastoreProvisioningStatusesDocument = `
|
|
1628
1698
|
query DatastoreProvisioningStatuses($datastoreIds: [String!]!) {
|
|
1629
1699
|
datastoreProvisioningStatuses(datastoreIds: $datastoreIds) {
|
|
@@ -2131,6 +2201,9 @@ export const MetaSetupProgressDocument = `
|
|
|
2131
2201
|
id
|
|
2132
2202
|
name
|
|
2133
2203
|
parent
|
|
2204
|
+
externalId
|
|
2205
|
+
isConnectable
|
|
2206
|
+
unavailableReason
|
|
2134
2207
|
}
|
|
2135
2208
|
lastError {
|
|
2136
2209
|
severity
|
|
@@ -2,8 +2,8 @@ import { GraphQLClient } from "graphql-request";
|
|
|
2
2
|
export declare const operatorRoleHeaders: {
|
|
3
3
|
readonly "x-hasura-role": "operator";
|
|
4
4
|
};
|
|
5
|
-
export declare const
|
|
6
|
-
export declare function
|
|
5
|
+
export declare const v1GQLPath = "/v1/graphql";
|
|
6
|
+
export declare function v1GraphQLClient(baseUrl: URL): GraphQLClient;
|
|
7
7
|
export declare const mantaGQLPath = "/graphql";
|
|
8
8
|
export declare function mantaGraphQLClient(baseUrl: URL, onUnauthorized?: () => void, headers?: Record<string, string>): GraphQLClient;
|
|
9
9
|
//# sourceMappingURL=graphql-clients.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-clients.d.ts","sourceRoot":"","sources":["../src/graphql-clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAI7D,eAAO,MAAM,mBAAmB;;CAA2C,CAAC;AAE5E,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"graphql-clients.d.ts","sourceRoot":"","sources":["../src/graphql-clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAI7D,eAAO,MAAM,mBAAmB;;CAA2C,CAAC;AAE5E,eAAO,MAAM,SAAS,gBAAgB,CAAC;AAGvC,wBAAgB,eAAe,CAAC,OAAO,EAAE,GAAG,iBAK3C;AAED,eAAO,MAAM,YAAY,aAAa,CAAC;AAGvC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iBAa7G"}
|
package/dist/graphql-clients.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ClientError, GraphQLClient } from "graphql-request";
|
|
2
|
-
//
|
|
2
|
+
// Default client constructors for the v1 and Manta GraphQL APIs
|
|
3
3
|
export const operatorRoleHeaders = { "x-hasura-role": "operator" };
|
|
4
|
-
export const
|
|
4
|
+
export const v1GQLPath = "/v1/graphql";
|
|
5
5
|
// To use custom keycloak headers, use headers: { "X-Keycloak-Token": keycloakToken } instead of credentials
|
|
6
|
-
export function
|
|
7
|
-
const url = new URL(
|
|
6
|
+
export function v1GraphQLClient(baseUrl) {
|
|
7
|
+
const url = new URL(v1GQLPath, baseUrl);
|
|
8
8
|
return new GraphQLClient(url.toString(), {
|
|
9
9
|
credentials: "include",
|
|
10
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manta-eu/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "The Manta GraphQL contract and the typed React Query hooks generated from it",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -42,15 +42,13 @@
|
|
|
42
42
|
"uuid": "^13.0.0",
|
|
43
43
|
"whatwg-mimetype": "^5.0.0",
|
|
44
44
|
"zod": "^4.5.0",
|
|
45
|
-
"@manta-eu/
|
|
46
|
-
"@manta-eu/
|
|
47
|
-
"@manta-eu/
|
|
48
|
-
"@manta-eu/
|
|
45
|
+
"@manta-eu/datalog-parser": "0.1.2",
|
|
46
|
+
"@manta-eu/ldo": "0.1.2",
|
|
47
|
+
"@manta-eu/lib": "0.1.2",
|
|
48
|
+
"@manta-eu/rdf-lib": "0.1.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@tanstack/react-query": "^5.100.10"
|
|
52
|
-
"react": "^19.2.3",
|
|
53
|
-
"react-router": "^7.9.6"
|
|
51
|
+
"@tanstack/react-query": "^5.100.10"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@graphql-codegen/cli": "^6.0.0",
|
|
@@ -58,11 +56,9 @@
|
|
|
58
56
|
"@graphql-codegen/typescript-operations": "^5.0.0",
|
|
59
57
|
"@graphql-codegen/typescript-react-query": "^6.1.1",
|
|
60
58
|
"@types/ramda": "^0.31.1",
|
|
61
|
-
"@types/react": "^19.2.7",
|
|
62
59
|
"@types/whatwg-mimetype": "^5.0.0",
|
|
63
60
|
"prettier": "^3.6.2",
|
|
64
|
-
"
|
|
65
|
-
"react-router": "^7.9.6",
|
|
61
|
+
"rimraf": "^6.1.3",
|
|
66
62
|
"tsc-alias": "^1.9.5",
|
|
67
63
|
"typescript": "^5.9.3",
|
|
68
64
|
"vitest": "^3.0.0"
|
|
@@ -85,7 +81,7 @@
|
|
|
85
81
|
}
|
|
86
82
|
},
|
|
87
83
|
"scripts": {
|
|
88
|
-
"build": "graphql-codegen -c codegen.ts && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths",
|
|
84
|
+
"build": "rimraf dist && graphql-codegen -c codegen.ts && tsc --project tsconfig.build.json && tsc-alias --project tsconfig.build.json --resolve-full-paths",
|
|
89
85
|
"types": "tsc --noEmit",
|
|
90
86
|
"test": "vitest --run --passWithNoTests",
|
|
91
87
|
"check": "./verify-generated.sh"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type RouteElements = {
|
|
3
|
-
Chat: ReactNode;
|
|
4
|
-
EnterDatastore?: ReactNode;
|
|
5
|
-
Plans?: ReactNode;
|
|
6
|
-
Rules?: ReactNode;
|
|
7
|
-
Explain?: ReactNode;
|
|
8
|
-
Streams?: ReactNode;
|
|
9
|
-
Datastores?: ReactNode;
|
|
10
|
-
Memories?: ReactNode;
|
|
11
|
-
Activity?: ReactNode;
|
|
12
|
-
ActivityDetail?: ReactNode;
|
|
13
|
-
Integrations?: ReactNode;
|
|
14
|
-
Team?: ReactNode;
|
|
15
|
-
DataExplorerLayout?: ReactNode;
|
|
16
|
-
DataExplorerIndex?: ReactNode;
|
|
17
|
-
DataExplorerRecent?: ReactNode;
|
|
18
|
-
DataExplorerCoverage?: ReactNode;
|
|
19
|
-
DataExplorerPrefix?: ReactNode;
|
|
20
|
-
DataExplorerType?: ReactNode;
|
|
21
|
-
DataEntity?: ReactNode;
|
|
22
|
-
DataDetail?: ReactNode;
|
|
23
|
-
NotFound?: ReactNode;
|
|
24
|
-
};
|
|
25
|
-
export declare function notFoundElement(elements: RouteElements): ReactNode;
|
|
26
|
-
export type RouteDefinition = {
|
|
27
|
-
path: string;
|
|
28
|
-
render: (elements: RouteElements) => ReactNode;
|
|
29
|
-
children?: RouteDefinition[];
|
|
30
|
-
};
|
|
31
|
-
export declare const notFoundRoutePath = "*";
|
|
32
|
-
export declare const globalRoutes: RouteDefinition[];
|
|
33
|
-
export declare const datastoreRoutes: RouteDefinition[];
|
|
34
|
-
export declare const datastoreRoutePaths: string[];
|
|
35
|
-
export declare const globalRoutePaths: string[];
|
|
36
|
-
//# sourceMappingURL=datastore-route-table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datastore-route-table.d.ts","sourceRoot":"","sources":["../../src/shared/datastore-route-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,oBAAoB,CAAC,EAAE,SAAS,CAAC;IACjC,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,aAEtD;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,SAAS,CAAC;IAC/C,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,YAAY,EAAE,eAAe,EAEzC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAAe,EA4B5C,CAAC;AAMF,eAAO,MAAM,mBAAmB,EAAE,MAAM,EAEvC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAA+B,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export function notFoundElement(elements) {
|
|
2
|
-
return elements.NotFound || elements.Chat;
|
|
3
|
-
}
|
|
4
|
-
export const notFoundRoutePath = "*";
|
|
5
|
-
export const globalRoutes = [
|
|
6
|
-
{ path: "/datastores", render: (e) => e.Datastores || notFoundElement(e) },
|
|
7
|
-
];
|
|
8
|
-
export const datastoreRoutes = [
|
|
9
|
-
{ path: "/", render: (e) => e.Chat },
|
|
10
|
-
{ path: "/plans", render: (e) => e.Plans || e.Chat },
|
|
11
|
-
{ path: "/plans/:planName", render: (e) => e.Plans || e.Chat },
|
|
12
|
-
{ path: "/rules", render: (e) => e.Rules || e.Chat },
|
|
13
|
-
{ path: "/rules/:ruleName", render: (e) => e.Rules || e.Chat },
|
|
14
|
-
{ path: "/explain", render: (e) => e.Explain || e.Chat },
|
|
15
|
-
{ path: "/streams", render: (e) => e.Streams || notFoundElement(e) },
|
|
16
|
-
{ path: "/memories", render: (e) => e.Memories || e.Chat },
|
|
17
|
-
{ path: "/activity", render: (e) => e.Activity || notFoundElement(e) },
|
|
18
|
-
{ path: "/activity/:id", render: (e) => e.ActivityDetail || notFoundElement(e) },
|
|
19
|
-
{ path: "/integrations", render: (e) => e.Integrations || e.Chat },
|
|
20
|
-
{ path: "/team", render: (e) => e.Team || notFoundElement(e) },
|
|
21
|
-
{
|
|
22
|
-
path: "/data",
|
|
23
|
-
render: (e) => e.DataExplorerLayout || e.Chat,
|
|
24
|
-
children: [
|
|
25
|
-
{ path: "/data", render: (e) => e.DataExplorerIndex || notFoundElement(e) },
|
|
26
|
-
{ path: "/data/recent", render: (e) => e.DataExplorerRecent || notFoundElement(e) },
|
|
27
|
-
{ path: "/data/coverage", render: (e) => e.DataExplorerCoverage || notFoundElement(e) },
|
|
28
|
-
{ path: "/data/entity/:iri", render: (e) => e.DataEntity || notFoundElement(e) },
|
|
29
|
-
{ path: "/data/:prefix", render: (e) => e.DataExplorerPrefix || notFoundElement(e) },
|
|
30
|
-
{ path: "/data/:prefix/:type", render: (e) => e.DataExplorerType || notFoundElement(e) },
|
|
31
|
-
{ path: "/data/:prefix/:type/:id", render: (e) => e.DataDetail || notFoundElement(e) },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
{ path: "/chat/:chatId", render: (e) => e.Chat },
|
|
35
|
-
{ path: notFoundRoutePath, render: notFoundElement },
|
|
36
|
-
];
|
|
37
|
-
function flattenPaths(routes) {
|
|
38
|
-
return routes.flatMap((route) => [route.path, ...(route.children ? flattenPaths(route.children) : [])]);
|
|
39
|
-
}
|
|
40
|
-
export const datastoreRoutePaths = [
|
|
41
|
-
...new Set(flattenPaths(datastoreRoutes).filter((path) => path !== "/" && path !== notFoundRoutePath)),
|
|
42
|
-
];
|
|
43
|
-
export const globalRoutePaths = flattenPaths(globalRoutes);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa-routes.d.ts","sourceRoot":"","sources":["../../src/shared/spa-routes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,UAAwC,CAAC;AAErE,eAAO,MAAM,eAAe,UAAoD,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const errorRoutePath = "/error";
|
|
2
|
-
import { datastoreRoutePaths, globalRoutePaths } from "./datastore-route-table.js";
|
|
3
|
-
// A wildcard instead of scopedSpaRoutes would answer /d/<id>/graphql, and every typo, with index.html.
|
|
4
|
-
export const globalSpaRoutes = [errorRoutePath, ...globalRoutePaths];
|
|
5
|
-
export const scopedSpaRoutes = ["", "/", errorRoutePath, ...datastoreRoutePaths];
|