@intuitionrobotics/db-api-generator 0.45.1 → 0.46.0
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/app-backend/BaseDB_ApiGenerator.d.ts +23 -18
- package/app-backend/BaseDB_ApiGenerator.js +57 -66
- package/app-backend/BaseDB_ApiGenerator.js.map +1 -1
- package/app-backend/apis.d.ts +5 -4
- package/app-backend/apis.js +9 -28
- package/app-backend/apis.js.map +1 -1
- package/app-frontend/BaseDB_ApiGeneratorCaller.d.ts +8 -7
- package/app-frontend/BaseDB_ApiGeneratorCaller.js +16 -34
- package/app-frontend/BaseDB_ApiGeneratorCaller.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +0 -30
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/shared/types.d.ts +2 -2
- package/shared/types.js +6 -6
- package/shared/types.js.map +1 -1
- package/backend.d.ts +0 -2
- package/backend.js +0 -33
- package/backend.js.map +0 -1
- package/frontend.d.ts +0 -1
- package/frontend.js +0 -32
- package/frontend.js.map +0 -1
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DB_Object, PartialProperties } from "@intuitionrobotics/ts-common/utils/types";
|
|
2
|
+
import { ServerApi } from "@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api";
|
|
3
|
+
import { ExpressRequest } from "@intuitionrobotics/thunderstorm/app-backend/utils/types";
|
|
4
|
+
import { Clause_Where, FilterKeys, FirestoreQuery } from "@intuitionrobotics/firebase/shared/types";
|
|
5
|
+
import { ValidatorTypeResolver } from "@intuitionrobotics/ts-common/validator/validator";
|
|
3
6
|
import { ServerApi_Create } from "./apis";
|
|
4
|
-
import {
|
|
5
|
-
import { FirestoreCollection
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
7
|
+
import { FirestoreBackupDetails, OnFirestoreBackupSchedulerAct } from "@intuitionrobotics/thunderstorm/app-backend/modules/FirestoreBackupScheduler";
|
|
8
|
+
import { FirestoreCollection } from "@intuitionrobotics/firebase/app-backend/firestore/FirestoreCollection";
|
|
9
|
+
import { FirestoreTransaction } from "@intuitionrobotics/firebase/app-backend/firestore/FirestoreTransaction";
|
|
10
|
+
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
11
|
+
export declare const validateId: (length: number, mandatory?: boolean) => import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
12
|
+
export declare const validateEmail: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
13
|
+
export declare const validateBucketUrl: (mandatory?: boolean | undefined) => import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
14
|
+
export declare const validateGeneralUrl: (mandatory?: boolean | undefined) => import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
15
|
+
export declare const validateUniqueId: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
16
|
+
export declare const validateOptionalId: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
17
|
+
export declare const validateStringWithDashes: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
18
|
+
export declare const validateStringAndNumbersWithDashes: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
19
|
+
export declare const validator_JavaObjectMemberName: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
20
|
+
export declare const validateNameWithDashesAndDots: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
21
|
+
export declare const validator_LowercaseStringWithDashes: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
22
|
+
export declare const validator_LowerUpperStringWithSpaces: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
23
|
+
export declare const validator_LowerUpperStringWithDashesAndUnderscore: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
24
|
+
export declare const validator_InternationalPhoneNumber: import("@intuitionrobotics/ts-common/validator/validator").Validator<string>;
|
|
20
25
|
export declare type CustomUniquenessAssertion<Type extends DB_Object> = (transaction: FirestoreTransaction, dbInstance: Type) => Promise<void>;
|
|
21
26
|
export declare type Config<Type extends object> = {
|
|
22
27
|
projectId?: string;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -28,39 +10,48 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
10
|
};
|
|
29
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
12
|
exports.BaseDB_ApiGenerator = exports.validator_InternationalPhoneNumber = exports.validator_LowerUpperStringWithDashesAndUnderscore = exports.validator_LowerUpperStringWithSpaces = exports.validator_LowercaseStringWithDashes = exports.validateNameWithDashesAndDots = exports.validator_JavaObjectMemberName = exports.validateStringAndNumbersWithDashes = exports.validateStringWithDashes = exports.validateOptionalId = exports.validateUniqueId = exports.validateGeneralUrl = exports.validateBucketUrl = exports.validateEmail = exports.validateId = void 0;
|
|
31
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
32
|
-
const apis_1 = require("./apis");
|
|
33
|
-
const backend_1 = require("@intuitionrobotics/thunderstorm/backend");
|
|
34
|
-
const backend_2 = require("@intuitionrobotics/firebase/backend");
|
|
35
13
|
const types_1 = require("../shared/types");
|
|
14
|
+
const validator_1 = require("@intuitionrobotics/ts-common/validator/validator");
|
|
15
|
+
const apis_1 = require("./apis");
|
|
16
|
+
const exceptions_1 = require("@intuitionrobotics/thunderstorm/app-backend/exceptions");
|
|
17
|
+
const FirebaseModule_1 = require("@intuitionrobotics/firebase/app-backend/FirebaseModule");
|
|
18
|
+
const FirestoreInterface_1 = require("@intuitionrobotics/firebase/app-backend/firestore/FirestoreInterface");
|
|
19
|
+
const module_1 = require("@intuitionrobotics/ts-common/core/module");
|
|
20
|
+
const date_time_tools_1 = require("@intuitionrobotics/ts-common/utils/date-time-tools");
|
|
21
|
+
const exceptions_2 = require("@intuitionrobotics/ts-common/core/exceptions");
|
|
22
|
+
const array_tools_1 = require("@intuitionrobotics/ts-common/utils/array-tools");
|
|
23
|
+
const tools_1 = require("@intuitionrobotics/ts-common/utils/tools");
|
|
24
|
+
const object_tools_1 = require("@intuitionrobotics/ts-common/utils/object-tools");
|
|
25
|
+
const random_tools_1 = require("@intuitionrobotics/ts-common/utils/random-tools");
|
|
26
|
+
const merge_tools_1 = require("@intuitionrobotics/ts-common/utils/merge-tools");
|
|
36
27
|
const idLength = 32;
|
|
37
|
-
const validateId = (length, mandatory = true) =>
|
|
28
|
+
const validateId = (length, mandatory = true) => validator_1.validateRegexp(new RegExp(`^[0-9a-f]{${length}}$`), mandatory);
|
|
38
29
|
exports.validateId = validateId;
|
|
39
|
-
exports.validateEmail =
|
|
40
|
-
const validateBucketUrl = (mandatory) =>
|
|
30
|
+
exports.validateEmail = validator_1.validateEmail;
|
|
31
|
+
const validateBucketUrl = (mandatory) => validator_1.validateRegexp(/gs?:\/\/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/, mandatory);
|
|
41
32
|
exports.validateBucketUrl = validateBucketUrl;
|
|
42
|
-
const validateGeneralUrl = (mandatory) =>
|
|
33
|
+
const validateGeneralUrl = (mandatory) => validator_1.validateRegexp(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/, mandatory);
|
|
43
34
|
exports.validateGeneralUrl = validateGeneralUrl;
|
|
44
35
|
exports.validateUniqueId = exports.validateId(idLength);
|
|
45
36
|
exports.validateOptionalId = exports.validateId(idLength, false);
|
|
46
|
-
exports.validateStringWithDashes =
|
|
47
|
-
exports.validateStringAndNumbersWithDashes =
|
|
48
|
-
exports.validator_JavaObjectMemberName =
|
|
49
|
-
exports.validateNameWithDashesAndDots =
|
|
50
|
-
exports.validator_LowercaseStringWithDashes =
|
|
51
|
-
exports.validator_LowerUpperStringWithSpaces =
|
|
52
|
-
exports.validator_LowerUpperStringWithDashesAndUnderscore =
|
|
53
|
-
exports.validator_InternationalPhoneNumber =
|
|
37
|
+
exports.validateStringWithDashes = validator_1.validateRegexp(/^[A-Za-z-]+$/);
|
|
38
|
+
exports.validateStringAndNumbersWithDashes = validator_1.validateRegexp(/^[0-9A-Za-z-]+$/);
|
|
39
|
+
exports.validator_JavaObjectMemberName = validator_1.validateRegexp(/^[a-z][a-zA-Z0-9]+$/);
|
|
40
|
+
exports.validateNameWithDashesAndDots = validator_1.validateRegexp(/^[a-z-.]+$/);
|
|
41
|
+
exports.validator_LowercaseStringWithDashes = validator_1.validateRegexp(/^[a-z-.]+$/);
|
|
42
|
+
exports.validator_LowerUpperStringWithSpaces = validator_1.validateRegexp(/^[A-Za-z ]+$/);
|
|
43
|
+
exports.validator_LowerUpperStringWithDashesAndUnderscore = validator_1.validateRegexp(/^[A-Za-z-_]+$/);
|
|
44
|
+
exports.validator_InternationalPhoneNumber = validator_1.validateRegexp(/^\+(?:[0-9] ?){6,14}[0-9]$/);
|
|
54
45
|
/**
|
|
55
46
|
* An abstract base class used for implementing CRUD operations on a specific collection.
|
|
56
47
|
*
|
|
57
48
|
* By default, it exposes API endpoints for creating, deleting, updating, querying and querying for unique document.
|
|
58
49
|
*/
|
|
59
|
-
class BaseDB_ApiGenerator extends
|
|
50
|
+
class BaseDB_ApiGenerator extends module_1.Module {
|
|
60
51
|
constructor(collectionName, validator, itemName, moduleName) {
|
|
61
52
|
super(moduleName);
|
|
62
53
|
// @ts-ignore
|
|
63
|
-
this.
|
|
54
|
+
this.setConfig({ itemName, collectionName, externalFilterKeys: ["_id"], lockKeys: ["_id"] });
|
|
64
55
|
this.validator = validator;
|
|
65
56
|
}
|
|
66
57
|
setValidator(validator) {
|
|
@@ -70,8 +61,8 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
70
61
|
return [{
|
|
71
62
|
backupQuery: this.resolveBackupQuery(),
|
|
72
63
|
collection: this.collection,
|
|
73
|
-
keepInterval: 7 *
|
|
74
|
-
interval:
|
|
64
|
+
keepInterval: 7 * date_time_tools_1.Day,
|
|
65
|
+
interval: date_time_tools_1.Day,
|
|
75
66
|
moduleKey: this.config.collectionName
|
|
76
67
|
}];
|
|
77
68
|
}
|
|
@@ -93,7 +84,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
93
84
|
*/
|
|
94
85
|
setExternalUniqueKeys(keys) {
|
|
95
86
|
if (this.initiated)
|
|
96
|
-
throw new
|
|
87
|
+
throw new exceptions_2.BadImplementationException("You can only update the 'externalUniqueKeys' before the module was initialized.. preferably from its constructor");
|
|
97
88
|
return this.config.externalFilterKeys = keys;
|
|
98
89
|
}
|
|
99
90
|
/**
|
|
@@ -110,8 +101,8 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
110
101
|
*/
|
|
111
102
|
setLockKeys(keys) {
|
|
112
103
|
if (this.initiated)
|
|
113
|
-
throw new
|
|
114
|
-
return this.config.lockKeys =
|
|
104
|
+
throw new exceptions_2.BadImplementationException("You can only update the 'lockKeys' before the module was initialized.. preferably from its constructor");
|
|
105
|
+
return this.config.lockKeys = array_tools_1.filterDuplicates([...keys,
|
|
115
106
|
"_id"]);
|
|
116
107
|
}
|
|
117
108
|
getCollectionName() {
|
|
@@ -126,7 +117,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
126
117
|
*/
|
|
127
118
|
init() {
|
|
128
119
|
var _a;
|
|
129
|
-
const firestore =
|
|
120
|
+
const firestore = FirebaseModule_1.FirebaseModule.createAdminSession((_a = this.config) === null || _a === void 0 ? void 0 : _a.projectId).getFirestore();
|
|
130
121
|
// @ts-ignore
|
|
131
122
|
this.collection = firestore.getCollection(this.config.collectionName, this.config.externalFilterKeys);
|
|
132
123
|
}
|
|
@@ -134,8 +125,8 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
134
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
126
|
const dbInstance = yield transaction.queryItem(this.collection, instance);
|
|
136
127
|
if (!dbInstance) {
|
|
137
|
-
const uniqueQuery =
|
|
138
|
-
throw new
|
|
128
|
+
const uniqueQuery = FirestoreInterface_1.FirestoreInterface.buildUniqueQuery(this.collection, instance);
|
|
129
|
+
throw new exceptions_1.ApiException(404, `Could not find ${this.config.itemName} with unique query '${tools_1.__stringify(uniqueQuery)}'`);
|
|
139
130
|
}
|
|
140
131
|
return dbInstance;
|
|
141
132
|
});
|
|
@@ -162,11 +153,11 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
162
153
|
if (!dbInstance || dbInstance._id === instance._id)
|
|
163
154
|
continue;
|
|
164
155
|
const query = uniqueQueries[idx];
|
|
165
|
-
const message =
|
|
156
|
+
const message = object_tools_1._keys(query).reduce((carry, key) => {
|
|
166
157
|
return carry + "\n" + `${key}: ${query[key]}`;
|
|
167
158
|
}, `${this.config.itemName} uniqueness violation. There is already a document with`);
|
|
168
159
|
this.logWarning(message);
|
|
169
|
-
throw new
|
|
160
|
+
throw new exceptions_1.ApiException(422, message);
|
|
170
161
|
}
|
|
171
162
|
});
|
|
172
163
|
}
|
|
@@ -180,16 +171,16 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
180
171
|
validateImpl(instance) {
|
|
181
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
182
173
|
try {
|
|
183
|
-
yield
|
|
174
|
+
yield validator_1.validate(instance, this.validator);
|
|
184
175
|
}
|
|
185
176
|
catch (e) {
|
|
186
|
-
const badImplementation =
|
|
177
|
+
const badImplementation = exceptions_2.isErrorOfType(e, exceptions_2.BadImplementationException);
|
|
187
178
|
if (badImplementation)
|
|
188
|
-
throw new
|
|
189
|
-
const error =
|
|
179
|
+
throw new exceptions_1.ApiException(500, badImplementation.message);
|
|
180
|
+
const error = exceptions_2.isErrorOfType(e, validator_1.ValidationException);
|
|
190
181
|
if (error) {
|
|
191
182
|
const errorBody = { type: types_1.ErrorKey_BadInput, body: { path: error.path, input: error.input } };
|
|
192
|
-
throw new
|
|
183
|
+
throw new exceptions_1.ApiException(400, error.message).setErrorBody(errorBody);
|
|
193
184
|
}
|
|
194
185
|
}
|
|
195
186
|
});
|
|
@@ -295,7 +286,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
295
286
|
upsert_Read(instance, transaction, request) {
|
|
296
287
|
return __awaiter(this, void 0, void 0, function* () {
|
|
297
288
|
if (instance._id === undefined)
|
|
298
|
-
return this.createImpl_Read(transaction, Object.assign(Object.assign({}, instance), { _id:
|
|
289
|
+
return this.createImpl_Read(transaction, Object.assign(Object.assign({}, instance), { _id: random_tools_1.generateHex(idLength) }), request);
|
|
299
290
|
return this.upsertImpl_Read(transaction, instance, request);
|
|
300
291
|
});
|
|
301
292
|
}
|
|
@@ -310,7 +301,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
310
301
|
*/
|
|
311
302
|
upsertAll_Batched(instances, request) {
|
|
312
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
313
|
-
return
|
|
304
|
+
return array_tools_1.batchAction(instances, 500, (chunked) => __awaiter(this, void 0, void 0, function* () { return this.upsertAll(chunked, undefined, request); }));
|
|
314
305
|
});
|
|
315
306
|
}
|
|
316
307
|
/**
|
|
@@ -329,7 +320,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
329
320
|
return __awaiter(this, void 0, void 0, function* () {
|
|
330
321
|
if (instances.length > 500) {
|
|
331
322
|
if (transaction)
|
|
332
|
-
throw new
|
|
323
|
+
throw new exceptions_2.BadImplementationException('Firestore transaction supports maximum 500 at a time');
|
|
333
324
|
return this.upsertAll_Batched(instances, request);
|
|
334
325
|
}
|
|
335
326
|
const processor = (_transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -345,7 +336,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
345
336
|
return __awaiter(this, void 0, void 0, function* () {
|
|
346
337
|
const actions = [];
|
|
347
338
|
instances.reduce((carry, instance) => {
|
|
348
|
-
|
|
339
|
+
carry.push(this.upsert_Read(instance, transaction, request));
|
|
349
340
|
return carry;
|
|
350
341
|
}, actions);
|
|
351
342
|
return Promise.all(actions);
|
|
@@ -390,11 +381,11 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
390
381
|
deleteUnique(_id, transaction, request) {
|
|
391
382
|
return __awaiter(this, void 0, void 0, function* () {
|
|
392
383
|
if (!_id)
|
|
393
|
-
throw new
|
|
384
|
+
throw new exceptions_2.BadImplementationException(`No _id for deletion provided.`);
|
|
394
385
|
const processor = (_transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
395
386
|
const write = yield this.deleteUnique_Read(_id, _transaction, request);
|
|
396
387
|
if (!write)
|
|
397
|
-
throw new
|
|
388
|
+
throw new exceptions_1.ApiException(404, `Could not find ${this.config.itemName} with unique id: ${_id}`);
|
|
398
389
|
return write();
|
|
399
390
|
});
|
|
400
391
|
if (transaction)
|
|
@@ -405,11 +396,11 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
405
396
|
deleteUnique_Read(_id, transaction, request) {
|
|
406
397
|
return __awaiter(this, void 0, void 0, function* () {
|
|
407
398
|
if (!_id)
|
|
408
|
-
throw new
|
|
399
|
+
throw new exceptions_2.BadImplementationException(`No _id for deletion provided.`);
|
|
409
400
|
const ourQuery = { where: { _id } };
|
|
410
401
|
const dbInstance = yield transaction.queryUnique(this.collection, ourQuery);
|
|
411
402
|
if (!dbInstance)
|
|
412
|
-
throw new
|
|
403
|
+
throw new exceptions_1.ApiException(404, `Could not find ${this.config.itemName} with unique id: ${_id}`);
|
|
413
404
|
const write = yield this.deleteImpl_Read(transaction, ourQuery, request);
|
|
414
405
|
return () => __awaiter(this, void 0, void 0, function* () {
|
|
415
406
|
if (!write)
|
|
@@ -434,7 +425,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
434
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
435
426
|
const write = yield transaction.deleteUnique_Read(this.collection, ourQuery);
|
|
436
427
|
if (!write)
|
|
437
|
-
throw new
|
|
428
|
+
throw new exceptions_2.ThisShouldNotHappenException(`I just checked that I had an instance for query: ${tools_1.__stringify(ourQuery)}`);
|
|
438
429
|
return write;
|
|
439
430
|
});
|
|
440
431
|
}
|
|
@@ -464,7 +455,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
464
455
|
return __awaiter(this, void 0, void 0, function* () {
|
|
465
456
|
const dbItem = yield this.collection.queryUnique({ where });
|
|
466
457
|
if (!dbItem)
|
|
467
|
-
throw new
|
|
458
|
+
throw new exceptions_1.ApiException(404, `Could not find ${this.config.itemName} with unique query: ${JSON.stringify(where)}`);
|
|
468
459
|
return dbItem;
|
|
469
460
|
});
|
|
470
461
|
}
|
|
@@ -502,16 +493,16 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
502
493
|
// If the caller has specified props to be changed, make sure the don't conflict with the lockKeys.
|
|
503
494
|
const wrongKey = propsToPatch === null || propsToPatch === void 0 ? void 0 : propsToPatch.find(prop => this.config.lockKeys.includes(prop));
|
|
504
495
|
if (wrongKey)
|
|
505
|
-
throw new
|
|
496
|
+
throw new exceptions_2.BadImplementationException(`Key ${wrongKey} is part of the 'lockKeys' and cannot be updated.`);
|
|
506
497
|
// If the caller has not specified props, we remove the keys from the caller's instance
|
|
507
498
|
// before merging with the original dbInstance.
|
|
508
|
-
|
|
499
|
+
object_tools_1._keys(instance).forEach(key => {
|
|
509
500
|
if (this.config.lockKeys.includes(key) || (propsToPatch && !propsToPatch.includes(key))) {
|
|
510
501
|
delete instance[key];
|
|
511
502
|
}
|
|
512
503
|
});
|
|
513
|
-
const mergedObject =
|
|
514
|
-
yield
|
|
504
|
+
const mergedObject = merge_tools_1.merge(dbInstance, instance);
|
|
505
|
+
yield validator_1.validate(mergedObject, this.validator);
|
|
515
506
|
yield this.assertUniqueness(transaction, mergedObject, request);
|
|
516
507
|
return this.upsertImpl(transaction, mergedObject, request);
|
|
517
508
|
}));
|
|
@@ -541,7 +532,7 @@ class BaseDB_ApiGenerator extends ts_common_1.Module {
|
|
|
541
532
|
* An array of api endpoints.
|
|
542
533
|
*/
|
|
543
534
|
apis(pathPart) {
|
|
544
|
-
return
|
|
535
|
+
return array_tools_1.filterInstances([
|
|
545
536
|
this.apiCreate(pathPart),
|
|
546
537
|
this.apiQuery(pathPart),
|
|
547
538
|
this.apiQueryUnique(pathPart),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDB_ApiGenerator.js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C3B,CAAC,CAAC;IACX,CAAC;CACJ;AAjhBD,kDAihBC"}
|
package/app-backend/apis.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BaseDB_ApiGenerator } from "./BaseDB_ApiGenerator";
|
|
2
|
-
import {
|
|
3
|
-
import { ApiBinder_DBCreate, ApiBinder_DBDelete, ApiBinder_DBQuery, ApiBinder_DBUniuqe, ApiBinder_DBUpdate, GenericApiDef } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { DB_Object } from "@intuitionrobotics/ts-common/utils/types";
|
|
3
|
+
import { ApiBinder_DBCreate, ApiBinder_DBDelete, ApiBinder_DBQuery, ApiBinder_DBUniuqe, ApiBinder_DBUpdate, GenericApiDef } from "../shared/types";
|
|
4
|
+
import { ApiResponse, ServerApi } from "@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api";
|
|
5
|
+
import { ApiTypeBinder, DeriveBodyType, DeriveQueryType, DeriveResponseType, QueryParams } from "@intuitionrobotics/thunderstorm/shared/types";
|
|
6
|
+
import { ExpressRequest } from "@intuitionrobotics/thunderstorm/app-backend/utils/types";
|
|
6
7
|
export declare function resolveUrlPart(dbModule: BaseDB_ApiGenerator<any>, pathPart?: string, pathSuffix?: string): string;
|
|
7
8
|
export declare abstract class GenericServerApi<DBType extends DB_Object, Binder extends ApiTypeBinder<string, R, B, P>, PostProcessor = never, R = DeriveResponseType<Binder>, B = DeriveBodyType<Binder>, P extends QueryParams | {} = DeriveQueryType<Binder>> extends ServerApi<Binder> {
|
|
8
9
|
protected readonly dbModule: BaseDB_ApiGenerator<DBType>;
|
package/app-backend/apis.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -28,27 +10,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
10
|
};
|
|
29
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
12
|
exports.ServerApi_Delete = exports.ServerApi_Query = exports.ServerApi_Unique = exports.ServerApi_Update = exports.ServerApi_Create = exports.GenericServerApi = exports.resolveUrlPart = void 0;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
13
|
+
const types_1 = require("../shared/types");
|
|
14
|
+
const server_api_1 = require("@intuitionrobotics/thunderstorm/app-backend/modules/server/server-api");
|
|
34
15
|
function resolveUrlPart(dbModule, pathPart, pathSuffix) {
|
|
35
16
|
return `${!pathPart ? dbModule.getItemName() : pathPart}${pathSuffix ? "/" + pathSuffix : ""}`;
|
|
36
17
|
}
|
|
37
18
|
exports.resolveUrlPart = resolveUrlPart;
|
|
38
|
-
class GenericServerApi extends
|
|
19
|
+
class GenericServerApi extends server_api_1.ServerApi {
|
|
39
20
|
constructor(dbModule, def, pathPart) {
|
|
40
21
|
super(def.method, resolveUrlPart(dbModule, pathPart, def.suffix));
|
|
41
22
|
this.postProcessors = [];
|
|
42
23
|
this.dbModule = dbModule;
|
|
43
24
|
}
|
|
44
25
|
addPostProcessor(processor) {
|
|
45
|
-
|
|
26
|
+
this.postProcessors.push(processor);
|
|
46
27
|
}
|
|
47
28
|
}
|
|
48
29
|
exports.GenericServerApi = GenericServerApi;
|
|
49
30
|
class ServerApi_Create extends GenericServerApi {
|
|
50
31
|
constructor(dbModule, pathPart) {
|
|
51
|
-
super(dbModule,
|
|
32
|
+
super(dbModule, types_1.DefaultApiDefs.Create, pathPart);
|
|
52
33
|
}
|
|
53
34
|
process(request, response, queryParams, body) {
|
|
54
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -63,7 +44,7 @@ class ServerApi_Create extends GenericServerApi {
|
|
|
63
44
|
exports.ServerApi_Create = ServerApi_Create;
|
|
64
45
|
class ServerApi_Update extends GenericServerApi {
|
|
65
46
|
constructor(dbModule, pathPart) {
|
|
66
|
-
super(dbModule,
|
|
47
|
+
super(dbModule, types_1.DefaultApiDefs.Update, pathPart);
|
|
67
48
|
}
|
|
68
49
|
process(request, response, queryParams, body) {
|
|
69
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -74,7 +55,7 @@ class ServerApi_Update extends GenericServerApi {
|
|
|
74
55
|
exports.ServerApi_Update = ServerApi_Update;
|
|
75
56
|
class ServerApi_Unique extends GenericServerApi {
|
|
76
57
|
constructor(dbModule, pathPart) {
|
|
77
|
-
super(dbModule,
|
|
58
|
+
super(dbModule, types_1.DefaultApiDefs.Unique, pathPart);
|
|
78
59
|
}
|
|
79
60
|
process(request, response, queryParams, body) {
|
|
80
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -85,7 +66,7 @@ class ServerApi_Unique extends GenericServerApi {
|
|
|
85
66
|
exports.ServerApi_Unique = ServerApi_Unique;
|
|
86
67
|
class ServerApi_Query extends GenericServerApi {
|
|
87
68
|
constructor(dbModule, pathPart) {
|
|
88
|
-
super(dbModule,
|
|
69
|
+
super(dbModule, types_1.DefaultApiDefs.Query, pathPart);
|
|
89
70
|
}
|
|
90
71
|
process(request, response, queryParams, _body) {
|
|
91
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -99,7 +80,7 @@ class ServerApi_Query extends GenericServerApi {
|
|
|
99
80
|
exports.ServerApi_Query = ServerApi_Query;
|
|
100
81
|
class ServerApi_Delete extends GenericServerApi {
|
|
101
82
|
constructor(dbModule, pathPart) {
|
|
102
|
-
super(dbModule,
|
|
83
|
+
super(dbModule, types_1.DefaultApiDefs.Delete, pathPart);
|
|
103
84
|
}
|
|
104
85
|
process(request, response, queryParams, body) {
|
|
105
86
|
return __awaiter(this, void 0, void 0, function* () {
|
package/app-backend/apis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../../src/main/app-backend/apis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../../src/main/app-backend/apis.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAQyB;AACzB,sGAA6G;AAW7G,SAAgB,cAAc,CAAC,QAAkC,EAAE,QAAiB,EAAE,UAAmB;IACrG,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACnG,CAAC;AAFD,wCAEC;AAED,MAAsB,gBAClB,SAAQ,sBAAiB;IAKzB,YAAsB,QAAqC,EAAE,GAAkB,EAAE,QAAiB;QAC9F,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAHnD,mBAAc,GAAoB,EAAE,CAAC;QAIpD,IAAI,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IAAU;;YACtG,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAmC,EAAE,OAAO,CAAC,CAAC;QACnF,CAAC;KAAA;CACJ;AAVD,4CAUC;AAED,MAAa,eACT,SAAQ,gBAAwF;IAEhG,YAAY,QAAqC,EAAE,QAAiB;QAChE,KAAK,CAAC,QAAQ,EAAE,sBAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAe,EAAE,KAAsB;;YAC3G,qDAAqD;YACrD,oCAAoC;YACpC,IAAI;YAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAC,KAAK,EAAE,KAAK,EAA2B,EAAE,OAAO,CAAC,CAAC;QAClF,CAAC;KAAA;CACJ;AAdD,0CAcC;AAED,MAAa,gBACT,SAAQ,gBAAoD;IAE5D,YAAY,QAAqC,EAAE,QAAiB;QAChE,KAAK,CAAC,QAAQ,EAAE,sBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,CAAC;IAEe,OAAO,CAAC,OAAuB,EAAE,QAAqB,EAAE,WAAsB,EAAE,IAAU;;YACtG,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAC3E,CAAC;KAAA;CACJ;AAVD,4CAUC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ApiBinder_DBCreate, ApiBinder_DBDelete, ApiBinder_DBQuery, ApiBinder_DBUniuqe, GenericApiDef } from "../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { DB_Object, PartialProperties } from "@intuitionrobotics/ts-common/utils/types";
|
|
2
|
+
import { ApiBinder_DBCreate, ApiBinder_DBDelete, ApiBinder_DBQuery, ApiBinder_DBUniuqe, GenericApiDef } from "../shared/types";
|
|
3
|
+
import { ThunderDispatcher } from "@intuitionrobotics/thunderstorm/app-frontend/core/thunder-dispatcher";
|
|
4
|
+
import { BaseHttpRequest } from "@intuitionrobotics/thunderstorm/shared/BaseHttpRequest";
|
|
5
|
+
import { ApiTypeBinder, DeriveBodyType, DeriveQueryType, DeriveResponseType, DeriveUrlType, ErrorResponse, QueryParams } from "@intuitionrobotics/thunderstorm/shared/types";
|
|
6
|
+
import { Module } from "@intuitionrobotics/ts-common/core/module";
|
|
6
7
|
export declare type BaseApiConfig = {
|
|
7
8
|
relativeUrl: string;
|
|
8
9
|
key: string;
|
|
9
10
|
};
|
|
10
|
-
export declare abstract class BaseDB_ApiGeneratorCaller<DBType extends DB_Object, UType extends PartialProperties<DBType, "_id"> = PartialProperties<DBType, "_id"
|
|
11
|
+
export declare abstract class BaseDB_ApiGeneratorCaller<DBType extends DB_Object, UType extends PartialProperties<DBType, "_id"> = PartialProperties<DBType, "_id">, Config extends BaseApiConfig = BaseApiConfig> extends Module<Config> {
|
|
11
12
|
private readonly errorHandler;
|
|
12
13
|
private defaultDispatcher?;
|
|
13
|
-
constructor(config:
|
|
14
|
+
constructor(config: Config, moduleName: string);
|
|
14
15
|
setDefaultDispatcher(defaultDispatcher: ThunderDispatcher<any, string>): void;
|
|
15
16
|
protected createRequest<Binder extends ApiTypeBinder<U, R, B, P, any> = ApiTypeBinder<void, void, void, {}, any>, U extends string = DeriveUrlType<Binder>, R = DeriveResponseType<Binder>, B = DeriveBodyType<Binder>, P extends QueryParams = DeriveQueryType<Binder>>(apiDef: GenericApiDef): BaseHttpRequest<Binder>;
|
|
16
17
|
getRequestKey(apiDef: GenericApiDef): string;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -28,21 +10,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
10
|
};
|
|
29
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
12
|
exports.BaseDB_ApiGeneratorCaller = void 0;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
13
|
+
const types_1 = require("../shared/types");
|
|
14
|
+
const XhrHttpModule_1 = require("@intuitionrobotics/thunderstorm/app-frontend/modules/http/XhrHttpModule");
|
|
15
|
+
const module_1 = require("@intuitionrobotics/ts-common/core/module");
|
|
16
|
+
const array_tools_1 = require("@intuitionrobotics/ts-common/utils/array-tools");
|
|
17
|
+
class BaseDB_ApiGeneratorCaller extends module_1.Module {
|
|
35
18
|
// noinspection TypeScriptAbstractClassConstructorCanBeMadeProtected
|
|
36
19
|
constructor(config, moduleName) {
|
|
37
20
|
super(moduleName);
|
|
38
21
|
this.errorHandler = (request, resError) => {
|
|
39
22
|
if (this.onError(request, resError))
|
|
40
23
|
return;
|
|
41
|
-
return
|
|
24
|
+
return XhrHttpModule_1.XhrHttpModule.handleRequestFailure(request, resError);
|
|
42
25
|
};
|
|
43
26
|
this.update = (toUpdate) => {
|
|
44
27
|
return this
|
|
45
|
-
.createRequest(
|
|
28
|
+
.createRequest(types_1.DefaultApiDefs.Update)
|
|
46
29
|
.setJsonBody(toUpdate)
|
|
47
30
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
48
31
|
return this.onEntryUpdated(response);
|
|
@@ -53,7 +36,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
53
36
|
if (!_query)
|
|
54
37
|
_query = {};
|
|
55
38
|
return this
|
|
56
|
-
.createRequest(
|
|
39
|
+
.createRequest(types_1.DefaultApiDefs.Query)
|
|
57
40
|
.setJsonBody(_query)
|
|
58
41
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
59
42
|
return this.onQueryReturned(response);
|
|
@@ -61,7 +44,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
61
44
|
};
|
|
62
45
|
this.unique = (_id) => {
|
|
63
46
|
return this
|
|
64
|
-
.createRequest(
|
|
47
|
+
.createRequest(types_1.DefaultApiDefs.Unique)
|
|
65
48
|
.setUrlParams({ _id })
|
|
66
49
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
67
50
|
return this.onGotUnique(response);
|
|
@@ -69,7 +52,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
69
52
|
};
|
|
70
53
|
this.delete = (_id) => {
|
|
71
54
|
return this
|
|
72
|
-
.createRequest(
|
|
55
|
+
.createRequest(types_1.DefaultApiDefs.Delete)
|
|
73
56
|
.setUrlParams({ _id })
|
|
74
57
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
75
58
|
return this.onEntryDeleted(response);
|
|
@@ -84,15 +67,15 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
84
67
|
};
|
|
85
68
|
this.upsertId = (id) => {
|
|
86
69
|
if (!this.ids.includes(id))
|
|
87
|
-
|
|
70
|
+
this.ids.push(id);
|
|
88
71
|
};
|
|
89
|
-
this.
|
|
72
|
+
this.setConfig(config);
|
|
90
73
|
}
|
|
91
74
|
setDefaultDispatcher(defaultDispatcher) {
|
|
92
75
|
this.defaultDispatcher = defaultDispatcher;
|
|
93
76
|
}
|
|
94
77
|
createRequest(apiDef) {
|
|
95
|
-
const request =
|
|
78
|
+
const request = XhrHttpModule_1.XhrHttpModule
|
|
96
79
|
.createRequest(apiDef.method, this.getRequestKey(apiDef))
|
|
97
80
|
.setRelativeUrl(`${this.config.relativeUrl}${apiDef.suffix ? "/" + apiDef.suffix : ""}`)
|
|
98
81
|
.setOnError(this.errorHandler);
|
|
@@ -111,7 +94,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
111
94
|
}
|
|
112
95
|
create(toCreate) {
|
|
113
96
|
return this
|
|
114
|
-
.createRequest(
|
|
97
|
+
.createRequest(types_1.DefaultApiDefs.Create)
|
|
115
98
|
.setJsonBody(toCreate)
|
|
116
99
|
.execute((response) => __awaiter(this, void 0, void 0, function* () {
|
|
117
100
|
return this.onEntryCreated(response);
|
|
@@ -132,7 +115,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
132
115
|
}
|
|
133
116
|
onEntryDeleted(item) {
|
|
134
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
|
|
118
|
+
array_tools_1.removeItemFromArray(this.ids, item._id);
|
|
136
119
|
delete this.items[item._id];
|
|
137
120
|
this.dispatch();
|
|
138
121
|
});
|
|
@@ -145,8 +128,7 @@ class BaseDB_ApiGeneratorCaller extends ts_common_1.Module {
|
|
|
145
128
|
}
|
|
146
129
|
onGotUnique(item) {
|
|
147
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
-
|
|
149
|
-
ts_common_1.addItemToArray(this.ids, item._id);
|
|
131
|
+
this.upsertId(item._id);
|
|
150
132
|
this.items[item._id] = item;
|
|
151
133
|
this.dispatch();
|
|
152
134
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDB_ApiGeneratorCaller.js","sourceRoot":"","sources":["../../src/main/app-frontend/BaseDB_ApiGeneratorCaller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseDB_ApiGeneratorCaller.js","sourceRoot":"","sources":["../../src/main/app-frontend/BaseDB_ApiGeneratorCaller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAOyB;AAEzB,2GAAsG;AAatG,qEAAgE;AAChE,gFAAmF;AAQnF,MAAsB,yBAKlB,SAAQ,eAAc;IAWtB,oEAAoE;IACpE,YAAY,MAAc,EAAE,UAAkB;QAC1C,KAAK,CAAC,UAAU,CAAC,CAAC;QAXL,iBAAY,GAA6B,CAAC,OAA6B,EAAE,QAA6B,EAAE,EAAE;YACvH,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;gBAC/B,OAAO;YAEX,OAAO,6BAAa,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,CAAC,CAAC;QAoDF,WAAM,GAAG,CAAC,QAAgB,EAA+C,EAAE;YACvE,OAAO,IAAI;iBACN,aAAa,CAA6B,sBAAc,CAAC,MAAM,CAAC;iBAChE,WAAW,CAAC,QAAQ,CAAC;iBACrB,OAAO,CAAC,CAAM,QAAQ,EAAC,EAAE;gBACtB,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACzC,CAAC,CAAA,CAAC,CAAC;QACX,CAAC,CAAC;QAEF,UAAK,GAAG,CAAC,KAAuB,EAA8C,EAAE;YAC5E,IAAI,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,MAAM;gBACP,MAAM,GAAG,EAAqB,CAAC;YAEnC,OAAO,IAAI;iBACN,aAAa,CAA4B,sBAAc,CAAC,KAAK,CAAC;iBAC9D,WAAW,CAAC,MAAM,CAAC;iBACnB,OAAO,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AC;YACjB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAEf,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;KAAA;CAMJ;AA/JD,8DA+JC"}
|
package/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./shared/types";
|
package/index.js
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("./shared/types"), exports);
|
|
32
2
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuitionrobotics/db-api-generator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.00",
|
|
4
4
|
"description": "db-api-generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"IR",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"build": "tsc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@intuitionrobotics/ts-common": "~0.
|
|
30
|
-
"@intuitionrobotics/firebase": "~0.
|
|
31
|
-
"@intuitionrobotics/thunderstorm": "~0.
|
|
29
|
+
"@intuitionrobotics/ts-common": "~0.46.0",
|
|
30
|
+
"@intuitionrobotics/firebase": "~0.46.0",
|
|
31
|
+
"@intuitionrobotics/thunderstorm": "~0.46.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@intuitionrobotics/testelot": "~0.
|
|
34
|
+
"@intuitionrobotics/testelot": "~0.46.0",
|
|
35
35
|
"@types/node": "^16.0.0",
|
|
36
36
|
"module-alias": "^2.2.0",
|
|
37
37
|
"ts-node": "^8.10.2",
|
package/shared/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ApiWithBody, ApiWithQuery, HttpMethod } from "@intuitionrobotics/thunderstorm/shared/types";
|
|
2
|
+
import { DB_Object } from "@intuitionrobotics/ts-common/utils/types";
|
|
3
3
|
export declare const DefaultApiDefs: {
|
|
4
4
|
[k: string]: GenericApiDef;
|
|
5
5
|
};
|
package/shared/types.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ErrorKey_BadInput = exports.DefaultApiDefs = void 0;
|
|
4
|
-
const
|
|
4
|
+
const types_1 = require("@intuitionrobotics/thunderstorm/shared/types");
|
|
5
5
|
exports.DefaultApiDefs = {
|
|
6
6
|
Create: {
|
|
7
|
-
method:
|
|
7
|
+
method: types_1.HttpMethod.POST,
|
|
8
8
|
key: "create",
|
|
9
9
|
suffix: "create"
|
|
10
10
|
},
|
|
11
11
|
Update: {
|
|
12
|
-
method:
|
|
12
|
+
method: types_1.HttpMethod.POST,
|
|
13
13
|
key: "update",
|
|
14
14
|
suffix: "update"
|
|
15
15
|
},
|
|
16
16
|
Delete: {
|
|
17
|
-
method:
|
|
17
|
+
method: types_1.HttpMethod.GET,
|
|
18
18
|
key: "delete",
|
|
19
19
|
suffix: "delete"
|
|
20
20
|
},
|
|
21
21
|
Unique: {
|
|
22
|
-
method:
|
|
22
|
+
method: types_1.HttpMethod.GET,
|
|
23
23
|
key: "unique",
|
|
24
24
|
suffix: "unique"
|
|
25
25
|
},
|
|
26
26
|
Query: {
|
|
27
|
-
method:
|
|
27
|
+
method: types_1.HttpMethod.POST,
|
|
28
28
|
key: "query",
|
|
29
29
|
suffix: "query"
|
|
30
30
|
},
|
package/shared/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/shared/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/shared/types.ts"],"names":[],"mappings":";;;AAAA,wEAAmG;AAGtF,QAAA,cAAc,GAAoC;IAC3D,MAAM,EAAE;QACJ,MAAM,EAAE,kBAAU,CAAC,IAAI;QACvB,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,QAAQ;KACnB;IACD,MAAM,EAAE;QACJ,MAAM,EAAE,kBAAU,CAAC,IAAI;QACvB,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,QAAQ;KACnB;IACD,MAAM,EAAE;QACJ,MAAM,EAAE,kBAAU,CAAC,GAAG;QACtB,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,QAAQ;KACnB;IACD,MAAM,EAAE;QACJ,MAAM,EAAE,kBAAU,CAAC,GAAG;QACtB,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,QAAQ;KACnB;IACD,KAAK,EAAE;QACH,MAAM,EAAE,kBAAU,CAAC,IAAI;QACvB,GAAG,EAAE,OAAO;QACZ,MAAM,EAAE,OAAO;KAClB;CACJ,CAAC;AAEW,QAAA,iBAAiB,GAAG,WAAW,CAAC"}
|
package/backend.d.ts
DELETED
package/backend.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("./app-backend/apis"), exports);
|
|
32
|
-
__exportStar(require("./app-backend/BaseDB_ApiGenerator"), exports);
|
|
33
|
-
//# sourceMappingURL=backend.js.map
|
package/backend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/main/backend.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,qDAAkC;AAClC,oEAAiD"}
|
package/frontend.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./app-frontend/BaseDB_ApiGeneratorCaller";
|
package/frontend.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Permissions management system, define access level for each of
|
|
4
|
-
* your server apis, and restrict users by giving them access levels
|
|
5
|
-
*
|
|
6
|
-
* Copyright (C) 2020 Intuition Robotics
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*/
|
|
20
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
28
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
__exportStar(require("./app-frontend/BaseDB_ApiGeneratorCaller"), exports);
|
|
32
|
-
//# sourceMappingURL=frontend.js.map
|
package/frontend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frontend.js","sourceRoot":"","sources":["../src/main/frontend.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;AAEH,2EAAwD"}
|