@nomalism-com/api 0.45.65 → 0.45.67

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
@@ -4480,22 +4480,48 @@ var TimesheetRepository = class {
4480
4480
  this.api = api;
4481
4481
  this.route = route.endsWith("/") ? route : `${route}/`;
4482
4482
  }
4483
+ /**
4484
+ * GET todos os registos com filtros opcionais
4485
+ */
4483
4486
  async find(params) {
4484
4487
  const response = await this.api.get(`${this.route}`, { params });
4485
4488
  return response.data;
4486
4489
  }
4487
- async findById(selector) {
4488
- const response = await this.api.get(`${this.route}${selector.id}`);
4490
+ /**
4491
+ * GET registos de um utilizador numa data específica
4492
+ */
4493
+ async findByUserAndDate(filters) {
4494
+ const response = await this.api.get(`${this.route}by-date`, {
4495
+ params: filters
4496
+ });
4497
+ return response.data;
4498
+ }
4499
+ /**
4500
+ * GET resumo diário
4501
+ */
4502
+ async getDailySummary(filters) {
4503
+ const response = await this.api.get(`${this.route}daily-summary`, {
4504
+ params: filters
4505
+ });
4489
4506
  return response.data;
4490
4507
  }
4508
+ /**
4509
+ * POST novo registo
4510
+ */
4491
4511
  async create(body) {
4492
4512
  const response = await this.api.post(`${this.route}`, body);
4493
4513
  return response.data;
4494
4514
  }
4515
+ /**
4516
+ * PUT atualizar registo
4517
+ */
4495
4518
  async update(selector, body) {
4496
4519
  const response = await this.api.put(`${this.route}${selector.id}`, body);
4497
4520
  return response.data;
4498
4521
  }
4522
+ /**
4523
+ * DELETE registo
4524
+ */
4499
4525
  async deleteOne(selector) {
4500
4526
  const response = await this.api.delete(`${this.route}${selector.id}`);
4501
4527
  return response.data;
@@ -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>;
27
+ /**
28
+ * DELETE registo
29
+ */
11
30
  deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.TimeSheet.Entity | null>;
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.45.65",
4
+ "version": "0.45.67",
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.45.68",
26
+ "@nomalism-com/types": "^0.45.70",
27
27
  "axios": "^1.17.0"
28
28
  },
29
29
  "devDependencies": {