@nomalism-com/api 0.36.4 → 0.36.10

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
@@ -96,6 +96,7 @@ __export(main_exports, {
96
96
  StockMovement: () => stockMovement_exports,
97
97
  StoreOperator: () => storeOperator_exports,
98
98
  Swift: () => swift_exports,
99
+ TagClass: () => tag_exports,
99
100
  Task: () => task_exports,
100
101
  TaskMessage: () => taskMessage_exports,
101
102
  TaskReadClass: () => taskRead_exports,
@@ -4104,6 +4105,33 @@ var Repository114 = class {
4104
4105
  }
4105
4106
  };
4106
4107
 
4108
+ // src/modules/stock/tag.ts
4109
+ var tag_exports = {};
4110
+ __export(tag_exports, {
4111
+ default: () => Repository115
4112
+ });
4113
+ var Repository115 = class {
4114
+ constructor({ api, route, publicRoute }) {
4115
+ this.api = api;
4116
+ this.route = route;
4117
+ this.publicRoute = publicRoute;
4118
+ }
4119
+ async create(body) {
4120
+ const response = await this.api.post(`${this.route}`, body);
4121
+ return response.data;
4122
+ }
4123
+ async findByDocumentHeaderId(selector) {
4124
+ const response = await this.api.get(`${this.route}document_header_id/${selector.id}`);
4125
+ return response.data;
4126
+ }
4127
+ async updateMany(body) {
4128
+ await this.api.put(`${this.route}update_many`, body);
4129
+ }
4130
+ async delete(selector) {
4131
+ await this.api.delete(`${this.route}${selector.id}`);
4132
+ }
4133
+ };
4134
+
4107
4135
  // src/main.ts
4108
4136
  var API = class {
4109
4137
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
@@ -4298,6 +4326,7 @@ var API = class {
4298
4326
  this.DocumentLineRm = new Repository112(getModuleParams("stock", "document_line_rm"));
4299
4327
  this.DocumentLineMt = new Repository113(getModuleParams("stock", "document_line_mt"));
4300
4328
  this.ChatSubscriber = new Repository114(getModuleParams("users", "chat_subscriber"));
4329
+ this.Tag = new Repository115(getModuleParams("stock", "tag"));
4301
4330
  }
4302
4331
  };
4303
4332
 
package/package-lock.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@nomalism-com/api",
3
- "version": "0.36.3",
3
+ "version": "0.35.12",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@nomalism-com/api",
9
- "version": "0.36.3",
9
+ "version": "0.35.12",
10
10
  "license": "UNLICENSED",
11
11
  "dependencies": {
12
- "@nomalism-com/types": "^0.36.1",
12
+ "@nomalism-com/types": "^0.36.10",
13
13
  "axios": "^1.9.0"
14
14
  },
15
15
  "devDependencies": {
@@ -887,9 +887,9 @@
887
887
  }
888
888
  },
889
889
  "node_modules/@nomalism-com/types": {
890
- "version": "0.36.4",
891
- "resolved": "https://registry.npmjs.org/@nomalism-com/types/-/types-0.36.4.tgz",
892
- "integrity": "sha512-n3EuHu8ky0QFM5QTAHyHZIlEJWKSDb7WbR+I8ur1AdQJYUcT9IlysWfUxDGyfKmyOr64b4IJ2BmQrVlY9I6ZWw==",
890
+ "version": "0.36.10",
891
+ "resolved": "https://registry.npmjs.org/@nomalism-com/types/-/types-0.36.10.tgz",
892
+ "integrity": "sha512-ySMWmKA3OAp49JcRrNQDRRq/DXeSoNyL+VXLVBhsStB+iXkH/MwxJu96OhacQEQ92zsWmGUQ3lL7hWHT0sOXeQ==",
893
893
  "license": "UNLICENSED",
894
894
  "dependencies": {
895
895
  "joi": "^17.13.3"
@@ -2576,9 +2576,9 @@
2576
2576
  }
2577
2577
  },
