@bisondesk/core-sdk 1.0.74 → 1.0.76

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.
@@ -17,7 +17,7 @@ export declare enum BusinessEntityIds {
17
17
  Contacts = "contacts",
18
18
  Vehicles = "vehicles",
19
19
  Users = "users",
20
- Contracts = "contracts"
20
+ LeasingContracts = "leasing_contracts"
21
21
  }
22
22
  export declare enum Categories {
23
23
  TractorHead = "Tractor Head",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAKjD,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAChD,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,sBAAsB,aAAa,CAAC;AACjD,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAC1D,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAChD,eAAO,MAAM,yBAAyB,YAAY,CAAC;AACnD,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAKlD,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,SAAS,cAAc;CACxB;AAKD,oBAAY,UAAU;IACpB,WAAW,iBAAiB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,GAAG,QAAQ;IACX,OAAO,YAAY;CACpB;AAKD,eAAO,MAAM,iBAAiB,QAAS,CAAC;AACxC,eAAO,MAAM,i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AAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAK9C,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,MAAM,UAAY,CAAC;AAChC,eAAO,MAAM,SAAS,SAAU,CAAC;AACjC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,eAAO,MAAM,WAAW,SAAU,CAAC"}
package/lib/constants.js CHANGED
@@ -30,7 +30,7 @@ var BusinessEntityIds;
30
30
  BusinessEntityIds["Contacts"] = "contacts";
31
31
  BusinessEntityIds["Vehicles"] = "vehicles";
32
32
  BusinessEntityIds["Users"] = "users";
33
- BusinessEntityIds["Contracts"] = "contracts";
33
+ BusinessEntityIds["LeasingContracts"] = "leasing_contracts";
34
34
  })(BusinessEntityIds = exports.BusinessEntityIds || (exports.BusinessEntityIds = {}));
35
35
  //
36
36
  // STATIC VALUES FOR VEHICLE CATEGORIES
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,EAAE;AACF,sBAAsB;AACtB,EAAE;AACW,QAAA,yBAAyB,GAAG,cAAc,CAAC;AAC3C,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEjD,EAAE;AACF,oCAAoC;AACpC,EAAE;AACW,QAAA,qBAAqB,GAAG,UAAU,CAAC;AACnC,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAC7B,QAAA,sBAAsB,GAAG,UAAU,CAAC;AACpC,QAAA,0BAA0B,GAAG,eAAe,CAAC;AAC7C,QAAA,qBAAqB,GAAG,UAAU,CAAC;AACnC,QAAA,yBAAyB,GAAG,SAAS,CAAC;AACtC,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAC3B,QAAA,uBAAuB,GAAG,YAAY,CAAC;AACvC,QAAA,uBAAuB,GAAG,YAAY,CAAC;AACvC,QAAA,wBAAwB,GAAG,SAA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AAS,GAAG,MAAO,CAAC;AACpB,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,WAAW,GAAG,MAAO,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare type CommunicationDestination = {
2
+ organizationId: string;
3
+ contactId: string;
4
+ type: 'sms' | 'email';
5
+ target: string;
6
+ };
7
+ export declare type Communication = {
8
+ templateId: string;
9
+ templateModifiedAt: number;
10
+ templateLanguage: string;
11
+ id: string;
12
+ createdAt: string;
13
+ content: string;
14
+ destinations: CommunicationDestination[];
15
+ };
16
+ //# sourceMappingURL=communications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communications.d.ts","sourceRoot":"","sources":["../../src/types/communications.ts"],"names":[],"mappings":"AAAA,oBAAY,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,wBAAwB,EAAE,CAAC;CAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=communications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communications.js","sourceRoot":"","sources":["../../src/types/communications.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ export declare enum TemplateType {
2
+ Email = "email",
3
+ Sms = "sms"
4
+ }
5
+ export declare type TemplateContent = {
6
+ type: TemplateType.Email;
7
+ subject: string;
8
+ content: {
9
+ html: string;
10
+ design: any;
11
+ };
12
+ } | {
13
+ type: TemplateType.Sms;
14
+ content: string;
15
+ };
16
+ export declare type Template = {
17
+ modifiedAt: string;
18
+ modifiedBy: string;
19
+ id: string;
20
+ language: string;
21
+ name: string;
22
+ } & TemplateContent;
23
+ export declare type TemplateInfo = {
24
+ id: string;
25
+ name: string;
26
+ langs: string[];
27
+ modifiedAt: string;
28
+ modifiedBy: string;
29
+ type: TemplateType;
30
+ };
31
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/types/templates.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED,oBAAY,eAAe,GACvB;IACE,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,GACD;IACE,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,oBAAY,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,eAAe,CAAC;AAEpB,oBAAY,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TemplateType = void 0;
4
+ var TemplateType;
5
+ (function (TemplateType) {
6
+ TemplateType["Email"] = "email";
7
+ TemplateType["Sms"] = "sms";
8
+ })(TemplateType = exports.TemplateType || (exports.TemplateType = {}));
9
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/types/templates.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,2BAAW,CAAA;AACb,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rm -rf build dist lib *.tsbuildinfo",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "author": "Ivo Anastácio",
13
13
  "dependencies": {
14
- "@bisondesk/commons-sdk": "1.0.74",
14
+ "@bisondesk/commons-sdk": "1.0.76",
15
15
  "joi": "17.4.0",
16
16
  "lru-cache": "6.0.0"
17
17
  },
