@bisondesk/commons-sdk 1.0.274 → 1.0.275
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/becris.js +3 -0
- package/lib/becris.js.map +1 -0
- package/lib/cjs/becris.js +3 -0
- package/lib/cjs/becris.js.map +1 -0
- package/lib/cjs/constants.js +102 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/dayjs-utils.js +26 -0
- package/lib/cjs/dayjs-utils.js.map +1 -0
- package/lib/cjs/discussions.js +5 -0
- package/lib/cjs/discussions.js.map +1 -0
- package/lib/cjs/errors.js +67 -0
- package/lib/cjs/errors.js.map +1 -0
- package/lib/cjs/exact.js +3 -0
- package/lib/cjs/exact.js.map +1 -0
- package/lib/cjs/fetch.js +21 -0
- package/lib/cjs/fetch.js.map +1 -0
- package/lib/cjs/ids.js +35 -0
- package/lib/cjs/ids.js.map +1 -0
- package/lib/cjs/insurance.js +3 -0
- package/lib/cjs/insurance.js.map +1 -0
- package/lib/cjs/location-utils.js +11 -0
- package/lib/cjs/location-utils.js.map +1 -0
- package/lib/cjs/locations.js +95 -0
- package/lib/cjs/locations.js.map +1 -0
- package/lib/cjs/messages.js +3 -0
- package/lib/cjs/messages.js.map +1 -0
- package/lib/cjs/notifications.js +13 -0
- package/lib/cjs/notifications.js.map +1 -0
- package/lib/cjs/pdf-gen.js +3 -0
- package/lib/cjs/pdf-gen.js.map +1 -0
- package/lib/cjs/storage.js +14 -0
- package/lib/cjs/storage.js.map +1 -0
- package/lib/cjs/types.js +8 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/constants.js +102 -0
- package/lib/constants.js.map +1 -0
- package/lib/dayjs-utils.js +25 -0
- package/lib/dayjs-utils.js.map +1 -0
- package/lib/discussions.js +5 -0
- package/lib/discussions.js.map +1 -0
- package/lib/errors.js +67 -0
- package/lib/errors.js.map +1 -0
- package/lib/esm/becris.js +2 -0
- package/lib/esm/becris.js.map +1 -0
- package/lib/esm/constants.js +99 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/dayjs-utils.js +18 -0
- package/lib/esm/dayjs-utils.js.map +1 -0
- package/lib/esm/discussions.js +2 -0
- package/lib/esm/discussions.js.map +1 -0
- package/lib/esm/errors.js +57 -0
- package/lib/esm/errors.js.map +1 -0
- package/lib/esm/exact.js +2 -0
- package/lib/esm/exact.js.map +1 -0
- package/lib/esm/fetch.js +16 -0
- package/lib/esm/fetch.js.map +1 -0
- package/lib/esm/ids.js +31 -0
- package/lib/esm/ids.js.map +1 -0
- package/lib/esm/insurance.js +2 -0
- package/lib/esm/insurance.js.map +1 -0
- package/lib/esm/location-utils.js +7 -0
- package/lib/esm/location-utils.js.map +1 -0
- package/lib/esm/locations.js +90 -0
- package/lib/esm/locations.js.map +1 -0
- package/lib/esm/messages.js +2 -0
- package/lib/esm/messages.js.map +1 -0
- package/lib/esm/notifications.js +10 -0
- package/lib/esm/notifications.js.map +1 -0
- package/lib/esm/pdf-gen.js +2 -0
- package/lib/esm/pdf-gen.js.map +1 -0
- package/lib/esm/storage.js +11 -0
- package/lib/esm/storage.js.map +1 -0
- package/lib/esm/types.js +5 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/exact.js +3 -0
- package/lib/exact.js.map +1 -0
- package/lib/fetch.js +20 -0
- package/lib/fetch.js.map +1 -0
- package/lib/ids.js +35 -0
- package/lib/ids.js.map +1 -0
- package/lib/insurance.js +3 -0
- package/lib/insurance.js.map +1 -0
- package/lib/location-utils.js +11 -0
- package/lib/location-utils.js.map +1 -0
- package/lib/locations.js +95 -0
- package/lib/locations.js.map +1 -0
- package/lib/messages.js +3 -0
- package/lib/messages.js.map +1 -0
- package/lib/notifications.js +13 -0
- package/lib/notifications.js.map +1 -0
- package/lib/pdf-gen.js +3 -0
- package/lib/pdf-gen.js.map +1 -0
- package/lib/storage.js +14 -0
- package/lib/storage.js.map +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/types/becris.d.ts +40 -0
- package/lib/types/becris.d.ts.map +1 -0
- package/lib/types/constants.d.ts +54 -0
- package/lib/types/constants.d.ts.map +1 -0
- package/lib/types/dayjs-utils.d.ts +8 -0
- package/lib/types/dayjs-utils.d.ts.map +1 -0
- package/lib/types/discussions.d.ts +43 -0
- package/lib/types/discussions.d.ts.map +1 -0
- package/lib/types/errors.d.ts +36 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/exact.d.ts +10 -0
- package/lib/types/exact.d.ts.map +1 -0
- package/lib/types/fetch.d.ts +3 -0
- package/lib/types/fetch.d.ts.map +1 -0
- package/lib/types/ids.d.ts +9 -0
- package/lib/types/ids.d.ts.map +1 -0
- package/lib/types/insurance.d.ts +20 -0
- package/lib/types/insurance.d.ts.map +1 -0
- package/lib/types/location-utils.d.ts +3 -0
- package/lib/types/location-utils.d.ts.map +1 -0
- package/lib/types/locations.d.ts +34 -0
- package/lib/types/locations.d.ts.map +1 -0
- package/lib/types/messages.d.ts +57 -0
- package/lib/types/messages.d.ts.map +1 -0
- package/lib/types/notifications.d.ts +51 -0
- package/lib/types/notifications.d.ts.map +1 -0
- package/lib/types/pdf-gen.d.ts +40 -0
- package/lib/types/pdf-gen.d.ts.map +1 -0
- package/lib/types/storage.d.ts +63 -0
- package/lib/types/storage.d.ts.map +1 -0
- package/lib/types/types.d.ts +124 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types.js +8 -0
- package/lib/types.js.map +1 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -0
package/lib/becris.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type BecrisInstrument = {\n clientId: string;\n clientExternalId: string;\n contractId: string;\n contractNumber: string;\n endDate?: string;\n id: string; // Hyperportal's LCT process id if it exists, otherwise the contract id\n inceptionDate: string;\n instrumentNumber: string;\n legalFinalMaturityDate: string;\n outstandingNominalAmount: string; // updated when creating a new declaration\n settlementDate: string;\n totalCommitmentAmountAtInception: string;\n vatNumber: string;\n\n /**\n * Becris state\n */\n active: boolean; // false if undeclaredAt is not null, useful for filtering in dynamodb\n declaredAt?: string;\n undeclaredAt?: string;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type BecrisInstrument = {\n clientId: string;\n clientExternalId: string;\n contractId: string;\n contractNumber: string;\n endDate?: string;\n id: string; // Hyperportal's LCT process id if it exists, otherwise the contract id\n inceptionDate: string;\n instrumentNumber: string;\n legalFinalMaturityDate: string;\n outstandingNominalAmount: string; // updated when creating a new declaration\n settlementDate: string;\n totalCommitmentAmountAtInception: string;\n vatNumber: string;\n\n /**\n * Becris state\n */\n active: boolean; // false if undeclaredAt is not null, useful for filtering in dynamodb\n declaredAt?: string;\n undeclaredAt?: string;\n};\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
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_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["LeasingDebtorsView"] = "leasing:debtors:view";
|
|
19
|
+
TopLevelActions["LeasingOverduesView"] = "leasing:overdues:view";
|
|
20
|
+
TopLevelActions["LeasingContractsExport"] = "leasing:contracts:export";
|
|
21
|
+
TopLevelActions["LeasingDebtorsExport"] = "leasing:debtors:export";
|
|
22
|
+
TopLevelActions["MarketBrowse"] = "market:browse";
|
|
23
|
+
TopLevelActions["MarketTrends"] = "market:trends";
|
|
24
|
+
TopLevelActions["SettingsAll"] = "settings:*";
|
|
25
|
+
TopLevelActions["VehicleCreate"] = "vehicle:create";
|
|
26
|
+
TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
|
|
27
|
+
})(TopLevelActions = exports.TopLevelActions || (exports.TopLevelActions = {}));
|
|
28
|
+
exports.SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es'];
|
|
29
|
+
exports.TENANT_ID_ADMIN_HEADER = 'tenant-id';
|
|
30
|
+
exports.SERVICE_ID_ADMIN_HEADER = 'service-id';
|
|
31
|
+
exports.NO_TENANT_ID_VALUE = 'notenant';
|
|
32
|
+
exports.SYSTEM_USER_ID = 'system';
|
|
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["Debtors"] = "debtors";
|
|
50
|
+
})(BusinessEntityIds = exports.BusinessEntityIds || (exports.BusinessEntityIds = {}));
|
|
51
|
+
exports.LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
|
|
52
|
+
exports.LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
|
|
53
|
+
exports.LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
|
|
54
|
+
exports.LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
|
|
55
|
+
exports.SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';
|
|
56
|
+
exports.SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
|
|
57
|
+
exports.EU_VAT_COUNTRY_CODES = [
|
|
58
|
+
'at',
|
|
59
|
+
'be',
|
|
60
|
+
'bg',
|
|
61
|
+
'hr',
|
|
62
|
+
'cy',
|
|
63
|
+
'cz',
|
|
64
|
+
'dk',
|
|
65
|
+
'ee',
|
|
66
|
+
'fi',
|
|
67
|
+
'fr',
|
|
68
|
+
'de',
|
|
69
|
+
'el',
|
|
70
|
+
'hu',
|
|
71
|
+
'ie',
|
|
72
|
+
'it',
|
|
73
|
+
'lv',
|
|
74
|
+
'lt',
|
|
75
|
+
'lu',
|
|
76
|
+
'mt',
|
|
77
|
+
'nl',
|
|
78
|
+
'pl',
|
|
79
|
+
'pt',
|
|
80
|
+
'ro',
|
|
81
|
+
'sk',
|
|
82
|
+
'si',
|
|
83
|
+
'es',
|
|
84
|
+
'se',
|
|
85
|
+
'xi',
|
|
86
|
+
];
|
|
87
|
+
exports.HEXON_LANG_CODES = [
|
|
88
|
+
'en',
|
|
89
|
+
'nl',
|
|
90
|
+
'de',
|
|
91
|
+
'fr',
|
|
92
|
+
'es',
|
|
93
|
+
'pt',
|
|
94
|
+
'it',
|
|
95
|
+
'pl',
|
|
96
|
+
'ru',
|
|
97
|
+
'ro',
|
|
98
|
+
'el',
|
|
99
|
+
'bg',
|
|
100
|
+
];
|
|
101
|
+
exports.DEFAULT_SLB_PARTNER = 'To be announced';
|
|
102
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,eAYX;AAZD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,0DAAuC,CAAA;IACvC,8DAA2C,CAAA;IAC3C,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,iDAA8B,CAAA;IAC9B,6CAA0B,CAAA;IAC1B,mDAAgC,CAAA;IAChC,wDAAqC,CAAA;AACvC,CAAC,EAZW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAY1B;AAKY,QAAA,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAK/C,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,iBAgBX;AAhBD,WAAY,iBAAiB;IAC3B,+DAA0C,CAAA;IAC1C,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,2DAAsC,CAAA;IACtC,2DAAsC,CAAA;IACtC,oCAAe,CAAA;IACf,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,EAhBW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAgB5B;AAKY,QAAA,+BAA+B,GAAG,wBAAwB,CAAC;AAC3D,QAAA,wCAAwC,GAAG,iCAAiC,CAAC;AAC7E,QAAA,+CAA+C,GAC1D,wCAAwC,CAAC;AAC9B,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 LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketTrends = 'market:trends',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TrackAndTraceDevices = 'tt:devices:*',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es'];\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 Leads = 'leads',\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_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"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export 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
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchJson = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
const fetchJson = async (url, init) => {
|
|
8
|
+
const response = await (0, node_fetch_1.default)(url, init);
|
|
9
|
+
if (!response.ok) {
|
|
10
|
+
const body = await response.text();
|
|
11
|
+
throw new errors_1.XError(response.statusText, {
|
|
12
|
+
url,
|
|
13
|
+
body: init?.body,
|
|
14
|
+
response: body,
|
|
15
|
+
status: response.status,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return response.status === 200 ? response.json() : undefined;
|
|
19
|
+
};
|
|
20
|
+
exports.fetchJson = fetchJson;
|
|
21
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,qCAAkC;AAE3B,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAgB,EAChB,IAAkB,EACM,EAAE;IAC1B,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;AAjBW,QAAA,SAAS,aAiBpB","sourcesContent":["import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch';\nimport { XError } from './errors';\n\nexport const fetchJson = async <T>(\n url: RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\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"]}
|
package/lib/cjs/ids.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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
|
+
return [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n).join(joinBy);
|
|
9
|
+
};
|
|
10
|
+
exports.getAddressText = getAddressText;
|
|
11
|
+
//# sourceMappingURL=location-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,OAAsB,EAAE,SAAiB,MAAM,EAAU,EAAE;IACxF,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,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnG,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB","sourcesContent":["import { LocationValue } from './types';\n\nexport const getAddressText = (address: LocationValue, joinBy: string = '<br>'): string => {\n const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]\n .filter((n) => !!n)\n .join(', ');\n\n return [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n).join(joinBy);\n};\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":";;;AAoBA,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};\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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","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};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\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 type NotificationsQuery = {\n limit?: number;\n unreadOnly?: boolean;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
package/lib/cjs/types.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Region = void 0;
|
|
4
|
+
var Region;
|
|
5
|
+
(function (Region) {
|
|
6
|
+
Region["euWest1"] = "eu-west-1";
|
|
7
|
+
})(Region = exports.Region || (exports.Region = {}));
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":";;;AA8CA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,cAAM,KAAN,cAAM,QAEjB","sourcesContent":["import { AppRoles, TopLevelActions } from './constants';\nimport { LocationValue } from './locations';\nexport { GPSCoord, LocationValue } from './locations';\n\nexport type PaginatedList<T, M = {}> = {\n results: T[];\n nextToken?: undefined;\n meta: M;\n totalCount: number;\n};\n\nexport type PaginationRequest = {\n limit: number;\n offset: number;\n};\n\nexport type NextList<T, M = {}> = {\n results: T[];\n nextToken?: string;\n meta: M;\n totalCount?: number;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\n};\n\nexport type Requester = {\n lang: string;\n roles: AppRoles[];\n actions: TopLevelActions[];\n tenantId: string;\n tenantLang: string;\n userAgent?: string;\n source?: string;\n userId: string;\n isApi: boolean;\n};\n\nexport type Option = {\n value: string | number;\n label: string;\n color?: string;\n};\n\nexport enum Region {\n euWest1 = 'eu-west-1',\n}\n\nexport type ErrorResponse = {\n message?: string;\n data?: unknown;\n};\n\nexport type MultiLangValue = { key?: string } & { [languageCode: string]: string };\n\nexport type CognitoInfo = {\n userPoolId: string;\n appClientId: string;\n region: Region;\n};\n\nexport type SearchPermissions = {\n users: string[];\n roles: AppRoles[];\n};\n\nexport type PhoneNumberValue = {\n country: string;\n e164: string;\n international: string;\n national: string;\n};\n\nexport type PhoneNumberRawValue = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type LinkValue = {\n text?: string;\n url: string;\n};\n\nexport type Document = {\n type: string; // passport, driving_license, ...\n displayName: string;\n file: AttachmentValue;\n};\n\nexport type AttachmentValue = {\n contentType: string;\n fileName: string;\n id: string;\n previewSrc?: string;\n size: number;\n uploadedAt: string;\n uploadedBy: string;\n url: string;\n descriptions?: string | MultiLangValue;\n};\n\nexport type VatLayerResponse = { vatNumber: string } & (\n | { formatValid: false; viesValid: false }\n | {\n formatValid: true;\n viesValid: boolean;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n countryCode?: string;\n} & (\n | { viesValid: false }\n | {\n viesValid: true;\n name?: string;\n normalizedAddress?: LocationValue;\n officialAddress?: string[];\n }\n);\n\nexport type VatValidationRequest = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type CurrencyLayerResponse = {\n conversionRate: number;\n targetCurrency: string;\n sourceCurrency: string;\n};\n"]}
|