@nomalism-com/api 0.46.9 → 0.46.11

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
@@ -4507,25 +4507,50 @@ var TimesheetRepository = class {
4507
4507
  this.api = api;
4508
4508
  this.route = route.endsWith("/") ? route : `${route}/`;
4509
4509
  }
4510
+ /**
4511
+ * GET todos os registos com filtros opcionais
4512
+ */
4510
4513
  async find(params) {
4511
4514
  const response = await this.api.get(`${this.route}`, { params });
4512
4515
  return response.data;
4513
4516
  }
4514
- async findById(selector) {
4515
- const response = await this.api.get(`${this.route}${selector.id}`);
4517
+ /**
4518
+ * GET registos de um utilizador numa data específica
4519
+ */
4520
+ async findByUserAndDate(filters) {
4521
+ const response = await this.api.get(`${this.route}by-date`, {
4522
+ params: filters
4523
+ });
4516
4524
  return response.data;
4517
4525
  }
4526
+ /**
4527
+ * GET resumo diário
4528
+ */
4529
+ async getDailySummary(filters) {
4530
+ const response = await this.api.get(`${this.route}daily-summary`, {
4531
+ params: filters
4532
+ });
4533
+ return response.data;
4534
+ }
4535
+ /**
4536
+ * POST novo registo
4537
+ */
4518
4538
  async create(body) {
4519
4539
  const response = await this.api.post(`${this.route}`, body);
4520
4540
  return response.data;
4521
4541
  }
4542
+ /**
4543
+ * PUT atualizar registo
4544
+ */
4522
4545
  async update(selector, body) {
4523
4546
  const response = await this.api.put(`${this.route}${selector.id}`, body);
4524
4547
  return response.data;
4525
4548
  }
4549
+ /**
4550
+ * DELETE registo
4551
+ */
4526
4552
  async deleteOne(selector) {
4527
- const response = await this.api.delete(`${this.route}${selector.id}`);
4528
- return response.data;
4553
+ await this.api.delete(`${this.route}${selector.id}`);
4529
4554
  }
4530
4555
  };
4531
4556
 
@@ -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.9",
4
+ "version": "0.46.11",
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.7",
26
+ "@nomalism-com/types": "^0.46.10",
27
27
  "axios": "^1.18.0"
28
28
  },
29
29
  "devDependencies": {