pg-mvc-service 2.0.74 → 2.0.76
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.
|
@@ -172,14 +172,19 @@ class RequestType extends ReqResType_1.default {
|
|
|
172
172
|
"ENUM_42": this.ERROR_MESSAGE.INVALID_ENUM,
|
|
173
173
|
"MAP_01": this.ERROR_MESSAGE.INVALID_MAP_NUMBER, // // tODO : mapのエラーメッセージどうするか
|
|
174
174
|
"MAP_02": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
175
|
-
"MAP_03": this.ERROR_MESSAGE.
|
|
176
|
-
"MAP_04": this.ERROR_MESSAGE.
|
|
177
|
-
"MAP_05": this.ERROR_MESSAGE.
|
|
175
|
+
"MAP_03": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
176
|
+
"MAP_04": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
177
|
+
"MAP_05": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
178
178
|
"MAP_11": this.ERROR_MESSAGE.INVALID_MAP_NUMBER,
|
|
179
179
|
"MAP_12": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
180
|
-
"MAP_13": this.ERROR_MESSAGE.
|
|
181
|
-
"MAP_14": this.ERROR_MESSAGE.
|
|
182
|
-
"MAP_15": this.ERROR_MESSAGE.
|
|
180
|
+
"MAP_13": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
181
|
+
"MAP_14": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
182
|
+
"MAP_15": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
183
|
+
"MAP_31": this.ERROR_MESSAGE.INVALID_MAP_NUMBER,
|
|
184
|
+
"MAP_32": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
185
|
+
"MAP_33": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
186
|
+
"MAP_34": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
187
|
+
"MAP_35": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
183
188
|
"NUMBER_91": this.ERROR_MESSAGE.INVALID_NUMBER,
|
|
184
189
|
"BOOL_91": this.ERROR_MESSAGE.INVALID_BOOL,
|
|
185
190
|
"BOOL_92": this.ERROR_MESSAGE.INVALID_BOOL,
|
|
@@ -313,6 +318,7 @@ class RequestType extends ReqResType_1.default {
|
|
|
313
318
|
default:
|
|
314
319
|
this.throwInputError("MAP_02", [key], value);
|
|
315
320
|
}
|
|
321
|
+
break;
|
|
316
322
|
case 'bool':
|
|
317
323
|
switch (typeof mapValue) {
|
|
318
324
|
case 'boolean':
|
|
@@ -332,6 +338,7 @@ class RequestType extends ReqResType_1.default {
|
|
|
332
338
|
default:
|
|
333
339
|
this.throwInputError("MAP_05", [key], mapValue);
|
|
334
340
|
}
|
|
341
|
+
break;
|
|
335
342
|
}
|
|
336
343
|
}
|
|
337
344
|
this.changeBody([key], mapData);
|
|
@@ -454,7 +461,7 @@ class RequestType extends ReqResType_1.default {
|
|
|
454
461
|
switch (property.item.mapType) {
|
|
455
462
|
case 'number':
|
|
456
463
|
if (this.isNumber(mapValue) === false) {
|
|
457
|
-
this.throwInputError("
|
|
464
|
+
this.throwInputError("MAP_31", [...keys, i], values[i]);
|
|
458
465
|
}
|
|
459
466
|
mapData[mapKey] = Number(mapValue);
|
|
460
467
|
break;
|
|
@@ -467,27 +474,29 @@ class RequestType extends ReqResType_1.default {
|
|
|
467
474
|
mapData[mapKey] = mapValue;
|
|
468
475
|
break;
|
|
469
476
|
default:
|
|
470
|
-
this.throwInputError("
|
|
477
|
+
this.throwInputError("MAP_32", [...keys, i], values[i]);
|
|
471
478
|
}
|
|
479
|
+
break;
|
|
472
480
|
case 'bool':
|
|
473
481
|
switch (typeof mapValue) {
|
|
474
482
|
case 'boolean':
|
|
475
483
|
mapData[mapKey] = mapValue;
|
|
476
484
|
case 'number':
|
|
477
485
|
if (mapValue !== 0 && mapValue !== 1) {
|
|
478
|
-
this.throwInputError("
|
|
486
|
+
this.throwInputError("MAP_33", keys, mapValue);
|
|
479
487
|
}
|
|
480
488
|
mapData[mapKey] = mapValue === 1;
|
|
481
489
|
break;
|
|
482
490
|
case 'string':
|
|
483
491
|
if (mapValue !== 'true' && mapValue !== 'false') {
|
|
484
|
-
this.throwInputError("
|
|
492
|
+
this.throwInputError("MAP_34", keys, mapValue);
|
|
485
493
|
}
|
|
486
494
|
mapData[mapKey] = mapValue === 'true';
|
|
487
495
|
break;
|
|
488
496
|
default:
|
|
489
|
-
this.throwInputError("
|
|
497
|
+
this.throwInputError("MAP_35", keys, mapValue);
|
|
490
498
|
}
|
|
499
|
+
break;
|
|
491
500
|
}
|
|
492
501
|
}
|
|
493
502
|
this.changeBody([...keys, i], mapData);
|
|
@@ -597,25 +606,27 @@ class RequestType extends ReqResType_1.default {
|
|
|
597
606
|
default:
|
|
598
607
|
this.throwInputError("MAP_12", [key], value);
|
|
599
608
|
}
|
|
609
|
+
break;
|
|
600
610
|
case 'bool':
|
|
601
|
-
switch (typeof
|
|
611
|
+
switch (typeof mapValue) {
|
|
602
612
|
case 'boolean':
|
|
603
|
-
mapData[mapKey] =
|
|
613
|
+
mapData[mapKey] = mapValue;
|
|
604
614
|
case 'number':
|
|
605
|
-
if (
|
|
606
|
-
this.throwInputError("MAP_13", keys,
|
|
615
|
+
if (mapValue !== 0 && mapValue !== 1) {
|
|
616
|
+
this.throwInputError("MAP_13", keys, mapValue);
|
|
607
617
|
}
|
|
608
|
-
mapData[mapKey] =
|
|
618
|
+
mapData[mapKey] = mapValue === 1;
|
|
609
619
|
break;
|
|
610
620
|
case 'string':
|
|
611
|
-
if (
|
|
612
|
-
this.throwInputError("MAP_14", keys,
|
|
621
|
+
if (mapValue !== 'true' && mapValue !== 'false') {
|
|
622
|
+
this.throwInputError("MAP_14", keys, mapValue);
|
|
613
623
|
}
|
|
614
|
-
mapData[mapKey] =
|
|
624
|
+
mapData[mapKey] = mapValue === 'true';
|
|
615
625
|
break;
|
|
616
626
|
default:
|
|
617
|
-
this.throwInputError("MAP_15", keys,
|
|
627
|
+
this.throwInputError("MAP_15", keys, mapValue);
|
|
618
628
|
}
|
|
629
|
+
break;
|
|
619
630
|
}
|
|
620
631
|
}
|
|
621
632
|
this.changeBody([...keys, key], mapData);
|
package/package.json
CHANGED
|
@@ -148,6 +148,7 @@ export class RequestType extends ReqResType {
|
|
|
148
148
|
"REQUIRE_31" |
|
|
149
149
|
"ENUM_41" | "ENUM_42" | "NUMBER_41" | "STRING_41" |
|
|
150
150
|
"MAP_01" | "MAP_02" | "MAP_03" | "MAP_04" | "MAP_05" | "MAP_11" | "MAP_12" | "MAP_13" | "MAP_14" | "MAP_15" |
|
|
151
|
+
"MAP_31" | "MAP_32" | "MAP_33" | "MAP_34" | "MAP_35" |
|
|
151
152
|
"NUMBER_91" | "BOOL_91" | "BOOL_92" | "BOOL_93" | "STRING_91" | "UUID_91" | "MAIL_91" | "DATE_91" | "DATE_92" |
|
|
152
153
|
"TIME_91" | "DATETIME_91" | "DATETIME_92" | "HTTPS_91" | "BASE64_91"
|
|
153
154
|
, keys: Array<string | number>, value: any): never {
|
|
@@ -182,14 +183,19 @@ export class RequestType extends ReqResType {
|
|
|
182
183
|
"ENUM_42": this.ERROR_MESSAGE.INVALID_ENUM,
|
|
183
184
|
"MAP_01": this.ERROR_MESSAGE.INVALID_MAP_NUMBER, // // tODO : mapのエラーメッセージどうするか
|
|
184
185
|
"MAP_02": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
185
|
-
"MAP_03": this.ERROR_MESSAGE.
|
|
186
|
-
"MAP_04": this.ERROR_MESSAGE.
|
|
187
|
-
"MAP_05": this.ERROR_MESSAGE.
|
|
186
|
+
"MAP_03": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
187
|
+
"MAP_04": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
188
|
+
"MAP_05": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
188
189
|
"MAP_11": this.ERROR_MESSAGE.INVALID_MAP_NUMBER,
|
|
189
190
|
"MAP_12": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
190
|
-
"MAP_13": this.ERROR_MESSAGE.
|
|
191
|
-
"MAP_14": this.ERROR_MESSAGE.
|
|
192
|
-
"MAP_15": this.ERROR_MESSAGE.
|
|
191
|
+
"MAP_13": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
192
|
+
"MAP_14": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
193
|
+
"MAP_15": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
194
|
+
"MAP_31": this.ERROR_MESSAGE.INVALID_MAP_NUMBER,
|
|
195
|
+
"MAP_32": this.ERROR_MESSAGE.INVALID_MAP_STRING,
|
|
196
|
+
"MAP_33": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
197
|
+
"MAP_34": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
198
|
+
"MAP_35": this.ERROR_MESSAGE.INVALID_MAP_BOOL,
|
|
193
199
|
"NUMBER_91": this.ERROR_MESSAGE.INVALID_NUMBER,
|
|
194
200
|
"BOOL_91": this.ERROR_MESSAGE.INVALID_BOOL,
|
|
195
201
|
"BOOL_92": this.ERROR_MESSAGE.INVALID_BOOL,
|
|
@@ -323,6 +329,7 @@ export class RequestType extends ReqResType {
|
|
|
323
329
|
default:
|
|
324
330
|
this.throwInputError("MAP_02", [key], value);
|
|
325
331
|
}
|
|
332
|
+
break;
|
|
326
333
|
case 'bool':
|
|
327
334
|
switch (typeof mapValue) {
|
|
328
335
|
case 'boolean':
|
|
@@ -342,6 +349,7 @@ export class RequestType extends ReqResType {
|
|
|
342
349
|
default:
|
|
343
350
|
this.throwInputError("MAP_05", [key], mapValue);
|
|
344
351
|
}
|
|
352
|
+
break;
|
|
345
353
|
}
|
|
346
354
|
}
|
|
347
355
|
|
|
@@ -473,7 +481,7 @@ export class RequestType extends ReqResType {
|
|
|
473
481
|
switch (property.item.mapType) {
|
|
474
482
|
case 'number':
|
|
475
483
|
if (this.isNumber(mapValue) === false) {
|
|
476
|
-
this.throwInputError("
|
|
484
|
+
this.throwInputError("MAP_31", [...keys, i], values[i]);
|
|
477
485
|
}
|
|
478
486
|
mapData[mapKey] = Number(mapValue);
|
|
479
487
|
break;
|
|
@@ -486,27 +494,29 @@ export class RequestType extends ReqResType {
|
|
|
486
494
|
mapData[mapKey] = mapValue;
|
|
487
495
|
break;
|
|
488
496
|
default:
|
|
489
|
-
this.throwInputError("
|
|
497
|
+
this.throwInputError("MAP_32", [...keys, i], values[i]);
|
|
490
498
|
}
|
|
499
|
+
break;
|
|
491
500
|
case 'bool':
|
|
492
501
|
switch (typeof mapValue) {
|
|
493
502
|
case 'boolean':
|
|
494
503
|
mapData[mapKey] = mapValue;
|
|
495
504
|
case 'number':
|
|
496
505
|
if (mapValue !== 0 && mapValue !== 1) {
|
|
497
|
-
this.throwInputError("
|
|
506
|
+
this.throwInputError("MAP_33", keys, mapValue);
|
|
498
507
|
}
|
|
499
508
|
mapData[mapKey] = mapValue === 1;
|
|
500
509
|
break;
|
|
501
510
|
case 'string':
|
|
502
511
|
if (mapValue !== 'true' && mapValue !== 'false') {
|
|
503
|
-
this.throwInputError("
|
|
512
|
+
this.throwInputError("MAP_34", keys, mapValue);
|
|
504
513
|
}
|
|
505
514
|
mapData[mapKey] = mapValue === 'true';
|
|
506
515
|
break;
|
|
507
516
|
default:
|
|
508
|
-
this.throwInputError("
|
|
517
|
+
this.throwInputError("MAP_35", keys, mapValue);
|
|
509
518
|
}
|
|
519
|
+
break;
|
|
510
520
|
}
|
|
511
521
|
}
|
|
512
522
|
|
|
@@ -620,25 +630,27 @@ export class RequestType extends ReqResType {
|
|
|
620
630
|
default:
|
|
621
631
|
this.throwInputError("MAP_12", [key], value);
|
|
622
632
|
}
|
|
633
|
+
break;
|
|
623
634
|
case 'bool':
|
|
624
|
-
switch (typeof
|
|
635
|
+
switch (typeof mapValue) {
|
|
625
636
|
case 'boolean':
|
|
626
|
-
mapData[mapKey] =
|
|
637
|
+
mapData[mapKey] = mapValue;
|
|
627
638
|
case 'number':
|
|
628
|
-
if (
|
|
629
|
-
this.throwInputError("MAP_13", keys,
|
|
639
|
+
if (mapValue !== 0 && mapValue !== 1) {
|
|
640
|
+
this.throwInputError("MAP_13", keys, mapValue);
|
|
630
641
|
}
|
|
631
|
-
mapData[mapKey] =
|
|
642
|
+
mapData[mapKey] = mapValue === 1;
|
|
632
643
|
break;
|
|
633
644
|
case 'string':
|
|
634
|
-
if (
|
|
635
|
-
this.throwInputError("MAP_14", keys,
|
|
645
|
+
if (mapValue !== 'true' && mapValue !== 'false') {
|
|
646
|
+
this.throwInputError("MAP_14", keys, mapValue);
|
|
636
647
|
}
|
|
637
|
-
mapData[mapKey] =
|
|
648
|
+
mapData[mapKey] = mapValue === 'true';
|
|
638
649
|
break;
|
|
639
650
|
default:
|
|
640
|
-
this.throwInputError("MAP_15", keys,
|
|
651
|
+
this.throwInputError("MAP_15", keys, mapValue);
|
|
641
652
|
}
|
|
653
|
+
break;
|
|
642
654
|
}
|
|
643
655
|
}
|
|
644
656
|
|