@nomalism-com/api 0.18.4 → 0.18.6

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 (128) hide show
  1. package/dist/index.min.js +1 -1
  2. package/package.json +10 -7
  3. package/dist/index.js +0 -460
  4. package/dist/modules/document/inventario.js +0 -60
  5. package/dist/modules/document/materialEntrance.js +0 -107
  6. package/dist/modules/document/order.js +0 -169
  7. package/dist/modules/document/propostaSheets.js +0 -148
  8. package/dist/modules/document/purchase.js +0 -100
  9. package/dist/modules/document/quebra.js +0 -100
  10. package/dist/modules/document/returnToProvider.js +0 -88
  11. package/dist/modules/document/transformado.js +0 -61
  12. package/dist/modules/document/upfrontReturn.js +0 -61
  13. package/dist/modules/documentManagement/multimedia.js +0 -82
  14. package/dist/modules/integration/emailLog.js +0 -75
  15. package/dist/modules/integration/emailTemplate.js +0 -112
  16. package/dist/modules/integration/emailTemplateAttachment.js +0 -73
  17. package/dist/modules/integration/errorHandler.js +0 -60
  18. package/dist/modules/integration/field.js +0 -102
  19. package/dist/modules/integration/fieldGroup.js +0 -131
  20. package/dist/modules/integration/file.js +0 -89
  21. package/dist/modules/integration/googleFilePermission.js +0 -100
  22. package/dist/modules/integration/googleSheets.js +0 -101
  23. package/dist/modules/integration/history.js +0 -66
  24. package/dist/modules/integration/observation.js +0 -102
  25. package/dist/modules/integration/observationType.js +0 -115
  26. package/dist/modules/integration/projectInfo.js +0 -60
  27. package/dist/modules/integration/settings.js +0 -115
  28. package/dist/modules/print/npc.js +0 -74
  29. package/dist/modules/print/printer.js +0 -87
  30. package/dist/modules/print/schedulePrintJob.js +0 -98
  31. package/dist/modules/stock/attribute.js +0 -160
  32. package/dist/modules/stock/attributeValue.js +0 -156
  33. package/dist/modules/stock/color.js +0 -155
  34. package/dist/modules/stock/composition.js +0 -141
  35. package/dist/modules/stock/compositionMaterial.js +0 -156
  36. package/dist/modules/stock/location.js +0 -156
  37. package/dist/modules/stock/maintenance.js +0 -156
  38. package/dist/modules/stock/maintenanceAssoc.js +0 -141
  39. package/dist/modules/stock/maintenancePreset.js +0 -126
  40. package/dist/modules/stock/maintenancePresetAssoc.js +0 -99
  41. package/dist/modules/stock/maintenanceType.js +0 -156
  42. package/dist/modules/stock/primaryColor.js +0 -156
  43. package/dist/modules/stock/prison.js +0 -128
  44. package/dist/modules/stock/product.js +0 -291
  45. package/dist/modules/stock/productAttribute.js +0 -141
  46. package/dist/modules/stock/productCategory.js +0 -156
  47. package/dist/modules/stock/productColor.js +0 -141
  48. package/dist/modules/stock/productImage.js +0 -145
  49. package/dist/modules/stock/productName.js +0 -156
  50. package/dist/modules/stock/productNamePreset.js +0 -156
  51. package/dist/modules/stock/productPart.js +0 -155
  52. package/dist/modules/stock/productSubCategory.js +0 -155
  53. package/dist/modules/stock/productUse.js +0 -156
  54. package/dist/modules/stock/productUseAssoc.js +0 -140
  55. package/dist/modules/stock/promotion.js +0 -176
  56. package/dist/modules/stock/promotionAssoc.js +0 -141
  57. package/dist/modules/stock/queryList.js +0 -158
  58. package/dist/modules/stock/queryParameter.js +0 -129
  59. package/dist/modules/stock/returnReason.js +0 -100
  60. package/dist/modules/stock/savedEmPicking.js +0 -74
  61. package/dist/modules/stock/savedProviderProposal.js +0 -100
  62. package/dist/modules/stock/schedule.js +0 -64
  63. package/dist/modules/stock/similarProduct.js +0 -141
  64. package/dist/modules/stock/stockMovement.js +0 -103
  65. package/dist/modules/stock/typeOfInventory.js +0 -156
  66. package/dist/modules/stock/typeOfLocation.js +0 -156
  67. package/dist/modules/stock/unitOfMeasure.js +0 -156
  68. package/dist/modules/stock/vatTax.js +0 -156
  69. package/dist/modules/stock/vatTaxZone.js +0 -156
  70. package/dist/modules/supply/cabide.js +0 -177
  71. package/dist/modules/supply/cabideProduct.js +0 -166
  72. package/dist/modules/supply/clientCurrentAccount.js +0 -132
  73. package/dist/modules/supply/documentHeader.js +0 -476
  74. package/dist/modules/supply/documentLine.js +0 -173
  75. package/dist/modules/supply/documentLineAssoc.js +0 -99
  76. package/dist/modules/supply/documentLineFolder.js +0 -100
  77. package/dist/modules/supply/documentLineNote.js +0 -87
  78. package/dist/modules/supply/documentSet.js +0 -126
  79. package/dist/modules/supply/documentType.js +0 -130
  80. package/dist/modules/supply/externalDocumentHeader.js +0 -151
  81. package/dist/modules/supply/externalDocumentType.js +0 -74
  82. package/dist/modules/supply/moloniRequest.js +0 -60
  83. package/dist/modules/supply/orderManagement.js +0 -91
  84. package/dist/modules/supply/payment.js +0 -262
  85. package/dist/modules/supply/preSale.js +0 -152
  86. package/dist/modules/supply/preSaleProduct.js +0 -74
  87. package/dist/modules/supply/providerCurrentAccount.js +0 -63
  88. package/dist/modules/supply/startDocumentHeaderLastUpdate.js +0 -61
  89. package/dist/modules/supply/vatValidation.js +0 -65
  90. package/dist/modules/supply/workflow.js +0 -113
  91. package/dist/modules/tickets/channel.js +0 -126
  92. package/dist/modules/tickets/clt.js +0 -126
  93. package/dist/modules/tickets/language.js +0 -126
  94. package/dist/modules/tickets/tickets.js +0 -100
  95. package/dist/modules/user/bankData.js +0 -141
  96. package/dist/modules/user/clientType.js +0 -141
  97. package/dist/modules/user/clients.js +0 -169
  98. package/dist/modules/user/commissioner.js +0 -156
  99. package/dist/modules/user/country.js +0 -156
  100. package/dist/modules/user/deliveryMethods.js +0 -128
  101. package/dist/modules/user/favorites.js +0 -100
  102. package/dist/modules/user/groupPermission.js +0 -102
  103. package/dist/modules/user/language.js +0 -141
  104. package/dist/modules/user/logout.js +0 -60
  105. package/dist/modules/user/maturityDates.js +0 -128
  106. package/dist/modules/user/password.js +0 -72
  107. package/dist/modules/user/paymentCondition.js +0 -141
  108. package/dist/modules/user/paymentMethods.js +0 -128
  109. package/dist/modules/user/permission.js +0 -102
  110. package/dist/modules/user/persona.js +0 -130
  111. package/dist/modules/user/provider.js +0 -184
  112. package/dist/modules/user/providerType.js +0 -141
  113. package/dist/modules/user/purchaseCondition.js +0 -141
  114. package/dist/modules/user/reasonForExemption.js +0 -141
  115. package/dist/modules/user/refreshToken.js +0 -61
  116. package/dist/modules/user/segmentsArea.js +0 -141
  117. package/dist/modules/user/sessions.js +0 -61
  118. package/dist/modules/user/shippings.js +0 -141
  119. package/dist/modules/user/socialMedia.js +0 -141
  120. package/dist/modules/user/storeOperator.js +0 -169
  121. package/dist/modules/user/swift.js +0 -141
  122. package/dist/modules/user/tenant.js +0 -100
  123. package/dist/modules/user/user.js +0 -167
  124. package/dist/modules/user/userPermission.js +0 -89
  125. package/dist/modules/user/userPositions.js +0 -141
  126. package/dist/modules/user/vehicles.js +0 -100
  127. package/dist/modules/user/zipCode.js +0 -73
  128. package/dist/modules/view/eventHistory.js +0 -61
