@balena/pinejs 20.1.0-build-large-file-uploads-2-1a7d50e8660ff52fe7df8d6ef9ce8b6b707027dc-1 → 21.0.0-build-21-x-aded34a9c5c670522247399b3cc4dc7814430d5e-1
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/.pinejs-cache.json +1 -1
- package/.versionbot/CHANGELOG.yml +339 -17
- package/CHANGELOG.md +79 -5
- package/Gruntfile.cts +1 -1
- package/VERSION +1 -1
- package/build/browser.cts +0 -1
- package/build/module.cts +0 -1
- package/build/server.cts +0 -1
- package/out/bin/utils.js +2 -3
- package/out/bin/utils.js.map +1 -1
- package/out/config-loader/env.d.ts +0 -5
- package/out/config-loader/env.js +0 -7
- package/out/config-loader/env.js.map +1 -1
- package/out/database-layer/db.js.map +1 -1
- package/out/express-emulator/express.js +4 -1
- package/out/express-emulator/express.js.map +1 -1
- package/out/migrator/async.js +6 -7
- package/out/migrator/async.js.map +1 -1
- package/out/sbvr-api/abstract-sql.js +19 -11
- package/out/sbvr-api/abstract-sql.js.map +1 -1
- package/out/sbvr-api/cached-compile.js +2 -1
- package/out/sbvr-api/cached-compile.js.map +1 -1
- package/out/sbvr-api/control-flow.js.map +1 -1
- package/out/sbvr-api/errors.js +1 -1
- package/out/sbvr-api/errors.js.map +1 -1
- package/out/sbvr-api/hooks.d.ts +1 -2
- package/out/sbvr-api/hooks.js.map +1 -1
- package/out/sbvr-api/sbvr-utils.d.ts +0 -10
- package/out/sbvr-api/sbvr-utils.js +7 -48
- package/out/sbvr-api/sbvr-utils.js.map +1 -1
- package/out/sbvr-api/translations.js +4 -17
- package/out/sbvr-api/translations.js.map +1 -1
- package/out/sbvr-api/uri-parser.d.ts +7 -1
- package/out/sbvr-api/uri-parser.js +0 -2
- package/out/sbvr-api/uri-parser.js.map +1 -1
- package/out/server-glue/module.js +1 -13
- package/out/server-glue/module.js.map +1 -1
- package/out/tasks/index.d.ts +1 -1
- package/out/tasks/index.js +2 -2
- package/out/tasks/index.js.map +1 -1
- package/out/tasks/worker.d.ts +3 -2
- package/out/tasks/worker.js +2 -1
- package/out/tasks/worker.js.map +1 -1
- package/out/webresource-handler/handlers/NoopHandler.js +0 -1
- package/out/webresource-handler/handlers/NoopHandler.js.map +1 -1
- package/out/webresource-handler/index.d.ts +0 -42
- package/out/webresource-handler/index.js +2 -25
- package/out/webresource-handler/index.js.map +1 -1
- package/package.json +32 -32
- package/src/bin/utils.ts +5 -3
- package/src/config-loader/env.ts +0 -14
- package/src/database-layer/db.ts +6 -2
- package/src/express-emulator/express.js +4 -1
- package/src/migrator/async.ts +20 -21
- package/src/sbvr-api/abstract-sql.ts +30 -25
- package/src/sbvr-api/cached-compile.ts +2 -1
- package/src/sbvr-api/control-flow.ts +1 -1
- package/src/sbvr-api/errors.ts +1 -1
- package/src/sbvr-api/express-extension.ts +1 -1
- package/src/sbvr-api/hooks.ts +2 -2
- package/src/sbvr-api/sbvr-utils.ts +9 -58
- package/src/sbvr-api/translations.ts +5 -18
- package/src/sbvr-api/uri-parser.ts +11 -4
- package/src/server-glue/module.ts +1 -15
- package/src/tasks/index.ts +2 -2
- package/src/tasks/worker.ts +6 -2
- package/src/webresource-handler/handlers/NoopHandler.ts +3 -1
- package/src/webresource-handler/index.ts +1 -86
- package/out/data-server/sbvr-server.d.ts +0 -17
- package/out/data-server/sbvr-server.js +0 -350
- package/out/data-server/sbvr-server.js.map +0 -1
- package/out/http-transactions/transaction.sbvr +0 -59
- package/out/http-transactions/transactions.d.ts +0 -3
- package/out/http-transactions/transactions.js +0 -305
- package/out/http-transactions/transactions.js.map +0 -1
- package/out/webresource-handler/multipartUpload.d.ts +0 -12
- package/out/webresource-handler/multipartUpload.js +0 -251
- package/out/webresource-handler/multipartUpload.js.map +0 -1
- package/out/webresource-handler/webresource.d.ts +0 -42
- package/out/webresource-handler/webresource.js +0 -2
- package/out/webresource-handler/webresource.js.map +0 -1
- package/out/webresource-handler/webresource.sbvr +0 -60
- package/src/data-server/sbvr-server.ts +0 -412
- package/src/http-transactions/transaction.sbvr +0 -59
- package/src/http-transactions/transactions.js +0 -305
- package/src/webresource-handler/multipartUpload.ts +0 -368
- package/src/webresource-handler/webresource.sbvr +0 -60
- package/src/webresource-handler/webresource.ts +0 -48
@@ -1,350 +0,0 @@
|
|
1
|
-
import * as permissions from '../sbvr-api/permissions.js';
|
2
|
-
const uiModel = `\
|
3
|
-
Vocabulary: ui
|
4
|
-
|
5
|
-
Term: text
|
6
|
-
Concept type: Text (Type)
|
7
|
-
Term: name
|
8
|
-
Concept type: Short Text (Type)
|
9
|
-
Term: textarea
|
10
|
-
--Database id Field: name
|
11
|
-
Reference Scheme: text
|
12
|
-
Fact type: textarea is disabled
|
13
|
-
Fact type: textarea has name
|
14
|
-
Necessity: Each textarea has exactly 1 name
|
15
|
-
Necessity: Each name is of exactly 1 textarea
|
16
|
-
Fact type: textarea has text
|
17
|
-
Necessity: Each textarea has exactly 1 text`;
|
18
|
-
const isServerOnAir = (() => {
|
19
|
-
let resolve;
|
20
|
-
let promise = new Promise(($resolve) => {
|
21
|
-
resolve = $resolve;
|
22
|
-
});
|
23
|
-
return (value) => {
|
24
|
-
if (value != null) {
|
25
|
-
if (resolve != null) {
|
26
|
-
resolve(value);
|
27
|
-
resolve = undefined;
|
28
|
-
}
|
29
|
-
else {
|
30
|
-
promise = Promise.resolve(value);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
return promise;
|
34
|
-
};
|
35
|
-
})();
|
36
|
-
const serverIsOnAir = async (_req, _res, next) => {
|
37
|
-
const onAir = await isServerOnAir();
|
38
|
-
if (onAir) {
|
39
|
-
next();
|
40
|
-
}
|
41
|
-
else {
|
42
|
-
next('route');
|
43
|
-
}
|
44
|
-
};
|
45
|
-
export const setup = async (app, sbvrUtils, db) => {
|
46
|
-
const uiApi = sbvrUtils.api.ui;
|
47
|
-
const devApi = sbvrUtils.api.dev;
|
48
|
-
const setupModels = async (tx) => {
|
49
|
-
try {
|
50
|
-
const uiApiTx = uiApi.clone({
|
51
|
-
passthrough: {
|
52
|
-
tx,
|
53
|
-
req: permissions.root,
|
54
|
-
},
|
55
|
-
});
|
56
|
-
await uiApiTx
|
57
|
-
.get({
|
58
|
-
resource: 'textarea',
|
59
|
-
id: {
|
60
|
-
name: 'model_area',
|
61
|
-
},
|
62
|
-
options: {
|
63
|
-
$select: 'id',
|
64
|
-
},
|
65
|
-
})
|
66
|
-
.then(async (result) => {
|
67
|
-
if (result == null) {
|
68
|
-
return await uiApiTx.post({
|
69
|
-
resource: 'textarea',
|
70
|
-
body: {
|
71
|
-
name: 'model_area',
|
72
|
-
text: ' ',
|
73
|
-
},
|
74
|
-
});
|
75
|
-
}
|
76
|
-
});
|
77
|
-
await devApi
|
78
|
-
.get({
|
79
|
-
resource: 'model',
|
80
|
-
passthrough: {
|
81
|
-
tx,
|
82
|
-
req: permissions.rootRead,
|
83
|
-
},
|
84
|
-
options: {
|
85
|
-
$select: ['is_of__vocabulary', 'model_value'],
|
86
|
-
$filter: {
|
87
|
-
model_type: 'se',
|
88
|
-
is_of__vocabulary: 'data',
|
89
|
-
},
|
90
|
-
},
|
91
|
-
})
|
92
|
-
.then(async (result) => {
|
93
|
-
if (result.length === 0) {
|
94
|
-
throw new Error('No SE data model found');
|
95
|
-
}
|
96
|
-
const instance = result[0];
|
97
|
-
const modelValue = instance.model_value;
|
98
|
-
await sbvrUtils.executeModel(tx, {
|
99
|
-
apiRoot: instance.is_of__vocabulary,
|
100
|
-
modelText: modelValue.value,
|
101
|
-
});
|
102
|
-
});
|
103
|
-
await isServerOnAir(true);
|
104
|
-
}
|
105
|
-
catch {
|
106
|
-
await isServerOnAir(false);
|
107
|
-
}
|
108
|
-
};
|
109
|
-
app.get('/onAir', async (_req, res) => {
|
110
|
-
const onAir = await isServerOnAir();
|
111
|
-
res.json(onAir);
|
112
|
-
});
|
113
|
-
app.post('/update', permissions.checkPermissionsMiddleware('all'), serverIsOnAir, (_req, res) => {
|
114
|
-
res.status(404).end();
|
115
|
-
});
|
116
|
-
app.post('/execute', permissions.checkPermissionsMiddleware('all'), async (_req, res) => {
|
117
|
-
try {
|
118
|
-
await uiApi
|
119
|
-
.get({
|
120
|
-
resource: 'textarea',
|
121
|
-
passthrough: { req: permissions.rootRead },
|
122
|
-
id: {
|
123
|
-
name: 'model_area',
|
124
|
-
},
|
125
|
-
options: {
|
126
|
-
$select: 'text',
|
127
|
-
},
|
128
|
-
})
|
129
|
-
.then(async (result) => {
|
130
|
-
if (result == null) {
|
131
|
-
throw new Error('Could not find the model to execute');
|
132
|
-
}
|
133
|
-
const modelText = result.text;
|
134
|
-
await db.transaction(async (tx) => {
|
135
|
-
await sbvrUtils.executeModel(tx, {
|
136
|
-
apiRoot: 'data',
|
137
|
-
modelText,
|
138
|
-
});
|
139
|
-
await uiApi.patch({
|
140
|
-
resource: 'textarea',
|
141
|
-
passthrough: {
|
142
|
-
tx,
|
143
|
-
req: permissions.root,
|
144
|
-
},
|
145
|
-
id: {
|
146
|
-
name: 'model_area',
|
147
|
-
},
|
148
|
-
body: {
|
149
|
-
is_disabled: true,
|
150
|
-
},
|
151
|
-
});
|
152
|
-
});
|
153
|
-
});
|
154
|
-
await isServerOnAir(true);
|
155
|
-
res.status(200).end();
|
156
|
-
}
|
157
|
-
catch (err) {
|
158
|
-
await isServerOnAir(false);
|
159
|
-
res.status(404).json(err);
|
160
|
-
}
|
161
|
-
});
|
162
|
-
app.post('/validate', permissions.checkPermissionsMiddleware('read'), async (req, res) => {
|
163
|
-
try {
|
164
|
-
const results = await sbvrUtils.runRule('data', req.body.rule);
|
165
|
-
res.json(results);
|
166
|
-
}
|
167
|
-
catch (err) {
|
168
|
-
console.log('Error validating', err);
|
169
|
-
res.status(404).end();
|
170
|
-
}
|
171
|
-
});
|
172
|
-
app.delete('/cleardb', permissions.checkPermissionsMiddleware('delete'), async (_req, res) => {
|
173
|
-
try {
|
174
|
-
await db.transaction(async (tx) => {
|
175
|
-
const result = await tx.tableList();
|
176
|
-
await Promise.all(result.rows.map((table) => tx.dropTable(table.name)));
|
177
|
-
await sbvrUtils.executeStandardModels(tx);
|
178
|
-
console.warn('DEL /cleardb is very destructive and should really be followed by a full restart/reload.');
|
179
|
-
await sbvrUtils.executeModels(tx, config.models);
|
180
|
-
await setupModels(tx);
|
181
|
-
});
|
182
|
-
res.status(200).end();
|
183
|
-
}
|
184
|
-
catch (err) {
|
185
|
-
console.error('Error clearing db', err);
|
186
|
-
res.status(503).end();
|
187
|
-
}
|
188
|
-
});
|
189
|
-
app.put('/importdb', permissions.checkPermissionsMiddleware({
|
190
|
-
and: ['create', 'update', 'delete'],
|
191
|
-
}), async (req, res) => {
|
192
|
-
try {
|
193
|
-
const queries = req.body.split(';');
|
194
|
-
await db.transaction(async (tx) => {
|
195
|
-
for (let query of queries) {
|
196
|
-
query = query.trim();
|
197
|
-
if (query.length > 0) {
|
198
|
-
try {
|
199
|
-
await tx.executeSql(query);
|
200
|
-
}
|
201
|
-
catch (err) {
|
202
|
-
throw [query, err];
|
203
|
-
}
|
204
|
-
}
|
205
|
-
}
|
206
|
-
});
|
207
|
-
res.status(200).end();
|
208
|
-
}
|
209
|
-
catch (err) {
|
210
|
-
console.error('Error importing db', err);
|
211
|
-
res.status(404).end();
|
212
|
-
}
|
213
|
-
});
|
214
|
-
app.get('/exportdb', permissions.checkPermissionsMiddleware('read'), async (_req, res) => {
|
215
|
-
try {
|
216
|
-
let exported = '';
|
217
|
-
await db.transaction(async (tx) => {
|
218
|
-
const tables = await tx.tableList("name NOT LIKE '%_buk'");
|
219
|
-
await Promise.all(tables.rows.map(async (table) => {
|
220
|
-
const tableName = table.name;
|
221
|
-
exported += 'DROP TABLE IF EXISTS "' + tableName + '";\n';
|
222
|
-
exported += table.sql + ';\n';
|
223
|
-
const result = await tx.executeSql('SELECT * FROM "' + tableName + '";');
|
224
|
-
let insQuery = '';
|
225
|
-
for (const currRow of result.rows) {
|
226
|
-
let notFirst = false;
|
227
|
-
insQuery += 'INSERT INTO "' + tableName + '" (';
|
228
|
-
let valQuery = '';
|
229
|
-
for (const propName of Object.keys(currRow)) {
|
230
|
-
if (notFirst) {
|
231
|
-
insQuery += ',';
|
232
|
-
valQuery += ',';
|
233
|
-
}
|
234
|
-
else {
|
235
|
-
notFirst = true;
|
236
|
-
}
|
237
|
-
insQuery += '"' + propName + '"';
|
238
|
-
valQuery += "'" + currRow[propName] + "'";
|
239
|
-
}
|
240
|
-
insQuery += ') values (' + valQuery + ');\n';
|
241
|
-
}
|
242
|
-
exported += insQuery;
|
243
|
-
}));
|
244
|
-
});
|
245
|
-
res.json(exported);
|
246
|
-
}
|
247
|
-
catch (err) {
|
248
|
-
console.error('Error exporting db', err);
|
249
|
-
res.status(503).end();
|
250
|
-
}
|
251
|
-
});
|
252
|
-
app.post('/backupdb', permissions.checkPermissionsMiddleware('all'), serverIsOnAir, async (_req, res) => {
|
253
|
-
try {
|
254
|
-
await db.transaction(async (tx) => {
|
255
|
-
const result = await tx.tableList("name NOT LIKE '%_buk'");
|
256
|
-
await Promise.all(result.rows.map(async (currRow) => {
|
257
|
-
const tableName = currRow.name;
|
258
|
-
await tx.dropTable(tableName + '_buk', true);
|
259
|
-
await tx.executeSql('ALTER TABLE "' +
|
260
|
-
tableName +
|
261
|
-
'" RENAME TO "' +
|
262
|
-
tableName +
|
263
|
-
'_buk";');
|
264
|
-
}));
|
265
|
-
});
|
266
|
-
res.status(200).end();
|
267
|
-
}
|
268
|
-
catch (err) {
|
269
|
-
console.error('Error backing up db', err);
|
270
|
-
res.status(404).end();
|
271
|
-
}
|
272
|
-
});
|
273
|
-
app.post('/restoredb', permissions.checkPermissionsMiddleware('all'), serverIsOnAir, async (_req, res) => {
|
274
|
-
try {
|
275
|
-
await db.transaction(async (tx) => {
|
276
|
-
const result = await tx.tableList("name LIKE '%_buk'");
|
277
|
-
await Promise.all(result.rows.map(async (currRow) => {
|
278
|
-
const tableName = currRow.name;
|
279
|
-
await tx.dropTable(tableName.slice(0, -4), true);
|
280
|
-
await tx.executeSql('ALTER TABLE "' +
|
281
|
-
tableName +
|
282
|
-
'" RENAME TO "' +
|
283
|
-
tableName.slice(0, -4) +
|
284
|
-
'";');
|
285
|
-
}));
|
286
|
-
});
|
287
|
-
res.status(200).end();
|
288
|
-
}
|
289
|
-
catch (err) {
|
290
|
-
console.error('Error restoring db', err);
|
291
|
-
res.status(404).end();
|
292
|
-
}
|
293
|
-
});
|
294
|
-
app.all('/data/*', serverIsOnAir, sbvrUtils.handleODataRequest);
|
295
|
-
app.get('/Auth/*', serverIsOnAir, sbvrUtils.handleODataRequest);
|
296
|
-
app.merge('/ui/*', sbvrUtils.handleODataRequest);
|
297
|
-
app.patch('/ui/*', sbvrUtils.handleODataRequest);
|
298
|
-
app.delete('/', serverIsOnAir, async (_req, res) => {
|
299
|
-
await Promise.all([
|
300
|
-
uiApi.patch({
|
301
|
-
resource: 'textarea',
|
302
|
-
passthrough: { req: permissions.root },
|
303
|
-
id: {
|
304
|
-
name: 'model_area',
|
305
|
-
},
|
306
|
-
body: {
|
307
|
-
text: '',
|
308
|
-
is_disabled: false,
|
309
|
-
},
|
310
|
-
}),
|
311
|
-
sbvrUtils.deleteModel('data'),
|
312
|
-
]);
|
313
|
-
await isServerOnAir(false);
|
314
|
-
res.status(200).end();
|
315
|
-
});
|
316
|
-
await db.transaction(setupModels);
|
317
|
-
};
|
318
|
-
export const config = {
|
319
|
-
models: [
|
320
|
-
{
|
321
|
-
modelName: 'ui',
|
322
|
-
modelText: uiModel,
|
323
|
-
apiRoot: 'ui',
|
324
|
-
customServerCode: { setup },
|
325
|
-
migrations: {
|
326
|
-
'11.0.0-modified-at': `\
|
327
|
-
ALTER TABLE "textarea"
|
328
|
-
ADD COLUMN IF NOT EXISTS "modified at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL;\
|
329
|
-
`,
|
330
|
-
'15.0.0-data-types': async (tx, sbvrUtils) => {
|
331
|
-
switch (sbvrUtils.db.engine) {
|
332
|
-
case 'mysql':
|
333
|
-
await tx.executeSql(`\
|
334
|
-
ALTER TABLE "textarea"
|
335
|
-
MODIFY "is disabled" BOOLEAN NOT NULL;`);
|
336
|
-
break;
|
337
|
-
case 'postgres':
|
338
|
-
await tx.executeSql(`\
|
339
|
-
ALTER TABLE "textarea"
|
340
|
-
ALTER COLUMN "is disabled" DROP DEFAULT,
|
341
|
-
ALTER COLUMN "is disabled" SET DATA TYPE BOOLEAN USING "is disabled"::BOOLEAN,
|
342
|
-
ALTER COLUMN "is disabled" SET DEFAULT FALSE;`);
|
343
|
-
break;
|
344
|
-
}
|
345
|
-
},
|
346
|
-
},
|
347
|
-
},
|
348
|
-
],
|
349
|
-
};
|
350
|
-
//# sourceMappingURL=sbvr-server.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sbvr-server.js","sourceRoot":"","sources":["../../src/data-server/sbvr-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAM1D,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;6CAe6B,CAAC;AAG9C,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE;IAC3B,IAAI,OAAuE,CAAC;IAC5E,IAAI,OAAO,GAAG,IAAI,OAAO,CAAU,CAAC,QAAQ,EAAE,EAAE;QAC/C,OAAO,GAAG,QAAQ,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAe,EAAE,EAAE;QAC1B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACrB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO,GAAG,SAAS,CAAC;YACrB,CAAC;iBAAM,CAAC;gBACP,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAClC,CAAC;QACF,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC,CAAC;AACH,CAAC,CAAC,EAAE,CAAC;AAEL,MAA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AAE,IAAI;YACf,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,IAAI;YACb,gBAAgB,EAAE,EAAE,KAAK,EAAE;YAC3B,UAAU,EAAE;gBACX,oBAAoB,EAAE;;;CAGzB;gBACG,mBAAmB,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE;oBAC5C,QAAQ,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;wBAC7B,KAAK,OAAO;4BACX,MAAM,EAAE,CAAC,UAAU,CAAC;;+CAEoB,CAAC,CAAC;4BAC1C,MAAM;wBACP,KAAK,UAAU;4BACd,MAAM,EAAE,CAAC,UAAU,CAAC;;;;sDAI2B,CAAC,CAAC;4BACjD,MAAM;oBAER,CAAC;gBACF,CAAC;aACD;SACD;KACD;CACgB,CAAC"}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
Vocabulary: transaction
|
2
|
-
|
3
|
-
Term: resource id
|
4
|
-
Concept type: Text (Type)
|
5
|
-
Term: resource type
|
6
|
-
Concept type: Text (Type)
|
7
|
-
Term: field name
|
8
|
-
Concept type: Text (Type)
|
9
|
-
Term: field value
|
10
|
-
Concept type: Text (Type)
|
11
|
-
Term: placeholder
|
12
|
-
Concept type: Short Text (Type)
|
13
|
-
|
14
|
-
Term: resource
|
15
|
-
Reference Scheme: resource id
|
16
|
-
Fact type: resource has resource id
|
17
|
-
Necessity: Each resource has exactly 1 resource id.
|
18
|
-
Fact type: resource has resource type
|
19
|
-
Necessity: Each resource has exactly 1 resource type.
|
20
|
-
|
21
|
-
Term: transaction
|
22
|
-
|
23
|
-
Term: lock
|
24
|
-
Fact type: lock is exclusive
|
25
|
-
Fact type: lock belongs to transaction
|
26
|
-
Necessity: Each lock belongs to exactly 1 transaction.
|
27
|
-
Fact type: resource is under lock
|
28
|
-
Synonymous Form: lock is on resource
|
29
|
-
Rule: It is obligatory that each resource that is under a lock that is exclusive, is under at most 1 lock.
|
30
|
-
|
31
|
-
Term: conditional type
|
32
|
-
Concept Type: Short Text (Type)
|
33
|
-
Definition: "ADD", "EDIT" or "DELETE"
|
34
|
-
|
35
|
-
Term: conditional resource
|
36
|
-
Fact type: conditional resource belongs to transaction
|
37
|
-
Necessity: Each conditional resource belongs to exactly 1 transaction.
|
38
|
-
Fact type: conditional resource has lock
|
39
|
-
Necessity: Each conditional resource has at most 1 lock.
|
40
|
-
Fact type: conditional resource has resource type
|
41
|
-
Necessity: Each conditional resource has exactly 1 resource type.
|
42
|
-
Fact type: conditional resource has conditional type
|
43
|
-
Necessity: Each conditional resource has exactly 1 conditional type.
|
44
|
-
Fact type: conditional resource has placeholder
|
45
|
-
Necessity: Each conditional resource has at most 1 placeholder.
|
46
|
-
--Rule: It is obligatory that each conditional resource that has a placeholder, has a conditional type that is of "ADD".
|
47
|
-
|
48
|
-
Term: conditional field
|
49
|
-
Reference Scheme: field name
|
50
|
-
Fact type: conditional field has field name
|
51
|
-
Necessity: Each conditional field has exactly 1 field name.
|
52
|
-
Fact type: conditional field has field value
|
53
|
-
Necessity: Each conditional field has at most 1 field value.
|
54
|
-
Fact type: conditional field is of conditional resource
|
55
|
-
Necessity: Each conditional field is of exactly 1 conditional resource.
|
56
|
-
|
57
|
-
--Rule: It is obligatory that each conditional resource that has a conditional type that is of "EDIT" or "DELETE", has a lock that is exclusive
|
58
|
-
Rule: It is obligatory that each conditional resource that has a lock, has a resource type that is of a resource that the lock is on.
|
59
|
-
Rule: It is obligatory that each conditional resource that has a lock, belongs to a transaction that the lock belongs to.
|
@@ -1,3 +0,0 @@
|
|
1
|
-
export function setup(app: import("express").Application, sbvrUtilsInstance: typeof import("../sbvr-api/sbvr-utils.js"), db: import("../database-layer/db.js").Database): import("../sbvr-api/common-types.js").Resolvable<void>;
|
2
|
-
export const config: import("../config-loader/config-loader.js").Config;
|
3
|
-
export let addModelHooks: (modelName: string) => void;
|