pg-mvc-service 2.0.74 → 2.0.75

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.INVALID_MAP_STRING,
176
- "MAP_04": this.ERROR_MESSAGE.INVALID_MAP_STRING,
177
- "MAP_05": this.ERROR_MESSAGE.INVALID_MAP_STRING,
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.INVALID_MAP_STRING,
181
- "MAP_14": this.ERROR_MESSAGE.INVALID_MAP_STRING,
182
- "MAP_15": this.ERROR_MESSAGE.INVALID_MAP_STRING,
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);
@@ -450,11 +457,12 @@ class RequestType extends ReqResType_1.default {
450
457
  case 'map':
451
458
  case 'map?':
452
459
  const mapData = {};
460
+ console.log("amp-value", values[i]);
453
461
  for (const [mapKey, mapValue] of Object.entries(values[i])) {
454
462
  switch (property.item.mapType) {
455
463
  case 'number':
456
464
  if (this.isNumber(mapValue) === false) {
457
- this.throwInputError("MAP_11", [...keys, i], values[i]);
465
+ this.throwInputError("MAP_31", [...keys, i], values[i]);
458
466
  }
459
467
  mapData[mapKey] = Number(mapValue);
460
468
  break;
@@ -467,27 +475,29 @@ class RequestType extends ReqResType_1.default {
467
475
  mapData[mapKey] = mapValue;
468
476
  break;
469
477
  default:
470
- this.throwInputError("MAP_12", [...keys, i], values[i]);
478
+ this.throwInputError("MAP_32", [...keys, i], values[i]);
471
479
  }
480
+ break;
472
481
  case 'bool':
473
482
  switch (typeof mapValue) {
474
483
  case 'boolean':
475
484
  mapData[mapKey] = mapValue;
476
485
  case 'number':
477
486
  if (mapValue !== 0 && mapValue !== 1) {
478
- this.throwInputError("MAP_13", keys, mapValue);
487
+ this.throwInputError("MAP_33", keys, mapValue);
479
488
  }
480
489
  mapData[mapKey] = mapValue === 1;
481
490
  break;
482
491
  case 'string':
483
492
  if (mapValue !== 'true' && mapValue !== 'false') {
484
- this.throwInputError("MAP_14", keys, mapValue);
493
+ this.throwInputError("MAP_34", keys, mapValue);
485
494
  }
486
495
  mapData[mapKey] = mapValue === 'true';
487
496
  break;
488
497
  default:
489
- this.throwInputError("MAP_15", keys, mapValue);
498
+ this.throwInputError("MAP_35", keys, mapValue);
490
499
  }
500
+ break;
491
501
  }
492
502
  }
493
503
  this.changeBody([...keys, i], mapData);
@@ -597,6 +607,7 @@ class RequestType extends ReqResType_1.default {
597
607
  default:
598
608
  this.throwInputError("MAP_12", [key], value);
599
609
  }
610
+ break;
600
611
  case 'bool':
601
612
  switch (typeof value) {
602
613
  case 'boolean':
@@ -616,6 +627,7 @@ class RequestType extends ReqResType_1.default {
616
627
  default:
617
628
  this.throwInputError("MAP_15", keys, value);
618
629
  }
630
+ break;
619
631
  }
620
632
  }
621
633
  this.changeBody([...keys, key], mapData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "2.0.74",
3
+ "version": "2.0.75",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -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.INVALID_MAP_STRING,
186
- "MAP_04": this.ERROR_MESSAGE.INVALID_MAP_STRING,
187
- "MAP_05": this.ERROR_MESSAGE.INVALID_MAP_STRING,
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.INVALID_MAP_STRING,
191
- "MAP_14": this.ERROR_MESSAGE.INVALID_MAP_STRING,
192
- "MAP_15": this.ERROR_MESSAGE.INVALID_MAP_STRING,
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
 
@@ -469,11 +477,12 @@ export class RequestType extends ReqResType {
469
477
  case 'map':
470
478
  case 'map?':
471
479
  const mapData: {[key: string]: string | number | boolean} = {};
480
+ console.log("amp-value", values[i]);
472
481
  for (const [mapKey, mapValue] of Object.entries(values[i])) {
473
482
  switch (property.item.mapType) {
474
483
  case 'number':
475
484
  if (this.isNumber(mapValue) === false) {
476
- this.throwInputError("MAP_11", [...keys, i], values[i]);
485
+ this.throwInputError("MAP_31", [...keys, i], values[i]);
477
486
  }
478
487
  mapData[mapKey] = Number(mapValue);
479
488
  break;
@@ -486,27 +495,29 @@ export class RequestType extends ReqResType {
486
495
  mapData[mapKey] = mapValue;
487
496
  break;
488
497
  default:
489
- this.throwInputError("MAP_12", [...keys, i], values[i]);
498
+ this.throwInputError("MAP_32", [...keys, i], values[i]);
490
499
  }
500
+ break;
491
501
  case 'bool':
492
502
  switch (typeof mapValue) {
493
503
  case 'boolean':
494
504
  mapData[mapKey] = mapValue;
495
505
  case 'number':
496
506
  if (mapValue !== 0 && mapValue !== 1) {
497
- this.throwInputError("MAP_13", keys, mapValue);
507
+ this.throwInputError("MAP_33", keys, mapValue);
498
508
  }
499
509
  mapData[mapKey] = mapValue === 1;
500
510
  break;
501
511
  case 'string':
502
512
  if (mapValue !== 'true' && mapValue !== 'false') {
503
- this.throwInputError("MAP_14", keys, mapValue);
513
+ this.throwInputError("MAP_34", keys, mapValue);
504
514
  }
505
515
  mapData[mapKey] = mapValue === 'true';
506
516
  break;
507
517
  default:
508
- this.throwInputError("MAP_15", keys, mapValue);
518
+ this.throwInputError("MAP_35", keys, mapValue);
509
519
  }
520
+ break;
510
521
  }
511
522
  }
512
523
 
@@ -620,6 +631,7 @@ export class RequestType extends ReqResType {
620
631
  default:
621
632
  this.throwInputError("MAP_12", [key], value);
622
633
  }
634
+ break;
623
635
  case 'bool':
624
636
  switch (typeof value) {
625
637
  case 'boolean':
@@ -639,6 +651,7 @@ export class RequestType extends ReqResType {
639
651
  default:
640
652
  this.throwInputError("MAP_15", keys, value);
641
653
  }
654
+ break;
642
655
  }
643
656
  }
644
657