@nomalism-com/api 0.46.10 → 0.46.12

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
@@ -103,6 +103,7 @@ __export(main_exports, {
103
103
  Shippings: () => shippings_exports,
104
104
  SideMenu: () => sideMenu_exports,
105
105
  SidemenuHighlight: () => sidemenuHighlight_exports,
106
+ SmsSender: () => smsSender_exports,
106
107
  StartDocumentHeaderLastUpdate: () => startDocumentHeaderLastUpdate_exports,
107
108
  StockMovement: () => stockMovement_exports,
108
109
  StoreOperator: () => storeOperator_exports,
@@ -4055,6 +4056,18 @@ var Repository111 = class {
4055
4056
  const response = await this.api.get(`${this.route}${id}`);
4056
4057
  return response.data;
4057
4058
  }
4059
+ async findByEmailToken({
4060
+ token
4061
+ }) {
4062
+ const response = await this.api.get(`${this.route}by_email_token/${token}`);
4063
+ return response.data;
4064
+ }
4065
+ async publicAuthenticateByEmailToken({
4066
+ token
4067
+ }) {
4068
+ const response = await this.api.get(`${this.route}authenticate_email_token/${token}`);
4069
+ return response.data;
4070
+ }
4058
4071
  async createOrUpdate(data) {
4059
4072
  const response = await this.api.post(`${this.route}`, data);
4060
4073
  return response.data;
@@ -4209,7 +4222,7 @@ var Repository116 = class {
4209
4222
  if (start_date) qs.set("start_date", start_date.toISOString());
4210
4223
  if (end_date) qs.set("end_date", end_date.toISOString());
4211
4224
  qs.set("token", token);
4212
- return `${this.route}export_current_account?${qs.toString()}`;
4225
+ return `${this.route}export?${qs.toString()}`;
4213
4226
  }
4214
4227
  };
4215
4228
 
@@ -4507,25 +4520,50 @@ var TimesheetRepository = class {
4507
4520
  this.api = api;
4508
4521
  this.route = route.endsWith("/") ? route : `${route}/`;
4509
4522
  }
4523
+ /**
4524
+ * GET todos os registos com filtros opcionais
4525
+ */
4510
4526
  async find(params) {
4511
4527
  const response = await this.api.get(`${this.route}`, { params });
4512
4528
  return response.data;
4513
4529
  }
4514
- async findById(selector) {
4515
- const response = await this.api.get(`${this.route}${selector.id}`);
4530
+ /**
4531
+ * GET registos de um utilizador numa data específica
4532
+ */
4533
+ async findByUserAndDate(filters) {
4534
+ const response = await this.api.get(`${this.route}by-date`, {
4535
+ params: filters
4536
+ });
4516
4537
  return response.data;
4517
4538
  }
4539
+ /**
4540
+ * GET resumo diário
4541
+ */
4542
+ async getDailySummary(filters) {
4543
+ const response = await this.api.get(`${this.route}daily-summary`, {
4544
+ params: filters
4545
+ });
4546
+ return response.data;
4547
+ }
4548
+ /**
4549
+ * POST novo registo
4550
+ */
4518
4551
  async create(body) {
4519
4552
  const response = await this.api.post(`${this.route}`, body);
4520
4553
  return response.data;
4521
4554
  }
4555
+ /**
4556
+ * PUT atualizar registo
4557
+ */
4522
4558
  async update(selector, body) {
4523
4559
  const response = await this.api.put(`${this.route}${selector.id}`, body);
4524
4560
  return response.data;
4525
4561
  }
4562
+ /**
4563
+ * DELETE registo
4564
+ */
4526
4565
  async deleteOne(selector) {
4527
- const response = await this.api.delete(`${this.route}${selector.id}`);
4528
- return response.data;
4566
+ await this.api.delete(`${this.route}${selector.id}`);
4529
4567
  }
4530
4568
  };
4531
4569
 
@@ -4545,6 +4583,33 @@ var Repository128 = class {
4545
4583
  }
4546
4584
  };
4547
4585
 
4586
+ // src/modules/stock/smsSender.ts
4587
+ var smsSender_exports = {};
4588
+ __export(smsSender_exports, {
4589
+ default: () => Repository129
4590
+ });
4591
+ var Repository129 = class {
4592
+ constructor({ api, route }) {
4593
+ this.api = api;
4594
+ this.route = route;
4595
+ }
4596
+ async claim() {
4597
+ const response = await this.api.get(`${this.route}claim`);
4598
+ return response.data;
4599
+ }
4600
+ async result(id, body) {
4601
+ await this.api.post(`${this.route}result/${id}`, body);
4602
+ }
4603
+ async findById(id) {
4604
+ const response = await this.api.get(`${this.route}${id}`);
4605
+ return response.data;
4606
+ }
4607
+ async findAll() {
4608
+ const response = await this.api.get(`${this.route}`);
4609
+ return response.data;
4610
+ }
4611
+ };
4612
+
4548
4613
  // src/main.ts
4549
4614
  var API = class {
4550
4615
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
@@ -4852,6 +4917,7 @@ var API = class {
4852
4917
  );
4853
4918
  this.TimeSheet = new TimesheetRepository(getModuleParams("users", Nomalism.TimeSheet.Route));
4854
4919
  this.Catalogo = new Repository128(getModuleParams("stock", Nomalism.Catalogo.Route));
4920
+ this.SmsSender = new Repository129(getModuleParams("stock", Nomalism.SmsSender.Route));
4855
4921
  }
4856
4922
  };
