@things-factory/figure-service 10.1.291 → 10.1.297
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-server/service/capability-module/capability-module-entity.d.ts +20 -0
- package/dist-server/service/capability-module/capability-module-entity.js +112 -11
- package/dist-server/service/capability-module/capability-module-resolver.js +13 -10
- package/dist-server/service/capability-module/capability-module-store.d.ts +4 -6
- package/dist-server/service/capability-module/capability-module-store.js +12 -23
- package/dist-server/service/capability-module/capability-release-check.js +16 -5
- package/dist-server/service/figure/figure-format.d.ts +15 -4
- package/dist-server/service/figure/figure-format.js +4 -3
- package/dist-server/service/figure/figure-mutation.js +2 -2
- package/dist-server/service/figure/figure-query.js +5 -5
- package/dist-server/service/figure/figure-tools.js +2 -2
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/service/install-key/figure-install-key.d.ts +10 -8
- package/dist-server/service/install-key/figure-install-key.js +31 -33
- package/package.json +13 -9
- package/translations/en.json +4 -5
- package/translations/es.json +4 -5
- package/translations/ja.json +4 -5
- package/translations/ko.json +4 -5
- package/translations/ms.json +4 -5
- package/translations/zh.json +4 -5
|
@@ -16,8 +16,11 @@ export declare class FigureCapabilityModule {
|
|
|
16
16
|
capabilities?: string[];
|
|
17
17
|
current?: boolean;
|
|
18
18
|
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
19
20
|
creator?: User;
|
|
20
21
|
creatorId?: string;
|
|
22
|
+
updater?: User;
|
|
23
|
+
updaterId?: string;
|
|
21
24
|
}
|
|
22
25
|
/** A provider a domain chose (ADR-0172 decision 5): its modeller loads it and its releases are checked by it. */
|
|
23
26
|
export declare class FigureCapabilityUse {
|
|
@@ -26,7 +29,11 @@ export declare class FigureCapabilityUse {
|
|
|
26
29
|
domainId?: string;
|
|
27
30
|
provider?: string;
|
|
28
31
|
createdAt?: Date;
|
|
32
|
+
updatedAt?: Date;
|
|
29
33
|
creator?: User;
|
|
34
|
+
creatorId?: string;
|
|
35
|
+
updater?: User;
|
|
36
|
+
updaterId?: string;
|
|
30
37
|
}
|
|
31
38
|
/**
|
|
32
39
|
* The choice lists a domain's own provider pushed with its module (ADR-0172 amendment 2, decisions 19 and 20): the
|
|
@@ -35,9 +42,15 @@ export declare class FigureCapabilityUse {
|
|
|
35
42
|
export declare class FigureCapabilityChoiceLists {
|
|
36
43
|
readonly id?: string;
|
|
37
44
|
domain?: Domain;
|
|
45
|
+
domainId?: string;
|
|
38
46
|
provider?: string;
|
|
39
47
|
choices?: Record<string, unknown[]>;
|
|
48
|
+
createdAt?: Date;
|
|
40
49
|
updatedAt?: Date;
|
|
50
|
+
creator?: User;
|
|
51
|
+
creatorId?: string;
|
|
52
|
+
updater?: User;
|
|
53
|
+
updaterId?: string;
|
|
41
54
|
}
|
|
42
55
|
/**
|
|
43
56
|
* What an install key may push besides reading released figures (ADR-0172 decision 14): the capability module of one
|
|
@@ -46,7 +59,14 @@ export declare class FigureCapabilityChoiceLists {
|
|
|
46
59
|
export declare class FigureInstallKeyCapability {
|
|
47
60
|
readonly id?: string;
|
|
48
61
|
domain?: Domain;
|
|
62
|
+
domainId?: string;
|
|
49
63
|
/** The install key (an appliance) */
|
|
50
64
|
applianceId?: string;
|
|
51
65
|
provider?: string;
|
|
66
|
+
createdAt?: Date;
|
|
67
|
+
updatedAt?: Date;
|
|
68
|
+
creator?: User;
|
|
69
|
+
creatorId?: string;
|
|
70
|
+
updater?: User;
|
|
71
|
+
updaterId?: string;
|
|
52
72
|
}
|
|
@@ -59,6 +59,11 @@ tslib_1.__decorate([
|
|
|
59
59
|
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was registered.' }),
|
|
60
60
|
tslib_1.__metadata("design:type", Date)
|
|
61
61
|
], FigureCapabilityModule.prototype, "createdAt", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
64
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed.' }),
|
|
65
|
+
tslib_1.__metadata("design:type", Date)
|
|
66
|
+
], FigureCapabilityModule.prototype, "updatedAt", void 0);
|
|
62
67
|
tslib_1.__decorate([
|
|
63
68
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
64
69
|
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who registered it.' }),
|
|
@@ -68,9 +73,18 @@ tslib_1.__decorate([
|
|
|
68
73
|
(0, typeorm_1.RelationId)((m) => m.creator),
|
|
69
74
|
tslib_1.__metadata("design:type", String)
|
|
70
75
|
], FigureCapabilityModule.prototype, "creatorId", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it.' }),
|
|
79
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
80
|
+
], FigureCapabilityModule.prototype, "updater", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.RelationId)((m) => m.updater),
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
84
|
+
], FigureCapabilityModule.prototype, "updaterId", void 0);
|
|
71
85
|
exports.FigureCapabilityModule = FigureCapabilityModule = tslib_1.__decorate([
|
|
72
|
-
(0, typeorm_1.Entity)(),
|
|
73
|
-
(0, typeorm_1.Index)('ix_figure_capability_module_0', (m) => [m.provider, m.version, m.domain]),
|
|
86
|
+
(0, typeorm_1.Entity)('figure_capability_modules'),
|
|
87
|
+
(0, typeorm_1.Index)('ix_figure_capability_module_0', (m) => [m.provider, m.version, m.domain], { unique: true }),
|
|
74
88
|
(0, typeorm_1.Index)('ix_figure_capability_module_1', (m) => [m.sha256]),
|
|
75
89
|
(0, type_graphql_1.ObjectType)({ description: "One version of a capability module: a provider's descriptors in one ESM file." })
|
|
76
90
|
], FigureCapabilityModule);
|
|
@@ -85,6 +99,7 @@ tslib_1.__decorate([
|
|
|
85
99
|
], FigureCapabilityUse.prototype, "id", void 0);
|
|
86
100
|
tslib_1.__decorate([
|
|
87
101
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
102
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'The domain that uses it.' }),
|
|
88
103
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
89
104
|
], FigureCapabilityUse.prototype, "domain", void 0);
|
|
90
105
|
tslib_1.__decorate([
|
|
@@ -98,15 +113,34 @@ tslib_1.__decorate([
|
|
|
98
113
|
], FigureCapabilityUse.prototype, "provider", void 0);
|
|
99
114
|
tslib_1.__decorate([
|
|
100
115
|
(0, typeorm_1.CreateDateColumn)(),
|
|
101
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was
|
|
116
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was made.' }),
|
|
102
117
|
tslib_1.__metadata("design:type", Date)
|
|
103
118
|
], FigureCapabilityUse.prototype, "createdAt", void 0);
|
|
119
|
+
tslib_1.__decorate([
|
|
120
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
121
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed.' }),
|
|
122
|
+
tslib_1.__metadata("design:type", Date)
|
|
123
|
+
], FigureCapabilityUse.prototype, "updatedAt", void 0);
|
|
104
124
|
tslib_1.__decorate([
|
|
105
125
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
126
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
|
|
106
127
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
107
128
|
], FigureCapabilityUse.prototype, "creator", void 0);
|
|
129
|
+
tslib_1.__decorate([
|
|
130
|
+
(0, typeorm_1.RelationId)((u) => u.creator),
|
|
131
|
+
tslib_1.__metadata("design:type", String)
|
|
132
|
+
], FigureCapabilityUse.prototype, "creatorId", void 0);
|
|
133
|
+
tslib_1.__decorate([
|
|
134
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
135
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it.' }),
|
|
136
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
137
|
+
], FigureCapabilityUse.prototype, "updater", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, typeorm_1.RelationId)((u) => u.updater),
|
|
140
|
+
tslib_1.__metadata("design:type", String)
|
|
141
|
+
], FigureCapabilityUse.prototype, "updaterId", void 0);
|
|
108
142
|
exports.FigureCapabilityUse = FigureCapabilityUse = tslib_1.__decorate([
|
|
109
|
-
(0, typeorm_1.Entity)(),
|
|
143
|
+
(0, typeorm_1.Entity)('figure_capability_uses'),
|
|
110
144
|
(0, typeorm_1.Index)('ix_figure_capability_use_0', (u) => [u.domain, u.provider], { unique: true }),
|
|
111
145
|
(0, type_graphql_1.ObjectType)({ description: 'A capability provider a domain uses.' })
|
|
112
146
|
], FigureCapabilityUse);
|
|
@@ -119,27 +153,59 @@ let FigureCapabilityChoiceLists = class FigureCapabilityChoiceLists {
|
|
|
119
153
|
exports.FigureCapabilityChoiceLists = FigureCapabilityChoiceLists;
|
|
120
154
|
tslib_1.__decorate([
|
|
121
155
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
156
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier.' }),
|
|
122
157
|
tslib_1.__metadata("design:type", String)
|
|
123
158
|
], FigureCapabilityChoiceLists.prototype, "id", void 0);
|
|
124
159
|
tslib_1.__decorate([
|
|
125
160
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
161
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'The domain whose provider pushed them.' }),
|
|
126
162
|
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
127
163
|
], FigureCapabilityChoiceLists.prototype, "domain", void 0);
|
|
164
|
+
tslib_1.__decorate([
|
|
165
|
+
(0, typeorm_1.RelationId)((c) => c.domain),
|
|
166
|
+
tslib_1.__metadata("design:type", String)
|
|
167
|
+
], FigureCapabilityChoiceLists.prototype, "domainId", void 0);
|
|
128
168
|
tslib_1.__decorate([
|
|
129
169
|
(0, typeorm_1.Column)(),
|
|
170
|
+
(0, type_graphql_1.Field)({ description: 'The provider.' }),
|
|
130
171
|
tslib_1.__metadata("design:type", String)
|
|
131
172
|
], FigureCapabilityChoiceLists.prototype, "provider", void 0);
|
|
132
173
|
tslib_1.__decorate([
|
|
133
174
|
(0, typeorm_1.Column)('simple-json'),
|
|
134
175
|
tslib_1.__metadata("design:type", Object)
|
|
135
176
|
], FigureCapabilityChoiceLists.prototype, "choices", void 0);
|
|
177
|
+
tslib_1.__decorate([
|
|
178
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
179
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was made.' }),
|
|
180
|
+
tslib_1.__metadata("design:type", Date)
|
|
181
|
+
], FigureCapabilityChoiceLists.prototype, "createdAt", void 0);
|
|
136
182
|
tslib_1.__decorate([
|
|
137
183
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
184
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed.' }),
|
|
138
185
|
tslib_1.__metadata("design:type", Date)
|
|
139
186
|
], FigureCapabilityChoiceLists.prototype, "updatedAt", void 0);
|
|
187
|
+
tslib_1.__decorate([
|
|
188
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
189
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
|
|
190
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
191
|
+
], FigureCapabilityChoiceLists.prototype, "creator", void 0);
|
|
192
|
+
tslib_1.__decorate([
|
|
193
|
+
(0, typeorm_1.RelationId)((c) => c.creator),
|
|
194
|
+
tslib_1.__metadata("design:type", String)
|
|
195
|
+
], FigureCapabilityChoiceLists.prototype, "creatorId", void 0);
|
|
196
|
+
tslib_1.__decorate([
|
|
197
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
198
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it.' }),
|
|
199
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
200
|
+
], FigureCapabilityChoiceLists.prototype, "updater", void 0);
|
|
201
|
+
tslib_1.__decorate([
|
|
202
|
+
(0, typeorm_1.RelationId)((c) => c.updater),
|
|
203
|
+
tslib_1.__metadata("design:type", String)
|
|
204
|
+
], FigureCapabilityChoiceLists.prototype, "updaterId", void 0);
|
|
140
205
|
exports.FigureCapabilityChoiceLists = FigureCapabilityChoiceLists = tslib_1.__decorate([
|
|
141
|
-
(0, typeorm_1.Entity)(),
|
|
142
|
-
(0, typeorm_1.Index)('
|
|
206
|
+
(0, typeorm_1.Entity)('figure_capability_choice_lists'),
|
|
207
|
+
(0, typeorm_1.Index)('ix_figure_capability_choice_list_0', (c) => [c.domain, c.provider], { unique: true }),
|
|
208
|
+
(0, type_graphql_1.ObjectType)({ description: "The choice lists a domain's provider pushed with its module." })
|
|
143
209
|
], FigureCapabilityChoiceLists);
|
|
144
210
|
/**
|
|
145
211
|
* What an install key may push besides reading released figures (ADR-0172 decision 14): the capability module of one
|
|
@@ -150,24 +216,59 @@ let FigureInstallKeyCapability = class FigureInstallKeyCapability {
|
|
|
150
216
|
exports.FigureInstallKeyCapability = FigureInstallKeyCapability;
|
|
151
217
|
tslib_1.__decorate([
|
|
152
218
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
219
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier.' }),
|
|
153
220
|
tslib_1.__metadata("design:type", String)
|
|
154
221
|
], FigureInstallKeyCapability.prototype, "id", void 0);
|
|
155
222
|
tslib_1.__decorate([
|
|
156
223
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
)
|
|
224
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { description: 'The domain the key is of.' }),
|
|
225
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
160
226
|
], FigureInstallKeyCapability.prototype, "domain", void 0);
|
|
227
|
+
tslib_1.__decorate([
|
|
228
|
+
(0, typeorm_1.RelationId)((g) => g.domain),
|
|
229
|
+
tslib_1.__metadata("design:type", String)
|
|
230
|
+
], FigureInstallKeyCapability.prototype, "domainId", void 0);
|
|
161
231
|
tslib_1.__decorate([
|
|
162
232
|
(0, typeorm_1.Column)(),
|
|
233
|
+
(0, type_graphql_1.Field)({ description: 'The install key (an appliance).' }),
|
|
163
234
|
tslib_1.__metadata("design:type", String)
|
|
164
235
|
], FigureInstallKeyCapability.prototype, "applianceId", void 0);
|
|
165
236
|
tslib_1.__decorate([
|
|
166
237
|
(0, typeorm_1.Column)(),
|
|
238
|
+
(0, type_graphql_1.Field)({ description: 'The provider whose module it pushes: the one its first push registered.' }),
|
|
167
239
|
tslib_1.__metadata("design:type", String)
|
|
168
240
|
], FigureInstallKeyCapability.prototype, "provider", void 0);
|
|
241
|
+
tslib_1.__decorate([
|
|
242
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
243
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was made.' }),
|
|
244
|
+
tslib_1.__metadata("design:type", Date)
|
|
245
|
+
], FigureInstallKeyCapability.prototype, "createdAt", void 0);
|
|
246
|
+
tslib_1.__decorate([
|
|
247
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
248
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When it was last changed.' }),
|
|
249
|
+
tslib_1.__metadata("design:type", Date)
|
|
250
|
+
], FigureInstallKeyCapability.prototype, "updatedAt", void 0);
|
|
251
|
+
tslib_1.__decorate([
|
|
252
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
253
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who made it.' }),
|
|
254
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
255
|
+
], FigureInstallKeyCapability.prototype, "creator", void 0);
|
|
256
|
+
tslib_1.__decorate([
|
|
257
|
+
(0, typeorm_1.RelationId)((g) => g.creator),
|
|
258
|
+
tslib_1.__metadata("design:type", String)
|
|
259
|
+
], FigureInstallKeyCapability.prototype, "creatorId", void 0);
|
|
260
|
+
tslib_1.__decorate([
|
|
261
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
262
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it.' }),
|
|
263
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
264
|
+
], FigureInstallKeyCapability.prototype, "updater", void 0);
|
|
265
|
+
tslib_1.__decorate([
|
|
266
|
+
(0, typeorm_1.RelationId)((g) => g.updater),
|
|
267
|
+
tslib_1.__metadata("design:type", String)
|
|
268
|
+
], FigureInstallKeyCapability.prototype, "updaterId", void 0);
|
|
169
269
|
exports.FigureInstallKeyCapability = FigureInstallKeyCapability = tslib_1.__decorate([
|
|
170
|
-
(0, typeorm_1.Entity)(),
|
|
171
|
-
(0, typeorm_1.Index)('ix_figure_install_key_capability_0', (g) => [g.applianceId], { unique: true })
|
|
270
|
+
(0, typeorm_1.Entity)('figure_install_key_capabilities'),
|
|
271
|
+
(0, typeorm_1.Index)('ix_figure_install_key_capability_0', (g) => [g.applianceId], { unique: true }),
|
|
272
|
+
(0, type_graphql_1.ObjectType)({ description: 'The capability provider an install key may push.' })
|
|
172
273
|
], FigureInstallKeyCapability);
|
|
173
274
|
//# sourceMappingURL=capability-module-entity.js.map
|
|
@@ -95,26 +95,29 @@ let FigureCapabilityModuleResolver = class FigureCapabilityModuleResolver {
|
|
|
95
95
|
return (0, capability_module_store_js_1.registerCapabilityModule)(tx, { bytes: await bytesOf(file), owner: null, asker: domain, user });
|
|
96
96
|
}
|
|
97
97
|
async setCurrentFigureCapabilityModule(provider, version, context) {
|
|
98
|
-
const { tx } = context.state;
|
|
99
|
-
return (0, capability_module_store_js_1.setCurrentCapabilityModule)(tx, provider, version);
|
|
98
|
+
const { tx, user } = context.state;
|
|
99
|
+
return (0, capability_module_store_js_1.setCurrentCapabilityModule)(tx, provider, version, user);
|
|
100
100
|
}
|
|
101
101
|
/*
|
|
102
102
|
* A consuming app's push over its figure server link (ADR-0172 amendment 1, decisions 13-15): the caller is an install
|
|
103
|
-
* key's user
|
|
104
|
-
*
|
|
103
|
+
* key's user -- every install key's role holds `figure-capability-push` mutation (decision 14). The key's first push
|
|
104
|
+
* keeps its provider in a grant row; the key pushes that provider only since. The module becomes this domain's,
|
|
105
|
+
* chosen here at once.
|
|
105
106
|
*/
|
|
106
107
|
async pushFigureCapabilityModule(source, context, choices) {
|
|
107
108
|
const { domain, user, tx } = context.state;
|
|
108
109
|
const applianceId = user?.userType === 'appliance' ? user.reference : undefined;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
if (!applianceId)
|
|
111
|
+
throw new shell_1.Refusal('figure-capability-push-not-allowed', {}, 'only an install key pushes a capability module.');
|
|
112
|
+
const grant = await tx.getRepository(capability_module_entity_js_1.FigureInstallKeyCapability).findOne({ where: { applianceId, domain: { id: domain.id } } });
|
|
112
113
|
const bytes = Buffer.from(String(source ?? ''), 'utf8');
|
|
113
114
|
if (bytes.length > capability_module_store_js_1.MODULE_MAX_BYTES)
|
|
114
115
|
throw new shell_1.Refusal('figure-capability-module-too-large', { max: capability_module_store_js_1.MODULE_MAX_BYTES }, 'a capability module is at most {max} bytes.');
|
|
115
|
-
const m = await (0, capability_module_store_js_1.registerCapabilityModule)(tx, { bytes, owner: domain, asker: domain, user, provider: grant.provider });
|
|
116
|
+
const m = await (0, capability_module_store_js_1.registerCapabilityModule)(tx, { bytes, owner: domain, asker: domain, user, ...(grant ? { provider: grant.provider } : {}) });
|
|
117
|
+
if (!grant)
|
|
118
|
+
await tx.getRepository(capability_module_entity_js_1.FigureInstallKeyCapability).save({ domain, applianceId, provider: m.provider, creator: user, updater: user });
|
|
116
119
|
if (choices)
|
|
117
|
-
await (0, capability_module_store_js_1.keepCapabilityChoices)(tx, domain, m.provider, choices);
|
|
120
|
+
await (0, capability_module_store_js_1.keepCapabilityChoices)(tx, domain, m.provider, choices, user);
|
|
118
121
|
return { provider: m.provider, version: m.version, sha256: m.sha256, capabilities: m.capabilities ?? [] };
|
|
119
122
|
}
|
|
120
123
|
};
|
|
@@ -179,7 +182,7 @@ tslib_1.__decorate([
|
|
|
179
182
|
], FigureCapabilityModuleResolver.prototype, "setCurrentFigureCapabilityModule", null);
|
|
180
183
|
tslib_1.__decorate([
|
|
181
184
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
182
|
-
(0, type_graphql_1.Directive)('@privilege(category: "figure-
|
|
185
|
+
(0, type_graphql_1.Directive)('@privilege(category: "figure-capability-push", privilege: "mutation")'),
|
|
183
186
|
(0, type_graphql_1.Mutation)(returns => FigureCapabilityModuleRef, { description: "Pushes the caller app's capability module to this domain, with an install key that may push it." }),
|
|
184
187
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('source', { description: 'The module file, as text.' })),
|
|
185
188
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
@@ -61,7 +61,7 @@ export declare function registerCapabilityModule(tx: Tx, input: {
|
|
|
61
61
|
* version when only the lists changed. Refused when they break the shape or name another provider's capability.
|
|
62
62
|
* Answers whether they were written.
|
|
63
63
|
*/
|
|
64
|
-
export declare function keepCapabilityChoices(tx: Tx, domain: Domain, provider: string, choices: unknown): Promise<boolean>;
|
|
64
|
+
export declare function keepCapabilityChoices(tx: Tx, domain: Domain, provider: string, choices: unknown, user?: Actor): Promise<boolean>;
|
|
65
65
|
/**
|
|
66
66
|
* The choice lists of the providers a domain uses, by `<capability>.<setting>` (decision 21): those its own providers
|
|
67
67
|
* pushed. A system provider has none.
|
|
@@ -70,7 +70,7 @@ export declare function chosenCapabilityChoices(tx: Tx, domain: {
|
|
|
70
70
|
id: string;
|
|
71
71
|
}): Promise<FigureCapabilityChoices>;
|
|
72
72
|
/** Makes one kept version of a system provider its current one again (a step back). */
|
|
73
|
-
export declare function setCurrentCapabilityModule(tx: Tx, provider: string, version: string): Promise<FigureCapabilityModule>;
|
|
73
|
+
export declare function setCurrentCapabilityModule(tx: Tx, provider: string, version: string, user?: Actor): Promise<FigureCapabilityModule>;
|
|
74
74
|
/** Uses a provider in a domain, or stops using it (decision 5). Refused for a provider nobody registered for it. */
|
|
75
75
|
export declare function chooseProvider(tx: Tx, domain: Domain, provider: string, on: boolean, user: Actor): Promise<boolean>;
|
|
76
76
|
/** The modules a domain uses: the current version of every provider it chose. A parent's choice is not inherited. */
|
|
@@ -95,15 +95,13 @@ export declare function chosenModuleBytes(tx: Tx, domain: {
|
|
|
95
95
|
id: string;
|
|
96
96
|
}, sha256: string, files?: ThumbnailFiles): Promise<Buffer | undefined>;
|
|
97
97
|
/**
|
|
98
|
-
* Loads the modules a domain uses, for the release check
|
|
98
|
+
* Loads the modules a domain uses and answers their descriptors, for the caller to give the release check (decision 9): each file from the data folder, or from
|
|
99
99
|
* attachment-base when the folder does not have it yet. A module that does not load is left out, and the figure's
|
|
100
100
|
* capabilities of it are then not verified -- the check blocks them.
|
|
101
101
|
*/
|
|
102
102
|
export declare function prepareCapabilityModules(tx: Tx, domain: {
|
|
103
103
|
id: string;
|
|
104
104
|
}, files?: ThumbnailFiles, folder?: string): Promise<Map<string, FigureCapabilityDescriptor>>;
|
|
105
|
-
/**
|
|
106
|
-
export declare const preparedDescriptors: (domainId?: string) => ReadonlyMap<string, FigureCapabilityDescriptor>;
|
|
107
|
-
/** For tests: forget loaded and prepared modules. */
|
|
105
|
+
/** For tests: forget loaded modules. */
|
|
108
106
|
export declare function forgetCapabilityModules(): void;
|
|
109
107
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.moduleFolder = exports.MODULE_MAX_BYTES = exports.MODULE_MIMETYPE = exports.MODULE_REF_TYPE = void 0;
|
|
4
4
|
exports.useModuleFolder = useModuleFolder;
|
|
5
5
|
exports.loadModuleBytes = loadModuleBytes;
|
|
6
6
|
exports.moduleContractOf = moduleContractOf;
|
|
@@ -57,11 +57,6 @@ function useModuleFolder(folder) {
|
|
|
57
57
|
folderInUse = folder;
|
|
58
58
|
return before;
|
|
59
59
|
}
|
|
60
|
-
/*
|
|
61
|
-
* Node's own require, which loads an ES module (22.12+): taken from the built-in module so that a loader in front of
|
|
62
|
-
* this file's `require` (a test runner's) does not stand between the file and Node.
|
|
63
|
-
*/
|
|
64
|
-
const nodeRequire = process.getBuiltinModule?.('node:module')?.createRequire(__filename) ?? require;
|
|
65
60
|
/* Loaded modules by hash: the content is its hash, so a loaded one never changes. */
|
|
66
61
|
const loaded = new Map();
|
|
67
62
|
/**
|
|
@@ -84,7 +79,7 @@ function loadModuleBytes(sha256, bytes, folder) {
|
|
|
84
79
|
(0, fs_1.writeFileSync)(partial, bytes);
|
|
85
80
|
(0, fs_1.renameSync)(partial, file);
|
|
86
81
|
}
|
|
87
|
-
const module =
|
|
82
|
+
const module = (0, env_1.requireModuleFile)(file);
|
|
88
83
|
loaded.set(sha256, module);
|
|
89
84
|
return module;
|
|
90
85
|
}
|
|
@@ -169,7 +164,7 @@ async function registerCapabilityModule(tx, input, files = (0, figure_thumbnail_
|
|
|
169
164
|
});
|
|
170
165
|
}
|
|
171
166
|
for (const v of versions.filter(v => v.current))
|
|
172
|
-
await repo.save({ ...v, current: false });
|
|
167
|
+
await repo.save({ ...v, current: false, updater: byId(input.user) });
|
|
173
168
|
const saved = await repo.save({
|
|
174
169
|
domain: input.owner,
|
|
175
170
|
provider,
|
|
@@ -177,7 +172,8 @@ async function registerCapabilityModule(tx, input, files = (0, figure_thumbnail_
|
|
|
177
172
|
sha256,
|
|
178
173
|
capabilities: module.capabilities.map(d => d.name),
|
|
179
174
|
current: true,
|
|
180
|
-
creator: byId(input.user)
|
|
175
|
+
creator: byId(input.user),
|
|
176
|
+
updater: byId(input.user)
|
|
181
177
|
});
|
|
182
178
|
if (input.owner)
|
|
183
179
|
await chooseProvider(tx, input.owner, provider, true, input.user);
|
|
@@ -189,7 +185,7 @@ async function registerCapabilityModule(tx, input, files = (0, figure_thumbnail_
|
|
|
189
185
|
* version when only the lists changed. Refused when they break the shape or name another provider's capability.
|
|
190
186
|
* Answers whether they were written.
|
|
191
187
|
*/
|
|
192
|
-
async function keepCapabilityChoices(tx, domain, provider, choices) {
|
|
188
|
+
async function keepCapabilityChoices(tx, domain, provider, choices, user) {
|
|
193
189
|
const issues = (0, figure_model_1.capabilityChoicesIssues)(choices, provider);
|
|
194
190
|
if (issues.length)
|
|
195
191
|
throw new shell_1.Refusal('figure-capability-choices-invalid', { issues: issues.slice(0, 5).join(' · ') }, 'the choice lists cannot be taken: {issues}');
|
|
@@ -197,7 +193,7 @@ async function keepCapabilityChoices(tx, domain, provider, choices) {
|
|
|
197
193
|
const found = await repo.findOne({ where: { domain: { id: domain.id }, provider } });
|
|
198
194
|
if (found && (0, figure_thumbnail_store_js_1.sha256Of)(Buffer.from(JSON.stringify(found.choices ?? {}))) === (0, figure_thumbnail_store_js_1.sha256Of)(Buffer.from(JSON.stringify(choices))))
|
|
199
195
|
return false;
|
|
200
|
-
await repo.save({ ...(found ?? { domain, provider }), choices });
|
|
196
|
+
await repo.save({ ...(found ?? { domain, provider, creator: byId(user) }), choices, updater: byId(user) });
|
|
201
197
|
return true;
|
|
202
198
|
}
|
|
203
199
|
/**
|
|
@@ -210,7 +206,7 @@ async function chosenCapabilityChoices(tx, domain) {
|
|
|
210
206
|
return Object.assign({}, ...rows.filter(r => providers.has(r.provider)).map(r => r.choices ?? {}));
|
|
211
207
|
}
|
|
212
208
|
/** Makes one kept version of a system provider its current one again (a step back). */
|
|
213
|
-
async function setCurrentCapabilityModule(tx, provider, version) {
|
|
209
|
+
async function setCurrentCapabilityModule(tx, provider, version, user) {
|
|
214
210
|
const repo = tx.getRepository(capability_module_entity_js_1.FigureCapabilityModule);
|
|
215
211
|
const versions = await repo.find({ where: { provider, domain: (0, typeorm_1.IsNull)() } });
|
|
216
212
|
const target = versions.find(v => v.version === version);
|
|
@@ -218,7 +214,7 @@ async function setCurrentCapabilityModule(tx, provider, version) {
|
|
|
218
214
|
throw new shell_1.Refusal('figure-capability-module-not-found', { provider, version }, 'there is no {provider} {version}.');
|
|
219
215
|
for (const v of versions)
|
|
220
216
|
if (v.current !== (v === target))
|
|
221
|
-
await repo.save({ ...v, current: v === target });
|
|
217
|
+
await repo.save({ ...v, current: v === target, updater: byId(user) });
|
|
222
218
|
return { ...target, current: true };
|
|
223
219
|
}
|
|
224
220
|
/** Uses a provider in a domain, or stops using it (decision 5). Refused for a provider nobody registered for it. */
|
|
@@ -234,7 +230,7 @@ async function chooseProvider(tx, domain, provider, on, user) {
|
|
|
234
230
|
return true;
|
|
235
231
|
if (!(await currentOf(tx, domain, provider)))
|
|
236
232
|
throw new shell_1.Refusal('figure-capability-provider-unknown', { provider }, 'no capability module of {provider} is registered.');
|
|
237
|
-
await uses.save({ domain, provider, creator: byId(user) });
|
|
233
|
+
await uses.save({ domain, provider, creator: byId(user), updater: byId(user) });
|
|
238
234
|
return true;
|
|
239
235
|
}
|
|
240
236
|
/**
|
|
@@ -281,10 +277,8 @@ async function chosenModuleBytes(tx, domain, sha256, files = (0, figure_thumbnai
|
|
|
281
277
|
const kept = await moduleAttachmentOf(tx, sha256);
|
|
282
278
|
return kept ? Buffer.from(await files.read(kept.path)) : undefined;
|
|
283
279
|
}
|
|
284
|
-
/* The descriptors each domain's release check reads, made ready before the check (which is synchronous) runs. */
|
|
285
|
-
const prepared = new Map();
|
|
286
280
|
/**
|
|
287
|
-
* Loads the modules a domain uses, for the release check
|
|
281
|
+
* Loads the modules a domain uses and answers their descriptors, for the caller to give the release check (decision 9): each file from the data folder, or from
|
|
288
282
|
* attachment-base when the folder does not have it yet. A module that does not load is left out, and the figure's
|
|
289
283
|
* capabilities of it are then not verified -- the check blocks them.
|
|
290
284
|
*/
|
|
@@ -311,15 +305,10 @@ async function prepareCapabilityModules(tx, domain, files = (0, figure_thumbnail
|
|
|
311
305
|
console.warn(`[figure] capability module ${m.provider} ${m.version} did not load: ${e?.message ?? e}`);
|
|
312
306
|
}
|
|
313
307
|
}
|
|
314
|
-
prepared.set(domain.id, descriptors);
|
|
315
308
|
return descriptors;
|
|
316
309
|
}
|
|
317
|
-
/**
|
|
318
|
-
const preparedDescriptors = (domainId) => (domainId && prepared.get(domainId)) || new Map();
|
|
319
|
-
exports.preparedDescriptors = preparedDescriptors;
|
|
320
|
-
/** For tests: forget loaded and prepared modules. */
|
|
310
|
+
/** For tests: forget loaded modules. */
|
|
321
311
|
function forgetCapabilityModules() {
|
|
322
312
|
loaded.clear();
|
|
323
|
-
prepared.clear();
|
|
324
313
|
}
|
|
325
314
|
//# sourceMappingURL=capability-module-store.js.map
|
|
@@ -4,7 +4,15 @@ exports.capabilityFindings = capabilityFindings;
|
|
|
4
4
|
exports.capabilityReleaseCheck = capabilityReleaseCheck;
|
|
5
5
|
const figure_model_1 = require("@hatiolab/figure-model");
|
|
6
6
|
const figure_format_js_1 = require("../figure/figure-format.js");
|
|
7
|
-
|
|
7
|
+
/** Words joined as the language joins a list: "A, B and C", or "A or B". */
|
|
8
|
+
function list(lang, type, words) {
|
|
9
|
+
try {
|
|
10
|
+
return new Intl.ListFormat(lang, { type }).format(words);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return new Intl.ListFormat('en', { type }).format(words);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
8
16
|
/** The findings for a figure's consumer capabilities, by these descriptors, in these words. */
|
|
9
17
|
function capabilityFindings(asset, descriptors, say, lang = 'en') {
|
|
10
18
|
const names = (asset.document.capabilities.names ?? []).filter(figure_model_1.isFigureConsumerCapability);
|
|
@@ -26,7 +34,10 @@ function capabilityFindings(asset, descriptors, say, lang = 'en') {
|
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
if (issue.code === 'CAPABILITY_NEEDS') {
|
|
29
|
-
|
|
37
|
+
/* Said from `needs` in the reader's words: each group as "this or that", the groups as a list. The verdict's
|
|
38
|
+
`reasons` are a log's words. */
|
|
39
|
+
const word = (need) => (need === 'item' ? say('figure.gate.capability-needs.item', {}, "'Used as an item'") : label(need));
|
|
40
|
+
const needs = list(lang, 'conjunction', (issue.needs ?? []).map(group => list(lang, 'disjunction', group.map(word))));
|
|
30
41
|
return {
|
|
31
42
|
code: 'capability-needs',
|
|
32
43
|
message: say('figure.gate.capability-needs.message', { name, needs }, `The capability '${name}' needs ${needs}.`),
|
|
@@ -49,9 +60,9 @@ function capabilityFindings(asset, descriptors, say, lang = 'en') {
|
|
|
49
60
|
function capabilityReleaseCheck(input) {
|
|
50
61
|
const t = input.t;
|
|
51
62
|
const say = (key, params, english) => (t ? t(key, { ...params, defaultValue: english, interpolation: { escapeValue: false } }) : english);
|
|
52
|
-
/* The language
|
|
53
|
-
const lang =
|
|
54
|
-
return capabilityFindings(input.asset,
|
|
63
|
+
/* The reader's language (the request's), for the module's own words. */
|
|
64
|
+
const lang = input.lng || 'en';
|
|
65
|
+
return capabilityFindings(input.asset, input.capabilities ?? new Map(), say, lang);
|
|
55
66
|
}
|
|
56
67
|
(0, figure_format_js_1.registerFigureReleaseCheck)(capabilityReleaseCheck);
|
|
57
68
|
//# sourceMappingURL=capability-release-check.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FigureAsset, FigureContractChange, FigureReleaseMetrics, FigureTopView } from '@hatiolab/figure-model';
|
|
1
|
+
import type { FigureAsset, FigureCapabilityDescriptor, FigureContractChange, FigureReleaseMetrics, FigureTopView } from '@hatiolab/figure-model';
|
|
2
2
|
import type { FigureFinding } from './figure-type.js';
|
|
3
3
|
/** The version the format stamps on its own source. */
|
|
4
4
|
export declare const FIGURE_ASSET_VERSION = "figure-asset-1";
|
|
@@ -51,6 +51,13 @@ export interface FigureReleaseCheckInput {
|
|
|
51
51
|
domain?: {
|
|
52
52
|
id: string;
|
|
53
53
|
};
|
|
54
|
+
/** The reader's language, the one `t` speaks: for words a module carries per language (ADR-0172 decision 7). */
|
|
55
|
+
lng?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The descriptors of the capability providers the releasing domain uses (`prepareCapabilityModules`), given by the
|
|
58
|
+
* caller: a figure's consumer capabilities are checked by them, and are not verified when none are given.
|
|
59
|
+
*/
|
|
60
|
+
capabilities?: ReadonlyMap<string, FigureCapabilityDescriptor>;
|
|
54
61
|
}
|
|
55
62
|
/**
|
|
56
63
|
* A check an app adds to releasing (LV figure-server design G10): findings in the gate's own shape, blocking or said.
|
|
@@ -83,9 +90,13 @@ export declare function inspectSource(sourceJson?: string | null, releasedJson?:
|
|
|
83
90
|
rowType?: string,
|
|
84
91
|
/** The row's category, for an app's release checks (G10). */
|
|
85
92
|
rowCategory?: string | null,
|
|
86
|
-
/** The releasing domain, for the capability check (ADR-0172 decision 9). */
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
/** The releasing domain, for the capability check (ADR-0172 decision 9), and the reader's language. */
|
|
94
|
+
releasing?: {
|
|
95
|
+
domain?: {
|
|
96
|
+
id: string;
|
|
97
|
+
};
|
|
98
|
+
lng?: string;
|
|
99
|
+
capabilities?: ReadonlyMap<string, FigureCapabilityDescriptor>;
|
|
89
100
|
}): Inspection;
|
|
90
101
|
/**
|
|
91
102
|
* What a release records about itself (ADR-0104 decision 5): the format its asset is written in, what it measured
|
|
@@ -169,8 +169,9 @@ function inspectSource(sourceJson, releasedJson, t,
|
|
|
169
169
|
rowType,
|
|
170
170
|
/** The row's category, for an app's release checks (G10). */
|
|
171
171
|
rowCategory,
|
|
172
|
-
/** The releasing domain, for the capability check (ADR-0172 decision 9). */
|
|
173
|
-
|
|
172
|
+
/** The releasing domain, for the capability check (ADR-0172 decision 9), and the reader's language. */
|
|
173
|
+
releasing = {}) {
|
|
174
|
+
const { domain, lng, capabilities } = releasing;
|
|
174
175
|
if (!sourceJson) {
|
|
175
176
|
return { blocked: true, findings: [{ code: 'no-source', message: '저장된 정본이 없다. 저장하면 발행할 수 있다', blocking: true }] };
|
|
176
177
|
}
|
|
@@ -219,7 +220,7 @@ domain) {
|
|
|
219
220
|
findings.push(...itemFindings(asset, say));
|
|
220
221
|
if (releasedJson)
|
|
221
222
|
findings.push(...figureContractFindings(asset, releasedJson, say));
|
|
222
|
-
findings.push(...appFindings({ asset: asset, type: rowType, category: rowCategory, t, domain }));
|
|
223
|
+
findings.push(...appFindings({ asset: asset, type: rowType, category: rowCategory, t, domain, lng, capabilities }));
|
|
223
224
|
return { blocked: findings.some(finding => finding.blocking), findings };
|
|
224
225
|
}
|
|
225
226
|
const PLANE_ENGLISH = {
|
|
@@ -340,8 +340,8 @@ let FigureMutation = class FigureMutation {
|
|
|
340
340
|
.orderBy('history.version', 'DESC')
|
|
341
341
|
.limit(1)
|
|
342
342
|
.getOne();
|
|
343
|
-
await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, context.state.domain);
|
|
344
|
-
const inspection = (0, figure_format_js_1.inspectSource)(figure.source, released?.source, context.t, figure.type, figure.category, context.state.domain);
|
|
343
|
+
const capabilities = await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, context.state.domain);
|
|
344
|
+
const inspection = (0, figure_format_js_1.inspectSource)(figure.source, released?.source, context.t, figure.type, figure.category, { domain: context.state.domain, lng: context.lng, capabilities });
|
|
345
345
|
if (inspection.blocked) {
|
|
346
346
|
const reasons = inspection.findings
|
|
347
347
|
.filter(finding => finding.blocking)
|
|
@@ -198,8 +198,8 @@ let FigureQuery = class FigureQuery {
|
|
|
198
198
|
.orderBy('history.version', 'DESC')
|
|
199
199
|
.limit(1)
|
|
200
200
|
.getOne();
|
|
201
|
-
await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, context.state.domain);
|
|
202
|
-
return (0, figure_format_js_1.inspectSource)(figure.source, released?.source, context.t, figure.type, figure.category, context.state.domain);
|
|
201
|
+
const capabilities = await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, context.state.domain);
|
|
202
|
+
return (0, figure_format_js_1.inspectSource)(figure.source, released?.source, context.t, figure.type, figure.category, { domain: context.state.domain, lng: context.lng, capabilities });
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
205
|
* The same judgement for a source that has not been saved — what the modeller shows **while** the author edits.
|
|
@@ -211,9 +211,9 @@ let FigureQuery = class FigureQuery {
|
|
|
211
211
|
*/
|
|
212
212
|
async inspectFigureDraft(source, context, id) {
|
|
213
213
|
const { domain } = context.state;
|
|
214
|
-
await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, domain);
|
|
214
|
+
const capabilities = await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository: shell_1.getRepository }, domain);
|
|
215
215
|
if (!id)
|
|
216
|
-
return (0, figure_format_js_1.inspectSource)(source, null, context.t, undefined, undefined, domain);
|
|
216
|
+
return (0, figure_format_js_1.inspectSource)(source, null, context.t, undefined, undefined, { domain, lng: context.lng, capabilities });
|
|
217
217
|
const figure = await (0, shell_1.getRepository)(figure_js_1.Figure).findOne({
|
|
218
218
|
where: { domain: { id: (0, typeorm_1.In)([domain.id, domain.parentId].filter(Boolean)) }, id },
|
|
219
219
|
select: { id: true, type: true, category: true }
|
|
@@ -226,7 +226,7 @@ let FigureQuery = class FigureQuery {
|
|
|
226
226
|
.orderBy('history.version', 'DESC')
|
|
227
227
|
.limit(1)
|
|
228
228
|
.getOne();
|
|
229
|
-
return (0, figure_format_js_1.inspectSource)(source, released?.source, context.t, figure.type, figure.category, domain);
|
|
229
|
+
return (0, figure_format_js_1.inspectSource)(source, released?.source, context.t, figure.type, figure.category, { domain, lng: context.lng, capabilities });
|
|
230
230
|
}
|
|
231
231
|
/** The categories this server allows (G5), or null when a category is free text: the modeller offers them to choose from. */
|
|
232
232
|
async figureCategories() {
|
|
@@ -429,9 +429,9 @@ function figureToolSpecs() {
|
|
|
429
429
|
return missingFigureTarget();
|
|
430
430
|
const current = sourceForTool(row, ctx?.host);
|
|
431
431
|
const { inspectSource, getRepository } = getDeps();
|
|
432
|
-
await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository }, { id: domainId });
|
|
432
|
+
const capabilities = await (0, capability_module_store_js_1.prepareCapabilityModules)({ getRepository }, { id: domainId });
|
|
433
433
|
/* Inspected whole, here; only what the model is told is held to its budget. */
|
|
434
|
-
return { ...findingsWithinBudget(inspectSource(current.source ? JSON.stringify(current.source) : null, null, undefined, row.type, row.category, { id: domainId })), draft: current.draft };
|
|
434
|
+
return { ...findingsWithinBudget(inspectSource(current.source ? JSON.stringify(current.source) : null, null, undefined, row.type, row.category, { domain: { id: domainId }, capabilities })), draft: current.draft };
|
|
435
435
|
}
|
|
436
436
|
},
|
|
437
437
|
{
|
|
@@ -5,11 +5,11 @@ export * from './figure/figure-history.js';
|
|
|
5
5
|
export * from './figure-recipe/figure-recipe-type.js';
|
|
6
6
|
export { recipeTemplates, inLanguage, RECIPE_DIR } from './figure-recipe/figure-recipe-templates.js';
|
|
7
7
|
import { FigureInstallKeyResolver } from './install-key/figure-install-key.js';
|
|
8
|
-
import {
|
|
8
|
+
import { FigureCapabilityUse } from './capability-module/capability-module-entity.js';
|
|
9
9
|
import { FigureCapabilityModuleResolver } from './capability-module/capability-module-resolver.js';
|
|
10
10
|
import './capability-module/capability-release-check.js';
|
|
11
11
|
export * from './install-key/figure-install-key.js';
|
|
12
|
-
export declare const entities: (typeof import("./figure/figure.js").Figure | typeof import("./figure/figure-history.js").FigureHistory | typeof FigureCapabilityUse | typeof
|
|
12
|
+
export declare const entities: (typeof import("./figure/figure.js").Figure | typeof import("./figure/figure-history.js").FigureHistory | typeof FigureCapabilityUse | typeof import("./figure/figure-replaced-draft.js").FigureReplacedDraft | typeof import("./figure/figure-proposal-record.js").FigureProposalRecord | typeof import("./figure/figure-namespace-entity.js").FigureNamespace)[];
|
|
13
13
|
export declare const subscribers: typeof import("./figure/event-subscriber.js").FigureHistoryEntitySubscriber[];
|
|
14
14
|
export declare const schema: {
|
|
15
15
|
resolverClasses: (typeof import("./figure/figure-query.js").FigureQuery | typeof import("./figure/figure-mutation.js").FigureMutation | typeof import("./figure/figure-namespace-resolver.js").FigureNamespaceResolver | typeof import("./figure-recipe/figure-recipe-resolver.js").FigureRecipeTemplateQuery | typeof FigureInstallKeyResolver | typeof FigureCapabilityModuleResolver)[];
|
|
@@ -3,7 +3,7 @@ import { Role, User } from '@things-factory/auth-base';
|
|
|
3
3
|
/** The appliance model that marks an install key. */
|
|
4
4
|
export declare const INSTALL_KEY_MODEL = "figure-install-key";
|
|
5
5
|
/** The role every install key's user holds, made the first time a key is issued. */
|
|
6
|
-
export declare const INSTALL_KEY_ROLE = "figure-install-
|
|
6
|
+
export declare const INSTALL_KEY_ROLE = "figure-install-key";
|
|
7
7
|
export declare class FigureInstallKey {
|
|
8
8
|
id: string;
|
|
9
9
|
name: string;
|
|
@@ -14,20 +14,22 @@ export declare class FigureInstallKey {
|
|
|
14
14
|
export declare class IssuedFigureInstallKey extends FigureInstallKey {
|
|
15
15
|
token: string;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The role install keys hold (ADR-0114, ADR-0172 decision 14): reading released figures, and registering their app's
|
|
19
|
+
* capabilities -- a server given a key is connected to this domain, and its app's capabilities come with it. Which app
|
|
20
|
+
* a key registers is its first push's. Made once per domain.
|
|
21
|
+
*/
|
|
22
|
+
export declare function installKeyRoleOf(tx: EntityManager, domain: {
|
|
19
23
|
id: string;
|
|
20
24
|
}, user: User): Promise<Role>;
|
|
21
25
|
export declare function installKeysOf(tx: EntityManager, domain: {
|
|
22
26
|
id: string;
|
|
23
27
|
}): Promise<FigureInstallKey[]>;
|
|
24
|
-
/** Issues a new key: an install-key appliance, its user given the
|
|
28
|
+
/** Issues a new key: an install-key appliance, its user given the install key role, its secret signed. */
|
|
25
29
|
export declare function issueInstallKey(tx: EntityManager, domain: {
|
|
26
30
|
id: string;
|
|
27
31
|
subdomain?: string;
|
|
28
|
-
}, user: User, name: string
|
|
29
|
-
/** The capability provider whose module the key may push (ADR-0172 decision 14): off unless given. */
|
|
30
|
-
capabilityProvider?: string | null): Promise<IssuedFigureInstallKey>;
|
|
32
|
+
}, user: User, name: string): Promise<IssuedFigureInstallKey>;
|
|
31
33
|
/** Revokes a key for good: the appliance and its user go, so its token is refused from the next request. */
|
|
32
34
|
export declare function revokeInstallKey(tx: EntityManager, domain: {
|
|
33
35
|
id: string;
|
|
@@ -35,6 +37,6 @@ export declare function revokeInstallKey(tx: EntityManager, domain: {
|
|
|
35
37
|
/** The Settings card's doors. Issuing a credential is a security change, as an appliance's is. */
|
|
36
38
|
export declare class FigureInstallKeyResolver {
|
|
37
39
|
figureInstallKeys(context: ResolverContext): Promise<FigureInstallKey[]>;
|
|
38
|
-
issueFigureInstallKey(name: string, context: ResolverContext
|
|
40
|
+
issueFigureInstallKey(name: string, context: ResolverContext): Promise<IssuedFigureInstallKey>;
|
|
39
41
|
revokeFigureInstallKey(id: string, context: ResolverContext): Promise<boolean>;
|
|
40
42
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FigureInstallKeyResolver = exports.IssuedFigureInstallKey = exports.FigureInstallKey = exports.INSTALL_KEY_ROLE = exports.INSTALL_KEY_MODEL = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.installKeyRoleOf = installKeyRoleOf;
|
|
5
5
|
exports.installKeysOf = installKeysOf;
|
|
6
6
|
exports.issueInstallKey = issueInstallKey;
|
|
7
7
|
exports.revokeInstallKey = revokeInstallKey;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const type_graphql_1 = require("type-graphql");
|
|
10
10
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
11
|
-
const figure_model_1 = require("@hatiolab/figure-model");
|
|
12
11
|
const shell_1 = require("@things-factory/shell");
|
|
13
12
|
const capability_module_entity_js_1 = require("../capability-module/capability-module-entity.js");
|
|
14
13
|
/*
|
|
@@ -21,7 +20,7 @@ const capability_module_entity_js_1 = require("../capability-module/capability-m
|
|
|
21
20
|
/** The appliance model that marks an install key. */
|
|
22
21
|
exports.INSTALL_KEY_MODEL = 'figure-install-key';
|
|
23
22
|
/** The role every install key's user holds, made the first time a key is issued. */
|
|
24
|
-
exports.INSTALL_KEY_ROLE = 'figure-install-
|
|
23
|
+
exports.INSTALL_KEY_ROLE = 'figure-install-key';
|
|
25
24
|
let FigureInstallKey = class FigureInstallKey {
|
|
26
25
|
};
|
|
27
26
|
exports.FigureInstallKey = FigureInstallKey;
|
|
@@ -42,7 +41,7 @@ tslib_1.__decorate([
|
|
|
42
41
|
tslib_1.__metadata("design:type", String)
|
|
43
42
|
], FigureInstallKey.prototype, "issuedBy", void 0);
|
|
44
43
|
tslib_1.__decorate([
|
|
45
|
-
(0, type_graphql_1.Field)({ nullable: true, description: 'The capability provider
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'The capability provider the key registered first, and the only one it registers since (ADR-0172 decision 14); none before.' }),
|
|
46
45
|
tslib_1.__metadata("design:type", String)
|
|
47
46
|
], FigureInstallKey.prototype, "capabilityProvider", void 0);
|
|
48
47
|
exports.FigureInstallKey = FigureInstallKey = tslib_1.__decorate([
|
|
@@ -58,23 +57,30 @@ tslib_1.__decorate([
|
|
|
58
57
|
exports.IssuedFigureInstallKey = IssuedFigureInstallKey = tslib_1.__decorate([
|
|
59
58
|
(0, type_graphql_1.ObjectType)({ description: 'A key just issued, with its token - shown this once.' })
|
|
60
59
|
], IssuedFigureInstallKey);
|
|
61
|
-
/**
|
|
62
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The role install keys hold (ADR-0114, ADR-0172 decision 14): reading released figures, and registering their app's
|
|
62
|
+
* capabilities -- a server given a key is connected to this domain, and its app's capabilities come with it. Which app
|
|
63
|
+
* a key registers is its first push's. Made once per domain.
|
|
64
|
+
*/
|
|
65
|
+
async function installKeyRoleOf(tx, domain, user) {
|
|
66
|
+
return await installKeyRole(tx, domain, user, exports.INSTALL_KEY_ROLE, "Board servers (ADR-0114, ADR-0172): read released figures and register their app's capabilities", [
|
|
67
|
+
['figure-published', 'query'],
|
|
68
|
+
['figure-capability-push', 'mutation']
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
async function installKeyRole(tx, domain, user, name, description, grants) {
|
|
63
72
|
const roles = tx.getRepository(auth_base_1.Role);
|
|
64
|
-
const found = await roles.findOne({ where: { domain: { id: domain.id }, name
|
|
73
|
+
const found = await roles.findOne({ where: { domain: { id: domain.id }, name }, relations: { privileges: true } });
|
|
65
74
|
if (found)
|
|
66
75
|
return found;
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
creator: user,
|
|
76
|
-
updater: user
|
|
77
|
-
});
|
|
76
|
+
const privileges = [];
|
|
77
|
+
for (const [category, privilege] of grants) {
|
|
78
|
+
const one = await tx.getRepository(auth_base_1.Privilege).findOne({ where: { category, name: privilege } });
|
|
79
|
+
if (!one)
|
|
80
|
+
throw new shell_1.Refusal('figure-install-key-privilege-missing', { category, privilege }, 'This server has no {category} {privilege} privilege for install keys.');
|
|
81
|
+
privileges.push(one);
|
|
82
|
+
}
|
|
83
|
+
return await roles.save({ domain, name, description, privileges, creator: user, updater: user });
|
|
78
84
|
}
|
|
79
85
|
const keyOf = (appliance) => ({
|
|
80
86
|
id: appliance.id,
|
|
@@ -91,14 +97,9 @@ async function installKeysOf(tx, domain) {
|
|
|
91
97
|
const grants = await tx.getRepository(capability_module_entity_js_1.FigureInstallKeyCapability).find({ where: { domain: { id: domain.id } } });
|
|
92
98
|
return keys.map(key => ({ ...keyOf(key), capabilityProvider: grants.find(g => g.applianceId === key.id)?.provider }));
|
|
93
99
|
}
|
|
94
|
-
/** Issues a new key: an install-key appliance, its user given the
|
|
95
|
-
async function issueInstallKey(tx, domain, user, name
|
|
96
|
-
/** The capability provider whose module the key may push (ADR-0172 decision 14): off unless given. */
|
|
97
|
-
capabilityProvider) {
|
|
100
|
+
/** Issues a new key: an install-key appliance, its user given the install key role, its secret signed. */
|
|
101
|
+
async function issueInstallKey(tx, domain, user, name) {
|
|
98
102
|
const label = String(name ?? '').trim();
|
|
99
|
-
const provider = capabilityProvider?.trim() || undefined;
|
|
100
|
-
if (provider && !figure_model_1.FIGURE_CAPABILITY_PROVIDER.test(provider))
|
|
101
|
-
throw new shell_1.Refusal('figure-install-key-provider-invalid', { provider }, "a capability provider is lower-case letters, digits and '-': {provider}");
|
|
102
103
|
if (!label)
|
|
103
104
|
throw new shell_1.Refusal('figure-install-key-name-missing', {}, 'Name the key - what board server it is for.');
|
|
104
105
|
if (label.length > 100)
|
|
@@ -110,14 +111,12 @@ capabilityProvider) {
|
|
|
110
111
|
model: exports.INSTALL_KEY_MODEL,
|
|
111
112
|
description: 'Board server install key (ADR-0114)'
|
|
112
113
|
});
|
|
113
|
-
const role = await
|
|
114
|
+
const role = await installKeyRoleOf(tx, domain, user);
|
|
114
115
|
const shadow = await tx.getRepository(auth_base_1.User).findOne({ where: { reference: appliance.id, userType: 'appliance' }, relations: { roles: true } });
|
|
115
116
|
shadow.roles = [role];
|
|
116
117
|
await tx.getRepository(auth_base_1.User).save(shadow);
|
|
117
|
-
if (provider)
|
|
118
|
-
await tx.getRepository(capability_module_entity_js_1.FigureInstallKeyCapability).save({ domain, applianceId: appliance.id, provider });
|
|
119
118
|
const issued = await (0, auth_base_1.issueApplianceSecret)(tx, domain, user, appliance.id);
|
|
120
|
-
return { ...keyOf({ ...issued, updater: user }),
|
|
119
|
+
return { ...keyOf({ ...issued, updater: user }), token: issued.accessToken };
|
|
121
120
|
}
|
|
122
121
|
/** Revokes a key for good: the appliance and its user go, so its token is refused from the next request. */
|
|
123
122
|
async function revokeInstallKey(tx, domain, id) {
|
|
@@ -134,9 +133,9 @@ let FigureInstallKeyResolver = class FigureInstallKeyResolver {
|
|
|
134
133
|
const { domain, tx } = context.state;
|
|
135
134
|
return await installKeysOf(tx ?? (0, shell_1.getRepository)(auth_base_1.Appliance).manager, domain);
|
|
136
135
|
}
|
|
137
|
-
async issueFigureInstallKey(name, context
|
|
136
|
+
async issueFigureInstallKey(name, context) {
|
|
138
137
|
const { domain, user, tx } = context.state;
|
|
139
|
-
return await issueInstallKey(tx, domain, user, name
|
|
138
|
+
return await issueInstallKey(tx, domain, user, name);
|
|
140
139
|
}
|
|
141
140
|
async revokeFigureInstallKey(id, context) {
|
|
142
141
|
const { domain, tx } = context.state;
|
|
@@ -158,9 +157,8 @@ tslib_1.__decorate([
|
|
|
158
157
|
(0, type_graphql_1.Mutation)(returns => IssuedFigureInstallKey, { description: 'Issues a key a board server installs figures with. Its token is answered this once.' }),
|
|
159
158
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('name', { description: 'What the key is for.' })),
|
|
160
159
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
161
|
-
tslib_1.__param(2, (0, type_graphql_1.Arg)('capabilityProvider', { nullable: true, description: 'The capability provider whose module the key may push to this domain. Left out, it pushes none.' })),
|
|
162
160
|
tslib_1.__metadata("design:type", Function),
|
|
163
|
-
tslib_1.__metadata("design:paramtypes", [String, Object
|
|
161
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
164
162
|
tslib_1.__metadata("design:returntype", Promise)
|
|
165
163
|
], FigureInstallKeyResolver.prototype, "issueFigureInstallKey", null);
|
|
166
164
|
tslib_1.__decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-service",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.297",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"@things-factory:registry": "https://registry.npmjs.org"
|
|
@@ -38,24 +38,28 @@
|
|
|
38
38
|
"clean": "npm run clean:server",
|
|
39
39
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration",
|
|
40
40
|
"build:templates": "node scripts/build-templates.mts",
|
|
41
|
-
"test:templates": "node --test scripts/templates.test.mts"
|
|
41
|
+
"test:templates": "node --test scripts/templates.test.mts",
|
|
42
|
+
"test": "node --test test/conventions.test.mjs"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"@hatiolab/figure-model": "^0.12.16",
|
|
45
46
|
"@operato/typeorm-history": "^10.0.0",
|
|
46
|
-
"@things-factory/ai-client-base": "^10.1.
|
|
47
|
-
"@things-factory/attachment-base": "^10.1.
|
|
48
|
-
"@things-factory/auth-base": "^10.1.
|
|
49
|
-
"@things-factory/env": "^10.1.
|
|
50
|
-
"@things-factory/setting-base": "^10.1.
|
|
51
|
-
"@things-factory/shell": "^10.1.
|
|
47
|
+
"@things-factory/ai-client-base": "^10.1.297",
|
|
48
|
+
"@things-factory/attachment-base": "^10.1.297",
|
|
49
|
+
"@things-factory/auth-base": "^10.1.297",
|
|
50
|
+
"@things-factory/env": "^10.1.297",
|
|
51
|
+
"@things-factory/setting-base": "^10.1.297",
|
|
52
|
+
"@things-factory/shell": "^10.1.297",
|
|
52
53
|
"graphql-scalars": "^1.22.4",
|
|
53
54
|
"graphql-upload": "^15.0.2",
|
|
54
55
|
"jszip": "^3.10.1",
|
|
55
56
|
"koa-router": "^7.4.0"
|
|
56
57
|
},
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "656ec78e5adf500b3b636eb9790cfe22f2a49ba9",
|
|
58
59
|
"engines": {
|
|
59
60
|
"node": ">=22.12"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@things-factory/conventions": "^10.1.281"
|
|
60
64
|
}
|
|
61
65
|
}
|
package/translations/en.json
CHANGED
|
@@ -204,26 +204,25 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "Name the key - what board server it is for.",
|
|
205
205
|
"error.figure-install-key-name-too-long": "A key name is at most {max} characters.",
|
|
206
206
|
"error.figure-install-key-not-found": "There is no such install key.",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "This server has no privilege
|
|
207
|
+
"error.figure-install-key-privilege-missing": "This server has no {category} {privilege} privilege for install keys.",
|
|
208
208
|
"figure.progress.propose.draft": "Writing the figure (request {call})…",
|
|
209
209
|
"figure.progress.propose.retry": "The kernel refused it: asking again with the reasons (request {call})…",
|
|
210
210
|
"figure.progress.propose.revise": "Looking at what was measured and revising (request {call})…",
|
|
211
211
|
"figure.progress.propose.recover": "The revision was refused: asking again with the reasons (request {call})…",
|
|
212
|
-
"figure.gate.capability-language": "en",
|
|
213
212
|
"figure.gate.capability-unverified.message": "The capability '{name}' is of the provider {provider}, which this domain does not use.",
|
|
214
213
|
"figure.gate.capability-unverified.why": "A release promises only what was checked. A capability this domain cannot check is not released.",
|
|
215
214
|
"figure.gate.capability-unverified.how": "Use {provider} in Settings > capability providers, or turn the capability off in the capability tab.",
|
|
216
215
|
"figure.gate.capability-needs.message": "The capability '{name}' needs {needs}.",
|
|
216
|
+
"figure.gate.capability-needs.item": "'Used as an item'",
|
|
217
217
|
"figure.gate.capability-needs.how": "Turn on {needs} in the capability tab, or turn the capability off.",
|
|
218
218
|
"figure.gate.capability-settings.message": "The settings of '{name}' cannot be applied. {reasons}",
|
|
219
219
|
"figure.gate.capability-settings.how": "Fix the settings in the capability tab.",
|
|
220
220
|
"error.figure-capability-module-invalid": "The file is not a capability module. {issues}",
|
|
221
|
-
"error.figure-capability-module-provider": "This key
|
|
221
|
+
"error.figure-capability-module-provider": "This key registers the capabilities of {allowed} only. These are of {provider}.",
|
|
222
222
|
"error.figure-capability-module-version": "{provider} {kept} is registered already. Raise the module version above {kept} (now {version}).",
|
|
223
223
|
"error.figure-capability-module-not-found": "There is no {provider} {version} module.",
|
|
224
224
|
"error.figure-capability-module-too-large": "A capability module file is at most {max} bytes.",
|
|
225
225
|
"error.figure-capability-provider-unknown": "No capability module of {provider} is registered.",
|
|
226
|
-
"error.figure-capability-push-not-allowed": "
|
|
227
|
-
"error.figure-install-key-provider-invalid": "A capability provider name uses lower-case letters, digits and '-' only: {provider}",
|
|
226
|
+
"error.figure-capability-push-not-allowed": "Only a board server install key registers capabilities.",
|
|
228
227
|
"error.figure-capability-choices-invalid": "The choice lists cannot be taken. {issues}"
|
|
229
228
|
}
|
package/translations/es.json
CHANGED
|
@@ -204,22 +204,21 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "Indique el nombre de la clave: el servidor de tableros que la usará.",
|
|
205
205
|
"error.figure-install-key-name-too-long": "El nombre de la clave tiene como máximo {max} caracteres.",
|
|
206
206
|
"error.figure-install-key-not-found": "No existe esa clave de instalación.",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "Este servidor no tiene el
|
|
208
|
-
"figure.gate.capability-language": "es",
|
|
207
|
+
"error.figure-install-key-privilege-missing": "Este servidor no tiene el privilegio {category} {privilege} para las claves de instalación.",
|
|
209
208
|
"figure.gate.capability-unverified.message": "The capability '{name}' is of the provider {provider}, which this domain does not use.",
|
|
210
209
|
"figure.gate.capability-unverified.why": "A release promises only what was checked. A capability this domain cannot check is not released.",
|
|
211
210
|
"figure.gate.capability-unverified.how": "Use {provider} in Settings > capability providers, or turn the capability off in the capability tab.",
|
|
212
211
|
"figure.gate.capability-needs.message": "The capability '{name}' needs {needs}.",
|
|
212
|
+
"figure.gate.capability-needs.item": "'Se usa como artículo'",
|
|
213
213
|
"figure.gate.capability-needs.how": "Turn on {needs} in the capability tab, or turn the capability off.",
|
|
214
214
|
"figure.gate.capability-settings.message": "The settings of '{name}' cannot be applied. {reasons}",
|
|
215
215
|
"figure.gate.capability-settings.how": "Fix the settings in the capability tab.",
|
|
216
216
|
"error.figure-capability-module-invalid": "The file is not a capability module. {issues}",
|
|
217
|
-
"error.figure-capability-module-provider": "
|
|
217
|
+
"error.figure-capability-module-provider": "Esta clave registra solo las capacidades de {allowed}. Estas son de {provider}.",
|
|
218
218
|
"error.figure-capability-module-version": "{provider} {kept} is registered already. Raise the module version above {kept} (now {version}).",
|
|
219
219
|
"error.figure-capability-module-not-found": "There is no {provider} {version} module.",
|
|
220
220
|
"error.figure-capability-module-too-large": "A capability module file is at most {max} bytes.",
|
|
221
221
|
"error.figure-capability-provider-unknown": "No capability module of {provider} is registered.",
|
|
222
|
-
"error.figure-capability-push-not-allowed": "
|
|
223
|
-
"error.figure-install-key-provider-invalid": "A capability provider name uses lower-case letters, digits and '-' only: {provider}",
|
|
222
|
+
"error.figure-capability-push-not-allowed": "Solo una clave de instalación del servidor de tableros registra capacidades.",
|
|
224
223
|
"error.figure-capability-choices-invalid": "The choice lists cannot be taken. {issues}"
|
|
225
224
|
}
|
package/translations/ja.json
CHANGED
|
@@ -204,22 +204,21 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "キー名を入力してください。このキーを使うボードサーバー名を入力します。",
|
|
205
205
|
"error.figure-install-key-name-too-long": "キー名は {max} 文字以内で入力してください。",
|
|
206
206
|
"error.figure-install-key-not-found": "該当するインストールキーがありません。",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "
|
|
208
|
-
"figure.gate.capability-language": "ja",
|
|
207
|
+
"error.figure-install-key-privilege-missing": "このサーバーにはインストールキーに与える {category} {privilege} 権限がありません。",
|
|
209
208
|
"figure.gate.capability-unverified.message": "The capability '{name}' is of the provider {provider}, which this domain does not use.",
|
|
210
209
|
"figure.gate.capability-unverified.why": "A release promises only what was checked. A capability this domain cannot check is not released.",
|
|
211
210
|
"figure.gate.capability-unverified.how": "Use {provider} in Settings > capability providers, or turn the capability off in the capability tab.",
|
|
212
211
|
"figure.gate.capability-needs.message": "The capability '{name}' needs {needs}.",
|
|
212
|
+
"figure.gate.capability-needs.item": "「アイテムとして使う」",
|
|
213
213
|
"figure.gate.capability-needs.how": "Turn on {needs} in the capability tab, or turn the capability off.",
|
|
214
214
|
"figure.gate.capability-settings.message": "The settings of '{name}' cannot be applied. {reasons}",
|
|
215
215
|
"figure.gate.capability-settings.how": "Fix the settings in the capability tab.",
|
|
216
216
|
"error.figure-capability-module-invalid": "The file is not a capability module. {issues}",
|
|
217
|
-
"error.figure-capability-module-provider": "
|
|
217
|
+
"error.figure-capability-module-provider": "このキーで登録できるのは {allowed} の能力だけです。届いたのは {provider} の能力です。",
|
|
218
218
|
"error.figure-capability-module-version": "{provider} {kept} is registered already. Raise the module version above {kept} (now {version}).",
|
|
219
219
|
"error.figure-capability-module-not-found": "There is no {provider} {version} module.",
|
|
220
220
|
"error.figure-capability-module-too-large": "A capability module file is at most {max} bytes.",
|
|
221
221
|
"error.figure-capability-provider-unknown": "No capability module of {provider} is registered.",
|
|
222
|
-
"error.figure-capability-push-not-allowed": "
|
|
223
|
-
"error.figure-install-key-provider-invalid": "A capability provider name uses lower-case letters, digits and '-' only: {provider}",
|
|
222
|
+
"error.figure-capability-push-not-allowed": "能力はボードサーバー設置キーでのみ登録できます。",
|
|
224
223
|
"error.figure-capability-choices-invalid": "The choice lists cannot be taken. {issues}"
|
|
225
224
|
}
|
package/translations/ko.json
CHANGED
|
@@ -204,26 +204,25 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "키 이름을 입력하세요. 이 키를 사용할 보드 서버를 적으면 됩니다.",
|
|
205
205
|
"error.figure-install-key-name-too-long": "키 이름은 {max}자 이하로 입력하세요.",
|
|
206
206
|
"error.figure-install-key-not-found": "해당 설치 키가 없습니다.",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "이
|
|
207
|
+
"error.figure-install-key-privilege-missing": "이 서버에는 설치 키에 줄 {category} {privilege} 권한이 없습니다.",
|
|
208
208
|
"figure.progress.propose.draft": "피규어를 쓰는 중 ({call}번째 요청)…",
|
|
209
209
|
"figure.progress.propose.retry": "커널이 거절해 이유를 붙여 다시 요청하는 중 ({call}번째 요청)…",
|
|
210
210
|
"figure.progress.propose.revise": "만든 모델을 잰 결과를 보고 고치는 중 ({call}번째 요청)…",
|
|
211
211
|
"figure.progress.propose.recover": "고친 답이 거절되어 이유를 붙여 다시 요청하는 중 ({call}번째 요청)…",
|
|
212
|
-
"figure.gate.capability-language": "ko",
|
|
213
212
|
"figure.gate.capability-unverified.message": "'{name}' 능력은 {provider} 제공자의 능력이며, 이 사업장은 {provider} 제공자를 사용하지 않습니다.",
|
|
214
213
|
"figure.gate.capability-unverified.why": "발행은 검사를 통과한 내용만 약속합니다. 이 사업장에서 검사할 수 없는 능력은 발행하지 않습니다.",
|
|
215
214
|
"figure.gate.capability-unverified.how": "설정 > 능력 제공자에서 {provider}을(를) 사용으로 바꾸거나, 능력 탭에서 이 능력을 끄세요.",
|
|
216
215
|
"figure.gate.capability-needs.message": "'{name}' 능력에는 {needs}이(가) 필요합니다.",
|
|
216
|
+
"figure.gate.capability-needs.item": "「아이템으로 쓴다」",
|
|
217
217
|
"figure.gate.capability-needs.how": "능력 탭에서 {needs}을(를) 켜거나 이 능력을 끄세요.",
|
|
218
218
|
"figure.gate.capability-settings.message": "'{name}' 능력의 설정을 적용할 수 없습니다. {reasons}",
|
|
219
219
|
"figure.gate.capability-settings.how": "능력 탭에서 설정을 고치세요.",
|
|
220
220
|
"error.figure-capability-module-invalid": "능력 모듈 파일이 아닙니다. {issues}",
|
|
221
|
-
"error.figure-capability-module-provider": "이 키로는 {allowed}
|
|
221
|
+
"error.figure-capability-module-provider": "이 키로는 {allowed}의 능력만 등록할 수 있습니다. 올라온 것은 {provider}의 능력입니다.",
|
|
222
222
|
"error.figure-capability-module-version": "{provider} {kept} 버전이 이미 등록되어 있습니다. 모듈 버전을 {kept}보다 높게 올리세요(지금 {version}).",
|
|
223
223
|
"error.figure-capability-module-not-found": "{provider} {version} 모듈이 없습니다.",
|
|
224
224
|
"error.figure-capability-module-too-large": "능력 모듈 파일은 {max}바이트 이하여야 합니다.",
|
|
225
225
|
"error.figure-capability-provider-unknown": "{provider} 제공자의 능력 모듈이 등록되어 있지 않습니다.",
|
|
226
|
-
"error.figure-capability-push-not-allowed": "
|
|
227
|
-
"error.figure-install-key-provider-invalid": "능력 제공자 이름은 영문 소문자, 숫자, '-'만 쓸 수 있습니다: {provider}",
|
|
226
|
+
"error.figure-capability-push-not-allowed": "능력은 보드 서버 설치 키로만 등록할 수 있습니다.",
|
|
228
227
|
"error.figure-capability-choices-invalid": "선택 목록을 받을 수 없습니다. {issues}"
|
|
229
228
|
}
|
package/translations/ms.json
CHANGED
|
@@ -204,22 +204,21 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "Namakan kunci - pelayan papan yang akan menggunakannya.",
|
|
205
205
|
"error.figure-install-key-name-too-long": "Nama kunci paling banyak {max} aksara.",
|
|
206
206
|
"error.figure-install-key-not-found": "Tiada kunci pemasangan sedemikian.",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "Pelayan ini tiada keistimewaan untuk
|
|
208
|
-
"figure.gate.capability-language": "ms",
|
|
207
|
+
"error.figure-install-key-privilege-missing": "Pelayan ini tiada keistimewaan {category} {privilege} untuk kunci pemasangan.",
|
|
209
208
|
"figure.gate.capability-unverified.message": "The capability '{name}' is of the provider {provider}, which this domain does not use.",
|
|
210
209
|
"figure.gate.capability-unverified.why": "A release promises only what was checked. A capability this domain cannot check is not released.",
|
|
211
210
|
"figure.gate.capability-unverified.how": "Use {provider} in Settings > capability providers, or turn the capability off in the capability tab.",
|
|
212
211
|
"figure.gate.capability-needs.message": "The capability '{name}' needs {needs}.",
|
|
212
|
+
"figure.gate.capability-needs.item": "'Digunakan sebagai item'",
|
|
213
213
|
"figure.gate.capability-needs.how": "Turn on {needs} in the capability tab, or turn the capability off.",
|
|
214
214
|
"figure.gate.capability-settings.message": "The settings of '{name}' cannot be applied. {reasons}",
|
|
215
215
|
"figure.gate.capability-settings.how": "Fix the settings in the capability tab.",
|
|
216
216
|
"error.figure-capability-module-invalid": "The file is not a capability module. {issues}",
|
|
217
|
-
"error.figure-capability-module-provider": "
|
|
217
|
+
"error.figure-capability-module-provider": "Kunci ini mendaftar keupayaan {allowed} sahaja. Ini keupayaan {provider}.",
|
|
218
218
|
"error.figure-capability-module-version": "{provider} {kept} is registered already. Raise the module version above {kept} (now {version}).",
|
|
219
219
|
"error.figure-capability-module-not-found": "There is no {provider} {version} module.",
|
|
220
220
|
"error.figure-capability-module-too-large": "A capability module file is at most {max} bytes.",
|
|
221
221
|
"error.figure-capability-provider-unknown": "No capability module of {provider} is registered.",
|
|
222
|
-
"error.figure-capability-push-not-allowed": "
|
|
223
|
-
"error.figure-install-key-provider-invalid": "A capability provider name uses lower-case letters, digits and '-' only: {provider}",
|
|
222
|
+
"error.figure-capability-push-not-allowed": "Hanya kunci pemasangan pelayan papan boleh mendaftar keupayaan.",
|
|
224
223
|
"error.figure-capability-choices-invalid": "The choice lists cannot be taken. {issues}"
|
|
225
224
|
}
|
package/translations/zh.json
CHANGED
|
@@ -204,22 +204,21 @@
|
|
|
204
204
|
"error.figure-install-key-name-missing": "请输入密钥名称,即使用该密钥的看板服务器。",
|
|
205
205
|
"error.figure-install-key-name-too-long": "密钥名称最多 {max} 个字符。",
|
|
206
206
|
"error.figure-install-key-not-found": "没有该安装密钥。",
|
|
207
|
-
"error.figure-install-key-privilege-missing": "
|
|
208
|
-
"figure.gate.capability-language": "zh",
|
|
207
|
+
"error.figure-install-key-privilege-missing": "此服务器没有可授予安装密钥的 {category} {privilege} 权限。",
|
|
209
208
|
"figure.gate.capability-unverified.message": "The capability '{name}' is of the provider {provider}, which this domain does not use.",
|
|
210
209
|
"figure.gate.capability-unverified.why": "A release promises only what was checked. A capability this domain cannot check is not released.",
|
|
211
210
|
"figure.gate.capability-unverified.how": "Use {provider} in Settings > capability providers, or turn the capability off in the capability tab.",
|
|
212
211
|
"figure.gate.capability-needs.message": "The capability '{name}' needs {needs}.",
|
|
212
|
+
"figure.gate.capability-needs.item": "「用作物品」",
|
|
213
213
|
"figure.gate.capability-needs.how": "Turn on {needs} in the capability tab, or turn the capability off.",
|
|
214
214
|
"figure.gate.capability-settings.message": "The settings of '{name}' cannot be applied. {reasons}",
|
|
215
215
|
"figure.gate.capability-settings.how": "Fix the settings in the capability tab.",
|
|
216
216
|
"error.figure-capability-module-invalid": "The file is not a capability module. {issues}",
|
|
217
|
-
"error.figure-capability-module-provider": "
|
|
217
|
+
"error.figure-capability-module-provider": "此密钥只能注册 {allowed} 的能力。收到的是 {provider} 的能力。",
|
|
218
218
|
"error.figure-capability-module-version": "{provider} {kept} is registered already. Raise the module version above {kept} (now {version}).",
|
|
219
219
|
"error.figure-capability-module-not-found": "There is no {provider} {version} module.",
|
|
220
220
|
"error.figure-capability-module-too-large": "A capability module file is at most {max} bytes.",
|
|
221
221
|
"error.figure-capability-provider-unknown": "No capability module of {provider} is registered.",
|
|
222
|
-
"error.figure-capability-push-not-allowed": "
|
|
223
|
-
"error.figure-install-key-provider-invalid": "A capability provider name uses lower-case letters, digits and '-' only: {provider}",
|
|
222
|
+
"error.figure-capability-push-not-allowed": "只有看板服务器安装密钥可以注册能力。",
|
|
224
223
|
"error.figure-capability-choices-invalid": "The choice lists cannot be taken. {issues}"
|
|
225
224
|
}
|