@webiny/db-dynamodb 0.0.0-unstable.40876133bb → 0.0.0-unstable.496cf268ac

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 (111) hide show
  1. package/BatchProcess.js +3 -37
  2. package/BatchProcess.js.map +1 -1
  3. package/DynamoDbDriver.js +3 -38
  4. package/DynamoDbDriver.js.map +1 -1
  5. package/QueryGenerator.js +4 -18
  6. package/QueryGenerator.js.map +1 -1
  7. package/index.d.ts +2 -0
  8. package/index.js +24 -3
  9. package/index.js.map +1 -1
  10. package/operators/comparison/beginsWith.js.map +1 -1
  11. package/operators/comparison/between.js.map +1 -1
  12. package/operators/comparison/eq.js +0 -2
  13. package/operators/comparison/eq.js.map +1 -1
  14. package/operators/comparison/gt.js.map +1 -1
  15. package/operators/comparison/gte.js.map +1 -1
  16. package/operators/comparison/lt.js.map +1 -1
  17. package/operators/comparison/lte.js.map +1 -1
  18. package/operators/index.js +0 -11
  19. package/operators/index.js.map +1 -1
  20. package/operators/logical/and.js +0 -5
  21. package/operators/logical/and.js.map +1 -1
  22. package/operators/logical/or.js +0 -5
  23. package/operators/logical/or.js.map +1 -1
  24. package/package.json +9 -9
  25. package/plugins/definitions/AttributePlugin.js +0 -13
  26. package/plugins/definitions/AttributePlugin.js.map +1 -1
  27. package/plugins/definitions/DateTimeTransformPlugin.js +0 -14
  28. package/plugins/definitions/DateTimeTransformPlugin.js.map +1 -1
  29. package/plugins/definitions/FieldPathPlugin.js +0 -12
  30. package/plugins/definitions/FieldPathPlugin.js.map +1 -1
  31. package/plugins/definitions/FieldPlugin.js +0 -16
  32. package/plugins/definitions/FieldPlugin.js.map +1 -1
  33. package/plugins/definitions/NumberTransformPlugin.js +0 -11
  34. package/plugins/definitions/NumberTransformPlugin.js.map +1 -1
  35. package/plugins/definitions/TimeTransformPlugin.js +0 -14
  36. package/plugins/definitions/TimeTransformPlugin.js.map +1 -1
  37. package/plugins/definitions/ValueFilterPlugin.js +0 -12
  38. package/plugins/definitions/ValueFilterPlugin.js.map +1 -1
  39. package/plugins/definitions/ValueTransformPlugin.js +0 -13
  40. package/plugins/definitions/ValueTransformPlugin.js.map +1 -1
  41. package/plugins/definitions/assignFields.js +0 -9
  42. package/plugins/definitions/assignFields.js.map +1 -1
  43. package/plugins/filters/andIn.d.ts +2 -2
  44. package/plugins/filters/andIn.js +3 -8
  45. package/plugins/filters/andIn.js.map +1 -1
  46. package/plugins/filters/between.d.ts +2 -2
  47. package/plugins/filters/between.js +3 -8
  48. package/plugins/filters/between.js.map +1 -1
  49. package/plugins/filters/contains.d.ts +2 -2
  50. package/plugins/filters/contains.js +3 -6
  51. package/plugins/filters/contains.js.map +1 -1
  52. package/plugins/filters/eq.d.ts +2 -2
  53. package/plugins/filters/eq.js +3 -5
  54. package/plugins/filters/eq.js.map +1 -1
  55. package/plugins/filters/fuzzy.d.ts +2 -2
  56. package/plugins/filters/fuzzy.js +3 -7
  57. package/plugins/filters/fuzzy.js.map +1 -1
  58. package/plugins/filters/gt.d.ts +2 -2
  59. package/plugins/filters/gt.js +3 -4
  60. package/plugins/filters/gt.js.map +1 -1
  61. package/plugins/filters/gte.d.ts +2 -2
  62. package/plugins/filters/gte.js +3 -4
  63. package/plugins/filters/gte.js.map +1 -1
  64. package/plugins/filters/in.d.ts +2 -2
  65. package/plugins/filters/in.js +3 -8
  66. package/plugins/filters/in.js.map +1 -1
  67. package/plugins/filters/index.js +0 -14
  68. package/plugins/filters/index.js.map +1 -1
  69. package/plugins/filters/lt.d.ts +2 -2
  70. package/plugins/filters/lt.js +3 -4
  71. package/plugins/filters/lt.js.map +1 -1
  72. package/plugins/filters/lte.d.ts +2 -2
  73. package/plugins/filters/lte.js +3 -4
  74. package/plugins/filters/lte.js.map +1 -1
  75. package/plugins/filters/startsWith.d.ts +2 -2
  76. package/plugins/filters/startsWith.js +3 -7
  77. package/plugins/filters/startsWith.js.map +1 -1
  78. package/plugins/index.js +0 -4
  79. package/plugins/index.js.map +1 -1
  80. package/statements/createKeyConditionExpressionArgs.js +0 -7
  81. package/statements/createKeyConditionExpressionArgs.js.map +1 -1
  82. package/statements/processStatement.js +0 -7
  83. package/statements/processStatement.js.map +1 -1
  84. package/types.d.ts +8 -0
  85. package/types.js.map +1 -1
  86. package/utils/attributes.js +0 -7
  87. package/utils/attributes.js.map +1 -1
  88. package/utils/batchRead.js +0 -22
  89. package/utils/batchRead.js.map +1 -1
  90. package/utils/batchWrite.js +0 -6
  91. package/utils/batchWrite.js.map +1 -1
  92. package/utils/cleanup.js +0 -10
  93. package/utils/cleanup.js.map +1 -1
  94. package/utils/createStandardEntity.d.ts +2 -0
  95. package/utils/createStandardEntity.js +34 -0
  96. package/utils/createStandardEntity.js.map +1 -0
  97. package/utils/cursor.js +0 -6
  98. package/utils/cursor.js.map +1 -1
  99. package/utils/filter.js +0 -37
  100. package/utils/filter.js.map +1 -1
  101. package/utils/get.js +0 -4
  102. package/utils/get.js.map +1 -1
  103. package/utils/listResponse.js +0 -4
  104. package/utils/listResponse.js.map +1 -1
  105. package/utils/query.d.ts +6 -1
  106. package/utils/query.js +21 -21
  107. package/utils/query.js.map +1 -1
  108. package/utils/sort.js +0 -17
  109. package/utils/sort.js.map +1 -1
  110. package/utils/table.js +0 -5
  111. package/utils/table.js.map +1 -1
