@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.
Files changed (108) hide show
  1. package/client/bootstrap.ts +25 -0
  2. package/client/components/card-dialogs.ts +422 -0
  3. package/client/components/card-library.ts +272 -0
  4. package/client/components/dashboard-card.ts +450 -0
  5. package/client/components/proposal-preview.ts +96 -0
  6. package/client/index.ts +3 -0
  7. package/client/pages/my-dashboard-page.ts +371 -0
  8. package/client/route.ts +8 -0
  9. package/client/tsconfig.json +13 -0
  10. package/client/utils/card-api.ts +110 -0
  11. package/client/utils/card-words.ts +80 -0
  12. package/dist-client/bootstrap.d.ts +2 -0
  13. package/dist-client/bootstrap.js +24 -0
  14. package/dist-client/bootstrap.js.map +1 -0
  15. package/dist-client/components/card-dialogs.d.ts +59 -0
  16. package/dist-client/components/card-dialogs.js +457 -0
  17. package/dist-client/components/card-dialogs.js.map +1 -0
  18. package/dist-client/components/card-library.d.ts +23 -0
  19. package/dist-client/components/card-library.js +276 -0
  20. package/dist-client/components/card-library.js.map +1 -0
  21. package/dist-client/components/dashboard-card.d.ts +35 -0
  22. package/dist-client/components/dashboard-card.js +490 -0
  23. package/dist-client/components/dashboard-card.js.map +1 -0
  24. package/dist-client/components/proposal-preview.d.ts +17 -0
  25. package/dist-client/components/proposal-preview.js +111 -0
  26. package/dist-client/components/proposal-preview.js.map +1 -0
  27. package/dist-client/index.d.ts +3 -0
  28. package/dist-client/index.js +4 -0
  29. package/dist-client/index.js.map +1 -0
  30. package/dist-client/pages/my-dashboard-page.d.ts +46 -0
  31. package/dist-client/pages/my-dashboard-page.js +376 -0
  32. package/dist-client/pages/my-dashboard-page.js.map +1 -0
  33. package/dist-client/route.d.ts +1 -0
  34. package/dist-client/route.js +9 -0
  35. package/dist-client/route.js.map +1 -0
  36. package/dist-client/tsconfig.tsbuildinfo +1 -0
  37. package/dist-client/utils/card-api.d.ts +95 -0
  38. package/dist-client/utils/card-api.js +39 -0
  39. package/dist-client/utils/card-api.js.map +1 -0
  40. package/dist-client/utils/card-words.d.ts +24 -0
  41. package/dist-client/utils/card-words.js +72 -0
  42. package/dist-client/utils/card-words.js.map +1 -0
  43. package/dist-server/index.d.ts +11 -0
  44. package/dist-server/index.js +19 -0
  45. package/dist-server/index.js.map +1 -0
  46. package/dist-server/role-tasks.d.ts +2 -0
  47. package/dist-server/role-tasks.js +13 -0
  48. package/dist-server/role-tasks.js.map +1 -0
  49. package/dist-server/service/card/card-access.d.ts +32 -0
  50. package/dist-server/service/card/card-access.js +45 -0
  51. package/dist-server/service/card/card-access.js.map +1 -0
  52. package/dist-server/service/card/card-definition.d.ts +100 -0
  53. package/dist-server/service/card/card-definition.js +237 -0
  54. package/dist-server/service/card/card-definition.js.map +1 -0
  55. package/dist-server/service/card/card-names.d.ts +5 -0
  56. package/dist-server/service/card/card-names.js +9 -0
  57. package/dist-server/service/card/card-names.js.map +1 -0
  58. package/dist-server/service/card/card-proposal.d.ts +21 -0
  59. package/dist-server/service/card/card-proposal.js +28 -0
  60. package/dist-server/service/card/card-proposal.js.map +1 -0
  61. package/dist-server/service/card/card-resolver.d.ts +29 -0
  62. package/dist-server/service/card/card-resolver.js +541 -0
  63. package/dist-server/service/card/card-resolver.js.map +1 -0
  64. package/dist-server/service/card/card-run.d.ts +48 -0
  65. package/dist-server/service/card/card-run.js +239 -0
  66. package/dist-server/service/card/card-run.js.map +1 -0
  67. package/dist-server/service/card/card-tool.d.ts +218 -0
  68. package/dist-server/service/card/card-tool.js +313 -0
  69. package/dist-server/service/card/card-tool.js.map +1 -0
  70. package/dist-server/service/card/card-types.d.ts +56 -0
  71. package/dist-server/service/card/card-types.js +212 -0
  72. package/dist-server/service/card/card-types.js.map +1 -0
  73. package/dist-server/service/card/dashboard-card.d.ts +87 -0
  74. package/dist-server/service/card/dashboard-card.js +388 -0
  75. package/dist-server/service/card/dashboard-card.js.map +1 -0
  76. package/dist-server/service/card/long-text.d.ts +6 -0
  77. package/dist-server/service/card/long-text.js +28 -0
  78. package/dist-server/service/card/long-text.js.map +1 -0
  79. package/dist-server/service/index.d.ts +12 -0
  80. package/dist-server/service/index.js +24 -0
  81. package/dist-server/service/index.js.map +1 -0
  82. package/dist-server/tsconfig.tsbuildinfo +1 -0
  83. package/package.json +47 -4
  84. package/server/index.ts +16 -0
  85. package/server/role-tasks.ts +12 -0
  86. package/server/service/card/card-access.test.ts +138 -0
  87. package/server/service/card/card-access.ts +53 -0
  88. package/server/service/card/card-definition.ts +298 -0
  89. package/server/service/card/card-names.ts +5 -0
  90. package/server/service/card/card-proposal.ts +37 -0
  91. package/server/service/card/card-resolver.ts +434 -0
  92. package/server/service/card/card-run.test.ts +237 -0
  93. package/server/service/card/card-run.ts +288 -0
  94. package/server/service/card/card-tool.ts +299 -0
  95. package/server/service/card/card-types.ts +145 -0
  96. package/server/service/card/dashboard-card.ts +301 -0
  97. package/server/service/card/long-text.ts +25 -0
  98. package/server/service/index.ts +16 -0
  99. package/test/translations.test.ts +42 -0
  100. package/things-factory.config.js +8 -0
  101. package/translations/en.json +126 -0
  102. package/translations/es.json +126 -0
  103. package/translations/ja.json +126 -0
  104. package/translations/ko.json +126 -0
  105. package/translations/ms.json +126 -0
  106. package/translations/zh.json +126 -0
  107. package/tsconfig.json +9 -0
  108. package/README.md +0 -3
