@nomalism-com/api 0.34.30 → 0.35.0

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,37 @@ 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 findById(selector) {
4128
+ const response = await this.api.get(`${this.route}${selector.id}`);
4129
+ return response.data;
4130
+ }
4131
+ async update(selector, body) {
4132
+ await this.api.put(`${this.route}${selector.id}`, body);
4133
+ }
4134
+ async delete(selector) {
4135
+ await this.api.delete(`${this.route}${selector.id}`);
4136
+ }
4137
+ };
4138
+
4107
4139
  // src/main.ts
4108
4140
  var API = class {
4109
4141
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
@@ -4298,6 +4330,7 @@ var API = class {
4298
4330
  this.DocumentLineRm = new Repository112(getModuleParams("stock", "document_line_rm"));
4299
4331
  this.DocumentLineMt = new Repository113(getModuleParams("stock", "document_line_mt"));
4300
4332
  this.ChatSubscriber = new Repository114(getModuleParams("users", "chat_subscriber"));
4333
+ this.Tag = new Repository115(getModuleParams("stock", "tag"));
4301
4334
  }
4302
4335
  };
4303
4336
 
package/package-lock.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@nomalism-com/api",
3
- "version": "0.34.29",
3
+ "version": "0.34.30",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@nomalism-com/api",
9
- "version": "0.34.29",
9
+ "version": "0.34.30",
10
10
  "license": "UNLICENSED",
11
11
  "dependencies": {
12
- "@nomalism-com/types": "^0.34.33",
12
+ "@nomalism-com/types": "^0.35.0",
13
13
  "axios": "^1.9.0"
14
14
  },
15
15
  "devDependencies": {
@@ -874,9 +874,9 @@
874
874
  }
875
875
  },
876
876
  "node_modules/@nomalism-com/types": {
877
- "version": "0.34.37",
878
- "resolved": "https://registry.npmjs.org/@nomalism-com/types/-/types-0.34.37.tgz",
879
- "integrity": "sha512-nAiz6dWjptwOEKBbTcKl4QvYj786QhjXQFSzxMbZygiwURuApqmu3KEnuMMtpspgZsjceJKuj0AMtBugQKTfLw==",
877
+ "version": "0.35.0",
878
+ "resolved": "https://registry.npmjs.org/@nomalism-com/types/-/types-0.35.0.tgz",
879
+ "integrity": "sha512-VU+8s1txWPa/Qf1RPmH3R3Hf1n6IKLtR466MVsY6unzaO/XRkBqNAeZ3N5XawwOS+cJKreIZl9DqiY8ZwfSa0A==",
880
880
  "license": "UNLICENSED",
881
881
  "dependencies": {
882
882
  "joi": "^17.13.3"
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.34.30",
12
+ "version": "0.35.0",
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.34.33",
42
+ "@nomalism-com/types": "^0.35.0",
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,45 @@
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 findById(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.Tag.IFindResponse> {
31
+ const response = await this.api.get(`${this.route}${selector.id}`);
32
+ return response.data;
33
+ }
34
+
35
+ async update(
36
+ selector: Nomalism.shared.IFindByIdRequest,
37
+ body: Nomalism.Tag.IUpdateRequest,
38
+ ): Promise<void> {
39
+ await this.api.put(`${this.route}${selector.id}`, body);
40
+ }
41
+
42
+ async delete(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
43
+ await this.api.delete(`${this.route}${selector.id}`);
44
+ }
45
+ }