@bisondesk/commons-sdk 1.0.317 → 1.0.319
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/{types/becris.d.ts → becris.d.ts} +1 -1
- package/lib/{types/becris.d.ts.map → becris.d.ts.map} +1 -1
- package/lib/becris.js +1 -2
- package/lib/becris.js.map +1 -1
- package/lib/{types/constants.d.ts → constants.d.ts} +5 -1
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +26 -25
- package/lib/constants.js.map +1 -1
- package/lib/date-utils.d.ts +6 -0
- package/lib/date-utils.d.ts.map +1 -0
- package/lib/date-utils.js +7 -0
- package/lib/date-utils.js.map +1 -0
- package/lib/{types/discussions.d.ts → discussions.d.ts} +1 -1
- package/lib/discussions.d.ts.map +1 -0
- package/lib/discussions.js +1 -4
- package/lib/discussions.js.map +1 -1
- package/lib/{types/errors.d.ts → errors.d.ts} +2 -2
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +7 -17
- package/lib/errors.js.map +1 -1
- package/lib/{types/exact.d.ts → exact.d.ts} +12 -0
- package/lib/{types/exact.d.ts.map → exact.d.ts.map} +1 -1
- package/lib/exact.js +1 -2
- package/lib/exact.js.map +1 -1
- package/lib/{types/fetch.d.ts → fetch.d.ts} +2 -2
- package/lib/fetch.d.ts.map +1 -0
- package/lib/fetch.js +10 -18
- package/lib/fetch.js.map +1 -1
- package/lib/formatting.js +2 -7
- package/lib/formatting.js.map +1 -1
- package/lib/ids.js +5 -9
- package/lib/ids.js.map +1 -1
- package/lib/insurance.js +1 -2
- package/lib/{types/location-utils.d.ts → location-utils.d.ts} +1 -1
- package/lib/{types/location-utils.d.ts.map → location-utils.d.ts.map} +1 -1
- package/lib/location-utils.js +3 -8
- package/lib/location-utils.js.map +1 -1
- package/lib/locations.js +4 -9
- package/lib/locations.js.map +1 -1
- package/lib/{types/messages.d.ts → messages.d.ts} +1 -1
- package/lib/{types/messages.d.ts.map → messages.d.ts.map} +1 -1
- package/lib/messages.js +1 -2
- package/lib/messages.js.map +1 -1
- package/lib/{types/notifications.d.ts → notifications.d.ts} +1 -1
- package/lib/notifications.d.ts.map +1 -0
- package/lib/notifications.js +6 -9
- package/lib/notifications.js.map +1 -1
- package/lib/{types/pdf-gen.d.ts → pdf-gen.d.ts} +6 -2
- package/lib/pdf-gen.d.ts.map +1 -0
- package/lib/pdf-gen.js +1 -2
- package/lib/pdf-gen.js.map +1 -1
- package/lib/servers.js +3 -7
- package/lib/servers.js.map +1 -1
- package/lib/{types/storage.d.ts → storage.d.ts} +1 -1
- package/lib/{types/storage.d.ts.map → storage.d.ts.map} +1 -1
- package/lib/storage.js +4 -7
- package/lib/storage.js.map +1 -1
- package/lib/{types/tasks.d.ts → tasks.d.ts} +3 -4
- package/lib/tasks.d.ts.map +1 -0
- package/lib/tasks.js +4 -7
- package/lib/tasks.js.map +1 -1
- package/lib/{types/types.d.ts → types.d.ts} +22 -6
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +7 -5
- package/lib/types.js.map +1 -1
- package/package.json +12 -21
- package/src/becris.ts +1 -1
- package/src/constants.ts +4 -0
- package/src/date-utils.ts +14 -0
- package/src/discussions.ts +1 -1
- package/src/errors.ts +3 -3
- package/src/exact.ts +15 -0
- package/src/fetch.ts +4 -5
- package/src/location-utils.ts +1 -1
- package/src/messages.ts +1 -1
- package/src/notifications.ts +1 -1
- package/src/pdf-gen.ts +7 -2
- package/src/storage.ts +1 -1
- package/src/tasks.ts +3 -4
- package/src/types.ts +25 -7
- package/tsconfig.deploy.json +4 -0
- package/tsconfig.deploy.tsbuildinfo +1 -0
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/becris.js +0 -3
- package/lib/cjs/becris.js.map +0 -1
- package/lib/cjs/constants.js +0 -107
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/dayjs-utils.js +0 -26
- package/lib/cjs/dayjs-utils.js.map +0 -1
- package/lib/cjs/discussions.js +0 -5
- package/lib/cjs/discussions.js.map +0 -1
- package/lib/cjs/errors.js +0 -67
- package/lib/cjs/errors.js.map +0 -1
- package/lib/cjs/exact.js +0 -3
- package/lib/cjs/exact.js.map +0 -1
- package/lib/cjs/fetch.js +0 -40
- package/lib/cjs/fetch.js.map +0 -1
- package/lib/cjs/formatting.js +0 -20
- package/lib/cjs/formatting.js.map +0 -1
- package/lib/cjs/ids.js +0 -35
- package/lib/cjs/ids.js.map +0 -1
- package/lib/cjs/insurance.js +0 -3
- package/lib/cjs/insurance.js.map +0 -1
- package/lib/cjs/location-utils.js +0 -21
- package/lib/cjs/location-utils.js.map +0 -1
- package/lib/cjs/locations.js +0 -95
- package/lib/cjs/locations.js.map +0 -1
- package/lib/cjs/messages.js +0 -3
- package/lib/cjs/messages.js.map +0 -1
- package/lib/cjs/notifications.js +0 -18
- package/lib/cjs/notifications.js.map +0 -1
- package/lib/cjs/pdf-gen.js +0 -3
- package/lib/cjs/pdf-gen.js.map +0 -1
- package/lib/cjs/servers.js +0 -26
- package/lib/cjs/servers.js.map +0 -1
- package/lib/cjs/storage.js +0 -14
- package/lib/cjs/storage.js.map +0 -1
- package/lib/cjs/tasks.js +0 -15
- package/lib/cjs/tasks.js.map +0 -1
- package/lib/cjs/types.js +0 -8
- package/lib/cjs/types.js.map +0 -1
- package/lib/dayjs-utils.js +0 -25
- package/lib/dayjs-utils.js.map +0 -1
- package/lib/esm/becris.js +0 -2
- package/lib/esm/becris.js.map +0 -1
- package/lib/esm/constants.js +0 -104
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/dayjs-utils.js +0 -18
- package/lib/esm/dayjs-utils.js.map +0 -1
- package/lib/esm/discussions.js +0 -2
- package/lib/esm/discussions.js.map +0 -1
- package/lib/esm/errors.js +0 -57
- package/lib/esm/errors.js.map +0 -1
- package/lib/esm/exact.js +0 -2
- package/lib/esm/exact.js.map +0 -1
- package/lib/esm/fetch.js +0 -32
- package/lib/esm/fetch.js.map +0 -1
- package/lib/esm/formatting.js +0 -15
- package/lib/esm/formatting.js.map +0 -1
- package/lib/esm/ids.js +0 -31
- package/lib/esm/ids.js.map +0 -1
- package/lib/esm/insurance.js +0 -2
- package/lib/esm/insurance.js.map +0 -1
- package/lib/esm/location-utils.js +0 -16
- package/lib/esm/location-utils.js.map +0 -1
- package/lib/esm/locations.js +0 -90
- package/lib/esm/locations.js.map +0 -1
- package/lib/esm/messages.js +0 -2
- package/lib/esm/messages.js.map +0 -1
- package/lib/esm/notifications.js +0 -15
- package/lib/esm/notifications.js.map +0 -1
- package/lib/esm/pdf-gen.js +0 -2
- package/lib/esm/pdf-gen.js.map +0 -1
- package/lib/esm/servers.js +0 -22
- package/lib/esm/servers.js.map +0 -1
- package/lib/esm/storage.js +0 -11
- package/lib/esm/storage.js.map +0 -1
- package/lib/esm/tasks.js +0 -12
- package/lib/esm/tasks.js.map +0 -1
- package/lib/esm/types.js +0 -5
- package/lib/esm/types.js.map +0 -1
- package/lib/tsconfig.cjs.tsbuildinfo +0 -1
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/types/constants.d.ts.map +0 -1
- package/lib/types/dayjs-utils.d.ts +0 -8
- package/lib/types/dayjs-utils.d.ts.map +0 -1
- package/lib/types/discussions.d.ts.map +0 -1
- package/lib/types/errors.d.ts.map +0 -1
- package/lib/types/fetch.d.ts.map +0 -1
- package/lib/types/notifications.d.ts.map +0 -1
- package/lib/types/pdf-gen.d.ts.map +0 -1
- package/lib/types/tasks.d.ts.map +0 -1
- package/lib/types/types.d.ts.map +0 -1
- package/src/dayjs-utils.ts +0 -30
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.esm.json +0 -8
- /package/lib/{types/formatting.d.ts → formatting.d.ts} +0 -0
- /package/lib/{types/formatting.d.ts.map → formatting.d.ts.map} +0 -0
- /package/lib/{types/ids.d.ts → ids.d.ts} +0 -0
- /package/lib/{types/ids.d.ts.map → ids.d.ts.map} +0 -0
- /package/lib/{types/insurance.d.ts → insurance.d.ts} +0 -0
- /package/lib/{types/insurance.d.ts.map → insurance.d.ts.map} +0 -0
- /package/lib/{types/locations.d.ts → locations.d.ts} +0 -0
- /package/lib/{types/locations.d.ts.map → locations.d.ts.map} +0 -0
- /package/lib/{types/servers.d.ts → servers.d.ts} +0 -0
- /package/lib/{types/servers.d.ts.map → servers.d.ts.map} +0 -0
package/lib/cjs/constants.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_SLB_PARTNER = exports.HEXON_LANG_CODES = exports.EU_VAT_COUNTRY_CODES = exports.SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = exports.SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = exports.LEASING_QUOTE_LOCATION_TEMPLATE = exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_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.TopLevelActions = exports.AppRoles = void 0;
|
|
4
|
-
var AppRoles;
|
|
5
|
-
(function (AppRoles) {
|
|
6
|
-
AppRoles["Accountant"] = "accountant";
|
|
7
|
-
AppRoles["Admin"] = "admins";
|
|
8
|
-
AppRoles["Administrative"] = "administrative";
|
|
9
|
-
AppRoles["Commercial"] = "commercial";
|
|
10
|
-
AppRoles["Manager"] = "manager";
|
|
11
|
-
AppRoles["ParkLogistics"] = "park_logistics";
|
|
12
|
-
AppRoles["AppManager"] = "app_manager";
|
|
13
|
-
})(AppRoles = exports.AppRoles || (exports.AppRoles = {}));
|
|
14
|
-
var TopLevelActions;
|
|
15
|
-
(function (TopLevelActions) {
|
|
16
|
-
TopLevelActions["AdministrationAll"] = "admin:*";
|
|
17
|
-
TopLevelActions["DocumentsBrowse"] = "docs:finance:browse";
|
|
18
|
-
TopLevelActions["LeadsAll"] = "leads:*";
|
|
19
|
-
TopLevelActions["LeasingDebtorsView"] = "leasing:debtors:view";
|
|
20
|
-
TopLevelActions["LeasingOverduesView"] = "leasing:overdues:view";
|
|
21
|
-
TopLevelActions["LeasingContractsExport"] = "leasing:contracts:export";
|
|
22
|
-
TopLevelActions["LeasingContractsRsExport"] = "leasing:contracts:rs:export-rs";
|
|
23
|
-
TopLevelActions["LeasingDebtorsExport"] = "leasing:debtors:export";
|
|
24
|
-
TopLevelActions["MarketBrowse"] = "market:browse";
|
|
25
|
-
TopLevelActions["MarketInsights"] = "insights:market";
|
|
26
|
-
TopLevelActions["VehicleInsights"] = "insights:vehicle";
|
|
27
|
-
TopLevelActions["SettingsAll"] = "settings:*";
|
|
28
|
-
TopLevelActions["VehicleCreate"] = "vehicle:create";
|
|
29
|
-
TopLevelActions["TasksAll"] = "tasks:*";
|
|
30
|
-
TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
|
|
31
|
-
})(TopLevelActions = exports.TopLevelActions || (exports.TopLevelActions = {}));
|
|
32
|
-
exports.SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
|
|
33
|
-
exports.TENANT_ID_ADMIN_HEADER = 'tenant-id';
|
|
34
|
-
exports.SERVICE_ID_ADMIN_HEADER = 'service-id';
|
|
35
|
-
exports.NO_TENANT_ID_VALUE = 'notenant';
|
|
36
|
-
exports.SYSTEM_USER_ID = 'system';
|
|
37
|
-
var BusinessEntityIds;
|
|
38
|
-
(function (BusinessEntityIds) {
|
|
39
|
-
BusinessEntityIds["BecrisDeclarations"] = "becris_declarations";
|
|
40
|
-
BusinessEntityIds["Contacts"] = "contacts";
|
|
41
|
-
BusinessEntityIds["Emails"] = "emails";
|
|
42
|
-
BusinessEntityIds["FinanceDocuments"] = "finance_documents";
|
|
43
|
-
BusinessEntityIds["InternetVehicles"] = "internet-vehicles";
|
|
44
|
-
BusinessEntityIds["LeasingContracts"] = "leasing_contracts";
|
|
45
|
-
BusinessEntityIds["LeasingUploadAutomation"] = "leasing_upload_automation";
|
|
46
|
-
BusinessEntityIds["Opportunities"] = "opportunities";
|
|
47
|
-
BusinessEntityIds["Organizations"] = "organizations";
|
|
48
|
-
BusinessEntityIds["PdfTemplates"] = "pdf_templates";
|
|
49
|
-
BusinessEntityIds["Users"] = "users";
|
|
50
|
-
BusinessEntityIds["Vehicles"] = "vehicles";
|
|
51
|
-
BusinessEntityIds["VehiclesPriceLists"] = "vehicles_price_lists";
|
|
52
|
-
BusinessEntityIds["Debtors"] = "debtors";
|
|
53
|
-
})(BusinessEntityIds = exports.BusinessEntityIds || (exports.BusinessEntityIds = {}));
|
|
54
|
-
exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
|
|
55
|
-
exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
|
|
56
|
-
exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
|
|
57
|
-
exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID = 'leasing_contract_amortization_print_version_template';
|
|
58
|
-
exports.LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';
|
|
59
|
-
exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
|
|
60
|
-
exports.SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';
|
|
61
|
-
exports.SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
|
|
62
|
-
exports.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',
|
|
91
|
-
];
|
|
92
|
-
exports.HEXON_LANG_CODES = [
|
|
93
|
-
'en',
|
|
94
|
-
'nl',
|
|
95
|
-
'de',
|
|
96
|
-
'fr',
|
|
97
|
-
'es',
|
|
98
|
-
'pt',
|
|
99
|
-
'it',
|
|
100
|
-
'pl',
|
|
101
|
-
'ru',
|
|
102
|
-
'ro',
|
|
103
|
-
'el',
|
|
104
|
-
'bg',
|
|
105
|
-
];
|
|
106
|
-
exports.DEFAULT_SLB_PARTNER = 'To be announced';
|
|
107
|
-
//# sourceMappingURL=constants.js.map
|
package/lib/cjs/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":";;;AAGA,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;IAChC,sCAA0B,CAAA;AAC5B,CAAC,EARW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAQnB;AAED,IAAY,eAgBX;AAhBD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,0DAAuC,CAAA;IACvC,uCAAoB,CAAA;IACpB,8DAA2C,CAAA;IAC3C,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,8EAA2D,CAAA;IAC3D,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,qDAAkC,CAAA;IAClC,uDAAoC,CAAA;IACpC,6CAA0B,CAAA;IAC1B,mDAAgC,CAAA;IAChC,uCAAoB,CAAA;IACpB,wDAAqC,CAAA;AACvC,CAAC,EAhBW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAgB1B;AAKY,QAAA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAKpE,QAAA,sBAAsB,GAAG,WAAW,CAAC;AACrC,QAAA,uBAAuB,GAAG,YAAY,CAAC;AAKvC,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,cAAc,GAAG,QAAQ,CAAC;AAKvC,IAAY,iBAeX;AAfD,WAAY,iBAAiB;IAC3B,+DAA0C,CAAA;IAC1C,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,2DAAsC,CAAA;IACtC,2DAAsC,CAAA;IACtC,2DAAsC,CAAA;IACtC,0EAAqD,CAAA;IACrD,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;IAC/B,mDAA8B,CAAA;IAC9B,oCAAe,CAAA;IACf,0CAAqB,CAAA;IACrB,gEAA2C,CAAA;IAC3C,wCAAmB,CAAA;AACrB,CAAC,EAfW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAe5B;AAKY,QAAA,+BAA+B,GAAG,wBAAwB,CAAC;AAC3D,QAAA,wCAAwC,GAAG,iCAAiC,CAAC;AAC7E,QAAA,+CAA+C,GAC1D,wCAAwC,CAAC;AAC9B,QAAA,6DAA6D,GACxE,sDAAsD,CAAC;AAC5C,QAAA,+BAA+B,GAAG,iCAAiC,CAAC;AACpE,QAAA,qCAAqC,GAAG,8BAA8B,CAAC;AACvE,QAAA,sCAAsC,GAAG,+BAA+B,CAAC;AACzE,QAAA,uCAAuC,GAAG,gCAAgC,CAAC;AAK3E,QAAA,oBAAoB,GAAG;IAClC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,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;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;AAEW,QAAA,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n AppManager = 'app_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsBrowse = 'docs:finance:browse',\n LeadsAll = 'leads:*',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n VehicleInsights = 'insights:vehicle',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n TrackAndTraceDevices = 'tt:devices:*',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n FinanceDocuments = 'finance_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
|
package/lib/cjs/dayjs-utils.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.businessDaysAdd = exports.isBetween = exports.isSameOrBefore = exports.isSameOrAfter = exports.utc = exports.tz = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
6
|
-
const dayjs_business_days_1 = tslib_1.__importDefault(require("dayjs-business-days"));
|
|
7
|
-
const customParseFormat_1 = tslib_1.__importDefault(require("dayjs/plugin/customParseFormat"));
|
|
8
|
-
const isoWeek_1 = tslib_1.__importDefault(require("dayjs/plugin/isoWeek"));
|
|
9
|
-
const timezone_1 = tslib_1.__importDefault(require("dayjs/plugin/timezone"));
|
|
10
|
-
const utc_1 = tslib_1.__importDefault(require("dayjs/plugin/utc"));
|
|
11
|
-
dayjs_1.default.extend(dayjs_business_days_1.default);
|
|
12
|
-
dayjs_1.default.extend(isoWeek_1.default);
|
|
13
|
-
dayjs_1.default.extend(customParseFormat_1.default);
|
|
14
|
-
dayjs_1.default.extend(utc_1.default);
|
|
15
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
16
|
-
exports.tz = dayjs_1.default.tz;
|
|
17
|
-
exports.utc = dayjs_1.default.utc;
|
|
18
|
-
const isSameOrAfter = (value, reference) => value.isAfter(reference) || value.isSame(reference);
|
|
19
|
-
exports.isSameOrAfter = isSameOrAfter;
|
|
20
|
-
const isSameOrBefore = (value, reference) => value.isBefore(reference) || value.isSame(reference);
|
|
21
|
-
exports.isSameOrBefore = isSameOrBefore;
|
|
22
|
-
const isBetween = (value, startInclusive, endExclusive) => (0, exports.isSameOrAfter)(value, startInclusive) && value.isBefore(endExclusive);
|
|
23
|
-
exports.isBetween = isBetween;
|
|
24
|
-
const businessDaysAdd = (value, days) => value.businessDaysAdd(days);
|
|
25
|
-
exports.businessDaysAdd = businessDaysAdd;
|
|
26
|
-
//# sourceMappingURL=dayjs-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs-utils.js","sourceRoot":"/","sources":["dayjs-utils.ts"],"names":[],"mappings":";;;;AAAA,0DAAqC;AACrC,sFAAoD;AACpD,+FAA+D;AAC/D,2EAA2C;AAC3C,6EAA6C;AAC7C,mEAAwC;AAExC,eAAK,CAAC,MAAM,CAAC,6BAAiB,CAAC,CAAC;AAChC,eAAK,CAAC,MAAM,CAAC,iBAAO,CAAC,CAAC;AACtB,eAAK,CAAC,MAAM,CAAC,2BAAiB,CAAC,CAAC;AAChC,eAAK,CAAC,MAAM,CAAC,aAAQ,CAAC,CAAC;AACvB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAIV,QAAA,EAAE,GAAG,eAAK,CAAC,EAAE,CAAC;AAEd,QAAA,GAAG,GAAG,eAAK,CAAC,GAAG,CAAC;AAEtB,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACvE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AADzC,QAAA,aAAa,iBAC4B;AAE/C,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACxE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAD1C,QAAA,cAAc,kBAC4B;AAEhD,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,cAAqB,EAAE,YAAmB,EAAW,EAAE,CAC7F,IAAA,qBAAa,EAAC,KAAK,EAAE,cAAc,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAD1D,QAAA,SAAS,aACiD;AAEhE,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,IAAY,EAAS,EAAE,CAClE,KAAa,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAD1B,QAAA,eAAe,mBACW","sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\nimport dayjsBusinessDays from 'dayjs-business-days';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport IsoWeek from 'dayjs/plugin/isoWeek';\nimport timezone from 'dayjs/plugin/timezone';\nimport dayjsUtc from 'dayjs/plugin/utc';\n\ndayjs.extend(dayjsBusinessDays);\ndayjs.extend(IsoWeek);\ndayjs.extend(customParseFormat);\ndayjs.extend(dayjsUtc);\ndayjs.extend(timezone);\n\n// Exists only to make Typescript happy, otherwise the build would fail with\n// \"Property 'tz' does not exist on type 'Dayjs'\"\nexport const tz = dayjs.tz;\n\nexport const utc = dayjs.utc;\n\nexport const isSameOrAfter = (value: Dayjs, reference: Dayjs): boolean =>\n value.isAfter(reference) || value.isSame(reference);\n\nexport const isSameOrBefore = (value: Dayjs, reference: Dayjs): boolean =>\n value.isBefore(reference) || value.isSame(reference);\n\nexport const isBetween = (value: Dayjs, startInclusive: Dayjs, endExclusive: Dayjs): boolean =>\n isSameOrAfter(value, startInclusive) && value.isBefore(endExclusive);\n\nexport const businessDaysAdd = (value: Dayjs, days: number): Dayjs =>\n (value as any).businessDaysAdd(days);\n"]}
|
package/lib/cjs/discussions.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discussions.js","sourceRoot":"/","sources":["discussions.ts"],"names":[],"mappings":";;;AAqCa,QAAA,2BAA2B,GAAG,SAAS,CAAC","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport type Discussion = {\n businessEntityId: BusinessEntityIds;\n createdAt: string;\n followers: string[];\n id: string;\n recordId: string;\n title?: string;\n};\n\nexport type DiscussionData = {\n discussion: Discussion;\n messages: Message[];\n};\n\nexport type NewDiscussion = {\n businessEntityId: BusinessEntityIds;\n content: MessageContent;\n recordId: string;\n title?: string;\n followers: string[];\n};\n\nexport type Message = {\n author: string;\n content?: MessageContent; // optional if the content is deleted\n createdAt: string;\n deletedAt?: string;\n id: string;\n};\n\nexport type MessageContent = {\n value: string;\n mentions: string[];\n};\n\nexport const MESSAGE_NOTIFICATION_ORIGIN = 'message';\n\nexport type MessageNotificationData = {\n snippet: string;\n id: string;\n mention?: boolean;\n};\n\nexport type NewDiscussionEvent = {\n discussion: NewDiscussion;\n tenantId: string;\n author: string;\n};\n"]}
|
package/lib/cjs/errors.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnauthorizedError = exports.InvalidArgumentsError = exports.EntryAlreadyExistsError = exports.ForbiddenError = exports.AsyncStopError = exports.WrappedError = exports.XError = void 0;
|
|
4
|
-
class XError extends Error {
|
|
5
|
-
constructor(message, errorCtx) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'XError';
|
|
8
|
-
this.errorCtx = errorCtx;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.XError = XError;
|
|
12
|
-
class WrappedError extends Error {
|
|
13
|
-
constructor(err, errorCtx) {
|
|
14
|
-
super(err.message);
|
|
15
|
-
this.name = err.name;
|
|
16
|
-
this.stack = err.stack;
|
|
17
|
-
this.errorCtx = errorCtx;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.WrappedError = WrappedError;
|
|
21
|
-
class AsyncStopError extends Error {
|
|
22
|
-
constructor(message) {
|
|
23
|
-
super(message);
|
|
24
|
-
this.name = 'AsyncStopError';
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.AsyncStopError = AsyncStopError;
|
|
28
|
-
class ForbiddenError extends Error {
|
|
29
|
-
constructor(message) {
|
|
30
|
-
super(message);
|
|
31
|
-
this.name = 'ForbiddenError';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.ForbiddenError = ForbiddenError;
|
|
35
|
-
class EntryAlreadyExistsError extends Error {
|
|
36
|
-
constructor(message) {
|
|
37
|
-
super(message);
|
|
38
|
-
this.name = 'EntryAlreadyExistsError';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.EntryAlreadyExistsError = EntryAlreadyExistsError;
|
|
42
|
-
class InvalidArgumentsError extends Error {
|
|
43
|
-
constructor(message, errors, errorCtx) {
|
|
44
|
-
super(message);
|
|
45
|
-
this.isValidation = true;
|
|
46
|
-
this.name = 'InvalidArgumentsError';
|
|
47
|
-
this.errorCtx = errorCtx;
|
|
48
|
-
if (errors != null) {
|
|
49
|
-
this.validationErrors = {
|
|
50
|
-
errors: errors.details.map(({ path, type, message }) => ({
|
|
51
|
-
message,
|
|
52
|
-
path,
|
|
53
|
-
type: type === 'custom' ? message : type,
|
|
54
|
-
})),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.InvalidArgumentsError = InvalidArgumentsError;
|
|
60
|
-
class UnauthorizedError extends Error {
|
|
61
|
-
constructor(message) {
|
|
62
|
-
super(message);
|
|
63
|
-
this.name = 'UnauthorizedError';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.UnauthorizedError = UnauthorizedError;
|
|
67
|
-
//# sourceMappingURL=errors.js.map
|
package/lib/cjs/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":";;;AAEA,MAAa,MAAO,SAAQ,KAAK;IAG/B,YAAY,OAAgB,EAAE,QAAc;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AARD,wBAQC;AAED,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,GAAU,EAAE,QAAc;QACpC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AATD,oCASC;AAED,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAED,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAED,MAAa,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AALD,0DAKC;AAOD,MAAa,qBAAsB,SAAQ,KAAK;IAK9C,YAAY,OAAgB,EAAE,MAAwB,EAAE,QAAc;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,iBAAY,GAAG,IAAI,CAAC;QAKlB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,gBAAgB,GAAG;gBACtB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAuB,EAAwB,EAAE,CAAC,CAAC;oBACvE,OAAO;oBACP,IAAI;oBACJ,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;iBACzC,CAAC,CACH;aACF,CAAC;SACH;IACH,CAAC;CACF;AAtBD,sDAsBC;AAED,MAAa,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,8CAKC","sourcesContent":["import { ValidationError, ValidationErrorItem } from 'joi';\n\nexport class XError extends Error {\n errorCtx: any;\n\n constructor(message?: string, errorCtx?: any) {\n super(message);\n this.name = 'XError';\n this.errorCtx = errorCtx;\n }\n}\n\nexport class WrappedError extends Error {\n errorCtx: any;\n\n constructor(err: Error, errorCtx?: any) {\n super(err.message);\n this.name = err.name;\n this.stack = err.stack;\n this.errorCtx = errorCtx;\n }\n}\n\nexport class AsyncStopError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'AsyncStopError';\n }\n}\n\nexport class ForbiddenError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'ForbiddenError';\n }\n}\n\nexport class EntryAlreadyExistsError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'EntryAlreadyExistsError';\n }\n}\n\ntype FieldValidationError = {\n message: string;\n path: Array<string | number>;\n type: string;\n};\nexport class InvalidArgumentsError extends Error {\n validationErrors?: { errors: FieldValidationError[] };\n isValidation = true;\n errorCtx: any;\n\n constructor(message?: string, errors?: ValidationError, errorCtx?: any) {\n super(message);\n this.name = 'InvalidArgumentsError';\n this.errorCtx = errorCtx;\n\n if (errors != null) {\n this.validationErrors = {\n errors: errors.details.map(\n ({ path, type, message }: ValidationErrorItem): FieldValidationError => ({\n message,\n path,\n type: type === 'custom' ? message : type,\n })\n ),\n };\n }\n }\n}\n\nexport class UnauthorizedError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'UnauthorizedError';\n }\n}\n"]}
|
package/lib/cjs/exact.js
DELETED
package/lib/cjs/exact.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export type NewExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n exactTld: string;\n};\n\nexport type ExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n lastAuthenticatedAt?: string;\n expiresAt?: string;\n exactTld: string;\n authenticated: boolean;\n};\n"]}
|
package/lib/cjs/fetch.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cleanHeaders = exports.getTenantIdHeader = exports.getAdminAuth = exports.fetchJson = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
-
const constants_1 = require("./constants");
|
|
7
|
-
const errors_1 = require("./errors");
|
|
8
|
-
const fetchJson = async (url, init) => {
|
|
9
|
-
url = url.toString().replace(/([^:]\/)\/+/g, '$1');
|
|
10
|
-
const response = await (0, node_fetch_1.default)(url, init);
|
|
11
|
-
if (!response.ok) {
|
|
12
|
-
const body = await response.text();
|
|
13
|
-
throw new errors_1.XError(response.statusText, {
|
|
14
|
-
url,
|
|
15
|
-
body: init?.body,
|
|
16
|
-
response: body,
|
|
17
|
-
status: response.status,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return response.status === 200 ? response.json() : undefined;
|
|
21
|
-
};
|
|
22
|
-
exports.fetchJson = fetchJson;
|
|
23
|
-
const getAdminAuth = async () => {
|
|
24
|
-
if (!process.env.ADMIN_KEY) {
|
|
25
|
-
return '';
|
|
26
|
-
}
|
|
27
|
-
return `AdminKey ${process.env.ADMIN_KEY}`;
|
|
28
|
-
};
|
|
29
|
-
exports.getAdminAuth = getAdminAuth;
|
|
30
|
-
const getTenantIdHeader = (headers) => {
|
|
31
|
-
const tenantId = headers[constants_1.TENANT_ID_ADMIN_HEADER];
|
|
32
|
-
if (!tenantId || typeof tenantId !== 'string') {
|
|
33
|
-
throw new errors_1.InvalidArgumentsError('Missing or invalid tenantId');
|
|
34
|
-
}
|
|
35
|
-
return tenantId;
|
|
36
|
-
};
|
|
37
|
-
exports.getTenantIdHeader = getTenantIdHeader;
|
|
38
|
-
const cleanHeaders = (headers) => Object.entries(headers).filter((h) => h[1] != null);
|
|
39
|
-
exports.cleanHeaders = cleanHeaders;
|
|
40
|
-
//# sourceMappingURL=fetch.js.map
|
package/lib/cjs/fetch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":";;;;AACA,oEAAuE;AAEvE,2CAAqD;AACrD,qCAAyD;AAElD,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAsB,EACtB,IAAkB,EACM,EAAE;IAE1B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAa,MAAM,IAAA,oBAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,eAAM,CAAC,QAAQ,CAAC,UAAU,EAAE;YACpC,GAAG;YACH,IAAI,EAAE,IAAI,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC,CAAC;KACJ;IAED,OAAO,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC,CAAC;AApBW,QAAA,SAAS,aAoBpB;AAEK,MAAM,YAAY,GAAG,KAAK,IAAqB,EAAE;IACtD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE;QAC1B,OAAO,EAAE,CAAC;KACX;IAED,OAAO,YAAY,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;AAC7C,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB;AAEK,MAAM,iBAAiB,GAAG,CAAC,OAAoC,EAAU,EAAE;IAChF,MAAM,QAAQ,GAAG,OAAO,CAAC,kCAAsB,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAC7C,MAAM,IAAI,8BAAqB,CAAC,6BAA6B,CAAC,CAAC;KAChE;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B;AAEK,MAAM,YAAY,GAAG,CAAC,OAA8C,EAAe,EAAE,CAC1F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;AADhE,QAAA,YAAY,gBACoD","sourcesContent":["import type { HeadersInit } from 'node-fetch';\nimport fetch, { RequestInfo, RequestInit, Response } from 'node-fetch';\nimport type { URL } from 'node:url';\nimport { TENANT_ID_ADMIN_HEADER } from './constants';\nimport { InvalidArgumentsError, XError } from './errors';\n\nexport const fetchJson = async <T>(\n url: URL | RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\n // sometimes the origin ends with a slash and when we append the path it gets a double slash\n url = url.toString().replace(/([^:]\\/)\\/+/g, '$1');\n\n const response: Response = await fetch(url, init);\n\n if (!response.ok) {\n const body = await response.text();\n throw new XError(response.statusText, {\n url,\n body: init?.body,\n response: body,\n status: response.status,\n });\n }\n\n return response.status === 200 ? (response.json() as Promise<T>) : undefined;\n};\n\nexport const getAdminAuth = async (): Promise<string> => {\n if (!process.env.ADMIN_KEY) {\n return '';\n }\n\n return `AdminKey ${process.env.ADMIN_KEY}`;\n};\n\nexport const getTenantIdHeader = (headers: { [name: string]: unknown }): string => {\n const tenantId = headers[TENANT_ID_ADMIN_HEADER];\n if (!tenantId || typeof tenantId !== 'string') {\n throw new InvalidArgumentsError('Missing or invalid tenantId');\n }\n\n return tenantId;\n};\n\nexport const cleanHeaders = (headers: { [key: string]: string | undefined }): HeadersInit =>\n Object.entries(headers).filter((h): h is [string, string] => h[1] != null);\n"]}
|
package/lib/cjs/formatting.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatCurrency = exports.joinWithSeparator = void 0;
|
|
4
|
-
const DEFAULT_SEPARATOR = ' • ';
|
|
5
|
-
const joinWithSeparator = (text, { separator = DEFAULT_SEPARATOR, filter = Boolean, } = {}) => text.filter(filter).join(separator);
|
|
6
|
-
exports.joinWithSeparator = joinWithSeparator;
|
|
7
|
-
const formatCurrency = (amount, locale = 'de-DE', showCurrencySign = false, options = { currency: 'EUR' }) => {
|
|
8
|
-
return new Intl.NumberFormat(locale, {
|
|
9
|
-
minimumFractionDigits: 2,
|
|
10
|
-
maximumFractionDigits: 2,
|
|
11
|
-
style: 'currency',
|
|
12
|
-
useGrouping: true,
|
|
13
|
-
...options,
|
|
14
|
-
})
|
|
15
|
-
.formatToParts(Number(amount))
|
|
16
|
-
.map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))
|
|
17
|
-
.join('');
|
|
18
|
-
};
|
|
19
|
-
exports.formatCurrency = formatCurrency;
|
|
20
|
-
//# sourceMappingURL=formatting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.js","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEzB,MAAM,iBAAiB,GAAG,CAC/B,IAA4C,EAC5C,EACE,SAAS,GAAG,iBAAiB,EAC7B,MAAM,GAAG,OAAO,MAC4C,EAAE,EAChE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAN5B,QAAA,iBAAiB,qBAMW;AAElC,MAAM,cAAc,GAAG,CAC5B,MAAc,EACd,MAAM,GAAG,OAAO,EAChB,gBAAgB,GAAG,KAAK,EACxB,UAAoC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAC/C,EAAE;IACV,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACnC,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;QACxB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,IAAI;QACjB,GAAG,OAAO;KACX,CAAC;SACC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9F,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB","sourcesContent":["const DEFAULT_SEPARATOR = ' • ';\n\nexport const joinWithSeparator = (\n text: (string | number | undefined | null)[],\n {\n separator = DEFAULT_SEPARATOR,\n filter = Boolean,\n }: { separator?: string; filter?: (value: any) => boolean } = {}\n) => text.filter(filter).join(separator);\n\nexport const formatCurrency = (\n amount: string,\n locale = 'de-DE',\n showCurrencySign = false,\n options: Intl.NumberFormatOptions = { currency: 'EUR' }\n): string => {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n style: 'currency',\n useGrouping: true,\n ...options,\n })\n .formatToParts(Number(amount))\n .map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))\n .join('');\n};\n"]}
|
package/lib/cjs/ids.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateId = exports.Alphabet = void 0;
|
|
4
|
-
const nanoid_1 = require("nanoid");
|
|
5
|
-
var Alphabet;
|
|
6
|
-
(function (Alphabet) {
|
|
7
|
-
Alphabet["Full"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
|
|
8
|
-
Alphabet["Alphanumeric"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
9
|
-
Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
|
|
10
|
-
Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
11
|
-
Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
|
|
12
|
-
})(Alphabet = exports.Alphabet || (exports.Alphabet = {}));
|
|
13
|
-
const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
|
|
14
|
-
const nanoid = (0, nanoid_1.customAlphabet)(alphabet, idLength);
|
|
15
|
-
while (true) {
|
|
16
|
-
const id = nanoid();
|
|
17
|
-
if (isValid(id)) {
|
|
18
|
-
return id;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.generateId = generateId;
|
|
23
|
-
const isValid = (id) => {
|
|
24
|
-
if (!Number.isNaN(Number.parseInt(id[0]))) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
if (id.endsWith('_') || id.startsWith('_')) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
if (id.includes('__')) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return true;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=ids.js.map
|
package/lib/cjs/ids.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"/","sources":["ids.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB;AAIM,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,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","sourcesContent":["import { customAlphabet } from 'nanoid';\n\nexport enum Alphabet {\n Full = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_',\n Alphanumeric = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n Lowercase = 'abcdefghijklmnopqrstuvwxyz',\n LowerAlphanumeric = '0123456789abcdefghijklmnopqrstuvwxyz',\n ReferenceCode = '123456789ABCDEFGHJKMNPQRSTUVWXYZ',\n}\n\n// The ID can contain only alphabets and numbers and underscore.\n// The ID should start with an alphabet and should not have two consecutive underscores or end with an underscore.\nexport const generateId = (idLength: number = 15, alphabet: Alphabet = Alphabet.Full): string => {\n const nanoid = customAlphabet(alphabet, idLength);\n while (true) {\n const id = nanoid();\n if (isValid(id)) {\n return id;\n }\n }\n};\n\nconst isValid = (id: string): boolean => {\n if (!Number.isNaN(Number.parseInt(id[0]))) {\n return false;\n }\n\n if (id.endsWith('_') || id.startsWith('_')) {\n return false;\n }\n\n if (id.includes('__')) {\n return false;\n }\n\n return true;\n};\n"]}
|
package/lib/cjs/insurance.js
DELETED
package/lib/cjs/insurance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insurance.js","sourceRoot":"/","sources":["insurance.ts"],"names":[],"mappings":"","sourcesContent":["export type InsuranceEntry = {\n checkedAt: string;\n insured: boolean;\n};\n\nexport type InsuranceCheckEvent = {\n contractId: string;\n tenantId: string;\n vin: string;\n licensePlate?: string;\n};\n\nexport type InsuranceCheckResponseEvent = InsuranceCheckEvent & {\n insurance: InsuranceEntry;\n};\n\nexport type InsuranceHistoryRequest = {\n contractId: string;\n tenantId: string;\n limit?: number;\n nextToken?: string;\n};\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFormatedAddressFromLocationValue = exports.getAddressText = void 0;
|
|
4
|
-
const getAddressText = (address, joinBy = '<br>') => {
|
|
5
|
-
const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]
|
|
6
|
-
.filter((n) => !!n)
|
|
7
|
-
.join(', ');
|
|
8
|
-
const filteredParts = [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n);
|
|
9
|
-
if (filteredParts.length === 0) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
return filteredParts.join(joinBy);
|
|
13
|
-
};
|
|
14
|
-
exports.getAddressText = getAddressText;
|
|
15
|
-
const getFormatedAddressFromLocationValue = (location) => {
|
|
16
|
-
const PARTS_JOINER = ', ';
|
|
17
|
-
const address = (0, exports.getAddressText)(location, PARTS_JOINER);
|
|
18
|
-
return address;
|
|
19
|
-
};
|
|
20
|
-
exports.getFormatedAddressFromLocationValue = getFormatedAddressFromLocationValue;
|
|
21
|
-
//# sourceMappingURL=location-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,SAAiB,MAAM,EACH,EAAE;IACtB,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;SAClF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,aAAa,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,MAAM,CACpF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CACX,CAAC;IAEF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;QAC9B,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAhBW,QAAA,cAAc,kBAgBzB;AAEK,MAAM,mCAAmC,GAAG,CACjD,QAAuB,EACH,EAAE;IACtB,MAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEvD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import { LocationValue } from './types';\n\nexport const getAddressText = (\n address: LocationValue,\n joinBy: string = '<br>'\n): string | undefined => {\n const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]\n .filter((n) => !!n)\n .join(', ');\n\n const filteredParts = [address.addressLine1, address.addressLine2, regionLines].filter(\n (n) => !!n\n );\n\n if (filteredParts.length === 0) {\n return undefined;\n }\n return filteredParts.join(joinBy);\n};\n\nexport const getFormatedAddressFromLocationValue = (\n location: LocationValue\n): string | undefined => {\n const PARTS_JOINER = ', ';\n const address = getAddressText(location, PARTS_JOINER);\n\n return address;\n};\n"]}
|
package/lib/cjs/locations.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEuropeanCountry = exports.isEUCountry = exports.RouteLabel = void 0;
|
|
4
|
-
var RouteLabel;
|
|
5
|
-
(function (RouteLabel) {
|
|
6
|
-
RouteLabel["Unspecified"] = "ROUTE_LABEL_UNSPECIFIED";
|
|
7
|
-
RouteLabel["Default"] = "DEFAULT_ROUTE";
|
|
8
|
-
RouteLabel["DefaultAlternate"] = "DEFAULT_ROUTE_ALTERNATE";
|
|
9
|
-
RouteLabel["FuelEfficient"] = "FUEL_EFFICIENT";
|
|
10
|
-
})(RouteLabel = exports.RouteLabel || (exports.RouteLabel = {}));
|
|
11
|
-
const isEUCountry = (country) => [
|
|
12
|
-
'AT',
|
|
13
|
-
'BE',
|
|
14
|
-
'BG',
|
|
15
|
-
'CY',
|
|
16
|
-
'CZ',
|
|
17
|
-
'DE',
|
|
18
|
-
'DK',
|
|
19
|
-
'EE',
|
|
20
|
-
'ES',
|
|
21
|
-
'FI',
|
|
22
|
-
'FR',
|
|
23
|
-
'GR',
|
|
24
|
-
'HR',
|
|
25
|
-
'HU',
|
|
26
|
-
'IE',
|
|
27
|
-
'IT',
|
|
28
|
-
'LT',
|
|
29
|
-
'LU',
|
|
30
|
-
'LV',
|
|
31
|
-
'MT',
|
|
32
|
-
'NL',
|
|
33
|
-
'PL',
|
|
34
|
-
'PT',
|
|
35
|
-
'RO',
|
|
36
|
-
'SE',
|
|
37
|
-
'SI',
|
|
38
|
-
'SK',
|
|
39
|
-
].includes(country.toUpperCase());
|
|
40
|
-
exports.isEUCountry = isEUCountry;
|
|
41
|
-
const isEuropeanCountry = (country) => [
|
|
42
|
-
'AL',
|
|
43
|
-
'AD',
|
|
44
|
-
'AM',
|
|
45
|
-
'AT',
|
|
46
|
-
'AZ',
|
|
47
|
-
'BY',
|
|
48
|
-
'BE',
|
|
49
|
-
'BA',
|
|
50
|
-
'BG',
|
|
51
|
-
'HR',
|
|
52
|
-
'CY',
|
|
53
|
-
'CZ',
|
|
54
|
-
'DK',
|
|
55
|
-
'EE',
|
|
56
|
-
'FO',
|
|
57
|
-
'FI',
|
|
58
|
-
'FR',
|
|
59
|
-
'GE',
|
|
60
|
-
'DE',
|
|
61
|
-
'GI',
|
|
62
|
-
'GR',
|
|
63
|
-
'HU',
|
|
64
|
-
'IS',
|
|
65
|
-
'IE',
|
|
66
|
-
'IT',
|
|
67
|
-
'KZ',
|
|
68
|
-
'XK',
|
|
69
|
-
'LV',
|
|
70
|
-
'LI',
|
|
71
|
-
'LT',
|
|
72
|
-
'LU',
|
|
73
|
-
'MK',
|
|
74
|
-
'MT',
|
|
75
|
-
'MD',
|
|
76
|
-
'MC',
|
|
77
|
-
'ME',
|
|
78
|
-
'NL',
|
|
79
|
-
'NO',
|
|
80
|
-
'PL',
|
|
81
|
-
'PT',
|
|
82
|
-
'RO',
|
|
83
|
-
'RU',
|
|
84
|
-
'SM',
|
|
85
|
-
'RS',
|
|
86
|
-
'SK',
|
|
87
|
-
'SI',
|
|
88
|
-
'ES',
|
|
89
|
-
'SE',
|
|
90
|
-
'CH',
|
|
91
|
-
'UA',
|
|
92
|
-
'GB',
|
|
93
|
-
].includes(country.toUpperCase());
|
|
94
|
-
exports.isEuropeanCountry = isEuropeanCountry;
|
|
95
|
-
//# sourceMappingURL=locations.js.map
|
package/lib/cjs/locations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":";;;AAqBA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,0DAA4C,CAAA;IAC5C,8CAAgC,CAAA;AAClC,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAYM,MAAM,WAAW,GAAG,CAAC,OAAe,EAAW,EAAE,CACtD;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,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,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AA7BvB,QAAA,WAAW,eA6BY;AAE7B,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAW,EAAE,CAC5D;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,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,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AArDvB,QAAA,iBAAiB,qBAqDM","sourcesContent":["export type GPSCoord = {\n lat: number;\n lon: number;\n alt?: number;\n gMapsZoom?: number;\n};\n\nexport type LocationValue = {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n postalCode?: string;\n gps?: GPSCoord;\n};\n\nexport type RoutesRequest = {\n origin: LocationValue;\n destination: LocationValue;\n};\n\nexport enum RouteLabel {\n Unspecified = 'ROUTE_LABEL_UNSPECIFIED',\n Default = 'DEFAULT_ROUTE',\n DefaultAlternate = 'DEFAULT_ROUTE_ALTERNATE',\n FuelEfficient = 'FUEL_EFFICIENT',\n}\n\nexport type Route = {\n duration: string;\n distanceMeters: number;\n routeLabels: RouteLabel[];\n};\n\nexport type RoutesResponse = {\n routes: Route[];\n};\n\nexport const isEUCountry = (country: string): boolean =>\n [\n 'AT',\n 'BE',\n 'BG',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GR',\n 'HR',\n 'HU',\n 'IE',\n 'IT',\n 'LT',\n 'LU',\n 'LV',\n 'MT',\n 'NL',\n 'PL',\n 'PT',\n 'RO',\n 'SE',\n 'SI',\n 'SK',\n ].includes(country.toUpperCase());\n\nexport const isEuropeanCountry = (country: string): boolean =>\n [\n 'AL',\n 'AD',\n 'AM',\n 'AT',\n 'AZ',\n 'BY',\n 'BE',\n 'BA',\n 'BG',\n 'HR',\n 'CY',\n 'CZ',\n 'DK',\n 'EE',\n 'FO',\n 'FI',\n 'FR',\n 'GE',\n 'DE',\n 'GI',\n 'GR',\n 'HU',\n 'IS',\n 'IE',\n 'IT',\n 'KZ',\n 'XK',\n 'LV',\n 'LI',\n 'LT',\n 'LU',\n 'MK',\n 'MT',\n 'MD',\n 'MC',\n 'ME',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SM',\n 'RS',\n 'SK',\n 'SI',\n 'ES',\n 'SE',\n 'CH',\n 'UA',\n 'GB',\n ].includes(country.toUpperCase());\n\n//I want the isEuropeanCountry but with countries in lowercase\n"]}
|
package/lib/cjs/messages.js
DELETED
package/lib/cjs/messages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
|
package/lib/cjs/notifications.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationsFilter = exports.NotificationVisibility = exports.GroupableNotificationOrigin = void 0;
|
|
4
|
-
var GroupableNotificationOrigin;
|
|
5
|
-
(function (GroupableNotificationOrigin) {
|
|
6
|
-
GroupableNotificationOrigin["Message"] = "message";
|
|
7
|
-
})(GroupableNotificationOrigin = exports.GroupableNotificationOrigin || (exports.GroupableNotificationOrigin = {}));
|
|
8
|
-
var NotificationVisibility;
|
|
9
|
-
(function (NotificationVisibility) {
|
|
10
|
-
NotificationVisibility["UNREAD"] = "unread";
|
|
11
|
-
NotificationVisibility["READ"] = "read";
|
|
12
|
-
})(NotificationVisibility = exports.NotificationVisibility || (exports.NotificationVisibility = {}));
|
|
13
|
-
var NotificationsFilter;
|
|
14
|
-
(function (NotificationsFilter) {
|
|
15
|
-
NotificationsFilter["Unread"] = "unread";
|
|
16
|
-
NotificationsFilter["Archived"] = "archived";
|
|
17
|
-
})(NotificationsFilter = exports.NotificationsFilter || (exports.NotificationsFilter = {}));
|
|
18
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":";;;AAEA,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAEtC;AACD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC;AAoDD,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport enum GroupableNotificationOrigin {\n Message = 'message',\n}\nexport enum NotificationVisibility {\n UNREAD = 'unread',\n READ = 'read',\n}\n\ntype BaseMeta = {\n snippet?: string;\n};\n\nexport type NewNotificationsEvent<T extends BaseMeta = BaseMeta> = {\n tenantId: string;\n notifications: NewNotification<T>[];\n};\n\ntype BaseNotification<T extends BaseMeta = BaseMeta> = {\n sourceId: string; // userId\n destinationId: string; // userId\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n meta: T;\n origin: string;\n};\n\nexport type NewNotification<T extends BaseMeta = BaseMeta> = BaseNotification<T>;\n\nexport type Notification<T extends BaseMeta = BaseMeta> = BaseNotification<T> & {\n id: string;\n createdAt: string;\n visibility: NotificationVisibility;\n archived: boolean;\n};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationArchiveUpdates = {\n notificationIds: string[];\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationsInfo = NotificationsStats & {\n externalPushAppId?: string;\n};\n\nexport type NotificationsStats = {\n unreadCount: number;\n unseen: boolean;\n latestSeenAt?: string;\n latestNotificationAt?: string;\n};\n\nexport enum NotificationsFilter {\n Unread = 'unread',\n Archived = 'archived',\n}\n\nexport type NotificationsQuery = {\n limit?: number;\n filter?: NotificationsFilter;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
|
package/lib/cjs/pdf-gen.js
DELETED
package/lib/cjs/pdf-gen.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants';\nimport { AttachmentValue } from './types';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n"]}
|
package/lib/cjs/servers.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getServerPort = exports.LambdaServer = void 0;
|
|
4
|
-
var LambdaServer;
|
|
5
|
-
(function (LambdaServer) {
|
|
6
|
-
LambdaServer[LambdaServer["HYPERPORTAL_SYNC"] = 0] = "HYPERPORTAL_SYNC";
|
|
7
|
-
LambdaServer[LambdaServer["CORE"] = 1] = "CORE";
|
|
8
|
-
LambdaServer[LambdaServer["CUSTOMER_MANAGEMENT"] = 2] = "CUSTOMER_MANAGEMENT";
|
|
9
|
-
LambdaServer[LambdaServer["MIGRATIONS"] = 3] = "MIGRATIONS";
|
|
10
|
-
LambdaServer[LambdaServer["NOTIFICATIONS"] = 4] = "NOTIFICATIONS";
|
|
11
|
-
LambdaServer[LambdaServer["DISCUSSIONS"] = 5] = "DISCUSSIONS";
|
|
12
|
-
LambdaServer[LambdaServer["PDF_GEN"] = 6] = "PDF_GEN";
|
|
13
|
-
LambdaServer[LambdaServer["MACHINES"] = 7] = "MACHINES";
|
|
14
|
-
LambdaServer[LambdaServer["INSURANCE_CHECK"] = 8] = "INSURANCE_CHECK";
|
|
15
|
-
LambdaServer[LambdaServer["EXACT"] = 9] = "EXACT";
|
|
16
|
-
LambdaServer[LambdaServer["STORAGE"] = 10] = "STORAGE";
|
|
17
|
-
LambdaServer[LambdaServer["BECRIS"] = 11] = "BECRIS";
|
|
18
|
-
LambdaServer[LambdaServer["TRACK_AND_TRACE"] = 12] = "TRACK_AND_TRACE";
|
|
19
|
-
LambdaServer[LambdaServer["TASKS"] = 13] = "TASKS";
|
|
20
|
-
})(LambdaServer = exports.LambdaServer || (exports.LambdaServer = {}));
|
|
21
|
-
const getServerPort = (server) => 2000 +
|
|
22
|
-
Object.values(LambdaServer)
|
|
23
|
-
.filter((v) => typeof v === 'number')
|
|
24
|
-
.indexOf(server);
|
|
25
|
-
exports.getServerPort = getServerPort;
|
|
26
|
-
//# sourceMappingURL=servers.js.map
|
package/lib/cjs/servers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"servers.js","sourceRoot":"/","sources":["servers.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,uEAAgB,CAAA;IAChB,+CAAI,CAAA;IACJ,6EAAmB,CAAA;IACnB,2DAAU,CAAA;IACV,iEAAa,CAAA;IACb,6DAAW,CAAA;IACX,qDAAO,CAAA;IACP,uDAAQ,CAAA;IACR,qEAAe,CAAA;IACf,iDAAK,CAAA;IACL,sDAAO,CAAA;IACP,oDAAM,CAAA;IACN,sEAAe,CAAA;IACf,kDAAK,CAAA;AACP,CAAC,EAfW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAevB;AAEM,MAAM,aAAa,GAAG,CAAC,MAAoB,EAAU,EAAE,CAC5D,IAAI;IACJ,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;SACxB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;SACpC,OAAO,CAAC,MAAM,CAAC,CAAC;AAJR,QAAA,aAAa,iBAIL","sourcesContent":["export enum LambdaServer {\n HYPERPORTAL_SYNC,\n CORE,\n CUSTOMER_MANAGEMENT,\n MIGRATIONS,\n NOTIFICATIONS,\n DISCUSSIONS,\n PDF_GEN,\n MACHINES,\n INSURANCE_CHECK,\n EXACT,\n STORAGE,\n BECRIS,\n TRACK_AND_TRACE,\n TASKS,\n}\n\nexport const getServerPort = (server: LambdaServer): number =>\n 2000 +\n Object.values(LambdaServer)\n .filter((v) => typeof v === 'number')\n .indexOf(server);\n"]}
|
package/lib/cjs/storage.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MediaExportResolution = exports.UploadProviders = void 0;
|
|
4
|
-
var UploadProviders;
|
|
5
|
-
(function (UploadProviders) {
|
|
6
|
-
UploadProviders["Vimeo"] = "vimeo";
|
|
7
|
-
UploadProviders["S3"] = "s3";
|
|
8
|
-
})(UploadProviders = exports.UploadProviders || (exports.UploadProviders = {}));
|
|
9
|
-
var MediaExportResolution;
|
|
10
|
-
(function (MediaExportResolution) {
|
|
11
|
-
MediaExportResolution["Low"] = "low";
|
|
12
|
-
MediaExportResolution["High"] = "high";
|
|
13
|
-
})(MediaExportResolution = exports.MediaExportResolution || (exports.MediaExportResolution = {}));
|
|
14
|
-
//# sourceMappingURL=storage.js.map
|
package/lib/cjs/storage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":";;;AAyBA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAsCD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types';\n\nexport type UploadInfo = {\n id: string;\n uploadUrl: string;\n downloadPath: string;\n method: 'POST' | 'PATCH' | 'PUT';\n headers?: {\n [name: string]: string;\n };\n};\n\nexport type VideoDownloadInfo = {\n url: string;\n quality: string;\n size: number;\n};\n\nexport type VideoInfo = {\n status: 'SUCCESS' | 'PROCESSING' | 'ERROR';\n downloads: VideoDownloadInfo[];\n id: string;\n};\n\nexport enum UploadProviders {\n Vimeo = 'vimeo',\n S3 = 's3',\n}\n\ntype BaseUploadUrlRequest = {\n contentType: string;\n};\n\nexport type VimeoUploadRequest = BaseUploadUrlRequest & {\n size: number;\n name: string;\n};\n\nexport type S3UploadRequest = BaseUploadUrlRequest & {\n // is the file supposed to be shared by all tenants that need it, or will each tenant have its copy\n shared: boolean;\n fileName: string;\n businessEntityId: string;\n};\n\nexport type UploadUrlRequest<Provider extends UploadProviders> =\n Provider extends UploadProviders.Vimeo\n ? VimeoUploadRequest\n : Provider extends UploadProviders.S3\n ? S3UploadRequest\n : {};\n\nexport type UploadProvider = {\n validationSchema: Joi.ObjectSchema<any>;\n getVideoListInfo: (requester: Requester, videoIds: string[]) => Promise<VideoInfo[]>;\n getUploadInfo(\n requester: Requester,\n request: UploadUrlRequest<UploadProviders>\n ): Promise<UploadInfo>;\n};\n\nexport type UploadProvidersDefinition = {\n [key in UploadProviders]: UploadProvider;\n};\n\nexport enum MediaExportResolution {\n Low = 'low',\n High = 'high',\n}\n\nexport type MediaExportRequest = {\n urls: string[];\n resolution?: MediaExportResolution;\n};\n\nexport type MediaExportEvent = {\n s3Keys: string[];\n outputId: string;\n tenantId: string;\n entityId: string;\n resolution: MediaExportResolution;\n};\n"]}
|