@nomalism-com/api 0.45.64 → 0.46.1

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.js CHANGED
@@ -92,6 +92,7 @@ __export(main_exports, {
92
92
  RefreshToken: () => refreshToken_exports,
93
93
  ReturnReason: () => returnReason_exports,
94
94
  ReturnToProvider: () => returnToProvider_exports,
95
+ Saft: () => saft_exports,
95
96
  SavedEmPicking: () => savedEmPicking_exports,
96
97
  SavedProviderProposal: () => savedProviderProposal_exports,
97
98
  Schedule: () => schedule_exports,
@@ -134,6 +135,7 @@ import Nomalism from "@nomalism-com/types";
134
135
 
135
136
  // src/lib/apiError.ts
136
137
  import axios from "axios";
138
+ var RAW_ERROR = /* @__PURE__ */ Symbol("rawError");
137
139
  var ApiError = class _ApiError extends Error {
138
140
  constructor(fields, cause) {
139
141
  super(fields.message);
@@ -144,7 +146,7 @@ var ApiError = class _ApiError extends Error {
144
146
  this.method = fields.method;
145
147
  this.url = fields.url;
146
148
  this.data = fields.data;
147
- Object.defineProperty(this, "cause", {
149
+ Object.defineProperty(this, RAW_ERROR, {
148
150
  value: cause,
149
151
  enumerable: false,
150
152
  writable: false,
@@ -153,6 +155,13 @@ var ApiError = class _ApiError extends Error {
153
155
  const captureStackTrace = Error.captureStackTrace;
154
156
  captureStackTrace?.(this, _ApiError);
155
157
  }
158
+ /**
159
+ * The original underlying error (e.g. the raw AxiosError) for deep debugging.
160
+ * Lives on a non-enumerable Symbol slot, so it is never printed by loggers.
161
+ */
162
+ get raw() {
163
+ return this[RAW_ERROR];
164
+ }
156
165
  /** Controls what `JSON.stringify(err)` and most loggers emit — kept compact. */
157
166
  toJSON() {
158
167
  return {
@@ -4446,12 +4455,30 @@ var Repository125 = class {
4446
4455
  }
4447
4456
  };
4448
4457
 
4458
+ // src/modules/supply/saft.ts
4459
+ var saft_exports = {};
4460
+ __export(saft_exports, {
4461
+ default: () => Repository126
4462
+ });
4463
+ var Repository126 = class {
4464
+ constructor({ route }) {
4465
+ this.route = route;
4466
+ }
4467
+ getUrl({ date_start, date_end, token }) {
4468
+ const qs = new URLSearchParams();
4469
+ qs.set("date_start", date_start);
4470
+ qs.set("date_end", date_end);
4471
+ qs.set("token", token);
4472
+ return `${this.route}download?${qs.toString()}`;
4473
+ }
4474
+ };
4475
+
4449
4476
  // src/modules/stock/productLocation.ts
4450
4477
  var productLocation_exports = {};
4451
4478
  __export(productLocation_exports, {
4452
- default: () => Repository126
4479
+ default: () => Repository127
4453
4480
  });
4454
- var Repository126 = class {
4481
+ var Repository127 = class {
4455
4482
  constructor({ api, route }) {
4456
4483
  this.api = api;
4457
4484
  this.route = route;
@@ -4497,9 +4524,9 @@ var TimesheetRepository = class {
4497
4524
  // src/modules/document/CAT.ts
4498
4525
  var CAT_exports = {};
4499
4526
  __export(CAT_exports, {
4500
- default: () => Repository127
4527
+ default: () => Repository128
4501
4528
  });
4502
- var Repository127 = class {
4529
+ var Repository128 = class {
4503
4530
  constructor({ api, route }) {
4504
4531
  this.api = api;
4505
4532
  this.route = route;
@@ -4793,6 +4820,8 @@ var API = class {
4793
4820
  getModuleParams("stock", Nomalism.CurrentAccount.Route)
4794
4821
  );
4795
4822
  this.Portal = new Repository118(getModuleParams("stock", Nomalism.Portal.Route));
4823
+ this.Saft = new Repository126(getModuleParams("stock", "saft"));
4824
+ this.AccountCode = new Repository120(getModuleParams("stock", "account_code"));
4796
4825
  this.GoogleSheetPool = new Repository119(
4797
4826
  getModuleParams("stock", Nomalism.GoogleSheetPool.Route)
4798
4827
  );
@@ -4810,11 +4839,11 @@ var API = class {
4810
4839
  this.GoogleCalendar = new Repository125(
4811
4840
  getModuleParams("stock", Nomalism.GoogleCalendar.Route)
4812
4841
  );
4813
- this.ProductLocation = new Repository126(
4842
+ this.ProductLocation = new Repository127(
4814
4843
  getModuleParams("stock", Nomalism.ProductLocation.Route)
4815
4844
  );
4816
4845
  this.TimeSheet = new TimesheetRepository(getModuleParams("users", Nomalism.TimeSheet.Route));
4817
- this.Catalogo = new Repository127(getModuleParams("stock", Nomalism.Catalogo.Route));
4846
+ this.Catalogo = new Repository128(getModuleParams("stock", Nomalism.Catalogo.Route));
4818
4847
  }
4819
4848
  };
4820
4849
 
@@ -21,8 +21,8 @@ export interface IApiErrorFields {
21
21
  *
22
22
  * Only small primitives are kept as enumerable fields, so `console.log(err)`,
23
23
  * `JSON.stringify(err)` and `err.stack` stay short. The original axios error is
24
- * preserved on a NON-enumerable `cause` property available for deep debugging,
25
- * but never dumped when the error is logged.
24
+ * preserved on a non-enumerable Symbol slot, reachable via `err.raw` for deep
25
+ * debugging, but never dumped when the error is logged.
26
26
  */
27
27
  export declare class ApiError extends Error {
28
28
  readonly kind: ApiErrorKind;
@@ -37,6 +37,11 @@ export declare class ApiError extends Error {
37
37
  /** The server-provided error payload (response body), when present. */
38
38
  readonly data?: unknown;
39
39
  constructor(fields: IApiErrorFields, cause?: unknown);
40
+ /**
41
+ * The original underlying error (e.g. the raw AxiosError) for deep debugging.
42
+ * Lives on a non-enumerable Symbol slot, so it is never printed by loggers.
43
+ */
44
+ get raw(): unknown;
40
45
  /** Controls what `JSON.stringify(err)` and most loggers emit — kept compact. */
41
46
  toJSON(): IApiErrorFields;
42
47
  }
package/dist/main.d.ts CHANGED
@@ -125,6 +125,7 @@ import PatchNotesClass from './modules/integration/patchNotes';
125
125
  import DocumentHeaderSurveyClass from './modules/supply/documentHeaderSurvey';
126
126
  import DocumentHeaderSubscriberClass from './modules/supply/documentHeaderSubscriber';
127
127
  import GoogleCalendarClass from './modules/stock/googleCalendar';
128
+ import SaftClass from './modules/supply/saft';
128
129
  import ProductLocationClass from './modules/stock/productLocation';
129
130
  import TimeSheetClass from './modules/user/timeSheet';
130
131
  import CatalogoClass from './modules/document/CAT';
@@ -245,6 +246,7 @@ export * as PatchNotes from './modules/integration/patchNotes';
245
246
  export * as DocumentHeaderSurvey from './modules/supply/documentHeaderSurvey';
246
247
  export * as DocumentHeaderSubscriber from './modules/supply/documentHeaderSubscriber';
247
248
  export * as GoogleCalendar from './modules/stock/googleCalendar';
249
+ export * as Saft from './modules/supply/saft';
248
250
  export * as ProductLocation from './modules/stock/productLocation';
249
251
  export * as TimeSheet from './modules/user/timeSheet';
250
252
  export * as Catalogo from './modules/document/CAT';
@@ -385,6 +387,7 @@ export declare class API {
385
387
  CurrentAccount: CurrentAccountClass;
386
388
  Portal: PortalClass;
387
389
  GoogleSheetPool: GoogleSheetPoolClass;
390
+ Saft: SaftClass;
388
391
  AccountCode: AccountCodeClass;
389
392
  LLM: LLMClass;
390
393
  PatchNotes: PatchNotesClass;
@@ -0,0 +1,11 @@
1
+ import { IModuleConstructor } from '../../main';
2
+ export interface IDownloadSaftRequest {
3
+ date_start: string;
4
+ date_end: string;
5
+ token: string;
6
+ }
7
+ export default class Repository {
8
+ route: string;
9
+ constructor({ route }: IModuleConstructor);
10
+ getUrl({ date_start, date_end, token }: IDownloadSaftRequest): string;
11
+ }
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.45.64",
4
+ "version": "0.46.1",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -27,15 +27,15 @@
27
27
  "axios": "^1.17.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@swc/core": "^1.15.40",
31
- "@types/node": "^24.13.1",
30
+ "@swc/core": "^1.15.41",
31
+ "@types/node": "^24.13.2",
32
32
  "@typescript-eslint/eslint-plugin": "^8.61.0",
33
33
  "@typescript-eslint/parser": "^8.61.0",
34
34
  "eslint": "^9.39.4",
35
35
  "eslint-config-prettier": "^10.1.8",
36
36
  "eslint-import-resolver-typescript": "^4.4.5",
37
37
  "eslint-plugin-prettier": "^5.5.6",
38
- "prettier": "^3.8.3",
38
+ "prettier": "^3.8.4",
39
39
  "tsup": "^8.5.1"
40
40
  },
41
41
  "repository": {