itrm-tools 1.1.2 → 1.1.4

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.
@@ -1,15 +1,15 @@
1
- import { IAlegraContact, IAlegraJournal, IAlegraPayment } from "./AlegraTypes";
1
+ import { IAlegraContact, IAlegraJournal, IAlegraPayment, IAlegraResult } from "./AlegraTypes";
2
2
  export declare class AlegraConnectionManager {
3
3
  private alegraUrl;
4
4
  private headers;
5
5
  constructor(alegraUrl: string, token: string);
6
- createContact(contact: IAlegraContact): Promise<unknown>;
6
+ createContact(contact: IAlegraContact): Promise<IAlegraContact>;
7
7
  findContact(document: string): Promise<IAlegraContact | undefined>;
8
- createJournal(body: IAlegraJournal): Promise<unknown>;
8
+ createJournal(body: IAlegraJournal): Promise<IAlegraJournal>;
9
9
  findJournal(journalId: string | number): Promise<IAlegraJournal>;
10
- deleteJournal(journalId: string | number): Promise<unknown>;
11
- createPayment(body: IAlegraPayment): Promise<unknown>;
10
+ deleteJournal(journalId: string | number): Promise<IAlegraResult>;
11
+ createPayment(body: IAlegraPayment): Promise<IAlegraPayment>;
12
12
  findPayment(paymentId: string | number): Promise<IAlegraPayment>;
13
13
  updatePayment(paymentId: string | number, body: IAlegraPayment): Promise<unknown>;
14
- deletePayment(paymentId: string | number): Promise<unknown>;
14
+ deletePayment(paymentId: string | number): Promise<IAlegraResult>;
15
15
  }
@@ -18,7 +18,7 @@ class AlegraConnectionManager {
18
18
  }
19
19
  createContact(contact) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
- return yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/contacts`, contact, this.headers);
21
+ return (yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/contacts`, contact, this.headers));
22
22
  });
23
23
  }
24
24
  findContact(document) {
@@ -29,7 +29,7 @@ class AlegraConnectionManager {
29
29
  }
30
30
  createJournal(body) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
- return yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/journals`, body, this.headers);
32
+ return (yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/journals`, body, this.headers));
33
33
  });
34
34
  }
35
35
  findJournal(journalId) {
@@ -39,12 +39,12 @@ class AlegraConnectionManager {
39
39
  }
40
40
  deleteJournal(journalId) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
- return yield RequestAxiosCall_1.RequestAxiosCall.delete(`${this.alegraUrl}/v1/journals/${journalId}`, this.headers);
42
+ return (yield RequestAxiosCall_1.RequestAxiosCall.delete(`${this.alegraUrl}/v1/journals/${journalId}`, this.headers));
43
43
  });
44
44
  }
45
45
  createPayment(body) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
- return yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/payments`, body, this.headers);
47
+ return (yield RequestAxiosCall_1.RequestAxiosCall.post(`${this.alegraUrl}/v1/payments`, body, this.headers));
48
48
  });
49
49
  }
50
50
  findPayment(paymentId) {
@@ -59,7 +59,7 @@ class AlegraConnectionManager {
59
59
  }
60
60
  deletePayment(paymentId) {
61
61
  return __awaiter(this, void 0, void 0, function* () {
62
- return yield RequestAxiosCall_1.RequestAxiosCall.delete(`${this.alegraUrl}/v1/payments/${paymentId}`, this.headers);
62
+ return (yield RequestAxiosCall_1.RequestAxiosCall.delete(`${this.alegraUrl}/v1/payments/${paymentId}`, this.headers));
63
63
  });
64
64
  }
65
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AlegraConnectionManager.js","sourceRoot":"","sources":["../../../src/api/alegra/AlegraConnectionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kEAA+D;AAG/D,MAAa,uBAAuB;IAIhC,YAAY,SAAiB,EAAE,KAAa;QACxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,EAAE,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C,SAA0B;;YACjD,OAAO,CAAC,MAAM,mCAAgB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,gBAAgB,SAAS,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAkB,CAAC;QACxH,CAAC;KAAA;CACJ;AA7CD,0DA6CC"}
@@ -141,3 +141,7 @@ export interface IAlegraEntry {
141
141
  resource: any;
142
142
  };
143
143
  }
144
+ export interface IAlegraResult {
145
+ code: number;
146
+ message: string;
147
+ }
@@ -22,6 +22,7 @@
22
22
  /// <reference types="mongoose/types/validation" />
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
25
26
  import { DefaultSchemaOptions, FilterQuery, Model, MongooseBulkWriteOptions, ObtainDocumentType, ResolveSchemaOptions, SchemaDefinition, SchemaDefinitionType, SchemaOptions, UpdateQuery, UpdateWithAggregationPipeline } from "mongoose";
26
27
  export declare class MongooseModelManager<S> {
27
28
  collection: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AlegraConnectionManager as AlegraConnectionManager } from './api/alegra/AlegraConnectionManager';
2
- export { IAlegraContact as IAlegraContact, IAlegraPayment as IAlegraPayment, IAlegraCategory as IAlegraCategory, IAlegraJournal as IAlegraJournal, IAlegraEntry as IAlegraEntry } from './api/alegra/AlegraTypes';
2
+ export { IAlegraContact as IAlegraContact, IAlegraPayment as IAlegraPayment, IAlegraCategory as IAlegraCategory, IAlegraJournal as IAlegraJournal, IAlegraEntry as IAlegraEntry, IAlegraResult as IAlegraResult } from './api/alegra/AlegraTypes';
3
3
  export { APIServiceConfig as APIServiceConfig, APIService as APIService, APIServiceResponse as APIServiceResponse, ITRMAPIServiceGlobal as ITRMAPIServiceGlobal } from './api/APIService';
4
4
  export { HttpsAPIService as HttpsAPIService } from './api/HttpsAPIService';
5
5
  export { ExpressConfiguration as ExpressConfiguration } from './api/ExpressConfiguration';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itrm-tools",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "sqlite3": "^5.1.6",
47
47
  "ts-jest": "^29.1.2",
48
48
  "typescript": "^5.4.4",
49
- "uuid": "^9.0.1"
49
+ "uuid": "^10.0.0"
50
50
  },
51
51
  "dependencies": {
52
52
  "@sequelize/core": "^7.0.0-alpha.10",