@nomalism-com/api 0.40.2 → 0.40.4

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 (3) hide show
  1. package/dist/index.d.ts +414 -365
  2. package/dist/index.js +174 -123
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ __export(main_exports, {
20
20
  Clt: () => clt_exports,
21
21
  Commissioner: () => commissioner_exports,
22
22
  Country: () => country_exports,
23
+ CurrentAccountClass: () => currentAccount_exports,
23
24
  DashboardClass: () => dashboard_exports,
24
25
  DeliveryMethods: () => deliveryMethods_exports,
25
26
  DocumentHeader: () => documentHeader_exports,
@@ -51,6 +52,8 @@ __export(main_exports, {
51
52
  MaterialEntrance: () => materialEntrance_exports,
52
53
  MaturityDates: () => maturityDates_exports,
53
54
  Multimedia: () => multimedia_exports,
55
+ NPFClass: () => NPF_exports,
56
+ NRCLClass: () => NRCL_exports,
54
57
  Npc: () => npc_exports,
55
58
  Observation: () => observation_exports,
56
59
  ObservationType: () => observationType_exports,
@@ -58,6 +61,7 @@ __export(main_exports, {
58
61
  OrderManagement: () => orderManagement_exports,
59
62
  Password: () => password_exports,
60
63
  Payment: () => payment_exports,
64
+ PaymentBatchClass: () => paymentBatch_exports,
61
65
  PaymentMethods: () => paymentMethods_exports,
62
66
  Permissions: () => permission_exports,
63
67
  Persona: () => persona_exports,
@@ -409,10 +413,6 @@ var Repository7 = class {
409
413
  const response = await this.api.get(`${this.route}${selector.id}`);
410
414
  return response.data;
411
415
  }
412
- async findStart(selector) {
413
- const response = await this.api.get(`${this.route}start/${selector.id}`);
414
- return response.data;
415
- }
416
416
  async findStartVirtual(selector) {
417
417
  const response = await this.api.get(`${this.route}start_virtual/${selector.id}`);
418
418
  return response.data;
@@ -431,24 +431,6 @@ var Repository7 = class {
431
431
  const response = await this.api.get(`${this.route}`, { params });
432
432
  return response.data;
433
433
  }
434
- async findClientUnpaidCredit(params) {
435
- const response = await this.api.get(`${this.route}unpaid_credit`, {
436
- params
437
- });
438
- return response.data;
439
- }
440
- async findClientUnpaidDebit(params) {
441
- const response = await this.api.get(`${this.route}unpaid_debit`, {
442
- params
443
- });
444
- return response.data;
445
- }
446
- async findUnpaidCommissions(params) {
447
- const response = await this.api.get(`${this.route}unpaid_commissions`, {
448
- params
449
- });
450
- return response.data;
451
- }
452
434
  async create(body) {
453
435
  const response = await this.api.post(`${this.route}`, body);
454
436
  return response.data;
@@ -507,15 +489,6 @@ var Repository7 = class {
507
489
  const result = await this.api.get(`${this.route}siblings/${id}`);
508
490
  return result.data;
509
491
  }
510
- async findRmOpenDocuments() {
511
- const response = await this.api.get(`${this.route}rm_open_documents`);
512
- return response.data;
513
- }
514
- async regularizarMultiplosDocumentos(data) {
515
- await this.api.post(`${this.route}multiple_documents`, {
516
- data
517
- });
518
- }
519
492
  };
520
493
 
521
494
  // src/modules/supply/documentHeaderHistory.ts
@@ -1336,6 +1309,10 @@ var Repository34 = class {
1336
1309
  const response = await this.api.delete(`${this.route}${selector.id}`);
1337
1310
  return response.data;
1338
1311
  }
1312
+ async findByNumber(selector) {
1313
+ const response = await this.api.get(`${this.route}by_number/${selector.number}`);
1314
+ return response.data;
1315
+ }
1339
1316
  };
1340
1317
 
1341
1318
  // src/modules/user/providerType.ts
@@ -1620,6 +1597,10 @@ var Repository42 = class {
1620
1597
  const response = await this.api.put(`${this.route}${selector.id}`, body);
1621
1598
  return response.data;
1622
1599
  }
1600
+ async updatePassword(selector, body) {
1601
+ const response = await this.api.put(`${this.route}password/${selector.id}`, body);
1602
+ return response.data;
1603
+ }
1623
1604
  async deleteOne(selector) {
1624
1605
  const response = await this.api.delete(`${this.route}${selector.id}`);
1625
1606
  return response.data;
@@ -2234,12 +2215,8 @@ var Repository58 = class {
2234
2215
  this.route = route;
2235
2216
  this.publicRoute = publicRoute;
2236
2217
  }
2237
- async find(params) {
2238
- const response = await this.api.get(`${this.route}`, { params });
2239
- return response.data;
2240
- }
2241
- async findPaginated(params) {
2242
- const response = await this.api.get(`${this.route}paginated`, { params });
2218
+ async findById(selector) {
2219
+ const response = await this.api.get(`${this.route}${selector.id}`);
2243
2220
  return response.data;
2244
2221
  }
2245
2222
  async findByOwnerId(params) {
@@ -2248,24 +2225,12 @@ var Repository58 = class {
2248
2225
  });
2249
2226
  return response.data;
2250
2227
  }
2251
- async findById(selector) {
2252
- const response = await this.api.get(`${this.route}${selector.id}`);
2253
- return response.data;
2254
- }
2255
- async deleteBatch(selector) {
2256
- const response = await this.api.delete(`${this.route}delete_batch${selector.id}`);
2257
- return response.data;
2258
- }
2259
- async findCurrentAccountByOwnerId(params) {
2260
- const response = await this.api.get(`${this.route}current_account`, {
2261
- params
2262
- });
2228
+ async find(params) {
2229
+ const response = await this.api.get(`${this.route}`, { params });
2263
2230
  return response.data;
2264
2231
  }
2265
- async findBalanceByOwnerId(params) {
2266
- const response = await this.api.get(`${this.route}balance`, {
2267
- params
2268
- });
2232
+ async findPaginated(params) {
2233
+ const response = await this.api.get(`${this.route}paginated`, { params });
2269
2234
  return response.data;
2270
2235
  }
2271
2236
  async findSettledMaterialEntrance(params) {
@@ -2274,61 +2239,14 @@ var Repository58 = class {
2274
2239
  });
2275
2240
  return response.data;
2276
2241
  }
2277
- async findSettledMaterialEntranceProviders() {
2278
- const response = await this.api.get(`${this.route}settled_material_entrance_providers`);
2279
- return response.data;
2280
- }
2281
- async createProvidersPayments(body) {
2282
- const response = await this.api.post(`${this.route}provider`, body);
2283
- return response.data;
2284
- }
2285
- async findPaymentsNotExported(params) {
2286
- const response = await this.api.get(`${this.route}not_exported`, {
2287
- params
2288
- });
2289
- return response.data;
2290
- }
2291
- async findPaymentBatches() {
2292
- const response = await this.api.get(`${this.route}batches`);
2293
- return response.data;
2294
- }
2295
- async updateDownloadedBatchNumber(params) {
2296
- await this.api.put(`${this.route}downloaded_batch_number/${params}`);
2297
- }
2298
- async exportCurrentAccount(params) {
2299
- const response = await this.api.get(`${this.publicRoute}export_current_account`, {
2300
- params
2301
- });
2302
- return response.data;
2303
- }
2304
2242
  async findSettledMaterialEntranceByDate(params) {
2305
2243
  const response = await this.api.get(`${this.route}settled_material_entrance_by_date`, {
2306
2244
  params
2307
2245
  });
2308
2246
  return response.data;
2309
2247
  }
2310
- async exportPayments(body) {
2311
- await this.api.post(`${this.route}export_payments`, body);
2312
- }
2313
- getExportCurrentAccountUrl({
2314
- owner_id,
2315
- start_date,
2316
- end_date,
2317
- output,
2318
- token
2319
- }) {
2320
- const qs = new URLSearchParams();
2321
- qs.set("owner_id", owner_id);
2322
- qs.set("output", output);
2323
- if (start_date) qs.set("start_date", start_date.toISOString());
2324
- if (end_date) qs.set("end_date", end_date.toISOString());
2325
- qs.set("token", token);
2326
- return `${this.publicRoute}export_current_account?${qs.toString()}`;
2327
- }
2328
- async findCurrentAccountPaginated(params) {
2329
- const response = await this.api.get(`${this.route}current_account_paginated`, {
2330
- params
2331
- });
2248
+ async findSettledMaterialEntranceProviders() {
2249
+ const response = await this.api.get(`${this.route}settled_material_entrance_providers`);
2332
2250
  return response.data;
2333
2251
  }
2334
2252
  };
@@ -2822,7 +2740,7 @@ var Repository73 = class {
2822
2740
  const response = await this.api.post(`${this.route}create_sheet_from_document`, params);
2823
2741
  return response.data;
2824
2742
  }
2825
- async cloneSheetsToNewDocument(params) {
2743
+ async cloneSheetToNewDocument(params) {
2826
2744
  const response = await this.api.post(`${this.route}clone_sheet_to_new_document`, params);
2827
2745
  return response.data;
2828
2746
  }
@@ -2847,6 +2765,10 @@ var Repository73 = class {
2847
2765
  async rmUpdateDataBySheetId(params, body) {
2848
2766
  await this.api.post(`${this.route}rm_data_by_sheet_id/${params.id}`, body);
2849
2767
  }
2768
+ async findRmOpenDocuments() {
2769
+ const response = await this.api.get(`${this.route}rm_open_documents`);
2770
+ return response.data;
2771
+ }
2850
2772
  };
2851
2773
 
2852
2774
  // src/modules/stock/schedule.ts
@@ -3442,7 +3364,8 @@ var Repository92 = class {
3442
3364
  return response.data;
3443
3365
  }
3444
3366
  async checkLinesInPrison(data) {
3445
- await this.api.post(`${this.route}check_in_prison`, data);
3367
+ const response = await this.api.post(`${this.route}check_in_prison`, data);
3368
+ return response.data;
3446
3369
  }
3447
3370
  async createLinesInPrison(data) {
3448
3371
  const response = await this.api.post(`${this.route}create_lines`, data);
@@ -3596,18 +3519,10 @@ var Repository98 = class {
3596
3519
  this.route = route;
3597
3520
  this.publicRoute = publicRoute;
3598
3521
  }
3599
- async create(body) {
3522
+ async upsertOrDelete(body) {
3600
3523
  const response = await this.api.post(`${this.route}`, body);
3601
3524
  return response.data;
3602
3525
  }
3603
- async update(selector, body) {
3604
- const response = await this.api.put(`${this.route}${selector.id}`, body);
3605
- return response.data;
3606
- }
3607
- async deleteOne(selector) {
3608
- const response = await this.api.delete(`${this.route}${selector.id}`);
3609
- return response.data;
3610
- }
3611
3526
  };
3612
3527
 
3613
3528
  // src/modules/stock/savedProviderProposal.ts
@@ -4049,16 +3964,8 @@ var Repository113 = class {
4049
3964
  const response = await this.api.post(`${this.route}`, data);
4050
3965
  return response.data;
4051
3966
  }
4052
- async findByOwnerId(selector) {
4053
- const response = await this.api.get(`${this.route}by_owner_id/${selector.id}`);
4054
- return response.data;
4055
- }
4056
- async findByDocumentHeaderId(selector) {
4057
- const response = await this.api.get(`${this.route}by_document_header_id/${selector.id}`);
4058
- return response.data;
4059
- }
4060
- async findByPersonaId(selector) {
4061
- const response = await this.api.get(`${this.route}by_persona_id/${selector.id}`);
3967
+ async find(data) {
3968
+ const response = await this.api.get(`${this.route}`, { params: data });
4062
3969
  return response.data;
4063
3970
  }
4064
3971
  async deleteOne(selector) {
@@ -4127,6 +4034,146 @@ var Repository115 = class {
4127
4034
  }
4128
4035
  };
4129
4036
 
4037
+ // src/modules/document/NPF.ts
4038
+ var NPF_exports = {};
4039
+ __export(NPF_exports, {
4040
+ default: () => Repository116
4041
+ });
4042
+ var Repository116 = class {
4043
+ constructor({ api, route, publicRoute }) {
4044
+ this.api = api;
4045
+ this.route = route;
4046
+ this.publicRoute = publicRoute;
4047
+ }
4048
+ async create(body) {
4049
+ const response = await this.api.post(`${this.route}providers`, body);
4050
+ return response.data;
4051
+ }
4052
+ getBatchPdfUrl(opts) {
4053
+ const qs = new URLSearchParams();
4054
+ qs.set("token", opts.token);
4055
+ if (opts.ids?.length) {
4056
+ qs.set("ids", opts.ids.join(","));
4057
+ return `${this.route}create_batch_pdf?${qs.toString()}`;
4058
+ }
4059
+ if (opts.month && opts.year) {
4060
+ qs.set("month", String(opts.month));
4061
+ qs.set("year", String(opts.year));
4062
+ return `${this.route}create_batch_pdf?${qs.toString()}`;
4063
+ }
4064
+ throw new Error("Precisas de passar ids OU month/year");
4065
+ }
4066
+ };
4067
+
4068
+ // src/modules/document/NRCL.ts
4069
+ var NRCL_exports = {};
4070
+ __export(NRCL_exports, {
4071
+ default: () => Repository117
4072
+ });
4073
+ var Repository117 = class {
4074
+ constructor({ api, route, publicRoute }) {
4075
+ this.api = api;
4076
+ this.route = route;
4077
+ this.publicRoute = publicRoute;
4078
+ }
4079
+ async create(data) {
4080
+ await this.api.post(`${this.route}multiple_documents`, {
4081
+ data
4082
+ });
4083
+ }
4084
+ };
4085
+
4086
+ // src/modules/supply/currentAccount.ts
4087
+ var currentAccount_exports = {};
4088
+ __export(currentAccount_exports, {
4089
+ default: () => Repository118
4090
+ });
4091
+ var Repository118 = class {
4092
+ constructor({ api, route, publicRoute }) {
4093
+ this.api = api;
4094
+ this.route = route;
4095
+ this.publicRoute = publicRoute;
4096
+ }
4097
+ async findCurrentAccountByOwnerId(params) {
4098
+ const response = await this.api.get(`${this.route}current_account`, {
4099
+ params
4100
+ });
4101
+ return response.data;
4102
+ }
4103
+ async findBalanceByOwnerId(params) {
4104
+ const response = await this.api.get(`${this.route}balance`, {
4105
+ params
4106
+ });
4107
+ return response.data;
4108
+ }
4109
+ async exportCurrentAccount(params) {
4110
+ const response = await this.api.get(`${this.publicRoute}export_current_account`, {
4111
+ params
4112
+ });
4113
+ return response.data;
4114
+ }
4115
+ async findClientUnpaidCredit(params) {
4116
+ const response = await this.api.get(`${this.route}unpaid_credit`, {
4117
+ params
4118
+ });
4119
+ return response.data;
4120
+ }
4121
+ async findClientUnpaidDebit(params) {
4122
+ const response = await this.api.get(`${this.route}unpaid_debit`, {
4123
+ params
4124
+ });
4125
+ return response.data;
4126
+ }
4127
+ getExportCurrentAccountUrl({
4128
+ owner_id,
4129
+ start_date,
4130
+ end_date,
4131
+ output,
4132
+ token
4133
+ }) {
4134
+ const qs = new URLSearchParams();
4135
+ qs.set("owner_id", owner_id);
4136
+ qs.set("output", output);
4137
+ if (start_date) qs.set("start_date", start_date.toISOString());
4138
+ if (end_date) qs.set("end_date", end_date.toISOString());
4139
+ qs.set("token", token);
4140
+ return `${this.publicRoute}export_current_account?${qs.toString()}`;
4141
+ }
4142
+ };
4143
+
4144
+ // src/modules/supply/paymentBatch.ts
4145
+ var paymentBatch_exports = {};
4146
+ __export(paymentBatch_exports, {
4147
+ default: () => Repository119
4148
+ });
4149
+ var Repository119 = class {
4150
+ constructor({ api, route, publicRoute }) {
4151
+ this.api = api;
4152
+ this.route = route;
4153
+ this.publicRoute = publicRoute;
4154
+ }
4155
+ async findPending(params) {
4156
+ const response = await this.api.get(`${this.route}not_exported`, {
4157
+ params
4158
+ });
4159
+ return response.data;
4160
+ }
4161
+ async create(body) {
4162
+ await this.api.post(`${this.route}export_payments`, body);
4163
+ }
4164
+ async findCreated() {
4165
+ const response = await this.api.get(`${this.route}batches`);
4166
+ return response.data;
4167
+ }
4168
+ async updateDownloadNumber(params) {
4169
+ await this.api.put(`${this.route}downloaded_batch_number/${params}`);
4170
+ }
4171
+ async deleteOne(selector) {
4172
+ const response = await this.api.delete(`${this.route}delete_batch${selector.id}`);
4173
+ return response.data;
4174
+ }
4175
+ };
4176
+
4130
4177
  // src/main.ts
4131
4178
  var API = class {
4132
4179
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
@@ -4320,6 +4367,10 @@ var API = class {
4320
4367
  this.ChatSubscriber = new Repository113(getModuleParams("users", "chat_subscriber"));
4321
4368
  this.Tag = new Repository114(getModuleParams("stock", "tag"));
4322
4369
  this.Gmails = new Repository115(getModuleParams("stock", "gmail"));
4370
+ this.NPF = new Repository116(getModuleParams("stock", "npf"));
4371
+ this.NRCL = new Repository117(getModuleParams("stock", "nrcl"));
4372
+ this.PaymentBatch = new Repository119(getModuleParams("stock", "payment_batch"));
4373
+ this.CurrentAccount = new Repository118(getModuleParams("stock", "current_account"));
4323
4374
  }
4324
4375
  };
4325
4376
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/api",
3
3
  "description": "A nomalism API package for performing HTTP requests on API endpoints",
4
- "version": "0.40.2",
4
+ "version": "0.40.4",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -23,12 +23,12 @@
23
23
  "prepack": "npm run lint && npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@nomalism-com/types": "^0.40.1",
26
+ "@nomalism-com/types": "^0.40.2",
27
27
  "axios": "^1.9.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@swc/core": "^1.11.29",
31
- "@types/node": "^22.15.21",
31
+ "@types/node": "^24.3.0",
32
32
  "@typescript-eslint/eslint-plugin": "^8.32.1",
33
33
  "@typescript-eslint/parser": "^8.32.1",
34
34
  "eslint": "^9.27.0",