@things-factory/ai-dashboard 0.0.0-stage → 10.1.213
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/bootstrap.ts +25 -0
- package/client/components/card-dialogs.ts +422 -0
- package/client/components/card-library.ts +272 -0
- package/client/components/dashboard-card.ts +450 -0
- package/client/components/proposal-preview.ts +96 -0
- package/client/index.ts +3 -0
- package/client/pages/my-dashboard-page.ts +371 -0
- package/client/route.ts +8 -0
- package/client/tsconfig.json +13 -0
- package/client/utils/card-api.ts +110 -0
- package/client/utils/card-words.ts +80 -0
- package/dist-client/bootstrap.d.ts +2 -0
- package/dist-client/bootstrap.js +24 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/card-dialogs.d.ts +59 -0
- package/dist-client/components/card-dialogs.js +457 -0
- package/dist-client/components/card-dialogs.js.map +1 -0
- package/dist-client/components/card-library.d.ts +23 -0
- package/dist-client/components/card-library.js +276 -0
- package/dist-client/components/card-library.js.map +1 -0
- package/dist-client/components/dashboard-card.d.ts +35 -0
- package/dist-client/components/dashboard-card.js +490 -0
- package/dist-client/components/dashboard-card.js.map +1 -0
- package/dist-client/components/proposal-preview.d.ts +17 -0
- package/dist-client/components/proposal-preview.js +111 -0
- package/dist-client/components/proposal-preview.js.map +1 -0
- package/dist-client/index.d.ts +3 -0
- package/dist-client/index.js +4 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/my-dashboard-page.d.ts +46 -0
- package/dist-client/pages/my-dashboard-page.js +376 -0
- package/dist-client/pages/my-dashboard-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +9 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/utils/card-api.d.ts +95 -0
- package/dist-client/utils/card-api.js +39 -0
- package/dist-client/utils/card-api.js.map +1 -0
- package/dist-client/utils/card-words.d.ts +24 -0
- package/dist-client/utils/card-words.js +72 -0
- package/dist-client/utils/card-words.js.map +1 -0
- package/dist-server/index.d.ts +11 -0
- package/dist-server/index.js +19 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/role-tasks.d.ts +2 -0
- package/dist-server/role-tasks.js +13 -0
- package/dist-server/role-tasks.js.map +1 -0
- package/dist-server/service/card/card-access.d.ts +32 -0
- package/dist-server/service/card/card-access.js +45 -0
- package/dist-server/service/card/card-access.js.map +1 -0
- package/dist-server/service/card/card-definition.d.ts +100 -0
- package/dist-server/service/card/card-definition.js +237 -0
- package/dist-server/service/card/card-definition.js.map +1 -0
- package/dist-server/service/card/card-names.d.ts +5 -0
- package/dist-server/service/card/card-names.js +9 -0
- package/dist-server/service/card/card-names.js.map +1 -0
- package/dist-server/service/card/card-proposal.d.ts +21 -0
- package/dist-server/service/card/card-proposal.js +28 -0
- package/dist-server/service/card/card-proposal.js.map +1 -0
- package/dist-server/service/card/card-resolver.d.ts +29 -0
- package/dist-server/service/card/card-resolver.js +541 -0
- package/dist-server/service/card/card-resolver.js.map +1 -0
- package/dist-server/service/card/card-run.d.ts +48 -0
- package/dist-server/service/card/card-run.js +239 -0
- package/dist-server/service/card/card-run.js.map +1 -0
- package/dist-server/service/card/card-tool.d.ts +218 -0
- package/dist-server/service/card/card-tool.js +313 -0
- package/dist-server/service/card/card-tool.js.map +1 -0
- package/dist-server/service/card/card-types.d.ts +56 -0
- package/dist-server/service/card/card-types.js +212 -0
- package/dist-server/service/card/card-types.js.map +1 -0
- package/dist-server/service/card/dashboard-card.d.ts +87 -0
- package/dist-server/service/card/dashboard-card.js +388 -0
- package/dist-server/service/card/dashboard-card.js.map +1 -0
- package/dist-server/service/card/long-text.d.ts +6 -0
- package/dist-server/service/card/long-text.js +28 -0
- package/dist-server/service/card/long-text.js.map +1 -0
- package/dist-server/service/index.d.ts +12 -0
- package/dist-server/service/index.js +24 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +47 -4
- package/server/index.ts +16 -0
- package/server/role-tasks.ts +12 -0
- package/server/service/card/card-access.test.ts +138 -0
- package/server/service/card/card-access.ts +53 -0
- package/server/service/card/card-definition.ts +298 -0
- package/server/service/card/card-names.ts +5 -0
- package/server/service/card/card-proposal.ts +37 -0
- package/server/service/card/card-resolver.ts +434 -0
- package/server/service/card/card-run.test.ts +237 -0
- package/server/service/card/card-run.ts +288 -0
- package/server/service/card/card-tool.ts +299 -0
- package/server/service/card/card-types.ts +145 -0
- package/server/service/card/dashboard-card.ts +301 -0
- package/server/service/card/long-text.ts +25 -0
- package/server/service/index.ts +16 -0
- package/test/translations.test.ts +42 -0
- package/things-factory.config.js +8 -0
- package/translations/en.json +126 -0
- package/translations/es.json +126 -0
- package/translations/ja.json +126 -0
- package/translations/ko.json +126 -0
- package/translations/ms.json +126 -0
- package/translations/zh.json +126 -0
- package/tsconfig.json +9 -0
- package/README.md +0 -3
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DashboardCardPlace = exports.DashboardCardShare = exports.DashboardCardVersion = exports.DashboardCard = exports.DashboardCardShareScope = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/*
|
|
6
|
+
* The four tables of the dashboard cards (ADR-0160 decisions 7, 8, 10): a card and its versions, who it is shared
|
|
7
|
+
* with, and where each person placed the cards they use. A card holds its definition only - never values.
|
|
8
|
+
*/
|
|
9
|
+
const typeorm_1 = require("typeorm");
|
|
10
|
+
const type_graphql_1 = require("type-graphql");
|
|
11
|
+
const graphql_scalars_1 = require("graphql-scalars");
|
|
12
|
+
const shell_1 = require("@things-factory/shell");
|
|
13
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
14
|
+
const long_text_js_1 = require("./long-text.js");
|
|
15
|
+
/** Who a card is shared with besides its owner - nobody when it has no share row. */
|
|
16
|
+
var DashboardCardShareScope;
|
|
17
|
+
(function (DashboardCardShareScope) {
|
|
18
|
+
/** One person, by user id. */
|
|
19
|
+
DashboardCardShareScope["USER"] = "USER";
|
|
20
|
+
/** The active members of one department, by department id (organization). */
|
|
21
|
+
DashboardCardShareScope["DEPARTMENT"] = "DEPARTMENT";
|
|
22
|
+
/** Everyone in the domain. */
|
|
23
|
+
DashboardCardShareScope["DOMAIN"] = "DOMAIN";
|
|
24
|
+
})(DashboardCardShareScope || (exports.DashboardCardShareScope = DashboardCardShareScope = {}));
|
|
25
|
+
(0, type_graphql_1.registerEnumType)(DashboardCardShareScope, { name: 'DashboardCardShareScope', description: 'Who a dashboard card is shared with: a person, a department or the whole domain.' });
|
|
26
|
+
let DashboardCard = class DashboardCard {
|
|
27
|
+
get definition() {
|
|
28
|
+
return (0, long_text_js_1.parsedJson)(this.definitionJson);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.DashboardCard = DashboardCard;
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
34
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Card id.' }),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], DashboardCard.prototype, "id", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
39
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain the card is in.' }),
|
|
40
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
41
|
+
], DashboardCard.prototype, "domain", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.RelationId)((card) => card.domain),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], DashboardCard.prototype, "domainId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)(),
|
|
48
|
+
(0, type_graphql_1.Field)({ description: 'The card name.' }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], DashboardCard.prototype, "name", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'What the card shows, in a line.' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], DashboardCard.prototype, "description", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User),
|
|
58
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The one who made the card - the only one who changes it.' }),
|
|
59
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
60
|
+
], DashboardCard.prototype, "owner", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.RelationId)((card) => card.owner),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], DashboardCard.prototype, "ownerId", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.Column)('int'),
|
|
67
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The current version - one more each time the definition or name changes.' }),
|
|
68
|
+
tslib_1.__metadata("design:type", Number)
|
|
69
|
+
], DashboardCard.prototype, "version", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ ...long_text_js_1.LONG_TEXT, nullable: false }),
|
|
72
|
+
tslib_1.__metadata("design:type", String)
|
|
73
|
+
], DashboardCard.prototype, "definitionJson", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, type_graphql_1.Field)(type => graphql_scalars_1.GraphQLJSON, { description: 'The current definition - what is read, how its rows are shaped and drawn.' }),
|
|
76
|
+
tslib_1.__metadata("design:type", Object),
|
|
77
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
78
|
+
], DashboardCard.prototype, "definition", null);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
81
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The card this one was copied from.' }),
|
|
82
|
+
tslib_1.__metadata("design:type", String)
|
|
83
|
+
], DashboardCard.prototype, "copiedFromId", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
86
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who created the row.' }),
|
|
87
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
88
|
+
], DashboardCard.prototype, "creator", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
(0, typeorm_1.RelationId)((card) => card.creator),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], DashboardCard.prototype, "creatorId", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
95
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed the row last.' }),
|
|
96
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
97
|
+
], DashboardCard.prototype, "updater", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_1.RelationId)((card) => card.updater),
|
|
100
|
+
tslib_1.__metadata("design:type", String)
|
|
101
|
+
], DashboardCard.prototype, "updaterId", void 0);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
104
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the card was made.' }),
|
|
105
|
+
tslib_1.__metadata("design:type", Date)
|
|
106
|
+
], DashboardCard.prototype, "createdAt", void 0);
|
|
107
|
+
tslib_1.__decorate([
|
|
108
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
109
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the card was changed last.' }),
|
|
110
|
+
tslib_1.__metadata("design:type", Date)
|
|
111
|
+
], DashboardCard.prototype, "updatedAt", void 0);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
114
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the card was deleted.' }),
|
|
115
|
+
tslib_1.__metadata("design:type", Date)
|
|
116
|
+
], DashboardCard.prototype, "deletedAt", void 0);
|
|
117
|
+
exports.DashboardCard = DashboardCard = tslib_1.__decorate([
|
|
118
|
+
(0, typeorm_1.Entity)('ai_dashboard_cards'),
|
|
119
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_0', (card) => [card.domain, card.owner]),
|
|
120
|
+
(0, type_graphql_1.ObjectType)({ description: 'A dashboard card - a definition made with the assistant, run as the viewer when drawn.' })
|
|
121
|
+
], DashboardCard);
|
|
122
|
+
let DashboardCardVersion = class DashboardCardVersion {
|
|
123
|
+
get definition() {
|
|
124
|
+
return (0, long_text_js_1.parsedJson)(this.definitionJson);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
exports.DashboardCardVersion = DashboardCardVersion;
|
|
128
|
+
tslib_1.__decorate([
|
|
129
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
130
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Version row id.' }),
|
|
131
|
+
tslib_1.__metadata("design:type", String)
|
|
132
|
+
], DashboardCardVersion.prototype, "id", void 0);
|
|
133
|
+
tslib_1.__decorate([
|
|
134
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
135
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
|
|
136
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
137
|
+
], DashboardCardVersion.prototype, "domain", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, typeorm_1.RelationId)((one) => one.domain),
|
|
140
|
+
tslib_1.__metadata("design:type", String)
|
|
141
|
+
], DashboardCardVersion.prototype, "domainId", void 0);
|
|
142
|
+
tslib_1.__decorate([
|
|
143
|
+
(0, typeorm_1.ManyToOne)(type => DashboardCard, { onDelete: 'CASCADE' }),
|
|
144
|
+
tslib_1.__metadata("design:type", DashboardCard)
|
|
145
|
+
], DashboardCardVersion.prototype, "card", void 0);
|
|
146
|
+
tslib_1.__decorate([
|
|
147
|
+
(0, typeorm_1.RelationId)((one) => one.card),
|
|
148
|
+
(0, type_graphql_1.Field)({ description: 'The card.' }),
|
|
149
|
+
tslib_1.__metadata("design:type", String)
|
|
150
|
+
], DashboardCardVersion.prototype, "cardId", void 0);
|
|
151
|
+
tslib_1.__decorate([
|
|
152
|
+
(0, typeorm_1.Column)('int'),
|
|
153
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The version number.' }),
|
|
154
|
+
tslib_1.__metadata("design:type", Number)
|
|
155
|
+
], DashboardCardVersion.prototype, "version", void 0);
|
|
156
|
+
tslib_1.__decorate([
|
|
157
|
+
(0, typeorm_1.Column)(),
|
|
158
|
+
(0, type_graphql_1.Field)({ description: 'The card name in this version.' }),
|
|
159
|
+
tslib_1.__metadata("design:type", String)
|
|
160
|
+
], DashboardCardVersion.prototype, "name", void 0);
|
|
161
|
+
tslib_1.__decorate([
|
|
162
|
+
(0, typeorm_1.Column)({ ...long_text_js_1.LONG_TEXT, nullable: false }),
|
|
163
|
+
tslib_1.__metadata("design:type", String)
|
|
164
|
+
], DashboardCardVersion.prototype, "definitionJson", void 0);
|
|
165
|
+
tslib_1.__decorate([
|
|
166
|
+
(0, type_graphql_1.Field)(type => graphql_scalars_1.GraphQLJSON, { description: 'The definition in this version.' }),
|
|
167
|
+
tslib_1.__metadata("design:type", Object),
|
|
168
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
169
|
+
], DashboardCardVersion.prototype, "definition", null);
|
|
170
|
+
tslib_1.__decorate([
|
|
171
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
172
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The conversation whose proposal made this version.' }),
|
|
173
|
+
tslib_1.__metadata("design:type", String)
|
|
174
|
+
], DashboardCardVersion.prototype, "proposalSessionId", void 0);
|
|
175
|
+
tslib_1.__decorate([
|
|
176
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
177
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The proposal that made this version.' }),
|
|
178
|
+
tslib_1.__metadata("design:type", String)
|
|
179
|
+
], DashboardCardVersion.prototype, "proposalKey", void 0);
|
|
180
|
+
tslib_1.__decorate([
|
|
181
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
182
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who saved this version.' }),
|
|
183
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
184
|
+
], DashboardCardVersion.prototype, "creator", void 0);
|
|
185
|
+
tslib_1.__decorate([
|
|
186
|
+
(0, typeorm_1.RelationId)((one) => one.creator),
|
|
187
|
+
tslib_1.__metadata("design:type", String)
|
|
188
|
+
], DashboardCardVersion.prototype, "creatorId", void 0);
|
|
189
|
+
tslib_1.__decorate([
|
|
190
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
191
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed the row last.' }),
|
|
192
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
193
|
+
], DashboardCardVersion.prototype, "updater", void 0);
|
|
194
|
+
tslib_1.__decorate([
|
|
195
|
+
(0, typeorm_1.RelationId)((one) => one.updater),
|
|
196
|
+
tslib_1.__metadata("design:type", String)
|
|
197
|
+
], DashboardCardVersion.prototype, "updaterId", void 0);
|
|
198
|
+
tslib_1.__decorate([
|
|
199
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
200
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When this version was saved.' }),
|
|
201
|
+
tslib_1.__metadata("design:type", Date)
|
|
202
|
+
], DashboardCardVersion.prototype, "createdAt", void 0);
|
|
203
|
+
tslib_1.__decorate([
|
|
204
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
205
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the row was changed last.' }),
|
|
206
|
+
tslib_1.__metadata("design:type", Date)
|
|
207
|
+
], DashboardCardVersion.prototype, "updatedAt", void 0);
|
|
208
|
+
tslib_1.__decorate([
|
|
209
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
210
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted.' }),
|
|
211
|
+
tslib_1.__metadata("design:type", Date)
|
|
212
|
+
], DashboardCardVersion.prototype, "deletedAt", void 0);
|
|
213
|
+
exports.DashboardCardVersion = DashboardCardVersion = tslib_1.__decorate([
|
|
214
|
+
(0, typeorm_1.Entity)('ai_dashboard_card_versions'),
|
|
215
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_version_0', (one) => [one.card, one.version], { unique: true, where: '"deleted_at" IS NULL' })
|
|
216
|
+
/* A proposal saved once - pressing it again finds this row and answers the same card (decision 9). */
|
|
217
|
+
,
|
|
218
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_version_1', (one) => [one.domain, one.proposalSessionId, one.proposalKey], { unique: true, where: '"deleted_at" IS NULL AND "proposal_session_id" IS NOT NULL' }),
|
|
219
|
+
(0, type_graphql_1.ObjectType)({ description: 'One version of a dashboard card - its name and definition as saved then.' })
|
|
220
|
+
], DashboardCardVersion);
|
|
221
|
+
let DashboardCardShare = class DashboardCardShare {
|
|
222
|
+
};
|
|
223
|
+
exports.DashboardCardShare = DashboardCardShare;
|
|
224
|
+
tslib_1.__decorate([
|
|
225
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
226
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Share id.' }),
|
|
227
|
+
tslib_1.__metadata("design:type", String)
|
|
228
|
+
], DashboardCardShare.prototype, "id", void 0);
|
|
229
|
+
tslib_1.__decorate([
|
|
230
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
231
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
|
|
232
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
233
|
+
], DashboardCardShare.prototype, "domain", void 0);
|
|
234
|
+
tslib_1.__decorate([
|
|
235
|
+
(0, typeorm_1.RelationId)((one) => one.domain),
|
|
236
|
+
tslib_1.__metadata("design:type", String)
|
|
237
|
+
], DashboardCardShare.prototype, "domainId", void 0);
|
|
238
|
+
tslib_1.__decorate([
|
|
239
|
+
(0, typeorm_1.ManyToOne)(type => DashboardCard, { onDelete: 'CASCADE' }),
|
|
240
|
+
tslib_1.__metadata("design:type", DashboardCard)
|
|
241
|
+
], DashboardCardShare.prototype, "card", void 0);
|
|
242
|
+
tslib_1.__decorate([
|
|
243
|
+
(0, typeorm_1.RelationId)((one) => one.card),
|
|
244
|
+
(0, type_graphql_1.Field)({ description: 'The card shared.' }),
|
|
245
|
+
tslib_1.__metadata("design:type", String)
|
|
246
|
+
], DashboardCardShare.prototype, "cardId", void 0);
|
|
247
|
+
tslib_1.__decorate([
|
|
248
|
+
(0, typeorm_1.Column)(),
|
|
249
|
+
(0, type_graphql_1.Field)(type => DashboardCardShareScope, { description: 'A person, a department or the domain.' }),
|
|
250
|
+
tslib_1.__metadata("design:type", String)
|
|
251
|
+
], DashboardCardShare.prototype, "scope", void 0);
|
|
252
|
+
tslib_1.__decorate([
|
|
253
|
+
(0, typeorm_1.Column)(),
|
|
254
|
+
(0, type_graphql_1.Field)({ description: 'The user, department or domain id the scope names.' }),
|
|
255
|
+
tslib_1.__metadata("design:type", String)
|
|
256
|
+
], DashboardCardShare.prototype, "targetId", void 0);
|
|
257
|
+
tslib_1.__decorate([
|
|
258
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
259
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The name of the person, department or domain when it was shared - shown to the owner.' }),
|
|
260
|
+
tslib_1.__metadata("design:type", String)
|
|
261
|
+
], DashboardCardShare.prototype, "targetName", void 0);
|
|
262
|
+
tslib_1.__decorate([
|
|
263
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
264
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who shared it.' }),
|
|
265
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
266
|
+
], DashboardCardShare.prototype, "creator", void 0);
|
|
267
|
+
tslib_1.__decorate([
|
|
268
|
+
(0, typeorm_1.RelationId)((one) => one.creator),
|
|
269
|
+
tslib_1.__metadata("design:type", String)
|
|
270
|
+
], DashboardCardShare.prototype, "creatorId", void 0);
|
|
271
|
+
tslib_1.__decorate([
|
|
272
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
273
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed the row last.' }),
|
|
274
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
275
|
+
], DashboardCardShare.prototype, "updater", void 0);
|
|
276
|
+
tslib_1.__decorate([
|
|
277
|
+
(0, typeorm_1.RelationId)((one) => one.updater),
|
|
278
|
+
tslib_1.__metadata("design:type", String)
|
|
279
|
+
], DashboardCardShare.prototype, "updaterId", void 0);
|
|
280
|
+
tslib_1.__decorate([
|
|
281
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
282
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was shared.' }),
|
|
283
|
+
tslib_1.__metadata("design:type", Date)
|
|
284
|
+
], DashboardCardShare.prototype, "createdAt", void 0);
|
|
285
|
+
tslib_1.__decorate([
|
|
286
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
287
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the row was changed last.' }),
|
|
288
|
+
tslib_1.__metadata("design:type", Date)
|
|
289
|
+
], DashboardCardShare.prototype, "updatedAt", void 0);
|
|
290
|
+
tslib_1.__decorate([
|
|
291
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
292
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the share was withdrawn.' }),
|
|
293
|
+
tslib_1.__metadata("design:type", Date)
|
|
294
|
+
], DashboardCardShare.prototype, "deletedAt", void 0);
|
|
295
|
+
exports.DashboardCardShare = DashboardCardShare = tslib_1.__decorate([
|
|
296
|
+
(0, typeorm_1.Entity)('ai_dashboard_card_shares'),
|
|
297
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_share_0', (one) => [one.card, one.scope, one.targetId], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
298
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_share_1', (one) => [one.domain, one.scope, one.targetId]),
|
|
299
|
+
(0, type_graphql_1.ObjectType)({ description: 'Who one dashboard card is shared with - a person, a department or the domain.' })
|
|
300
|
+
], DashboardCardShare);
|
|
301
|
+
let DashboardCardPlace = class DashboardCardPlace {
|
|
302
|
+
};
|
|
303
|
+
exports.DashboardCardPlace = DashboardCardPlace;
|
|
304
|
+
tslib_1.__decorate([
|
|
305
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
306
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Place id.' }),
|
|
307
|
+
tslib_1.__metadata("design:type", String)
|
|
308
|
+
], DashboardCardPlace.prototype, "id", void 0);
|
|
309
|
+
tslib_1.__decorate([
|
|
310
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
311
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain.' }),
|
|
312
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
313
|
+
], DashboardCardPlace.prototype, "domain", void 0);
|
|
314
|
+
tslib_1.__decorate([
|
|
315
|
+
(0, typeorm_1.RelationId)((one) => one.domain),
|
|
316
|
+
tslib_1.__metadata("design:type", String)
|
|
317
|
+
], DashboardCardPlace.prototype, "domainId", void 0);
|
|
318
|
+
tslib_1.__decorate([
|
|
319
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User),
|
|
320
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
321
|
+
], DashboardCardPlace.prototype, "user", void 0);
|
|
322
|
+
tslib_1.__decorate([
|
|
323
|
+
(0, typeorm_1.RelationId)((one) => one.user),
|
|
324
|
+
tslib_1.__metadata("design:type", String)
|
|
325
|
+
], DashboardCardPlace.prototype, "userId", void 0);
|
|
326
|
+
tslib_1.__decorate([
|
|
327
|
+
(0, typeorm_1.ManyToOne)(type => DashboardCard, { onDelete: 'CASCADE' }),
|
|
328
|
+
tslib_1.__metadata("design:type", DashboardCard)
|
|
329
|
+
], DashboardCardPlace.prototype, "card", void 0);
|
|
330
|
+
tslib_1.__decorate([
|
|
331
|
+
(0, typeorm_1.RelationId)((one) => one.card),
|
|
332
|
+
(0, type_graphql_1.Field)({ description: 'The card placed.' }),
|
|
333
|
+
tslib_1.__metadata("design:type", String)
|
|
334
|
+
], DashboardCardPlace.prototype, "cardId", void 0);
|
|
335
|
+
tslib_1.__decorate([
|
|
336
|
+
(0, typeorm_1.Column)('int'),
|
|
337
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Its place in the grid, from the top left.' }),
|
|
338
|
+
tslib_1.__metadata("design:type", Number)
|
|
339
|
+
], DashboardCardPlace.prototype, "order", void 0);
|
|
340
|
+
tslib_1.__decorate([
|
|
341
|
+
(0, typeorm_1.Column)('int'),
|
|
342
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Columns it spans, 1 to 4.' }),
|
|
343
|
+
tslib_1.__metadata("design:type", Number)
|
|
344
|
+
], DashboardCardPlace.prototype, "width", void 0);
|
|
345
|
+
tslib_1.__decorate([
|
|
346
|
+
(0, typeorm_1.Column)('int'),
|
|
347
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'Rows it spans, 1 to 2.' }),
|
|
348
|
+
tslib_1.__metadata("design:type", Number)
|
|
349
|
+
], DashboardCardPlace.prototype, "height", void 0);
|
|
350
|
+
tslib_1.__decorate([
|
|
351
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
352
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who created the row.' }),
|
|
353
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
354
|
+
], DashboardCardPlace.prototype, "creator", void 0);
|
|
355
|
+
tslib_1.__decorate([
|
|
356
|
+
(0, typeorm_1.RelationId)((one) => one.creator),
|
|
357
|
+
tslib_1.__metadata("design:type", String)
|
|
358
|
+
], DashboardCardPlace.prototype, "creatorId", void 0);
|
|
359
|
+
tslib_1.__decorate([
|
|
360
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
361
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who changed the row last.' }),
|
|
362
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
363
|
+
], DashboardCardPlace.prototype, "updater", void 0);
|
|
364
|
+
tslib_1.__decorate([
|
|
365
|
+
(0, typeorm_1.RelationId)((one) => one.updater),
|
|
366
|
+
tslib_1.__metadata("design:type", String)
|
|
367
|
+
], DashboardCardPlace.prototype, "updaterId", void 0);
|
|
368
|
+
tslib_1.__decorate([
|
|
369
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
370
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was placed.' }),
|
|
371
|
+
tslib_1.__metadata("design:type", Date)
|
|
372
|
+
], DashboardCardPlace.prototype, "createdAt", void 0);
|
|
373
|
+
tslib_1.__decorate([
|
|
374
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
375
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was moved or sized last.' }),
|
|
376
|
+
tslib_1.__metadata("design:type", Date)
|
|
377
|
+
], DashboardCardPlace.prototype, "updatedAt", void 0);
|
|
378
|
+
tslib_1.__decorate([
|
|
379
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
380
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was taken off the dashboard.' }),
|
|
381
|
+
tslib_1.__metadata("design:type", Date)
|
|
382
|
+
], DashboardCardPlace.prototype, "deletedAt", void 0);
|
|
383
|
+
exports.DashboardCardPlace = DashboardCardPlace = tslib_1.__decorate([
|
|
384
|
+
(0, typeorm_1.Entity)('ai_dashboard_card_places'),
|
|
385
|
+
(0, typeorm_1.Index)('ix_ai_dashboard_card_place_0', (one) => [one.domain, one.user, one.card], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
386
|
+
(0, type_graphql_1.ObjectType)({ description: 'Where one person placed a card on their dashboard - its order and size.' })
|
|
387
|
+
], DashboardCardPlace);
|
|
388
|
+
//# sourceMappingURL=dashboard-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-card.js","sourceRoot":"","sources":["../../../server/service/card/dashboard-card.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,qCAAoJ;AACpJ,+CAA2E;AAC3E,qDAA6C;AAE7C,iDAA8C;AAC9C,yDAAgD;AAEhD,iDAAsD;AAEtD,qFAAqF;AACrF,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,8BAA8B;IAC9B,wCAAa,CAAA;IACb,6EAA6E;IAC7E,oDAAyB,CAAA;IACzB,8BAA8B;IAC9B,4CAAiB,CAAA;AACnB,CAAC,EAPW,uBAAuB,uCAAvB,uBAAuB,QAOlC;AAED,IAAA,+BAAgB,EAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,WAAW,EAAE,kFAAkF,EAAE,CAAC,CAA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AAE,CAAC;IACrJ,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,yEAAyE,EAAE,CAAC;GAC1F,kBAAkB,CA8D9B","sourcesContent":["/*\n * The four tables of the dashboard cards (ADR-0160 decisions 7, 8, 10): a card and its versions, who it is shared\n * with, and where each person placed the cards they use. A card holds its definition only - never values.\n */\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\nimport { Field, ID, Int, ObjectType, registerEnumType } from 'type-graphql'\nimport { GraphQLJSON } from 'graphql-scalars'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\nimport { LONG_TEXT, parsedJson } from './long-text.js'\n\n/** Who a card is shared with besides its owner - nobody when it has no share row. */\nexport enum DashboardCardShareScope {\n /** One person, by user id. */\n USER = 'USER',\n /** The active members of one department, by department id (organization). */\n DEPARTMENT = 'DEPARTMENT',\n /** Everyone in the domain. */\n DOMAIN = 'DOMAIN'\n}\n\nregisterEnumType(DashboardCardShareScope, { name: 'DashboardCardShareScope', description: 'Who a dashboard card is shared with: a person, a department or the whole domain.' })\n\n@Entity('ai_dashboard_cards')\n@Index('ix_ai_dashboard_card_0', (card: DashboardCard) => [card.domain, card.owner])\n@ObjectType({ description: 'A dashboard card - a definition made with the assistant, run as the viewer when drawn.' })\nexport class DashboardCard {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Card id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain the card is in.' })\n domain?: Domain\n\n @RelationId((card: DashboardCard) => card.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'The card name.' })\n name: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'What the card shows, in a line.' })\n description?: string\n\n @ManyToOne(type => User)\n @Field(type => User, { nullable: true, description: 'The one who made the card - the only one who changes it.' })\n owner?: User\n\n @RelationId((card: DashboardCard) => card.owner)\n ownerId?: string\n\n @Column('int')\n @Field(type => Int, { description: 'The current version - one more each time the definition or name changes.' })\n version: number\n\n @Column({ ...LONG_TEXT, nullable: false })\n definitionJson: string\n\n @Field(type => GraphQLJSON, { description: 'The current definition - what is read, how its rows are shaped and drawn.' })\n get definition(): unknown {\n return parsedJson(this.definitionJson)\n }\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The card this one was copied from.' })\n copiedFromId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who created the row.' })\n creator?: User\n\n @RelationId((card: DashboardCard) => card.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed the row last.' })\n updater?: User\n\n @RelationId((card: DashboardCard) => card.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the card was made.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the card was changed last.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the card was deleted.' })\n deletedAt?: Date\n}\n\n@Entity('ai_dashboard_card_versions')\n@Index('ix_ai_dashboard_card_version_0', (one: DashboardCardVersion) => [one.card, one.version], { unique: true, where: '\"deleted_at\" IS NULL' })\n/* A proposal saved once - pressing it again finds this row and answers the same card (decision 9). */\n@Index('ix_ai_dashboard_card_version_1', (one: DashboardCardVersion) => [one.domain, one.proposalSessionId, one.proposalKey], { unique: true, where: '\"deleted_at\" IS NULL AND \"proposal_session_id\" IS NOT NULL' })\n@ObjectType({ description: 'One version of a dashboard card - its name and definition as saved then.' })\nexport class DashboardCardVersion {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Version row id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain.' })\n domain?: Domain\n\n @RelationId((one: DashboardCardVersion) => one.domain)\n domainId?: string\n\n @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })\n card?: DashboardCard\n\n @RelationId((one: DashboardCardVersion) => one.card)\n @Field({ description: 'The card.' })\n cardId?: string\n\n @Column('int')\n @Field(type => Int, { description: 'The version number.' })\n version: number\n\n @Column()\n @Field({ description: 'The card name in this version.' })\n name: string\n\n @Column({ ...LONG_TEXT, nullable: false })\n definitionJson: string\n\n @Field(type => GraphQLJSON, { description: 'The definition in this version.' })\n get definition(): unknown {\n return parsedJson(this.definitionJson)\n }\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The conversation whose proposal made this version.' })\n proposalSessionId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The proposal that made this version.' })\n proposalKey?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who saved this version.' })\n creator?: User\n\n @RelationId((one: DashboardCardVersion) => one.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed the row last.' })\n updater?: User\n\n @RelationId((one: DashboardCardVersion) => one.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When this version was saved.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row was changed last.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the row was deleted.' })\n deletedAt?: Date\n}\n\n@Entity('ai_dashboard_card_shares')\n@Index('ix_ai_dashboard_card_share_0', (one: DashboardCardShare) => [one.card, one.scope, one.targetId], { unique: true, where: '\"deleted_at\" IS NULL' })\n@Index('ix_ai_dashboard_card_share_1', (one: DashboardCardShare) => [one.domain, one.scope, one.targetId])\n@ObjectType({ description: 'Who one dashboard card is shared with - a person, a department or the domain.' })\nexport class DashboardCardShare {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Share id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain.' })\n domain?: Domain\n\n @RelationId((one: DashboardCardShare) => one.domain)\n domainId?: string\n\n @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })\n card?: DashboardCard\n\n @RelationId((one: DashboardCardShare) => one.card)\n @Field({ description: 'The card shared.' })\n cardId?: string\n\n @Column()\n @Field(type => DashboardCardShareScope, { description: 'A person, a department or the domain.' })\n scope: DashboardCardShareScope\n\n @Column()\n @Field({ description: 'The user, department or domain id the scope names.' })\n targetId: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The name of the person, department or domain when it was shared - shown to the owner.' })\n targetName?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who shared it.' })\n creator?: User\n\n @RelationId((one: DashboardCardShare) => one.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed the row last.' })\n updater?: User\n\n @RelationId((one: DashboardCardShare) => one.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was shared.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row was changed last.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the share was withdrawn.' })\n deletedAt?: Date\n}\n\n@Entity('ai_dashboard_card_places')\n@Index('ix_ai_dashboard_card_place_0', (one: DashboardCardPlace) => [one.domain, one.user, one.card], { unique: true, where: '\"deleted_at\" IS NULL' })\n@ObjectType({ description: 'Where one person placed a card on their dashboard - its order and size.' })\nexport class DashboardCardPlace {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Place id.' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain.' })\n domain?: Domain\n\n @RelationId((one: DashboardCardPlace) => one.domain)\n domainId?: string\n\n @ManyToOne(type => User)\n user?: User\n\n @RelationId((one: DashboardCardPlace) => one.user)\n userId?: string\n\n @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })\n card?: DashboardCard\n\n @RelationId((one: DashboardCardPlace) => one.card)\n @Field({ description: 'The card placed.' })\n cardId?: string\n\n @Column('int')\n @Field(type => Int, { description: 'Its place in the grid, from the top left.' })\n order: number\n\n @Column('int')\n @Field(type => Int, { description: 'Columns it spans, 1 to 4.' })\n width: number\n\n @Column('int')\n @Field(type => Int, { description: 'Rows it spans, 1 to 2.' })\n height: number\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who created the row.' })\n creator?: User\n\n @RelationId((one: DashboardCardPlace) => one.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who changed the row last.' })\n updater?: User\n\n @RelationId((one: DashboardCardPlace) => one.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When it was placed.' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When it was moved or sized last.' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When it was taken off the dashboard.' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** A long text column on every database the framework runs on - a definition kept as JSON text. */
|
|
2
|
+
export declare const LONG_TEXT: {
|
|
3
|
+
readonly type: "longtext" | "clob" | "nvarchar" | "text";
|
|
4
|
+
readonly length: "MAX";
|
|
5
|
+
};
|
|
6
|
+
export declare const parsedJson: (text?: string | null) => any;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parsedJson = exports.LONG_TEXT = void 0;
|
|
4
|
+
const env_1 = require("@things-factory/env");
|
|
5
|
+
const DATABASE_TYPE = env_1.config.get('ormconfig', {}).type;
|
|
6
|
+
/** A long text column on every database the framework runs on - a definition kept as JSON text. */
|
|
7
|
+
exports.LONG_TEXT = {
|
|
8
|
+
type: DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
9
|
+
? 'longtext'
|
|
10
|
+
: DATABASE_TYPE == 'oracle'
|
|
11
|
+
? 'clob'
|
|
12
|
+
: DATABASE_TYPE == 'mssql'
|
|
13
|
+
? 'nvarchar'
|
|
14
|
+
: 'text',
|
|
15
|
+
length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined
|
|
16
|
+
};
|
|
17
|
+
const parsedJson = (text) => {
|
|
18
|
+
if (!text)
|
|
19
|
+
return null;
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(text);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.parsedJson = parsedJson;
|
|
28
|
+
//# sourceMappingURL=long-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long-text.js","sourceRoot":"","sources":["../../../server/service/card/long-text.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE5C,MAAM,aAAa,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,IAAI,CAAA;AAEtD,mGAAmG;AACtF,QAAA,SAAS,GAAG;IACvB,IAAI,EACF,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;QACpD,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,aAAa,IAAI,QAAQ;YACzB,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,OAAO;gBACxB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,MAAM;IAChB,MAAM,EAAE,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;CAC5C,CAAA;AAEH,MAAM,UAAU,GAAG,CAAC,IAAoB,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAPY,QAAA,UAAU,cAOtB","sourcesContent":["import { config } from '@things-factory/env'\n\nconst DATABASE_TYPE = config.get('ormconfig', {}).type\n\n/** A long text column on every database the framework runs on - a definition kept as JSON text. */\nexport const LONG_TEXT = {\n type:\n DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'longtext'\n : DATABASE_TYPE == 'oracle'\n ? 'clob'\n : DATABASE_TYPE == 'mssql'\n ? 'nvarchar'\n : 'text',\n length: DATABASE_TYPE == 'mssql' ? 'MAX' : undefined\n} as const\n\nexport const parsedJson = (text?: string | null) => {\n if (!text) return null\n try {\n return JSON.parse(text)\n } catch {\n return null\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardVersion } from './card/dashboard-card.js';
|
|
2
|
+
import { DashboardCardResolver } from './card/card-resolver.js';
|
|
3
|
+
import './card/card-tool.js';
|
|
4
|
+
export * from './card/card-names.js';
|
|
5
|
+
export * from './card/card-definition.js';
|
|
6
|
+
export * from './card/card-access.js';
|
|
7
|
+
export { runCard, type CardRunResult, type CardCounts, type CardRunDeps } from './card/card-run.js';
|
|
8
|
+
export { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardShareScope, DashboardCardVersion } from './card/dashboard-card.js';
|
|
9
|
+
export declare const entities: (typeof DashboardCard | typeof DashboardCardVersion | typeof DashboardCardShare | typeof DashboardCardPlace)[];
|
|
10
|
+
export declare const schema: {
|
|
11
|
+
resolverClasses: (typeof DashboardCardResolver)[];
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = exports.entities = exports.DashboardCardVersion = exports.DashboardCardShareScope = exports.DashboardCardShare = exports.DashboardCardPlace = exports.DashboardCard = exports.runCard = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const dashboard_card_js_1 = require("./card/dashboard-card.js");
|
|
6
|
+
const card_resolver_js_1 = require("./card/card-resolver.js");
|
|
7
|
+
/* The card tool - in reach of every conversation, in front on the dashboard page. */
|
|
8
|
+
require("./card/card-tool.js");
|
|
9
|
+
tslib_1.__exportStar(require("./card/card-names.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./card/card-definition.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./card/card-access.js"), exports);
|
|
12
|
+
var card_run_js_1 = require("./card/card-run.js");
|
|
13
|
+
Object.defineProperty(exports, "runCard", { enumerable: true, get: function () { return card_run_js_1.runCard; } });
|
|
14
|
+
var dashboard_card_js_2 = require("./card/dashboard-card.js");
|
|
15
|
+
Object.defineProperty(exports, "DashboardCard", { enumerable: true, get: function () { return dashboard_card_js_2.DashboardCard; } });
|
|
16
|
+
Object.defineProperty(exports, "DashboardCardPlace", { enumerable: true, get: function () { return dashboard_card_js_2.DashboardCardPlace; } });
|
|
17
|
+
Object.defineProperty(exports, "DashboardCardShare", { enumerable: true, get: function () { return dashboard_card_js_2.DashboardCardShare; } });
|
|
18
|
+
Object.defineProperty(exports, "DashboardCardShareScope", { enumerable: true, get: function () { return dashboard_card_js_2.DashboardCardShareScope; } });
|
|
19
|
+
Object.defineProperty(exports, "DashboardCardVersion", { enumerable: true, get: function () { return dashboard_card_js_2.DashboardCardVersion; } });
|
|
20
|
+
exports.entities = [dashboard_card_js_1.DashboardCard, dashboard_card_js_1.DashboardCardVersion, dashboard_card_js_1.DashboardCardShare, dashboard_card_js_1.DashboardCardPlace];
|
|
21
|
+
exports.schema = {
|
|
22
|
+
resolverClasses: [card_resolver_js_1.DashboardCardResolver]
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsH;AACtH,8DAA+D;AAC/D,qFAAqF;AACrF,+BAA4B;AAE5B,+DAAoC;AACpC,oEAAyC;AACzC,gEAAqC;AACrC,kDAAmG;AAA1F,sGAAA,OAAO,OAAA;AAChB,8DAA+I;AAAtI,kHAAA,aAAa,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAEhG,QAAA,QAAQ,GAAG,CAAC,iCAAa,EAAE,wCAAoB,EAAE,sCAAkB,EAAE,sCAAkB,CAAC,CAAA;AAExF,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE,CAAC,wCAAqB,CAAC;CACzC,CAAA","sourcesContent":["import { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardVersion } from './card/dashboard-card.js'\nimport { DashboardCardResolver } from './card/card-resolver.js'\n/* The card tool - in reach of every conversation, in front on the dashboard page. */\nimport './card/card-tool.js'\n\nexport * from './card/card-names.js'\nexport * from './card/card-definition.js'\nexport * from './card/card-access.js'\nexport { runCard, type CardRunResult, type CardCounts, type CardRunDeps } from './card/card-run.js'\nexport { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardShareScope, DashboardCardVersion } from './card/dashboard-card.js'\n\nexport const entities = [DashboardCard, DashboardCardVersion, DashboardCardShare, DashboardCardPlace]\n\nexport const schema = {\n resolverClasses: [DashboardCardResolver]\n}\n"]}
|