@skalfa/skalfa-api-core 1.0.2
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/.github/workflows/publish.yml +40 -0
- package/dist/auth/auth.d.ts +19 -0
- package/dist/auth/auth.js +227 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth.util.d.ts +19 -0
- package/dist/auth.util.js +183 -0
- package/dist/auth.util.js.map +1 -0
- package/dist/commands/cli.d.ts +1 -0
- package/dist/commands/cli.js +78 -0
- package/dist/commands/cli.js.map +1 -0
- package/dist/commands/make/basic-controller.d.ts +2 -0
- package/dist/commands/make/basic-controller.js +40 -0
- package/dist/commands/make/basic-controller.js.map +1 -0
- package/dist/commands/make/basic-migration.d.ts +5 -0
- package/dist/commands/make/basic-migration.js +60 -0
- package/dist/commands/make/basic-migration.js.map +1 -0
- package/dist/commands/make/basic-model.d.ts +2 -0
- package/dist/commands/make/basic-model.js +25 -0
- package/dist/commands/make/basic-model.js.map +1 -0
- package/dist/commands/make/basic-seeder.d.ts +3 -0
- package/dist/commands/make/basic-seeder.js +32 -0
- package/dist/commands/make/basic-seeder.js.map +1 -0
- package/dist/commands/make/blueprint.d.ts +2 -0
- package/dist/commands/make/blueprint.js +29 -0
- package/dist/commands/make/blueprint.js.map +1 -0
- package/dist/commands/make/da-migration.d.ts +5 -0
- package/dist/commands/make/da-migration.js +60 -0
- package/dist/commands/make/da-migration.js.map +1 -0
- package/dist/commands/make/light-controller.d.ts +3 -0
- package/dist/commands/make/light-controller.js +54 -0
- package/dist/commands/make/light-controller.js.map +1 -0
- package/dist/commands/make/light-model.d.ts +3 -0
- package/dist/commands/make/light-model.js +50 -0
- package/dist/commands/make/light-model.js.map +1 -0
- package/dist/commands/make/mail.d.ts +2 -0
- package/dist/commands/make/mail.js +41 -0
- package/dist/commands/make/mail.js.map +1 -0
- package/dist/commands/make/notification.d.ts +2 -0
- package/dist/commands/make/notification.js +33 -0
- package/dist/commands/make/notification.js.map +1 -0
- package/dist/commands/make/queue.d.ts +2 -0
- package/dist/commands/make/queue.js +35 -0
- package/dist/commands/make/queue.js.map +1 -0
- package/dist/commands/runner/barrels.d.ts +3 -0
- package/dist/commands/runner/barrels.js +78 -0
- package/dist/commands/runner/barrels.js.map +1 -0
- package/dist/commands/runner/blueprint/controller-generation.d.ts +1 -0
- package/dist/commands/runner/blueprint/controller-generation.js +147 -0
- package/dist/commands/runner/blueprint/controller-generation.js.map +1 -0
- package/dist/commands/runner/blueprint/documentation-generation.d.ts +6 -0
- package/dist/commands/runner/blueprint/documentation-generation.js +337 -0
- package/dist/commands/runner/blueprint/documentation-generation.js.map +1 -0
- package/dist/commands/runner/blueprint/migration-generation.d.ts +1 -0
- package/dist/commands/runner/blueprint/migration-generation.js +120 -0
- package/dist/commands/runner/blueprint/migration-generation.js.map +1 -0
- package/dist/commands/runner/blueprint/model-generation.d.ts +1 -0
- package/dist/commands/runner/blueprint/model-generation.js +122 -0
- package/dist/commands/runner/blueprint/model-generation.js.map +1 -0
- package/dist/commands/runner/blueprint/runner.d.ts +23 -0
- package/dist/commands/runner/blueprint/runner.js +139 -0
- package/dist/commands/runner/blueprint/runner.js.map +1 -0
- package/dist/commands/runner/blueprint/seeder-generation.d.ts +1 -0
- package/dist/commands/runner/blueprint/seeder-generation.js +40 -0
- package/dist/commands/runner/blueprint/seeder-generation.js.map +1 -0
- package/dist/commands/runner/da-migration.d.ts +39 -0
- package/dist/commands/runner/da-migration.js +262 -0
- package/dist/commands/runner/da-migration.js.map +1 -0
- package/dist/commands/runner/migration.d.ts +11 -0
- package/dist/commands/runner/migration.js +188 -0
- package/dist/commands/runner/migration.js.map +1 -0
- package/dist/commands/runner/seeder.d.ts +3 -0
- package/dist/commands/runner/seeder.js +40 -0
- package/dist/commands/runner/seeder.js.map +1 -0
- package/dist/commands/stubs/index.d.ts +14 -0
- package/dist/commands/stubs/index.js +277 -0
- package/dist/commands/stubs/index.js.map +1 -0
- package/dist/context/context.d.ts +7 -0
- package/dist/context/context.js +11 -0
- package/dist/context/context.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context.util.d.ts +7 -0
- package/dist/context.util.js +11 -0
- package/dist/context.util.js.map +1 -0
- package/dist/controller/controller.d.ts +118 -0
- package/dist/controller/controller.js +147 -0
- package/dist/controller/controller.js.map +1 -0
- package/dist/controller/index.d.ts +1 -0
- package/dist/controller/index.js +2 -0
- package/dist/controller/index.js.map +1 -0
- package/dist/controller.util.d.ts +118 -0
- package/dist/controller.util.js +144 -0
- package/dist/controller.util.js.map +1 -0
- package/dist/conversion/conversion.d.ts +8 -0
- package/dist/conversion/conversion.js +52 -0
- package/dist/conversion/conversion.js.map +1 -0
- package/dist/conversion/index.d.ts +1 -0
- package/dist/conversion/index.js +2 -0
- package/dist/conversion/index.js.map +1 -0
- package/dist/conversion.util.d.ts +8 -0
- package/dist/conversion.util.js +52 -0
- package/dist/conversion.util.js.map +1 -0
- package/dist/db/db.d.ts +84 -0
- package/dist/db/db.js +177 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.js +2 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db.util.d.ts +84 -0
- package/dist/db.util.js +177 -0
- package/dist/db.util.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/index.d.ts +1 -0
- package/dist/logger/index.js +2 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/logger/logger.d.ts +30 -0
- package/dist/logger/logger.js +126 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/logger.util.d.ts +30 -0
- package/dist/logger.util.js +126 -0
- package/dist/logger.util.js.map +1 -0
- package/dist/mail/index.d.ts +1 -0
- package/dist/mail/index.js +2 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/mail.d.ts +21 -0
- package/dist/mail/mail.js +53 -0
- package/dist/mail/mail.js.map +1 -0
- package/dist/mail.util.d.ts +21 -0
- package/dist/mail.util.js +53 -0
- package/dist/mail.util.js.map +1 -0
- package/dist/middleware/index.d.ts +1 -0
- package/dist/middleware/index.js +2 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/middleware.d.ts +263 -0
- package/dist/middleware/middleware.js +233 -0
- package/dist/middleware/middleware.js.map +1 -0
- package/dist/middleware.util.d.ts +263 -0
- package/dist/middleware.util.js +233 -0
- package/dist/middleware.util.js.map +1 -0
- package/dist/model/index.d.ts +3 -0
- package/dist/model/index.js +4 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/model.d.ts +204 -0
- package/dist/model/model.js +1495 -0
- package/dist/model/model.js.map +1 -0
- package/dist/model.util.d.ts +204 -0
- package/dist/model.util.js +1495 -0
- package/dist/model.util.js.map +1 -0
- package/dist/permission/index.d.ts +1 -0
- package/dist/permission/index.js +2 -0
- package/dist/permission/index.js.map +1 -0
- package/dist/permission/permission.d.ts +38 -0
- package/dist/permission/permission.js +91 -0
- package/dist/permission/permission.js.map +1 -0
- package/dist/permission.util.d.ts +38 -0
- package/dist/permission.util.js +91 -0
- package/dist/permission.util.js.map +1 -0
- package/dist/registry/index.d.ts +1 -0
- package/dist/registry/index.js +2 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/registry.d.ts +28 -0
- package/dist/registry/registry.js +19 -0
- package/dist/registry/registry.js.map +1 -0
- package/dist/registry.util.d.ts +28 -0
- package/dist/registry.util.js +19 -0
- package/dist/registry.util.js.map +1 -0
- package/dist/route/index.d.ts +1 -0
- package/dist/route/index.js +2 -0
- package/dist/route/index.js.map +1 -0
- package/dist/route/route.d.ts +1 -0
- package/dist/route/route.js +12 -0
- package/dist/route/route.js.map +1 -0
- package/dist/route.util.d.ts +1 -0
- package/dist/route.util.js +12 -0
- package/dist/route.util.js.map +1 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/storage.d.ts +56 -0
- package/dist/storage/storage.js +86 -0
- package/dist/storage/storage.js.map +1 -0
- package/dist/storage.util.d.ts +56 -0
- package/dist/storage.util.js +82 -0
- package/dist/storage.util.js.map +1 -0
- package/dist/validation/index.d.ts +1 -0
- package/dist/validation/index.js +2 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validation.d.ts +7 -0
- package/dist/validation/validation.js +245 -0
- package/dist/validation/validation.js.map +1 -0
- package/dist/validation.util.d.ts +7 -0
- package/dist/validation.util.js +237 -0
- package/dist/validation.util.js.map +1 -0
- package/package.json +34 -0
- package/src/auth/auth.ts +282 -0
- package/src/auth/index.ts +1 -0
- package/src/commands/cli.ts +89 -0
- package/src/commands/make/basic-controller.ts +49 -0
- package/src/commands/make/basic-migration.ts +89 -0
- package/src/commands/make/basic-model.ts +32 -0
- package/src/commands/make/basic-seeder.ts +38 -0
- package/src/commands/make/blueprint.ts +36 -0
- package/src/commands/make/da-migration.ts +90 -0
- package/src/commands/make/light-controller.ts +67 -0
- package/src/commands/make/light-model.ts +61 -0
- package/src/commands/make/mail.ts +51 -0
- package/src/commands/make/notification.ts +43 -0
- package/src/commands/make/queue.ts +45 -0
- package/src/commands/runner/barrels.ts +85 -0
- package/src/commands/runner/blueprint/controller-generation.ts +194 -0
- package/src/commands/runner/blueprint/documentation-generation.ts +463 -0
- package/src/commands/runner/blueprint/migration-generation.ts +153 -0
- package/src/commands/runner/blueprint/model-generation.ts +149 -0
- package/src/commands/runner/blueprint/runner.ts +181 -0
- package/src/commands/runner/blueprint/seeder-generation.ts +55 -0
- package/src/commands/runner/da-migration.ts +333 -0
- package/src/commands/runner/migration.ts +245 -0
- package/src/commands/runner/seeder.ts +44 -0
- package/src/commands/stubs/index.ts +289 -0
- package/src/context/context.ts +17 -0
- package/src/context/index.ts +1 -0
- package/src/controller/controller.ts +240 -0
- package/src/controller/index.ts +1 -0
- package/src/conversion/conversion.ts +65 -0
- package/src/conversion/index.ts +1 -0
- package/src/index.ts +22 -0
- package/src/logger/index.ts +1 -0
- package/src/logger/logger.ts +177 -0
- package/src/mail/index.ts +1 -0
- package/src/mail/mail.ts +86 -0
- package/src/middleware/index.ts +1 -0
- package/src/middleware/middleware.ts +289 -0
- package/src/permission/index.ts +1 -0
- package/src/permission/permission.ts +136 -0
- package/src/registry/index.ts +1 -0
- package/src/registry/registry.ts +37 -0
- package/src/route/index.ts +1 -0
- package/src/route/route.ts +12 -0
- package/src/storage/index.ts +1 -0
- package/src/storage/storage.ts +107 -0
- package/src/validation/index.ts +1 -0
- package/src/validation/validation.ts +346 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
export const basicControllerStub = `import type { ControllerContext } from "elysia"
|
|
2
|
+
|
|
3
|
+
export class {{ name }} {
|
|
4
|
+
// ========================================>
|
|
5
|
+
// ## Display a listing of the resource.
|
|
6
|
+
// ========================================>
|
|
7
|
+
static async index(c: ControllerContext) {
|
|
8
|
+
// something amazing
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// =============================================>
|
|
13
|
+
// ## Store a newly created resource.
|
|
14
|
+
// =============================================>
|
|
15
|
+
static async store(c: ControllerContext) {
|
|
16
|
+
// something amazing
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
// ============================================>
|
|
21
|
+
// ## Update the specified resource.
|
|
22
|
+
// ============================================>
|
|
23
|
+
static async update(c: ControllerContext) {
|
|
24
|
+
// something amazing
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// ===============================================>
|
|
29
|
+
// ## Remove the specified resource.
|
|
30
|
+
// ===============================================>
|
|
31
|
+
static async destroy(c: ControllerContext) {
|
|
32
|
+
// something amazing
|
|
33
|
+
}
|
|
34
|
+
}`;
|
|
35
|
+
export const basicMigrationStub = `import type { Knex } from "knex"
|
|
36
|
+
|
|
37
|
+
export async function up(knex: Knex): Promise<void> {
|
|
38
|
+
await knex.schema.createTable("{{ tableName }}", (table) => {
|
|
39
|
+
table.bigIncrements('id').primary()
|
|
40
|
+
// your table schema
|
|
41
|
+
table.timestamps(true, true)
|
|
42
|
+
table.softDelete()
|
|
43
|
+
})
|
|
44
|
+
}`;
|
|
45
|
+
export const basicModelStub = `import { Model } from '@utils'
|
|
46
|
+
|
|
47
|
+
export class {{ name }} extends Model {
|
|
48
|
+
// something amazing
|
|
49
|
+
}`;
|
|
50
|
+
export const basicSeederStub = `import { {{ model }} } from "@models";
|
|
51
|
+
|
|
52
|
+
export default async function {{ name }}() {
|
|
53
|
+
// =========================>
|
|
54
|
+
// ## Seed the application's database
|
|
55
|
+
// =========================>
|
|
56
|
+
|
|
57
|
+
await {{ model }}.query().insert([]);
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
export const blueprintStub = `[
|
|
61
|
+
{
|
|
62
|
+
"model" : "",
|
|
63
|
+
"schema" : {},
|
|
64
|
+
"relations": {},
|
|
65
|
+
"controllers": {},
|
|
66
|
+
"migrations" : true,
|
|
67
|
+
"seeders" : [],
|
|
68
|
+
"documentation": true
|
|
69
|
+
}
|
|
70
|
+
]`;
|
|
71
|
+
export const daMigrationStub = `import { DAMigration } from "@utils"
|
|
72
|
+
|
|
73
|
+
export default class {{ className }} extends DAMigration {
|
|
74
|
+
async up() {
|
|
75
|
+
await this.createTable("{{ tableName }}",(table) => {
|
|
76
|
+
table.uuid()
|
|
77
|
+
}, {
|
|
78
|
+
engine: "MergeTree",
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
export const lightControllerStub = `{{ marker }}
|
|
84
|
+
import type { ControllerContext } from "elysia"
|
|
85
|
+
import { permission } from '@utils'
|
|
86
|
+
import { {{ model }} } from '@models'
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
// ========================================>
|
|
91
|
+
// ## Permission of the resource.
|
|
92
|
+
// ========================================>
|
|
93
|
+
const p = permission.register({
|
|
94
|
+
"{{ permission_code }}": {
|
|
95
|
+
name: "{{ permission_name }}",
|
|
96
|
+
accesses: {
|
|
97
|
+
"00": "Melihat",
|
|
98
|
+
"01": "Membuat",
|
|
99
|
+
"02": "Mengubah",
|
|
100
|
+
"03": "Menghapus",
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
export class {{ name }} {
|
|
108
|
+
// ========================================>
|
|
109
|
+
// ## Display a listing of the resource.
|
|
110
|
+
// ========================================>
|
|
111
|
+
static async index(c: ControllerContext) {
|
|
112
|
+
p.have("{{ permission_code }}.00").guard(c)
|
|
113
|
+
|
|
114
|
+
const { data, total } = await {{ model }}.query().resolve(c)
|
|
115
|
+
|
|
116
|
+
c.responseData(data, total)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
// =============================================>
|
|
121
|
+
// ## Store a newly created resource.
|
|
122
|
+
// =============================================>
|
|
123
|
+
static async store(c: ControllerContext) {
|
|
124
|
+
p.have("{{ permission_code }}.01").guard(c)
|
|
125
|
+
|
|
126
|
+
c.validation<{{ model }}>({{{ validations }}})
|
|
127
|
+
|
|
128
|
+
let record = {}
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
record = await (new {{ model }}).pump(c.payload)
|
|
132
|
+
} catch (err) {
|
|
133
|
+
c.responseError(err as Error, "Create {{ model }}")
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
c.responseSaved(record)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
// ============================================>
|
|
141
|
+
// ## Update the specified resource.
|
|
142
|
+
// ============================================>
|
|
143
|
+
static async update(c: ControllerContext) {
|
|
144
|
+
p.have("{{ permission_code }}.02").guard(c)
|
|
145
|
+
|
|
146
|
+
const record = await {{ model }}.query().findOrNotFound(c.params.id)
|
|
147
|
+
|
|
148
|
+
c.validation<{{ model }}>({{{ validations }}})
|
|
149
|
+
|
|
150
|
+
try {
|
|
151
|
+
await record.pump(c.payload)
|
|
152
|
+
} catch (err) {
|
|
153
|
+
c.responseError(err as Error, "Update {{ model }}")
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
c.responseSaved(record)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
// ===============================================>
|
|
161
|
+
// ## Remove the specified resource.
|
|
162
|
+
// ===============================================>
|
|
163
|
+
static async destroy(c: ControllerContext) {
|
|
164
|
+
p.have("{{ permission_code }}.03").guard(c)
|
|
165
|
+
|
|
166
|
+
const record = await {{ model }}.query().findOrNotFound(c.params.id)
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
await record.delete()
|
|
170
|
+
} catch (err) {
|
|
171
|
+
c.responseError(err as Error, "Delete {{ model }}")
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
c.responseSuccess(record)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`;
|
|
178
|
+
export const lightMigrationStub = `{{ marker }}
|
|
179
|
+
import type { Knex } from "knex"
|
|
180
|
+
|
|
181
|
+
export async function up(knex: Knex): Promise<void> {
|
|
182
|
+
await knex.schema.createTable("{{ tableName }}", (table) => {
|
|
183
|
+
table.bigIncrements('id').primary()
|
|
184
|
+
{{ schemas }}
|
|
185
|
+
table.timestamps(true, true)
|
|
186
|
+
table.softDelete()
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
{{ pivot }}
|
|
190
|
+
}`;
|
|
191
|
+
export const lightModelStub = `{{ marker }}
|
|
192
|
+
import { Model, SoftDelete{{ import_utils }} } from '@utils'
|
|
193
|
+
{{ import }}
|
|
194
|
+
|
|
195
|
+
export class {{ name }} extends Model {
|
|
196
|
+
// =====================>
|
|
197
|
+
// ## Field
|
|
198
|
+
// =====================>
|
|
199
|
+
{{ fields }}
|
|
200
|
+
|
|
201
|
+
@SoftDelete()
|
|
202
|
+
deleted_at!: Date
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
// =========================>
|
|
206
|
+
// ## Relations
|
|
207
|
+
// =========================>
|
|
208
|
+
{{ relations }}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
// =====================>
|
|
212
|
+
// ## Attribute
|
|
213
|
+
// =====================>
|
|
214
|
+
{{ attributes }}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
// =====================>
|
|
218
|
+
// ## Hook
|
|
219
|
+
// =====================>
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
`;
|
|
223
|
+
export const lightSeederStub = `{{ marker }}
|
|
224
|
+
import { {{ model }} } from "@models";
|
|
225
|
+
|
|
226
|
+
export default async function {{ name }}Seeder() {
|
|
227
|
+
// =========================>
|
|
228
|
+
// ## Seed the application's database
|
|
229
|
+
// =========================>
|
|
230
|
+
|
|
231
|
+
await (new {{ model }}).pump([
|
|
232
|
+
{{ seeders }}
|
|
233
|
+
]);
|
|
234
|
+
}
|
|
235
|
+
`;
|
|
236
|
+
export const mailStub = `import { renderMailTemplate, sendMail } from "@utils"
|
|
237
|
+
|
|
238
|
+
export async function {{ name }}Mail(to: string) {
|
|
239
|
+
const content = renderMailTemplate("{{ name }}", {
|
|
240
|
+
title: "{{ title }}",
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
const send = await sendMail({
|
|
244
|
+
subject: "{{ title }}",
|
|
245
|
+
to: to,
|
|
246
|
+
content: content
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
return send;
|
|
250
|
+
}
|
|
251
|
+
`;
|
|
252
|
+
export const notificationStub = `import { queue } from "@utils";
|
|
253
|
+
|
|
254
|
+
export async function {{ name }}Notification(payload: Record<string,any>) {
|
|
255
|
+
await queue.add('notification', { payload })
|
|
256
|
+
}
|
|
257
|
+
`;
|
|
258
|
+
export const queueStub = `import { queue } from '@utils'
|
|
259
|
+
|
|
260
|
+
export const {{ name }}QueueWorker = () => {
|
|
261
|
+
queue.worker("{{ worker_name }}", async (payload) => {
|
|
262
|
+
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
`;
|
|
266
|
+
export const routeStub = `import { Elysia } from 'elysia'
|
|
267
|
+
import { api, middleware } from '@utils'
|
|
268
|
+
import {
|
|
269
|
+
|
|
270
|
+
} from '@controllers'
|
|
271
|
+
|
|
272
|
+
export const {{ name }}Routes = (app: Elysia) => app.group('/{{ path }}', (route) => {
|
|
273
|
+
|
|
274
|
+
return route;
|
|
275
|
+
})
|
|
276
|
+
`;
|
|
277
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/stubs/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCjC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;EAShC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;EAI5B,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;CAS9B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;EAU3B,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;CAW9B,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FlC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;EAYhC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B7B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;CAY9B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;CAevB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;CAK/B,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;CAOxB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;CAUxB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
const storage = new AsyncLocalStorage();
|
|
3
|
+
export const context = {
|
|
4
|
+
run(ctx, fn) {
|
|
5
|
+
return storage.run(ctx, fn);
|
|
6
|
+
},
|
|
7
|
+
get(key) {
|
|
8
|
+
return storage.getStore()?.[key];
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAMpD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAc,CAAA;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,CAAI,GAAe,EAAE,EAAW;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC7B,CAAC;IAED,GAAG,CAA6B,GAAM;QACpC,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./context";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
const storage = new AsyncLocalStorage();
|
|
3
|
+
export const context = {
|
|
4
|
+
run(ctx, fn) {
|
|
5
|
+
return storage.run(ctx, fn);
|
|
6
|
+
},
|
|
7
|
+
get(key) {
|
|
8
|
+
return storage.getStore()?.[key];
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=context.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.util.js","sourceRoot":"","sources":["../src/context.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAMpD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAc,CAAA;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,CAAI,GAAe,EAAE,EAAW;QACjC,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC7B,CAAC;IAED,GAAG,CAA6B,GAAM;QACpC,OAAO,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import "elysia";
|
|
2
|
+
import { Elysia, Context } from "elysia";
|
|
3
|
+
import { KeyPermission, ValidationRules, ValidationRule } from "@utils";
|
|
4
|
+
declare module "elysia" {
|
|
5
|
+
interface ControllerContext extends Context {
|
|
6
|
+
getQuery: {
|
|
7
|
+
paginate: number;
|
|
8
|
+
page: number;
|
|
9
|
+
sort: string[];
|
|
10
|
+
filter: Record<string, string>;
|
|
11
|
+
search: string;
|
|
12
|
+
searchable: string[];
|
|
13
|
+
selectable: string[];
|
|
14
|
+
selectableOption: string[];
|
|
15
|
+
expand: string[];
|
|
16
|
+
};
|
|
17
|
+
responseData: (data: any[], totalRow?: number, message?: string, columns?: string[], access?: string[]) => {
|
|
18
|
+
status: number;
|
|
19
|
+
body: any;
|
|
20
|
+
};
|
|
21
|
+
validation: <T extends object>(rules: Partial<Record<keyof T | string, ValidationRule[] | string>>) => any;
|
|
22
|
+
responseError: (error: any, section?: string, message?: string, debug?: boolean) => any;
|
|
23
|
+
responseErrorValidation: (errors: Record<string, string[]>) => any;
|
|
24
|
+
responseSaved: (data: any, message?: string) => any;
|
|
25
|
+
responseSuccess: (data: any, message?: string) => any;
|
|
26
|
+
responseForbidden: (message?: string) => any;
|
|
27
|
+
uploadFile: (file: File, folder?: string) => Promise<string>;
|
|
28
|
+
deleteFile: (filePath: string) => void;
|
|
29
|
+
user?: any;
|
|
30
|
+
permissions?: KeyPermission[];
|
|
31
|
+
payload: Record<string, any>;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export type ValidationRulesFor<T> = Partial<Record<keyof T | string, ValidationRule[] | string>>;
|
|
35
|
+
export declare const controller: (app: Elysia) => Elysia<"", {
|
|
36
|
+
decorator: {};
|
|
37
|
+
store: {};
|
|
38
|
+
derive: {};
|
|
39
|
+
resolve: {};
|
|
40
|
+
}, {
|
|
41
|
+
typebox: {};
|
|
42
|
+
error: {};
|
|
43
|
+
}, {
|
|
44
|
+
schema: {};
|
|
45
|
+
standaloneSchema: {};
|
|
46
|
+
macro: {};
|
|
47
|
+
macroFn: {};
|
|
48
|
+
parser: {};
|
|
49
|
+
response: {};
|
|
50
|
+
}, {}, {
|
|
51
|
+
derive: {};
|
|
52
|
+
resolve: {};
|
|
53
|
+
schema: {};
|
|
54
|
+
standaloneSchema: {};
|
|
55
|
+
response: {};
|
|
56
|
+
}, {
|
|
57
|
+
derive: {
|
|
58
|
+
readonly getQuery: {
|
|
59
|
+
readonly page: number;
|
|
60
|
+
readonly paginate: number;
|
|
61
|
+
readonly search: string;
|
|
62
|
+
readonly sort: any;
|
|
63
|
+
readonly filter: any;
|
|
64
|
+
readonly searchable: any;
|
|
65
|
+
readonly selectable: any;
|
|
66
|
+
readonly selectableOption: any;
|
|
67
|
+
readonly expand: any;
|
|
68
|
+
};
|
|
69
|
+
readonly validation: <T extends object>(rules: Partial<Record<keyof T | string, ValidationRules[] | string>>) => Promise<void>;
|
|
70
|
+
readonly responseErrorValidation: (errors: Record<string, string[]>) => never;
|
|
71
|
+
readonly responseError: (error: any, section?: string, message?: string, debug?: string | boolean) => never;
|
|
72
|
+
readonly responseForbidden: (message?: string) => never;
|
|
73
|
+
readonly responseData: (data: any[], totalRow?: number, message?: string) => never;
|
|
74
|
+
readonly responseSuccess: (data: any, message?: string, code?: 200 | 201) => never;
|
|
75
|
+
readonly responseSaved: (data: any, message?: string) => never;
|
|
76
|
+
readonly uploadFile: (file: File, folder?: string, options?: {
|
|
77
|
+
disk?: "public" | "private";
|
|
78
|
+
owner_id?: number;
|
|
79
|
+
permissions?: {
|
|
80
|
+
user_id?: number;
|
|
81
|
+
role_id?: number;
|
|
82
|
+
}[];
|
|
83
|
+
}) => Promise<string>;
|
|
84
|
+
readonly deleteFile: (filePath: string) => Promise<boolean>;
|
|
85
|
+
};
|
|
86
|
+
resolve: {};
|
|
87
|
+
schema: {};
|
|
88
|
+
standaloneSchema: {};
|
|
89
|
+
response: import("elysia").ExtractErrorFromHandle<{
|
|
90
|
+
readonly getQuery: {
|
|
91
|
+
readonly page: number;
|
|
92
|
+
readonly paginate: number;
|
|
93
|
+
readonly search: string;
|
|
94
|
+
readonly sort: any;
|
|
95
|
+
readonly filter: any;
|
|
96
|
+
readonly searchable: any;
|
|
97
|
+
readonly selectable: any;
|
|
98
|
+
readonly selectableOption: any;
|
|
99
|
+
readonly expand: any;
|
|
100
|
+
};
|
|
101
|
+
readonly validation: <T extends object>(rules: Partial<Record<keyof T | string, ValidationRules[] | string>>) => Promise<void>;
|
|
102
|
+
readonly responseErrorValidation: (errors: Record<string, string[]>) => never;
|
|
103
|
+
readonly responseError: (error: any, section?: string, message?: string, debug?: string | boolean) => never;
|
|
104
|
+
readonly responseForbidden: (message?: string) => never;
|
|
105
|
+
readonly responseData: (data: any[], totalRow?: number, message?: string) => never;
|
|
106
|
+
readonly responseSuccess: (data: any, message?: string, code?: 200 | 201) => never;
|
|
107
|
+
readonly responseSaved: (data: any, message?: string) => never;
|
|
108
|
+
readonly uploadFile: (file: File, folder?: string, options?: {
|
|
109
|
+
disk?: "public" | "private";
|
|
110
|
+
owner_id?: number;
|
|
111
|
+
permissions?: {
|
|
112
|
+
user_id?: number;
|
|
113
|
+
role_id?: number;
|
|
114
|
+
}[];
|
|
115
|
+
}) => Promise<string>;
|
|
116
|
+
readonly deleteFile: (filePath: string) => Promise<boolean>;
|
|
117
|
+
}>;
|
|
118
|
+
}>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import "elysia";
|
|
4
|
+
import { validate, logger } from "@utils";
|
|
5
|
+
import { db } from "@skalfa/skalfa-orm";
|
|
6
|
+
export const controller = (app) => app.derive(({ query, body, status }) => ({
|
|
7
|
+
// =====================================>
|
|
8
|
+
// ## Basic fetching data query
|
|
9
|
+
// =====================================>
|
|
10
|
+
getQuery: {
|
|
11
|
+
page: query.page ? Number(query.page) : 1,
|
|
12
|
+
paginate: query.paginate ? Number(query.paginate) : 10,
|
|
13
|
+
search: query.search ? query.search : "",
|
|
14
|
+
sort: query.sort ? JSON.parse(query.sort) : ["created_at desc"],
|
|
15
|
+
filter: query.filter ? JSON.parse(query.filter) : [],
|
|
16
|
+
searchable: query.searchable ? JSON.parse(query.searchable) : [],
|
|
17
|
+
selectable: query.selectable ? JSON.parse(query.selectable) : [],
|
|
18
|
+
selectableOption: query.selectableOption ? JSON.parse(query.selectableOption) : [],
|
|
19
|
+
expand: query.expand ? JSON.parse(query.expand) : [],
|
|
20
|
+
},
|
|
21
|
+
// ===================================>
|
|
22
|
+
// ## Validation request body
|
|
23
|
+
// ===================================>
|
|
24
|
+
validation: async (rules) => {
|
|
25
|
+
const result = await validate(body, rules);
|
|
26
|
+
if (!result.valid) {
|
|
27
|
+
throw status(422, {
|
|
28
|
+
message: "Error: Unprocessable Entity!",
|
|
29
|
+
errors: result.errors,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
// ====================================>
|
|
34
|
+
// ## Response error validation
|
|
35
|
+
// ====================================>
|
|
36
|
+
responseErrorValidation: (errors) => {
|
|
37
|
+
throw status(422, {
|
|
38
|
+
message: "Error: Unprocessable Entity!",
|
|
39
|
+
errors: errors,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
// ====================================>
|
|
43
|
+
// ## Response error
|
|
44
|
+
// ====================================>
|
|
45
|
+
responseError: (error, section, message, debug = (process.env.APP_DEBUG || true)) => {
|
|
46
|
+
logger.error(`Error: ${error}`, { error: error, feature: section });
|
|
47
|
+
if (debug) {
|
|
48
|
+
throw status(500, {
|
|
49
|
+
message: message ?? "Error: Server Side Having Problem!",
|
|
50
|
+
error: error?.message ?? "unknown",
|
|
51
|
+
section: section ?? "unknown",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
throw status(500, {
|
|
55
|
+
message: message ?? "Error: Server Side Having Problem!"
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
// ====================================>
|
|
59
|
+
// ## Response Forbidden
|
|
60
|
+
// ====================================>
|
|
61
|
+
responseForbidden: (message) => {
|
|
62
|
+
throw status(403, {
|
|
63
|
+
message: message ?? "Access Forbidden!"
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
// ====================================>
|
|
67
|
+
// ## Response record
|
|
68
|
+
// ====================================>
|
|
69
|
+
responseData: (data, totalRow, message) => {
|
|
70
|
+
throw status(200, {
|
|
71
|
+
message: message ?? (data.length ? "Success" : "Empty data"),
|
|
72
|
+
data: data ?? [],
|
|
73
|
+
total_row: totalRow ?? null,
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
// ===================================>
|
|
77
|
+
// ## Response success
|
|
78
|
+
// ===================================>
|
|
79
|
+
responseSuccess: (data, message, code) => {
|
|
80
|
+
throw status(code || 200, {
|
|
81
|
+
message: message ?? "Success",
|
|
82
|
+
data: data ?? [],
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
// ===================================>
|
|
86
|
+
// ## Response saved record
|
|
87
|
+
// ===================================>
|
|
88
|
+
responseSaved: (data, message) => {
|
|
89
|
+
throw status(201, {
|
|
90
|
+
message: message ?? "Success",
|
|
91
|
+
data: data ?? [],
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
// ===================================>
|
|
95
|
+
// ## Upload file
|
|
96
|
+
// ===================================>
|
|
97
|
+
uploadFile: async (file, folder = "uploads", options) => {
|
|
98
|
+
const disk = options?.disk ?? "public";
|
|
99
|
+
const dir = path.resolve("storage", disk, folder);
|
|
100
|
+
if (!fs.existsSync(dir))
|
|
101
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
102
|
+
const fileName = `${Date.now().toString(36)}${Math.random().toString(36).substring(2, 18)}${path.extname(file.name).toLowerCase()}`;
|
|
103
|
+
const filePath = path.join(dir, fileName);
|
|
104
|
+
const buffer = Buffer.from(await file.arrayBuffer());
|
|
105
|
+
fs.writeFileSync(filePath, buffer);
|
|
106
|
+
const relativePath = `/${folder}/${fileName}`;
|
|
107
|
+
if (db && options) {
|
|
108
|
+
const [storage] = await db("storages").insert({
|
|
109
|
+
user_id: options?.owner_id ?? null,
|
|
110
|
+
disk: disk,
|
|
111
|
+
path: relativePath,
|
|
112
|
+
filename: file.name,
|
|
113
|
+
filetype: file.type,
|
|
114
|
+
filesize: buffer.length,
|
|
115
|
+
created_at: new Date(),
|
|
116
|
+
}).returning(["id"]);
|
|
117
|
+
if (options?.permissions?.length) {
|
|
118
|
+
const permissions = options.permissions.map(p => ({
|
|
119
|
+
storage_id: storage.id,
|
|
120
|
+
user_id: p.user_id ?? null,
|
|
121
|
+
role_id: p.role_id ?? null,
|
|
122
|
+
created_at: new Date(),
|
|
123
|
+
}));
|
|
124
|
+
await db("storage_permissions").insert(permissions);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return relativePath;
|
|
128
|
+
},
|
|
129
|
+
// ==================================>
|
|
130
|
+
// ## Delete File
|
|
131
|
+
// ==================================>
|
|
132
|
+
deleteFile: async (filePath) => {
|
|
133
|
+
if (fs.existsSync(filePath)) {
|
|
134
|
+
if (db) {
|
|
135
|
+
const record = await db("storages").where("path", filePath).first();
|
|
136
|
+
if (record) {
|
|
137
|
+
await db("storages").where("id", record.id).delete();
|
|
138
|
+
await db("storage_permissions").where("storage_id", record.id).delete();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
fs.unlinkSync(filePath);
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
return false;
|
|
145
|
+
},
|
|
146
|
+
}));
|
|
147
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/controller/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,CAAC;AAEhB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAkD,MAAM,QAAQ,CAAC;AAC1F,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAgDxC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAElF,yCAAyC;IACzC,+BAA+B;IAC/B,yCAAyC;IACzC,QAAQ,EAAE;QACR,IAAI,EAAiB,KAAK,CAAC,IAAI,CAAc,CAAC,CAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAkC,CAAC,CAAI,CAAC;QAC3G,QAAQ,EAAa,KAAK,CAAC,QAAQ,CAAU,CAAC,CAAG,MAAM,CAAC,KAA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