@bisondesk/commons-sdk 1.0.23-B → 1.0.23

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.
Files changed (61) hide show
  1. package/lib/constants.d.ts +4 -34
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +8 -94
  4. package/lib/constants.js.map +1 -1
  5. package/lib/ids.d.ts +1 -2
  6. package/lib/ids.d.ts.map +1 -1
  7. package/lib/ids.js +1 -2
  8. package/lib/ids.js.map +1 -1
  9. package/lib/types.d.ts +2 -85
  10. package/lib/types.d.ts.map +1 -1
  11. package/lib/types.js.map +1 -1
  12. package/package.json +3 -6
  13. package/src/constants.ts +7 -97
  14. package/src/ids.ts +0 -1
  15. package/src/types.ts +2 -97
  16. package/tsconfig.tsbuildinfo +2892 -1
  17. package/lib/dayjs-utils.d.ts +0 -7
  18. package/lib/dayjs-utils.d.ts.map +0 -1
  19. package/lib/dayjs-utils.js +0 -28
  20. package/lib/dayjs-utils.js.map +0 -1
  21. package/lib/discussions.d.ts +0 -43
  22. package/lib/discussions.d.ts.map +0 -1
  23. package/lib/discussions.js +0 -5
  24. package/lib/discussions.js.map +0 -1
  25. package/lib/errors.d.ts +0 -36
  26. package/lib/errors.d.ts.map +0 -1
  27. package/lib/errors.js +0 -67
  28. package/lib/errors.js.map +0 -1
  29. package/lib/exact.d.ts +0 -10
  30. package/lib/exact.d.ts.map +0 -1
  31. package/lib/exact.js +0 -3
  32. package/lib/exact.js.map +0 -1
  33. package/lib/insurance.d.ts +0 -19
  34. package/lib/insurance.d.ts.map +0 -1
  35. package/lib/insurance.js +0 -3
  36. package/lib/insurance.js.map +0 -1
  37. package/lib/messages.d.ts +0 -56
  38. package/lib/messages.d.ts.map +0 -1
  39. package/lib/messages.js +0 -3
  40. package/lib/messages.js.map +0 -1
  41. package/lib/notifications.d.ts +0 -35
  42. package/lib/notifications.d.ts.map +0 -1
  43. package/lib/notifications.js +0 -9
  44. package/lib/notifications.js.map +0 -1
  45. package/lib/pdf-gen.d.ts +0 -40
  46. package/lib/pdf-gen.d.ts.map +0 -1
  47. package/lib/pdf-gen.js +0 -3
  48. package/lib/pdf-gen.js.map +0 -1
  49. package/lib/storage.d.ts +0 -63
  50. package/lib/storage.d.ts.map +0 -1
  51. package/lib/storage.js +0 -14
  52. package/lib/storage.js.map +0 -1
  53. package/src/dayjs-utils.ts +0 -27
  54. package/src/discussions.ts +0 -50
  55. package/src/errors.ts +0 -79
  56. package/src/exact.ts +0 -9
  57. package/src/insurance.ts +0 -21
  58. package/src/messages.ts +0 -65
  59. package/src/notifications.ts +0 -40
  60. package/src/pdf-gen.ts +0 -43
  61. package/src/storage.ts +0 -83
@@ -1,36 +1,6 @@
1
- export declare enum AppRoles {
2
- Accountant = "accountant",
3
- Admin = "admins",
4
- Administrative = "administrative",
5
- Commercial = "commercial",
6
- Manager = "manager",
7
- ParkLogistics = "park_logistics"
8
- }
1
+ export declare const ADMINS_ROLE = "admins";
2
+ export declare const INFRA_STACK_NAME = "infra";
3
+ export declare const RDS_MASTER_SECRET_ID_OUTPUT_NAME = "RDSMasterSecretId";
4
+ export declare const RDS_DEFAULT_SECRET_ID_OUTPUT_NAME = "RDSSecretId";
9
5
  export declare const SUPPORTED_LANGUAGES: string[];
