@things-factory/ai-dashboard 10.1.256 → 10.1.258
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/client/components/card-dialogs.ts +31 -24
- package/client/components/card-library.ts +20 -16
- package/client/components/dashboard-card.ts +33 -28
- package/client/components/proposal-preview.ts +15 -16
- package/client/pages/my-dashboard-page.ts +33 -32
- package/client/utils/card-api.ts +28 -39
- package/dist-client/components/card-dialogs.d.ts +9 -5
- package/dist-client/components/card-dialogs.js +25 -35
- package/dist-client/components/card-dialogs.js.map +1 -1
- package/dist-client/components/card-library.d.ts +3 -3
- package/dist-client/components/card-library.js +13 -22
- package/dist-client/components/card-library.js.map +1 -1
- package/dist-client/components/dashboard-card.d.ts +5 -6
- package/dist-client/components/dashboard-card.js +26 -46
- package/dist-client/components/dashboard-card.js.map +1 -1
- package/dist-client/components/proposal-preview.d.ts +3 -5
- package/dist-client/components/proposal-preview.js +13 -25
- package/dist-client/components/proposal-preview.js.map +1 -1
- package/dist-client/pages/my-dashboard-page.d.ts +8 -5
- package/dist-client/pages/my-dashboard-page.js +31 -44
- package/dist-client/pages/my-dashboard-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/card-api.d.ts +20 -35
- package/dist-client/utils/card-api.js +12 -23
- package/dist-client/utils/card-api.js.map +1 -1
- package/package.json +9 -9
|
@@ -43,37 +43,29 @@ export interface CardRun {
|
|
|
43
43
|
labelKey?: string;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
versions: (id: string) => Promise<{
|
|
52
|
-
version: number;
|
|
46
|
+
export interface ShareOptions {
|
|
47
|
+
domainId: string;
|
|
48
|
+
domainName: string;
|
|
49
|
+
departments: {
|
|
50
|
+
id: string;
|
|
53
51
|
name: string;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}[]>;
|
|
58
|
-
shareOptions: () => Promise<{
|
|
59
|
-
domainId: string;
|
|
60
|
-
domainName: string;
|
|
61
|
-
departments: {
|
|
62
|
-
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
}[];
|
|
65
|
-
peopleAvailable: boolean;
|
|
66
|
-
roles: {
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
note?: string | null;
|
|
70
|
-
}[];
|
|
71
|
-
}>;
|
|
72
|
-
people: (text: string) => Promise<{
|
|
52
|
+
}[];
|
|
53
|
+
peopleAvailable: boolean;
|
|
54
|
+
roles: {
|
|
73
55
|
id: string;
|
|
74
56
|
name: string;
|
|
75
|
-
note?: string;
|
|
76
|
-
}[]
|
|
57
|
+
note?: string | null;
|
|
58
|
+
}[];
|
|
59
|
+
}
|
|
60
|
+
export interface CardVersion {
|
|
61
|
+
version: number;
|
|
62
|
+
name: string;
|
|
63
|
+
definition: any;
|
|
64
|
+
creatorName?: string;
|
|
65
|
+
createdAt?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const CARD_FIELDS = "id name description version definition access ownerName copiedFromId placed shares { scope targetId targetName } updatedAt";
|
|
68
|
+
export declare const cardApi: {
|
|
77
69
|
saveProposal: (sessionId: string, proposalKey: string) => Promise<{
|
|
78
70
|
cardId: string;
|
|
79
71
|
version: number;
|
|
@@ -86,13 +78,6 @@ export declare const cardApi: {
|
|
|
86
78
|
remove: (id: string) => Promise<any>;
|
|
87
79
|
share: (id: string, shares: CardShare[]) => Promise<CardItem>;
|
|
88
80
|
place: (cardId: string) => Promise<any>;
|
|
89
|
-
unplace: (id: string) => Promise<any>;
|
|
90
|
-
arrange: (places: {
|
|
91
|
-
id: string;
|
|
92
|
-
order: number;
|
|
93
|
-
width: number;
|
|
94
|
-
height: number;
|
|
95
|
-
}[]) => Promise<any>;
|
|
96
81
|
};
|
|
97
82
|
/** Told when a card is saved, copied, placed or removed elsewhere - an open dashboard reads itself again. */
|
|
98
83
|
export declare const DASHBOARD_CHANGED = "ai-dashboard-changed";
|
|
@@ -1,35 +1,24 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* The
|
|
3
|
-
* conversation's card read the same fields.
|
|
2
|
+
* The dashboard's changes (server: card-resolver.ts), and the card fields the screens read - one place, so the page,
|
|
3
|
+
* the library and the conversation's card read the same fields. Each screen declares its own reads (ADR-0190).
|
|
4
4
|
*/
|
|
5
5
|
import gql from 'graphql-tag';
|
|
6
6
|
import { client } from '@operato/graphql';
|
|
7
|
-
const CARD_FIELDS = `id name description version definition access ownerName copiedFromId placed shares { scope targetId targetName } updatedAt`;
|
|
8
|
-
async function ask(document, variables = {}
|
|
9
|
-
const response = mutate
|
|
10
|
-
? await client.mutate({ mutation: gql(document), variables })
|
|
11
|
-
: await client.query({ query: gql(document), variables, fetchPolicy: 'no-cache' });
|
|
7
|
+
export const CARD_FIELDS = `id name description version definition access ownerName copiedFromId placed shares { scope targetId targetName } updatedAt`;
|
|
8
|
+
async function ask(document, variables = {}) {
|
|
9
|
+
const response = await client.mutate({ mutation: gql(document), variables });
|
|
12
10
|
if (response.errors?.length)
|
|
13
11
|
throw new Error(response.errors[0].message);
|
|
14
12
|
return response.data;
|
|
15
13
|
}
|
|
16
14
|
export const cardApi = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
saveProposal: async (sessionId, proposalKey) => (await ask(`mutation ($s: String!, $k: String!) { saveDashboardCardProposal(sessionId: $s, proposalKey: $k) }`, { s: sessionId, k: proposalKey }, true)).saveDashboardCardProposal,
|
|
25
|
-
rename: async (id, name) => (await ask(`mutation ($id: String!, $name: String!) { renameDashboardCard(id: $id, name: $name) { id } }`, { id, name }, true)).renameDashboardCard,
|
|
26
|
-
restore: async (id, version) => (await ask(`mutation ($id: String!, $v: Int!) { restoreDashboardCardVersion(id: $id, version: $v) { id } }`, { id, v: version }, true)).restoreDashboardCardVersion,
|
|
27
|
-
copy: async (id) => (await ask(`mutation ($id: String!) { copyDashboardCard(id: $id) { id } }`, { id }, true)).copyDashboardCard,
|
|
28
|
-
remove: async (id) => (await ask(`mutation ($id: String!) { deleteDashboardCard(id: $id) }`, { id }, true)).deleteDashboardCard,
|
|
29
|
-
share: async (id, shares) => (await ask(`mutation ($id: String!, $shares: [DashboardCardShareInput!]!) { shareDashboardCard(id: $id, shares: $shares) { ${CARD_FIELDS} } }`, { id, shares }, true)).shareDashboardCard,
|
|
30
|
-
place: async (cardId) => (await ask(`mutation ($id: String!) { placeDashboardCard(cardId: $id) { id } }`, { id: cardId }, true)).placeDashboardCard,
|
|
31
|
-
unplace: async (id) => (await ask(`mutation ($id: String!) { removeDashboardPlace(id: $id) }`, { id }, true)).removeDashboardPlace,
|
|
32
|
-
arrange: async (places) => (await ask(`mutation ($places: [DashboardPlaceInput!]!) { arrangeDashboard(places: $places) }`, { places }, true)).arrangeDashboard
|
|
15
|
+
saveProposal: async (sessionId, proposalKey) => (await ask(`mutation ($s: String!, $k: String!) { saveDashboardCardProposal(sessionId: $s, proposalKey: $k) }`, { s: sessionId, k: proposalKey })).saveDashboardCardProposal,
|
|
16
|
+
rename: async (id, name) => (await ask(`mutation ($id: String!, $name: String!) { renameDashboardCard(id: $id, name: $name) { id } }`, { id, name })).renameDashboardCard,
|
|
17
|
+
restore: async (id, version) => (await ask(`mutation ($id: String!, $v: Int!) { restoreDashboardCardVersion(id: $id, version: $v) { id } }`, { id, v: version })).restoreDashboardCardVersion,
|
|
18
|
+
copy: async (id) => (await ask(`mutation ($id: String!) { copyDashboardCard(id: $id) { id } }`, { id })).copyDashboardCard,
|
|
19
|
+
remove: async (id) => (await ask(`mutation ($id: String!) { deleteDashboardCard(id: $id) }`, { id })).deleteDashboardCard,
|
|
20
|
+
share: async (id, shares) => (await ask(`mutation ($id: String!, $shares: [DashboardCardShareInput!]!) { shareDashboardCard(id: $id, shares: $shares) { ${CARD_FIELDS} } }`, { id, shares })).shareDashboardCard,
|
|
21
|
+
place: async (cardId) => (await ask(`mutation ($id: String!) { placeDashboardCard(cardId: $id) { id } }`, { id: cardId })).placeDashboardCard
|
|
33
22
|
};
|
|
34
23
|
/** Told when a card is saved, copied, placed or removed elsewhere - an open dashboard reads itself again. */
|
|
35
24
|
export const DASHBOARD_CHANGED = 'ai-dashboard-changed';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-api.js","sourceRoot":"","sources":["../../client/utils/card-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"card-api.js","sourceRoot":"","sources":["../../client/utils/card-api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AA8DzC,MAAM,CAAC,MAAM,WAAW,GAAG,4HAA4H,CAAA;AAEvJ,KAAK,UAAU,GAAG,CAAI,QAAgB,EAAE,YAAqC,EAAE;IAC7E,MAAM,QAAQ,GAAQ,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;IACjF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IACxE,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,YAAY,EAAE,KAAK,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAE,CAC7D,CAAC,MAAM,GAAG,CAAM,mGAAmG,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,yBAKvJ;IACH,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,CAAM,8FAA8F,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,mBAAmB;IAC9L,OAAO,EAAE,KAAK,EAAE,EAAU,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,CAAM,gGAAgG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,2BAA2B;IAClN,IAAI,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,CAAM,+DAA+D,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB;IACvI,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,CAAM,0DAA0D,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB;IACtI,KAAK,EAAE,KAAK,EAAE,EAAU,EAAE,MAAmB,EAAE,EAAE,CAC/C,CAAC,MAAM,GAAG,CAAM,kHAAkH,WAAW,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,kBAA8B;IACtM,KAAK,EAAE,KAAK,EAAE,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,CAAM,oEAAoE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,kBAAkB;CAC3J,CAAA;AAED,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAA;AAEvD,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["/*\n * The dashboard's changes (server: card-resolver.ts), and the card fields the screens read - one place, so the page,\n * the library and the conversation's card read the same fields. Each screen declares its own reads (ADR-0190).\n */\nimport gql from 'graphql-tag'\n\nimport { client } from '@operato/graphql'\n\nexport interface CardShare {\n scope: 'USER' | 'DEPARTMENT' | 'ROLE' | 'DOMAIN'\n targetId: string\n targetName?: string | null\n}\n\nexport interface CardItem {\n id: string\n name: string\n description?: string | null\n version: number\n definition: any\n access: 'owner' | 'shared'\n ownerName?: string | null\n copiedFromId?: string | null\n placed: boolean\n shares?: CardShare[] | null\n updatedAt?: string | null\n}\n\nexport interface PlaceItem {\n id: string\n order: number\n width: number\n height: number\n card: CardItem\n}\n\nexport interface CardCounts {\n read: number\n total: number\n complete: boolean\n shaped: number\n shown: number\n}\n\nexport interface CardRun {\n block?: any\n issue?: { code: string; params?: Record<string, unknown> }\n counts?: CardCounts\n asOf: string\n source?: { key: string; labelKey?: string }\n}\n\nexport interface ShareOptions {\n domainId: string\n domainName: string\n departments: { id: string; name: string }[]\n peopleAvailable: boolean\n roles: { id: string; name: string; note?: string | null }[]\n}\n\nexport interface CardVersion {\n version: number\n name: string\n definition: any\n creatorName?: string\n createdAt?: string\n}\n\nexport const CARD_FIELDS = `id name description version definition access ownerName copiedFromId placed shares { scope targetId targetName } updatedAt`\n\nasync function ask<T>(document: string, variables: Record<string, unknown> = {}): Promise<T> {\n const response: any = await client.mutate({ mutation: gql(document), variables })\n if (response.errors?.length) throw new Error(response.errors[0].message)\n return response.data\n}\n\nexport const cardApi = {\n saveProposal: async (sessionId: string, proposalKey: string) =>\n (await ask<any>(`mutation ($s: String!, $k: String!) { saveDashboardCardProposal(sessionId: $s, proposalKey: $k) }`, { s: sessionId, k: proposalKey })).saveDashboardCardProposal as {\n cardId: string\n version: number\n placeId: string\n again?: boolean\n },\n rename: async (id: string, name: string) => (await ask<any>(`mutation ($id: String!, $name: String!) { renameDashboardCard(id: $id, name: $name) { id } }`, { id, name })).renameDashboardCard,\n restore: async (id: string, version: number) => (await ask<any>(`mutation ($id: String!, $v: Int!) { restoreDashboardCardVersion(id: $id, version: $v) { id } }`, { id, v: version })).restoreDashboardCardVersion,\n copy: async (id: string) => (await ask<any>(`mutation ($id: String!) { copyDashboardCard(id: $id) { id } }`, { id })).copyDashboardCard,\n remove: async (id: string) => (await ask<any>(`mutation ($id: String!) { deleteDashboardCard(id: $id) }`, { id })).deleteDashboardCard,\n share: async (id: string, shares: CardShare[]) =>\n (await ask<any>(`mutation ($id: String!, $shares: [DashboardCardShareInput!]!) { shareDashboardCard(id: $id, shares: $shares) { ${CARD_FIELDS} } }`, { id, shares })).shareDashboardCard as CardItem,\n place: async (cardId: string) => (await ask<any>(`mutation ($id: String!) { placeDashboardCard(cardId: $id) { id } }`, { id: cardId })).placeDashboardCard\n}\n\n/** Told when a card is saved, copied, placed or removed elsewhere - an open dashboard reads itself again. */\nexport const DASHBOARD_CHANGED = 'ai-dashboard-changed'\n\nexport function dashboardChanged(): void {\n window.dispatchEvent(new CustomEvent(DASHBOARD_CHANGED))\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/ai-dashboard",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.258",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@material/web": "^2.0.0",
|
|
30
|
-
"@operato/graphql": "^10.29.
|
|
30
|
+
"@operato/graphql": "^10.29.69",
|
|
31
31
|
"@operato/i18n": "^10.0.0",
|
|
32
32
|
"@operato/layout": "^10.29.49",
|
|
33
33
|
"@operato/popup": "^10.29.39",
|
|
34
|
-
"@operato/shell": "^10.29.
|
|
34
|
+
"@operato/shell": "^10.29.69",
|
|
35
35
|
"@operato/styles": "^10.0.0",
|
|
36
|
-
"@things-factory/ai-assistant": "^10.1.
|
|
37
|
-
"@things-factory/ai-client-base": "^10.1.
|
|
38
|
-
"@things-factory/auth-base": "^10.1.
|
|
36
|
+
"@things-factory/ai-assistant": "^10.1.258",
|
|
37
|
+
"@things-factory/ai-client-base": "^10.1.258",
|
|
38
|
+
"@things-factory/auth-base": "^10.1.258",
|
|
39
39
|
"@things-factory/env": "^10.1.149",
|
|
40
|
-
"@things-factory/organization": "^10.1.
|
|
41
|
-
"@things-factory/shell": "^10.1.
|
|
40
|
+
"@things-factory/organization": "^10.1.258",
|
|
41
|
+
"@things-factory/shell": "^10.1.258",
|
|
42
42
|
"graphql-scalars": "^1.22.0",
|
|
43
43
|
"graphql-tag": "^2.12.6",
|
|
44
44
|
"lit": "^3.1.2"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"copyfiles": "^2.4.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c7b7e3b4e9aa1b36a246ccee312a4124a50924dd"
|
|
50
50
|
}
|