@spinajs/orm-http 1.2.125 → 1.2.127
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/lib/api.d.ts +21 -0
- package/lib/api.js +291 -0
- package/lib/api.js.map +1 -0
- package/lib/config/orm-http.d.ts +1 -0
- package/lib/config/orm-http.js +14 -0
- package/lib/config/orm-http.js.map +1 -0
- package/lib/controllers/repository.d.ts +31 -0
- package/lib/controllers/repository.js +231 -0
- package/lib/controllers/repository.js.map +1 -0
- package/package.json +13 -11
package/lib/api.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AccessControl } from '@spinajs/rbac';
|
|
2
|
+
import { Bootstrapper, Constructor, IContainer } from '@spinajs/di';
|
|
3
|
+
import { HttpServer } from '@spinajs/http';
|
|
4
|
+
import { Log } from '@spinajs/log';
|
|
5
|
+
import { ModelBase, Orm } from '@spinajs/orm';
|
|
6
|
+
import * as express from 'express';
|
|
7
|
+
export declare class OrmJsonApiBootsrapper extends Bootstrapper {
|
|
8
|
+
protected Log: Log;
|
|
9
|
+
protected Container: IContainer;
|
|
10
|
+
protected Server: HttpServer;
|
|
11
|
+
protected Orm: Orm;
|
|
12
|
+
protected Router: express.Router;
|
|
13
|
+
protected Ac: AccessControl;
|
|
14
|
+
constructor();
|
|
15
|
+
bootstrap(): void | Promise<void>;
|
|
16
|
+
protected addGet(model: Constructor<ModelBase>): void;
|
|
17
|
+
protected addGetAll(model: Constructor<ModelBase>): void;
|
|
18
|
+
protected addUpdate(model: Constructor<ModelBase>): void;
|
|
19
|
+
protected addInsert(model: Constructor<ModelBase>): void;
|
|
20
|
+
protected addDelete(model: Constructor<ModelBase>): void;
|
|
21
|
+
}
|
package/lib/api.js
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.OrmJsonApiBootsrapper = void 0;
|
|
39
|
+
const exceptions_1 = require("@spinajs/exceptions");
|
|
40
|
+
const rbac_1 = require("@spinajs/rbac");
|
|
41
|
+
const di_1 = require("@spinajs/di");
|
|
42
|
+
const http_1 = require("@spinajs/http");
|
|
43
|
+
const log_1 = require("@spinajs/log");
|
|
44
|
+
const orm_1 = require("@spinajs/orm");
|
|
45
|
+
const express = __importStar(require("express"));
|
|
46
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
47
|
+
const rbac_http_1 = require("@spinajs/rbac-http");
|
|
48
|
+
function dehydrate(model, omit) {
|
|
49
|
+
const dObj = {
|
|
50
|
+
type: model.constructor.name,
|
|
51
|
+
id: model.PrimaryKeyValue,
|
|
52
|
+
attributes: model.dehydrate(false, omit),
|
|
53
|
+
relationships: lodash_1.default.mapValues(lodash_1.default.groupBy(model.getFlattenRelationModels(false), '__relationKey__'), (x) => {
|
|
54
|
+
return x.map((xx) => {
|
|
55
|
+
return {
|
|
56
|
+
type: xx.constructor.name,
|
|
57
|
+
id: xx.PrimaryKeyValue,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
return dObj;
|
|
63
|
+
}
|
|
64
|
+
function modelToJsonApi(model) {
|
|
65
|
+
return {
|
|
66
|
+
data: Array.isArray(model) ? model.map((m) => dehydrate(m)) : dehydrate(model),
|
|
67
|
+
included: Array.isArray(model) ? lodash_1.default.flatMap(model, extractIncluded) : extractIncluded(model),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function extractIncluded(model) {
|
|
71
|
+
return model.getFlattenRelationModels(true).map((m) => dehydrate(m));
|
|
72
|
+
}
|
|
73
|
+
function extractRouteParameters(req) {
|
|
74
|
+
const id = req.params['id'];
|
|
75
|
+
const page = Number(req.query['page']);
|
|
76
|
+
const perPage = Number(req.query['perPage']);
|
|
77
|
+
const order = req.query['order'];
|
|
78
|
+
const orderDirection = req.query['orderDirection'];
|
|
79
|
+
const includes = req.query['include']
|
|
80
|
+
? req.query['include'].split(',').map((i) => {
|
|
81
|
+
return i.split('.');
|
|
82
|
+
})
|
|
83
|
+
: [];
|
|
84
|
+
const filters = req.query['filter'] ? JSON.parse(req.query['filter']) : [];
|
|
85
|
+
return {
|
|
86
|
+
id,
|
|
87
|
+
page,
|
|
88
|
+
perPage,
|
|
89
|
+
order,
|
|
90
|
+
orderDirection,
|
|
91
|
+
includes,
|
|
92
|
+
filters,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function _apiCheckPolicy(model, permission) {
|
|
96
|
+
return async (req, _res, next) => {
|
|
97
|
+
const p = (0, rbac_http_1.checkRoutePermission)(req, model.name.toLowerCase(), permission);
|
|
98
|
+
if (p.granted) {
|
|
99
|
+
next();
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
next(new exceptions_1.Forbidden(`current user does not have permission to access resource ${model.name} with ${permission} grant`));
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function _apiInsertAction(model) {
|
|
107
|
+
return async (req, res, next) => {
|
|
108
|
+
try {
|
|
109
|
+
const entity = new model(req.body);
|
|
110
|
+
await model['insert'](entity);
|
|
111
|
+
res.locals.response = new http_1.Ok(modelToJsonApi(entity));
|
|
112
|
+
next();
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
res.locals.response = new http_1.ServerError({
|
|
116
|
+
error: {
|
|
117
|
+
message: err.message,
|
|
118
|
+
err: err,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
next(err);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function _apiPatchAction(model) {
|
|
126
|
+
return async (req, res, next) => {
|
|
127
|
+
try {
|
|
128
|
+
const param = req.params['id'];
|
|
129
|
+
const entity = await model['getOrFail'](param);
|
|
130
|
+
entity.hydrate(req.body.data.attributes);
|
|
131
|
+
await entity.update();
|
|
132
|
+
res.locals.response = new http_1.Ok(modelToJsonApi(entity));
|
|
133
|
+
next();
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
res.locals.response = new http_1.ServerError({
|
|
137
|
+
error: {
|
|
138
|
+
message: err.message,
|
|
139
|
+
err: err,
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
next(err);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function _apiDeleteAction(model) {
|
|
147
|
+
return async (req, res, next) => {
|
|
148
|
+
try {
|
|
149
|
+
const param = req.params['id'];
|
|
150
|
+
await model['destroy'](param);
|
|
151
|
+
res.locals.response = new http_1.Ok();
|
|
152
|
+
next();
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
res.locals.response = new http_1.ServerError({
|
|
156
|
+
error: {
|
|
157
|
+
message: err.message,
|
|
158
|
+
err: err,
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
next(err);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function _apiGetAllAction(model) {
|
|
166
|
+
return async (req, res, next) => {
|
|
167
|
+
var _a, _b, _c;
|
|
168
|
+
try {
|
|
169
|
+
const params = extractRouteParameters(req);
|
|
170
|
+
const query = model['all']((_a = params.page) !== null && _a !== void 0 ? _a : 0, (_b = params.perPage) !== null && _b !== void 0 ? _b : 15);
|
|
171
|
+
if (params.order) {
|
|
172
|
+
query.order(params.order, (_c = params.orderDirection) !== null && _c !== void 0 ? _c : 'asc');
|
|
173
|
+
}
|
|
174
|
+
let currQuery = null;
|
|
175
|
+
params.includes.forEach((i) => {
|
|
176
|
+
currQuery = query;
|
|
177
|
+
i.forEach((ii) => {
|
|
178
|
+
currQuery.populate(ii, function () {
|
|
179
|
+
currQuery = this;
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
const result = await query;
|
|
184
|
+
res.locals.response = new http_1.Ok(modelToJsonApi(result));
|
|
185
|
+
next();
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
res.locals.response = new http_1.ServerError({
|
|
189
|
+
error: {
|
|
190
|
+
message: err.message,
|
|
191
|
+
err: err,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
next(err);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function _apiGetAction(model) {
|
|
199
|
+
return async (req, res, next) => {
|
|
200
|
+
try {
|
|
201
|
+
const params = extractRouteParameters(req);
|
|
202
|
+
const desc = (0, orm_1.extractModelDescriptor)(model);
|
|
203
|
+
const query = model['where'](desc.PrimaryKey, params.id);
|
|
204
|
+
let currQuery = null;
|
|
205
|
+
params.includes.forEach((i) => {
|
|
206
|
+
currQuery = query;
|
|
207
|
+
i.forEach((ii) => {
|
|
208
|
+
currQuery.populate(ii, function () {
|
|
209
|
+
currQuery = this;
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
const result = await query.firstOrFail();
|
|
214
|
+
res.locals.response = new http_1.Ok(modelToJsonApi(result));
|
|
215
|
+
next();
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
res.locals.response = new http_1.ServerError({
|
|
219
|
+
error: {
|
|
220
|
+
message: err.message,
|
|
221
|
+
err: err,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
next(err);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
let OrmJsonApiBootsrapper = class OrmJsonApiBootsrapper extends di_1.Bootstrapper {
|
|
229
|
+
constructor() {
|
|
230
|
+
super();
|
|
231
|
+
this.Router = express.Router();
|
|
232
|
+
}
|
|
233
|
+
bootstrap() {
|
|
234
|
+
this.Orm.Models.forEach((model) => {
|
|
235
|
+
this.addGet(model.type);
|
|
236
|
+
this.addGetAll(model.type);
|
|
237
|
+
this.addUpdate(model.type);
|
|
238
|
+
this.addInsert(model.type);
|
|
239
|
+
this.addDelete(model.type);
|
|
240
|
+
});
|
|
241
|
+
this.Ac = di_1.DI.resolve(rbac_1.AccessControl);
|
|
242
|
+
this.Server.use(this.Router);
|
|
243
|
+
}
|
|
244
|
+
addGet(model) {
|
|
245
|
+
const path = `/repository/${model.name.toLowerCase()}/:id`;
|
|
246
|
+
this.Router.get(path, [_apiCheckPolicy(model, 'readAny'), _apiGetAction(model)]);
|
|
247
|
+
this.Log.trace(`API GET:${path}`);
|
|
248
|
+
}
|
|
249
|
+
addGetAll(model) {
|
|
250
|
+
const path = `/repository/${model.name.toLowerCase()}`;
|
|
251
|
+
this.Router.get(path, [_apiCheckPolicy(model, 'readAny'), _apiGetAllAction(model)]);
|
|
252
|
+
this.Log.trace(`API GET:${path}`);
|
|
253
|
+
}
|
|
254
|
+
addUpdate(model) {
|
|
255
|
+
const path = `/repository/${model.name.toLowerCase()}/:id`;
|
|
256
|
+
this.Router.patch(path, [_apiCheckPolicy(model, 'updateAny'), _apiPatchAction(model)]);
|
|
257
|
+
this.Log.trace(`API PUT:${path}`);
|
|
258
|
+
}
|
|
259
|
+
addInsert(model) {
|
|
260
|
+
const path = `/repository/${model.name.toLowerCase()}`;
|
|
261
|
+
this.Router.post(path, [_apiCheckPolicy(model, 'insertAny'), _apiInsertAction(model)]);
|
|
262
|
+
this.Log.trace(`API POST:${path}`);
|
|
263
|
+
}
|
|
264
|
+
addDelete(model) {
|
|
265
|
+
const path = `repository/${model.name.toLowerCase()}/:id`;
|
|
266
|
+
this.Router.delete(path, [_apiCheckPolicy(model, 'deleteAny'), _apiDeleteAction(model)]);
|
|
267
|
+
this.Log.trace(`API DEL:${path}`);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, log_1.Logger)('http'),
|
|
272
|
+
__metadata("design:type", log_1.Log)
|
|
273
|
+
], OrmJsonApiBootsrapper.prototype, "Log", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, di_1.Autoinject)(di_1.Container),
|
|
276
|
+
__metadata("design:type", Object)
|
|
277
|
+
], OrmJsonApiBootsrapper.prototype, "Container", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
(0, di_1.Autoinject)(),
|
|
280
|
+
__metadata("design:type", http_1.HttpServer)
|
|
281
|
+
], OrmJsonApiBootsrapper.prototype, "Server", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
(0, di_1.Autoinject)(),
|
|
284
|
+
__metadata("design:type", orm_1.Orm)
|
|
285
|
+
], OrmJsonApiBootsrapper.prototype, "Orm", void 0);
|
|
286
|
+
OrmJsonApiBootsrapper = __decorate([
|
|
287
|
+
(0, di_1.Injectable)(di_1.Bootstrapper),
|
|
288
|
+
__metadata("design:paramtypes", [])
|
|
289
|
+
], OrmJsonApiBootsrapper);
|
|
290
|
+
exports.OrmJsonApiBootsrapper = OrmJsonApiBootsrapper;
|
|
291
|
+
//# sourceMappingURL=api.js.map
|
package/lib/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAgD;AAChD,wCAA8C;AAC9C,oCAA2G;AAC3G,wCAA4D;AAC5D,sCAA2C;AAC3C,sCAA0F;AAC1F,iDAAmC;AACnC,oDAAuB;AACvB,kDAA0D;AAE1D,SAAS,SAAS,CAAC,KAAgB,EAAE,IAAe;IAClD,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI;QAC5B,EAAE,EAAE,KAAK,CAAC,eAAe;QACzB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC;QACxC,aAAa,EAAE,gBAAC,CAAC,SAAS,CA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vD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEvF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IAES,SAAS,CAAC,KAA6B;QAC/C,MAAM,IAAI,GAAG,cAAc,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;QAE1D,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEzF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;CAOF,CAAA;AA9EC;IADC,IAAA,YAAM,EAAC,MAAM,CAAC;8BACA,SAAG;kDAAC;AAGnB;IADC,IAAA,eAAU,EAAC,cAAS,CAAC;;wDACU;AAGhC;IADC,IAAA,eAAU,GAAE;8BACK,iBAAU;qDAAC;AAG7B;IADC,IAAA,eAAU,GAAE;8BACE,SAAG;kDAAC;AAXR,qBAAqB;IADjC,IAAA,eAAU,EAAC,iBAAY,CAAC;;GACZ,qBAAqB,CAgFjC;AAhFY,sDAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path_1 = require("path");
|
|
4
|
+
function dir(path) {
|
|
5
|
+
return (0, path_1.resolve)((0, path_1.normalize)((0, path_1.join)(__dirname, path)));
|
|
6
|
+
}
|
|
7
|
+
module.exports = {
|
|
8
|
+
system: {
|
|
9
|
+
dirs: {
|
|
10
|
+
controllers: [dir('./../controllers')],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=orm-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orm-http.js","sourceRoot":"","sources":["../../src/config/orm-http.ts"],"names":[],"mappings":";;AAAA,+BAAgD;AAEhD,SAAS,GAAG,CAAC,IAAY;IACvB,OAAO,IAAA,cAAO,EAAC,IAAA,gBAAS,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,WAAW,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;SACvC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AccessControl } from '@spinajs/rbac';
|
|
2
|
+
import { Constructor } from '@spinajs/di';
|
|
3
|
+
import { BaseController, Ok } from '@spinajs/http';
|
|
4
|
+
import { ModelBase, Orm } from '@spinajs/orm';
|
|
5
|
+
import * as express from 'express';
|
|
6
|
+
declare class Includes {
|
|
7
|
+
Param: string[][];
|
|
8
|
+
constructor(Param: string[][]);
|
|
9
|
+
}
|
|
10
|
+
declare class Filters {
|
|
11
|
+
Param: any;
|
|
12
|
+
constructor(Param: any);
|
|
13
|
+
}
|
|
14
|
+
interface JsonApiIncomingObject {
|
|
15
|
+
data: {
|
|
16
|
+
attributes: {};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare class Repository extends BaseController {
|
|
20
|
+
protected Orm: Orm;
|
|
21
|
+
protected Ac: AccessControl;
|
|
22
|
+
constructor(Orm: Orm, Ac: AccessControl);
|
|
23
|
+
protected getModel(model: string): Constructor<ModelBase>;
|
|
24
|
+
private checkPolicy;
|
|
25
|
+
get(model: string, id: string, include: Includes, _filters: Filters, req: express.Request): Promise<Ok>;
|
|
26
|
+
getAll(model: string, page: number, perPage: number, order: string, orderDirection: string, include: Includes, _filters: Filters, req: express.Request): Promise<Ok>;
|
|
27
|
+
del(model: string, id: string, req: express.Request): Promise<Ok>;
|
|
28
|
+
patch(model: string, id: string, incoming: JsonApiIncomingObject, req: express.Request): Promise<Ok>;
|
|
29
|
+
insert(model: string, incoming: JsonApiIncomingObject, req: express.Request): Promise<Ok>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
32
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
33
|
+
};
|
|
34
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
35
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Repository = void 0;
|
|
42
|
+
const rbac_1 = require("@spinajs/rbac");
|
|
43
|
+
const di_1 = require("@spinajs/di");
|
|
44
|
+
const http_1 = require("@spinajs/http");
|
|
45
|
+
const http_2 = require("@spinajs/http");
|
|
46
|
+
const orm_1 = require("@spinajs/orm");
|
|
47
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
48
|
+
const express = __importStar(require("express"));
|
|
49
|
+
const rbac_http_1 = require("@spinajs/rbac-http");
|
|
50
|
+
class IncludesHydrator extends http_1.ArgHydrator {
|
|
51
|
+
async hydrate(input) {
|
|
52
|
+
return new Includes(input ? input.split(',').map((x) => x.split('.')) : []);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class FiltersHydrator extends http_1.ArgHydrator {
|
|
56
|
+
async hydrate(input) {
|
|
57
|
+
return new Filters(input ? JSON.parse(input) : []);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function dehydrate(model, omit) {
|
|
61
|
+
const dObj = {
|
|
62
|
+
type: model.constructor.name,
|
|
63
|
+
id: model.PrimaryKeyValue,
|
|
64
|
+
attributes: model.dehydrate(false, omit),
|
|
65
|
+
relationships: lodash_1.default.mapValues(lodash_1.default.groupBy(model.getFlattenRelationModels(false), '__relationKey__'), (x) => {
|
|
66
|
+
return x.map((xx) => {
|
|
67
|
+
return {
|
|
68
|
+
type: xx.constructor.name,
|
|
69
|
+
id: xx.PrimaryKeyValue,
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
74
|
+
return dObj;
|
|
75
|
+
}
|
|
76
|
+
function modelToJsonApi(model) {
|
|
77
|
+
return {
|
|
78
|
+
data: Array.isArray(model) ? model.map((m) => dehydrate(m)) : dehydrate(model),
|
|
79
|
+
included: Array.isArray(model) ? lodash_1.default.flatMap(model, extractIncluded) : extractIncluded(model),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function extractIncluded(model) {
|
|
83
|
+
return model.getFlattenRelationModels(true).map((m) => dehydrate(m));
|
|
84
|
+
}
|
|
85
|
+
function applyQueryIncludes(includes, query) {
|
|
86
|
+
let currQuery = null;
|
|
87
|
+
includes.Param.forEach((i) => {
|
|
88
|
+
currQuery = query;
|
|
89
|
+
i.forEach((ii) => {
|
|
90
|
+
currQuery.populate(ii, function () {
|
|
91
|
+
currQuery = this;
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
let Includes = class Includes {
|
|
97
|
+
constructor(Param) {
|
|
98
|
+
this.Param = Param;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
Includes = __decorate([
|
|
102
|
+
(0, http_1.Hydrator)(IncludesHydrator),
|
|
103
|
+
__metadata("design:paramtypes", [Array])
|
|
104
|
+
], Includes);
|
|
105
|
+
let Filters = class Filters {
|
|
106
|
+
constructor(Param) {
|
|
107
|
+
this.Param = Param;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
Filters = __decorate([
|
|
111
|
+
(0, http_1.Hydrator)(FiltersHydrator),
|
|
112
|
+
__metadata("design:paramtypes", [Object])
|
|
113
|
+
], Filters);
|
|
114
|
+
let Repository = class Repository extends http_1.BaseController {
|
|
115
|
+
constructor(Orm, Ac) {
|
|
116
|
+
super();
|
|
117
|
+
this.Orm = Orm;
|
|
118
|
+
this.Ac = Ac;
|
|
119
|
+
}
|
|
120
|
+
getModel(model) {
|
|
121
|
+
return this.Orm.Models.find((x) => x.name.toLowerCase() === model).type;
|
|
122
|
+
}
|
|
123
|
+
checkPolicy(model, permission, req) {
|
|
124
|
+
const p = (0, rbac_http_1.checkRoutePermission)(req, model.name.toLowerCase(), permission);
|
|
125
|
+
if (!p || !p.granted) {
|
|
126
|
+
throw new http_1.Forbidden(`current user does not have permission to access resource ${model.name} with ${permission} grant`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async get(model, id, include, _filters, req) {
|
|
130
|
+
const mClass = this.getModel(model);
|
|
131
|
+
this.checkPolicy(mClass, 'readAny', req);
|
|
132
|
+
const mDesc = (0, orm_1.extractModelDescriptor)(mClass);
|
|
133
|
+
const query = mClass['where'](mDesc.PrimaryKey, id);
|
|
134
|
+
applyQueryIncludes(include, query);
|
|
135
|
+
const result = await query.firstOrFail();
|
|
136
|
+
return new http_1.Ok(modelToJsonApi(result));
|
|
137
|
+
}
|
|
138
|
+
async getAll(model, page, perPage, order, orderDirection, include, _filters, req) {
|
|
139
|
+
const mClass = this.getModel(model);
|
|
140
|
+
this.checkPolicy(mClass, 'readAny', req);
|
|
141
|
+
const query = mClass['all'](page !== null && page !== void 0 ? page : 0, perPage !== null && perPage !== void 0 ? perPage : 15);
|
|
142
|
+
if (order) {
|
|
143
|
+
query.order(order, orderDirection !== null && orderDirection !== void 0 ? orderDirection : 'asc');
|
|
144
|
+
}
|
|
145
|
+
applyQueryIncludes(include, query);
|
|
146
|
+
const result = await query;
|
|
147
|
+
return new http_1.Ok(modelToJsonApi(result));
|
|
148
|
+
}
|
|
149
|
+
async del(model, id, req) {
|
|
150
|
+
const mClass = this.getModel(model);
|
|
151
|
+
this.checkPolicy(mClass, 'deleteAny', req);
|
|
152
|
+
await mClass['destroy'](id);
|
|
153
|
+
return new http_1.Ok();
|
|
154
|
+
}
|
|
155
|
+
async patch(model, id, incoming, req) {
|
|
156
|
+
const mClass = this.getModel(model);
|
|
157
|
+
this.checkPolicy(mClass, 'updateAny', req);
|
|
158
|
+
const entity = await mClass['getOrFail'](id);
|
|
159
|
+
entity.hydrate(incoming.data.attributes);
|
|
160
|
+
await entity.update();
|
|
161
|
+
return new http_1.Ok(entity.dehydrate());
|
|
162
|
+
}
|
|
163
|
+
async insert(model, incoming, req) {
|
|
164
|
+
const mClass = this.getModel(model);
|
|
165
|
+
this.checkPolicy(mClass, 'createAny', req);
|
|
166
|
+
const entity = new mClass();
|
|
167
|
+
entity.hydrate(incoming.data.attributes);
|
|
168
|
+
await entity.insert();
|
|
169
|
+
return new http_1.Ok(entity.dehydrate());
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, http_2.Get)(':model/:id'),
|
|
174
|
+
__param(0, (0, http_2.Param)()),
|
|
175
|
+
__param(1, (0, http_2.Param)('id')),
|
|
176
|
+
__param(2, (0, http_1.Query)()),
|
|
177
|
+
__param(3, (0, http_1.Query)()),
|
|
178
|
+
__param(4, (0, http_1.Req)()),
|
|
179
|
+
__metadata("design:type", Function),
|
|
180
|
+
__metadata("design:paramtypes", [String, String, Includes, Filters, Object]),
|
|
181
|
+
__metadata("design:returntype", Promise)
|
|
182
|
+
], Repository.prototype, "get", null);
|
|
183
|
+
__decorate([
|
|
184
|
+
(0, http_2.Get)(':model'),
|
|
185
|
+
__param(0, (0, http_2.Param)()),
|
|
186
|
+
__param(1, (0, http_1.Query)()),
|
|
187
|
+
__param(2, (0, http_1.Query)()),
|
|
188
|
+
__param(3, (0, http_1.Query)()),
|
|
189
|
+
__param(4, (0, http_1.Query)()),
|
|
190
|
+
__param(5, (0, http_1.Query)()),
|
|
191
|
+
__param(6, (0, http_1.Query)()),
|
|
192
|
+
__param(7, (0, http_1.Req)()),
|
|
193
|
+
__metadata("design:type", Function),
|
|
194
|
+
__metadata("design:paramtypes", [String, Number, Number, String, String, Includes, Filters, Object]),
|
|
195
|
+
__metadata("design:returntype", Promise)
|
|
196
|
+
], Repository.prototype, "getAll", null);
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, http_1.Del)(':model/:id'),
|
|
199
|
+
__param(0, (0, http_2.Param)()),
|
|
200
|
+
__param(1, (0, http_2.Param)()),
|
|
201
|
+
__param(2, (0, http_1.Req)()),
|
|
202
|
+
__metadata("design:type", Function),
|
|
203
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
204
|
+
__metadata("design:returntype", Promise)
|
|
205
|
+
], Repository.prototype, "del", null);
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, http_2.Patch)(':model/:id'),
|
|
208
|
+
__param(0, (0, http_2.Param)()),
|
|
209
|
+
__param(1, (0, http_2.Param)()),
|
|
210
|
+
__param(2, (0, http_2.Body)()),
|
|
211
|
+
__param(3, (0, http_1.Req)()),
|
|
212
|
+
__metadata("design:type", Function),
|
|
213
|
+
__metadata("design:paramtypes", [String, String, Object, Object]),
|
|
214
|
+
__metadata("design:returntype", Promise)
|
|
215
|
+
], Repository.prototype, "patch", null);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, http_1.Post)(':model'),
|
|
218
|
+
__param(0, (0, http_2.Param)()),
|
|
219
|
+
__param(1, (0, http_2.Body)()),
|
|
220
|
+
__param(2, (0, http_1.Req)()),
|
|
221
|
+
__metadata("design:type", Function),
|
|
222
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
223
|
+
__metadata("design:returntype", Promise)
|
|
224
|
+
], Repository.prototype, "insert", null);
|
|
225
|
+
Repository = __decorate([
|
|
226
|
+
(0, http_2.BasePath)('repository'),
|
|
227
|
+
(0, di_1.Inject)(orm_1.Orm, rbac_1.AccessControl),
|
|
228
|
+
__metadata("design:paramtypes", [orm_1.Orm, rbac_1.AccessControl])
|
|
229
|
+
], Repository);
|
|
230
|
+
exports.Repository = Repository;
|
|
231
|
+
//# sourceMappingURL=Repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Repository.js","sourceRoot":"","sources":["../../src/controllers/Repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA8C;AAC9C,oCAAkD;AAClD,wCAA4G;AAC5G,wCAAkE;AAClE,sCAA0F;AAC1F,oDAAuB;AACvB,iDAAmC;AACnC,kDAA0D;AAE1D,MAAM,gBAAiB,SAAQ,kBAAW;IACjC,KAAK,CAAC,OAAO,CAAC,KAAU;QAC7B,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtF,CAAC;CACF;AAED,MAAM,eAAgB,SAAQ,kBAAW;IAChC,KAAK,CAAC,OAAO,CAAC,KAAU;QAC7B,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AAED,SAAS,SAAS,CAAC,KAAgB,EAAE,IAAe;IAClD,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI;QAC5B,EAAE,EAAE,KAAK,CAAC,eAAe;QACzB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC;QACxC,aAAa,EAAE,gBAAC,CAAC,SAAS,CAAC,gBAAC,CAAC,OAAO,CA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E,CAAA;;;;wCAS1F;AArFU,UAAU;IAFtB,IAAA,eAAQ,EAAC,YAAY,CAAC;IACtB,IAAA,WAAM,EAAC,SAAG,EAAE,oBAAa,CAAC;qCAEE,SAAG,EAAgB,oBAAa;GADhD,UAAU,CAsFtB;AAtFY,gCAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinajs/orm-http",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.127",
|
|
4
4
|
"description": "Orm extensions for HTTP module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -38,19 +38,21 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/spinajs/main#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@spinajs/configuration": "^1.2.
|
|
42
|
-
"@spinajs/di": "^1.2.
|
|
43
|
-
"@spinajs/exceptions": "^1.2.
|
|
44
|
-
"@spinajs/http": "^1.2.
|
|
45
|
-
"@spinajs/
|
|
46
|
-
"@spinajs/
|
|
41
|
+
"@spinajs/configuration": "^1.2.127",
|
|
42
|
+
"@spinajs/di": "^1.2.127",
|
|
43
|
+
"@spinajs/exceptions": "^1.2.127",
|
|
44
|
+
"@spinajs/http": "^1.2.127",
|
|
45
|
+
"@spinajs/intl-orm": "^1.2.127",
|
|
46
|
+
"@spinajs/log": "^1.2.127",
|
|
47
|
+
"@spinajs/orm": "^1.2.127",
|
|
48
|
+
"@spinajs/rbac-http": "^1.2.127",
|
|
47
49
|
"lodash": "^4.17.21",
|
|
48
50
|
"luxon": "^2.4.0"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
|
-
"@spinajs/http": "1.2.
|
|
52
|
-
"@spinajs/orm": "1.2.
|
|
53
|
-
"@spinajs/orm-sqlite": "^1.2.
|
|
53
|
+
"@spinajs/http": "1.2.119",
|
|
54
|
+
"@spinajs/orm": "1.2.125",
|
|
55
|
+
"@spinajs/orm-sqlite": "^1.2.127"
|
|
54
56
|
},
|
|
55
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "53b022d0e70b7f2689ac984578b52afb0fd9e967"
|
|
56
58
|
}
|