@nomalism-com/api 0.18.5 → 0.18.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 (129) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/modules/document/materialEntrance.d.ts +1 -1
  3. package/package.json +11 -8
  4. package/dist/index.js +0 -460
  5. package/dist/modules/document/inventario.js +0 -60
  6. package/dist/modules/document/materialEntrance.js +0 -107
  7. package/dist/modules/document/order.js +0 -169
  8. package/dist/modules/document/propostaSheets.js +0 -148
  9. package/dist/modules/document/purchase.js +0 -100
  10. package/dist/modules/document/quebra.js +0 -100
  11. package/dist/modules/document/returnToProvider.js +0 -88
  12. package/dist/modules/document/transformado.js +0 -61
  13. package/dist/modules/document/upfrontReturn.js +0 -61
  14. package/dist/modules/documentManagement/multimedia.js +0 -82
  15. package/dist/modules/integration/emailLog.js +0 -75
  16. package/dist/modules/integration/emailTemplate.js +0 -112
  17. package/dist/modules/integration/emailTemplateAttachment.js +0 -73
  18. package/dist/modules/integration/errorHandler.js +0 -60
  19. package/dist/modules/integration/field.js +0 -102
  20. package/dist/modules/integration/fieldGroup.js +0 -131
  21. package/dist/modules/integration/file.js +0 -89
  22. package/dist/modules/integration/googleFilePermission.js +0 -100
  23. package/dist/modules/integration/googleSheets.js +0 -101
  24. package/dist/modules/integration/history.js +0 -66
  25. package/dist/modules/integration/observation.js +0 -102
  26. package/dist/modules/integration/observationType.js +0 -115
  27. package/dist/modules/integration/projectInfo.js +0 -60
  28. package/dist/modules/integration/settings.js +0 -115
  29. package/dist/modules/print/npc.js +0 -74
  30. package/dist/modules/print/printer.js +0 -87
  31. package/dist/modules/print/schedulePrintJob.js +0 -98
  32. package/dist/modules/stock/attribute.js +0 -160
  33. package/dist/modules/stock/attributeValue.js +0 -156
  34. package/dist/modules/stock/color.js +0 -155
  35. package/dist/modules/stock/composition.js +0 -141
  36. package/dist/modules/stock/compositionMaterial.js +0 -156
  37. package/dist/modules/stock/location.js +0 -156
  38. package/dist/modules/stock/maintenance.js +0 -156
  39. package/dist/modules/stock/maintenanceAssoc.js +0 -141
  40. package/dist/modules/stock/maintenancePreset.js +0 -126
  41. package/dist/modules/stock/maintenancePresetAssoc.js +0 -99
  42. package/dist/modules/stock/maintenanceType.js +0 -156
  43. package/dist/modules/stock/primaryColor.js +0 -156
  44. package/dist/modules/stock/prison.js +0 -128
  45. package/dist/modules/stock/product.js +0 -291
  46. package/dist/modules/stock/productAttribute.js +0 -141
  47. package/dist/modules/stock/productCategory.js +0 -156
  48. package/dist/modules/stock/productColor.js +0 -141
  49. package/dist/modules/stock/productImage.js +0 -145
  50. package/dist/modules/stock/productName.js +0 -156
  51. package/dist/modules/stock/productNamePreset.js +0 -156
  52. package/dist/modules/stock/productPart.js +0 -155
  53. package/dist/modules/stock/productSubCategory.js +0 -155
  54. package/dist/modules/stock/productUse.js +0 -156
  55. package/dist/modules/stock/productUseAssoc.js +0 -140
  56. package/dist/modules/stock/promotion.js +0 -176
  57. package/dist/modules/stock/promotionAssoc.js +0 -141
  58. package/dist/modules/stock/queryList.js +0 -158
  59. package/dist/modules/stock/queryParameter.js +0 -129
  60. package/dist/modules/stock/returnReason.js +0 -100
  61. package/dist/modules/stock/savedEmPicking.js +0 -74
  62. package/dist/modules/stock/savedProviderProposal.js +0 -100
  63. package/dist/modules/stock/schedule.js +0 -64
  64. package/dist/modules/stock/similarProduct.js +0 -141
  65. package/dist/modules/stock/stockMovement.js +0 -103
  66. package/dist/modules/stock/typeOfInventory.js +0 -156
  67. package/dist/modules/stock/typeOfLocation.js +0 -156
  68. package/dist/modules/stock/unitOfMeasure.js +0 -156
  69. package/dist/modules/stock/vatTax.js +0 -156
  70. package/dist/modules/stock/vatTaxZone.js +0 -156
  71. package/dist/modules/supply/cabide.js +0 -177
  72. package/dist/modules/supply/cabideProduct.js +0 -166
  73. package/dist/modules/supply/clientCurrentAccount.js +0 -132
  74. package/dist/modules/supply/documentHeader.js +0 -476
  75. package/dist/modules/supply/documentLine.js +0 -173
  76. package/dist/modules/supply/documentLineAssoc.js +0 -99
  77. package/dist/modules/supply/documentLineFolder.js +0 -100
  78. package/dist/modules/supply/documentLineNote.js +0 -87
  79. package/dist/modules/supply/documentSet.js +0 -126
  80. package/dist/modules/supply/documentType.js +0 -130
  81. package/dist/modules/supply/externalDocumentHeader.js +0 -151
  82. package/dist/modules/supply/externalDocumentType.js +0 -74
  83. package/dist/modules/supply/moloniRequest.js +0 -60
  84. package/dist/modules/supply/orderManagement.js +0 -91
  85. package/dist/modules/supply/payment.js +0 -262
  86. package/dist/modules/supply/preSale.js +0 -152
  87. package/dist/modules/supply/preSaleProduct.js +0 -74
  88. package/dist/modules/supply/providerCurrentAccount.js +0 -63
  89. package/dist/modules/supply/startDocumentHeaderLastUpdate.js +0 -61
  90. package/dist/modules/supply/vatValidation.js +0 -65
  91. package/dist/modules/supply/workflow.js +0 -113
  92. package/dist/modules/tickets/channel.js +0 -126
  93. package/dist/modules/tickets/clt.js +0 -126
  94. package/dist/modules/tickets/language.js +0 -126
  95. package/dist/modules/tickets/tickets.js +0 -100
  96. package/dist/modules/user/bankData.js +0 -141
  97. package/dist/modules/user/clientType.js +0 -141
  98. package/dist/modules/user/clients.js +0 -169
  99. package/dist/modules/user/commissioner.js +0 -156
  100. package/dist/modules/user/country.js +0 -156
  101. package/dist/modules/user/deliveryMethods.js +0 -128
  102. package/dist/modules/user/favorites.js +0 -100
  103. package/dist/modules/user/groupPermission.js +0 -102
  104. package/dist/modules/user/language.js +0 -141
  105. package/dist/modules/user/logout.js +0 -60
  106. package/dist/modules/user/maturityDates.js +0 -128
  107. package/dist/modules/user/password.js +0 -72
  108. package/dist/modules/user/paymentCondition.js +0 -141
  109. package/dist/modules/user/paymentMethods.js +0 -128
  110. package/dist/modules/user/permission.js +0 -102
  111. package/dist/modules/user/persona.js +0 -130
  112. package/dist/modules/user/provider.js +0 -184
  113. package/dist/modules/user/providerType.js +0 -141
  114. package/dist/modules/user/purchaseCondition.js +0 -141
  115. package/dist/modules/user/reasonForExemption.js +0 -141
  116. package/dist/modules/user/refreshToken.js +0 -61
  117. package/dist/modules/user/segmentsArea.js +0 -141
  118. package/dist/modules/user/sessions.js +0 -61
  119. package/dist/modules/user/shippings.js +0 -141
  120. package/dist/modules/user/socialMedia.js +0 -141
  121. package/dist/modules/user/storeOperator.js +0 -169
  122. package/dist/modules/user/swift.js +0 -141
  123. package/dist/modules/user/tenant.js +0 -100
  124. package/dist/modules/user/user.js +0 -167
  125. package/dist/modules/user/userPermission.js +0 -89
  126. package/dist/modules/user/userPositions.js +0 -141
  127. package/dist/modules/user/vehicles.js +0 -100
  128. package/dist/modules/user/zipCode.js +0 -73
  129. package/dist/modules/view/eventHistory.js +0 -61
