@nomalism-com/api 0.8.115 → 0.8.117

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.
@@ -19,4 +19,6 @@ export import IPaymentsNotExportedResponse = Entity.IPaymentsNotExportedResponse
19
19
  export import IExportCurrentAccountRequest = Entity.IExportCurrentAccountRequest;
20
20
  export type IPaginationResponse = shared.IPaginationResponse<Entity.IFindResponse>;
21
21
  export declare const route: string;
22
- export declare const find: (selector: Entity.IFindRequest) => Promise<Entity.IFindResponse[]>, findPaginated: (selector: Entity.IFindPaginatedRequest) => Promise<Entity.IFindWithPaginationResponse>, findByOwnerId: (params: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindByOwnerIdResponse[]>, findById: (selector: shared.IFindByIdRequest) => Promise<Entity.IFindByIdResponse | null>, deleteBatch: (data: shared.IFindByIdRequest) => Promise<void>, findCurrentAccountByOwnerId: (params: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindCurrentAccountByOwnerIdResponse[]>, findSettledMaterialEntrance: (params: Entity.IUnpaidPurchasesRequest) => Promise<Entity.IUnpaidPurchasesResponse[]>, findSettledMaterialEntranceProviders: () => Promise<Entity.IFindProvidersWithClientIdResponse[]>, createProvidersPayments: (params: Entity.IProviderPaymentRequest[], user_id: string) => Promise<void>, findPaymentsNotExported: () => Promise<Entity.IPaymentsNotExportedResponse[]>, findPaymentBatches: () => Promise<Entity.IPaymentsBatchResponse[]>, updateDownloadedBatchNumber: (id: shared.IFindByIdRequest, user_id: string) => Promise<void>, exportCurrentAccount: (params: Entity.IExportCurrentAccountRequest, user_id: string) => Promise<Entity.IFindCurrentAccountByOwnerIdResponse[]>, findSettledMaterialEntranceByDate: (params: Entity.IUnpaidByDatePurchasesRequest) => Promise<Entity.IUnpaidPurchasesResponse[]>;
22
+ export declare const publicRoute: string;
23
+ export declare const find: (selector: Entity.IFindRequest) => Promise<Entity.IFindResponse[]>, findPaginated: (selector: Entity.IFindPaginatedRequest) => Promise<Entity.IFindWithPaginationResponse>, findByOwnerId: (params: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindByOwnerIdResponse[]>, findById: (selector: shared.IFindByIdRequest) => Promise<Entity.IFindByIdResponse | null>, deleteBatch: (data: shared.IFindByIdRequest) => Promise<void>, findCurrentAccountByOwnerId: (params: shared.IFindByOwnerIdRequest) => Promise<Entity.IFindCurrentAccountByOwnerIdResponse[]>, findSettledMaterialEntrance: (params: Entity.IUnpaidPurchasesRequest) => Promise<Entity.IUnpaidPurchasesResponse[]>, findSettledMaterialEntranceProviders: () => Promise<Entity.IFindProvidersWithClientIdResponse[]>, createProvidersPayments: (params: Entity.IProviderPaymentRequest[]) => Promise<void>, findPaymentsNotExported: () => Promise<Entity.IPaymentsNotExportedResponse[]>, findPaymentBatches: () => Promise<Entity.IPaymentsBatchResponse[]>, updateDownloadedBatchNumber: (id: shared.IFindByIdRequest) => Promise<void>, exportCurrentAccount: (params: Entity.IExportCurrentAccountRequest) => Promise<Entity.IFindCurrentAccountByOwnerIdResponse[]>, findSettledMaterialEntranceByDate: (params: Entity.IUnpaidByDatePurchasesRequest) => Promise<Entity.IUnpaidPurchasesResponse[]>, exportPayments: (params: Entity.IPaymentsNotExportedResponse[]) => Promise<void>;
24
+ export declare const getExportCurrentAccountUrl: ({ owner_id, start_date, end_date, token, }: IExportCurrentAccountRequest) => string;
@@ -39,10 +39,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.findSettledMaterialEntranceByDate = exports.exportCurrentAccount = exports.updateDownloadedBatchNumber = exports.findPaymentBatches = exports.findPaymentsNotExported = exports.createProvidersPayments = exports.findSettledMaterialEntranceProviders = exports.findSettledMaterialEntrance = exports.findCurrentAccountByOwnerId = exports.deleteBatch = exports.findById = exports.findByOwnerId = exports.findPaginated = exports.find = exports.route = void 0;
42
+ exports.getExportCurrentAccountUrl = exports.exportPayments = exports.findSettledMaterialEntranceByDate = exports.exportCurrentAccount = exports.updateDownloadedBatchNumber = exports.findPaymentBatches = exports.findPaymentsNotExported = exports.createProvidersPayments = exports.findSettledMaterialEntranceProviders = exports.findSettledMaterialEntrance = exports.findCurrentAccountByOwnerId = exports.deleteBatch = exports.findById = exports.findByOwnerId = exports.findPaginated = exports.find = exports.publicRoute = exports.route = void 0;
43
43
  var client_1 = __importDefault(require("../../shared/client"));
44
44
  var _1 = require(".");
45
45
  exports.route = "".concat(_1.serviceHostname).concat(_1.serviceAuthPath, "payment/");
46
+ exports.publicRoute = "".concat(_1.serviceHostname).concat(_1.servicePublicPath, "payment/");
46
47
  var repository = {
47
48
  find: function (params) { return __awaiter(void 0, void 0, void 0, function () {
48
49
  var response;
@@ -184,7 +185,7 @@ var repository = {
184
185
  var response;
185
186
  return __generator(this, function (_a) {
186
187
  switch (_a.label) {
187
- case 0: return [4, client_1.default.get("".concat(exports.route, "export_current_account"), {
188
+ case 0: return [4, client_1.default.get("".concat(exports.publicRoute, "export_current_account"), {
188
189
  params: params,
189
190
  })];
190
191
  case 1:
@@ -206,5 +207,27 @@ var repository = {
206
207
  }
207
208
  });
208
209
  }); },
210
+ exportPayments: function (body) { return __awaiter(void 0, void 0, void 0, function () {
211
+ return __generator(this, function (_a) {
212
+ switch (_a.label) {
213
+ case 0: return [4, client_1.default.post("".concat(exports.route, "export_payments"), body)];
214
+ case 1:
215
+ _a.sent();
216
+ return [2];
217
+ }
218
+ });
219
+ }); },
220
+ };
221
+ exports.find = repository.find, exports.findPaginated = repository.findPaginated, exports.findByOwnerId = repository.findByOwnerId, exports.findById = repository.findById, exports.deleteBatch = repository.deleteBatch, exports.findCurrentAccountByOwnerId = repository.findCurrentAccountByOwnerId, exports.findSettledMaterialEntrance = repository.findSettledMaterialEntrance, exports.findSettledMaterialEntranceProviders = repository.findSettledMaterialEntranceProviders, exports.createProvidersPayments = repository.createProvidersPayments, exports.findPaymentsNotExported = repository.findPaymentsNotExported, exports.findPaymentBatches = repository.findPaymentBatches, exports.updateDownloadedBatchNumber = repository.updateDownloadedBatchNumber, exports.exportCurrentAccount = repository.exportCurrentAccount, exports.findSettledMaterialEntranceByDate = repository.findSettledMaterialEntranceByDate, exports.exportPayments = repository.exportPayments;
222
+ var getExportCurrentAccountUrl = function (_a) {
223
+ var owner_id = _a.owner_id, start_date = _a.start_date, end_date = _a.end_date, token = _a.token;
224
+ var qs = new URLSearchParams();
225
+ qs.set('owner_id', owner_id);
226
+ if (start_date)
227
+ qs.set('start_date', start_date.toISOString());
228
+ if (end_date)
229
+ qs.set('end_date', end_date.toISOString());
230
+ qs.set('token', token);
231
+ return "".concat(exports.publicRoute, "csv?").concat(qs.toString());
209
232
  };
210
- exports.find = repository.find, exports.findPaginated = repository.findPaginated, exports.findByOwnerId = repository.findByOwnerId, exports.findById = repository.findById, exports.deleteBatch = repository.deleteBatch, exports.findCurrentAccountByOwnerId = repository.findCurrentAccountByOwnerId, exports.findSettledMaterialEntrance = repository.findSettledMaterialEntrance, exports.findSettledMaterialEntranceProviders = repository.findSettledMaterialEntranceProviders, exports.createProvidersPayments = repository.createProvidersPayments, exports.findPaymentsNotExported = repository.findPaymentsNotExported, exports.findPaymentBatches = repository.findPaymentBatches, exports.updateDownloadedBatchNumber = repository.updateDownloadedBatchNumber, exports.exportCurrentAccount = repository.exportCurrentAccount, exports.findSettledMaterialEntranceByDate = repository.findSettledMaterialEntranceByDate;
233
+ exports.getExportCurrentAccountUrl = getExportCurrentAccountUrl;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.8.115",
12
+ "version": "0.8.117",
13
13
  "main": "dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
@@ -47,8 +47,8 @@
47
47
  "typescript": "^4.9.5"
48
48
  },
49
49
  "dependencies": {
50
- "@nomalism-com/api": "^0.8.114",
51
- "@nomalism-com/types": "^0.9.126",
50
+ "@nomalism-com/api": "^0.8.115",
51
+ "@nomalism-com/types": "^0.9.129",
52
52
  "axios": "^0.27.2"
53
53
  }
54
54
  }