@@ -0,0 +1,301 @@
1
+ /*
2
+ * The four tables of the dashboard cards (ADR-0160 decisions 7, 8, 10): a card and its versions, who it is shared
3
+ * with, and where each person placed the cards they use. A card holds its definition only - never values.
4
+ */
5
+ import { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'
6
+ import { Field, ID, Int, ObjectType, registerEnumType } from 'type-graphql'
7
+ import { GraphQLJSON } from 'graphql-scalars'
8
+
9
+ import { Domain } from '@things-factory/shell'
10
+ import { User } from '@things-factory/auth-base'
11
+
12
+ import { LONG_TEXT, parsedJson } from './long-text.js'
13
+
14
+ /** Who a card is shared with besides its owner - nobody when it has no share row. */
15
+ export enum DashboardCardShareScope {
16
+ /** One person, by user id. */
17
+ USER = 'USER',
18
+ /** The active members of one department, by department id (organization). */
19
+ DEPARTMENT = 'DEPARTMENT',
20
+ /** Everyone in the domain. */
21
+ DOMAIN = 'DOMAIN'
22
+ }
23
+
24
+ registerEnumType(DashboardCardShareScope, { name: 'DashboardCardShareScope', description: 'Who a dashboard card is shared with: a person, a department or the whole domain.' })
25
+
26
+ @Entity('ai_dashboard_cards')
27
+ @Index('ix_ai_dashboard_card_0', (card: DashboardCard) => [card.domain, card.owner])
28
+ @ObjectType({ description: 'A dashboard card - a definition made with the assistant, run as the viewer when drawn.' })
29
+ export class DashboardCard {
30
+ @PrimaryGeneratedColumn('uuid')
31
+ @Field(type => ID, { description: 'Card id.' })
32
+ readonly id: string
33
+
34
+ @ManyToOne(type => Domain)
35
+ @Field(type => Domain, { nullable: true, description: 'The domain the card is in.' })
36
+ domain?: Domain
37
+
38
+ @RelationId((card: DashboardCard) => card.domain)
39
+ domainId?: string
40
+
41
+ @Column()
42
+ @Field({ description: 'The card name.' })
43
+ name: string
44
+
45
+ @Column({ type: 'text', nullable: true })
46
+ @Field({ nullable: true, description: 'What the card shows, in a line.' })
47
+ description?: string
48
+
49
+ @ManyToOne(type => User)
50
+ @Field(type => User, { nullable: true, description: 'The one who made the card - the only one who changes it.' })
51
+ owner?: User
52
+
53
+ @RelationId((card: DashboardCard) => card.owner)
54
+ ownerId?: string
55
+
56
+ @Column('int')
57
+ @Field(type => Int, { description: 'The current version - one more each time the definition or name changes.' })
58
+ version: number
59
+
60
+ @Column({ ...LONG_TEXT, nullable: false })
61
+ definitionJson: string
62
+
63
+ @Field(type => GraphQLJSON, { description: 'The current definition - what is read, how its rows are shaped and drawn.' })
64
+ get definition(): unknown {
65
+ return parsedJson(this.definitionJson)
66
+ }
67
+
68
+ @Column({ nullable: true })
69
+ @Field({ nullable: true, description: 'The card this one was copied from.' })
70
+ copiedFromId?: string
71
+
72
+ @ManyToOne(type => User, { nullable: true })
73
+ @Field(type => User, { nullable: true, description: 'Who created the row.' })
74
+ creator?: User
75
+
76
+ @RelationId((card: DashboardCard) => card.creator)
77
+ creatorId?: string
78
+
79
+ @ManyToOne(type => User, { nullable: true })
80
+ @Field(type => User, { nullable: true, description: 'Who changed the row last.' })
81
+ updater?: User
82
+
83
+ @RelationId((card: DashboardCard) => card.updater)
84
+ updaterId?: string
85
+
86
+ @CreateDateColumn()
87
+ @Field({ nullable: true, description: 'When the card was made.' })
88
+ createdAt?: Date
89
+
90
+ @UpdateDateColumn()
91
+ @Field({ nullable: true, description: 'When the card was changed last.' })
92
+ updatedAt?: Date
93
+
94
+ @DeleteDateColumn()
95
+ @Field({ nullable: true, description: 'When the card was deleted.' })
96
+ deletedAt?: Date
97
+ }
98
+
99
+ @Entity('ai_dashboard_card_versions')
100
+ @Index('ix_ai_dashboard_card_version_0', (one: DashboardCardVersion) => [one.card, one.version], { unique: true, where: '"deleted_at" IS NULL' })
101
+ /* A proposal saved once - pressing it again finds this row and answers the same card (decision 9). */
102
+ @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' })
103
+ @ObjectType({ description: 'One version of a dashboard card - its name and definition as saved then.' })
104
+ export class DashboardCardVersion {
105
+ @PrimaryGeneratedColumn('uuid')
106
+ @Field(type => ID, { description: 'Version row id.' })
107
+ readonly id: string
108
+
109
+ @ManyToOne(type => Domain)
110
+ @Field(type => Domain, { nullable: true, description: 'The domain.' })
111
+ domain?: Domain
112
+
113
+ @RelationId((one: DashboardCardVersion) => one.domain)
114
+ domainId?: string
115
+
116
+ @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })
117
+ card?: DashboardCard
118
+
119
+ @RelationId((one: DashboardCardVersion) => one.card)
120
+ @Field({ description: 'The card.' })
121
+ cardId?: string
122
+
123
+ @Column('int')
124
+ @Field(type => Int, { description: 'The version number.' })
125
+ version: number
126
+
127
+ @Column()
128
+ @Field({ description: 'The card name in this version.' })
129
+ name: string
130
+
131
+ @Column({ ...LONG_TEXT, nullable: false })
132
+ definitionJson: string
133
+
134
+ @Field(type => GraphQLJSON, { description: 'The definition in this version.' })
135
+ get definition(): unknown {
136
+ return parsedJson(this.definitionJson)
137
+ }
138
+
139
+ @Column({ nullable: true })
140
+ @Field({ nullable: true, description: 'The conversation whose proposal made this version.' })
141
+ proposalSessionId?: string
142
+
143
+ @Column({ nullable: true })
144
+ @Field({ nullable: true, description: 'The proposal that made this version.' })
145
+ proposalKey?: string
146
+
147
+ @ManyToOne(type => User, { nullable: true })
148
+ @Field(type => User, { nullable: true, description: 'Who saved this version.' })
149
+ creator?: User
150
+
151
+ @RelationId((one: DashboardCardVersion) => one.creator)
152
+ creatorId?: string
153
+
154
+ @ManyToOne(type => User, { nullable: true })
155
+ @Field(type => User, { nullable: true, description: 'Who changed the row last.' })
156
+ updater?: User
157
+
158
+ @RelationId((one: DashboardCardVersion) => one.updater)
159
+ updaterId?: string
160
+
161
+ @CreateDateColumn()
162
+ @Field({ nullable: true, description: 'When this version was saved.' })
163
+ createdAt?: Date
164
+
165
+ @UpdateDateColumn()
166
+ @Field({ nullable: true, description: 'When the row was changed last.' })
167
+ updatedAt?: Date
168
+
169
+ @DeleteDateColumn()
170
+ @Field({ nullable: true, description: 'When the row was deleted.' })
171
+ deletedAt?: Date
172
+ }
173
+
174
+ @Entity('ai_dashboard_card_shares')
175
+ @Index('ix_ai_dashboard_card_share_0', (one: DashboardCardShare) => [one.card, one.scope, one.targetId], { unique: true, where: '"deleted_at" IS NULL' })
176
+ @Index('ix_ai_dashboard_card_share_1', (one: DashboardCardShare) => [one.domain, one.scope, one.targetId])
177
+ @ObjectType({ description: 'Who one dashboard card is shared with - a person, a department or the domain.' })
178
+ export class DashboardCardShare {
179
+ @PrimaryGeneratedColumn('uuid')
180
+ @Field(type => ID, { description: 'Share id.' })
181
+ readonly id: string
182
+
183
+ @ManyToOne(type => Domain)
184
+ @Field(type => Domain, { nullable: true, description: 'The domain.' })
185
+ domain?: Domain
186
+
187
+ @RelationId((one: DashboardCardShare) => one.domain)
188
+ domainId?: string
189
+
190
+ @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })
191
+ card?: DashboardCard
192
+
193
+ @RelationId((one: DashboardCardShare) => one.card)
194
+ @Field({ description: 'The card shared.' })
195
+ cardId?: string
196
+
197
+ @Column()
198
+ @Field(type => DashboardCardShareScope, { description: 'A person, a department or the domain.' })
199
+ scope: DashboardCardShareScope
200
+
201
+ @Column()
202
+ @Field({ description: 'The user, department or domain id the scope names.' })
203
+ targetId: string
204
+
205
+ @Column({ nullable: true })
206
+ @Field({ nullable: true, description: 'The name of the person, department or domain when it was shared - shown to the owner.' })
207
+ targetName?: string
208
+
209
+ @ManyToOne(type => User, { nullable: true })
210
+ @Field(type => User, { nullable: true, description: 'Who shared it.' })
211
+ creator?: User
212
+
213
+ @RelationId((one: DashboardCardShare) => one.creator)
214
+ creatorId?: string
215
+
216
+ @ManyToOne(type => User, { nullable: true })
217
+ @Field(type => User, { nullable: true, description: 'Who changed the row last.' })
218
+ updater?: User
219
+
220
+ @RelationId((one: DashboardCardShare) => one.updater)
221
+ updaterId?: string
222
+
223
+ @CreateDateColumn()
224
+ @Field({ nullable: true, description: 'When it was shared.' })
225
+ createdAt?: Date
226
+
227
+ @UpdateDateColumn()
228
+ @Field({ nullable: true, description: 'When the row was changed last.' })
229
+ updatedAt?: Date
230
+
231
+ @DeleteDateColumn()
232
+ @Field({ nullable: true, description: 'When the share was withdrawn.' })
233
+ deletedAt?: Date
234
+ }
235
+
236
+ @Entity('ai_dashboard_card_places')
237
+ @Index('ix_ai_dashboard_card_place_0', (one: DashboardCardPlace) => [one.domain, one.user, one.card], { unique: true, where: '"deleted_at" IS NULL' })
238
+ @ObjectType({ description: 'Where one person placed a card on their dashboard - its order and size.' })
239
+ export class DashboardCardPlace {
240
+ @PrimaryGeneratedColumn('uuid')
241
+ @Field(type => ID, { description: 'Place id.' })
242
+ readonly id: string
243
+
244
+ @ManyToOne(type => Domain)
245
+ @Field(type => Domain, { nullable: true, description: 'The domain.' })
246
+ domain?: Domain
247
+
248
+ @RelationId((one: DashboardCardPlace) => one.domain)
249
+ domainId?: string
250
+
251
+ @ManyToOne(type => User)
252
+ user?: User
253
+
254
+ @RelationId((one: DashboardCardPlace) => one.user)
255
+ userId?: string
256
+
257
+ @ManyToOne(type => DashboardCard, { onDelete: 'CASCADE' })
258
+ card?: DashboardCard
259
+
260
+ @RelationId((one: DashboardCardPlace) => one.card)
261
+ @Field({ description: 'The card placed.' })
262
+ cardId?: string
263
+
264
+ @Column('int')
265
+ @Field(type => Int, { description: 'Its place in the grid, from the top left.' })
266
+ order: number
267
+
268
+ @Column('int')
269
+ @Field(type => Int, { description: 'Columns it spans, 1 to 4.' })
270
+ width: number
271
+
272
+ @Column('int')
273
+ @Field(type => Int, { description: 'Rows it spans, 1 to 2.' })
274
+ height: number
275
+
276
+ @ManyToOne(type => User, { nullable: true })
277
+ @Field(type => User, { nullable: true, description: 'Who created the row.' })
278
+ creator?: User
279
+
280
+ @RelationId((one: DashboardCardPlace) => one.creator)
281
+ creatorId?: string
282
+
283
+ @ManyToOne(type => User, { nullable: true })
284
+ @Field(type => User, { nullable: true, description: 'Who changed the row last.' })
285
+ updater?: User
286
+
287
+ @RelationId((one: DashboardCardPlace) => one.updater)
288
+ updaterId?: string
289
+
290
+ @CreateDateColumn()
291
+ @Field({ nullable: true, description: 'When it was placed.' })
292
+ createdAt?: Date
293
+
294
+ @UpdateDateColumn()
295
+ @Field({ nullable: true, description: 'When it was moved or sized last.' })
296
+ updatedAt?: Date
297
+
298
+ @DeleteDateColumn()
299
+ @Field({ nullable: true, description: 'When it was taken off the dashboard.' })
300
+ deletedAt?: Date
301
+ }
@@ -0,0 +1,25 @@
1
+ import { config } from '@things-factory/env'
2
+
3
+ const DATABASE_TYPE = config.get('ormconfig', {}).type
4
+
5
+ /** A long text column on every database the framework runs on - a definition kept as JSON text. */
6
+ export const LONG_TEXT = {
7
+ type:
8
+ 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
+ } as const
17
+
18
+ export const parsedJson = (text?: string | null) => {
19
+ if (!text) return null
20
+ try {
21
+ return JSON.parse(text)
22
+ } catch {
23
+ return null
24
+ }
25
+ }
@@ -0,0 +1,16 @@
1
+ import { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardVersion } from './card/dashboard-card.js'
2
+ import { DashboardCardResolver } from './card/card-resolver.js'
3
+ /* The card tool - in reach of every conversation, in front on the dashboard page. */
4
+ import './card/card-tool.js'
5
+
6
+ export * from './card/card-names.js'
7
+ export * from './card/card-definition.js'
8
+ export * from './card/card-access.js'
9
+ export { runCard, type CardRunResult, type CardCounts, type CardRunDeps } from './card/card-run.js'
10
+ export { DashboardCard, DashboardCardPlace, DashboardCardShare, DashboardCardShareScope, DashboardCardVersion } from './card/dashboard-card.js'
11
+
12
+ export const entities = [DashboardCard, DashboardCardVersion, DashboardCardShare, DashboardCardPlace]
13
+
14
+ export const schema = {
15
+ resolverClasses: [DashboardCardResolver]
16
+ }
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Every word the dashboard says is in every language the module ships - the keys are strings, so neither tsc nor
3
+ * eslint sees one with no entry; this test is the only thing that does. Covers the client's words, the refusals the
4
+ * server says (`ai-dashboard.refusal.<code>`), the reasons a card is not drawn and the role task's words.
5
+ */
6
+ import { readFileSync, readdirSync } from 'fs'
7
+ import { join } from 'path'
8
+
9
+ const ROOT = join(__dirname, '..')
10
+ const LANGUAGES = ['ko', 'en', 'ja', 'zh', 'es', 'ms']
11
+
12
+ const sources = (dir: string): string[] =>
13
+ readdirSync(dir, { withFileTypes: true }).flatMap(entry => (entry.isDirectory() ? sources(join(dir, entry.name)) : /\.ts$/.test(entry.name) && !/\.test\.ts$/.test(entry.name) ? [join(dir, entry.name)] : []))
14
+
15
+ const text = [...sources(join(ROOT, 'client')), ...sources(join(ROOT, 'server'))].map(file => readFileSync(file, 'utf8')).join('\n')
16
+ const locale = (lang: string): Record<string, string> => JSON.parse(readFileSync(join(ROOT, 'translations', `${lang}.json`), 'utf8'))
17
+
18
+ const used = new Set<string>([...text.matchAll(/'(ai-dashboard\.[a-z0-9.-]+[a-z0-9])'/g)].map(match => match[1]).filter(key => key !== 'ai-dashboard.use'))
19
+ /* Keys built from a code: the refusals (refuse(context, '<code>', ...)), the shares' (share-<code>), the issues a card names, the views. */
20
+ for (const [, code] of text.matchAll(/refuse\(context, '([a-z-]+)'/g)) used.add(`ai-dashboard.refusal.${code}`)
21
+ for (const code of ['unknown-scope', 'no-target', 'another-domain', 'no-departments']) used.add(`ai-dashboard.refusal.share-${code}`)
22
+ const issues = /KNOWN_ISSUES = \[([\s\S]*?)\]/.exec(text)![1]
23
+ for (const [, code] of issues.matchAll(/'([a-z-]+)'/g)) used.add(`ai-dashboard.issue.${code}`)
24
+ for (const view of ['number', 'table', 'bar', 'line']) used.add(`ai-dashboard.view.${view}`)
25
+ used.add('task.ai-dashboard.use.name')
26
+ used.add('task.ai-dashboard.use.description')
27
+
28
+ test('the floor - the parser found the words', () => {
29
+ expect(used.size).toBeGreaterThan(100)
30
+ })
31
+
32
+ test.each(LANGUAGES)('★ every key the dashboard names is in %s', lang => {
33
+ const words = locale(lang)
34
+ expect([...used].filter(key => !(key in words))).toEqual([])
35
+ })
36
+
37
+ test.each(LANGUAGES)('a placeholder said in Korean is said in %s too', lang => {
38
+ const ko = locale('ko')
39
+ const words = locale(lang)
40
+ const holes = (said: string) => [...said.matchAll(/\{(\w+)\}/g)].map(match => match[1]).sort()
41
+ expect(Object.keys(ko).filter(key => key in words && holes(ko[key]).join() !== holes(words[key]).join())).toEqual([])
42
+ })
@@ -0,0 +1,8 @@
1
+ import bootstrap from './dist-client/bootstrap.js'
2
+ import route from './dist-client/route.js'
3
+
4
+ export default {
5
+ bootstrap,
6
+ route,
7
+ routes: [{ tagname: 'my-dashboard-page', page: 'my-dashboard' }]
8
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "ai-dashboard.title": "My dashboard",
3
+ "task.ai-dashboard.use.name": "My dashboard",
4
+ "task.ai-dashboard.use.description": "Keeps, shares and places the cards made with the assistant. A card's data is read only with the viewer's own privileges.",
5
+ "ai-dashboard.button.arrange": "Arrange",
6
+ "ai-dashboard.button.done": "Done",
7
+ "ai-dashboard.button.library": "Card library",
8
+ "ai-dashboard.button.make": "Make a card with AI",
9
+ "ai-dashboard.button.cancel": "Cancel",
10
+ "ai-dashboard.button.save": "Save",
11
+ "ai-dashboard.page.lead": "Each card is made once in a conversation with the assistant and drawn from the current data every time it opens.",
12
+ "ai-dashboard.page.arranging": "Arranging - move and size the cards",
13
+ "ai-dashboard.page.empty-title": "Tell the assistant what you want to see",
14
+ "ai-dashboard.page.empty-text": "The assistant finds the data, decides how to draw it and makes it a card. A saved card is drawn from the current data any time, without the assistant.",
15
+ "ai-dashboard.page.from-library": "Add a card from the library",
16
+ "ai-dashboard.page.no-tokens": "Drawing a card calls no AI. Its data is read with the viewer's own privileges.",
17
+ "ai-dashboard.page.make-draft": "Make a dashboard card: ",
18
+ "ai-dashboard.example.receivables": "Make a card with bars for the five customers who still owe us the most",
19
+ "ai-dashboard.example.cash-trend": "Make a card with a line of money in and out each month for the last six months",
20
+ "ai-dashboard.example.month-count": "Make a card with this month's count and total of bank lines",
21
+ "ai-dashboard.card.refresh": "Draw again",
22
+ "ai-dashboard.card.ai": "Change with AI",
23
+ "ai-dashboard.card.more": "More",
24
+ "ai-dashboard.card.rename": "Rename",
25
+ "ai-dashboard.card.share": "Share",
26
+ "ai-dashboard.card.versions": "Versions",
27
+ "ai-dashboard.card.duplicate": "Duplicate",
28
+ "ai-dashboard.card.copy": "Copy as my card",
29
+ "ai-dashboard.card.unplace": "Take off the dashboard",
30
+ "ai-dashboard.card.delete": "Delete card",
31
+ "ai-dashboard.card.count": "Count",
32
+ "ai-dashboard.card.partial": "Drawn from {read} of {total} rows - sums and ranks are of those.",
33
+ "ai-dashboard.card.read-at": "as of {day} · read {time}",
34
+ "ai-dashboard.card.shared-by": "shared by {name}",
35
+ "ai-dashboard.card.shared-with": "shared with {names}",
36
+ "ai-dashboard.edit.left": "Move earlier",
37
+ "ai-dashboard.edit.right": "Move later",
38
+ "ai-dashboard.edit.wider": "Wider",
39
+ "ai-dashboard.edit.narrower": "Narrower",
40
+ "ai-dashboard.edit.taller": "Taller",
41
+ "ai-dashboard.edit.shorter": "Shorter",
42
+ "ai-dashboard.library.title": "Card library",
43
+ "ai-dashboard.library.mine": "My cards",
44
+ "ai-dashboard.library.shared": "Shared with me",
45
+ "ai-dashboard.library.none-mine": "No cards yet. Make the first one in a conversation with the assistant.",
46
+ "ai-dashboard.library.none-shared": "Nothing has been shared with you.",
47
+ "ai-dashboard.library.place": "Place on dashboard",
48
+ "ai-dashboard.library.placed": "On the dashboard",
49
+ "ai-dashboard.share.title": "Share \"{name}\"",
50
+ "ai-dashboard.share.lead": "Sharing passes on the card's definition only. Each person sees only the data their own privileges open.",
51
+ "ai-dashboard.share.everyone-title": "Site",
52
+ "ai-dashboard.share.everyone-in": "Everyone in {name}",
53
+ "ai-dashboard.share.everyone": "everyone",
54
+ "ai-dashboard.share.departments": "My departments",
55
+ "ai-dashboard.share.department-members": "active members",
56
+ "ai-dashboard.share.people": "People",
57
+ "ai-dashboard.share.find-person": "Find by name",
58
+ "ai-dashboard.share.add": "Add",
59
+ "ai-dashboard.share.remove": "Remove",
60
+ "ai-dashboard.share.people-unavailable": "People cannot be looked up with your privileges, so the card cannot be shared with a person.",
61
+ "ai-dashboard.share.rule": "Withdrawing a share takes the card off the other person's dashboard at once.",
62
+ "ai-dashboard.ai.lead": "How should \"{name}\" change? The assistant offers a new definition with a preview; saving it makes a new version.",
63
+ "ai-dashboard.ai.placeholder": "e.g. compare it with last month",
64
+ "ai-dashboard.ai.hint-period": "Make the period this quarter",
65
+ "ai-dashboard.ai.hint-top": "Show the top ten",
66
+ "ai-dashboard.ai.hint-line": "A line by month",
67
+ "ai-dashboard.ai.hint-table": "As a table",
68
+ "ai-dashboard.ai.send": "Send to the assistant",
69
+ "ai-dashboard.ai.ask": "Change the dashboard card \"{name}\" (version {version}): {change}",
70
+ "ai-dashboard.versions.lead": "Picking an earlier version makes a new version from it. No version is erased.",
71
+ "ai-dashboard.versions.current": "Current",
72
+ "ai-dashboard.versions.restore": "Bring this back",
73
+ "ai-dashboard.view.number": "Number",
74
+ "ai-dashboard.view.table": "Table",
75
+ "ai-dashboard.view.bar": "Bars",
76
+ "ai-dashboard.view.line": "Line",
77
+ "ai-dashboard.preview.reading": "Drawing the preview…",
78
+ "ai-dashboard.preview.note": "Preview · as of {day} - once saved, the dashboard draws it from the current data without AI",
79
+ "ai-dashboard.preview.save": "Save to my dashboard",
80
+ "ai-dashboard.preview.saved": "Placed \"{name}\" on my dashboard.",
81
+ "ai-dashboard.preview.saved-version": "Saved \"{name}\" as version {version}.",
82
+ "ai-dashboard.text.copied": "Copied \"{name}\" as my card and placed it on the dashboard.",
83
+ "ai-dashboard.text.placed": "Placed \"{name}\" on the dashboard.",
84
+ "ai-dashboard.text.unplaced": "Took \"{name}\" off the dashboard. The card stays in the library.",
85
+ "ai-dashboard.text.shared": "Saved who \"{name}\" is shared with.",
86
+ "ai-dashboard.text.private": "\"{name}\" is now yours alone.",
87
+ "ai-dashboard.text.restored": "Made a new version from version {version}.",
88
+ "ai-dashboard.text.delete": "Delete \"{name}\"? Its versions and its places on dashboards go with it.",
89
+ "ai-dashboard.text.delete-shared": "Delete \"{name}\"? It also leaves the dashboards of the people it is shared with.",
90
+ "ai-dashboard.issue.door-closed": "You may not read the data this card draws.",
91
+ "ai-dashboard.issue.not-found": "Nothing was found for these conditions.",
92
+ "ai-dashboard.issue.list-missing": "The data does not have the declared shape ({read}/{list}). Tell the application's maintainers.",
93
+ "ai-dashboard.issue.query-failed": "The data could not be read: {message}",
94
+ "ai-dashboard.issue.condition-unreadable": "The data does not take this card's conditions. Change them with AI.",
95
+ "ai-dashboard.issue.mixed-currency-order": "The rows hold several currencies ({currencies}), which have no common order. Filter by currency or order by a converted column.",
96
+ "ai-dashboard.issue.too-many-series": "{series} series cannot be drawn (at most {max}). Group differently or draw fewer values.",
97
+ "ai-dashboard.issue.too-many-figures": "{figures} figures cannot be drawn (at most {max}).",
98
+ "ai-dashboard.issue.unknown-read": "The data this card read is no longer offered by this application.",
99
+ "ai-dashboard.issue.not-a-card-source": "This data is not declared for cards.",
100
+ "ai-dashboard.issue.unknown-list": "The list this card read is no longer there.",
101
+ "ai-dashboard.issue.unknown-column": "The column this card uses ({column}) is no longer in the data. Change it with AI.",
102
+ "ai-dashboard.issue.unknown-condition": "The data no longer takes this card's condition ({name}). Change it with AI.",
103
+ "ai-dashboard.issue.other": "This card cannot be drawn ({code}).",
104
+ "ai-dashboard.refusal.unknown-card": "There is no such card.",
105
+ "ai-dashboard.refusal.card-not-shared": "This card is not shared with you.",
106
+ "ai-dashboard.refusal.not-your-card": "Only the one who made this card changes it - copy it to make your own.",
107
+ "ai-dashboard.refusal.definition-unfit": "The card definition does not fit its data ({code}).",
108
+ "ai-dashboard.refusal.unknown-conversation": "There is no such conversation.",
109
+ "ai-dashboard.refusal.conversation-closed": "This conversation is not open to you.",
110
+ "ai-dashboard.refusal.unknown-proposal": "There is no such card in this conversation.",
111
+ "ai-dashboard.refusal.not-a-card": "This proposal is not a dashboard card.",
112
+ "ai-dashboard.refusal.superseded": "A newer card replaced this one in the conversation - save that one.",
113
+ "ai-dashboard.refusal.data-closed": "You may not read the data this card draws.",
114
+ "ai-dashboard.refusal.stale-version": "The card changed since this proposal (now version {version}) - ask for the change again.",
115
+ "ai-dashboard.refusal.no-name": "A card needs a name.",
116
+ "ai-dashboard.refusal.unknown-version": "There is no such version.",
117
+ "ai-dashboard.refusal.share-unknown-scope": "An unknown share scope.",
118
+ "ai-dashboard.refusal.share-no-target": "The share names no one.",
119
+ "ai-dashboard.refusal.share-another-domain": "A card cannot be shared with another site.",
120
+ "ai-dashboard.refusal.share-no-departments": "This application has no departments to share with.",
121
+ "ai-dashboard.refusal.unknown-place": "That card is not on your dashboard.",
122
+ "ai-dashboard.refusal.size-out-of-range": "A card spans 1 to 4 columns and 1 to 2 rows.",
123
+ "ai-dashboard.refusal.people-unavailable": "People cannot be looked up here.",
124
+ "ai-dashboard.card.nothing": "No data meets this card's conditions right now.",
125
+ "ai-dashboard.card.blank": "(none)"
126
+ }
@@ -0,0 +1,126 @@
1
+ {
2
+ "ai-dashboard.title": "Mi panel",
3
+ "task.ai-dashboard.use.name": "Mi panel",
4
+ "task.ai-dashboard.use.description": "Guarda, comparte y coloca las tarjetas creadas con el asistente. Los datos de una tarjeta se leen solo con los permisos de quien la ve.",
5
+ "ai-dashboard.button.arrange": "Organizar",
6
+ "ai-dashboard.button.done": "Listo",
7
+ "ai-dashboard.button.library": "Biblioteca de tarjetas",
8
+ "ai-dashboard.button.make": "Crear tarjeta con IA",
9
+ "ai-dashboard.button.cancel": "Cancelar",
10
+ "ai-dashboard.button.save": "Guardar",
11
+ "ai-dashboard.page.lead": "Cada tarjeta se crea una vez conversando con el asistente y se dibuja con los datos actuales cada vez que se abre.",
12
+ "ai-dashboard.page.arranging": "Organizando: mueva y redimensione las tarjetas",
13
+ "ai-dashboard.page.empty-title": "Dígale al asistente qué quiere ver",
14
+ "ai-dashboard.page.empty-text": "El asistente busca los datos, decide cómo dibujarlos y los convierte en una tarjeta. Una tarjeta guardada se dibuja con los datos actuales en cualquier momento, sin el asistente.",
15
+ "ai-dashboard.page.from-library": "Añadir una tarjeta de la biblioteca",
16
+ "ai-dashboard.page.no-tokens": "Dibujar una tarjeta no llama a la IA. Sus datos se leen con los permisos de quien la ve.",
17
+ "ai-dashboard.page.make-draft": "Crea una tarjeta del panel: ",
18
+ "ai-dashboard.example.receivables": "Crea una tarjeta con barras de los cinco clientes que más nos deben",
19
+ "ai-dashboard.example.cash-trend": "Crea una tarjeta con una línea de entradas y salidas de cada mes de los últimos seis meses",
20
+ "ai-dashboard.example.month-count": "Crea una tarjeta con el número y el total de movimientos bancarios de este mes",
21
+ "ai-dashboard.card.refresh": "Volver a dibujar",
22
+ "ai-dashboard.card.ai": "Cambiar con IA",
23
+ "ai-dashboard.card.more": "Más",
24
+ "ai-dashboard.card.rename": "Cambiar nombre",
25
+ "ai-dashboard.card.share": "Compartir",
26
+ "ai-dashboard.card.versions": "Versiones",
27
+ "ai-dashboard.card.duplicate": "Duplicar",
28
+ "ai-dashboard.card.copy": "Copiar como mi tarjeta",
29
+ "ai-dashboard.card.unplace": "Quitar del panel",
30
+ "ai-dashboard.card.delete": "Eliminar tarjeta",
31
+ "ai-dashboard.card.count": "Cantidad",
32
+ "ai-dashboard.card.partial": "Calculado con {read} de {total} filas: las sumas y posiciones son de esas filas.",
33
+ "ai-dashboard.card.read-at": "a {day} · leído {time}",
34
+ "ai-dashboard.card.shared-by": "compartida por {name}",
35
+ "ai-dashboard.card.shared-with": "compartida con {names}",
36
+ "ai-dashboard.edit.left": "Mover antes",
37
+ "ai-dashboard.edit.right": "Mover después",
38
+ "ai-dashboard.edit.wider": "Más ancha",
39
+ "ai-dashboard.edit.narrower": "Más estrecha",
40
+ "ai-dashboard.edit.taller": "Más alta",
41
+ "ai-dashboard.edit.shorter": "Más baja",
42
+ "ai-dashboard.library.title": "Biblioteca de tarjetas",
43
+ "ai-dashboard.library.mine": "Mis tarjetas",
44
+ "ai-dashboard.library.shared": "Compartidas conmigo",
45
+ "ai-dashboard.library.none-mine": "Aún no hay tarjetas. Cree la primera conversando con el asistente.",
46
+ "ai-dashboard.library.none-shared": "No se ha compartido ninguna tarjeta con usted.",
47
+ "ai-dashboard.library.place": "Colocar en el panel",
48
+ "ai-dashboard.library.placed": "En el panel",
49
+ "ai-dashboard.share.title": "Compartir «{name}»",
50
+ "ai-dashboard.share.lead": "Compartir solo transmite la definición de la tarjeta. Cada persona ve solo los datos que sus propios permisos le abren.",
51
+ "ai-dashboard.share.everyone-title": "Sitio",
52
+ "ai-dashboard.share.everyone-in": "Todos en {name}",
53
+ "ai-dashboard.share.everyone": "todos",
54
+ "ai-dashboard.share.departments": "Mis departamentos",
55
+ "ai-dashboard.share.department-members": "miembros activos",
56
+ "ai-dashboard.share.people": "Personas",
57
+ "ai-dashboard.share.find-person": "Buscar por nombre",
58
+ "ai-dashboard.share.add": "Añadir",
59
+ "ai-dashboard.share.remove": "Quitar",
60
+ "ai-dashboard.share.people-unavailable": "Sus permisos no permiten buscar personas, así que no puede compartir la tarjeta con una persona.",
61
+ "ai-dashboard.share.rule": "Retirar un uso compartido quita la tarjeta del panel de la otra persona de inmediato.",
62
+ "ai-dashboard.ai.lead": "¿Cómo debe cambiar «{name}»? El asistente ofrece una nueva definición con vista previa; al guardarla se crea una nueva versión.",
63
+ "ai-dashboard.ai.placeholder": "p. ej., compárala con el mes pasado",
64
+ "ai-dashboard.ai.hint-period": "Periodo: este trimestre",
65
+ "ai-dashboard.ai.hint-top": "Mostrar los diez primeros",
66
+ "ai-dashboard.ai.hint-line": "Una línea por mes",
67
+ "ai-dashboard.ai.hint-table": "Como tabla",
68
+ "ai-dashboard.ai.send": "Enviar al asistente",
69
+ "ai-dashboard.ai.ask": "Cambia la tarjeta del panel «{name}» (versión {version}): {change}",
70
+ "ai-dashboard.versions.lead": "Elegir una versión anterior crea una nueva versión a partir de ella. No se borra ninguna versión.",
71
+ "ai-dashboard.versions.current": "Actual",
72
+ "ai-dashboard.versions.restore": "Restaurar esta",
73
+ "ai-dashboard.view.number": "Número",
74
+ "ai-dashboard.view.table": "Tabla",
75
+ "ai-dashboard.view.bar": "Barras",
76
+ "ai-dashboard.view.line": "Línea",
77
+ "ai-dashboard.preview.reading": "Dibujando la vista previa…",
78
+ "ai-dashboard.preview.note": "Vista previa · a {day}: una vez guardada, el panel la dibuja con los datos actuales sin IA",
79
+ "ai-dashboard.preview.save": "Guardar en mi panel",
80
+ "ai-dashboard.preview.saved": "Se colocó «{name}» en mi panel.",
81
+ "ai-dashboard.preview.saved-version": "Se guardó «{name}» como versión {version}.",
82
+ "ai-dashboard.text.copied": "Se copió «{name}» como mi tarjeta y se colocó en el panel.",
83
+ "ai-dashboard.text.placed": "Se colocó «{name}» en el panel.",
84
+ "ai-dashboard.text.unplaced": "Se quitó «{name}» del panel. La tarjeta sigue en la biblioteca.",
85
+ "ai-dashboard.text.shared": "Se guardó con quién se comparte «{name}».",
86
+ "ai-dashboard.text.private": "«{name}» ahora es solo suya.",
87
+ "ai-dashboard.text.restored": "Se creó una nueva versión a partir de la versión {version}.",
88
+ "ai-dashboard.text.delete": "¿Eliminar «{name}»? Se eliminan también sus versiones y sus lugares en los paneles.",
89
+ "ai-dashboard.text.delete-shared": "¿Eliminar «{name}»? También desaparece de los paneles de las personas con quienes se comparte.",
90
+ "ai-dashboard.issue.door-closed": "No tiene permiso para leer los datos de esta tarjeta.",
91
+ "ai-dashboard.issue.not-found": "No se encontró nada con estas condiciones.",
92
+ "ai-dashboard.issue.list-missing": "Los datos no tienen la forma declarada ({read}/{list}). Avise a los responsables de la aplicación.",
93
+ "ai-dashboard.issue.query-failed": "No se pudieron leer los datos: {message}",
94
+ "ai-dashboard.issue.condition-unreadable": "Los datos no aceptan las condiciones de la tarjeta. Cámbielas con IA.",
95
+ "ai-dashboard.issue.mixed-currency-order": "Las filas tienen varias monedas ({currencies}) sin un orden común. Filtre por moneda u ordene por una columna convertida.",
96
+ "ai-dashboard.issue.too-many-series": "No se pueden dibujar {series} series (máximo {max}). Agrupe de otra forma o dibuje menos valores.",
97
+ "ai-dashboard.issue.too-many-figures": "No se pueden dibujar {figures} cifras (máximo {max}).",
98
+ "ai-dashboard.issue.unknown-read": "Esta aplicación ya no ofrece los datos que leía esta tarjeta.",
99
+ "ai-dashboard.issue.not-a-card-source": "Estos datos no están declarados para tarjetas.",
100
+ "ai-dashboard.issue.unknown-list": "La lista que leía esta tarjeta ya no existe.",
101
+ "ai-dashboard.issue.unknown-column": "La columna que usa esta tarjeta ({column}) ya no está en los datos. Cámbiela con IA.",
102
+ "ai-dashboard.issue.unknown-condition": "Los datos ya no aceptan la condición de esta tarjeta ({name}). Cámbiela con IA.",
103
+ "ai-dashboard.issue.other": "No se puede dibujar esta tarjeta ({code}).",
104
+ "ai-dashboard.refusal.unknown-card": "No existe esa tarjeta.",
105
+ "ai-dashboard.refusal.card-not-shared": "Esta tarjeta no se ha compartido con usted.",
106
+ "ai-dashboard.refusal.not-your-card": "Solo quien creó esta tarjeta puede cambiarla: cópiela para tener la suya.",
107
+ "ai-dashboard.refusal.definition-unfit": "La definición de la tarjeta no encaja con sus datos ({code}).",
108
+ "ai-dashboard.refusal.unknown-conversation": "No existe esa conversación.",
109
+ "ai-dashboard.refusal.conversation-closed": "Esta conversación no está abierta para usted.",
110
+ "ai-dashboard.refusal.unknown-proposal": "No hay tal tarjeta en esta conversación.",
111
+ "ai-dashboard.refusal.not-a-card": "Esta propuesta no es una tarjeta del panel.",
112
+ "ai-dashboard.refusal.superseded": "Una tarjeta más reciente reemplazó a esta en la conversación: guarde esa.",
113
+ "ai-dashboard.refusal.data-closed": "No tiene permiso para leer los datos de esta tarjeta.",
114
+ "ai-dashboard.refusal.stale-version": "La tarjeta cambió después de esta propuesta (ahora versión {version}): vuelva a pedir el cambio.",
115
+ "ai-dashboard.refusal.no-name": "Una tarjeta necesita un nombre.",
116
+ "ai-dashboard.refusal.unknown-version": "No existe esa versión.",
117
+ "ai-dashboard.refusal.share-unknown-scope": "Un ámbito de uso compartido desconocido.",
118
+ "ai-dashboard.refusal.share-no-target": "El uso compartido no nombra a nadie.",
119
+ "ai-dashboard.refusal.share-another-domain": "No se puede compartir una tarjeta con otro sitio.",
120
+ "ai-dashboard.refusal.share-no-departments": "Esta aplicación no tiene departamentos con los que compartir.",
121
+ "ai-dashboard.refusal.unknown-place": "Esa tarjeta no está en su panel.",
122
+ "ai-dashboard.refusal.size-out-of-range": "Una tarjeta ocupa de 1 a 4 columnas y de 1 a 2 filas.",
123
+ "ai-dashboard.refusal.people-unavailable": "Aquí no se pueden buscar personas.",
124
+ "ai-dashboard.card.nothing": "Ahora no hay datos que cumplan las condiciones de esta tarjeta.",
125
+ "ai-dashboard.card.blank": "(sin indicar)"
126
+ }