10
- export declare const TENANT_ID_ADMIN_HEADER = "tenant-id";
11
- export declare const SERVICE_ID_ADMIN_HEADER = "service-id";
12
- export declare const NO_TENANT_ID_VALUE = "notenant";
13
- export declare const SYSTEM_USER_ID = "system";
14
- export declare enum BusinessEntityIds {
15
- BecrisDeclarations = "becris_declarations",
16
- Contacts = "contacts",
17
- Emails = "emails",
18
- FinanceDocuments = "finance_documents",
19
- InternetVehicles = "internet-vehicles",
20
- Leads = "leads",
21
- LeasingContracts = "leasing_contracts",
22
- LeasingUploadAutomation = "leasing_upload_automation",
23
- Opportunities = "opportunities",
24
- Organizations = "organizations",
25
- PdfTemplates = "pdf_templates",
26
- Users = "users",
27
- Vehicles = "vehicles",
28
- VehiclesPriceLists = "vehicles_price_lists"
29
- }
30
- export declare const LEASING_QUOTE_TEMPLATE_GROUP_ID = "leasing_quote_template";
31
- export declare const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = "leasing_quote_proforma_template";
32
- export declare const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = "leasing_contract_amortization_template";
33
- export declare const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = "leasing_contract_tc_template";
34
- export declare const EU_VAT_COUNTRY_CODES: string[];
35
- export declare const HEXON_LANG_CODES: [string, ...string[]];
36
6
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,KAAK,WAAW;IAChB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,aAAa,mBAAmB;CACjC;AAKD,eAAO,MAAM,mBAAmB,UAA2B,CAAC;AAK5D,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAClD,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAKpD,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,cAAc,WAAW,CAAC;AAKvC,oBAAY,iBAAiB;IAC3B,kBAAkB,wBAAwB;IAC1C,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,KAAK,UAAU;IACf,gBAAgB,sBAAsB;IACtC,uBAAuB,8BAA8B;IACrD,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,kBAAkB;IAC9B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC5C;AAKD,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,wCAAwC,oCAAoC,CAAC;AAC1F,eAAO,MAAM,+CAA+C,2CAClB,CAAC;AAC3C,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAKpF,eAAO,MAAM,oBAAoB,UA6BhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAalD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,WAAW,CAAC;AAKpC,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,gCAAgC,sBAAsB,CAAC;AACpE,eAAO,MAAM,iCAAiC,gBAAgB,CAAC;AAK/D,eAAO,MAAM,mBAAmB,UAAqB,CAAC"}
package/lib/constants.js CHANGED
@@ -1,104 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HEXON_LANG_CODES = exports.EU_VAT_COUNTRY_CODES = exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = exports.BusinessEntityIds = exports.SYSTEM_USER_ID = exports.NO_TENANT_ID_VALUE = exports.SERVICE_ID_ADMIN_HEADER = exports.TENANT_ID_ADMIN_HEADER = exports.SUPPORTED_LANGUAGES = exports.AppRoles = void 0;
3
+ exports.SUPPORTED_LANGUAGES = exports.RDS_DEFAULT_SECRET_ID_OUTPUT_NAME = exports.RDS_MASTER_SECRET_ID_OUTPUT_NAME = exports.INFRA_STACK_NAME = exports.ADMINS_ROLE = void 0;
4
4
  //
5
5
  // STATIC ROLES
6
6
  //
7
- var AppRoles;
8
- (function (AppRoles) {
9
- AppRoles["Accountant"] = "accountant";
10
- AppRoles["Admin"] = "admins";
11
- AppRoles["Administrative"] = "administrative";
12
- AppRoles["Commercial"] = "commercial";
13
- AppRoles["Manager"] = "manager";
14
- AppRoles["ParkLogistics"] = "park_logistics";
15
- })(AppRoles = exports.AppRoles || (exports.AppRoles = {}));
7
+ exports.ADMINS_ROLE = 'admins';
16
8
  //
17
- // I18N
18
- //
19
- exports.SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es'];
20
- //
21
- // Headers
22
- //
23
- exports.TENANT_ID_ADMIN_HEADER = 'tenant-id';
24
- exports.SERVICE_ID_ADMIN_HEADER = 'service-id';
25
- //
26
- // AUTH
9
+ // CLOUDFORMATION
27
10
  //
28
- exports.NO_TENANT_ID_VALUE = 'notenant';
29
- exports.SYSTEM_USER_ID = 'system';
11
+ exports.INFRA_STACK_NAME = 'infra';
12
+ exports.RDS_MASTER_SECRET_ID_OUTPUT_NAME = 'RDSMasterSecretId';
13
+ exports.RDS_DEFAULT_SECRET_ID_OUTPUT_NAME = 'RDSSecretId';
30
14
  //