4857
4923
 
package/dist/main.d.ts CHANGED
@@ -129,6 +129,7 @@ import SaftClass from './modules/supply/saft';
129
129
  import ProductLocationClass from './modules/stock/productLocation';
130
130
  import TimeSheetClass from './modules/user/timeSheet';
131
131
  import CatalogoClass from './modules/document/CAT';
132
+ import SmsSenderClass from './modules/stock/smsSender';
132
133
  export * as BankData from './modules/user/bankData';
133
134
  export * as Client from './modules/user/clients';
134
135
  export * as ClientType from './modules/user/clientType';
@@ -250,6 +251,7 @@ export * as Saft from './modules/supply/saft';
250
251
  export * as ProductLocation from './modules/stock/productLocation';
251
252
  export * as TimeSheet from './modules/user/timeSheet';
252
253
  export * as Catalogo from './modules/document/CAT';
254
+ export * as SmsSender from './modules/stock/smsSender';
253
255
  export type IEnvironment = 'production' | 'uat' | 'development' | 'localhost';
254
256
  type IService = 'stock' | 'users' | 'integration' | 'documents' | 'view' | 'print' | 'tickets' | 'llm';
255
257
  export interface IOptions {
@@ -397,6 +399,7 @@ export declare class API {
397
399
  ProductLocation: ProductLocationClass;
398
400
  TimeSheet: TimeSheetClass;
399
401
  Catalogo: CatalogoClass;
402
+ SmsSender: SmsSenderClass;
400
403
  private defaultHeaders;
401
404
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }: IOptions);
402
405
  }