package/utils/sort.js CHANGED
@@ -1,27 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.sortItems = sortItems;
9
-
10
8
  var _orderBy = _interopRequireDefault(require("lodash/orderBy"));
11
-
12
9
  var _error = _interopRequireDefault(require("@webiny/error"));
13
-
14
10
  const extractSort = (sortBy, fields) => {
15
11
  const result = sortBy.split("_");
16
-
17
12
  if (result.length !== 2) {
18
13
  throw new _error.default("Problem in determining the sorting for the entry items.", "SORT_ERROR", {
19
14
  sortBy
20
15
  });
21
16
  }
22
-
23
17
  const [field, order] = result;
24
-
25
18
  if (!field) {
26
19
  throw new _error.default("Sorting field does not exist.", "SORTING_FIELD_ERROR", {
27
20
  field,
@@ -29,23 +22,19 @@ const extractSort = (sortBy, fields) => {
29
22
  fields
30
23
  });
31
24
  }
32
-
33
25
  const fieldPlugin = fields.find(f => f.getField() === field);
34
26
  const isSortable = fieldPlugin ? fieldPlugin.isSortable() : true;
35
-
36
27
  if (isSortable === false) {
37
28
  throw new _error.default(`Cannot sort by given field: "${field}".`, "UNSUPPORTED_SORT_ERROR", {
38
29
  fields,
39
30
  field
40
31
  });
41
32
  }
42
-
43
33
  return {
44
34
  field,
45
35
  reverse: order.toUpperCase() === "DESC"
46
36
  };
47
37
  };
48
-
49
38
  function sortItems(params) {
50
39
  const {
51
40
  items,
@@ -55,16 +44,13 @@ function sortItems(params) {
55
44
  /**
56
45
  * Skip sorting if nothing was passed to sort by or nothing to sort.
57
46
  */
58
-
59
47
  if (items.length <= 1 || Array.isArray(initialSort) === false || initialSort.length === 0) {
60
48
  return items;
61
49
  }
62
-
63
50
  const info = {
64
51
  sorters: [],
65
52
  orders: []
66
53
  };
67
-
68
54
  for (const sort of initialSort) {
69
55
  /**
70
56
  * Possibly empty array item was passed.
@@ -72,7 +58,6 @@ function sortItems(params) {
72
58
  if (!sort) {
73
59
  continue;
74
60
  }
75
-
76
61
  const {
77
62
  field,
78
63
  reverse
@@ -82,10 +67,8 @@ function sortItems(params) {
82
67
  info.sorters.push(path);
83
68
  info.orders.push(reverse === true ? "desc" : "asc");
84
69
  }
85
-
86
70
  if (info.sorters.length === 0) {
87
71
  return items;
88
72
  }
89
-
90
73
  return (0, _orderBy.default)(items, info.sorters, info.orders);
91
74
  }
package/utils/sort.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["extractSort","sortBy","fields","result","split","length","WebinyError","field","order","fieldPlugin","find","f","getField","isSortable","reverse","toUpperCase","sortItems","params","items","sort","initialSort","Array","isArray","info","sorters","orders","path","getPath","push","lodashOrderBy"],"sources":["sort.ts"],"sourcesContent":["import lodashOrderBy from \"lodash/orderBy\";\nimport WebinyError from \"@webiny/error\";\nimport { FieldPlugin } from \"~/plugins/definitions/FieldPlugin\";\n\ninterface Info {\n sorters: string[];\n orders: (boolean | \"asc\" | \"desc\")[];\n}\n\ninterface Response {\n reverse: boolean;\n field: string;\n}\n\nconst extractSort = (sortBy: string, fields: FieldPlugin[]): Response => {\n const result = sortBy.split(\"_\");\n if (result.length !== 2) {\n throw new WebinyError(\n \"Problem in determining the sorting for the entry items.\",\n \"SORT_ERROR\",\n {\n sortBy\n }\n );\n }\n const [field, order] = result;\n\n if (!field) {\n throw new WebinyError(\"Sorting field does not exist.\", \"SORTING_FIELD_ERROR\", {\n field,\n order,\n fields\n });\n }\n const fieldPlugin = fields.find(f => f.getField() === field);\n const isSortable = fieldPlugin ? fieldPlugin.isSortable() : true;\n if (isSortable === false) {\n throw new WebinyError(`Cannot sort by given field: \"${field}\".`, \"UNSUPPORTED_SORT_ERROR\", {\n fields,\n field\n });\n }\n\n return {\n field,\n reverse: order.toUpperCase() === \"DESC\"\n };\n};\n\ninterface Params<T> {\n /**\n * The items we are sorting.\n */\n items: T[];\n /**\n * Sort options. For example: [\"id_ASC\"]\n */\n sort?: string[];\n /**\n * Fields we can sort by.\n */\n fields?: FieldPlugin[];\n}\n\nexport function sortItems<T = any>(params: Params<T>): T[] {\n const { items, sort: initialSort = [], fields = [] } = params;\n /**\n * Skip sorting if nothing was passed to sort by or nothing to sort.\n */\n if (items.length <= 1 || Array.isArray(initialSort) === false || initialSort.length === 0) {\n return items;\n }\n\n const info: Info = {\n sorters: [],\n orders: []\n };\n\n for (const sort of initialSort) {\n /**\n * Possibly empty array item was passed.\n */\n if (!sort) {\n continue;\n }\n const { field, reverse } = extractSort(sort, fields);\n const fieldPlugin = fields.find(f => f.getField() === field);\n const path = fieldPlugin ? fieldPlugin.getPath() : field;\n\n info.sorters.push(path);\n info.orders.push(reverse === true ? \"desc\" : \"asc\");\n }\n\n if (info.sorters.length === 0) {\n return items;\n }\n\n return lodashOrderBy(items, info.sorters, info.orders);\n}\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAaA,MAAMA,WAAW,GAAG,CAACC,MAAD,EAAiBC,MAAjB,KAAqD;EACrE,MAAMC,MAAM,GAAGF,MAAM,CAACG,KAAP,CAAa,GAAb,CAAf;;EACA,IAAID,MAAM,CAACE,MAAP,KAAkB,CAAtB,EAAyB;IACrB,MAAM,IAAIC,cAAJ,CACF,yDADE,EAEF,YAFE,EAGF;MACIL;IADJ,CAHE,CAAN;EAOH;;EACD,MAAM,CAACM,KAAD,EAAQC,KAAR,IAAiBL,MAAvB;;EAEA,IAAI,CAACI,KAAL,EAAY;IACR,MAAM,IAAID,cAAJ,CAAgB,+BAAhB,EAAiD,qBAAjD,EAAwE;MAC1EC,KAD0E;MAE1EC,KAF0E;MAG1EN;IAH0E,CAAxE,CAAN;EAKH;;EACD,MAAMO,WAAW,GAAGP,MAAM,CAACQ,IAAP,CAAYC,CAAC,IAAIA,CAAC,CAACC,QAAF,OAAiBL,KAAlC,CAApB;EACA,MAAMM,UAAU,GAAGJ,WAAW,GAAGA,WAAW,CAACI,UAAZ,EAAH,GAA8B,IAA5D;;EACA,IAAIA,UAAU,KAAK,KAAnB,EAA0B;IACtB,MAAM,IAAIP,cAAJ,CAAiB,gCAA+BC,KAAM,IAAtD,EAA2D,wBAA3D,EAAqF;MACvFL,MADuF;MAEvFK;IAFuF,CAArF,CAAN;EAIH;;EAED,OAAO;IACHA,KADG;IAEHO,OAAO,EAAEN,KAAK,CAACO,WAAN,OAAwB;EAF9B,CAAP;AAIH,CAjCD;;AAkDO,SAASC,SAAT,CAA4BC,MAA5B,EAAoD;EACvD,MAAM;IAAEC,KAAF;IAASC,IAAI,EAAEC,WAAW,GAAG,EAA7B;IAAiClB,MAAM,GAAG;EAA1C,IAAiDe,MAAvD;EACA;AACJ;AACA;;EACI,IAAIC,KAAK,CAACb,MAAN,IAAgB,CAAhB,IAAqBgB,KAAK,CAACC,OAAN,CAAcF,WAAd,MAA+B,KAApD,IAA6DA,WAAW,CAACf,MAAZ,KAAuB,CAAxF,EAA2F;IACvF,OAAOa,KAAP;EACH;;EAED,MAAMK,IAAU,GAAG;IACfC,OAAO,EAAE,EADM;IAEfC,MAAM,EAAE;EAFO,CAAnB;;EAKA,KAAK,MAAMN,IAAX,IAAmBC,WAAnB,EAAgC;IAC5B;AACR;AACA;IACQ,IAAI,CAACD,IAAL,EAAW;MACP;IACH;;IACD,MAAM;MAAEZ,KAAF;MAASO;IAAT,IAAqBd,WAAW,CAACmB,IAAD,EAAOjB,MAAP,CAAtC;IACA,MAAMO,WAAW,GAAGP,MAAM,CAACQ,IAAP,CAAYC,CAAC,IAAIA,CAAC,CAACC,QAAF,OAAiBL,KAAlC,CAApB;IACA,MAAMmB,IAAI,GAAGjB,WAAW,GAAGA,WAAW,CAACkB,OAAZ,EAAH,GAA2BpB,KAAnD;IAEAgB,IAAI,CAACC,OAAL,CAAaI,IAAb,CAAkBF,IAAlB;IACAH,IAAI,CAACE,MAAL,CAAYG,IAAZ,CAAiBd,OAAO,KAAK,IAAZ,GAAmB,MAAnB,GAA4B,KAA7C;EACH;;EAED,IAAIS,IAAI,CAACC,OAAL,CAAanB,MAAb,KAAwB,CAA5B,EAA+B;IAC3B,OAAOa,KAAP;EACH;;EAED,OAAO,IAAAW,gBAAA,EAAcX,KAAd,EAAqBK,IAAI,CAACC,OAA1B,EAAmCD,IAAI,CAACE,MAAxC,CAAP;AACH"}
1
+ {"version":3,"names":["extractSort","sortBy","fields","result","split","length","WebinyError","field","order","fieldPlugin","find","f","getField","isSortable","reverse","toUpperCase","sortItems","params","items","sort","initialSort","Array","isArray","info","sorters","orders","path","getPath","push","lodashOrderBy"],"sources":["sort.ts"],"sourcesContent":["import lodashOrderBy from \"lodash/orderBy\";\nimport WebinyError from \"@webiny/error\";\nimport { FieldPlugin } from \"~/plugins/definitions/FieldPlugin\";\n\ninterface Info {\n sorters: string[];\n orders: (boolean | \"asc\" | \"desc\")[];\n}\n\ninterface Response {\n reverse: boolean;\n field: string;\n}\n\nconst extractSort = (sortBy: string, fields: FieldPlugin[]): Response => {\n const result = sortBy.split(\"_\");\n if (result.length !== 2) {\n throw new WebinyError(\n \"Problem in determining the sorting for the entry items.\",\n \"SORT_ERROR\",\n {\n sortBy\n }\n );\n }\n const [field, order] = result;\n\n if (!field) {\n throw new WebinyError(\"Sorting field does not exist.\", \"SORTING_FIELD_ERROR\", {\n field,\n order,\n fields\n });\n }\n const fieldPlugin = fields.find(f => f.getField() === field);\n const isSortable = fieldPlugin ? fieldPlugin.isSortable() : true;\n if (isSortable === false) {\n throw new WebinyError(`Cannot sort by given field: \"${field}\".`, \"UNSUPPORTED_SORT_ERROR\", {\n fields,\n field\n });\n }\n\n return {\n field,\n reverse: order.toUpperCase() === \"DESC\"\n };\n};\n\ninterface Params<T> {\n /**\n * The items we are sorting.\n */\n items: T[];\n /**\n * Sort options. For example: [\"id_ASC\"]\n */\n sort?: string[];\n /**\n * Fields we can sort by.\n */\n fields?: FieldPlugin[];\n}\n\nexport function sortItems<T = any>(params: Params<T>): T[] {\n const { items, sort: initialSort = [], fields = [] } = params;\n /**\n * Skip sorting if nothing was passed to sort by or nothing to sort.\n */\n if (items.length <= 1 || Array.isArray(initialSort) === false || initialSort.length === 0) {\n return items;\n }\n\n const info: Info = {\n sorters: [],\n orders: []\n };\n\n for (const sort of initialSort) {\n /**\n * Possibly empty array item was passed.\n */\n if (!sort) {\n continue;\n }\n const { field, reverse } = extractSort(sort, fields);\n const fieldPlugin = fields.find(f => f.getField() === field);\n const path = fieldPlugin ? fieldPlugin.getPath() : field;\n\n info.sorters.push(path);\n info.orders.push(reverse === true ? \"desc\" : \"asc\");\n }\n\n if (info.sorters.length === 0) {\n return items;\n }\n\n return lodashOrderBy(items, info.sorters, info.orders);\n}\n"],"mappings":";;;;;;;AAAA;AACA;AAaA,MAAMA,WAAW,GAAG,CAACC,MAAc,EAAEC,MAAqB,KAAe;EACrE,MAAMC,MAAM,GAAGF,MAAM,CAACG,KAAK,CAAC,GAAG,CAAC;EAChC,IAAID,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE;IACrB,MAAM,IAAIC,cAAW,CACjB,yDAAyD,EACzD,YAAY,EACZ;MACIL;IACJ,CAAC,CACJ;EACL;EACA,MAAM,CAACM,KAAK,EAAEC,KAAK,CAAC,GAAGL,MAAM;EAE7B,IAAI,CAACI,KAAK,EAAE;IACR,MAAM,IAAID,cAAW,CAAC,+BAA+B,EAAE,qBAAqB,EAAE;MAC1EC,KAAK;MACLC,KAAK;MACLN;IACJ,CAAC,CAAC;EACN;EACA,MAAMO,WAAW,GAAGP,MAAM,CAACQ,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,EAAE,KAAKL,KAAK,CAAC;EAC5D,MAAMM,UAAU,GAAGJ,WAAW,GAAGA,WAAW,CAACI,UAAU,EAAE,GAAG,IAAI;EAChE,IAAIA,UAAU,KAAK,KAAK,EAAE;IACtB,MAAM,IAAIP,cAAW,CAAE,gCAA+BC,KAAM,IAAG,EAAE,wBAAwB,EAAE;MACvFL,MAAM;MACNK;IACJ,CAAC,CAAC;EACN;EAEA,OAAO;IACHA,KAAK;IACLO,OAAO,EAAEN,KAAK,CAACO,WAAW,EAAE,KAAK;EACrC,CAAC;AACL,CAAC;AAiBM,SAASC,SAAS,CAAUC,MAAiB,EAAO;EACvD,MAAM;IAAEC,KAAK;IAAEC,IAAI,EAAEC,WAAW,GAAG,EAAE;IAAElB,MAAM,GAAG;EAAG,CAAC,GAAGe,MAAM;EAC7D;AACJ;AACA;EACI,IAAIC,KAAK,CAACb,MAAM,IAAI,CAAC,IAAIgB,KAAK,CAACC,OAAO,CAACF,WAAW,CAAC,KAAK,KAAK,IAAIA,WAAW,CAACf,MAAM,KAAK,CAAC,EAAE;IACvF,OAAOa,KAAK;EAChB;EAEA,MAAMK,IAAU,GAAG;IACfC,OAAO,EAAE,EAAE;IACXC,MAAM,EAAE;EACZ,CAAC;EAED,KAAK,MAAMN,IAAI,IAAIC,WAAW,EAAE;IAC5B;AACR;AACA;IACQ,IAAI,CAACD,IAAI,EAAE;MACP;IACJ;IACA,MAAM;MAAEZ,KAAK;MAAEO;IAAQ,CAAC,GAAGd,WAAW,CAACmB,IAAI,EAAEjB,MAAM,CAAC;IACpD,MAAMO,WAAW,GAAGP,MAAM,CAACQ,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,EAAE,KAAKL,KAAK,CAAC;IAC5D,MAAMmB,IAAI,GAAGjB,WAAW,GAAGA,WAAW,CAACkB,OAAO,EAAE,GAAGpB,KAAK;IAExDgB,IAAI,CAACC,OAAO,CAACI,IAAI,CAACF,IAAI,CAAC;IACvBH,IAAI,CAACE,MAAM,CAACG,IAAI,CAACd,OAAO,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;EACvD;EAEA,IAAIS,IAAI,CAACC,OAAO,CAACnB,MAAM,KAAK,CAAC,EAAE;IAC3B,OAAOa,KAAK;EAChB;EAEA,OAAO,IAAAW,gBAAa,EAACX,KAAK,EAAEK,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC;AAC1D"}
package/utils/table.js CHANGED
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.getTable = void 0;
9
-
10
8
  var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
9
  /**
13
10
  * Will be removed in favor of passing the table name directly to the storage operations.
14
11
  *
@@ -20,8 +17,6 @@ const getTable = context => {
20
17
  } else if (!context.db.table) {
21
18
  throw new _error.default("Missing table on context.db.", "TABLE_ERROR");
22
19
  }
23
-
24
20
  return context.db.table;
25
21
  };
26
-
27
22
  exports.getTable = getTable;
@@ -1 +1 @@
1
- {"version":3,"names":["getTable","context","db","WebinyError","table"],"sources":["table.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { DbContext } from \"@webiny/handler-db/types\";\n\n/**\n * Will be removed in favor of passing the table name directly to the storage operations.\n *\n * @deprecated\n */\nexport const getTable = <T extends DbContext>(context: T): string => {\n if (!context.db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!context.db.table) {\n throw new WebinyError(\"Missing table on context.db.\", \"TABLE_ERROR\");\n }\n return context.db.table;\n};\n"],"mappings":";;;;;;;;;AAAA;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAAyBC,OAAtB,IAA6C;EACjE,IAAI,CAACA,OAAO,CAACC,EAAb,EAAiB;IACb,MAAM,IAAIC,cAAJ,CAAgB,wBAAhB,EAA0C,UAA1C,CAAN;EACH,CAFD,MAEO,IAAI,CAACF,OAAO,CAACC,EAAR,CAAWE,KAAhB,EAAuB;IAC1B,MAAM,IAAID,cAAJ,CAAgB,8BAAhB,EAAgD,aAAhD,CAAN;EACH;;EACD,OAAOF,OAAO,CAACC,EAAR,CAAWE,KAAlB;AACH,CAPM"}
1
+ {"version":3,"names":["getTable","context","db","WebinyError","table"],"sources":["table.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { DbContext } from \"@webiny/handler-db/types\";\n\n/**\n * Will be removed in favor of passing the table name directly to the storage operations.\n *\n * @deprecated\n */\nexport const getTable = <T extends DbContext>(context: T): string => {\n if (!context.db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!context.db.table) {\n throw new WebinyError(\"Missing table on context.db.\", \"TABLE_ERROR\");\n }\n return context.db.table;\n};\n"],"mappings":";;;;;;;AAAA;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,GAAyBC,OAAU,IAAa;EACjE,IAAI,CAACA,OAAO,CAACC,EAAE,EAAE;IACb,MAAM,IAAIC,cAAW,CAAC,wBAAwB,EAAE,UAAU,CAAC;EAC/D,CAAC,MAAM,IAAI,CAACF,OAAO,CAACC,EAAE,CAACE,KAAK,EAAE;IAC1B,MAAM,IAAID,cAAW,CAAC,8BAA8B,EAAE,aAAa,CAAC;EACxE;EACA,OAAOF,OAAO,CAACC,EAAE,CAACE,KAAK;AAC3B,CAAC;AAAC"}