@@ -1,184 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var Repository = (function () {
40
- function Repository(_a) {
41
- var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
- this.api = api;
43
- this.route = route;
44
- this.publicRoute = publicRoute;
45
- }
46
- Repository.prototype.findByQuery = function (data) {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, this.api.post("".concat(this.route, "query"), data)];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.find = function (params) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- var response;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- Repository.prototype.findPaginated = function (params) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var response;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
78
- case 1:
79
- response = _a.sent();
80
- return [2, response.data];
81
- }
82
- });
83
- });
84
- };
85
- Repository.prototype.findMinified = function (params) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- var response;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0: return [4, this.api.get("".concat(this.route, "minified"), {
91
- params: params,
92
- })];
93
- case 1:
94
- response = _a.sent();
95
- return [2, response.data];
96
- }
97
- });
98
- });
99
- };
100
- Repository.prototype.findMinifiedManufacturer = function (params) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var response;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4, this.api.get("".concat(this.route, "minified_manufacturer"), {
106
- params: params,
107
- })];
108
- case 1:
109
- response = _a.sent();
110
- return [2, response.data];
111
- }
112
- });
113
- });
114
- };
115
- Repository.prototype.findByOwnerId = function (params) {
116
- return __awaiter(this, void 0, void 0, function () {
117
- var response;
118
- return __generator(this, function (_a) {
119
- switch (_a.label) {
120
- case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
121
- params: params,
122
- })];
123
- case 1:
124
- response = _a.sent();
125
- return [2, response.data];
126
- }
127
- });
128
- });
129
- };
130
- Repository.prototype.findById = function (selector) {
131
- return __awaiter(this, void 0, void 0, function () {
132
- var response;
133
- return __generator(this, function (_a) {
134
- switch (_a.label) {
135
- case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
136
- case 1:
137
- response = _a.sent();
138
- return [2, response.data];
139
- }
140
- });
141
- });
142
- };
143
- Repository.prototype.create = function (body) {
144
- return __awaiter(this, void 0, void 0, function () {
145
- var response;
146
- return __generator(this, function (_a) {
147
- switch (_a.label) {
148
- case 0: return [4, this.api.post("".concat(this.route), body)];
149
- case 1:
150
- response = _a.sent();
151
- return [2, response.data];
152
- }
153
- });
154
- });
155
- };
156
- Repository.prototype.update = function (selector, body) {
157
- return __awaiter(this, void 0, void 0, function () {
158
- var response;
159
- return __generator(this, function (_a) {
160
- switch (_a.label) {
161
- case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
162
- case 1:
163
- response = _a.sent();
164
- return [2, response.data];
165
- }
166
- });
167
- });
168
- };
169
- Repository.prototype.deleteOne = function (selector) {
170
- return __awaiter(this, void 0, void 0, function () {
171
- var response;
172
- return __generator(this, function (_a) {
173
- switch (_a.label) {
174
- case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
175
- case 1:
176
- response = _a.sent();
177
- return [2, response.data];
178
- }
179
- });
180
- });
181
- };
182
- return Repository;
183
- }());
184
- exports.default = Repository;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var Repository = (function () {
40
- function Repository(_a) {
41
- var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
- this.api = api;
43
- this.route = route;
44
- this.publicRoute = publicRoute;
45
- }
46
- Repository.prototype.find = function (params) {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.findPaginated = function (params) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- var response;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- Repository.prototype.findMinified = function (params) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var response;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4, this.api.get("".concat(this.route, "minified"), {
78
- params: params,
79
- })];
80
- case 1:
81
- response = _a.sent();
82
- return [2, response.data];
83
- }
84
- });
85
- });
86
- };
87
- Repository.prototype.findById = function (selector) {
88
- return __awaiter(this, void 0, void 0, function () {
89
- var response;
90
- return __generator(this, function (_a) {
91
- switch (_a.label) {
92
- case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
93
- case 1:
94
- response = _a.sent();
95
- return [2, response.data];
96
- }
97
- });
98
- });
99
- };
100
- Repository.prototype.create = function (body) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var response;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4, this.api.post("".concat(this.route), body)];
106
- case 1:
107
- response = _a.sent();
108
- return [2, response.data];
109
- }
110
- });
111
- });
112
- };
113
- Repository.prototype.update = function (selector, body) {
114
- return __awaiter(this, void 0, void 0, function () {
115
- var response;
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
119
- case 1:
120
- response = _a.sent();
121
- return [2, response.data];
122
- }
123
- });
124
- });
125
- };
126
- Repository.prototype.deleteOne = function (selector) {
127
- return __awaiter(this, void 0, void 0, function () {
128
- var response;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
132
- case 1:
133
- response = _a.sent();
134
- return [2, response.data];
135
- }
136
- });
137
- });
138
- };
139
- return Repository;
140
- }());
141
- exports.default = Repository;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var Repository = (function () {
40
- function Repository(_a) {
41
- var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
- this.api = api;
43
- this.route = route;
44
- this.publicRoute = publicRoute;
45
- }
46
- Repository.prototype.find = function (params) {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.findPaginated = function (params) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- var response;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- Repository.prototype.findByOwnerId = function (params) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var response;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
78
- params: params,
79
- })];
80
- case 1:
81
- response = _a.sent();
82
- return [2, response.data];
83
- }
84
- });
85
- });
86
- };
87
- Repository.prototype.findById = function (selector) {
88
- return __awaiter(this, void 0, void 0, function () {
89
- var response;
90
- return __generator(this, function (_a) {
91
- switch (_a.label) {
92
- case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
93
- case 1:
94
- response = _a.sent();
95
- return [2, response.data];
96
- }
97
- });
98
- });
99
- };
100
- Repository.prototype.create = function (body) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var response;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4, this.api.post("".concat(this.route), body)];
106
- case 1:
107
- response = _a.sent();
108
- return [2, response.data];
109
- }
110
- });
111
- });
112
- };
113
- Repository.prototype.update = function (selector, body) {
114
- return __awaiter(this, void 0, void 0, function () {
115
- var response;
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
119
- case 1:
120
- response = _a.sent();
121
- return [2, response.data];
122
- }
123
- });
124
- });
125
- };
126
- Repository.prototype.deleteOne = function (selector) {
127
- return __awaiter(this, void 0, void 0, function () {
128
- var response;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
132
- case 1:
133
- response = _a.sent();
134
- return [2, response.data];
135
- }
136
- });
137
- });
138
- };
139
- return Repository;
140
- }());
141
- exports.default = Repository;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var Repository = (function () {
40
- function Repository(_a) {
41
- var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
- this.api = api;
43
- this.route = route;
44
- this.publicRoute = publicRoute;
45
- }
46
- Repository.prototype.find = function (params) {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.findPaginated = function (params) {
60
- return __awaiter(this, void 0, void 0, function () {
61
- var response;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- Repository.prototype.findMinified = function (params) {
73
- return __awaiter(this, void 0, void 0, function () {
74
- var response;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0: return [4, this.api.get("".concat(this.route, "minified"), {
78
- params: params,
79
- })];
80
- case 1:
81
- response = _a.sent();
82
- return [2, response.data];
83
- }
84
- });
85
- });
86
- };
87
- Repository.prototype.findById = function (selector) {
88
- return __awaiter(this, void 0, void 0, function () {
89
- var response;
90
- return __generator(this, function (_a) {
91
- switch (_a.label) {
92
- case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
93
- case 1:
94
- response = _a.sent();
95
- return [2, response.data];
96
- }
97
- });
98
- });
99
- };
100
- Repository.prototype.create = function (body) {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var response;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0: return [4, this.api.post("".concat(this.route), body)];
106
- case 1:
107
- response = _a.sent();
108
- return [2, response.data];
109
- }
110
- });
111
- });
112
- };
113
- Repository.prototype.update = function (selector, body) {
114
- return __awaiter(this, void 0, void 0, function () {
115
- var response;
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
119
- case 1:
120
- response = _a.sent();
121
- return [2, response.data];
122
- }
123
- });
124
- });
125
- };
126
- Repository.prototype.deleteOne = function (selector) {
127
- return __awaiter(this, void 0, void 0, function () {
128
- var response;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
132
- case 1:
133
- response = _a.sent();
134
- return [2, response.data];
135
- }
136
- });
137
- });
138
- };
139
- return Repository;
140
- }());
141
- exports.default = Repository;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var Repository = (function () {
40
- function Repository(_a) {
41
- var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
- this.api = api;
43
- this.route = route;
44
- this.publicRoute = publicRoute;
45
- }
46
- Repository.prototype.create = function (body) {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var response;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0: return [4, this.api.post("".concat(this.publicRoute), body)];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- return Repository;
60
- }());
61
- exports.default = Repository;