@nomalism-com/api 1.2.4 → 1.3.2
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.d.ts +478 -370
- package/dist/index.js +294 -148
- 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,
|
|
@@ -40,7 +41,9 @@ __export(main_exports, {
|
|
|
40
41
|
ExternalDocumentType: () => externalDocumentType_exports,
|
|
41
42
|
Favorites: () => favorites_exports,
|
|
42
43
|
File: () => file_exports,
|
|
44
|
+
GmailsClass: () => gmails_exports,
|
|
43
45
|
GoogleFilePermission: () => googleFilePermission_exports,
|
|
46
|
+
GoogleSheetPoolClass: () => googleSheetPool_exports,
|
|
44
47
|
GoogleSheets: () => googleSheets_exports,
|
|
45
48
|
GroupPermissions: () => groupPermission_exports,
|
|
46
49
|
Inventario: () => inventario_exports,
|
|
@@ -50,6 +53,8 @@ __export(main_exports, {
|
|
|
50
53
|
MaterialEntrance: () => materialEntrance_exports,
|
|
51
54
|
MaturityDates: () => maturityDates_exports,
|
|
52
55
|
Multimedia: () => multimedia_exports,
|
|
56
|
+
NPFClass: () => NPF_exports,
|
|
57
|
+
NRCLClass: () => NRCL_exports,
|
|
53
58
|
Npc: () => npc_exports,
|
|
54
59
|
Observation: () => observation_exports,
|
|
55
60
|
ObservationType: () => observationType_exports,
|
|
@@ -57,9 +62,11 @@ __export(main_exports, {
|
|
|
57
62
|
OrderManagement: () => orderManagement_exports,
|
|
58
63
|
Password: () => password_exports,
|
|
59
64
|
Payment: () => payment_exports,
|
|
65
|
+
PaymentBatchClass: () => paymentBatch_exports,
|
|
60
66
|
PaymentMethods: () => paymentMethods_exports,
|
|
61
67
|
Permissions: () => permission_exports,
|
|
62
68
|
Persona: () => persona_exports,
|
|
69
|
+
PortalClass: () => portal_exports,
|
|
63
70
|
PreSale: () => preSale_exports,
|
|
64
71
|
PreSaleProduct: () => preSaleProduct_exports,
|
|
65
72
|
Printer: () => printer_exports,
|
|
@@ -82,6 +89,7 @@ __export(main_exports, {
|
|
|
82
89
|
RefreshToken: () => refreshToken_exports,
|
|
83
90
|
ReturnReason: () => returnReason_exports,
|
|
84
91
|
ReturnToProvider: () => returnToProvider_exports,
|
|
92
|
+
SaftClass: () => saft_exports,
|
|
85
93
|
SavedEmPicking: () => savedEmPicking_exports,
|
|
86
94
|
SavedProviderProposal: () => savedProviderProposal_exports,
|
|
87
95
|
Schedule: () => schedule_exports,
|
|
@@ -408,10 +416,6 @@ var Repository7 = class {
|
|
|
408
416
|
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
409
417
|
return response.data;
|
|
410
418
|
}
|
|
411
|
-
async findStart(selector) {
|
|
412
|
-
const response = await this.api.get(`${this.route}start/${selector.id}`);
|
|
413
|
-
return response.data;
|
|
414
|
-
}
|
|
415
419
|
async findStartVirtual(selector) {
|
|
416
420
|
const response = await this.api.get(`${this.route}start_virtual/${selector.id}`);
|
|
417
421
|
return response.data;
|
|
@@ -430,24 +434,6 @@ var Repository7 = class {
|
|
|
430
434
|
const response = await this.api.get(`${this.route}`, { params });
|
|
431
435
|
return response.data;
|
|
432
436
|
}
|
|
433
|
-
async findClientUnpaidCredit(params) {
|
|
434
|
-
const response = await this.api.get(`${this.route}unpaid_credit`, {
|
|
435
|
-
params
|
|
436
|
-
});
|
|
437
|
-
return response.data;
|
|
438
|
-
}
|
|
439
|
-
async findClientUnpaidDebit(params) {
|
|
440
|
-
const response = await this.api.get(`${this.route}unpaid_debit`, {
|
|
441
|
-
params
|
|
442
|
-
});
|
|
443
|
-
return response.data;
|
|
444
|
-
}
|
|
445
|
-
async findUnpaidCommissions(params) {
|
|
446
|
-
const response = await this.api.get(`${this.route}unpaid_commissions`, {
|
|
447
|
-
params
|
|
448
|
-
});
|
|
449
|
-
return response.data;
|
|
450
|
-
}
|
|
451
437
|
async create(body) {
|
|
452
438
|
const response = await this.api.post(`${this.route}`, body);
|
|
453
439
|
return response.data;
|
|
@@ -506,15 +492,6 @@ var Repository7 = class {
|
|
|
506
492
|
const result = await this.api.get(`${this.route}siblings/${id}`);
|
|
507
493
|
return result.data;
|
|
508
494
|
}
|
|
509
|
-
async findRmOpenDocuments() {
|
|
510
|
-
const response = await this.api.get(`${this.route}rm_open_documents`);
|
|
511
|
-
return response.data;
|
|
512
|
-
}
|
|
513
|
-
async regularizarMultiplosDocumentos(data) {
|
|
514
|
-
await this.api.post(`${this.route}multiple_documents`, {
|
|
515
|
-
data
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
495
|
};
|
|
519
496
|
|
|
520
497
|
// src/modules/supply/documentHeaderHistory.ts
|
|
@@ -570,6 +547,10 @@ var Repository11 = class {
|
|
|
570
547
|
const result = await this.api.post(`${this.route}pro_forma`, data);
|
|
571
548
|
return result.data;
|
|
572
549
|
}
|
|
550
|
+
async createFromLines(data) {
|
|
551
|
+
const result = await this.api.post(`${this.route}pro_forma_from_lines`, data);
|
|
552
|
+
return result.data;
|
|
553
|
+
}
|
|
573
554
|
};
|
|
574
555
|
|
|
575
556
|
// src/modules/document/propostaFornecedor.ts
|
|
@@ -1335,6 +1316,10 @@ var Repository34 = class {
|
|
|
1335
1316
|
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
1336
1317
|
return response.data;
|
|
1337
1318
|
}
|
|
1319
|
+
async findByNumber(selector) {
|
|
1320
|
+
const response = await this.api.get(`${this.route}by_number/${selector.number}`);
|
|
1321
|
+
return response.data;
|
|
1322
|
+
}
|
|
1338
1323
|
};
|
|
1339
1324
|
|
|
1340
1325
|
// src/modules/user/providerType.ts
|
|
@@ -1619,6 +1604,10 @@ var Repository42 = class {
|
|
|
1619
1604
|
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
1620
1605
|
return response.data;
|
|
1621
1606
|
}
|
|
1607
|
+
async updatePassword(selector, body) {
|
|
1608
|
+
const response = await this.api.put(`${this.route}password/${selector.id}`, body);
|
|
1609
|
+
return response.data;
|
|
1610
|
+
}
|
|
1622
1611
|
async deleteOne(selector) {
|
|
1623
1612
|
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
1624
1613
|
return response.data;
|
|
@@ -2233,12 +2222,8 @@ var Repository58 = class {
|
|
|
2233
2222
|
this.route = route;
|
|
2234
2223
|
this.publicRoute = publicRoute;
|
|
2235
2224
|
}
|
|
2236
|
-
async
|
|
2237
|
-
const response = await this.api.get(`${this.route}
|
|
2238
|
-
return response.data;
|
|
2239
|
-
}
|
|
2240
|
-
async findPaginated(params) {
|
|
2241
|
-
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
2225
|
+
async findById(selector) {
|
|
2226
|
+
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
2242
2227
|
return response.data;
|
|
2243
2228
|
}
|
|
2244
2229
|
async findByOwnerId(params) {
|
|
@@ -2247,24 +2232,12 @@ var Repository58 = class {
|
|
|
2247
2232
|
});
|
|
2248
2233
|
return response.data;
|
|
2249
2234
|
}
|
|
2250
|
-
async
|
|
2251
|
-
const response = await this.api.get(`${this.route}
|
|
2252
|
-
return response.data;
|
|
2253
|
-
}
|
|
2254
|
-
async deleteBatch(selector) {
|
|
2255
|
-
const response = await this.api.delete(`${this.route}delete_batch${selector.id}`);
|
|
2256
|
-
return response.data;
|
|
2257
|
-
}
|
|
2258
|
-
async findCurrentAccountByOwnerId(params) {
|
|
2259
|
-
const response = await this.api.get(`${this.route}current_account`, {
|
|
2260
|
-
params
|
|
2261
|
-
});
|
|
2235
|
+
async find(params) {
|
|
2236
|
+
const response = await this.api.get(`${this.route}`, { params });
|
|
2262
2237
|
return response.data;
|
|
2263
2238
|
}
|
|
2264
|
-
async
|
|
2265
|
-
const response = await this.api.get(`${this.route}
|
|
2266
|
-
params
|
|
2267
|
-
});
|
|
2239
|
+
async findPaginated(params) {
|
|
2240
|
+
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
2268
2241
|
return response.data;
|
|
2269
2242
|
}
|
|
2270
2243
|
async findSettledMaterialEntrance(params) {
|
|
@@ -2273,61 +2246,14 @@ var Repository58 = class {
|
|
|
2273
2246
|
});
|
|
2274
2247
|
return response.data;
|
|
2275
2248
|
}
|
|
2276
|
-
async findSettledMaterialEntranceProviders() {
|
|
2277
|
-
const response = await this.api.get(`${this.route}settled_material_entrance_providers`);
|
|
2278
|
-
return response.data;
|
|
2279
|
-
}
|
|
2280
|
-
async createProvidersPayments(body) {
|
|
2281
|
-
const response = await this.api.post(`${this.route}provider`, body);
|
|
2282
|
-
return response.data;
|
|
2283
|
-
}
|
|
2284
|
-
async findPaymentsNotExported(params) {
|
|
2285
|
-
const response = await this.api.get(`${this.route}not_exported`, {
|
|
2286
|
-
params
|
|
2287
|
-
});
|
|
2288
|
-
return response.data;
|
|
2289
|
-
}
|
|
2290
|
-
async findPaymentBatches() {
|
|
2291
|
-
const response = await this.api.get(`${this.route}batches`);
|
|
2292
|
-
return response.data;
|
|
2293
|
-
}
|
|
2294
|
-
async updateDownloadedBatchNumber(params) {
|
|
2295
|
-
await this.api.put(`${this.route}downloaded_batch_number/${params}`);
|
|
2296
|
-
}
|
|
2297
|
-
async exportCurrentAccount(params) {
|
|
2298
|
-
const response = await this.api.get(`${this.publicRoute}export_current_account`, {
|
|
2299
|
-
params
|
|
2300
|
-
});
|
|
2301
|
-
return response.data;
|
|
2302
|
-
}
|
|
2303
2249
|
async findSettledMaterialEntranceByDate(params) {
|
|
2304
2250
|
const response = await this.api.get(`${this.route}settled_material_entrance_by_date`, {
|
|
2305
2251
|
params
|
|
2306
2252
|
});
|
|
2307
2253
|
return response.data;
|
|
2308
2254
|
}
|
|
2309
|
-
async
|
|
2310
|
-
await this.api.
|
|
2311
|
-
}
|
|
2312
|
-
getExportCurrentAccountUrl({
|
|
2313
|
-
owner_id,
|
|
2314
|
-
start_date,
|
|
2315
|
-
end_date,
|
|
2316
|
-
output,
|
|
2317
|
-
token
|
|
2318
|
-
}) {
|
|
2319
|
-
const qs = new URLSearchParams();
|
|
2320
|
-
qs.set("owner_id", owner_id);
|
|
2321
|
-
qs.set("output", output);
|
|
2322
|
-
if (start_date) qs.set("start_date", start_date.toISOString());
|
|
2323
|
-
if (end_date) qs.set("end_date", end_date.toISOString());
|
|
2324
|
-
qs.set("token", token);
|
|
2325
|
-
return `${this.publicRoute}export_current_account?${qs.toString()}`;
|
|
2326
|
-
}
|
|
2327
|
-
async findCurrentAccountPaginated(params) {
|
|
2328
|
-
const response = await this.api.get(`${this.route}current_account_paginated`, {
|
|
2329
|
-
params
|
|
2330
|
-
});
|
|
2255
|
+
async findSettledMaterialEntranceProviders() {
|
|
2256
|
+
const response = await this.api.get(`${this.route}settled_material_entrance_providers`);
|
|
2331
2257
|
return response.data;
|
|
2332
2258
|
}
|
|
2333
2259
|
};
|
|
@@ -2359,12 +2285,6 @@ var Repository59 = class {
|
|
|
2359
2285
|
const response = await this.api.get(`${this.route}by_owner`, { params });
|
|
2360
2286
|
return response.data;
|
|
2361
2287
|
}
|
|
2362
|
-
async publicFindByOwnerId(params) {
|
|
2363
|
-
const response = await this.api.get(`${this.route}public_by_owner`, {
|
|
2364
|
-
params
|
|
2365
|
-
});
|
|
2366
|
-
return response.data;
|
|
2367
|
-
}
|
|
2368
2288
|
async find(params) {
|
|
2369
2289
|
const response = await this.api.get(`${this.route}`, { params });
|
|
2370
2290
|
return response.data;
|
|
@@ -2380,14 +2300,6 @@ var Repository59 = class {
|
|
|
2380
2300
|
async sendEmailDocument(body) {
|
|
2381
2301
|
await this.api.post(`${this.route}sendEmail`, body);
|
|
2382
2302
|
}
|
|
2383
|
-
async createPublicDocumentHeaderNote(data) {
|
|
2384
|
-
const response = await this.api.post(`${this.route}public_document_header_note`, data);
|
|
2385
|
-
return response.data;
|
|
2386
|
-
}
|
|
2387
|
-
async updatePublicDocumentHeaderNote({ id }, data) {
|
|
2388
|
-
const response = await this.api.put(`${this.route}public_document_header_note/${id}`, data);
|
|
2389
|
-
return response.data;
|
|
2390
|
-
}
|
|
2391
2303
|
};
|
|
2392
2304
|
|
|
2393
2305
|
// src/modules/supply/vatValidation.ts
|
|
@@ -2821,7 +2733,7 @@ var Repository73 = class {
|
|
|
2821
2733
|
const response = await this.api.post(`${this.route}create_sheet_from_document`, params);
|
|
2822
2734
|
return response.data;
|
|
2823
2735
|
}
|
|
2824
|
-
async
|
|
2736
|
+
async cloneSheetToNewDocument(params) {
|
|
2825
2737
|
const response = await this.api.post(`${this.route}clone_sheet_to_new_document`, params);
|
|
2826
2738
|
return response.data;
|
|
2827
2739
|
}
|
|
@@ -2846,6 +2758,10 @@ var Repository73 = class {
|
|
|
2846
2758
|
async rmUpdateDataBySheetId(params, body) {
|
|
2847
2759
|
await this.api.post(`${this.route}rm_data_by_sheet_id/${params.id}`, body);
|
|
2848
2760
|
}
|
|
2761
|
+
async findRmOpenDocuments() {
|
|
2762
|
+
const response = await this.api.get(`${this.route}rm_open_documents`);
|
|
2763
|
+
return response.data;
|
|
2764
|
+
}
|
|
2849
2765
|
};
|
|
2850
2766
|
|
|
2851
2767
|
// src/modules/stock/schedule.ts
|
|
@@ -3144,6 +3060,10 @@ var Repository82 = class {
|
|
|
3144
3060
|
const response = await this.api.get(`${this.route}find_client_or_provider`, { params });
|
|
3145
3061
|
return response.data;
|
|
3146
3062
|
}
|
|
3063
|
+
async findForGmail(params) {
|
|
3064
|
+
const response = await this.api.get(`${this.route}for_gmail`, { params });
|
|
3065
|
+
return response.data;
|
|
3066
|
+
}
|
|
3147
3067
|
};
|
|
3148
3068
|
|
|
3149
3069
|
// src/modules/integration/projectInfo.ts
|
|
@@ -3264,7 +3184,8 @@ var Repository86 = class {
|
|
|
3264
3184
|
ef_name,
|
|
3265
3185
|
pc_document_number,
|
|
3266
3186
|
prison,
|
|
3267
|
-
note
|
|
3187
|
+
note,
|
|
3188
|
+
availableStock
|
|
3268
3189
|
}, token) {
|
|
3269
3190
|
const qs = new URLSearchParams();
|
|
3270
3191
|
qs.set("ef_name", ef_name);
|
|
@@ -3276,6 +3197,7 @@ var Repository86 = class {
|
|
|
3276
3197
|
qs.set("note", note.toString());
|
|
3277
3198
|
}
|
|
3278
3199
|
qs.set("prison", prison.toString());
|
|
3200
|
+
qs.set("availableStock", availableStock.toString());
|
|
3279
3201
|
qs.set("token", token);
|
|
3280
3202
|
return `${this.publicRoute}print_label_pdf/${product_id}?${qs.toString()}`;
|
|
3281
3203
|
}
|
|
@@ -3437,7 +3359,8 @@ var Repository92 = class {
|
|
|
3437
3359
|
return response.data;
|
|
3438
3360
|
}
|
|
3439
3361
|
async checkLinesInPrison(data) {
|
|
3440
|
-
await this.api.post(`${this.route}check_in_prison`, data);
|
|
3362
|
+
const response = await this.api.post(`${this.route}check_in_prison`, data);
|
|
3363
|
+
return response.data;
|
|
3441
3364
|
}
|
|
3442
3365
|
async createLinesInPrison(data) {
|
|
3443
3366
|
const response = await this.api.post(`${this.route}create_lines`, data);
|
|
@@ -3491,6 +3414,9 @@ var Repository94 = class {
|
|
|
3491
3414
|
async createInventory(data) {
|
|
3492
3415
|
await this.api.post(`${this.route}`, data);
|
|
3493
3416
|
}
|
|
3417
|
+
async createManyInventory(data) {
|
|
3418
|
+
await this.api.post(`${this.route}/create_many`, data);
|
|
3419
|
+
}
|
|
3494
3420
|
};
|
|
3495
3421
|
|
|
3496
3422
|
// src/modules/document/returnToProvider.ts
|
|
@@ -3588,18 +3514,10 @@ var Repository98 = class {
|
|
|
3588
3514
|
this.route = route;
|
|
3589
3515
|
this.publicRoute = publicRoute;
|
|
3590
3516
|
}
|
|
3591
|
-
async
|
|
3517
|
+
async upsertOrDelete(body) {
|
|
3592
3518
|
const response = await this.api.post(`${this.route}`, body);
|
|
3593
3519
|
return response.data;
|
|
3594
3520
|
}
|
|
3595
|
-
async update(selector, body) {
|
|
3596
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
3597
|
-
return response.data;
|
|
3598
|
-
}
|
|
3599
|
-
async deleteOne(selector) {
|
|
3600
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
3601
|
-
return response.data;
|
|
3602
|
-
}
|
|
3603
3521
|
};
|
|
3604
3522
|
|
|
3605
3523
|
// src/modules/stock/savedProviderProposal.ts
|
|
@@ -3617,18 +3535,10 @@ var Repository99 = class {
|
|
|
3617
3535
|
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
3618
3536
|
return response.data;
|
|
3619
3537
|
}
|
|
3620
|
-
async
|
|
3538
|
+
async set(body) {
|
|
3621
3539
|
const response = await this.api.post(`${this.route}`, body);
|
|
3622
3540
|
return response.data;
|
|
3623
3541
|
}
|
|
3624
|
-
async update(selector, body) {
|
|
3625
|
-
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
3626
|
-
return response.data;
|
|
3627
|
-
}
|
|
3628
|
-
async deleteOne(selector) {
|
|
3629
|
-
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
3630
|
-
return response.data;
|
|
3631
|
-
}
|
|
3632
3542
|
};
|
|
3633
3543
|
|
|
3634
3544
|
// src/modules/stock/productGoogleSheets.ts
|
|
@@ -3916,7 +3826,7 @@ var Repository107 = class {
|
|
|
3916
3826
|
}
|
|
3917
3827
|
};
|
|
3918
3828
|
|
|
3919
|
-
// src/modules/
|
|
3829
|
+
// src/modules/ui/sideMenu.ts
|
|
3920
3830
|
var sideMenu_exports = {};
|
|
3921
3831
|
__export(sideMenu_exports, {
|
|
3922
3832
|
default: () => Repository108
|
|
@@ -4041,16 +3951,8 @@ var Repository113 = class {
|
|
|
4041
3951
|
const response = await this.api.post(`${this.route}`, data);
|
|
4042
3952
|
return response.data;
|
|
4043
3953
|
}
|
|
4044
|
-
async
|
|
4045
|
-
const response = await this.api.get(`${this.route}
|
|
4046
|
-
return response.data;
|
|
4047
|
-
}
|
|
4048
|
-
async findByDocumentHeaderId(selector) {
|
|
4049
|
-
const response = await this.api.get(`${this.route}by_document_header_id/${selector.id}`);
|
|
4050
|
-
return response.data;
|
|
4051
|
-
}
|
|
4052
|
-
async findByPersonaId(selector) {
|
|
4053
|
-
const response = await this.api.get(`${this.route}by_persona_id/${selector.id}`);
|
|
3954
|
+
async find(data) {
|
|
3955
|
+
const response = await this.api.get(`${this.route}`, { params: data });
|
|
4054
3956
|
return response.data;
|
|
4055
3957
|
}
|
|
4056
3958
|
async deleteOne(selector) {
|
|
@@ -4085,6 +3987,242 @@ var Repository114 = class {
|
|
|
4085
3987
|
}
|
|
4086
3988
|
};
|
|
4087
3989
|
|
|
3990
|
+
// src/modules/stock/gmails.ts
|
|
3991
|
+
var gmails_exports = {};
|
|
3992
|
+
__export(gmails_exports, {
|
|
3993
|
+
default: () => Repository115
|
|
3994
|
+
});
|
|
3995
|
+
var Repository115 = class {
|
|
3996
|
+
constructor({ api, route, publicRoute }) {
|
|
3997
|
+
this.api = api;
|
|
3998
|
+
this.route = route;
|
|
3999
|
+
this.publicRoute = publicRoute;
|
|
4000
|
+
}
|
|
4001
|
+
async auth() {
|
|
4002
|
+
const response = await this.api.get(`${this.route}auth`);
|
|
4003
|
+
return response.data;
|
|
4004
|
+
}
|
|
4005
|
+
async emails() {
|
|
4006
|
+
const response = await this.api.get(`${this.route}emails`);
|
|
4007
|
+
return response.data;
|
|
4008
|
+
}
|
|
4009
|
+
async executeGmailCommand(selector) {
|
|
4010
|
+
const response = await this.api.post(
|
|
4011
|
+
`${this.route}execute_gmail_command/${selector.id}`
|
|
4012
|
+
);
|
|
4013
|
+
return response.data;
|
|
4014
|
+
}
|
|
4015
|
+
async editPreviewChatMessage(selector, data) {
|
|
4016
|
+
const response = await this.api.post(
|
|
4017
|
+
`${this.route}edit_preview_chat_message/${selector.id}`,
|
|
4018
|
+
data
|
|
4019
|
+
);
|
|
4020
|
+
return response.data;
|
|
4021
|
+
}
|
|
4022
|
+
};
|
|
4023
|
+
|
|
4024
|
+
// src/modules/document/NPF.ts
|
|
4025
|
+
var NPF_exports = {};
|
|
4026
|
+
__export(NPF_exports, {
|
|
4027
|
+
default: () => Repository116
|
|
4028
|
+
});
|
|
4029
|
+
var Repository116 = class {
|
|
4030
|
+
constructor({ api, route, publicRoute }) {
|
|
4031
|
+
this.api = api;
|
|
4032
|
+
this.route = route;
|
|
4033
|
+
this.publicRoute = publicRoute;
|
|
4034
|
+
}
|
|
4035
|
+
async create(body) {
|
|
4036
|
+
const response = await this.api.post(`${this.route}providers`, body);
|
|
4037
|
+
return response.data;
|
|
4038
|
+
}
|
|
4039
|
+
};
|
|
4040
|
+
|
|
4041
|
+
// src/modules/document/NRCL.ts
|
|
4042
|
+
var NRCL_exports = {};
|
|
4043
|
+
__export(NRCL_exports, {
|
|
4044
|
+
default: () => Repository117
|
|
4045
|
+
});
|
|
4046
|
+
var Repository117 = class {
|
|
4047
|
+
constructor({ api, route, publicRoute }) {
|
|
4048
|
+
this.api = api;
|
|
4049
|
+
this.route = route;
|
|
4050
|
+
this.publicRoute = publicRoute;
|
|
4051
|
+
}
|
|
4052
|
+
async create(data) {
|
|
4053
|
+
await this.api.post(`${this.route}multiple_documents`, {
|
|
4054
|
+
data
|
|
4055
|
+
});
|
|
4056
|
+
}
|
|
4057
|
+
};
|
|
4058
|
+
|
|
4059
|
+
// src/modules/supply/currentAccount.ts
|
|
4060
|
+
var currentAccount_exports = {};
|
|
4061
|
+
__export(currentAccount_exports, {
|
|
4062
|
+
default: () => Repository118
|
|
4063
|
+
});
|
|
4064
|
+
var Repository118 = class {
|
|
4065
|
+
constructor({ api, route, publicRoute }) {
|
|
4066
|
+
this.api = api;
|
|
4067
|
+
this.route = route;
|
|
4068
|
+
this.publicRoute = publicRoute;
|
|
4069
|
+
}
|
|
4070
|
+
async findCurrentAccountByOwnerId(params) {
|
|
4071
|
+
const response = await this.api.get(`${this.route}current_account`, {
|
|
4072
|
+
params
|
|
4073
|
+
});
|
|
4074
|
+
return response.data;
|
|
4075
|
+
}
|
|
4076
|
+
async findBalanceByOwnerId(params) {
|
|
4077
|
+
const response = await this.api.get(`${this.route}balance`, {
|
|
4078
|
+
params
|
|
4079
|
+
});
|
|
4080
|
+
return response.data;
|
|
4081
|
+
}
|
|
4082
|
+
async exportCurrentAccount(params) {
|
|
4083
|
+
const response = await this.api.get(`${this.publicRoute}export_current_account`, {
|
|
4084
|
+
params
|
|
4085
|
+
});
|
|
4086
|
+
return response.data;
|
|
4087
|
+
}
|
|
4088
|
+
async findClientUnpaidCredit(params) {
|
|
4089
|
+
const response = await this.api.get(`${this.route}unpaid_credit`, {
|
|
4090
|
+
params
|
|
4091
|
+
});
|
|
4092
|
+
return response.data;
|
|
4093
|
+
}
|
|
4094
|
+
async findClientUnpaidDebit(params) {
|
|
4095
|
+
const response = await this.api.get(`${this.route}unpaid_debit`, {
|
|
4096
|
+
params
|
|
4097
|
+
});
|
|
4098
|
+
return response.data;
|
|
4099
|
+
}
|
|
4100
|
+
getExportCurrentAccountUrl({
|
|
4101
|
+
owner_id,
|
|
4102
|
+
start_date,
|
|
4103
|
+
end_date,
|
|
4104
|
+
output,
|
|
4105
|
+
token
|
|
4106
|
+
}) {
|
|
4107
|
+
const qs = new URLSearchParams();
|
|
4108
|
+
qs.set("owner_id", owner_id);
|
|
4109
|
+
qs.set("output", output);
|
|
4110
|
+
if (start_date) qs.set("start_date", start_date.toISOString());
|
|
4111
|
+
if (end_date) qs.set("end_date", end_date.toISOString());
|
|
4112
|
+
qs.set("token", token);
|
|
4113
|
+
return `${this.publicRoute}export_current_account?${qs.toString()}`;
|
|
4114
|
+
}
|
|
4115
|
+
};
|
|
4116
|
+
|
|
4117
|
+
// src/modules/supply/paymentBatch.ts
|
|
4118
|
+
var paymentBatch_exports = {};
|
|
4119
|
+
__export(paymentBatch_exports, {
|
|
4120
|
+
default: () => Repository119
|
|
4121
|
+
});
|
|
4122
|
+
var Repository119 = class {
|
|
4123
|
+
constructor({ api, route, publicRoute }) {
|
|
4124
|
+
this.api = api;
|
|
4125
|
+
this.route = route;
|
|
4126
|
+
this.publicRoute = publicRoute;
|
|
4127
|
+
}
|
|
4128
|
+
async findPending(params) {
|
|
4129
|
+
const response = await this.api.get(`${this.route}not_exported`, {
|
|
4130
|
+
params
|
|
4131
|
+
});
|
|
4132
|
+
return response.data;
|
|
4133
|
+
}
|
|
4134
|
+
async create(body) {
|
|
4135
|
+
await this.api.post(`${this.route}export_payments`, body);
|
|
4136
|
+
}
|
|
4137
|
+
async findCreated() {
|
|
4138
|
+
const response = await this.api.get(`${this.route}batches`);
|
|
4139
|
+
return response.data;
|
|
4140
|
+
}
|
|
4141
|
+
async updateDownloadNumber(params) {
|
|
4142
|
+
await this.api.put(`${this.route}downloaded_batch_number/${params}`);
|
|
4143
|
+
}
|
|
4144
|
+
async deleteOne(selector) {
|
|
4145
|
+
const response = await this.api.delete(`${this.route}delete_batch${selector.id}`);
|
|
4146
|
+
return response.data;
|
|
4147
|
+
}
|
|
4148
|
+
getBatchPdfUrl(opts) {
|
|
4149
|
+
const qs = new URLSearchParams();
|
|
4150
|
+
qs.set("token", opts.token);
|
|
4151
|
+
if (opts.ids?.length) {
|
|
4152
|
+
qs.set("ids", opts.ids.join(","));
|
|
4153
|
+
return `${this.route}create_batch_pdf?${qs.toString()}`;
|
|
4154
|
+
}
|
|
4155
|
+
if (opts.month && opts.year) {
|
|
4156
|
+
qs.set("month", String(opts.month));
|
|
4157
|
+
qs.set("year", String(opts.year));
|
|
4158
|
+
return `${this.route}create_batch_pdf?${qs.toString()}`;
|
|
4159
|
+
}
|
|
4160
|
+
throw new Error("Precisas de passar ids OU month/year");
|
|
4161
|
+
}
|
|
4162
|
+
};
|
|
4163
|
+
|
|
4164
|
+
// src/modules/ui/portal.ts
|
|
4165
|
+
var portal_exports = {};
|
|
4166
|
+
__export(portal_exports, {
|
|
4167
|
+
default: () => Repository120
|
|
4168
|
+
});
|
|
4169
|
+
var Repository120 = class {
|
|
4170
|
+
constructor({ api, route, publicRoute }) {
|
|
4171
|
+
this.api = api;
|
|
4172
|
+
this.route = route;
|
|
4173
|
+
this.publicRoute = publicRoute;
|
|
4174
|
+
}
|
|
4175
|
+
async publicFindByOwnerId(params) {
|
|
4176
|
+
const response = await this.api.get(`${this.route}public_by_owner`, {
|
|
4177
|
+
params
|
|
4178
|
+
});
|
|
4179
|
+
return response.data;
|
|
4180
|
+
}
|
|
4181
|
+
async createPublicDocumentHeaderNote(data) {
|
|
4182
|
+
const response = await this.api.post(`${this.route}public_document_header_note`, data);
|
|
4183
|
+
return response.data;
|
|
4184
|
+
}
|
|
4185
|
+
async updatePublicDocumentHeaderNote({ id }, data) {
|
|
4186
|
+
const response = await this.api.put(`${this.route}public_document_header_note/${id}`, data);
|
|
4187
|
+
return response.data;
|
|
4188
|
+
}
|
|
4189
|
+
};
|
|
4190
|
+
|
|
4191
|
+
// src/modules/supply/googleSheetPool.ts
|
|
4192
|
+
var googleSheetPool_exports = {};
|
|
4193
|
+
__export(googleSheetPool_exports, {
|
|
4194
|
+
default: () => Repository121
|
|
4195
|
+
});
|
|
4196
|
+
var Repository121 = class {
|
|
4197
|
+
constructor({ api, route, publicRoute }) {
|
|
4198
|
+
this.api = api;
|
|
4199
|
+
this.route = route;
|
|
4200
|
+
this.publicRoute = publicRoute;
|
|
4201
|
+
}
|
|
4202
|
+
async clearAndFill() {
|
|
4203
|
+
const response = await this.api.post(`${this.route}clear_and_fill`);
|
|
4204
|
+
return response.data;
|
|
4205
|
+
}
|
|
4206
|
+
};
|
|
4207
|
+
|
|
4208
|
+
// src/modules/supply/saft.ts
|
|
4209
|
+
var saft_exports = {};
|
|
4210
|
+
__export(saft_exports, {
|
|
4211
|
+
default: () => Repository122
|
|
4212
|
+
});
|
|
4213
|
+
var Repository122 = class {
|
|
4214
|
+
constructor({ api, route }) {
|
|
4215
|
+
this.api = api;
|
|
4216
|
+
this.route = route;
|
|
4217
|
+
}
|
|
4218
|
+
async getUrl({ month, year }) {
|
|
4219
|
+
const qs = new URLSearchParams();
|
|
4220
|
+
qs.set("month", month.toString());
|
|
4221
|
+
qs.set("year", year.toString());
|
|
4222
|
+
return `${this.route}download?${qs.toString()}`;
|
|
4223
|
+
}
|
|
4224
|
+
};
|
|
4225
|
+
|
|
4088
4226
|
// src/main.ts
|
|
4089
4227
|
var API = class {
|
|
4090
4228
|
constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
|
|
@@ -4277,6 +4415,14 @@ var API = class {
|
|
|
4277
4415
|
this.DocumentLineMt = new Repository112(getModuleParams("stock", "document_line_mt"));
|
|
4278
4416
|
this.ChatSubscriber = new Repository113(getModuleParams("users", "chat_subscriber"));
|
|
4279
4417
|
this.Tag = new Repository114(getModuleParams("stock", "tag"));
|
|
4418
|
+
this.Gmails = new Repository115(getModuleParams("stock", "gmail"));
|
|
4419
|
+
this.NPF = new Repository116(getModuleParams("stock", "npf"));
|
|
4420
|
+
this.NRCL = new Repository117(getModuleParams("stock", "nrcl"));
|
|
4421
|
+
this.PaymentBatch = new Repository119(getModuleParams("stock", "payment_batch"));
|
|
4422
|
+
this.CurrentAccount = new Repository118(getModuleParams("stock", "current_account"));
|
|
4423
|
+
this.Portal = new Repository120(getModuleParams("stock", "portal"));
|
|
4424
|
+
this.GoogleSheetPool = new Repository121(getModuleParams("stock", "google_sheet_pool"));
|
|
4425
|
+
this.Saft = new Repository122(getModuleParams("stock", "saft"));
|
|
4280
4426
|
}
|
|
4281
4427
|
};
|
|
4282
4428
|
|
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": "1.2
|
|
4
|
+
"version": "1.3.2",
|
|
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": "^1.
|
|
26
|
+
"@nomalism-com/types": "^1.3.1",
|
|
27
27
|
"axios": "^1.9.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@swc/core": "^1.11.29",
|
|
31
|
-
"@types/node": "^
|
|
31
|
+
"@types/node": "^24.9.1",
|
|
32
32
|
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
33
33
|
"@typescript-eslint/parser": "^8.32.1",
|
|
34
34
|
"eslint": "^9.27.0",
|