@@ -0,0 +1,11 @@
1
+ import Nomalism from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../../main';
3
+ export default class Repository implements Nomalism.SmsSender.IController {
4
+ route: string;
5
+ private api;
6
+ constructor({ api, route }: IModuleConstructor);
7
+ claim(): Promise<Nomalism.SmsSender.IClaimResponse>;
8
+ result(id: string, body: Nomalism.SmsSender.IResultRequest): Promise<void>;
9
+ findById(id: string): Promise<Nomalism.SmsSender.IFindResponse>;
10
+ findAll(): Promise<Nomalism.SmsSender.IFindResponse[]>;
11
+ }
@@ -4,7 +4,7 @@ export default class Repository implements Nomalism.Portal.IRepository {
4
4
  route: string;
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
- publicFindBySubscriberId(params?: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.Portal.IPublicFindBySubscriberId>;
7
+ publicFindBySubscriberId(params?: Nomalism.Portal.IPublicFindBySubscriberIdRequest): Promise<Nomalism.Portal.IPublicFindBySubscriberId>;
8
8
  publicCreateDocumentHeaderNote(data: Nomalism.Portal.PublicDocumentHeaderNoteCreateRequest[]): Promise<Nomalism.Portal.PublicDocumentHeaderNote[]>;
9
9
  publicUpdateDocumentHeaderNote({ id }: Nomalism.shared.IFindByIdRequest, data: Nomalism.Portal.PublicDocumentHeaderNoteUpdateRequest[]): Promise<Nomalism.Portal.PublicDocumentHeaderNote[]>;
10
10
  }
@@ -8,6 +8,8 @@ export default class Repository implements Nomalism.ChatSubscriber.IRepository {
8
8
  findDocumentHeaderSubscribersByLanguage(params: Nomalism.ChatSubscriber.IFindDocumentHeaderSubscribersByLanguageRequest): Promise<string[]>;
9
9
  findSubscribedDocumentHeaders(params: Nomalism.ChatSubscriber.IFindSubscribedDocumentHeadersRequest): Promise<Nomalism.ChatSubscriber.IEntityWithPersonaAndSubscriptions>;
10
10
  findById({ id, }: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.ChatSubscriber.IEntityWithPersonaAndSubscriptions>;
11
+ findByEmailToken({ token, }: Nomalism.ChatSubscriber.IFindByEmailTokenRequest): Promise<Nomalism.ChatSubscriber.IEntityWithPersonaAndSubscriptions>;
12
+ publicAuthenticateByEmailToken({ token, }: Nomalism.ChatSubscriber.IPublicAuthenticateByEmailTokenRequest): Promise<string | null>;
11
13
  createOrUpdate(data: Nomalism.ChatSubscriber.ICreateOrUpdateRequest): Promise<string>;
12
14
  deleteOne({ id }: Nomalism.shared.IFindByIdRequest): Promise<void>;
13
15
  deleteByDocumentHeader({ id }: Nomalism.shared.IFindByIdRequest): Promise<void>;
@@ -4,9 +4,28 @@ export default class TimesheetRepository implements Nomalism.TimeSheet.IApi {
4
4
  route: string;
5
5
  private api;
6
6
  constructor({ api, route }: IModuleConstructor);
7
+ /**
8
+ * GET todos os registos com filtros opcionais
9
+ */
7
10
  find(params?: Nomalism.TimeSheet.IFindRequest): Promise<Nomalism.TimeSheet.Entity[]>;
8
- findById(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.TimeSheet.Entity | null>;
11
+ /**
12
+ * GET registos de um utilizador numa data específica
13
+ */
14
+ findByUserAndDate(filters: Nomalism.TimeSheet.IFindByDateRequest): Promise<Nomalism.TimeSheet.Entity[]>;
15
+ /**
16
+ * GET resumo diário
17
+ */
18
+ getDailySummary(filters: Nomalism.TimeSheet.IDailySummaryRequest): Promise<Nomalism.TimeSheet.IDailySummaryResponse[]>;
19
+ /**
20
+ * POST novo registo
21
+ */
9
22
  create(body: Nomalism.TimeSheet.ICreateRequest): Promise<Nomalism.TimeSheet.Entity>;
23
+ /**
24
+ * PUT atualizar registo
25
+ */
10
26
  update(selector: Nomalism.shared.IFindByIdRequest, body: Nomalism.TimeSheet.IUpdateRequest): Promise<Nomalism.TimeSheet.Entity | null>;
11
- deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.TimeSheet.Entity | null>;
27
+ /**
28
+ * DELETE registo
29
+ */
30
+ deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void>;
12
31
  }
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.46.10",
4
+ "version": "0.46.12",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "prepack": "npm run lint && npm run build"
24
24
  },
25
25
  "dependencies": {
26
- "@nomalism-com/types": "^0.46.9",
26
+ "@nomalism-com/types": "^0.46.12",
27
27
  "axios": "^1.18.0"
28
28
  },
29
29
  "devDependencies": {