@carbonorm/carbonnode 3.7.6 → 3.7.7

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/api/orm/builders/AggregateBuilder.d.ts +1 -0
  3. package/dist/api/types/ormInterfaces.d.ts +2 -2
  4. package/dist/api/utils/cacheManager.d.ts +1 -1
  5. package/dist/api/utils/normalizeSingularRequest.d.ts +10 -0
  6. package/dist/index.cjs.js +175 -32
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.esm.js +176 -34
  10. package/dist/index.esm.js.map +1 -1
  11. package/package.json +11 -6
  12. package/scripts/assets/handlebars/C6.test.ts.handlebars +55 -80
  13. package/scripts/assets/handlebars/C6.ts.handlebars +28 -2
  14. package/scripts/generateRestBindings.cjs +17 -6
  15. package/scripts/generateRestBindings.ts +22 -8
  16. package/src/__tests__/fixtures/c6.fixture.ts +74 -0
  17. package/src/__tests__/normalizeSingularRequest.test.ts +95 -0
  18. package/src/__tests__/sakila-db/C6.js +1487 -0
  19. package/src/__tests__/sakila-db/C6.test.ts +63 -0
  20. package/src/__tests__/sakila-db/C6.ts +2206 -0
  21. package/src/__tests__/sakila-db/sakila-data.sql +46444 -0
  22. package/src/__tests__/sakila-db/sakila-schema.sql +686 -0
  23. package/src/__tests__/sakila-db/sakila.mwb +0 -0
  24. package/src/__tests__/sakila.generated.test.ts +46 -0
  25. package/src/__tests__/sqlBuilders.complex.test.ts +134 -0
  26. package/src/__tests__/sqlBuilders.test.ts +121 -0
  27. package/src/api/convertForRequestBody.ts +1 -1
  28. package/src/api/executors/HttpExecutor.ts +14 -3
  29. package/src/api/executors/SqlExecutor.ts +14 -1
  30. package/src/api/orm/builders/AggregateBuilder.ts +3 -0
  31. package/src/api/orm/builders/ConditionBuilder.ts +34 -11
  32. package/src/api/orm/builders/PaginationBuilder.ts +10 -4
  33. package/src/api/orm/queries/SelectQueryBuilder.ts +3 -0
  34. package/src/api/orm/queries/UpdateQueryBuilder.ts +2 -1
  35. package/src/api/types/ormInterfaces.ts +3 -4
  36. package/src/api/utils/cacheManager.ts +1 -1
  37. package/src/api/utils/normalizeSingularRequest.ts +138 -0
  38. package/src/index.ts +1 -0