2578
2578
  "node_modules/eslint-plugin-prettier": {
2579
- "version": "5.4.1",
2580
- "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.4.1.tgz",
2581
- "integrity": "sha512-9dF+KuU/Ilkq27A8idRP7N2DH8iUR6qXcjF3FR2wETY21PZdBrIjwCau8oboyGj9b7etWmTGEeM8e7oOed6ZWg==",
2579
+ "version": "5.5.0",
2580
+ "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.0.tgz",
2581
+ "integrity": "sha512-8qsOYwkkGrahrgoUv76NZi23koqXOGiiEzXMrT8Q7VcYaUISR+5MorIUxfWqYXN0fN/31WbSrxCxFkVQ43wwrA==",
2582
2582
  "dev": true,
2583
2583
  "license": "MIT",
2584
2584
  "dependencies": {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.36.4",
12
+ "version": "0.36.10",
13
13
  "type": "module",
14
14
  "main": "./dist/index.cjs",
15
15
  "module": "./dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "prepack": "npm run lint && npm run build"
40
40
  },
41
41
  "dependencies": {
42
- "@nomalism-com/types": "^0.36.1",
42
+ "@nomalism-com/types": "^0.36.10",
43
43
  "axios": "^1.9.0"
44
44
  },
45
45
  "devDependencies": {
package/src/main.ts CHANGED
@@ -114,6 +114,7 @@ import AdminPanelClass from './modules/view/adminPanel';
114
114
  import DocumentLineRmClass from './modules/supply/documentLineRm';
115
115
  import DocumentLineMtClass from './modules/supply/documentLineMt';
116
116
  import ChatSubscriberClass from './modules/user/chatSubscriber';
117
+ import TagClass from './modules/stock/tag';
117
118
 
118
119
  export * as BankData from './modules/user/bankData';
119
120
  export * as Client from './modules/user/clients';
@@ -221,6 +222,7 @@ export * as AdminPanelClass from './modules/view/adminPanel';
221
222
  export * as DocumentLineRmClass from './modules/supply/documentLineRm';
222
223
  export * as DocumentLineMtClass from './modules/supply/documentLineMt';
223
224
  export * as ChatSubscriberClass from './modules/user/chatSubscriber';
225
+ export * as TagClass from './modules/stock/tag';
224
226
 
225
227
  export type IEnvironment = 'production' | 'uat' | 'development' | 'localhost';
226
228
 
@@ -475,6 +477,8 @@ export class API {
475
477
 
476
478
  public ChatSubscriber: ChatSubscriberClass;
477
479
 
480
+ public Tag: TagClass;
481
+
478
482
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }: IOptions) {
479
483
  this.processEnvironment = processEnvironment || 'localhost';
480
484
 
@@ -787,5 +791,7 @@ export class API {
787
791
  this.DocumentLineMt = new DocumentLineMtClass(getModuleParams('stock', 'document_line_mt'));
788
792
 
789
793
  this.ChatSubscriber = new ChatSubscriberClass(getModuleParams('users', 'chat_subscriber'));
794
+
795
+ this.Tag = new TagClass(getModuleParams('stock', 'tag'));
790
796
  }
791
797
  }
@@ -0,0 +1,37 @@
1
+ import Nomalism from '@nomalism-com/types';
2
+ import { AxiosInstance } from 'axios';
3
+ import { IModuleConstructor } from '../../main';
4
+
5
+ export default class Repository implements Nomalism.Tag.IRepository {
6
+ public route: string;
7
+
8
+ public publicRoute: string;
9
+
10
+ private api: AxiosInstance;
11
+
12
+ constructor({ api, route, publicRoute }: IModuleConstructor) {
13
+ this.api = api;
14
+ this.route = route;
15
+ this.publicRoute = publicRoute;
16
+ }
17
+
18
+ async create(body: Nomalism.Tag.ICreateRequest): Promise<void> {
19
+ const response = await this.api.post(`${this.route}`, body);
20
+ return response.data;
21
+ }
22
+
23
+ async findByDocumentHeaderId(
24
+ selector: Nomalism.shared.IFindByIdRequest,
25
+ ): Promise<Nomalism.Tag.IFindResponse[]> {
26
+ const response = await this.api.get(`${this.route}document_header_id/${selector.id}`);
27
+ return response.data;
28
+ }
29
+
30
+ async updateMany(body: Nomalism.Tag.IUpdateManyRequest[]): Promise<void> {
31
+ await this.api.put(`${this.route}update_many`, body);
32
+ }
33
+
34
+ async delete(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
35
+ await this.api.delete(`${this.route}${selector.id}`);
36
+ }
37
+ }