31
- // Business Entity IDs
32
- //
33
- var BusinessEntityIds;
34
- (function (BusinessEntityIds) {
35
- BusinessEntityIds["BecrisDeclarations"] = "becris_declarations";
36
- BusinessEntityIds["Contacts"] = "contacts";
37
- BusinessEntityIds["Emails"] = "emails";
38
- BusinessEntityIds["FinanceDocuments"] = "finance_documents";
39
- BusinessEntityIds["InternetVehicles"] = "internet-vehicles";
40
- BusinessEntityIds["Leads"] = "leads";
41
- BusinessEntityIds["LeasingContracts"] = "leasing_contracts";
42
- BusinessEntityIds["LeasingUploadAutomation"] = "leasing_upload_automation";
43
- BusinessEntityIds["Opportunities"] = "opportunities";
44
- BusinessEntityIds["Organizations"] = "organizations";
45
- BusinessEntityIds["PdfTemplates"] = "pdf_templates";
46
- BusinessEntityIds["Users"] = "users";
47
- BusinessEntityIds["Vehicles"] = "vehicles";
48
- BusinessEntityIds["VehiclesPriceLists"] = "vehicles_price_lists";
49
- })(BusinessEntityIds = exports.BusinessEntityIds || (exports.BusinessEntityIds = {}));
50
- //
51
- // PDF Templates IDs
52
- //
53
- exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
54
- exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
55
- exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
56
- exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
57
- //
58
- // VAT Prefixes for EU Countries and Great Britain & Northern Ireland
15
+ // I18N
59
16
  //
60
- exports.EU_VAT_COUNTRY_CODES = [
61
- 'at',
62
- 'be',
63
- 'bg',
64
- 'hr',
65
- 'cy',
66
- 'cz',
67
- 'dk',
68
- 'ee',
69
- 'fi',
70
- 'fr',
71
- 'de',
72
- 'el',
73
- 'hu',
74
- 'ie',
75
- 'it',
76
- 'lv',
77
- 'lt',
78
- 'lu',
79
- 'mt',
80
- 'nl',
81
- 'pl',
82
- 'pt',
83
- 'ro',
84
- 'sk',
85
- 'si',
86
- 'es',
87
- 'se',
88
- 'xi', // Northern Ireland
89
- ];
90
- exports.HEXON_LANG_CODES = [
91
- 'en',
92
- 'nl',
93
- 'de',
94
- 'fr',
95
- 'es',
96
- 'pt',
97
- 'it',
98
- 'pl',
99
- 'ru',
100
- 'ro',
101
- 'el',
102
- 'bg',
103
- ];
17
+ exports.SUPPORTED_LANGUAGES = ['en', 'fr', 'nl'];
104
18
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,EAAE;AACF,eAAe;AACf,EAAE;AACF,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;AAClC,CAAC,EAPW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAOnB;AAED,EAAE;AACF,OAAO;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ACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI,EAAE,mBAAmB;CAC1B,CAAC;AAEW,QAAA,gBAAgB,GAA0B;IACrD,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,EAAE;AACF,eAAe;AACf,EAAE;AACW,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEpC,EAAE;AACF,iBAAiB;AACjB,EAAE;AACW,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,gCAAgC,GAAG,mBAAmB,CAAC;AACvD,QAAA,iCAAiC,GAAG,aAAa,CAAC;AAE/D,EAAE;AACF,OAAO;AACP,EAAE;AACW,QAAA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"}
package/lib/ids.d.ts CHANGED
@@ -2,8 +2,7 @@ export declare enum Alphabet {
2
2
  Full = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_",
3
3
  Alphanumeric = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
4
4
  Lowercase = "abcdefghijklmnopqrstuvwxyz",
5
- LowerAlphanumeric = "0123456789abcdefghijklmnopqrstuvwxyz",
6
- ReferenceCode = "123456789ABCDEFGHJKMNPQRSTUVWXYZ"
5
+ LowerAlphanumeric = "0123456789abcdefghijklmnopqrstuvwxyz"
7
6
  }
8
7
  export declare const generateId: (idLength?: number, alphabet?: Alphabet) => string;
9
8
  //# sourceMappingURL=ids.d.ts.map