@@ -0,0 +1,1487 @@
1
+ // noinspection JSUnusedGlobalSymbols,SpellCheckingInspection
2
+ import { C6Constants, removePrefixIfExists, restOrm, } from "@carbonorm/carbonnode";
3
+ export const RestTablePrefix = '';
4
+ const actor = {
5
+ TABLE_NAME: 'actor',
6
+ ACTOR_ID: 'actor.actor_id',
7
+ FIRST_NAME: 'actor.first_name',
8
+ LAST_NAME: 'actor.last_name',
9
+ LAST_UPDATE: 'actor.last_update',
10
+ PRIMARY: [
11
+ 'actor.actor_id',
12
+ ],
13
+ PRIMARY_SHORT: [
14
+ 'actor_id',
15
+ ],
16
+ COLUMNS: {
17
+ 'actor.actor_id': 'actor_id',
18
+ 'actor.first_name': 'first_name',
19
+ 'actor.last_name': 'last_name',
20
+ 'actor.last_update': 'last_update',
21
+ },
22
+ TYPE_VALIDATION: {
23
+ 'actor.actor_id': {
24
+ MYSQL_TYPE: 'smallint',
25
+ MAX_LENGTH: '',
26
+ AUTO_INCREMENT: true,
27
+ SKIP_COLUMN_IN_POST: false
28
+ },
29
+ 'actor.first_name': {
30
+ MYSQL_TYPE: 'varchar',
31
+ MAX_LENGTH: '45',
32
+ AUTO_INCREMENT: false,
33
+ SKIP_COLUMN_IN_POST: false
34
+ },
35
+ 'actor.last_name': {
36
+ MYSQL_TYPE: 'varchar',
37
+ MAX_LENGTH: '45',
38
+ AUTO_INCREMENT: false,
39
+ SKIP_COLUMN_IN_POST: false
40
+ },
41
+ 'actor.last_update': {
42
+ MYSQL_TYPE: 'timestamp',
43
+ MAX_LENGTH: '',
44
+ AUTO_INCREMENT: false,
45
+ SKIP_COLUMN_IN_POST: false
46
+ },
47
+ },
48
+ REGEX_VALIDATION: {},
49
+ LIFECYCLE_HOOKS: {
50
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
51
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
52
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
53
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
54
+ },
55
+ TABLE_REFERENCES: {},
56
+ TABLE_REFERENCED_BY: {
57
+ 'actor_id': [{
58
+ TABLE: 'film_actor',
59
+ COLUMN: 'actor_id',
60
+ CONSTRAINT: 'fk_film_actor_actor',
61
+ },],
62
+ }
63
+ };
64
+ const address = {
65
+ TABLE_NAME: 'address',
66
+ ADDRESS_ID: 'address.address_id',
67
+ ADDRESS: 'address.address',
68
+ ADDRESS2: 'address.address2',
69
+ DISTRICT: 'address.district',
70
+ CITY_ID: 'address.city_id',
71
+ POSTAL_CODE: 'address.postal_code',
72
+ PHONE: 'address.phone',
73
+ LOCATION: 'address.location',
74
+ LAST_UPDATE: 'address.last_update',
75
+ PRIMARY: [
76
+ 'address.address_id',
77
+ ],
78
+ PRIMARY_SHORT: [
79
+ 'address_id',
80
+ ],
81
+ COLUMNS: {
82
+ 'address.address_id': 'address_id',
83
+ 'address.address': 'address',
84
+ 'address.address2': 'address2',
85
+ 'address.district': 'district',
86
+ 'address.city_id': 'city_id',
87
+ 'address.postal_code': 'postal_code',
88
+ 'address.phone': 'phone',
89
+ 'address.location': 'location',
90
+ 'address.last_update': 'last_update',
91
+ },
92
+ TYPE_VALIDATION: {
93
+ 'address.address_id': {
94
+ MYSQL_TYPE: 'smallint',
95
+ MAX_LENGTH: '',
96
+ AUTO_INCREMENT: true,
97
+ SKIP_COLUMN_IN_POST: false
98
+ },
99
+ 'address.address': {
100
+ MYSQL_TYPE: 'varchar',
101
+ MAX_LENGTH: '50',
102
+ AUTO_INCREMENT: false,
103
+ SKIP_COLUMN_IN_POST: false
104
+ },
105
+ 'address.address2': {
106
+ MYSQL_TYPE: 'varchar',
107
+ MAX_LENGTH: '50',
108
+ AUTO_INCREMENT: false,
109
+ SKIP_COLUMN_IN_POST: false
110
+ },
111
+ 'address.district': {
112
+ MYSQL_TYPE: 'varchar',
113
+ MAX_LENGTH: '20',
114
+ AUTO_INCREMENT: false,
115
+ SKIP_COLUMN_IN_POST: false
116
+ },
117
+ 'address.city_id': {
118
+ MYSQL_TYPE: 'smallint',
119
+ MAX_LENGTH: '',
120
+ AUTO_INCREMENT: false,
121
+ SKIP_COLUMN_IN_POST: false
122
+ },
123
+ 'address.postal_code': {
124
+ MYSQL_TYPE: 'varchar',
125
+ MAX_LENGTH: '10',
126
+ AUTO_INCREMENT: false,
127
+ SKIP_COLUMN_IN_POST: false
128
+ },
129
+ 'address.phone': {
130
+ MYSQL_TYPE: 'varchar',
131
+ MAX_LENGTH: '20',
132
+ AUTO_INCREMENT: false,
133
+ SKIP_COLUMN_IN_POST: false
134
+ },
135
+ 'address.location': {
136
+ MYSQL_TYPE: 'geometry',
137
+ MAX_LENGTH: '',
138
+ AUTO_INCREMENT: false,
139
+ SKIP_COLUMN_IN_POST: false
140
+ },
141
+ 'address.last_update': {
142
+ MYSQL_TYPE: 'timestamp',
143
+ MAX_LENGTH: '',
144
+ AUTO_INCREMENT: false,
145
+ SKIP_COLUMN_IN_POST: false
146
+ },
147
+ },
148
+ REGEX_VALIDATION: {},
149
+ LIFECYCLE_HOOKS: {
150
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
151
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
152
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
153
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
154
+ },
155
+ TABLE_REFERENCES: {
156
+ 'city_id': [{
157
+ TABLE: 'city',
158
+ COLUMN: 'city_id',
159
+ CONSTRAINT: 'fk_address_city',
160
+ },],
161
+ },
162
+ TABLE_REFERENCED_BY: {
163
+ 'address_id': [{
164
+ TABLE: 'customer',
165
+ COLUMN: 'address_id',
166
+ CONSTRAINT: 'fk_customer_address',
167
+ }, {
168
+ TABLE: 'staff',
169
+ COLUMN: 'address_id',
170
+ CONSTRAINT: 'fk_staff_address',
171
+ }, {
172
+ TABLE: 'store',
173
+ COLUMN: 'address_id',
174
+ CONSTRAINT: 'fk_store_address',
175
+ },],
176
+ }
177
+ };
178
+ const category = {
179
+ TABLE_NAME: 'category',
180
+ CATEGORY_ID: 'category.category_id',
181
+ NAME: 'category.name',
182
+ LAST_UPDATE: 'category.last_update',
183
+ PRIMARY: [
184
+ 'category.category_id',
185
+ ],
186
+ PRIMARY_SHORT: [
187
+ 'category_id',
188
+ ],
189
+ COLUMNS: {
190
+ 'category.category_id': 'category_id',
191
+ 'category.name': 'name',
192
+ 'category.last_update': 'last_update',
193
+ },
194
+ TYPE_VALIDATION: {
195
+ 'category.category_id': {
196
+ MYSQL_TYPE: 'tinyint',
197
+ MAX_LENGTH: '',
198
+ AUTO_INCREMENT: true,
199
+ SKIP_COLUMN_IN_POST: false
200
+ },
201
+ 'category.name': {
202
+ MYSQL_TYPE: 'varchar',
203
+ MAX_LENGTH: '25',
204
+ AUTO_INCREMENT: false,
205
+ SKIP_COLUMN_IN_POST: false
206
+ },
207
+ 'category.last_update': {
208
+ MYSQL_TYPE: 'timestamp',
209
+ MAX_LENGTH: '',
210
+ AUTO_INCREMENT: false,
211
+ SKIP_COLUMN_IN_POST: false
212
+ },
213
+ },
214
+ REGEX_VALIDATION: {},
215
+ LIFECYCLE_HOOKS: {
216
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
217
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
218
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
219
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
220
+ },
221
+ TABLE_REFERENCES: {},
222
+ TABLE_REFERENCED_BY: {
223
+ 'category_id': [{
224
+ TABLE: 'film_category',
225
+ COLUMN: 'category_id',
226
+ CONSTRAINT: 'fk_film_category_category',
227
+ },],
228
+ }
229
+ };
230
+ const city = {
231
+ TABLE_NAME: 'city',
232
+ CITY_ID: 'city.city_id',
233
+ CITY: 'city.city',
234
+ COUNTRY_ID: 'city.country_id',
235
+ LAST_UPDATE: 'city.last_update',
236
+ PRIMARY: [
237
+ 'city.city_id',
238
+ ],
239
+ PRIMARY_SHORT: [
240
+ 'city_id',
241
+ ],
242
+ COLUMNS: {
243
+ 'city.city_id': 'city_id',
244
+ 'city.city': 'city',
245
+ 'city.country_id': 'country_id',
246
+ 'city.last_update': 'last_update',
247
+ },
248
+ TYPE_VALIDATION: {
249
+ 'city.city_id': {
250
+ MYSQL_TYPE: 'smallint',
251
+ MAX_LENGTH: '',
252
+ AUTO_INCREMENT: true,
253
+ SKIP_COLUMN_IN_POST: false
254
+ },
255
+ 'city.city': {
256
+ MYSQL_TYPE: 'varchar',
257
+ MAX_LENGTH: '50',
258
+ AUTO_INCREMENT: false,
259
+ SKIP_COLUMN_IN_POST: false
260
+ },
261
+ 'city.country_id': {
262
+ MYSQL_TYPE: 'smallint',
263
+ MAX_LENGTH: '',
264
+ AUTO_INCREMENT: false,
265
+ SKIP_COLUMN_IN_POST: false
266
+ },
267
+ 'city.last_update': {
268
+ MYSQL_TYPE: 'timestamp',
269
+ MAX_LENGTH: '',
270
+ AUTO_INCREMENT: false,
271
+ SKIP_COLUMN_IN_POST: false
272
+ },
273
+ },
274
+ REGEX_VALIDATION: {},
275
+ LIFECYCLE_HOOKS: {
276
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
277
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
278
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
279
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
280
+ },
281
+ TABLE_REFERENCES: {
282
+ 'country_id': [{
283
+ TABLE: 'country',
284
+ COLUMN: 'country_id',
285
+ CONSTRAINT: 'fk_city_country',
286
+ },],
287
+ },
288
+ TABLE_REFERENCED_BY: {
289
+ 'city_id': [{
290
+ TABLE: 'address',
291
+ COLUMN: 'city_id',
292
+ CONSTRAINT: 'fk_address_city',
293
+ },],
294
+ }
295
+ };
296
+ const country = {
297
+ TABLE_NAME: 'country',
298
+ COUNTRY_ID: 'country.country_id',
299
+ COUNTRY: 'country.country',
300
+ LAST_UPDATE: 'country.last_update',
301
+ PRIMARY: [
302
+ 'country.country_id',
303
+ ],
304
+ PRIMARY_SHORT: [
305
+ 'country_id',
306
+ ],
307
+ COLUMNS: {
308
+ 'country.country_id': 'country_id',
309
+ 'country.country': 'country',
310
+ 'country.last_update': 'last_update',
311
+ },
312
+ TYPE_VALIDATION: {
313
+ 'country.country_id': {
314
+ MYSQL_TYPE: 'smallint',
315
+ MAX_LENGTH: '',
316
+ AUTO_INCREMENT: true,
317
+ SKIP_COLUMN_IN_POST: false
318
+ },
319
+ 'country.country': {
320
+ MYSQL_TYPE: 'varchar',
321
+ MAX_LENGTH: '50',
322
+ AUTO_INCREMENT: false,
323
+ SKIP_COLUMN_IN_POST: false
324
+ },
325
+ 'country.last_update': {
326
+ MYSQL_TYPE: 'timestamp',
327
+ MAX_LENGTH: '',
328
+ AUTO_INCREMENT: false,
329
+ SKIP_COLUMN_IN_POST: false
330
+ },
331
+ },
332
+ REGEX_VALIDATION: {},
333
+ LIFECYCLE_HOOKS: {
334
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
335
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
336
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
337
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
338
+ },
339
+ TABLE_REFERENCES: {},
340
+ TABLE_REFERENCED_BY: {
341
+ 'country_id': [{
342
+ TABLE: 'city',
343
+ COLUMN: 'country_id',
344
+ CONSTRAINT: 'fk_city_country',
345
+ },],
346
+ }
347
+ };
348
+ const customer = {
349
+ TABLE_NAME: 'customer',
350
+ CUSTOMER_ID: 'customer.customer_id',
351
+ STORE_ID: 'customer.store_id',
352
+ FIRST_NAME: 'customer.first_name',
353
+ LAST_NAME: 'customer.last_name',
354
+ EMAIL: 'customer.email',
355
+ ADDRESS_ID: 'customer.address_id',
356
+ ACTIVE: 'customer.active',
357
+ CREATE_DATE: 'customer.create_date',
358
+ LAST_UPDATE: 'customer.last_update',
359
+ PRIMARY: [
360
+ 'customer.customer_id',
361
+ ],
362
+ PRIMARY_SHORT: [
363
+ 'customer_id',
364
+ ],
365
+ COLUMNS: {
366
+ 'customer.customer_id': 'customer_id',
367
+ 'customer.store_id': 'store_id',
368
+ 'customer.first_name': 'first_name',
369
+ 'customer.last_name': 'last_name',
370
+ 'customer.email': 'email',
371
+ 'customer.address_id': 'address_id',
372
+ 'customer.active': 'active',
373
+ 'customer.create_date': 'create_date',
374
+ 'customer.last_update': 'last_update',
375
+ },
376
+ TYPE_VALIDATION: {
377
+ 'customer.customer_id': {
378
+ MYSQL_TYPE: 'smallint',
379
+ MAX_LENGTH: '',
380
+ AUTO_INCREMENT: true,
381
+ SKIP_COLUMN_IN_POST: false
382
+ },
383
+ 'customer.store_id': {
384
+ MYSQL_TYPE: 'tinyint',
385
+ MAX_LENGTH: '',
386
+ AUTO_INCREMENT: false,
387
+ SKIP_COLUMN_IN_POST: false
388
+ },
389
+ 'customer.first_name': {
390
+ MYSQL_TYPE: 'varchar',
391
+ MAX_LENGTH: '45',
392
+ AUTO_INCREMENT: false,
393
+ SKIP_COLUMN_IN_POST: false
394
+ },
395
+ 'customer.last_name': {
396
+ MYSQL_TYPE: 'varchar',
397
+ MAX_LENGTH: '45',
398
+ AUTO_INCREMENT: false,
399
+ SKIP_COLUMN_IN_POST: false
400
+ },
401
+ 'customer.email': {
402
+ MYSQL_TYPE: 'varchar',
403
+ MAX_LENGTH: '50',
404
+ AUTO_INCREMENT: false,
405
+ SKIP_COLUMN_IN_POST: false
406
+ },
407
+ 'customer.address_id': {
408
+ MYSQL_TYPE: 'smallint',
409
+ MAX_LENGTH: '',
410
+ AUTO_INCREMENT: false,
411
+ SKIP_COLUMN_IN_POST: false
412
+ },
413
+ 'customer.active': {
414
+ MYSQL_TYPE: 'tinyint',
415
+ MAX_LENGTH: '1',
416
+ AUTO_INCREMENT: false,
417
+ SKIP_COLUMN_IN_POST: false
418
+ },
419
+ 'customer.create_date': {
420
+ MYSQL_TYPE: 'datetime',
421
+ MAX_LENGTH: '',
422
+ AUTO_INCREMENT: false,
423
+ SKIP_COLUMN_IN_POST: false
424
+ },
425
+ 'customer.last_update': {
426
+ MYSQL_TYPE: 'timestamp',
427
+ MAX_LENGTH: '',
428
+ AUTO_INCREMENT: false,
429
+ SKIP_COLUMN_IN_POST: false
430
+ },
431
+ },
432
+ REGEX_VALIDATION: {},
433
+ LIFECYCLE_HOOKS: {
434
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
435
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
436
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
437
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
438
+ },
439
+ TABLE_REFERENCES: {
440
+ 'address_id': [{
441
+ TABLE: 'address',
442
+ COLUMN: 'address_id',
443
+ CONSTRAINT: 'fk_customer_address',
444
+ },], 'store_id': [{
445
+ TABLE: 'store',
446
+ COLUMN: 'store_id',
447
+ CONSTRAINT: 'fk_customer_store',
448
+ },],
449
+ },
450
+ TABLE_REFERENCED_BY: {
451
+ 'customer_id': [{
452
+ TABLE: 'payment',
453
+ COLUMN: 'customer_id',
454
+ CONSTRAINT: 'fk_payment_customer',
455
+ }, {
456
+ TABLE: 'rental',
457
+ COLUMN: 'customer_id',
458
+ CONSTRAINT: 'fk_rental_customer',
459
+ },],
460
+ }
461
+ };
462
+ const film = {
463
+ TABLE_NAME: 'film',
464
+ FILM_ID: 'film.film_id',
465
+ TITLE: 'film.title',
466
+ DESCRIPTION: 'film.description',
467
+ RELEASE_YEAR: 'film.release_year',
468
+ LANGUAGE_ID: 'film.language_id',
469
+ ORIGINAL_LANGUAGE_ID: 'film.original_language_id',
470
+ RENTAL_DURATION: 'film.rental_duration',
471
+ RENTAL_RATE: 'film.rental_rate',
472
+ LENGTH: 'film.length',
473
+ REPLACEMENT_COST: 'film.replacement_cost',
474
+ RATING: 'film.rating',
475
+ SPECIAL_FEATURES: 'film.special_features',
476
+ LAST_UPDATE: 'film.last_update',
477
+ PRIMARY: [
478
+ 'film.film_id',
479
+ ],
480
+ PRIMARY_SHORT: [
481
+ 'film_id',
482
+ ],
483
+ COLUMNS: {
484
+ 'film.film_id': 'film_id',
485
+ 'film.title': 'title',
486
+ 'film.description': 'description',
487
+ 'film.release_year': 'release_year',
488
+ 'film.language_id': 'language_id',
489
+ 'film.original_language_id': 'original_language_id',
490
+ 'film.rental_duration': 'rental_duration',
491
+ 'film.rental_rate': 'rental_rate',
492
+ 'film.length': 'length',
493
+ 'film.replacement_cost': 'replacement_cost',
494
+ 'film.rating': 'rating',
495
+ 'film.special_features': 'special_features',
496
+ 'film.last_update': 'last_update',
497
+ },
498
+ TYPE_VALIDATION: {
499
+ 'film.film_id': {
500
+ MYSQL_TYPE: 'smallint',
501
+ MAX_LENGTH: '',
502
+ AUTO_INCREMENT: true,
503
+ SKIP_COLUMN_IN_POST: false
504
+ },
505
+ 'film.title': {
506
+ MYSQL_TYPE: 'varchar',
507
+ MAX_LENGTH: '128',
508
+ AUTO_INCREMENT: false,
509
+ SKIP_COLUMN_IN_POST: false
510
+ },
511
+ 'film.description': {
512
+ MYSQL_TYPE: 'text',
513
+ MAX_LENGTH: '',
514
+ AUTO_INCREMENT: false,
515
+ SKIP_COLUMN_IN_POST: true
516
+ },
517
+ 'film.release_year': {
518
+ MYSQL_TYPE: 'year',
519
+ MAX_LENGTH: '',
520
+ AUTO_INCREMENT: false,
521
+ SKIP_COLUMN_IN_POST: false
522
+ },
523
+ 'film.language_id': {
524
+ MYSQL_TYPE: 'tinyint',
525
+ MAX_LENGTH: '',
526
+ AUTO_INCREMENT: false,
527
+ SKIP_COLUMN_IN_POST: false
528
+ },
529
+ 'film.original_language_id': {
530
+ MYSQL_TYPE: 'tinyint',
531
+ MAX_LENGTH: '',
532
+ AUTO_INCREMENT: false,
533
+ SKIP_COLUMN_IN_POST: false
534
+ },
535
+ 'film.rental_duration': {
536
+ MYSQL_TYPE: 'tinyint',
537
+ MAX_LENGTH: '',
538
+ AUTO_INCREMENT: false,
539
+ SKIP_COLUMN_IN_POST: false
540
+ },
541
+ 'film.rental_rate': {
542
+ MYSQL_TYPE: 'decimal',
543
+ MAX_LENGTH: '4,2',
544
+ AUTO_INCREMENT: false,
545
+ SKIP_COLUMN_IN_POST: false
546
+ },
547
+ 'film.length': {
548
+ MYSQL_TYPE: 'smallint',
549
+ MAX_LENGTH: '',
550
+ AUTO_INCREMENT: false,
551
+ SKIP_COLUMN_IN_POST: false
552
+ },
553
+ 'film.replacement_cost': {
554
+ MYSQL_TYPE: 'decimal',
555
+ MAX_LENGTH: '5,2',
556
+ AUTO_INCREMENT: false,
557
+ SKIP_COLUMN_IN_POST: false
558
+ },
559
+ 'film.rating': {
560
+ MYSQL_TYPE: 'enum',
561
+ MAX_LENGTH: ''G','PG','PG-13','R','NC-17'',
562
+ AUTO_INCREMENT: false,
563
+ SKIP_COLUMN_IN_POST: false
564
+ },
565
+ 'film.special_features': {
566
+ MYSQL_TYPE: 'set',
567
+ MAX_LENGTH: ''Trailers','Commentaries','Deleted Scenes','Behind the Scenes'',
568
+ AUTO_INCREMENT: false,
569
+ SKIP_COLUMN_IN_POST: false
570
+ },
571
+ 'film.last_update': {
572
+ MYSQL_TYPE: 'timestamp',
573
+ MAX_LENGTH: '',
574
+ AUTO_INCREMENT: false,
575
+ SKIP_COLUMN_IN_POST: false
576
+ },
577
+ },
578
+ REGEX_VALIDATION: {},
579
+ LIFECYCLE_HOOKS: {
580
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
581
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
582
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
583
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
584
+ },
585
+ TABLE_REFERENCES: {
586
+ 'language_id': [{
587
+ TABLE: 'language',
588
+ COLUMN: 'language_id',
589
+ CONSTRAINT: 'fk_film_language',
590
+ },], 'original_language_id': [{
591
+ TABLE: 'language',
592
+ COLUMN: 'language_id',
593
+ CONSTRAINT: 'fk_film_language_original',
594
+ },],
595
+ },
596
+ TABLE_REFERENCED_BY: {
597
+ 'film_id': [{
598
+ TABLE: 'film_actor',
599
+ COLUMN: 'film_id',
600
+ CONSTRAINT: 'fk_film_actor_film',
601
+ }, {
602
+ TABLE: 'film_category',
603
+ COLUMN: 'film_id',
604
+ CONSTRAINT: 'fk_film_category_film',
605
+ }, {
606
+ TABLE: 'inventory',
607
+ COLUMN: 'film_id',
608
+ CONSTRAINT: 'fk_inventory_film',
609
+ },],
610
+ }
611
+ };
612
+ const film_actor = {
613
+ TABLE_NAME: 'film_actor',
614
+ ACTOR_ID: 'film_actor.actor_id',
615
+ FILM_ID: 'film_actor.film_id',
616
+ LAST_UPDATE: 'film_actor.last_update',
617
+ PRIMARY: [
618
+ 'film_actor.actor_id',
619
+ 'film_actor.film_id',
620
+ ],
621
+ PRIMARY_SHORT: [
622
+ 'actor_id',
623
+ 'film_id',
624
+ ],
625
+ COLUMNS: {
626
+ 'film_actor.actor_id': 'actor_id',
627
+ 'film_actor.film_id': 'film_id',
628
+ 'film_actor.last_update': 'last_update',
629
+ },
630
+ TYPE_VALIDATION: {
631
+ 'film_actor.actor_id': {
632
+ MYSQL_TYPE: 'smallint',
633
+ MAX_LENGTH: '',
634
+ AUTO_INCREMENT: false,
635
+ SKIP_COLUMN_IN_POST: false
636
+ },
637
+ 'film_actor.film_id': {
638
+ MYSQL_TYPE: 'smallint',
639
+ MAX_LENGTH: '',
640
+ AUTO_INCREMENT: false,
641
+ SKIP_COLUMN_IN_POST: false
642
+ },
643
+ 'film_actor.last_update': {
644
+ MYSQL_TYPE: 'timestamp',
645
+ MAX_LENGTH: '',
646
+ AUTO_INCREMENT: false,
647
+ SKIP_COLUMN_IN_POST: false
648
+ },
649
+ },
650
+ REGEX_VALIDATION: {},
651
+ LIFECYCLE_HOOKS: {
652
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
653
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
654
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
655
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
656
+ },
657
+ TABLE_REFERENCES: {
658
+ 'actor_id': [{
659
+ TABLE: 'actor',
660
+ COLUMN: 'actor_id',
661
+ CONSTRAINT: 'fk_film_actor_actor',
662
+ },], 'film_id': [{
663
+ TABLE: 'film',
664
+ COLUMN: 'film_id',
665
+ CONSTRAINT: 'fk_film_actor_film',
666
+ },],
667
+ },
668
+ TABLE_REFERENCED_BY: {}
669
+ };
670
+ const film_category = {
671
+ TABLE_NAME: 'film_category',
672
+ FILM_ID: 'film_category.film_id',
673
+ CATEGORY_ID: 'film_category.category_id',
674
+ LAST_UPDATE: 'film_category.last_update',
675
+ PRIMARY: [
676
+ 'film_category.film_id',
677
+ 'film_category.category_id',
678
+ ],
679
+ PRIMARY_SHORT: [
680
+ 'film_id',
681
+ 'category_id',
682
+ ],
683
+ COLUMNS: {
684
+ 'film_category.film_id': 'film_id',
685
+ 'film_category.category_id': 'category_id',
686
+ 'film_category.last_update': 'last_update',
687
+ },
688
+ TYPE_VALIDATION: {
689
+ 'film_category.film_id': {
690
+ MYSQL_TYPE: 'smallint',
691
+ MAX_LENGTH: '',
692
+ AUTO_INCREMENT: false,
693
+ SKIP_COLUMN_IN_POST: false
694
+ },
695
+ 'film_category.category_id': {
696
+ MYSQL_TYPE: 'tinyint',
697
+ MAX_LENGTH: '',
698
+ AUTO_INCREMENT: false,
699
+ SKIP_COLUMN_IN_POST: false
700
+ },
701
+ 'film_category.last_update': {
702
+ MYSQL_TYPE: 'timestamp',
703
+ MAX_LENGTH: '',
704
+ AUTO_INCREMENT: false,
705
+ SKIP_COLUMN_IN_POST: false
706
+ },
707
+ },
708
+ REGEX_VALIDATION: {},
709
+ LIFECYCLE_HOOKS: {
710
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
711
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
712
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
713
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
714
+ },
715
+ TABLE_REFERENCES: {
716
+ 'category_id': [{
717
+ TABLE: 'category',
718
+ COLUMN: 'category_id',
719
+ CONSTRAINT: 'fk_film_category_category',
720
+ },], 'film_id': [{
721
+ TABLE: 'film',
722
+ COLUMN: 'film_id',
723
+ CONSTRAINT: 'fk_film_category_film',
724
+ },],
725
+ },
726
+ TABLE_REFERENCED_BY: {}
727
+ };
728
+ const film_text = {
729
+ TABLE_NAME: 'film_text',
730
+ FILM_ID: 'film_text.film_id',
731
+ TITLE: 'film_text.title',
732
+ DESCRIPTION: 'film_text.description',
733
+ PRIMARY: [
734
+ 'film_text.film_id',
735
+ ],
736
+ PRIMARY_SHORT: [
737
+ 'film_id',
738
+ ],
739
+ COLUMNS: {
740
+ 'film_text.film_id': 'film_id',
741
+ 'film_text.title': 'title',
742
+ 'film_text.description': 'description',
743
+ },
744
+ TYPE_VALIDATION: {
745
+ 'film_text.film_id': {
746
+ MYSQL_TYPE: 'smallint',
747
+ MAX_LENGTH: '',
748
+ AUTO_INCREMENT: false,
749
+ SKIP_COLUMN_IN_POST: false
750
+ },
751
+ 'film_text.title': {
752
+ MYSQL_TYPE: 'varchar',
753
+ MAX_LENGTH: '255',
754
+ AUTO_INCREMENT: false,
755
+ SKIP_COLUMN_IN_POST: false
756
+ },
757
+ 'film_text.description': {
758
+ MYSQL_TYPE: 'text',
759
+ MAX_LENGTH: '',
760
+ AUTO_INCREMENT: false,
761
+ SKIP_COLUMN_IN_POST: true
762
+ },
763
+ },
764
+ REGEX_VALIDATION: {},
765
+ LIFECYCLE_HOOKS: {
766
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
767
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
768
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
769
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
770
+ },
771
+ TABLE_REFERENCES: {},
772
+ TABLE_REFERENCED_BY: {}
773
+ };
774
+ const inventory = {
775
+ TABLE_NAME: 'inventory',
776
+ INVENTORY_ID: 'inventory.inventory_id',
777
+ FILM_ID: 'inventory.film_id',
778
+ STORE_ID: 'inventory.store_id',
779
+ LAST_UPDATE: 'inventory.last_update',
780
+ PRIMARY: [
781
+ 'inventory.inventory_id',
782
+ ],
783
+ PRIMARY_SHORT: [
784
+ 'inventory_id',
785
+ ],
786
+ COLUMNS: {
787
+ 'inventory.inventory_id': 'inventory_id',
788
+ 'inventory.film_id': 'film_id',
789
+ 'inventory.store_id': 'store_id',
790
+ 'inventory.last_update': 'last_update',
791
+ },
792
+ TYPE_VALIDATION: {
793
+ 'inventory.inventory_id': {
794
+ MYSQL_TYPE: 'mediumint',
795
+ MAX_LENGTH: '',
796
+ AUTO_INCREMENT: true,
797
+ SKIP_COLUMN_IN_POST: false
798
+ },
799
+ 'inventory.film_id': {
800
+ MYSQL_TYPE: 'smallint',
801
+ MAX_LENGTH: '',
802
+ AUTO_INCREMENT: false,
803
+ SKIP_COLUMN_IN_POST: false
804
+ },
805
+ 'inventory.store_id': {
806
+ MYSQL_TYPE: 'tinyint',
807
+ MAX_LENGTH: '',
808
+ AUTO_INCREMENT: false,
809
+ SKIP_COLUMN_IN_POST: false
810
+ },
811
+ 'inventory.last_update': {
812
+ MYSQL_TYPE: 'timestamp',
813
+ MAX_LENGTH: '',
814
+ AUTO_INCREMENT: false,
815
+ SKIP_COLUMN_IN_POST: false
816
+ },
817
+ },
818
+ REGEX_VALIDATION: {},
819
+ LIFECYCLE_HOOKS: {
820
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
821
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
822
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
823
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
824
+ },
825
+ TABLE_REFERENCES: {
826
+ 'film_id': [{
827
+ TABLE: 'film',
828
+ COLUMN: 'film_id',
829
+ CONSTRAINT: 'fk_inventory_film',
830
+ },], 'store_id': [{
831
+ TABLE: 'store',
832
+ COLUMN: 'store_id',
833
+ CONSTRAINT: 'fk_inventory_store',
834
+ },],
835
+ },
836
+ TABLE_REFERENCED_BY: {
837
+ 'inventory_id': [{
838
+ TABLE: 'rental',
839
+ COLUMN: 'inventory_id',
840
+ CONSTRAINT: 'fk_rental_inventory',
841
+ },],
842
+ }
843
+ };
844
+ const language = {
845
+ TABLE_NAME: 'language',
846
+ LANGUAGE_ID: 'language.language_id',
847
+ NAME: 'language.name',
848
+ LAST_UPDATE: 'language.last_update',
849
+ PRIMARY: [
850
+ 'language.language_id',
851
+ ],
852
+ PRIMARY_SHORT: [
853
+ 'language_id',
854
+ ],
855
+ COLUMNS: {
856
+ 'language.language_id': 'language_id',
857
+ 'language.name': 'name',
858
+ 'language.last_update': 'last_update',
859
+ },
860
+ TYPE_VALIDATION: {
861
+ 'language.language_id': {
862
+ MYSQL_TYPE: 'tinyint',
863
+ MAX_LENGTH: '',
864
+ AUTO_INCREMENT: true,
865
+ SKIP_COLUMN_IN_POST: false
866
+ },
867
+ 'language.name': {
868
+ MYSQL_TYPE: 'char',
869
+ MAX_LENGTH: '20',
870
+ AUTO_INCREMENT: false,
871
+ SKIP_COLUMN_IN_POST: false
872
+ },
873
+ 'language.last_update': {
874
+ MYSQL_TYPE: 'timestamp',
875
+ MAX_LENGTH: '',
876
+ AUTO_INCREMENT: false,
877
+ SKIP_COLUMN_IN_POST: false
878
+ },
879
+ },
880
+ REGEX_VALIDATION: {},
881
+ LIFECYCLE_HOOKS: {
882
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
883
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
884
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
885
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
886
+ },
887
+ TABLE_REFERENCES: {},
888
+ TABLE_REFERENCED_BY: {
889
+ 'language_id': [{
890
+ TABLE: 'film',
891
+ COLUMN: 'language_id',
892
+ CONSTRAINT: 'fk_film_language',
893
+ }, {
894
+ TABLE: 'film',
895
+ COLUMN: 'original_language_id',
896
+ CONSTRAINT: 'fk_film_language_original',
897
+ },],
898
+ }
899
+ };
900
+ const payment = {
901
+ TABLE_NAME: 'payment',
902
+ PAYMENT_ID: 'payment.payment_id',
903
+ CUSTOMER_ID: 'payment.customer_id',
904
+ STAFF_ID: 'payment.staff_id',
905
+ RENTAL_ID: 'payment.rental_id',
906
+ AMOUNT: 'payment.amount',
907
+ PAYMENT_DATE: 'payment.payment_date',
908
+ LAST_UPDATE: 'payment.last_update',
909
+ PRIMARY: [
910
+ 'payment.payment_id',
911
+ ],
912
+ PRIMARY_SHORT: [
913
+ 'payment_id',
914
+ ],
915
+ COLUMNS: {
916
+ 'payment.payment_id': 'payment_id',
917
+ 'payment.customer_id': 'customer_id',
918
+ 'payment.staff_id': 'staff_id',
919
+ 'payment.rental_id': 'rental_id',
920
+ 'payment.amount': 'amount',
921
+ 'payment.payment_date': 'payment_date',
922
+ 'payment.last_update': 'last_update',
923
+ },
924
+ TYPE_VALIDATION: {
925
+ 'payment.payment_id': {
926
+ MYSQL_TYPE: 'smallint',
927
+ MAX_LENGTH: '',
928
+ AUTO_INCREMENT: true,
929
+ SKIP_COLUMN_IN_POST: false
930
+ },
931
+ 'payment.customer_id': {
932
+ MYSQL_TYPE: 'smallint',
933
+ MAX_LENGTH: '',
934
+ AUTO_INCREMENT: false,
935
+ SKIP_COLUMN_IN_POST: false
936
+ },
937
+ 'payment.staff_id': {
938
+ MYSQL_TYPE: 'tinyint',
939
+ MAX_LENGTH: '',
940
+ AUTO_INCREMENT: false,
941
+ SKIP_COLUMN_IN_POST: false
942
+ },
943
+ 'payment.rental_id': {
944
+ MYSQL_TYPE: 'int',
945
+ MAX_LENGTH: '',
946
+ AUTO_INCREMENT: false,
947
+ SKIP_COLUMN_IN_POST: false
948
+ },
949
+ 'payment.amount': {
950
+ MYSQL_TYPE: 'decimal',
951
+ MAX_LENGTH: '5,2',
952
+ AUTO_INCREMENT: false,
953
+ SKIP_COLUMN_IN_POST: false
954
+ },
955
+ 'payment.payment_date': {
956
+ MYSQL_TYPE: 'datetime',
957
+ MAX_LENGTH: '',
958
+ AUTO_INCREMENT: false,
959
+ SKIP_COLUMN_IN_POST: false
960
+ },
961
+ 'payment.last_update': {
962
+ MYSQL_TYPE: 'timestamp',
963
+ MAX_LENGTH: '',
964
+ AUTO_INCREMENT: false,
965
+ SKIP_COLUMN_IN_POST: false
966
+ },
967
+ },
968
+ REGEX_VALIDATION: {},
969
+ LIFECYCLE_HOOKS: {
970
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
971
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
972
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
973
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
974
+ },
975
+ TABLE_REFERENCES: {
976
+ 'customer_id': [{
977
+ TABLE: 'customer',
978
+ COLUMN: 'customer_id',
979
+ CONSTRAINT: 'fk_payment_customer',
980
+ },], 'rental_id': [{
981
+ TABLE: 'rental',
982
+ COLUMN: 'rental_id',
983
+ CONSTRAINT: 'fk_payment_rental',
984
+ },], 'staff_id': [{
985
+ TABLE: 'staff',
986
+ COLUMN: 'staff_id',
987
+ CONSTRAINT: 'fk_payment_staff',
988
+ },],
989
+ },
990
+ TABLE_REFERENCED_BY: {}
991
+ };
992
+ const rental = {
993
+ TABLE_NAME: 'rental',
994
+ RENTAL_ID: 'rental.rental_id',
995
+ RENTAL_DATE: 'rental.rental_date',
996
+ INVENTORY_ID: 'rental.inventory_id',
997
+ CUSTOMER_ID: 'rental.customer_id',
998
+ RETURN_DATE: 'rental.return_date',
999
+ STAFF_ID: 'rental.staff_id',
1000
+ LAST_UPDATE: 'rental.last_update',
1001
+ PRIMARY: [
1002
+ 'rental.rental_id',
1003
+ ],
1004
+ PRIMARY_SHORT: [
1005
+ 'rental_id',
1006
+ ],
1007
+ COLUMNS: {
1008
+ 'rental.rental_id': 'rental_id',
1009
+ 'rental.rental_date': 'rental_date',
1010
+ 'rental.inventory_id': 'inventory_id',
1011
+ 'rental.customer_id': 'customer_id',
1012
+ 'rental.return_date': 'return_date',
1013
+ 'rental.staff_id': 'staff_id',
1014
+ 'rental.last_update': 'last_update',
1015
+ },
1016
+ TYPE_VALIDATION: {
1017
+ 'rental.rental_id': {
1018
+ MYSQL_TYPE: 'int',
1019
+ MAX_LENGTH: '',
1020
+ AUTO_INCREMENT: true,
1021
+ SKIP_COLUMN_IN_POST: false
1022
+ },
1023
+ 'rental.rental_date': {
1024
+ MYSQL_TYPE: 'datetime',
1025
+ MAX_LENGTH: '',
1026
+ AUTO_INCREMENT: false,
1027
+ SKIP_COLUMN_IN_POST: false
1028
+ },
1029
+ 'rental.inventory_id': {
1030
+ MYSQL_TYPE: 'mediumint',
1031
+ MAX_LENGTH: '',
1032
+ AUTO_INCREMENT: false,
1033
+ SKIP_COLUMN_IN_POST: false
1034
+ },
1035
+ 'rental.customer_id': {
1036
+ MYSQL_TYPE: 'smallint',
1037
+ MAX_LENGTH: '',
1038
+ AUTO_INCREMENT: false,
1039
+ SKIP_COLUMN_IN_POST: false
1040
+ },
1041
+ 'rental.return_date': {
1042
+ MYSQL_TYPE: 'datetime',
1043
+ MAX_LENGTH: '',
1044
+ AUTO_INCREMENT: false,
1045
+ SKIP_COLUMN_IN_POST: false
1046
+ },
1047
+ 'rental.staff_id': {
1048
+ MYSQL_TYPE: 'tinyint',
1049
+ MAX_LENGTH: '',
1050
+ AUTO_INCREMENT: false,
1051
+ SKIP_COLUMN_IN_POST: false
1052
+ },
1053
+ 'rental.last_update': {
1054
+ MYSQL_TYPE: 'timestamp',
1055
+ MAX_LENGTH: '',
1056
+ AUTO_INCREMENT: false,
1057
+ SKIP_COLUMN_IN_POST: false
1058
+ },
1059
+ },
1060
+ REGEX_VALIDATION: {},
1061
+ LIFECYCLE_HOOKS: {
1062
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1063
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1064
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1065
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1066
+ },
1067
+ TABLE_REFERENCES: {
1068
+ 'customer_id': [{
1069
+ TABLE: 'customer',
1070
+ COLUMN: 'customer_id',
1071
+ CONSTRAINT: 'fk_rental_customer',
1072
+ },], 'inventory_id': [{
1073
+ TABLE: 'inventory',
1074
+ COLUMN: 'inventory_id',
1075
+ CONSTRAINT: 'fk_rental_inventory',
1076
+ },], 'staff_id': [{
1077
+ TABLE: 'staff',
1078
+ COLUMN: 'staff_id',
1079
+ CONSTRAINT: 'fk_rental_staff',
1080
+ },],
1081
+ },
1082
+ TABLE_REFERENCED_BY: {
1083
+ 'rental_id': [{
1084
+ TABLE: 'payment',
1085
+ COLUMN: 'rental_id',
1086
+ CONSTRAINT: 'fk_payment_rental',
1087
+ },],
1088
+ }
1089
+ };
1090
+ const staff = {
1091
+ TABLE_NAME: 'staff',
1092
+ STAFF_ID: 'staff.staff_id',
1093
+ FIRST_NAME: 'staff.first_name',
1094
+ LAST_NAME: 'staff.last_name',
1095
+ ADDRESS_ID: 'staff.address_id',
1096
+ PICTURE: 'staff.picture',
1097
+ EMAIL: 'staff.email',
1098
+ STORE_ID: 'staff.store_id',
1099
+ ACTIVE: 'staff.active',
1100
+ USERNAME: 'staff.username',
1101
+ PASSWORD: 'staff.password',
1102
+ LAST_UPDATE: 'staff.last_update',
1103
+ PRIMARY: [
1104
+ 'staff.staff_id',
1105
+ ],
1106
+ PRIMARY_SHORT: [
1107
+ 'staff_id',
1108
+ ],
1109
+ COLUMNS: {
1110
+ 'staff.staff_id': 'staff_id',
1111
+ 'staff.first_name': 'first_name',
1112
+ 'staff.last_name': 'last_name',
1113
+ 'staff.address_id': 'address_id',
1114
+ 'staff.picture': 'picture',
1115
+ 'staff.email': 'email',
1116
+ 'staff.store_id': 'store_id',
1117
+ 'staff.active': 'active',
1118
+ 'staff.username': 'username',
1119
+ 'staff.password': 'password',
1120
+ 'staff.last_update': 'last_update',
1121
+ },
1122
+ TYPE_VALIDATION: {
1123
+ 'staff.staff_id': {
1124
+ MYSQL_TYPE: 'tinyint',
1125
+ MAX_LENGTH: '',
1126
+ AUTO_INCREMENT: true,
1127
+ SKIP_COLUMN_IN_POST: false
1128
+ },
1129
+ 'staff.first_name': {
1130
+ MYSQL_TYPE: 'varchar',
1131
+ MAX_LENGTH: '45',
1132
+ AUTO_INCREMENT: false,
1133
+ SKIP_COLUMN_IN_POST: false
1134
+ },
1135
+ 'staff.last_name': {
1136
+ MYSQL_TYPE: 'varchar',
1137
+ MAX_LENGTH: '45',
1138
+ AUTO_INCREMENT: false,
1139
+ SKIP_COLUMN_IN_POST: false
1140
+ },
1141
+ 'staff.address_id': {
1142
+ MYSQL_TYPE: 'smallint',
1143
+ MAX_LENGTH: '',
1144
+ AUTO_INCREMENT: false,
1145
+ SKIP_COLUMN_IN_POST: false
1146
+ },
1147
+ 'staff.picture': {
1148
+ MYSQL_TYPE: 'blob',
1149
+ MAX_LENGTH: '',
1150
+ AUTO_INCREMENT: false,
1151
+ SKIP_COLUMN_IN_POST: true
1152
+ },
1153
+ 'staff.email': {
1154
+ MYSQL_TYPE: 'varchar',
1155
+ MAX_LENGTH: '50',
1156
+ AUTO_INCREMENT: false,
1157
+ SKIP_COLUMN_IN_POST: false
1158
+ },
1159
+ 'staff.store_id': {
1160
+ MYSQL_TYPE: 'tinyint',
1161
+ MAX_LENGTH: '',
1162
+ AUTO_INCREMENT: false,
1163
+ SKIP_COLUMN_IN_POST: false
1164
+ },
1165
+ 'staff.active': {
1166
+ MYSQL_TYPE: 'tinyint',
1167
+ MAX_LENGTH: '1',
1168
+ AUTO_INCREMENT: false,
1169
+ SKIP_COLUMN_IN_POST: false
1170
+ },
1171
+ 'staff.username': {
1172
+ MYSQL_TYPE: 'varchar',
1173
+ MAX_LENGTH: '16',
1174
+ AUTO_INCREMENT: false,
1175
+ SKIP_COLUMN_IN_POST: false
1176
+ },
1177
+ 'staff.password': {
1178
+ MYSQL_TYPE: 'varchar',
1179
+ MAX_LENGTH: '40',
1180
+ AUTO_INCREMENT: false,
1181
+ SKIP_COLUMN_IN_POST: true
1182
+ },
1183
+ 'staff.last_update': {
1184
+ MYSQL_TYPE: 'timestamp',
1185
+ MAX_LENGTH: '',
1186
+ AUTO_INCREMENT: false,
1187
+ SKIP_COLUMN_IN_POST: false
1188
+ },
1189
+ },
1190
+ REGEX_VALIDATION: {},
1191
+ LIFECYCLE_HOOKS: {
1192
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1193
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1194
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1195
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1196
+ },
1197
+ TABLE_REFERENCES: {
1198
+ 'address_id': [{
1199
+ TABLE: 'address',
1200
+ COLUMN: 'address_id',
1201
+ CONSTRAINT: 'fk_staff_address',
1202
+ },], 'store_id': [{
1203
+ TABLE: 'store',
1204
+ COLUMN: 'store_id',
1205
+ CONSTRAINT: 'fk_staff_store',
1206
+ },],
1207
+ },
1208
+ TABLE_REFERENCED_BY: {
1209
+ 'staff_id': [{
1210
+ TABLE: 'payment',
1211
+ COLUMN: 'staff_id',
1212
+ CONSTRAINT: 'fk_payment_staff',
1213
+ }, {
1214
+ TABLE: 'rental',
1215
+ COLUMN: 'staff_id',
1216
+ CONSTRAINT: 'fk_rental_staff',
1217
+ }, {
1218
+ TABLE: 'store',
1219
+ COLUMN: 'manager_staff_id',
1220
+ CONSTRAINT: 'fk_store_staff',
1221
+ },],
1222
+ }
1223
+ };
1224
+ const store = {
1225
+ TABLE_NAME: 'store',
1226
+ STORE_ID: 'store.store_id',
1227
+ MANAGER_STAFF_ID: 'store.manager_staff_id',
1228
+ ADDRESS_ID: 'store.address_id',
1229
+ LAST_UPDATE: 'store.last_update',
1230
+ PRIMARY: [
1231
+ 'store.store_id',
1232
+ ],
1233
+ PRIMARY_SHORT: [
1234
+ 'store_id',
1235
+ ],
1236
+ COLUMNS: {
1237
+ 'store.store_id': 'store_id',
1238
+ 'store.manager_staff_id': 'manager_staff_id',
1239
+ 'store.address_id': 'address_id',
1240
+ 'store.last_update': 'last_update',
1241
+ },
1242
+ TYPE_VALIDATION: {
1243
+ 'store.store_id': {
1244
+ MYSQL_TYPE: 'tinyint',
1245
+ MAX_LENGTH: '',
1246
+ AUTO_INCREMENT: true,
1247
+ SKIP_COLUMN_IN_POST: false
1248
+ },
1249
+ 'store.manager_staff_id': {
1250
+ MYSQL_TYPE: 'tinyint',
1251
+ MAX_LENGTH: '',
1252
+ AUTO_INCREMENT: false,
1253
+ SKIP_COLUMN_IN_POST: false
1254
+ },
1255
+ 'store.address_id': {
1256
+ MYSQL_TYPE: 'smallint',
1257
+ MAX_LENGTH: '',
1258
+ AUTO_INCREMENT: false,
1259
+ SKIP_COLUMN_IN_POST: false
1260
+ },
1261
+ 'store.last_update': {
1262
+ MYSQL_TYPE: 'timestamp',
1263
+ MAX_LENGTH: '',
1264
+ AUTO_INCREMENT: false,
1265
+ SKIP_COLUMN_IN_POST: false
1266
+ },
1267
+ },
1268
+ REGEX_VALIDATION: {},
1269
+ LIFECYCLE_HOOKS: {
1270
+ GET: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1271
+ PUT: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1272
+ POST: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1273
+ DELETE: { beforeProcessing: {}, beforeExecution: {}, afterExecution: {}, afterCommit: {} },
1274
+ },
1275
+ TABLE_REFERENCES: {
1276
+ 'address_id': [{
1277
+ TABLE: 'address',
1278
+ COLUMN: 'address_id',
1279
+ CONSTRAINT: 'fk_store_address',
1280
+ },], 'manager_staff_id': [{
1281
+ TABLE: 'staff',
1282
+ COLUMN: 'staff_id',
1283
+ CONSTRAINT: 'fk_store_staff',
1284
+ },],
1285
+ },
1286
+ TABLE_REFERENCED_BY: {
1287
+ 'store_id': [{
1288
+ TABLE: 'customer',
1289
+ COLUMN: 'store_id',
1290
+ CONSTRAINT: 'fk_customer_store',
1291
+ }, {
1292
+ TABLE: 'inventory',
1293
+ COLUMN: 'store_id',
1294
+ CONSTRAINT: 'fk_inventory_store',
1295
+ }, {
1296
+ TABLE: 'staff',
1297
+ COLUMN: 'store_id',
1298
+ CONSTRAINT: 'fk_staff_store',
1299
+ },],
1300
+ }
1301
+ };
1302
+ export const TABLES = {
1303
+ actor, address, category, city, country, customer, film, film_actor, film_category, film_text, inventory, language, payment, rental, staff, store,
1304
+ };
1305
+ export const C6 = {
1306
+ ...C6Constants,
1307
+ C6VERSION: '3.7.7',
1308
+ IMPORT: async (tableName) => {
1309
+ tableName = tableName.toLowerCase();
1310
+ // if tableName is not a key in the TABLES object then throw an error
1311
+ if (!TABLES[tableName]) {
1312
+ const error = (table) => {
1313
+ throw Error('Table (' + table + ') does not exist in the TABLES object. Possible values include (' + Object.keys(TABLES).join(', ') + ')');
1314
+ };
1315
+ if (!tableName.startsWith(RestTablePrefix.toLowerCase())) {
1316
+ error(tableName);
1317
+ }
1318
+ tableName = removePrefixIfExists(tableName, RestTablePrefix);
1319
+ if (!TABLES[tableName]) {
1320
+ error(tableName);
1321
+ }
1322
+ }
1323
+ // This will rightfully throw a dynamic import warning in the console, but it is necessary to use dynamic imports
1324
+ return import(/* @vite-ignore */ './' + (tableName.split('_')
1325
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
1326
+ .join('_')) + '.ts');
1327
+ },
1328
+ PREFIX: RestTablePrefix,
1329
+ TABLES: TABLES,
1330
+ ORM: {},
1331
+ ...TABLES
1332
+ };
1333
+ export const initialRestfulObjectsState = {
1334
+ actor: undefined,
1335
+ address: undefined,
1336
+ category: undefined,
1337
+ city: undefined,
1338
+ country: undefined,
1339
+ customer: undefined,
1340
+ film: undefined,
1341
+ film_actor: undefined,
1342
+ film_category: undefined,
1343
+ film_text: undefined,
1344
+ inventory: undefined,
1345
+ language: undefined,
1346
+ payment: undefined,
1347
+ rental: undefined,
1348
+ staff: undefined,
1349
+ store: undefined,
1350
+ };
1351
+ export const COLUMNS = {
1352
+ 'actor.actor_id': 'actor_id', 'actor.first_name': 'first_name', 'actor.last_name': 'last_name', 'actor.last_update': 'last_update',
1353
+ 'address.address_id': 'address_id', 'address.address': 'address', 'address.address2': 'address2', 'address.district': 'district', 'address.city_id': 'city_id', 'address.postal_code': 'postal_code', 'address.phone': 'phone', 'address.location': 'location', 'address.last_update': 'last_update',
1354
+ 'category.category_id': 'category_id', 'category.name': 'name', 'category.last_update': 'last_update',
1355
+ 'city.city_id': 'city_id', 'city.city': 'city', 'city.country_id': 'country_id', 'city.last_update': 'last_update',
1356
+ 'country.country_id': 'country_id', 'country.country': 'country', 'country.last_update': 'last_update',
1357
+ 'customer.customer_id': 'customer_id', 'customer.store_id': 'store_id', 'customer.first_name': 'first_name', 'customer.last_name': 'last_name', 'customer.email': 'email', 'customer.address_id': 'address_id', 'customer.active': 'active', 'customer.create_date': 'create_date', 'customer.last_update': 'last_update',
1358
+ 'film.film_id': 'film_id', 'film.title': 'title', 'film.description': 'description', 'film.release_year': 'release_year', 'film.language_id': 'language_id', 'film.original_language_id': 'original_language_id', 'film.rental_duration': 'rental_duration', 'film.rental_rate': 'rental_rate', 'film.length': 'length', 'film.replacement_cost': 'replacement_cost', 'film.rating': 'rating', 'film.special_features': 'special_features', 'film.last_update': 'last_update',
1359
+ 'film_actor.actor_id': 'actor_id', 'film_actor.film_id': 'film_id', 'film_actor.last_update': 'last_update',
1360
+ 'film_category.film_id': 'film_id', 'film_category.category_id': 'category_id', 'film_category.last_update': 'last_update',
1361
+ 'film_text.film_id': 'film_id', 'film_text.title': 'title', 'film_text.description': 'description',
1362
+ 'inventory.inventory_id': 'inventory_id', 'inventory.film_id': 'film_id', 'inventory.store_id': 'store_id', 'inventory.last_update': 'last_update',
1363
+ 'language.language_id': 'language_id', 'language.name': 'name', 'language.last_update': 'last_update',
1364
+ 'payment.payment_id': 'payment_id', 'payment.customer_id': 'customer_id', 'payment.staff_id': 'staff_id', 'payment.rental_id': 'rental_id', 'payment.amount': 'amount', 'payment.payment_date': 'payment_date', 'payment.last_update': 'last_update',
1365
+ 'rental.rental_id': 'rental_id', 'rental.rental_date': 'rental_date', 'rental.inventory_id': 'inventory_id', 'rental.customer_id': 'customer_id', 'rental.return_date': 'return_date', 'rental.staff_id': 'staff_id', 'rental.last_update': 'last_update',
1366
+ 'staff.staff_id': 'staff_id', 'staff.first_name': 'first_name', 'staff.last_name': 'last_name', 'staff.address_id': 'address_id', 'staff.picture': 'picture', 'staff.email': 'email', 'staff.store_id': 'store_id', 'staff.active': 'active', 'staff.username': 'username', 'staff.password': 'password', 'staff.last_update': 'last_update',
1367
+ 'store.store_id': 'store_id', 'store.manager_staff_id': 'manager_staff_id', 'store.address_id': 'address_id', 'store.last_update': 'last_update',
1368
+ };
1369
+ export const GLOBAL_REST_PARAMETERS = {
1370
+ C6: C6,
1371
+ restURL: "/rest/",
1372
+ };
1373
+ export const Actor = {
1374
+ ...actor,
1375
+ ...restOrm(() => ({
1376
+ ...GLOBAL_REST_PARAMETERS,
1377
+ restModel: actor
1378
+ }))
1379
+ };
1380
+ export const Address = {
1381
+ ...address,
1382
+ ...restOrm(() => ({
1383
+ ...GLOBAL_REST_PARAMETERS,
1384
+ restModel: address
1385
+ }))
1386
+ };
1387
+ export const Category = {
1388
+ ...category,
1389
+ ...restOrm(() => ({
1390
+ ...GLOBAL_REST_PARAMETERS,
1391
+ restModel: category
1392
+ }))
1393
+ };
1394
+ export const City = {
1395
+ ...city,
1396
+ ...restOrm(() => ({
1397
+ ...GLOBAL_REST_PARAMETERS,
1398
+ restModel: city
1399
+ }))
1400
+ };
1401
+ export const Country = {
1402
+ ...country,
1403
+ ...restOrm(() => ({
1404
+ ...GLOBAL_REST_PARAMETERS,
1405
+ restModel: country
1406
+ }))
1407
+ };
1408
+ export const Customer = {
1409
+ ...customer,
1410
+ ...restOrm(() => ({
1411
+ ...GLOBAL_REST_PARAMETERS,
1412
+ restModel: customer
1413
+ }))
1414
+ };
1415
+ export const Film = {
1416
+ ...film,
1417
+ ...restOrm(() => ({
1418
+ ...GLOBAL_REST_PARAMETERS,
1419
+ restModel: film
1420
+ }))
1421
+ };
1422
+ export const Film_Actor = {
1423
+ ...film_actor,
1424
+ ...restOrm(() => ({
1425
+ ...GLOBAL_REST_PARAMETERS,
1426
+ restModel: film_actor
1427
+ }))
1428
+ };
1429
+ export const Film_Category = {
1430
+ ...film_category,
1431
+ ...restOrm(() => ({
1432
+ ...GLOBAL_REST_PARAMETERS,
1433
+ restModel: film_category
1434
+ }))
1435
+ };
1436
+ export const Film_Text = {
1437
+ ...film_text,
1438
+ ...restOrm(() => ({
1439
+ ...GLOBAL_REST_PARAMETERS,
1440
+ restModel: film_text
1441
+ }))
1442
+ };
1443
+ export const Inventory = {
1444
+ ...inventory,
1445
+ ...restOrm(() => ({
1446
+ ...GLOBAL_REST_PARAMETERS,
1447
+ restModel: inventory
1448
+ }))
1449
+ };
1450
+ export const Language = {
1451
+ ...language,
1452
+ ...restOrm(() => ({
1453
+ ...GLOBAL_REST_PARAMETERS,
1454
+ restModel: language
1455
+ }))
1456
+ };
1457
+ export const Payment = {
1458
+ ...payment,
1459
+ ...restOrm(() => ({
1460
+ ...GLOBAL_REST_PARAMETERS,
1461
+ restModel: payment
1462
+ }))
1463
+ };
1464
+ export const Rental = {
1465
+ ...rental,
1466
+ ...restOrm(() => ({
1467
+ ...GLOBAL_REST_PARAMETERS,
1468
+ restModel: rental
1469
+ }))
1470
+ };
1471
+ export const Staff = {
1472
+ ...staff,
1473
+ ...restOrm(() => ({
1474
+ ...GLOBAL_REST_PARAMETERS,
1475
+ restModel: staff
1476
+ }))
1477
+ };
1478
+ export const Store = {
1479
+ ...store,
1480
+ ...restOrm(() => ({
1481
+ ...GLOBAL_REST_PARAMETERS,
1482
+ restModel: store
1483
+ }))
1484
+ };
1485
+ C6.ORM = {
1486
+ Actor, Address, Category, City, Country, Customer, Film, Film_Actor, Film_Category, Film_Text, Inventory, Language, Payment, Rental, Staff, Store,
1487
+ };