package/src/constants.ts CHANGED
@@ -28,7 +28,7 @@ export enum BusinessEntityIds {
28
28
  Contacts = 'contacts',
29
29
  Vehicles = 'vehicles',
30
30
  Users = 'users',
31
- Contracts = 'contracts',
31
+ LeasingContracts = 'leasing_contracts',
32
32
  }
33
33
 
34
34
  //
@@ -0,0 +1,16 @@
1
+ export type CommunicationDestination = {
2
+ organizationId: string;
3
+ contactId: string;
4
+ type: 'sms' | 'email';
5
+ target: string; // the contact's phone number in E164 format or email
6
+ };
7
+
8
+ export type Communication = {
9
+ templateId: string;
10
+ templateModifiedAt: number;
11
+ templateLanguage: string;
12
+ id: string;
13
+ createdAt: string;
14
+ content: string;
15
+ destinations: CommunicationDestination[];
16
+ };
@@ -0,0 +1,35 @@
1
+ export enum TemplateType {
2
+ Email = 'email',
3
+ Sms = 'sms',
4
+ }
5
+
6
+ export type TemplateContent =
7
+ | {
8
+ type: TemplateType.Email;
9
+ subject: string;
10
+ content: {
11
+ html: string;
12
+ design: any;
13
+ };
14
+ }
15
+ | {
16
+ type: TemplateType.Sms;
17
+ content: string;
18
+ };
19
+
20
+ export type Template = {
21
+ modifiedAt: string;
22
+ modifiedBy: string;
23
+ id: string;
24
+ language: string;
25
+ name: string;
26
+ } & TemplateContent;
27
+
28
+ export type TemplateInfo = {
29
+ id: string;
30
+ name: string;
31
+ langs: string[];
32
+ modifiedAt: string;
33
+ modifiedBy: string;
34
+ type: TemplateType;
35
+ };
@@ -217,8 +217,8 @@
217
217
  "affectsGlobalScope": true
218
218
  },
219
219
  "./src/constants.ts": {
220
- "version": "cf7382657e1af3832541bd97ae05bbbc17bfa7c2b4674f66925a448b9b7a4f6a",
221
- "signature": "9c50a8b1c60c3ce4f53ce193af6169b94bacaf375bb3481bceda62843dfa7be2",
220
+ "version": "a9f12e9bacc0b38859c78f7f354917e6eb799061962e4b91b72c8c274d481ede",
221
+ "signature": "53e963e9a17267d08cab83fa8f84e59b7afe01074ae35ef8874473028267d3ee",
222
222
  "affectsGlobalScope": false
223
223
  },
224
224
  "../commons-sdk/lib/constants.d.ts": {
@@ -566,6 +566,11 @@
566
566
  "signature": "b715c10ba458f9f3de7c97f3f74122bc1e4e28747a09e966b99bfb1180e58853",
567
567
  "affectsGlobalScope": false
568
568
  },
569
+ "./src/types/communications.ts": {
570
+ "version": "ddc8a4abf653b461063a1ee61ee1e5a36c68884d1539d05bfee547d1313e64bc",
571
+ "signature": "e6f498f5bdc6bf5e4f1d10fe9f348cf0e003759422a36d755ad9858bb1231c9a",
572
+ "affectsGlobalScope": false
573
+ },
569
574
  "./src/types/conversations.ts": {
570
575
  "version": "64f6e1c8acfb1c799b8a23c561626ff5b8821734281f6b7b825806026c5f18ac",
571
576
  "signature": "e69c84342201dc3f03f3b6e3c279cf09238d40f600fd22a7e9454e08d01039fa",
@@ -596,6 +601,11 @@
596
601
  "signature": "88a781f968c85ed8359ad428b167e98b3ec50d75d2ddf317164f6173082dda4a",
597
602
  "affectsGlobalScope": false
598
603
  },
604
+ "./src/types/templates.ts": {
605
+ "version": "b16f14e12b11c1e3f85c86d6c626ab6ee82ba65959268485194a18c17efc6c18",
606
+ "signature": "7bcad107ed474d228f94783520d07674529e209f4ae1f39fae652b8ecd4b9096",
607
+ "affectsGlobalScope": false
608
+ },
599
609
  "./src/types/users.ts": {
600
610
  "version": "7ebc0d856c4c4a0f218ecf0c3dca9103cdc6ec1e94d8f7cc57c378af11207c71",
601
611
  "signature": "8498aad47ce75ed30d7360634bda5f327c5b0ff28adabec1e4d9be1ddcd5d0a2",
@@ -3188,6 +3198,7 @@
3188
3198
  "./src/apis/utils.ts",
3189
3199
  "./src/apis/vehicles.ts",
3190
3200
  "./src/constants.ts",
3201
+ "./src/types/communications.ts",
3191
3202
  "./src/types/conversations.ts",
3192
3203
  "./src/types/crm.ts",
3193
3204
  "./src/types/definitions.ts",
@@ -3199,6 +3210,7 @@
3199
3210
  "./src/types/search.ts",
3200
3211
  "./src/types/settings.ts",
3201
3212
  "./src/types/storage.ts",
3213
+ "./src/types/templates.ts",
3202
3214
  "./src/types/tenants.ts",
3203
3215
  "./src/types/users.ts",
3204
3216
  "./src/types/utils.ts",