package/lib/ids.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ;IAClB,IAAI,oEAAoE;IACxE,YAAY,mEAAmE;IAC/E,SAAS,+BAA+B;IACxC,iBAAiB,yCAAyC;IAC1D,aAAa,qCAAqC;CACnD;AAID,eAAO,MAAM,UAAU,cAAc,MAAM,aAAiB,QAAQ,KAAmB,MAQtF,CAAC"}
1
+ {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ;IAClB,IAAI,oEAAoE;IACxE,YAAY,mEAAmE;IAC/E,SAAS,+BAA+B;IACxC,iBAAiB,yCAAyC;CAC3D;AAID,eAAO,MAAM,UAAU,cAAc,MAAM,aAAiB,QAAQ,KAAmB,MAQtF,CAAC"}
package/lib/ids.js CHANGED
@@ -8,12 +8,11 @@ var Alphabet;
8
8
  Alphabet["Alphanumeric"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
9
9
  Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
10
10
  Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
11
- Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
12
11
  })(Alphabet = exports.Alphabet || (exports.Alphabet = {}));
13
12
  // The ID can contain only alphabets and numbers and underscore.
14
13
  // The ID should start with an alphabet and should not have two consecutive underscores or end with an underscore.
15
14
  const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
16
- const nanoid = (0, nanoid_1.customAlphabet)(alphabet, idLength);
15
+ const nanoid = nanoid_1.customAlphabet(alphabet, idLength);
17
16
  while (true) {
18
17
  const id = nanoid();
19
18
  if (isValid(id)) {
package/lib/ids.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../src/ids.ts"],"names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D,CAAA;AAC5D,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,gEAAgE;AAChE,kHAAkH;AAC3G,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,uBAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE;YACf,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEF,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;IACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC1C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
package/lib/types.d.ts CHANGED
@@ -1,25 +1,15 @@
1
- import { AppRoles } from './constants';
2
1
  export declare type PaginatedList<T, M = {}> = {
3
2
  results: T[];
4
3
  totalCount: number;
5
4
  meta: M;
6
5
  };
7
- export declare type NextList<T, M = {}> = {
8
- results: T[];
9
- nextToken?: string;
10
- meta: M;
11
- };
12
- export declare type PaginatedRequest = {
13
- limit?: number;
14
- offset?: number;
15
- };
16
6
  export declare type Requester = {
17
7
  lang: string;
18
- roles: AppRoles[];
8
+ roles: string[];
19
9
  tenantId: string;
20
10
  tenantLang: string;
21
11
  userAgent?: string;
22
- source?: string;
12
+ source: string;
23
13
  userId: string;
24
14
  isApi: boolean;
25
15
  };
@@ -45,77 +35,4 @@ export declare type CognitoInfo = {
45
35
  appClientId: string;
46
36
  region: Region;
47
37
  };
48
- export declare type SearchPermissions = {
49
- users: string[];
50
- roles: AppRoles[];
51
- };
52
- export declare type PhoneNumberValue = {
53
- country: string;
54
- e164: string;
55
- international: string;
56
- national: string;
57
- };
58
- export declare type PhoneNumberRawValue = {
59
- defaultCountry?: string;
60
- input: string;
61
- };
62
- export declare type LocationValue = {
63
- addressLine1?: string;
64
- addressLine2?: string;
65
- city?: string;
66
- country: string;
67
- postalCode?: string;
68
- gps?: {
69
- lat: number;
70
- lon: number;
71
- };
72
- };
73
- export declare type LinkValue = {
74
- text?: string;
75
- url: string;
76
- };
77
- export declare type Document = {
78
- type: string;
79
- displayName: string;
80
- file: AttachmentValue;
81
- };
82
- export declare type AttachmentValue = {
83
- contentType: string;
84
- fileName: string;
85
- id: string;
86
- previewSrc?: string;
87
- size: number;
88
- uploadedAt: string;
89
- uploadedBy: string;
90
- url: string;
91
- descriptions?: string | MultiLangValue;
92
- };
93
- export declare type VatLayerResponse = {
94
- vatNumber: string;
95
- } & ({
96
- formatValid: false;
97
- viesValid: false;
98
- } | {
99
- formatValid: true;
100
- viesValid: boolean;
101
- countryCode: string;
102
- name: string;
103
- addressLines: string[];
104
- });
105
- export declare type VatValidationResponse = {
106
- vatNumber: string;
107
- formatValid?: boolean;
108
- countryCode?: string;
109
- } & ({
110
- viesValid: false;
111
- } | {
112
- viesValid: true;
113
- name?: string;
114
- normalizedAddress?: LocationValue;
115
- officialAddress?: string[];
116
- });
117
- export declare type VatValidationRequest = {
118
- defaultCountry?: string;
119
- input: string;
120
- };
121
38
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM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,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,oBAAY,MAAM,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,MAAM;IAChB,OAAO,cAAc;CACtB;AAED,oBAAY,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEnF,oBAAY,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAoCA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,cAAM,KAAN,cAAM,QAEjB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAuBA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,cAAM,KAAN,cAAM,QAEjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/commons-sdk",
3
- "version": "1.0.23-B",
3
+ "version": "1.0.23",
4
4
  "scripts": {
5
5
  "build": "npx tsc --build",
6
6
  "clean": "rm -rf lib *.tsbuildinfo",
@@ -8,13 +8,10 @@
8
8
  "integrationtest": "echo \"No test specified\""
9
9
  },
10
10
  "dependencies": {
11
- "nanoid": "3.1.31",
12
- "dayjs": "1.10.4",
13
- "dayjs-business-days": "1.0.4"
11
+ "nanoid": "3.1.22"
14
12
  },
15
13
  "devDependencies": {
16
14
  "@types/nanoid": "2.1.0",
17
- "typescript": "4.7.4"
15
+ "typescript": "4.2.3"
18
16
  }
19
17
  }
20
-
package/src/constants.ts CHANGED
@@ -1,106 +1,16 @@
1
1
  //
2
2
  // STATIC ROLES
3
3
  //
4
- export enum AppRoles {
5
- Accountant = 'accountant',
6
- Admin = 'admins',
7
- Administrative = 'administrative',
8
- Commercial = 'commercial',
9
- Manager = 'manager',
10
- ParkLogistics = 'park_logistics',
11
- }
4
+ export const ADMINS_ROLE = 'admins';
12
5
 
13
6
  //
14
- // I18N
15
- //
16
- export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es'];
17
-
18
- //
19
- // Headers
7
+ // CLOUDFORMATION
20
8
  //
21
- export const TENANT_ID_ADMIN_HEADER = 'tenant-id';
22
- export const SERVICE_ID_ADMIN_HEADER = 'service-id';
9
+ export const INFRA_STACK_NAME = 'infra';
10
+ export const RDS_MASTER_SECRET_ID_OUTPUT_NAME = 'RDSMasterSecretId';
11
+ export const RDS_DEFAULT_SECRET_ID_OUTPUT_NAME = 'RDSSecretId';
23
12
 
24
13
  //
25
- // AUTH
26
- //
27
- export const NO_TENANT_ID_VALUE = 'notenant';
28
- export const SYSTEM_USER_ID = 'system';
29
-
30
- //
31
- // Business Entity IDs
32
- //
33
- export enum BusinessEntityIds {
34
- BecrisDeclarations = 'becris_declarations',
35
- Contacts = 'contacts',
36
- Emails = 'emails',
37
- FinanceDocuments = 'finance_documents',
38
- InternetVehicles = 'internet-vehicles',
39
- Leads = 'leads',
40
- LeasingContracts = 'leasing_contracts',
41
- LeasingUploadAutomation = 'leasing_upload_automation',
42
- Opportunities = 'opportunities',
43
- Organizations = 'organizations',
44
- PdfTemplates = 'pdf_templates',
45
- Users = 'users',
46
- Vehicles = 'vehicles',
47
- VehiclesPriceLists = 'vehicles_price_lists',
48
- }
49
-
50
- //
51
- // PDF Templates IDs
52
- //
53
- export const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
54
- export const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
55
- export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =
56
- 'leasing_contract_amortization_template';
57
- export const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
58
-
59
- //
60
- // VAT Prefixes for EU Countries and Great Britain & Northern Ireland
14
+ // I18N
61
15
  //
62
- export const EU_VAT_COUNTRY_CODES = [
63
- 'at',
64
- 'be',
65
- 'bg',
66
- 'hr',
67
- 'cy',
68
- 'cz',
69
- 'dk',
70
- 'ee',
71
- 'fi',
72
- 'fr',
73
- 'de',
74
- 'el',
75
- 'hu',
76
- 'ie',
77
- 'it',
78
- 'lv',
79
- 'lt',
80
- 'lu',
81
- 'mt',
82
- 'nl',
83
- 'pl',
84
- 'pt',
85
- 'ro',
86
- 'sk',
87
- 'si',
88
- 'es',
89
- 'se',
90
- 'xi', // Northern Ireland
91
- ];
92
-
93
- export const HEXON_LANG_CODES: [string, ...string[]] = [
94
- 'en',
95
- 'nl',
96
- 'de',
97
- 'fr',
98
- 'es',
99
- 'pt',
100
- 'it',
101
- 'pl',
102
- 'ru',
103
- 'ro',
104
- 'el',
105
- 'bg',
106
- ];
16
+ export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl'];
package/src/ids.ts CHANGED
@@ -5,7 +5,6 @@ export enum Alphabet {
5
5
  Alphanumeric = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
6
6
  Lowercase = 'abcdefghijklmnopqrstuvwxyz',
7
7
  LowerAlphanumeric = '0123456789abcdefghijklmnopqrstuvwxyz',
8
- ReferenceCode = '123456789ABCDEFGHJKMNPQRSTUVWXYZ',
9
8
  }
10
9
 
11
10
  // The ID can contain only alphabets and numbers and underscore.
package/src/types.ts CHANGED
@@ -1,29 +1,16 @@
1
- import { AppRoles } from './constants';
2
-
3
1
  export type PaginatedList<T, M = {}> = {
4
2
  results: T[];
5
3
  totalCount: number;
6
4
  meta: M;
7
5
  };
8
6
 
9
- export type NextList<T, M = {}> = {
10
- results: T[];
11
- nextToken?: string;
12
- meta: M;
13
- };
14
-
15
- export type PaginatedRequest = {
16
- limit?: number;
17
- offset?: number;
18
- };
19
-
20
7
  export type Requester = {
21
8
  lang: string;
22
- roles: AppRoles[];
9
+ roles: string[];
23
10
  tenantId: string;
24
11
  tenantLang: string;
25
12
  userAgent?: string;
26
- source?: string;
13
+ source: string;
27
14
  userId: string;
28
15
  isApi: boolean;
29
16
  };
@@ -50,85 +37,3 @@ export type CognitoInfo = {
50
37
  appClientId: string;
51
38
  region: Region;
52
39
  };
53
-
54
- export type SearchPermissions = {
55
- users: string[];
56
- roles: AppRoles[];
57
- };
58
-
59
- export type PhoneNumberValue = {
60
- country: string;
61
- e164: string;
62
- international: string;
63
- national: string;
64
- };
65
-
66
- export type PhoneNumberRawValue = {
67
- defaultCountry?: string;
68
- input: string;
69
- };
70
-
71
- export type LocationValue = {
72
- addressLine1?: string;
73
- addressLine2?: string;
74
- city?: string;
75
- country: string;
76
- postalCode?: string;
77
- gps?: {
78
- lat: number;
79
- lon: number;
80
- };
81
- };
82
-
83
- export type LinkValue = {
84
- text?: string;
85
- url: string;
86
- };
87
-
88
- export type Document = {
89
- type: string; // passport, driving_license, ...
90
- displayName: string;
91
- file: AttachmentValue;
92
- };
93
-
94
- export type AttachmentValue = {
95
- contentType: string;
96
- fileName: string;
97
- id: string;
98
- previewSrc?: string;
99
- size: number;
100
- uploadedAt: string;
101
- uploadedBy: string;
102
- url: string;
103
- descriptions?: string | MultiLangValue;
104
- };
105
-
106
- export type VatLayerResponse = { vatNumber: string } & (
107
- | { formatValid: false; viesValid: false }
108
- | {
109
- formatValid: true;
110
- viesValid: boolean;
111
- countryCode: string;
112
- name: string;
113
- addressLines: string[];
114
- }
115
- );
116
-
117
- export type VatValidationResponse = {
118
- vatNumber: string;
119
- formatValid?: boolean;
120
- countryCode?: string;
121
- } & (
122
- | { viesValid: false }
123
- | {
124
- viesValid: true;
125
- name?: string;
126
- normalizedAddress?: LocationValue;
127
- officialAddress?: string[];
128
- }
129
- );
130
-
131
- export type VatValidationRequest = {
132
- defaultCountry?: string;
133
- input: string;
134
- };