@nomalism-com/api 0.49.19 → 0.49.20

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.cjs CHANGED
@@ -366,8 +366,9 @@ var Repository4 = class {
366
366
  pc_document_number,
367
367
  prison,
368
368
  note,
369
- availableStock
370
- }, token) {
369
+ availableStock,
370
+ token
371
+ }) {
371
372
  const qs = new URLSearchParams();
372
373
  qs.set("ef_name", ef_name);
373
374
  qs.set("quantity", quantity.toString());
@@ -830,7 +831,7 @@ var Repository20 = class {
830
831
  this.api = api;
831
832
  this.route = route;
832
833
  }
833
- getUrl(multimediaId, download = false) {
834
+ getUrl(multimediaId, { download } = {}) {
834
835
  const qs = new URLSearchParams();
835
836
  if (download) qs.set("download", download.toString());
836
837
  return `${this.route}${multimediaId}?${qs.toString()}`;
@@ -2131,15 +2132,18 @@ var Repository52 = class {
2131
2132
  async deleteOne(selector) {
2132
2133
  await this.api.delete(`${this.route}${selector.id}`);
2133
2134
  }
2134
- printLabelToPdfUrl({ id }, token) {
2135
+ printLabelToPdfUrl({ id }, { token }) {
2135
2136
  const qs = new URLSearchParams();
2136
2137
  qs.set("token", token);
2137
2138
  return `${this.route}print_label_pdf/${id}?${qs.toString()}`;
2138
2139
  }
2139
- printLabelToPdfBulk(ids, token) {
2140
+ printLabelToPdfBulk({
2141
+ ids,
2142
+ token
2143
+ }) {
2140
2144
  const qs = new URLSearchParams();
2141
2145
  qs.set("token", token);
2142
- qs.set("ids", ids.join(","));
2146
+ qs.set("ids", ids);
2143
2147
  return `${this.route}print_label_pdf/bulk?${qs.toString()}`;
2144
2148
  }
2145
2149
  async updateDbFromSheets() {
@@ -3279,12 +3283,12 @@ var Repository77 = class {
3279
3283
  async deleteMany(document_line_ids) {
3280
3284
  await this.api.delete(`${this.route}`, { data: document_line_ids });
3281
3285
  }
3282
- printLabelToPdfUrl({ document_line_ids }, token) {
3286
+ printLabelToPdfUrl({ document_line_ids }, { token }) {
3283
3287
  const qs = new URLSearchParams();
3284
3288
  qs.set("token", token);
3285
3289
  return `${this.route}print_label_pdf/${document_line_ids}?${qs.toString()}`;
3286
3290
  }
3287
- printGroupLabelToPdfUrl({ document_line_ids }, token) {
3291
+ printGroupLabelToPdfUrl({ document_line_ids }, { token }) {
3288
3292
  const qs = new URLSearchParams();
3289
3293
  qs.set("token", token);
3290
3294
  return `${this.route}print_group_label_pdf/${document_line_ids}?${qs.toString()}`;
@@ -3668,16 +3672,21 @@ var Repository89 = class {
3668
3672
  async deleteOne(selector) {
3669
3673
  await this.api.delete(`${this.route}delete_batch${selector.id}`);
3670
3674
  }
3671
- getBatchPdfUrl(opts) {
3675
+ getBatchPdfUrl({
3676
+ token,
3677
+ ids,
3678
+ month,
3679
+ year
3680
+ }) {
3672
3681
  const qs = new URLSearchParams();
3673
- qs.set("token", opts.token);
3674
- if (opts.ids?.length) {
3675
- qs.set("ids", opts.ids.join(","));
3682
+ qs.set("token", token);
3683
+ if (ids) {
3684
+ qs.set("ids", ids);
3676
3685
  return `${this.route}create_batch_pdf?${qs.toString()}`;
3677
3686
  }
3678
- if (opts.month && opts.year) {
3679
- qs.set("month", String(opts.month));
3680
- qs.set("year", String(opts.year));
3687
+ if (month && year) {
3688
+ qs.set("month", String(month));
3689
+ qs.set("year", String(year));
3681
3690
  return `${this.route}create_batch_pdf?${qs.toString()}`;
3682
3691
  }
3683
3692
  throw new Error("Precisas de passar ids OU month/year");
@@ -3775,7 +3784,11 @@ var Repository92 = class {
3775
3784
  constructor({ route }) {
3776
3785
  this.route = route;
3777
3786
  }
3778
- getUrl({ date_start, date_end, token }) {
3787
+ getUrl({
3788
+ date_start,
3789
+ date_end,
3790
+ token
3791
+ }) {
3779
3792
  const qs = new URLSearchParams();
3780
3793
  qs.set("date_start", date_start);
3781
3794
  qs.set("date_end", date_end);
package/dist/index.js CHANGED
@@ -333,8 +333,9 @@ var Repository4 = class {
333
333
  pc_document_number,
334
334
  prison,
335
335
  note,
336
- availableStock
337
- }, token) {
336
+ availableStock,
337
+ token
338
+ }) {
338
339
  const qs = new URLSearchParams();
339
340
  qs.set("ef_name", ef_name);
340
341
  qs.set("quantity", quantity.toString());
@@ -797,7 +798,7 @@ var Repository20 = class {
797
798
  this.api = api;
798
799
  this.route = route;
799
800
  }
800
- getUrl(multimediaId, download = false) {
801
+ getUrl(multimediaId, { download } = {}) {
801
802
  const qs = new URLSearchParams();
802
803
  if (download) qs.set("download", download.toString());
803
804
  return `${this.route}${multimediaId}?${qs.toString()}`;
@@ -2098,15 +2099,18 @@ var Repository52 = class {
2098
2099
  async deleteOne(selector) {
2099
2100
  await this.api.delete(`${this.route}${selector.id}`);
2100
2101
  }
2101
- printLabelToPdfUrl({ id }, token) {
2102
+ printLabelToPdfUrl({ id }, { token }) {
2102
2103
  const qs = new URLSearchParams();
2103
2104
  qs.set("token", token);
2104
2105
  return `${this.route}print_label_pdf/${id}?${qs.toString()}`;
2105
2106
  }
2106
- printLabelToPdfBulk(ids, token) {
2107
+ printLabelToPdfBulk({
2108
+ ids,
2109
+ token
2110
+ }) {
2107
2111
  const qs = new URLSearchParams();
2108
2112
  qs.set("token", token);
2109
- qs.set("ids", ids.join(","));
2113
+ qs.set("ids", ids);
2110
2114
  return `${this.route}print_label_pdf/bulk?${qs.toString()}`;
2111
2115
  }
2112
2116
  async updateDbFromSheets() {
@@ -3246,12 +3250,12 @@ var Repository77 = class {
3246
3250
  async deleteMany(document_line_ids) {
3247
3251
  await this.api.delete(`${this.route}`, { data: document_line_ids });
3248
3252
  }
3249
- printLabelToPdfUrl({ document_line_ids }, token) {
3253
+ printLabelToPdfUrl({ document_line_ids }, { token }) {
3250
3254
  const qs = new URLSearchParams();
3251
3255
  qs.set("token", token);
3252
3256
  return `${this.route}print_label_pdf/${document_line_ids}?${qs.toString()}`;
3253
3257
  }
3254
- printGroupLabelToPdfUrl({ document_line_ids }, token) {
3258
+ printGroupLabelToPdfUrl({ document_line_ids }, { token }) {
3255
3259
  const qs = new URLSearchParams();
3256
3260
  qs.set("token", token);
3257
3261
  return `${this.route}print_group_label_pdf/${document_line_ids}?${qs.toString()}`;
@@ -3635,16 +3639,21 @@ var Repository89 = class {
3635
3639
  async deleteOne(selector) {
3636
3640
  await this.api.delete(`${this.route}delete_batch${selector.id}`);
3637
3641
  }
3638
- getBatchPdfUrl(opts) {
3642
+ getBatchPdfUrl({
3643
+ token,
3644
+ ids,
3645
+ month,
3646
+ year
3647
+ }) {
3639
3648
  const qs = new URLSearchParams();
3640
- qs.set("token", opts.token);
3641
- if (opts.ids?.length) {
3642
- qs.set("ids", opts.ids.join(","));
3649
+ qs.set("token", token);
3650
+ if (ids) {
3651
+ qs.set("ids", ids);
3643
3652
  return `${this.route}create_batch_pdf?${qs.toString()}`;
3644
3653
  }
3645
- if (opts.month && opts.year) {
3646
- qs.set("month", String(opts.month));
3647
- qs.set("year", String(opts.year));
3654
+ if (month && year) {
3655
+ qs.set("month", String(month));
3656
+ qs.set("year", String(year));
3648
3657
  return `${this.route}create_batch_pdf?${qs.toString()}`;
3649
3658
  }
3650
3659
  throw new Error("Precisas de passar ids OU month/year");
@@ -3742,7 +3751,11 @@ var Repository92 = class {
3742
3751
  constructor({ route }) {
3743
3752
  this.route = route;
3744
3753
  }
3745
- getUrl({ date_start, date_end, token }) {
3754
+ getUrl({
3755
+ date_start,
3756
+ date_end,
3757
+ token
3758
+ }) {
3746
3759
  const qs = new URLSearchParams();
3747
3760
  qs.set("date_start", date_start);
3748
3761
  qs.set("date_end", date_end);
@@ -9,6 +9,6 @@ export default class Repository implements Nomalism.MaterialEntrance.IApi {
9
9
  finalizarEntradaMaterial(data: Nomalism.MaterialEntrance.IFinalizarEntradaDeMaterialRequest): Promise<Nomalism.MaterialEntrance.IFinalizarEntradaDeMaterialResponse>;
10
10
  undoEntradaMaterial(data: Nomalism.MaterialEntrance.IUndoEntradaDeMaterialRequest): Promise<void>;
11
11
  findDoneById({ id, }: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.MaterialEntrance.IFindDoneByIdResponse[]>;
12
- printLabelToPdfUrl({ product_id }: Nomalism.MaterialEntrance.IPrintLabelParamsRequest, { quantity, ef_name, pc_document_number, prison, note, availableStock, }: Nomalism.MaterialEntrance.IPrintLabelQueryRequest, token: string): string;
12
+ printLabelToPdfUrl({ product_id }: Nomalism.MaterialEntrance.IPrintLabelParamsRequest, { quantity, ef_name, pc_document_number, prison, note, availableStock, token, }: Nomalism.MaterialEntrance.IPrintLabelQueryWithTokenRequest): string;
13
13
  printBulkLabelToPdfUrl({ groupLabel, stockOrders, notOk, clientOrders, saved_em_picking_ids, token, }: Nomalism.MaterialEntrance.IPrintBulkLabelRequest): string;
14
14
  }
@@ -5,7 +5,7 @@ export default class Repository implements Nomalism.Multimedia.IApi {
5
5
  route: string;
6
6
  private api;
7
7
  constructor({ api, route }: IModuleConstructor);
8
- getUrl(multimediaId: string, download?: boolean): string;
8
+ getUrl(multimediaId: string, { download }?: Nomalism.Multimedia.IFindByIdRequest): string;
9
9
  create(multipartFormData: unknown, headers?: RawAxiosRequestHeaders): Promise<Nomalism.Multimedia.Entity>;
10
10
  update(id: string, multipartFormData: unknown, headers?: RawAxiosRequestHeaders): Promise<void>;
11
11
  }
@@ -22,8 +22,8 @@ export default class Repository implements Nomalism.ProductGoogleSheets.IReposit
22
22
  create(body: Nomalism.ProductGoogleSheets.ICreateRequest): Promise<string>;
23
23
  update({ id }: Nomalism.shared.IFindByIdRequest, body: Nomalism.ProductGoogleSheets.IUpdateRequest): Promise<void>;
24
24
  deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void>;
25
- printLabelToPdfUrl({ id }: Nomalism.shared.IFindByIdRequest, token: string): string;
26
- printLabelToPdfBulk(ids: string[], token: string): string;
25
+ printLabelToPdfUrl({ id }: Nomalism.shared.IFindByIdRequest, { token }: Nomalism.ProductGoogleSheets.IPrintLabelQueryRequest): string;
26
+ printLabelToPdfBulk({ ids, token, }: Nomalism.ProductGoogleSheets.IPrintLabelBulkQueryRequest): string;
27
27
  updateDbFromSheets(): Promise<void>;
28
28
  partialLocation(body: Nomalism.ProductGoogleSheets.IProductLocation): Promise<void>;
29
29
  fullLocation(body: Nomalism.ProductGoogleSheets.IProductLocation): Promise<void>;
@@ -10,6 +10,6 @@ export default class Repository implements Nomalism.DocumentLine.IRepository {
10
10
  updateMany(data: Nomalism.DocumentLine.IUpdateManyRequest): Promise<void>;
11
11
  updateManyByDocumentHeader(params: Nomalism.shared.IFindByIdRequest, data: Nomalism.DocumentLine.IUpdateManyByDocumentHeaderRequest): Promise<void>;
12
12
  deleteMany(document_line_ids: string[]): Promise<void>;
13
- printLabelToPdfUrl({ document_line_ids }: Nomalism.DocumentLine.IPrintLabelParamsRequest, token: string): string;
14
- printGroupLabelToPdfUrl({ document_line_ids }: Nomalism.DocumentLine.IPrintLabelParamsRequest, token: string): string;
13
+ printLabelToPdfUrl({ document_line_ids }: Nomalism.DocumentLine.IPrintLabelParamsRequest, { token }: Nomalism.DocumentLine.IPrintLabelQueryRequest): string;
14
+ printGroupLabelToPdfUrl({ document_line_ids }: Nomalism.DocumentLine.IPrintLabelParamsRequest, { token }: Nomalism.DocumentLine.IPrintLabelQueryRequest): string;
15
15
  }
@@ -9,10 +9,5 @@ export default class Repository implements Nomalism.PaymentBatch.IRepository {
9
9
  findCreated(): Promise<Nomalism.PaymentBatch.IPaymentsBatchResponse[]>;
10
10
  updateDownloadNumber({ id, }: Nomalism.shared.IFindByIdRequest): Promise<void>;
11
11
  deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void>;
12
- getBatchPdfUrl(opts: {
13
- month?: number;
14
- year?: number;
15
- ids?: string[];
16
- token: string;
17
- }): string;
12
+ getBatchPdfUrl({ token, ids, month, year, }: Nomalism.PaymentBatch.ICreateBulkPdfRequest): string;
18
13
  }
@@ -1,11 +1,7 @@
1
+ import * as Nomalism from "@nomalism-com/types";
1
2
  import { IModuleConstructor } from "../../main";
2
- export interface IDownloadSaftRequest {
3
- date_start: string;
4
- date_end: string;
5
- token: string;
6
- }
7
3
  export default class Repository {
8
4
  route: string;
9
5
  constructor({ route }: IModuleConstructor);
10
- getUrl({ date_start, date_end, token }: IDownloadSaftRequest): string;
6
+ getUrl({ date_start, date_end, token, }: Nomalism.Saft.ISaftInvoiceRequest): string;
11
7
  }
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.49.19",
4
+ "version": "0.49.20",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -30,24 +30,24 @@
30
30
  "prepare": "husky"
31
31
  },
32
32
  "dependencies": {
33
- "@nomalism-com/types": "^0.49.26",
33
+ "@nomalism-com/types": "^0.49.27",
34
34
  "axios": "^1.20.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@eslint/js": "^10.0.1",
38
38
  "@swc/core": "^1.16.2",
39
- "@types/node": "^26.6.1",
39
+ "@types/node": "^26.6.2",
40
40
  "@typescript-eslint/eslint-plugin": "^8.62.0",
41
41
  "@typescript-eslint/parser": "^8.62.0",
42
- "eslint": "^10.10.0",
42
+ "eslint": "^10.11.0",
43
43
  "eslint-config-prettier": "^10.1.8",
44
44
  "eslint-plugin-simple-import-sort": "^14.0.0",
45
45
  "globals": "^17.12.0",
46
46
  "husky": "^9.1.7",
47
47
  "lint-staged": "^17.5.1",
48
- "prettier": "^3.9.8",
48
+ "prettier": "^3.9.9",
49
49
  "tsup": "^8.5.1",
50
- "typescript-eslint": "^8.70.0"
50
+ "typescript-eslint": "^8.70.1"
51
51
  },
52
52
  "repository": {
53
53
  "type": "git",