@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.
- package/dist/index.min.js +1 -1
- package/package.json +10 -7
- package/dist/index.js +0 -460
- package/dist/modules/document/inventario.js +0 -60
- package/dist/modules/document/materialEntrance.js +0 -107
- package/dist/modules/document/order.js +0 -169
- package/dist/modules/document/propostaSheets.js +0 -148
- package/dist/modules/document/purchase.js +0 -100
- package/dist/modules/document/quebra.js +0 -100
- package/dist/modules/document/returnToProvider.js +0 -88
- package/dist/modules/document/transformado.js +0 -61
- package/dist/modules/document/upfrontReturn.js +0 -61
- package/dist/modules/documentManagement/multimedia.js +0 -82
- package/dist/modules/integration/emailLog.js +0 -75
- package/dist/modules/integration/emailTemplate.js +0 -112
- package/dist/modules/integration/emailTemplateAttachment.js +0 -73
- package/dist/modules/integration/errorHandler.js +0 -60
- package/dist/modules/integration/field.js +0 -102
- package/dist/modules/integration/fieldGroup.js +0 -131
- package/dist/modules/integration/file.js +0 -89
- package/dist/modules/integration/googleFilePermission.js +0 -100
- package/dist/modules/integration/googleSheets.js +0 -101
- package/dist/modules/integration/history.js +0 -66
- package/dist/modules/integration/observation.js +0 -102
- package/dist/modules/integration/observationType.js +0 -115
- package/dist/modules/integration/projectInfo.js +0 -60
- package/dist/modules/integration/settings.js +0 -115
- package/dist/modules/print/npc.js +0 -74
- package/dist/modules/print/printer.js +0 -87
- package/dist/modules/print/schedulePrintJob.js +0 -98
- package/dist/modules/stock/attribute.js +0 -160
- package/dist/modules/stock/attributeValue.js +0 -156
- package/dist/modules/stock/color.js +0 -155
- package/dist/modules/stock/composition.js +0 -141
- package/dist/modules/stock/compositionMaterial.js +0 -156
- package/dist/modules/stock/location.js +0 -156
- package/dist/modules/stock/maintenance.js +0 -156
- package/dist/modules/stock/maintenanceAssoc.js +0 -141
- package/dist/modules/stock/maintenancePreset.js +0 -126
- package/dist/modules/stock/maintenancePresetAssoc.js +0 -99
- package/dist/modules/stock/maintenanceType.js +0 -156
- package/dist/modules/stock/primaryColor.js +0 -156
- package/dist/modules/stock/prison.js +0 -128
- package/dist/modules/stock/product.js +0 -291
- package/dist/modules/stock/productAttribute.js +0 -141
- package/dist/modules/stock/productCategory.js +0 -156
- package/dist/modules/stock/productColor.js +0 -141
- package/dist/modules/stock/productImage.js +0 -145
- package/dist/modules/stock/productName.js +0 -156
- package/dist/modules/stock/productNamePreset.js +0 -156
- package/dist/modules/stock/productPart.js +0 -155
- package/dist/modules/stock/productSubCategory.js +0 -155
- package/dist/modules/stock/productUse.js +0 -156
- package/dist/modules/stock/productUseAssoc.js +0 -140
- package/dist/modules/stock/promotion.js +0 -176
- package/dist/modules/stock/promotionAssoc.js +0 -141
- package/dist/modules/stock/queryList.js +0 -158
- package/dist/modules/stock/queryParameter.js +0 -129
- package/dist/modules/stock/returnReason.js +0 -100
- package/dist/modules/stock/savedEmPicking.js +0 -74
- package/dist/modules/stock/savedProviderProposal.js +0 -100
- package/dist/modules/stock/schedule.js +0 -64
- package/dist/modules/stock/similarProduct.js +0 -141
- package/dist/modules/stock/stockMovement.js +0 -103
- package/dist/modules/stock/typeOfInventory.js +0 -156
- package/dist/modules/stock/typeOfLocation.js +0 -156
- package/dist/modules/stock/unitOfMeasure.js +0 -156
- package/dist/modules/stock/vatTax.js +0 -156
- package/dist/modules/stock/vatTaxZone.js +0 -156
- package/dist/modules/supply/cabide.js +0 -177
- package/dist/modules/supply/cabideProduct.js +0 -166
- package/dist/modules/supply/clientCurrentAccount.js +0 -132
- package/dist/modules/supply/documentHeader.js +0 -476
- package/dist/modules/supply/documentLine.js +0 -173
- package/dist/modules/supply/documentLineAssoc.js +0 -99
- package/dist/modules/supply/documentLineFolder.js +0 -100
- package/dist/modules/supply/documentLineNote.js +0 -87
- package/dist/modules/supply/documentSet.js +0 -126
- package/dist/modules/supply/documentType.js +0 -130
- package/dist/modules/supply/externalDocumentHeader.js +0 -151
- package/dist/modules/supply/externalDocumentType.js +0 -74
- package/dist/modules/supply/moloniRequest.js +0 -60
- package/dist/modules/supply/orderManagement.js +0 -91
- package/dist/modules/supply/payment.js +0 -262
- package/dist/modules/supply/preSale.js +0 -152
- package/dist/modules/supply/preSaleProduct.js +0 -74
- package/dist/modules/supply/providerCurrentAccount.js +0 -63
- package/dist/modules/supply/startDocumentHeaderLastUpdate.js +0 -61
- package/dist/modules/supply/vatValidation.js +0 -65
- package/dist/modules/supply/workflow.js +0 -113
- package/dist/modules/tickets/channel.js +0 -126
- package/dist/modules/tickets/clt.js +0 -126
- package/dist/modules/tickets/language.js +0 -126
- package/dist/modules/tickets/tickets.js +0 -100
- package/dist/modules/user/bankData.js +0 -141
- package/dist/modules/user/clientType.js +0 -141
- package/dist/modules/user/clients.js +0 -169
- package/dist/modules/user/commissioner.js +0 -156
- package/dist/modules/user/country.js +0 -156
- package/dist/modules/user/deliveryMethods.js +0 -128
- package/dist/modules/user/favorites.js +0 -100
- package/dist/modules/user/groupPermission.js +0 -102
- package/dist/modules/user/language.js +0 -141
- package/dist/modules/user/logout.js +0 -60
- package/dist/modules/user/maturityDates.js +0 -128
- package/dist/modules/user/password.js +0 -72
- package/dist/modules/user/paymentCondition.js +0 -141
- package/dist/modules/user/paymentMethods.js +0 -128
- package/dist/modules/user/permission.js +0 -102
- package/dist/modules/user/persona.js +0 -130
- package/dist/modules/user/provider.js +0 -184
- package/dist/modules/user/providerType.js +0 -141
- package/dist/modules/user/purchaseCondition.js +0 -141
- package/dist/modules/user/reasonForExemption.js +0 -141
- package/dist/modules/user/refreshToken.js +0 -61
- package/dist/modules/user/segmentsArea.js +0 -141
- package/dist/modules/user/sessions.js +0 -61
- package/dist/modules/user/shippings.js +0 -141
- package/dist/modules/user/socialMedia.js +0 -141
- package/dist/modules/user/storeOperator.js +0 -169
- package/dist/modules/user/swift.js +0 -141
- package/dist/modules/user/tenant.js +0 -100
- package/dist/modules/user/user.js +0 -167
- package/dist/modules/user/userPermission.js +0 -89
- package/dist/modules/user/userPositions.js +0 -141
- package/dist/modules/user/vehicles.js +0 -100
- package/dist/modules/user/zipCode.js +0 -73
- package/dist/modules/view/eventHistory.js +0 -61
|
@@ -1,476 +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.findMinified = 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, "minified"), {
|
|
52
|
-
params: params,
|
|
53
|
-
})];
|
|
54
|
-
case 1:
|
|
55
|
-
response = _a.sent();
|
|
56
|
-
return [2, response.data];
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
Repository.prototype.findOne = function (selector) {
|
|
62
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var response;
|
|
64
|
-
return __generator(this, function (_a) {
|
|
65
|
-
switch (_a.label) {
|
|
66
|
-
case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
|
|
67
|
-
case 1:
|
|
68
|
-
response = _a.sent();
|
|
69
|
-
return [2, response.data];
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
Repository.prototype.findStart = function (selector) {
|
|
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, "/start/").concat(selector.id))];
|
|
80
|
-
case 1:
|
|
81
|
-
response = _a.sent();
|
|
82
|
-
return [2, response.data];
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
Repository.prototype.findByDocumentLineState = function (params) {
|
|
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, "by_document_line_state"), {
|
|
93
|
-
params: params,
|
|
94
|
-
})];
|
|
95
|
-
case 1:
|
|
96
|
-
response = _a.sent();
|
|
97
|
-
return [2, response.data];
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
Repository.prototype.findByBasicSearch = function (params) {
|
|
103
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
-
var response;
|
|
105
|
-
return __generator(this, function (_a) {
|
|
106
|
-
switch (_a.label) {
|
|
107
|
-
case 0: return [4, this.api.get("".concat(this.route, "basic_search"), {
|
|
108
|
-
params: params,
|
|
109
|
-
})];
|
|
110
|
-
case 1:
|
|
111
|
-
response = _a.sent();
|
|
112
|
-
return [2, response.data];
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
Repository.prototype.findByType = function (params) {
|
|
118
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
var response;
|
|
120
|
-
return __generator(this, function (_a) {
|
|
121
|
-
switch (_a.label) {
|
|
122
|
-
case 0: return [4, this.api.get("".concat(this.route, "by_type"), { params: params })];
|
|
123
|
-
case 1:
|
|
124
|
-
response = _a.sent();
|
|
125
|
-
return [2, response.data];
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
Repository.prototype.find = function (params) {
|
|
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), { params: params })];
|
|
136
|
-
case 1:
|
|
137
|
-
response = _a.sent();
|
|
138
|
-
return [2, response.data];
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
Repository.prototype.findByCommissionerId = function (params) {
|
|
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, "by_commissioner"), {
|
|
149
|
-
params: params,
|
|
150
|
-
})];
|
|
151
|
-
case 1:
|
|
152
|
-
response = _a.sent();
|
|
153
|
-
return [2, response.data];
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
Repository.prototype.findClientUnpaidCredit = function (params) {
|
|
159
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
-
var response;
|
|
161
|
-
return __generator(this, function (_a) {
|
|
162
|
-
switch (_a.label) {
|
|
163
|
-
case 0: return [4, this.api.get("".concat(this.route, "unpaid_credit"), {
|
|
164
|
-
params: params,
|
|
165
|
-
})];
|
|
166
|
-
case 1:
|
|
167
|
-
response = _a.sent();
|
|
168
|
-
return [2, response.data];
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
Repository.prototype.findClientUnpaidDebit = function (params) {
|
|
174
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
175
|
-
var response;
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
switch (_a.label) {
|
|
178
|
-
case 0: return [4, this.api.get("".concat(this.route, "unpaid_debit"), {
|
|
179
|
-
params: params,
|
|
180
|
-
})];
|
|
181
|
-
case 1:
|
|
182
|
-
response = _a.sent();
|
|
183
|
-
return [2, response.data];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
Repository.prototype.findUnpaidCommissions = function (params) {
|
|
189
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
-
var response;
|
|
191
|
-
return __generator(this, function (_a) {
|
|
192
|
-
switch (_a.label) {
|
|
193
|
-
case 0: return [4, this.api.get("".concat(this.route, "unpaid_commissions"), {
|
|
194
|
-
params: params,
|
|
195
|
-
})];
|
|
196
|
-
case 1:
|
|
197
|
-
response = _a.sent();
|
|
198
|
-
return [2, response.data];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
Repository.prototype.create = function (body) {
|
|
204
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
205
|
-
var response;
|
|
206
|
-
return __generator(this, function (_a) {
|
|
207
|
-
switch (_a.label) {
|
|
208
|
-
case 0: return [4, this.api.post("".concat(this.route), body)];
|
|
209
|
-
case 1:
|
|
210
|
-
response = _a.sent();
|
|
211
|
-
return [2, response.data];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
Repository.prototype.createFromHeader = function (body) {
|
|
217
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
218
|
-
var response;
|
|
219
|
-
return __generator(this, function (_a) {
|
|
220
|
-
switch (_a.label) {
|
|
221
|
-
case 0: return [4, this.api.post("".concat(this.route, "from_header"), body)];
|
|
222
|
-
case 1:
|
|
223
|
-
response = _a.sent();
|
|
224
|
-
return [2, response.data];
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
Repository.prototype.createProductionOrder = function (body) {
|
|
230
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
231
|
-
return __generator(this, function (_a) {
|
|
232
|
-
switch (_a.label) {
|
|
233
|
-
case 0: return [4, this.api.post("".concat(this.route, "production_order"), body)];
|
|
234
|
-
case 1:
|
|
235
|
-
_a.sent();
|
|
236
|
-
return [2];
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
Repository.prototype.update = function (selector, body) {
|
|
242
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
243
|
-
var response;
|
|
244
|
-
return __generator(this, function (_a) {
|
|
245
|
-
switch (_a.label) {
|
|
246
|
-
case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
|
|
247
|
-
case 1:
|
|
248
|
-
response = _a.sent();
|
|
249
|
-
return [2, response.data];
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
Repository.prototype.deleteOne = function (selector) {
|
|
255
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
-
return __generator(this, function (_a) {
|
|
257
|
-
switch (_a.label) {
|
|
258
|
-
case 0: return [4, this.api.delete("".concat(this.route).concat(selector.id))];
|
|
259
|
-
case 1:
|
|
260
|
-
_a.sent();
|
|
261
|
-
return [2];
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
Repository.prototype.getActions = function (selector) {
|
|
267
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
268
|
-
var response;
|
|
269
|
-
return __generator(this, function (_a) {
|
|
270
|
-
switch (_a.label) {
|
|
271
|
-
case 0: return [4, this.api.get("".concat(this.route, "get_actions/").concat(selector.id))];
|
|
272
|
-
case 1:
|
|
273
|
-
response = _a.sent();
|
|
274
|
-
return [2, response.data];
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
|
-
Repository.prototype.findMaterialEntranceProviders = function () {
|
|
280
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
281
|
-
var response;
|
|
282
|
-
return __generator(this, function (_a) {
|
|
283
|
-
switch (_a.label) {
|
|
284
|
-
case 0: return [4, this.api.get("".concat(this.route, "material_entrance_providers"))];
|
|
285
|
-
case 1:
|
|
286
|
-
response = _a.sent();
|
|
287
|
-
return [2, response.data];
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
Repository.prototype.findProviderInvoice = function (params) {
|
|
293
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
294
|
-
var response;
|
|
295
|
-
return __generator(this, function (_a) {
|
|
296
|
-
switch (_a.label) {
|
|
297
|
-
case 0: return [4, this.api.get("".concat(this.route, "provider_invoice"), {
|
|
298
|
-
params: params,
|
|
299
|
-
})];
|
|
300
|
-
case 1:
|
|
301
|
-
response = _a.sent();
|
|
302
|
-
return [2, response.data];
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
};
|
|
307
|
-
Repository.prototype.createProviderFinancialCreditNote = function (data) {
|
|
308
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
-
return __generator(this, function (_a) {
|
|
310
|
-
switch (_a.label) {
|
|
311
|
-
case 0: return [4, this.api.post("".concat(this.route, "provider_financial_credit_note"), data)];
|
|
312
|
-
case 1:
|
|
313
|
-
_a.sent();
|
|
314
|
-
return [2];
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
};
|
|
319
|
-
Repository.prototype.createProviderServiceInvoice = function (data) {
|
|
320
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
321
|
-
return __generator(this, function (_a) {
|
|
322
|
-
switch (_a.label) {
|
|
323
|
-
case 0: return [4, this.api.post("".concat(this.route, "provider_service_invoice"), data)];
|
|
324
|
-
case 1:
|
|
325
|
-
_a.sent();
|
|
326
|
-
return [2];
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
};
|
|
331
|
-
Repository.prototype.findProviderReturn = function (params) {
|
|
332
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
333
|
-
var response;
|
|
334
|
-
return __generator(this, function (_a) {
|
|
335
|
-
switch (_a.label) {
|
|
336
|
-
case 0: return [4, this.api.get("".concat(this.route, "provider_return"), {
|
|
337
|
-
params: params,
|
|
338
|
-
})];
|
|
339
|
-
case 1:
|
|
340
|
-
response = _a.sent();
|
|
341
|
-
return [2, response.data];
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
};
|
|
346
|
-
Repository.prototype.createProviderCreditNoteFromReturn = function (data) {
|
|
347
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
348
|
-
return __generator(this, function (_a) {
|
|
349
|
-
switch (_a.label) {
|
|
350
|
-
case 0: return [4, this.api.post("".concat(this.route, "provider_credit_note_from_return"), data)];
|
|
351
|
-
case 1:
|
|
352
|
-
_a.sent();
|
|
353
|
-
return [2];
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
};
|
|
358
|
-
Repository.prototype.transferClientOwnership = function (data) {
|
|
359
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
360
|
-
return __generator(this, function (_a) {
|
|
361
|
-
switch (_a.label) {
|
|
362
|
-
case 0: return [4, this.api.put("".concat(this.route, "transfer_client_ownership"), data)];
|
|
363
|
-
case 1:
|
|
364
|
-
_a.sent();
|
|
365
|
-
return [2];
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
};
|
|
370
|
-
Repository.prototype.updateManyWithPersona = function (data) {
|
|
371
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
372
|
-
return __generator(this, function (_a) {
|
|
373
|
-
switch (_a.label) {
|
|
374
|
-
case 0: return [4, this.api.put("".concat(this.route, "update_many_with_persona"), data)];
|
|
375
|
-
case 1:
|
|
376
|
-
_a.sent();
|
|
377
|
-
return [2];
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
});
|
|
381
|
-
};
|
|
382
|
-
Repository.prototype.sendClientNotification = function (_a, data) {
|
|
383
|
-
var id = _a.id;
|
|
384
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
385
|
-
return __generator(this, function (_b) {
|
|
386
|
-
switch (_b.label) {
|
|
387
|
-
case 0: return [4, this.api.post("".concat(this.route).concat(id, "/send_client_notification"), data)];
|
|
388
|
-
case 1:
|
|
389
|
-
_b.sent();
|
|
390
|
-
return [2];
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
|
-
Repository.prototype.markUnsentClientNotification = function (_a) {
|
|
396
|
-
var id = _a.id;
|
|
397
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
-
return __generator(this, function (_b) {
|
|
399
|
-
switch (_b.label) {
|
|
400
|
-
case 0: return [4, this.api.post("".concat(this.route).concat(id, "/mark_unsent_client_notification"))];
|
|
401
|
-
case 1:
|
|
402
|
-
_b.sent();
|
|
403
|
-
return [2];
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
Repository.prototype.documentPdf = function (_a) {
|
|
409
|
-
var id = _a.id;
|
|
410
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
411
|
-
var result;
|
|
412
|
-
return __generator(this, function (_b) {
|
|
413
|
-
switch (_b.label) {
|
|
414
|
-
case 0: return [4, this.api.post("".concat(this.route, "document_pdf/").concat(id))];
|
|
415
|
-
case 1:
|
|
416
|
-
result = _b.sent();
|
|
417
|
-
return [2, result.data];
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
Repository.prototype.documentPdfStream = function (_a, params) {
|
|
423
|
-
var id = _a.id;
|
|
424
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
425
|
-
var result;
|
|
426
|
-
return __generator(this, function (_b) {
|
|
427
|
-
switch (_b.label) {
|
|
428
|
-
case 0: return [4, this.api.get("".concat(this.route, "document_pdf/").concat(id), {
|
|
429
|
-
params: params,
|
|
430
|
-
responseType: 'arraybuffer',
|
|
431
|
-
})];
|
|
432
|
-
case 1:
|
|
433
|
-
result = _b.sent();
|
|
434
|
-
return [2, result.data];
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
Repository.prototype.getDocumentPdfUrl = function (_a, data) {
|
|
440
|
-
var id = _a.id;
|
|
441
|
-
var qs = new URLSearchParams();
|
|
442
|
-
if (data === null || data === void 0 ? void 0 : data.token) {
|
|
443
|
-
qs.set('token', data.token);
|
|
444
|
-
}
|
|
445
|
-
return "".concat(this.route, "document_pdf/").concat(id, "?").concat(qs.toString());
|
|
446
|
-
};
|
|
447
|
-
Repository.prototype.documentList = function (_a) {
|
|
448
|
-
var id = _a.id;
|
|
449
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
450
|
-
var result;
|
|
451
|
-
return __generator(this, function (_b) {
|
|
452
|
-
switch (_b.label) {
|
|
453
|
-
case 0: return [4, this.api.post("".concat(this.route, "document_list/").concat(id))];
|
|
454
|
-
case 1:
|
|
455
|
-
result = _b.sent();
|
|
456
|
-
return [2, result.data];
|
|
457
|
-
}
|
|
458
|
-
});
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
Repository.prototype.createProviderProposal = function (data) {
|
|
462
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
463
|
-
var result;
|
|
464
|
-
return __generator(this, function (_a) {
|
|
465
|
-
switch (_a.label) {
|
|
466
|
-
case 0: return [4, this.api.post("".concat(this.route, "provider_proposal"), data)];
|
|
467
|
-
case 1:
|
|
468
|
-
result = _a.sent();
|
|
469
|
-
return [2, result.data];
|
|
470
|
-
}
|
|
471
|
-
});
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
return Repository;
|
|
475
|
-
}());
|
|
476
|
-
exports.default = Repository;
|
|
@@ -1,173 +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
|
-
exports.IMetadataPlugins = void 0;
|
|
40
|
-
var types_1 = require("@nomalism-com/types");
|
|
41
|
-
exports.IMetadataPlugins = types_1.DocumentLine.IMetadataPlugins;
|
|
42
|
-
var Repository = (function () {
|
|
43
|
-
function Repository(_a) {
|
|
44
|
-
var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
|
|
45
|
-
this.api = api;
|
|
46
|
-
this.route = route;
|
|
47
|
-
this.publicRoute = publicRoute;
|
|
48
|
-
}
|
|
49
|
-
Repository.prototype.findByState = function (params) {
|
|
50
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
51
|
-
var response;
|
|
52
|
-
return __generator(this, function (_a) {
|
|
53
|
-
switch (_a.label) {
|
|
54
|
-
case 0: return [4, this.api.get("".concat(this.route, "find_by_state"), {
|
|
55
|
-
params: params,
|
|
56
|
-
})];
|
|
57
|
-
case 1:
|
|
58
|
-
response = _a.sent();
|
|
59
|
-
return [2, response.data];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
Repository.prototype.findById = function (selector) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
-
var response;
|
|
67
|
-
return __generator(this, function (_a) {
|
|
68
|
-
switch (_a.label) {
|
|
69
|
-
case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
|
|
70
|
-
case 1:
|
|
71
|
-
response = _a.sent();
|
|
72
|
-
return [2, response.data];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
Repository.prototype.findByOwnerId = function (params) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
var response;
|
|
80
|
-
return __generator(this, function (_a) {
|
|
81
|
-
switch (_a.label) {
|
|
82
|
-
case 0: return [4, this.api.get("".concat(this.route, "by_owner"), { params: params })];
|
|
83
|
-
case 1:
|
|
84
|
-
response = _a.sent();
|
|
85
|
-
return [2, response.data];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
Repository.prototype.create = function (body) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
-
var response;
|
|
93
|
-
return __generator(this, function (_a) {
|
|
94
|
-
switch (_a.label) {
|
|
95
|
-
case 0: return [4, this.api.post("".concat(this.route), body)];
|
|
96
|
-
case 1:
|
|
97
|
-
response = _a.sent();
|
|
98
|
-
return [2, response.data];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
Repository.prototype.update = function (selector, body) {
|
|
104
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
105
|
-
return __generator(this, function (_a) {
|
|
106
|
-
switch (_a.label) {
|
|
107
|
-
case 0: return [4, this.api.put("".concat(this.route).concat(selector.id), body)];
|
|
108
|
-
case 1:
|
|
109
|
-
_a.sent();
|
|
110
|
-
return [2];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
Repository.prototype.updateIndexes = function (document_line_ids) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
117
|
-
return __generator(this, function (_a) {
|
|
118
|
-
switch (_a.label) {
|
|
119
|
-
case 0: return [4, this.api.put("".concat(this.route, "update_indexes"), document_line_ids)];
|
|
120
|
-
case 1:
|
|
121
|
-
_a.sent();
|
|
122
|
-
return [2];
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
Repository.prototype.updateData = function (data) {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
-
var response;
|
|
130
|
-
return __generator(this, function (_a) {
|
|
131
|
-
switch (_a.label) {
|
|
132
|
-
case 0: return [4, this.api.post("".concat(this.route, "update_data"), data)];
|
|
133
|
-
case 1:
|
|
134
|
-
response = _a.sent();
|
|
135
|
-
return [2, response.data];
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
Repository.prototype.updateMany = function (data) {
|
|
141
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
-
var response;
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
switch (_a.label) {
|
|
145
|
-
case 0: return [4, this.api.post("".concat(this.route, "update_many"), data)];
|
|
146
|
-
case 1:
|
|
147
|
-
response = _a.sent();
|
|
148
|
-
return [2, response.data];
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
Repository.prototype.deleteMany = function (document_line_ids) {
|
|
154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
-
return __generator(this, function (_a) {
|
|
156
|
-
switch (_a.label) {
|
|
157
|
-
case 0: return [4, this.api.delete("".concat(this.route), { data: document_line_ids })];
|
|
158
|
-
case 1:
|
|
159
|
-
_a.sent();
|
|
160
|
-
return [2];
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
Repository.prototype.printLabelToPdfUrl = function (_a, token) {
|
|
166
|
-
var document_line_ids = _a.document_line_ids;
|
|
167
|
-
var qs = new URLSearchParams();
|
|
168
|
-
qs.set('token', token);
|
|
169
|
-
return "".concat(this.route, "print_label_pdf/").concat(document_line_ids, "?").concat(qs.toString());
|
|
170
|
-
};
|
|
171
|
-
return Repository;
|
|
172
|
-
}());
|
|
173
|
-
exports.default = Repository;
|