sim-node-lib 0.3.34 → 0.3.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Commands/SimCrud.d.ts +19 -0
- package/dist/Commands/SimCrud.js +304 -0
- package/dist/Commands/Templates/controller.txt +28 -0
- package/dist/Commands/Templates/migration.txt +19 -0
- package/dist/Commands/Templates/model.txt +19 -0
- package/dist/Commands/Templates/pubsub.txt +21 -0
- package/dist/Commands/Templates/pubsubrepo.txt +38 -0
- package/dist/Commands/Templates/repository.txt +24 -0
- package/dist/Commands/Templates/route.txt +10 -0
- package/dist/Commands/Templates/validator.txt +12 -0
- package/dist/Commands/index.d.ts +2 -0
- package/dist/Commands/index.js +3 -0
- package/dist/Functions/BasicPubSubRepo.d.ts +13 -0
- package/dist/Functions/BasicPubSubRepo.js +51 -0
- package/dist/Handlers/ExceptionHandler.js +4 -1
- package/dist/Services/AxiosService.js +28 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +70 -1
- package/package.json +28 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCommand } from '@adonisjs/ace';
|
|
2
|
+
export default class Teste extends BaseCommand {
|
|
3
|
+
static commandName: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
pubsub: boolean;
|
|
6
|
+
path: string;
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
private makeController;
|
|
9
|
+
private makeRepository;
|
|
10
|
+
private makePubsub;
|
|
11
|
+
private makeModel;
|
|
12
|
+
private makeRoute;
|
|
13
|
+
private writeToRoute;
|
|
14
|
+
private makeValidator;
|
|
15
|
+
private makeMigration;
|
|
16
|
+
private renderTemplate;
|
|
17
|
+
private typeToMigration;
|
|
18
|
+
private camelToSnake;
|
|
19
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const ace_1 = require("@adonisjs/ace");
|
|
22
|
+
const fs_1 = __importDefault(require("fs"));
|
|
23
|
+
var VarType;
|
|
24
|
+
(function (VarType) {
|
|
25
|
+
VarType["string"] = "string";
|
|
26
|
+
VarType["number"] = "number";
|
|
27
|
+
VarType["date"] = "Date";
|
|
28
|
+
VarType["boolean"] = "boolean";
|
|
29
|
+
})(VarType || (VarType = {}));
|
|
30
|
+
class Teste extends ace_1.BaseCommand {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.path = './node_modules/sim-node-lib/dist/Commands/Templates';
|
|
34
|
+
}
|
|
35
|
+
run() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
this.ui
|
|
38
|
+
.sticker()
|
|
39
|
+
.add('Utilize o padrão de nomenclatura para o modelo')
|
|
40
|
+
.add(`${this.colors.green('Ex: Usuario, MotoBarco')}`)
|
|
41
|
+
.add('Utilize o padrão de nomenclatura camelCase para variáveis')
|
|
42
|
+
.add(`${this.colors.green('Ex: nomUsuario, idade, alturaUsuarioJovem')}`)
|
|
43
|
+
.render();
|
|
44
|
+
let name = yield this.prompt.ask('Nome do Modelo?');
|
|
45
|
+
let vars = [];
|
|
46
|
+
let varNames = (yield this.prompt.ask('Digite todas variáveis que você deseja no modelo separadas por vírgula:')).split(',');
|
|
47
|
+
for (let vn of varNames) {
|
|
48
|
+
vars.push({
|
|
49
|
+
name: vn,
|
|
50
|
+
type: yield this.prompt.choice(`Tipo da variável "${vn}":`, [
|
|
51
|
+
{
|
|
52
|
+
name: 'string',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'number',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Date',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'boolean',
|
|
62
|
+
},
|
|
63
|
+
]),
|
|
64
|
+
required: yield this.prompt.confirm(`A varíavel "${vn}" é obrigatória?`),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
let files = [];
|
|
68
|
+
let mig = this.makeMigration(vars, name);
|
|
69
|
+
files.push(mig);
|
|
70
|
+
let model = this.makeModel(vars, name);
|
|
71
|
+
files.push(model);
|
|
72
|
+
let repo = this.makeRepository(name, model.path);
|
|
73
|
+
files.push(repo);
|
|
74
|
+
if (this.pubsub) {
|
|
75
|
+
files.push(this.makePubsub(name, model.path));
|
|
76
|
+
}
|
|
77
|
+
let val = this.makeValidator(vars, name);
|
|
78
|
+
files.push(val);
|
|
79
|
+
let controller = this.makeController(name, val.path, repo.path);
|
|
80
|
+
files.push(controller);
|
|
81
|
+
let route = this.makeRoute(name);
|
|
82
|
+
files.push(route);
|
|
83
|
+
let logs = [];
|
|
84
|
+
for (let f of files) {
|
|
85
|
+
try {
|
|
86
|
+
fs_1.default.writeFileSync(f.path, f.content);
|
|
87
|
+
logs.push();
|
|
88
|
+
logs.push(`Arquivo criado em: ${f.path}`);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
logs.push(`Erro ao criar arquivo: ${error.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
let filesMsg = this.ui.sticker();
|
|
95
|
+
for (let l of logs) {
|
|
96
|
+
filesMsg.add(l);
|
|
97
|
+
}
|
|
98
|
+
filesMsg.render();
|
|
99
|
+
this.ui
|
|
100
|
+
.instructions()
|
|
101
|
+
.add('Busque por "TODO" para encontrar os detalhes que necessitam ajustes específicos')
|
|
102
|
+
.render();
|
|
103
|
+
if (this.pubsub) {
|
|
104
|
+
this.ui
|
|
105
|
+
.instructions()
|
|
106
|
+
.add('Adicione a tabela ao enum de tabelas do pubsub')
|
|
107
|
+
.add('Adicione o case da tabela ao PubSubHandlerTable')
|
|
108
|
+
.render();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
makeController(name, valPath, repoPath) {
|
|
113
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/controller.txt', 'utf8');
|
|
114
|
+
let conName = name + 'Controller';
|
|
115
|
+
let conPath = `app/Controllers/Http/${conName}.ts`;
|
|
116
|
+
let valName = name + 'Validator';
|
|
117
|
+
let repoName = name + 'Repository';
|
|
118
|
+
let valImp = `import ${valName} from '${valPath}'`.slice(0, -4) + "'";
|
|
119
|
+
let repoImp = `import { ${repoName} } from '${repoPath}'`.slice(0, -4) + "'";
|
|
120
|
+
let data = {
|
|
121
|
+
name,
|
|
122
|
+
controllerName: conName,
|
|
123
|
+
validatorImport: valImp,
|
|
124
|
+
repoImport: repoImp,
|
|
125
|
+
repo: repoName,
|
|
126
|
+
validator: valName,
|
|
127
|
+
modelImport: `import ${name} from 'app/Models/DAO/${name}'`,
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
content: this.renderTemplate(tempPath, data),
|
|
131
|
+
path: conPath,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
makeRepository(name, modelPath) {
|
|
135
|
+
let tempPath;
|
|
136
|
+
if (this.pubsub) {
|
|
137
|
+
tempPath = fs_1.default.readFileSync(this.path + '/pubsubrepo.txt', 'utf8');
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
tempPath = fs_1.default.readFileSync(this.path + '/repository.txt', 'utf8');
|
|
141
|
+
}
|
|
142
|
+
let path = `app/Repositories/${name}Repository.ts`;
|
|
143
|
+
let modelImport = `import ${name} from '${modelPath.slice(0, -3)}'`;
|
|
144
|
+
let data = {
|
|
145
|
+
name,
|
|
146
|
+
modelImport,
|
|
147
|
+
};
|
|
148
|
+
return {
|
|
149
|
+
content: this.renderTemplate(tempPath, data),
|
|
150
|
+
path,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
makePubsub(name, modelPath) {
|
|
154
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/pubsub.txt', 'utf8');
|
|
155
|
+
let path = `app/PubSub/Repositories/${name}PubSub.ts`;
|
|
156
|
+
let modelImport = `import ${name} from '${modelPath.slice(0, -3)}'`;
|
|
157
|
+
let data = {
|
|
158
|
+
name,
|
|
159
|
+
modelImport,
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
content: this.renderTemplate(tempPath, data),
|
|
163
|
+
path,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
makeModel(vars, name) {
|
|
167
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/model.txt', 'utf8');
|
|
168
|
+
let path = `app/Models/DAO/${name}.ts`;
|
|
169
|
+
let tableName = this.camelToSnake(name);
|
|
170
|
+
let cols = '';
|
|
171
|
+
for (let v of vars) {
|
|
172
|
+
cols += `@column()\n public ${v.name}${v.required ? '' : '?'}: ${v.type}\n\n `;
|
|
173
|
+
}
|
|
174
|
+
cols = cols.slice(0, -4);
|
|
175
|
+
let data = {
|
|
176
|
+
name,
|
|
177
|
+
tableName,
|
|
178
|
+
cols,
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
content: this.renderTemplate(tempPath, data),
|
|
182
|
+
path,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
makeRoute(name) {
|
|
186
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/route.txt', 'utf8');
|
|
187
|
+
let controllerName = name + 'Controller';
|
|
188
|
+
name = this.camelToSnake(name).replace('_', '-');
|
|
189
|
+
this.writeToRoute(name);
|
|
190
|
+
let path = `start/routes/${name}.ts`;
|
|
191
|
+
let data = {
|
|
192
|
+
name,
|
|
193
|
+
controllerName,
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
content: this.renderTemplate(tempPath, data),
|
|
197
|
+
path,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
writeToRoute(routeName) {
|
|
201
|
+
let path = 'start/routes/routes.ts';
|
|
202
|
+
let routes = fs_1.default.readFileSync(path, 'utf8');
|
|
203
|
+
let arr1 = routes.split('\n');
|
|
204
|
+
let firstLine = arr1[0];
|
|
205
|
+
let arr2 = [];
|
|
206
|
+
for (let a of arr1) {
|
|
207
|
+
let aux = a.split('./')[1];
|
|
208
|
+
if (aux) {
|
|
209
|
+
if (!aux.includes('eslint')) {
|
|
210
|
+
arr2.push(aux);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
arr2.push(routeName + "'");
|
|
215
|
+
let arr3 = arr2.sort((a, b) => a.localeCompare(b));
|
|
216
|
+
let newFile = firstLine;
|
|
217
|
+
for (let a of arr3) {
|
|
218
|
+
newFile += `\nimport './${a}`;
|
|
219
|
+
}
|
|
220
|
+
newFile += '\n\n';
|
|
221
|
+
try {
|
|
222
|
+
fs_1.default.writeFileSync(path, newFile);
|
|
223
|
+
console.log(`File created at: ${path}`);
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
console.log(`Error creating file: ${error.message}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
makeValidator(vars, name) {
|
|
230
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/validator.txt', 'utf8');
|
|
231
|
+
let path = `app/Validators/${name}Validator.ts`;
|
|
232
|
+
let cols = '';
|
|
233
|
+
for (let v of vars) {
|
|
234
|
+
cols +=
|
|
235
|
+
`${v.name}: schema.${v.type.toLowerCase()}` +
|
|
236
|
+
(v.required ? '()' : '.optional()') +
|
|
237
|
+
',\n ';
|
|
238
|
+
}
|
|
239
|
+
cols = cols.slice(0, -5);
|
|
240
|
+
let data = {
|
|
241
|
+
name,
|
|
242
|
+
cols,
|
|
243
|
+
};
|
|
244
|
+
return {
|
|
245
|
+
content: this.renderTemplate(tempPath, data),
|
|
246
|
+
path,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
makeMigration(vars, name) {
|
|
250
|
+
const tempPath = fs_1.default.readFileSync(this.path + '/migration.txt', 'utf8');
|
|
251
|
+
let tableName = this.camelToSnake(name);
|
|
252
|
+
let path = `database/migrations/${Number(new Date()) + '_' + tableName}.ts`;
|
|
253
|
+
let cols = '';
|
|
254
|
+
for (let v of vars) {
|
|
255
|
+
cols +=
|
|
256
|
+
`table.${this.typeToMigration(v.type)}('${this.camelToSnake(v.name)}').` +
|
|
257
|
+
(v.required ? 'notNullable()' : 'nullable()') +
|
|
258
|
+
'\n ';
|
|
259
|
+
}
|
|
260
|
+
cols = cols.slice(0, -7);
|
|
261
|
+
let data = {
|
|
262
|
+
name,
|
|
263
|
+
tableName,
|
|
264
|
+
cols,
|
|
265
|
+
};
|
|
266
|
+
return {
|
|
267
|
+
content: this.renderTemplate(tempPath, data),
|
|
268
|
+
path,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
renderTemplate(template, data) {
|
|
272
|
+
for (const key in data) {
|
|
273
|
+
if (Object.hasOwnProperty.call(data, key)) {
|
|
274
|
+
const placeholder = `{{ ${key} }}`;
|
|
275
|
+
const value = data[key];
|
|
276
|
+
template = template.replace(new RegExp(placeholder, 'g'), value);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return template;
|
|
280
|
+
}
|
|
281
|
+
typeToMigration(input) {
|
|
282
|
+
switch (input) {
|
|
283
|
+
case VarType.string:
|
|
284
|
+
return 'string';
|
|
285
|
+
case VarType.date:
|
|
286
|
+
return 'date';
|
|
287
|
+
case VarType.number:
|
|
288
|
+
return 'integer';
|
|
289
|
+
case VarType.boolean:
|
|
290
|
+
return 'boolean';
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
camelToSnake(input) {
|
|
294
|
+
let firstLetter = input.charAt(0);
|
|
295
|
+
input = input.substring(1);
|
|
296
|
+
return firstLetter.toLowerCase() + input.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
Teste.commandName = 'sim-crud';
|
|
300
|
+
Teste.description = 'Gera um crud no padrão SIM';
|
|
301
|
+
__decorate([
|
|
302
|
+
ace_1.flags.boolean({ alias: 'pubsub', description: 'Persistência via pubsub' })
|
|
303
|
+
], Teste.prototype, "pubsub", void 0);
|
|
304
|
+
exports.default = Teste;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{ validatorImport }}
|
|
2
|
+
{{ repoImport }}
|
|
3
|
+
{{ modelImport }}
|
|
4
|
+
import { ModelPaginatorContract } from '@ioc:Adonis/Lucid/Orm'
|
|
5
|
+
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
6
|
+
export default class {{ controllerName }} {
|
|
7
|
+
private readonly repo = new {{ repo }}()
|
|
8
|
+
|
|
9
|
+
public async get(ctx: HttpContextContract): Promise<ModelPaginatorContract<{{ name }}>> {
|
|
10
|
+
//TODO make validator for filter
|
|
11
|
+
let filter = ctx.request.all()
|
|
12
|
+
return await this.repo.get(filter)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async post(ctx: HttpContextContract): Promise<void> {
|
|
16
|
+
let payload: {{ name }} = Object.assign(await ctx.request.validate({{ validator }}))
|
|
17
|
+
return await this.repo.post(payload)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async put(ctx: HttpContextContract): Promise<void> {
|
|
21
|
+
let payload: {{ name }} = Object.assign(await ctx.request.validate({{ validator }}))
|
|
22
|
+
return await this.repo.put(payload)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async delete(ctx: HttpContextContract): Promise<void> {
|
|
26
|
+
return await this.repo.delete(ctx.params.id)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
2
|
+
|
|
3
|
+
export default class {{ name }} extends BaseSchema {
|
|
4
|
+
protected tableName = '{{ tableName }}'
|
|
5
|
+
|
|
6
|
+
public async up() {
|
|
7
|
+
this.schema.createTable(this.tableName, (table) => {
|
|
8
|
+
table.uuid('uuid').primary().defaultTo(this.db.rawQuery('uuid_generate_v4()').knexQuery)
|
|
9
|
+
{{ cols }}
|
|
10
|
+
|
|
11
|
+
table.timestamp('created_at', { useTz: true })
|
|
12
|
+
table.timestamp('updated_at', { useTz: true })
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public async down() {
|
|
17
|
+
this.schema.dropTable(this.tableName)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DateTime } from 'luxon'
|
|
2
|
+
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
|
3
|
+
|
|
4
|
+
export default class {{ name }} extends BaseModel {
|
|
5
|
+
public static get table() {
|
|
6
|
+
return '{{ tableName }}'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@column({ isPrimary: true })
|
|
10
|
+
public uuid: string
|
|
11
|
+
|
|
12
|
+
{{ cols }}
|
|
13
|
+
|
|
14
|
+
@column.dateTime({ autoCreate: true })
|
|
15
|
+
public createdAt: DateTime
|
|
16
|
+
|
|
17
|
+
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
18
|
+
public updatedAt: DateTime
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BasicPubSubRepo } from 'sim-node-lib/dist/Functions/BasicPubSubRepo'
|
|
2
|
+
{{ modelImport }}
|
|
3
|
+
import { PubSubHandlerAction } from 'sim-node-lib'
|
|
4
|
+
import { PubSubModel } from 'sim-node-lib/dist/Models/PubSubModel'
|
|
5
|
+
|
|
6
|
+
export class {{ name }}PubSub extends PubSubHandlerAction {
|
|
7
|
+
private repo: BasicPubSubRepo
|
|
8
|
+
constructor(pubsubModel: PubSubModel) {
|
|
9
|
+
super(pubsubModel)
|
|
10
|
+
this.repo = new BasicPubSubRepo({{ name }}, pubsubModel)
|
|
11
|
+
}
|
|
12
|
+
protected async insert(): Promise<boolean> {
|
|
13
|
+
return await this.repo.insert()
|
|
14
|
+
}
|
|
15
|
+
protected async update(): Promise<boolean> {
|
|
16
|
+
return await this.repo.update()
|
|
17
|
+
}
|
|
18
|
+
protected async delete(): Promise<boolean> {
|
|
19
|
+
return await this.repo.delete()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ModelPaginatorContract } from '@ioc:Adonis/Lucid/Orm'
|
|
2
|
+
{{ modelImport }}
|
|
3
|
+
import { UpdateUtil } from 'sim-node-lib'
|
|
4
|
+
import { PubSubActionEnum } from 'sim-node-lib/dist/Enums/PubSubActionEnum'
|
|
5
|
+
import { PubSubApiEnum } from 'sim-node-lib/dist/Enums/PubSubApiEnum'
|
|
6
|
+
import { PubSubTableEnum } from 'sim-node-lib/dist/Enums/PubSubTableEnum'
|
|
7
|
+
import { PubSubService } from 'App/PubSub/PubSubService'
|
|
8
|
+
|
|
9
|
+
export class {{ name }}Repository {
|
|
10
|
+
//TODO make model for filter
|
|
11
|
+
public async get(filter): Promise<ModelPaginatorContract<{{ name }}>> {
|
|
12
|
+
return await {{ name }}.query().paginate(filter.pageNumber, filter.pageSize)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async post(payload: {{ name }}): Promise<void> {
|
|
16
|
+
await {{ name }}.create(payload).then((model) => {
|
|
17
|
+
//TODO ajustar variáveis
|
|
18
|
+
new PubSubService(model.toObject(), PubSubActionEnum.insert, PubSubTableEnum., PubSubApiEnum.)
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async put(payload: {{ name }}): Promise<void> {
|
|
23
|
+
let model = await {{ name }}.findOrFail(payload.uuid)
|
|
24
|
+
model = UpdateUtil.updateObjectsWithSameType(model, payload, {{ name }})
|
|
25
|
+
await model.save().then(() => {
|
|
26
|
+
//TODO ajustar variáveis
|
|
27
|
+
new PubSubService(model.toObject(), PubSubActionEnum.update, PubSubTableEnum., PubSubApiEnum.)
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async delete(id: string): Promise<void> {
|
|
32
|
+
let model = await {{ name }}.findOrFail(id)
|
|
33
|
+
await model.delete().then(() => {
|
|
34
|
+
//TODO ajustar variáveis
|
|
35
|
+
new PubSubService(model.toObject(), PubSubActionEnum.delete, PubSubTableEnum., PubSubApiEnum.)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ModelPaginatorContract } from '@ioc:Adonis/Lucid/Orm'
|
|
2
|
+
{{ modelImport }}
|
|
3
|
+
import { UpdateUtil } from 'sim-node-lib'
|
|
4
|
+
|
|
5
|
+
export class {{ name }}Repository {
|
|
6
|
+
//TODO make model for filter
|
|
7
|
+
public async get(filter): Promise<ModelPaginatorContract<{{ name }}>> {
|
|
8
|
+
return await {{ name }}.query().paginate(filter.pageNumber, filter.pageSize)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
public async post(payload: {{ name }}): Promise<void> {
|
|
12
|
+
await {{ name }}.create(payload)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public async put(payload: {{ name }}): Promise<void> {
|
|
16
|
+
let model = await {{ name }}.findOrFail(payload.uuid)
|
|
17
|
+
model = UpdateUtil.updateObjectsWithSameType(model, payload, {{ name }})
|
|
18
|
+
await model.save()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async delete(id: string): Promise<void> {
|
|
22
|
+
await (await {{ name }}.findOrFail(id)).delete()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Route from '@ioc:Adonis/Core/Route'
|
|
2
|
+
|
|
3
|
+
Route.group(() => {
|
|
4
|
+
Route.get('/{{ name }}', '{{ controllerName }}.get')
|
|
5
|
+
Route.post('/{{ name }}', '{{ controllerName }}.post')
|
|
6
|
+
Route.put('/{{ name }}', '{{ controllerName }}.put')
|
|
7
|
+
Route.delete('/{{ name }}/:id', '{{ controllerName }}.delete')
|
|
8
|
+
})
|
|
9
|
+
.middleware('TODO')
|
|
10
|
+
.prefix('TODO')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
2
|
+
import { CustomMessages, schema } from '@ioc:Adonis/Core/Validator'
|
|
3
|
+
|
|
4
|
+
export default class {{ name }}Validator {
|
|
5
|
+
constructor(protected ctx: HttpContextContract) {}
|
|
6
|
+
|
|
7
|
+
public schema = schema.create({
|
|
8
|
+
{{ cols }}
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
public messages: CustomMessages = {}
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="@adonisjs/lucid" />
|
|
2
|
+
import { LucidModel } from '@ioc:Adonis/Lucid/Orm';
|
|
3
|
+
import { PubSubModel } from '../Models/PubSubModel';
|
|
4
|
+
export declare class BasicPubSubRepo {
|
|
5
|
+
model: LucidModel;
|
|
6
|
+
pubsubModel: PubSubModel;
|
|
7
|
+
constructor(model: LucidModel, pubsubModel: PubSubModel);
|
|
8
|
+
insert(): Promise<boolean>;
|
|
9
|
+
update(): Promise<boolean>;
|
|
10
|
+
delete(): Promise<boolean>;
|
|
11
|
+
private buildData;
|
|
12
|
+
private getKey;
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BasicPubSubRepo = void 0;
|
|
13
|
+
const UpdateUtil_1 = require("../Helpers/UpdateUtil");
|
|
14
|
+
class BasicPubSubRepo {
|
|
15
|
+
constructor(model, pubsubModel) {
|
|
16
|
+
this.model = model;
|
|
17
|
+
this.pubsubModel = pubsubModel;
|
|
18
|
+
}
|
|
19
|
+
insert() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const obj = this.buildData();
|
|
22
|
+
yield this.model.create(obj);
|
|
23
|
+
return true;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
update() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
let obj = yield this.model.findByOrFail('key', this.getKey());
|
|
29
|
+
let update = this.buildData();
|
|
30
|
+
obj = UpdateUtil_1.UpdateUtil.updateObjectsWithSameType(obj, update.$attributes, typeof this.model);
|
|
31
|
+
yield obj.save();
|
|
32
|
+
return true;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
delete() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
let obj = yield this.model.findByOrFail('key', this.getKey());
|
|
38
|
+
yield obj.delete();
|
|
39
|
+
return true;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
buildData() {
|
|
43
|
+
let obj = new this.model();
|
|
44
|
+
obj = UpdateUtil_1.UpdateUtil.updateObjectsWithSameType(obj, this.pubsubModel.value, typeof this.model);
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
getKey() {
|
|
48
|
+
return this.pubsubModel.value.key;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.BasicPubSubRepo = BasicPubSubRepo;
|
|
@@ -8,10 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.errorSwitch = void 0;
|
|
13
16
|
const Enums_1 = require("../Enums");
|
|
14
|
-
const BasicException_1 = require("../Models/BasicException");
|
|
17
|
+
const BasicException_1 = __importDefault(require("../Models/BasicException"));
|
|
15
18
|
function errorSwitch(error, ctx, logger) {
|
|
16
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
20
|
switch (error.code) {
|
|
@@ -1,4 +1,27 @@
|
|
|
1
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 __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,10 +31,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
32
|
});
|
|
10
33
|
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
11
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
38
|
exports.AxiosService = void 0;
|
|
13
|
-
const axios_1 = require("axios");
|
|
14
|
-
const dotenv = require("dotenv");
|
|
39
|
+
const axios_1 = __importDefault(require("axios"));
|
|
40
|
+
const dotenv = __importStar(require("dotenv"));
|
|
15
41
|
let headers;
|
|
16
42
|
class AxiosService {
|
|
17
43
|
constructor(url) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/// <reference types="@adonisjs/application/build/adonis-typings" />
|
|
1
2
|
export { GooglePubSubCreateSubscription } from './Class/GooglePubSubCreateSubscription';
|
|
2
3
|
export { GooglePubSubPublish } from './Class/GooglePubSubPublish';
|
|
3
4
|
export { GooglePubSubSubscription } from './Class/GooglePubSubSubscription';
|
|
5
|
+
export { BasicPubSubRepo } from './Functions/BasicPubSubRepo';
|
|
4
6
|
export * from './Functions/TestVerification';
|
|
5
7
|
export { PubSubHandlerAction } from './Handlers/PubSubHandlerAction';
|
|
6
8
|
export { CryptHelper } from './Helpers/CryptHelper';
|
|
@@ -21,3 +23,13 @@ export { VendaPortal } from './Models/VendaPortal';
|
|
|
21
23
|
export { VendaReduzida, VendaReduzidaV2 } from './Models/VendaReduzida';
|
|
22
24
|
export { AxiosService } from './Services/AxiosService';
|
|
23
25
|
export { CombustivelService } from './Services/CombustivelService';
|
|
26
|
+
import { ApplicationContract } from "@ioc:Adonis/Core/Application";
|
|
27
|
+
export default class SimProvider {
|
|
28
|
+
protected app: ApplicationContract;
|
|
29
|
+
static needsApplication: boolean;
|
|
30
|
+
constructor(app: ApplicationContract);
|
|
31
|
+
register(): void;
|
|
32
|
+
boot(): Promise<void>;
|
|
33
|
+
ready(): Promise<void>;
|
|
34
|
+
shutdown(): Promise<void>;
|
|
35
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -10,17 +10,40 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
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
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
16
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.CombustivelService = exports.AxiosService = exports.VendaReduzidaV2 = exports.VendaReduzida = exports.VendaPortal = exports.VendaOrigem = exports.VendaItemReduzido = exports.VendaFormaPagamentoReduzida = exports.SMS = exports.PriceToSale = exports.PriceToConsult = exports.AxiosModel = exports.UpdateUtil = exports.StringHelper = exports.PromiseHelper = exports.NumberHelper = exports.HashHelper = exports.DateHelper = exports.CryptHelper = exports.PubSubHandlerAction = exports.GooglePubSubSubscription = exports.GooglePubSubPublish = exports.GooglePubSubCreateSubscription = void 0;
|
|
38
|
+
exports.CombustivelService = exports.AxiosService = exports.VendaReduzidaV2 = exports.VendaReduzida = exports.VendaPortal = exports.VendaOrigem = exports.VendaItemReduzido = exports.VendaFormaPagamentoReduzida = exports.SMS = exports.PriceToSale = exports.PriceToConsult = exports.AxiosModel = exports.UpdateUtil = exports.StringHelper = exports.PromiseHelper = exports.NumberHelper = exports.HashHelper = exports.DateHelper = exports.CryptHelper = exports.PubSubHandlerAction = exports.BasicPubSubRepo = exports.GooglePubSubSubscription = exports.GooglePubSubPublish = exports.GooglePubSubCreateSubscription = void 0;
|
|
18
39
|
var GooglePubSubCreateSubscription_1 = require("./Class/GooglePubSubCreateSubscription");
|
|
19
40
|
Object.defineProperty(exports, "GooglePubSubCreateSubscription", { enumerable: true, get: function () { return GooglePubSubCreateSubscription_1.GooglePubSubCreateSubscription; } });
|
|
20
41
|
var GooglePubSubPublish_1 = require("./Class/GooglePubSubPublish");
|
|
21
42
|
Object.defineProperty(exports, "GooglePubSubPublish", { enumerable: true, get: function () { return GooglePubSubPublish_1.GooglePubSubPublish; } });
|
|
22
43
|
var GooglePubSubSubscription_1 = require("./Class/GooglePubSubSubscription");
|
|
23
44
|
Object.defineProperty(exports, "GooglePubSubSubscription", { enumerable: true, get: function () { return GooglePubSubSubscription_1.GooglePubSubSubscription; } });
|
|
45
|
+
var BasicPubSubRepo_1 = require("./Functions/BasicPubSubRepo");
|
|
46
|
+
Object.defineProperty(exports, "BasicPubSubRepo", { enumerable: true, get: function () { return BasicPubSubRepo_1.BasicPubSubRepo; } });
|
|
24
47
|
__exportStar(require("./Functions/TestVerification"), exports);
|
|
25
48
|
var PubSubHandlerAction_1 = require("./Handlers/PubSubHandlerAction");
|
|
26
49
|
Object.defineProperty(exports, "PubSubHandlerAction", { enumerable: true, get: function () { return PubSubHandlerAction_1.PubSubHandlerAction; } });
|
|
@@ -61,3 +84,49 @@ var AxiosService_1 = require("./Services/AxiosService");
|
|
|
61
84
|
Object.defineProperty(exports, "AxiosService", { enumerable: true, get: function () { return AxiosService_1.AxiosService; } });
|
|
62
85
|
var CombustivelService_1 = require("./Services/CombustivelService");
|
|
63
86
|
Object.defineProperty(exports, "CombustivelService", { enumerable: true, get: function () { return CombustivelService_1.CombustivelService; } });
|
|
87
|
+
class SimProvider {
|
|
88
|
+
constructor(app) {
|
|
89
|
+
this.app = app;
|
|
90
|
+
}
|
|
91
|
+
register() {
|
|
92
|
+
}
|
|
93
|
+
boot() {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const { BaseModel, SnakeCaseNamingStrategy } = this.app.container.use("Adonis/Lucid/Orm");
|
|
96
|
+
const { string } = yield Promise.resolve().then(() => __importStar(require('@poppinss/utils/build/helpers')));
|
|
97
|
+
class CamelCaseNamingStrategy extends SnakeCaseNamingStrategy {
|
|
98
|
+
serializedName(_model, propertyName) {
|
|
99
|
+
return string.camelCase(propertyName);
|
|
100
|
+
}
|
|
101
|
+
paginationMetaKeys() {
|
|
102
|
+
return {
|
|
103
|
+
total: 'total',
|
|
104
|
+
perPage: 'perPage',
|
|
105
|
+
currentPage: 'currentPage',
|
|
106
|
+
lastPage: 'lastPage',
|
|
107
|
+
firstPage: 'firstPage',
|
|
108
|
+
firstPageUrl: 'firstPageUrl',
|
|
109
|
+
lastPageUrl: 'lastPageUrl',
|
|
110
|
+
nextPageUrl: 'nextPageUrl',
|
|
111
|
+
previousPageUrl: 'previousPageUrl',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
BaseModel.namingStrategy = new CamelCaseNamingStrategy();
|
|
116
|
+
const Database = this.app.container.use("Adonis/Lucid/Database");
|
|
117
|
+
Database.SimplePaginator.namingStrategy = {
|
|
118
|
+
paginationMetaKeys() {
|
|
119
|
+
return new CamelCaseNamingStrategy().paginationMetaKeys();
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
ready() {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
126
|
+
}
|
|
127
|
+
shutdown() {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.default = SimProvider;
|
|
132
|
+
SimProvider.needsApplication = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sim-node-lib",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.35",
|
|
4
4
|
"description": "Library from SIMLabs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"tsc": "tsc",
|
|
12
|
-
"pub": "tsc && yarn publish",
|
|
13
|
-
"tgz": "tsc && yarn pack"
|
|
11
|
+
"tsc": "tsc && cpy './src/Commands/Templates/*.txt' dist/Commands/Templates",
|
|
12
|
+
"pub": "tsc && cpy './src/Commands/Templates/*.txt' dist/Commands/Templates && yarn publish",
|
|
13
|
+
"tgz": "tsc && cpy './src/Commands/Templates/*.txt' dist/Commands/Templates && yarn pack",
|
|
14
|
+
"mrm": "mrm --preset=@adonisjs/mrm-preset"
|
|
14
15
|
},
|
|
15
16
|
"license": "ISC",
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@google-cloud/pubsub": "^3.2.1",
|
|
18
19
|
"axios": "^0.27.2",
|
|
20
|
+
"cpy-cli": "^5.0.0",
|
|
19
21
|
"crypto": "^1.0.1",
|
|
20
22
|
"crypto-js": "^4.1.1",
|
|
21
23
|
"dotenv": "^16.0.1",
|
|
@@ -24,8 +26,30 @@
|
|
|
24
26
|
"uuid": "^9.0.0"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
29
|
+
"@adonisjs/core": "^5.9.0",
|
|
30
|
+
"@adonisjs/lucid": "^18.4.0",
|
|
31
|
+
"@adonisjs/mrm-preset": "^5.0.3",
|
|
32
|
+
"@adonisjs/require-ts": "^2.0.13",
|
|
27
33
|
"@types/node": "^17.0.41",
|
|
34
|
+
"@types/pino-std-serializers": "^4.0.0",
|
|
28
35
|
"@types/uuid": "^9.0.2",
|
|
36
|
+
"mrm": "^4.1.17",
|
|
29
37
|
"typescript": "^4.7.3"
|
|
38
|
+
},
|
|
39
|
+
"mrmConfig": {
|
|
40
|
+
"core": false,
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"services": [],
|
|
43
|
+
"minNodeVersion": "16.13.1",
|
|
44
|
+
"probotApps": []
|
|
45
|
+
},
|
|
46
|
+
"adonisjs": {
|
|
47
|
+
"commands": [
|
|
48
|
+
"sim-node-lib/dist/Commands"
|
|
49
|
+
],
|
|
50
|
+
"types": "sim-node-lib",
|
|
51
|
+
"providers": [
|
|
52
|
+
"sim-node-lib"
|
|
53
|
+
]
|
|
30
54
|
}
|
|
31
55
|
}
|