@nomalism-com/api 0.45.53 → 0.45.55

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
@@ -114,6 +114,7 @@ __export(main_exports, {
114
114
  Theme: () => theme_exports,
115
115
  Tickets: () => tickets_exports,
116
116
  TicketsLanguage: () => language_exports2,
117
+ TimeSheet: () => timeSheet_exports,
117
118
  Transformado: () => transformado_exports,
118
119
  TypeOfLocation: () => typeOfLocation_exports,
119
120
  UnitOfMeasure: () => unitOfMeasure_exports,
@@ -4392,6 +4393,38 @@ var Repository126 = class {
4392
4393
  }
4393
4394
  };
4394
4395
 
4396
+ // src/modules/user/timeSheet.ts
4397
+ var timeSheet_exports = {};
4398
+ __export(timeSheet_exports, {
4399
+ default: () => TimesheetRepository
4400
+ });
4401
+ var TimesheetRepository = class {
4402
+ constructor({ api, route }) {
4403
+ this.api = api;
4404
+ this.route = route.endsWith("/") ? route : `${route}/`;
4405
+ }
4406
+ async find(params) {
4407
+ const response = await this.api.get(`${this.route}`, { params });
4408
+ return response.data;
4409
+ }
4410
+ async findById(selector) {
4411
+ const response = await this.api.get(`${this.route}${selector.id}`);
4412
+ return response.data;
4413
+ }
4414
+ async create(body) {
4415
+ const response = await this.api.post(`${this.route}`, body);
4416
+ return response.data;
4417
+ }
4418
+ async update(selector, body) {
4419
+ const response = await this.api.put(`${this.route}${selector.id}`, body);
4420
+ return response.data;
4421
+ }
4422
+ async deleteOne(selector) {
4423
+ const response = await this.api.delete(`${this.route}${selector.id}`);
4424
+ return response.data;
4425
+ }
4426
+ };
4427
+
4395
4428
  // src/main.ts
4396
4429
  var API = class {
4397
4430
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }) {
@@ -4691,6 +4724,7 @@ var API = class {
4691
4724
  this.ProductLocation = new Repository126(
4692
4725
  getModuleParams("stock", Nomalism.ProductLocation.Route)
4693
4726
  );
4727
+ this.TimeSheet = new TimesheetRepository(getModuleParams("users", Nomalism.TimeSheet.Route));
4694
4728
  }
4695
4729
  };
4696
4730
 
package/dist/main.d.ts CHANGED
@@ -126,6 +126,7 @@ import DocumentHeaderSurveyClass from './modules/supply/documentHeaderSurvey';
126
126
  import DocumentHeaderSubscriberClass from './modules/supply/documentHeaderSubscriber';
127
127
  import GoogleCalendarClass from './modules/stock/googleCalendar';
128
128
  import ProductLocationClass from './modules/stock/productLocation';
129
+ import TimeSheetClass from './modules/user/timeSheet';
129
130
  export * as BankData from './modules/user/bankData';
130
131
  export * as Client from './modules/user/clients';
131
132
  export * as ClientType from './modules/user/clientType';
@@ -244,6 +245,7 @@ export * as DocumentHeaderSurvey from './modules/supply/documentHeaderSurvey';
244
245
  export * as DocumentHeaderSubscriber from './modules/supply/documentHeaderSubscriber';
245
246
  export * as GoogleCalendar from './modules/stock/googleCalendar';
246
247
  export * as ProductLocation from './modules/stock/productLocation';
248
+ export * as TimeSheet from './modules/user/timeSheet';
247
249
  export type IEnvironment = 'production' | 'uat' | 'development' | 'localhost';
248
250
  type IService = 'stock' | 'users' | 'integration' | 'documents' | 'view' | 'print' | 'tickets' | 'llm';
249
251
  export interface IOptions {
@@ -388,6 +390,7 @@ export declare class API {
388
390
  DocumentHeaderSubscriber: DocumentHeaderSubscriberClass;
389
391
  GoogleCalendar: GoogleCalendarClass;
390
392
  ProductLocation: ProductLocationClass;
393
+ TimeSheet: TimeSheetClass;
391
394
  private defaultHeaders;
392
395
  constructor({ processEnvironment, services, gatewayUrl, apikey, tokenBearer }: IOptions);
393
396
  }
@@ -0,0 +1,12 @@
1
+ import Nomalism from '@nomalism-com/types';
2
+ import { IModuleConstructor } from '../../main';
3
+ export default class TimesheetRepository implements Nomalism.TimeSheet.IApi {
4
+ route: string;
5
+ private api;
6
+ constructor({ api, route }: IModuleConstructor);
7
+ find(params?: Nomalism.TimeSheet.IFindRequest): Promise<Nomalism.TimeSheet.Entity[]>;
8
+ findById(selector: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.TimeSheet.Entity | null>;
9
+ create(body: Nomalism.TimeSheet.ICreateRequest): Promise<Nomalism.TimeSheet.Entity>;
10
+ 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>;
12
+ }
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.53",
4
+ "version": "0.45.55",
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.55",
26
+ "@nomalism-com/types": "^0.45.59",
27
27
  "axios": "^1.17.0"
28
28
  },
29
29
  "devDependencies": {