@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.
- package/lib/constants.d.ts +4 -34
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +8 -94
- package/lib/constants.js.map +1 -1
- package/lib/ids.d.ts +1 -2
- package/lib/ids.d.ts.map +1 -1
- package/lib/ids.js +1 -2
- package/lib/ids.js.map +1 -1
- package/lib/types.d.ts +2 -85
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +3 -6
- package/src/constants.ts +7 -97
- package/src/ids.ts +0 -1
- package/src/types.ts +2 -97
- package/tsconfig.tsbuildinfo +2892 -1
- package/lib/dayjs-utils.d.ts +0 -7
- package/lib/dayjs-utils.d.ts.map +0 -1
- package/lib/dayjs-utils.js +0 -28
- package/lib/dayjs-utils.js.map +0 -1
- package/lib/discussions.d.ts +0 -43
- package/lib/discussions.d.ts.map +0 -1
- package/lib/discussions.js +0 -5
- package/lib/discussions.js.map +0 -1
- package/lib/errors.d.ts +0 -36
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -67
- package/lib/errors.js.map +0 -1
- package/lib/exact.d.ts +0 -10
- package/lib/exact.d.ts.map +0 -1
- package/lib/exact.js +0 -3
- package/lib/exact.js.map +0 -1
- package/lib/insurance.d.ts +0 -19
- package/lib/insurance.d.ts.map +0 -1
- package/lib/insurance.js +0 -3
- package/lib/insurance.js.map +0 -1
- package/lib/messages.d.ts +0 -56
- package/lib/messages.d.ts.map +0 -1
- package/lib/messages.js +0 -3
- package/lib/messages.js.map +0 -1
- package/lib/notifications.d.ts +0 -35
- package/lib/notifications.d.ts.map +0 -1
- package/lib/notifications.js +0 -9
- package/lib/notifications.js.map +0 -1
- package/lib/pdf-gen.d.ts +0 -40
- package/lib/pdf-gen.d.ts.map +0 -1
- package/lib/pdf-gen.js +0 -3
- package/lib/pdf-gen.js.map +0 -1
- package/lib/storage.d.ts +0 -63
- package/lib/storage.d.ts.map +0 -1
- package/lib/storage.js +0 -14
- package/lib/storage.js.map +0 -1
- package/src/dayjs-utils.ts +0 -27
- package/src/discussions.ts +0 -50
- package/src/errors.ts +0 -79
- package/src/exact.ts +0 -9
- package/src/insurance.ts +0 -21
- package/src/messages.ts +0 -65
- package/src/notifications.ts +0 -40
- package/src/pdf-gen.ts +0 -43
- package/src/storage.ts +0 -83
package/lib/constants.d.ts
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
package/lib/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,
|
|
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.
|
|
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
|
-
|
|
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
|
-
//
|
|
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.
|
|
29
|
-
exports.
|
|
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
|
-
//
|
|
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.
|
|
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
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,EAAE;AACF,eAAe;AACf,EAAE;
|
|
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;
|
|
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 =
|
|
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":[],"mappings":";;;AAAA,mCAAwC;AAExC,IAAY,
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,sEAA0D,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:
|
|
8
|
+
roles: string[];
|
|
19
9
|
tenantId: string;
|
|
20
10
|
tenantLang: string;
|
|
21
11
|
userAgent?: string;
|
|
22
|
-
source
|
|
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
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI;IACrC,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,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":";;;
|
|
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
|
|
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.
|
|
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.
|
|
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
|
|
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
|
-
//
|
|
15
|
-
//
|
|
16
|
-
export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es'];
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
// Headers
|
|
7
|
+
// CLOUDFORMATION
|
|
20
8
|
//
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
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
|
-
//
|
|
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
|
|
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:
|
|
9
|
+
roles: string[];
|
|
23
10
|
tenantId: string;
|
|
24
11
|
tenantLang: string;
|
|
25
12
|
userAgent?: string;
|
|
26
|
-
source
|
|
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
|
-
};
|