@@ -1,151 +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.route), body)];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.update = function (selector, body) {
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.put("".concat(this.route).concat(selector.id), body)];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- Repository.prototype.findById = function (selector) {
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).concat(selector.id))];
78
- case 1:
79
- response = _a.sent();
80
- return [2, response.data];
81
- }
82
- });
83
- });
84
- };
85
- Repository.prototype.findByOwnerId = 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, "by_owner"), { params: params })];
91
- case 1:
92
- response = _a.sent();
93
- return [2, response.data];
94
- }
95
- });
96
- });
97
- };
98
- Repository.prototype.find = function (params) {
99
- return __awaiter(this, void 0, void 0, function () {
100
- var response;
101
- return __generator(this, function (_a) {
102
- switch (_a.label) {
103
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
104
- case 1:
105
- response = _a.sent();
106
- return [2, response.data];
107
- }
108
- });
109
- });
110
- };
111
- Repository.prototype.findPaginated = function (params) {
112
- return __awaiter(this, void 0, void 0, function () {
113
- var response;
114
- return __generator(this, function (_a) {
115
- switch (_a.label) {
116
- case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
117
- case 1:
118
- response = _a.sent();
119
- return [2, response.data];
120
- }
121
- });
122
- });
123
- };
124
- Repository.prototype.deleteOne = function (params) {
125
- return __awaiter(this, void 0, void 0, function () {
126
- var response;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
129
- case 0: return [4, this.api.get("".concat(this.route), { params: params })];
130
- case 1:
131
- response = _a.sent();
132
- return [2, response.data];
133
- }
134
- });
135
- });
136
- };
137
- Repository.prototype.sendEmailDocument = function (body) {
138
- return __awaiter(this, void 0, void 0, function () {
139
- return __generator(this, function (_a) {
140
- switch (_a.label) {
141
- case 0: return [4, this.api.post("".concat(this.route, "sendEmail"), body)];
142
- case 1:
143
- _a.sent();
144
- return [2];
145
- }
146
- });
147
- });
148
- };
149
- return Repository;
150
- }());
151
- exports.default = Repository;
@@ -1,74 +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 () {
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))];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.findMinified = 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, "minified"), { params: params })];
65
- case 1:
66
- response = _a.sent();
67
- return [2, response.data];
68
- }
69
- });
70
- });
71
- };
72
- return Repository;
73
- }());
74
- exports.default = Repository;
@@ -1,60 +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
- return __generator(this, function (_a) {
49
- switch (_a.label) {
50
- case 0: return [4, this.api.post("".concat(this.route), body)];
51
- case 1:
52
- _a.sent();
53
- return [2];
54
- }
55
- });
56
- });
57
- };
58
- return Repository;
59
- }());
60
- exports.default = Repository;
@@ -1,91 +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.findProviders = function () {
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, "providers"))];
52
- case 1:
53
- response = _a.sent();
54
- return [2, response.data];
55
- }
56
- });
57
- });
58
- };
59
- Repository.prototype.findProviderProducts = 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, "provider_products"), {
65
- params: params,
66
- })];
67
- case 1:
68
- response = _a.sent();
69
- return [2, response.data];
70
- }
71
- });
72
- });
73
- };
74
- Repository.prototype.findProductHistory = function (params) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var response;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
79
- case 0: return [4, this.api.get("".concat(this.route, "product_history"), {
80
- params: params,
81
- })];
82
- case 1:
83
- response = _a.sent();
84
- return [2, response.data];
85
- }
86
- });
87
- });
88
- };
89
- return Repository;
90
- }());
91
- exports.default = Repository;
@@ -1,262 +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.deleteBatch = function (selector) {
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.delete("".concat(this.route, "delete_batch").concat(selector.id))];
106
- case 1:
107
- response = _a.sent();
108
- return [2, response.data];
109
- }
110
- });
111
- });
112
- };
113
- Repository.prototype.findCurrentAccountByOwnerId = function (params) {
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.get("".concat(this.route, "current_account"), {
119
- params: params,
120
- })];
121
- case 1:
122
- response = _a.sent();
123
- return [2, response.data];
124
- }
125
- });
126
- });
127
- };
128
- Repository.prototype.findSettledMaterialEntrance = function (params) {
129
- return __awaiter(this, void 0, void 0, function () {
130
- var response;
131
- return __generator(this, function (_a) {
132
- switch (_a.label) {
133
- case 0: return [4, this.api.get("".concat(this.route, "settled_material_entrance"), {
134
- params: params,
135
- })];
136
- case 1:
137
- response = _a.sent();
138
- return [2, response.data];
139
- }
140
- });
141
- });
142
- };
143
- Repository.prototype.findSettledMaterialEntranceProviders = function () {
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.get("".concat(this.route, "settled_material_entrance_providers"))];
149
- case 1:
150
- response = _a.sent();
151
- return [2, response.data];
152
- }
153
- });
154
- });
155
- };
156
- Repository.prototype.createProvidersPayments = function (body) {
157
- return __awaiter(this, void 0, void 0, function () {
158
- return __generator(this, function (_a) {
159
- switch (_a.label) {
160
- case 0: return [4, this.api.post("".concat(this.route, "provider"), body)];
161
- case 1:
162
- _a.sent();
163
- return [2];
164
- }
165
- });
166
- });
167
- };
168
- Repository.prototype.findPaymentsNotExported = function () {
169
- return __awaiter(this, void 0, void 0, function () {
170
- var response;
171
- return __generator(this, function (_a) {
172
- switch (_a.label) {
173
- case 0: return [4, this.api.get("".concat(this.route, "not_exported"))];
174
- case 1:
175
- response = _a.sent();
176
- return [2, response.data];
177
- }
178
- });
179
- });
180
- };
181
- Repository.prototype.findPaymentBatches = function () {
182
- return __awaiter(this, void 0, void 0, function () {
183
- var response;
184
- return __generator(this, function (_a) {
185
- switch (_a.label) {
186
- case 0: return [4, this.api.get("".concat(this.route, "batches"))];
187
- case 1:
188
- response = _a.sent();
189
- return [2, response.data];
190
- }
191
- });
192
- });
193
- };
194
- Repository.prototype.updateDownloadedBatchNumber = function (params) {
195
- return __awaiter(this, void 0, void 0, function () {
196
- return __generator(this, function (_a) {
197
- switch (_a.label) {
198
- case 0: return [4, this.api.put("".concat(this.route, "downloaded_batch_number").concat(params))];
199
- case 1:
200
- _a.sent();
201
- return [2];
202
- }
203
- });
204
- });
205
- };
206
- Repository.prototype.exportCurrentAccount = function (params) {
207
- return __awaiter(this, void 0, void 0, function () {
208
- var response;
209
- return __generator(this, function (_a) {
210
- switch (_a.label) {
211
- case 0: return [4, this.api.get("".concat(this.publicRoute, "export_current_account"), {
212
- params: params,
213
- })];
214
- case 1:
215
- response = _a.sent();
216
- return [2, response.data];
217
- }
218
- });
219
- });
220
- };
221
- Repository.prototype.findSettledMaterialEntranceByDate = function (params) {
222
- return __awaiter(this, void 0, void 0, function () {
223
- var response;
224
- return __generator(this, function (_a) {
225
- switch (_a.label) {
226
- case 0: return [4, this.api.get("".concat(this.route, "settled_material_entrance_by_date"), {
227
- params: params,
228
- })];
229
- case 1:
230
- response = _a.sent();
231
- return [2, response.data];
232
- }
233
- });
234
- });
235
- };
236
- Repository.prototype.exportPayments = function (body) {
237
- return __awaiter(this, void 0, void 0, function () {
238
- return __generator(this, function (_a) {
239
- switch (_a.label) {
240
- case 0: return [4, this.api.post("".concat(this.route, "export_payments"), body)];
241
- case 1:
242
- _a.sent();
243
- return [2];
244
- }
245
- });
246
- });
247
- };
248
- Repository.prototype.getExportCurrentAccountUrl = function (_a) {
249
- var owner_id = _a.owner_id, start_date = _a.start_date, end_date = _a.end_date, output = _a.output, token = _a.token;
250
- var qs = new URLSearchParams();
251
- qs.set('owner_id', owner_id);
252
- qs.set('output', output);
253
- if (start_date)
254
- qs.set('start_date', start_date.toISOString());
255
- if (end_date)
256
- qs.set('end_date', end_date.toISOString());
257
- qs.set('token', token);
258
- return "".concat(this.publicRoute, "export_current_account?").concat(qs.toString());
259
- };
260
- return Repository;
261
- }());
262
- exports.default = Repository;