@bisondesk/commons-sdk 1.0.345 → 1.0.347
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/apis/picklists.js.map +1 -1
- package/lib/constants.js +3 -3
- package/lib/constants.js.map +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/fetch.d.ts +0 -1
- package/lib/fetch.d.ts.map +1 -1
- package/lib/fetch.js.map +1 -1
- package/lib/fields.js +2 -2
- package/lib/fields.js.map +1 -1
- package/lib/formatting.d.ts +2 -2
- package/lib/formatting.d.ts.map +1 -1
- package/lib/ids.js +1 -1
- package/lib/ids.js.map +1 -1
- package/lib/location-utils.js.map +1 -1
- package/lib/locations.js +1 -1
- package/lib/locations.js.map +1 -1
- package/lib/money.d.ts +1 -0
- package/lib/money.d.ts.map +1 -1
- package/lib/money.js +1 -0
- package/lib/money.js.map +1 -1
- package/lib/notifications.d.ts +1 -0
- package/lib/notifications.d.ts.map +1 -1
- package/lib/notifications.js +3 -3
- package/lib/notifications.js.map +1 -1
- package/lib/search.js +5 -5
- package/lib/search.js.map +1 -1
- package/lib/servers.js +1 -1
- package/lib/servers.js.map +1 -1
- package/lib/storage.js +2 -2
- package/lib/storage.js.map +1 -1
- package/lib/tasks.js +2 -2
- package/lib/tasks.js.map +1 -1
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils.js +1 -1
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/money.ts +4 -0
- package/src/notifications.ts +1 -0
- package/tsconfig.deploy.tsbuildinfo +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picklists.js","sourceRoot":"/","sources":["apis/picklists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE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AC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAC/C,QAAgC,EAChC,aAAqB,EACrB,UAAkB,EACkB,EAAE;IACtC,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAElC,MAAM,GAAG,GAAyB;QAChC,aAAa;QACb,QAAQ;QACR,UAAU;KACX,CAAC;IAEF,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,0BAA0B,EAAE;QAC/F,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,YAAY,CAAC;YACpB,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,kBAAkB;SACnC,CAAC;QACF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;KAC1B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,EAAE,EAAE;QACf,OAAO,QAAQ,CAAC,IAAI,EAAS,CAAC;KAC/B;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC","sourcesContent":["import fetch, { Response } from 'node-fetch';\nimport { XError } from '../errors.js';\nimport { cleanHeaders, getAdminAuth } from '../fetch.js';\nimport {\n AdHocPicklistRequest,\n AdHocPicklistValueDisplay,\n PicklistOptionsRequest,\n PicklistValue,\n PicklistValueRequest,\n PicklistValueUpdateRequest,\n} from '../picklists.js';\nimport { Option } from '../types.js';\n\nexport const getMultiplePicklistValues = async (\n request: AdHocPicklistRequest\n): Promise<AdHocPicklistValueDisplay> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/bulk/read`, {\n method: 'POST',\n headers: {\n Authorization: auth,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getPicklistOptions = async (req: PicklistOptionsRequest): Promise<Option[]> => {\n const auth = await getAdminAuth();\n\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/options`, {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n }),\n body: JSON.stringify(req),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body, req });\n};\n\nexport const upsertPicklistValue = async (\n request: PicklistValueUpdateRequest\n): Promise<PicklistValue> => {\n const auth = await getAdminAuth();\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/value`, {\n method: 'POST',\n headers: {\n Authorization: auth,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(request),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n\n const body = await response.text();\n throw new XError(response.statusText, { body });\n};\n\nexport const getAdhocPicklistDisplayValue = async (\n requests: PicklistValueRequest[],\n preferredLang: string,\n tenantLang: string\n): Promise<AdHocPicklistValueDisplay> => {\n const auth = await getAdminAuth();\n\n const req: AdHocPicklistRequest = {\n preferredLang,\n requests,\n tenantLang,\n };\n\n const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/bulk/read`, {\n method: 'POST',\n headers: cleanHeaders({\n Authorization: auth,\n 'Content-Type': 'application/json',\n }),\n body: JSON.stringify(req),\n });\n\n if (response.ok) {\n return response.json() as any;\n }\n\n const body = await response.text();\n\n throw new XError(response.statusText, { body, req });\n};\n"]}
|
package/lib/constants.js
CHANGED
|
@@ -10,7 +10,7 @@ export var AppRoles;
|
|
|
10
10
|
AppRoles["ParkLogistics"] = "park_logistics";
|
|
11
11
|
AppRoles["SeniorAccountant"] = "senior_accountant";
|
|
12
12
|
AppRoles["TrackAndTraceManager"] = "track_and_trace_manager";
|
|
13
|
-
})(AppRoles || (AppRoles = {}));
|
|
13
|
+
})(AppRoles = AppRoles || (AppRoles = {}));
|
|
14
14
|
export var TopLevelActions;
|
|
15
15
|
(function (TopLevelActions) {
|
|
16
16
|
TopLevelActions["AdministrationAll"] = "admin:*";
|
|
@@ -30,7 +30,7 @@ export var TopLevelActions;
|
|
|
30
30
|
TopLevelActions["VehicleCreate"] = "vehicle:create";
|
|
31
31
|
TopLevelActions["TasksAll"] = "tasks:*";
|
|
32
32
|
TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
|
|
33
|
-
})(TopLevelActions || (TopLevelActions = {}));
|
|
33
|
+
})(TopLevelActions = TopLevelActions || (TopLevelActions = {}));
|
|
34
34
|
export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
|
|
35
35
|
export const TENANT_ID_ADMIN_HEADER = 'tenant-id';
|
|
36
36
|
export const SERVICE_ID_ADMIN_HEADER = 'service-id';
|
|
@@ -55,7 +55,7 @@ export var BusinessEntityIds;
|
|
|
55
55
|
BusinessEntityIds["Debtors"] = "debtors";
|
|
56
56
|
BusinessEntityIds["DocumentDrafts"] = "document_drafts";
|
|
57
57
|
BusinessEntityIds["TrackAndTraceDevices"] = "track_and_trace_devices";
|
|
58
|
-
})(BusinessEntityIds || (BusinessEntityIds = {}));
|
|
58
|
+
})(BusinessEntityIds = BusinessEntityIds || (BusinessEntityIds = {}));
|
|
59
59
|
export const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
|
|
60
60
|
export const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
|
|
61
61
|
export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n AppManager = 'app_manager',\n Board = 'board',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n SeniorAccountant = 'senior_accountant',\n TrackAndTraceManager = 'track_and_trace_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsFinanceBrowse = 'docs:finance:browse',\n DocumentsAdministrativeBrowse = 'docs:administrative:browse',\n LeadsAll = 'leads:*',\n BrowseDocumentDrafts = 'docs:drafts:browse',\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 AdministrativeDocuments = 'administrative_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 DocumentDrafts = 'document_drafts',\n TrackAndTraceDevices = 'track_and_trace_devices',\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"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,QAWX;AAXD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,sCAA0B,CAAA;IAC1B,2BAAe,CAAA;IACf,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;IAChC,kDAAsC,CAAA;IACtC,4DAAgD,CAAA;AAClD,CAAC,EAXW,QAAQ,GAAR,QAAQ,KAAR,QAAQ,QAWnB;AAED,MAAM,CAAN,IAAY,eAkBX;AAlBD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,iEAA8C,CAAA;IAC9C,+EAA4D,CAAA;IAC5D,uCAAoB,CAAA;IACpB,8DAA2C,CAAA;IAC3C,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,EAlBW,eAAe,GAAf,eAAe,KAAf,eAAe,QAkB1B;AAKD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAKjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAKpD,MAAM,CAAC,MAAM,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AI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,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;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n AppManager = 'app_manager',\n Board = 'board',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n SeniorAccountant = 'senior_accountant',\n TrackAndTraceManager = 'track_and_trace_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsFinanceBrowse = 'docs:finance:browse',\n DocumentsAdministrativeBrowse = 'docs:administrative:browse',\n LeadsAll = 'leads:*',\n BrowseDocumentDrafts = 'docs:drafts:browse',\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 AdministrativeDocuments = 'administrative_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 DocumentDrafts = 'document_drafts',\n TrackAndTraceDevices = 'track_and_trace_devices',\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/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,MAAO,SAAQ,KAAK;IAC/B,QAAQ,CAAM;IAEd,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;AAED,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAM;IAEd,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;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,C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AC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAOD,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,gBAAgB,CAAsC;IACtD,YAAY,GAAG,IAAI,CAAC;IACpB,QAAQ,CAAM;IAEd,YAAY,OAAgB,EAAE,MAA4B,EAAE,QAAc;QACxE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,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,EAA2B,EAAwB,EAAE,CAAC,CAAC;oBAC3E,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;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF","sourcesContent":["import Joi 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?: Joi.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 }: Joi.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/fetch.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
1
|
import type { HeadersInit, RequestInfo, RequestInit } from 'node-fetch';
|
|
3
2
|
import type { URL } from 'node:url';
|
|
4
3
|
export declare const fetchJson: <T>(url: URL | RequestInfo, init?: RequestInit) => Promise<T | undefined>;
|
package/lib/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAIpC,eAAO,MAAM,SAAS,WACf,GAAG,GAAG,WAAW,SACf,WAAW,2BAkBnB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,QAAQ,MAAM,CAMnD,CAAC;AAEF,eAAO,MAAM,iBAAiB;;MAA2C,MAOxE,CAAC;AAEF,eAAO,MAAM,YAAY;;MAAqD,WACF,CAAC"}
|
package/lib/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,CAAC,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,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAW,CAAC,CAAC;IAE/C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAsB,EACtB,IAAkB,EACM,EAAE;IAE1B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAA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CAAC,IAAI,IAAI,CAAC,CAAC","sourcesContent":["import type { HeadersInit, RequestInfo, RequestInit } from 'node-fetch';\nimport type { URL } from 'node:url';\nimport { TENANT_ID_ADMIN_HEADER } from './constants.js';\nimport { InvalidArgumentsError, XError } from './errors.js';\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 = await fetch(url, init as any);\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/fields.js
CHANGED
|
@@ -15,12 +15,12 @@ export var FieldTypes;
|
|
|
15
15
|
FieldTypes["picklist"] = "picklist";
|
|
16
16
|
FieldTypes["rating"] = "rating";
|
|
17
17
|
FieldTypes["text"] = "text";
|
|
18
|
-
})(FieldTypes || (FieldTypes = {}));
|
|
18
|
+
})(FieldTypes = FieldTypes || (FieldTypes = {}));
|
|
19
19
|
export var DateGranularity;
|
|
20
20
|
(function (DateGranularity) {
|
|
21
21
|
DateGranularity["year"] = "year";
|
|
22
22
|
DateGranularity["yearMonth"] = "yearMonth";
|
|
23
23
|
DateGranularity["yearMonthDay"] = "yearMonthDay";
|
|
24
24
|
DateGranularity["yearMonthDayTime"] = "yearMonthDayTime";
|
|
25
|
-
})(DateGranularity || (DateGranularity = {}));
|
|
25
|
+
})(DateGranularity = DateGranularity || (DateGranularity = {}));
|
|
26
26
|
//# sourceMappingURL=fields.js.map
|
package/lib/fields.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"/","sources":["fields.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;IAC7B,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EAhBW,UAAU,KAAV,UAAU,QAgBrB;AAKD,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,gDAA6B,CAAA;IAC7B,wDAAqC,CAAA;AACvC,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B","sourcesContent":["export enum FieldTypes {\n attachment = 'attachment',\n checkbox = 'checkbox',\n collaborator = 'collaborator',\n date = 'date',\n email = 'email',\n image = 'image',\n link = 'link',\n location = 'location',\n multilang = 'multilang',\n multiline = 'multiline',\n number = 'number',\n phoneNumber = 'phoneNumber',\n picklist = 'picklist',\n rating = 'rating',\n text = 'text',\n}\n\n//\n// Field values\n//\nexport enum DateGranularity {\n year = 'year',\n yearMonth = 'yearMonth',\n yearMonthDay = 'yearMonthDay',\n yearMonthDayTime = 'yearMonthDayTime',\n}\n\n//\n// Field metas\n//\ntype BaseMeta = {};\n\ntype NumberUnit =\n | 'acre'\n | 'bit'\n | 'byte'\n | 'celsius'\n | 'centimeter'\n | 'day'\n | 'degree'\n | 'fahrenheit'\n | 'fluid-ounce'\n | 'foot'\n | 'gallon'\n | 'gigabit'\n | 'gigabyte'\n | 'gram'\n | 'hectare'\n | 'hour'\n | 'inch'\n | 'kilobit'\n | 'kilobyte'\n | 'kilogram'\n | 'kilometer'\n | 'liter'\n | 'megabit'\n | 'megabyte'\n | 'meter'\n | 'mile'\n | 'mile-scandinavian'\n | 'milliliter'\n | 'millimeter'\n | 'millisecond'\n | 'minute'\n | 'month'\n | 'ounce'\n | 'percent'\n | 'petabyte'\n | 'pound'\n | 'second'\n | 'stone'\n | 'terabit'\n | 'terabyte'\n | 'week'\n | 'yard'\n | 'year';\n\ntype BaseNumberMeta = {\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n useGrouping?: boolean;\n} & (\n | {\n style: 'unit';\n unit: NumberUnit;\n }\n | {\n style?: 'currency' | 'decimal' | 'percent';\n unit?: NumberUnit;\n }\n);\n\nexport type NumberMeta = BaseMeta & BaseNumberMeta;\n\nexport type DateMeta = BaseMeta & {\n granularity: DateGranularity;\n};\n\nexport type RatingMeta = BaseMeta & {\n max: number;\n};\n\nexport type PicklistMeta = BaseMeta & {\n picklistId: string;\n};\n\nexport type FieldTypeInfo =\n | { type: FieldTypes.attachment }\n | { type: FieldTypes.checkbox }\n | { type: FieldTypes.date; meta: DateMeta }\n | { type: FieldTypes.email }\n | { type: FieldTypes.image }\n | { type: FieldTypes.link }\n | { type: FieldTypes.location }\n | { type: FieldTypes.multilang }\n | { type: FieldTypes.multiline }\n | { type: FieldTypes.number; meta: NumberMeta }\n | { type: FieldTypes.phoneNumber }\n | { type: FieldTypes.picklist; meta: PicklistMeta }\n | { type: FieldTypes.rating; meta: RatingMeta }\n | { type: FieldTypes.text }\n | { type: FieldTypes.collaborator };\n"]}
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"/","sources":["fields.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2CAA6B,CAAA;IAC7B,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EAhBW,UAAU,GAAV,UAAU,KAAV,UAAU,QAgBrB;AAKD,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,gDAA6B,CAAA;IAC7B,wDAAqC,CAAA;AACvC,CAAC,EALW,eAAe,GAAf,eAAe,KAAf,eAAe,QAK1B","sourcesContent":["export enum FieldTypes {\n attachment = 'attachment',\n checkbox = 'checkbox',\n collaborator = 'collaborator',\n date = 'date',\n email = 'email',\n image = 'image',\n link = 'link',\n location = 'location',\n multilang = 'multilang',\n multiline = 'multiline',\n number = 'number',\n phoneNumber = 'phoneNumber',\n picklist = 'picklist',\n rating = 'rating',\n text = 'text',\n}\n\n//\n// Field values\n//\nexport enum DateGranularity {\n year = 'year',\n yearMonth = 'yearMonth',\n yearMonthDay = 'yearMonthDay',\n yearMonthDayTime = 'yearMonthDayTime',\n}\n\n//\n// Field metas\n//\ntype BaseMeta = {};\n\ntype NumberUnit =\n | 'acre'\n | 'bit'\n | 'byte'\n | 'celsius'\n | 'centimeter'\n | 'day'\n | 'degree'\n | 'fahrenheit'\n | 'fluid-ounce'\n | 'foot'\n | 'gallon'\n | 'gigabit'\n | 'gigabyte'\n | 'gram'\n | 'hectare'\n | 'hour'\n | 'inch'\n | 'kilobit'\n | 'kilobyte'\n | 'kilogram'\n | 'kilometer'\n | 'liter'\n | 'megabit'\n | 'megabyte'\n | 'meter'\n | 'mile'\n | 'mile-scandinavian'\n | 'milliliter'\n | 'millimeter'\n | 'millisecond'\n | 'minute'\n | 'month'\n | 'ounce'\n | 'percent'\n | 'petabyte'\n | 'pound'\n | 'second'\n | 'stone'\n | 'terabit'\n | 'terabyte'\n | 'week'\n | 'yard'\n | 'year';\n\ntype BaseNumberMeta = {\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n useGrouping?: boolean;\n} & (\n | {\n style: 'unit';\n unit: NumberUnit;\n }\n | {\n style?: 'currency' | 'decimal' | 'percent';\n unit?: NumberUnit;\n }\n);\n\nexport type NumberMeta = BaseMeta & BaseNumberMeta;\n\nexport type DateMeta = BaseMeta & {\n granularity: DateGranularity;\n};\n\nexport type RatingMeta = BaseMeta & {\n max: number;\n};\n\nexport type PicklistMeta = BaseMeta & {\n picklistId: string;\n};\n\nexport type FieldTypeInfo =\n | { type: FieldTypes.attachment }\n | { type: FieldTypes.checkbox }\n | { type: FieldTypes.date; meta: DateMeta }\n | { type: FieldTypes.email }\n | { type: FieldTypes.image }\n | { type: FieldTypes.link }\n | { type: FieldTypes.location }\n | { type: FieldTypes.multilang }\n | { type: FieldTypes.multiline }\n | { type: FieldTypes.number; meta: NumberMeta }\n | { type: FieldTypes.phoneNumber }\n | { type: FieldTypes.picklist; meta: PicklistMeta }\n | { type: FieldTypes.rating; meta: RatingMeta }\n | { type: FieldTypes.text }\n | { type: FieldTypes.collaborator };\n"]}
|
package/lib/formatting.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const joinWithSeparator: (text: (string | number | undefined | null)[], { separator, filter, }?: {
|
|
2
|
-
separator?: string;
|
|
3
|
-
filter?: (value: any) => boolean;
|
|
2
|
+
separator?: string | undefined;
|
|
3
|
+
filter?: ((value: any) => boolean) | undefined;
|
|
4
4
|
}) => string;
|
|
5
5
|
export declare const formatCurrency: (amount: string, locale?: string, showCurrencySign?: boolean, options?: Intl.NumberFormatOptions) => string;
|
|
6
6
|
//# sourceMappingURL=formatting.d.ts.map
|
package/lib/formatting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,SACtB,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,SACtB,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE;;sBAIF,GAAG,KAAK,OAAO;YACnB,CAAC;AAEzC,eAAO,MAAM,cAAc,WACjB,MAAM,yDAGL,KAAK,mBAAmB,KAChC,MAWF,CAAC"}
|
package/lib/ids.js
CHANGED
|
@@ -6,7 +6,7 @@ export var Alphabet;
|
|
|
6
6
|
Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
|
|
7
7
|
Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
8
8
|
Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
|
|
9
|
-
})(Alphabet || (Alphabet = {}));
|
|
9
|
+
})(Alphabet = Alphabet || (Alphabet = {}));
|
|
10
10
|
export const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
|
|
11
11
|
const nanoid = customAlphabet(alphabet, idLength);
|
|
12
12
|
while (true) {
|
package/lib/ids.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"/","sources":["ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,s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;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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,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
|
|
1
|
+
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,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;AAEF,MAAM,CAAC,MAAM,mCAAmC,GAAG,CACjD,QAAuB,EACH,EAAE;IACtB,MAAM,YAAY,GAAG,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEvD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { LocationValue } from './types.js';\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/locations.js
CHANGED
|
@@ -4,7 +4,7 @@ export var RouteLabel;
|
|
|
4
4
|
RouteLabel["Default"] = "DEFAULT_ROUTE";
|
|
5
5
|
RouteLabel["DefaultAlternate"] = "DEFAULT_ROUTE_ALTERNATE";
|
|
6
6
|
RouteLabel["FuelEfficient"] = "FUEL_EFFICIENT";
|
|
7
|
-
})(RouteLabel || (RouteLabel = {}));
|
|
7
|
+
})(RouteLabel = RouteLabel || (RouteLabel = {}));
|
|
8
8
|
export const isEUCountry = (country) => [
|
|
9
9
|
'AT',
|
|
10
10
|
'BE',
|
package/lib/locations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,0DAA4C,CAAA;IAC5C,8CAAgC,CAAA;AAClC,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAYD,MAAM,CAAC,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;AAEpC,MAAM,CAAC,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","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"]}
|
|
1
|
+
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,0DAA4C,CAAA;IAC5C,8CAAgC,CAAA;AAClC,CAAC,EALW,UAAU,GAAV,UAAU,KAAV,UAAU,QAKrB;AAYD,MAAM,CAAC,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;AAEpC,MAAM,CAAC,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","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/money.d.ts
CHANGED
package/lib/money.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.d.ts","sourceRoot":"/","sources":["money.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,eAAO,MAAM,UAAU,UAAW,OAAO,GAAG,MAAM,YACc,CAAC"}
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"/","sources":["money.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,eAAO,MAAM,UAAU,UAAW,OAAO,GAAG,MAAM,YACc,CAAC;AAGjE,eAAO,MAAM,2BAA2B,YAAa,OAAO,GAAG,MAAM,WAAW,OAAO,GAAG,MAAM,YACnB,CAAC"}
|
package/lib/money.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Decimal } from 'decimal.js';
|
|
2
2
|
export const roundMoney = (value) => new Decimal(value).toDecimalPlaces(2, Decimal.ROUND_HALF_EVEN);
|
|
3
|
+
export const isAmountWithinToleranceSame = (amount1, amount2) => roundMoney(amount1).minus(roundMoney(amount2)).abs().lessThanOrEqualTo(0.1);
|
|
3
4
|
//# sourceMappingURL=money.js.map
|
package/lib/money.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.js","sourceRoot":"/","sources":["money.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAE,EAAE,CACpD,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { Decimal } from 'decimal.js';\n\nexport const roundMoney = (value: Decimal | string) =>\n new Decimal(value).toDecimalPlaces(2, Decimal.ROUND_HALF_EVEN);\n"]}
|
|
1
|
+
{"version":3,"file":"money.js","sourceRoot":"/","sources":["money.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAE,EAAE,CACpD,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,OAAyB,EAAE,OAAyB,EAAE,EAAE,CAClG,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import { Decimal } from 'decimal.js';\n\nexport const roundMoney = (value: Decimal | string) =>\n new Decimal(value).toDecimalPlaces(2, Decimal.ROUND_HALF_EVEN);\n\n// We tolerate a 10 cent rounding difference\nexport const isAmountWithinToleranceSame = (amount1: Decimal | string, amount2: Decimal | string) =>\n roundMoney(amount1).minus(roundMoney(amount2)).abs().lessThanOrEqualTo(0.1);\n"]}
|
package/lib/notifications.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,oBAAY,2BAA2B;IACrC,OAAO,YAAY;CACpB;AACD,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,KAAK,QAAQ,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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e,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,mBAAmB;IAC7B,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,2BAA2B,CAAC;CACtC,CAAC"}
|
package/lib/notifications.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export var GroupableNotificationOrigin;
|
|
2
2
|
(function (GroupableNotificationOrigin) {
|
|
3
3
|
GroupableNotificationOrigin["Message"] = "message";
|
|
4
|
-
})(GroupableNotificationOrigin || (GroupableNotificationOrigin = {}));
|
|
4
|
+
})(GroupableNotificationOrigin = GroupableNotificationOrigin || (GroupableNotificationOrigin = {}));
|
|
5
5
|
export var NotificationVisibility;
|
|
6
6
|
(function (NotificationVisibility) {
|
|
7
7
|
NotificationVisibility["UNREAD"] = "unread";
|
|
8
8
|
NotificationVisibility["READ"] = "read";
|
|
9
|
-
})(NotificationVisibility || (NotificationVisibility = {}));
|
|
9
|
+
})(NotificationVisibility = NotificationVisibility || (NotificationVisibility = {}));
|
|
10
10
|
export var NotificationsFilter;
|
|
11
11
|
(function (NotificationsFilter) {
|
|
12
12
|
NotificationsFilter["Unread"] = "unread";
|
|
13
13
|
NotificationsFilter["Archived"] = "archived";
|
|
14
|
-
})(NotificationsFilter || (NotificationsFilter = {}));
|
|
14
|
+
})(NotificationsFilter = NotificationsFilter || (NotificationsFilter = {}));
|
|
15
15
|
//# sourceMappingURL=notifications.js.map
|
package/lib/notifications.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,KAA3B,2BAA2B,QAEtC;AACD,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,GAA3B,2BAA2B,KAA3B,2BAA2B,QAEtC;AACD,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,GAAtB,sBAAsB,KAAtB,sBAAsB,QAGjC;AAqDD,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAHW,mBAAmB,GAAnB,mBAAmB,KAAnB,mBAAmB,QAG9B","sourcesContent":["import { BusinessEntityIds } from './constants.js';\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 dedupId?: string;\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/search.js
CHANGED
|
@@ -2,7 +2,7 @@ export var ConditionType;
|
|
|
2
2
|
(function (ConditionType) {
|
|
3
3
|
ConditionType["and"] = "AND";
|
|
4
4
|
ConditionType["or"] = "OR";
|
|
5
|
-
})(ConditionType || (ConditionType = {}));
|
|
5
|
+
})(ConditionType = ConditionType || (ConditionType = {}));
|
|
6
6
|
export var ElasticsearchOperator;
|
|
7
7
|
(function (ElasticsearchOperator) {
|
|
8
8
|
ElasticsearchOperator["empty"] = "EMPTY";
|
|
@@ -18,22 +18,22 @@ export var ElasticsearchOperator;
|
|
|
18
18
|
ElasticsearchOperator["notContains"] = "NOT_CONTAINS";
|
|
19
19
|
ElasticsearchOperator["startsWith"] = "STARTS_WITH";
|
|
20
20
|
ElasticsearchOperator["endsWith"] = "ENDS_WITH";
|
|
21
|
-
})(ElasticsearchOperator || (ElasticsearchOperator = {}));
|
|
21
|
+
})(ElasticsearchOperator = ElasticsearchOperator || (ElasticsearchOperator = {}));
|
|
22
22
|
export var ElasticsearchGeoOperator;
|
|
23
23
|
(function (ElasticsearchGeoOperator) {
|
|
24
24
|
ElasticsearchGeoOperator["boundingBox"] = "geo_bounding_box";
|
|
25
25
|
ElasticsearchGeoOperator["distance"] = "geo_distance";
|
|
26
26
|
ElasticsearchGeoOperator["polygon"] = "geo_polygon";
|
|
27
|
-
})(ElasticsearchGeoOperator || (ElasticsearchGeoOperator = {}));
|
|
27
|
+
})(ElasticsearchGeoOperator = ElasticsearchGeoOperator || (ElasticsearchGeoOperator = {}));
|
|
28
28
|
export const FILTER_RANGE_SEPARATOR = '__';
|
|
29
29
|
export var SortOrder;
|
|
30
30
|
(function (SortOrder) {
|
|
31
31
|
SortOrder["asc"] = "asc";
|
|
32
32
|
SortOrder["desc"] = "desc";
|
|
33
|
-
})(SortOrder || (SortOrder = {}));
|
|
33
|
+
})(SortOrder = SortOrder || (SortOrder = {}));
|
|
34
34
|
export var AggregationType;
|
|
35
35
|
(function (AggregationType) {
|
|
36
36
|
AggregationType["term"] = "TERM";
|
|
37
37
|
AggregationType["range"] = "RANGE";
|
|
38
|
-
})(AggregationType || (AggregationType = {}));
|
|
38
|
+
})(AggregationType = AggregationType || (AggregationType = {}));
|
|
39
39
|
//# sourceMappingURL=search.js.map
|
package/lib/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"/","sources":["search.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0BAAS,CAAA;AACX,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAE/B,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAEhB,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IAEnB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,KAArB,qBAAqB,QAiBhC;AAQD,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,4DAAgC,CAAA;IAChC,qDAAyB,CAAA;IACzB,mDAAuB,CAAA;AACzB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AA4FD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAwED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { BusinessEntityIds, SUPPORTED_LANGUAGES } from './constants.js';\nimport { FieldTypes, NumberMeta } from './fields.js';\nimport { MultiLangValue } from './types.js';\n\nexport enum ConditionType {\n and = 'AND',\n or = 'OR',\n}\n\nexport enum ElasticsearchOperator {\n // all properties\n empty = 'EMPTY',\n notEmpty = 'NOT_EMPTY',\n is = 'IS',\n isNot = 'IS_NOT',\n // number, date properties\n greaterThanOrEqual = 'GTE',\n greaterThan = 'GT',\n lessThanEqual = 'LTE',\n lessThan = 'LT',\n between = 'BETWEEN',\n // string properties\n contains = 'CONTAINS',\n notContains = 'NOT_CONTAINS',\n startsWith = 'STARTS_WITH',\n endsWith = 'ENDS_WITH',\n}\n\nexport type Filter<OP = ElasticsearchOperator> = {\n data: string;\n fieldId: string;\n operator: OP;\n};\n\nexport enum ElasticsearchGeoOperator {\n boundingBox = 'geo_bounding_box',\n distance = 'geo_distance',\n polygon = 'geo_polygon',\n}\n\ntype ElasticSearchCoordinates =\n | {\n lat: number;\n lon: number;\n }\n | [lat: number, lon: number]\n | string;\n\ntype BoundingBoxCoordinates = {\n top_left: ElasticSearchCoordinates;\n bottom_right: ElasticSearchCoordinates;\n};\n\ntype BoundingBoxWKT = {\n wkt: `BBOX (${number}, ${number}, ${number}, ${number})`;\n};\n\ntype BoundingBoxVertices = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\ntype GeoDistanceUnit = 'mi' | 'yd' | 'ft' | 'in' | 'km' | 'm' | 'cm' | 'mm' | 'nmi';\n\ntype GeoBoundingBoxFilter = {\n operator: ElasticsearchGeoOperator.boundingBox;\n data: BoundingBoxCoordinates | BoundingBoxWKT | BoundingBoxVertices;\n};\n\ntype GeoDistanceFilter = {\n operator: ElasticsearchGeoOperator.distance;\n data: {\n distance: `${number}${GeoDistanceUnit}`;\n coords: ElasticSearchCoordinates;\n };\n};\n\ntype GeoPolygonFilter = {\n operator: ElasticsearchGeoOperator.polygon;\n data: {\n points: ElasticSearchCoordinates[];\n };\n};\n\nexport type GeoFilter = { fieldId: string } & (\n | GeoBoundingBoxFilter\n | GeoDistanceFilter\n | GeoPolygonFilter\n);\n\nexport type ComplexFilter<OP = ElasticsearchOperator> = {\n condition: ConditionType;\n filters: Array<Filter<OP> | ComplexFilter<OP>>;\n};\n\nexport type SearchResponse<T = any> = {\n took: number;\n timed_out: boolean;\n _scroll_id?: string;\n _shards: unknown;\n hits: {\n total: {\n value: number;\n relation: 'eq' | 'gte';\n };\n max_score: number;\n hits: Array<{\n _index: string;\n _type: string;\n _id: string;\n _score: number;\n _source?: T;\n _version?: number;\n _explanation?: unknown;\n fields?: any;\n highlight?: any;\n inner_hits?: any;\n matched_queries?: string[];\n sort?: Array<string | number>;\n }>;\n };\n aggregations?: { [aggName: string]: object };\n};\n\n///////////////////////////////////////////////////////\n// Search\n///////////////////////////////////////////////////////\n\nexport const FILTER_RANGE_SEPARATOR = '__';\n\nexport enum SortOrder {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport type SortFilter = {\n fieldId: string;\n order: SortOrder;\n};\n\nexport type BaseSearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n};\n\ntype InfiniteSearchRequest = {\n infinite: true;\n nextToken?: string;\n};\n\ntype PaginatedSearchRequest = {\n infinite?: false;\n offset?: number;\n};\n\nexport type SearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n geoFilters?: GeoFilter[];\n sortBy?: SortFilter[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchRequest = {\n fullText: string;\n limit: number;\n} & {\n entityIds: BusinessEntityIds[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchResult = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n title: string;\n description: string;\n tags?: string[];\n};\n\nexport type GlobalSearchByIdRequest = {\n ids: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n }[];\n};\n\nexport type PublicSearchRequest = {\n limit: number;\n offset?: number;\n query?: ComplexFilter;\n sortBy?: SortFilter[];\n};\n\n///////////////////////////////////////////////////////\n// Aggregations\n///////////////////////////////////////////////////////\n\nexport type AggFilterOperator =\n | ElasticsearchOperator.is\n | ElasticsearchOperator.greaterThan\n | ElasticsearchOperator.lessThan\n | ElasticsearchOperator.greaterThanOrEqual\n | ElasticsearchOperator.lessThanEqual;\n\nexport enum AggregationType {\n term = 'TERM',\n range = 'RANGE',\n}\n\nexport type TermAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.term;\n\n orderBy?: 'count' | 'field';\n} & (\n | {\n fieldType: FieldTypes.picklist;\n picklistId: string;\n }\n | {\n fieldType: FieldTypes.number;\n meta?: NumberMeta;\n }\n | {\n fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;\n }\n);\n\nexport type Range =\n | {\n start: number;\n end?: number;\n }\n | {\n start?: number;\n end: number;\n }\n | {\n start: number;\n end: number;\n };\n\nexport type RangeAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.range;\n step: number;\n ranges: Range[];\n format?: NumberMeta;\n};\n\nexport type Aggregation = TermAggregation | RangeAggregation;\n\nexport type AggregationRequest = {\n fullText?: string;\n filters: ComplexFilter<AggFilterOperator>[];\n geoFilters?: GeoFilter[];\n};\n\nexport type AggregationResult = {\n value: string;\n count: number;\n label?: string;\n from?: number;\n to?: number;\n};\n\nexport type AggregationResultSet = {\n [field: string]: AggregationResult[];\n};\n\nexport type AggregationResponse<M = {}> = {\n results: AggregationResultSet;\n meta: M;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"/","sources":["search.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0BAAS,CAAA;AACX,CAAC,EAHW,aAAa,GAAb,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAE/B,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAEhB,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IAEnB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,GAArB,qBAAqB,KAArB,qBAAqB,QAiBhC;AAQD,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,4DAAgC,CAAA;IAChC,qDAAyB,CAAA;IACzB,mDAAuB,CAAA;AACzB,CAAC,EAJW,wBAAwB,GAAxB,wBAAwB,KAAxB,wBAAwB,QAInC;AA4FD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,SAAS,KAAT,SAAS,QAGpB;AAwED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,GAAf,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { BusinessEntityIds, SUPPORTED_LANGUAGES } from './constants.js';\nimport { FieldTypes, NumberMeta } from './fields.js';\nimport { MultiLangValue } from './types.js';\n\nexport enum ConditionType {\n and = 'AND',\n or = 'OR',\n}\n\nexport enum ElasticsearchOperator {\n // all properties\n empty = 'EMPTY',\n notEmpty = 'NOT_EMPTY',\n is = 'IS',\n isNot = 'IS_NOT',\n // number, date properties\n greaterThanOrEqual = 'GTE',\n greaterThan = 'GT',\n lessThanEqual = 'LTE',\n lessThan = 'LT',\n between = 'BETWEEN',\n // string properties\n contains = 'CONTAINS',\n notContains = 'NOT_CONTAINS',\n startsWith = 'STARTS_WITH',\n endsWith = 'ENDS_WITH',\n}\n\nexport type Filter<OP = ElasticsearchOperator> = {\n data: string;\n fieldId: string;\n operator: OP;\n};\n\nexport enum ElasticsearchGeoOperator {\n boundingBox = 'geo_bounding_box',\n distance = 'geo_distance',\n polygon = 'geo_polygon',\n}\n\ntype ElasticSearchCoordinates =\n | {\n lat: number;\n lon: number;\n }\n | [lat: number, lon: number]\n | string;\n\ntype BoundingBoxCoordinates = {\n top_left: ElasticSearchCoordinates;\n bottom_right: ElasticSearchCoordinates;\n};\n\ntype BoundingBoxWKT = {\n wkt: `BBOX (${number}, ${number}, ${number}, ${number})`;\n};\n\ntype BoundingBoxVertices = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\ntype GeoDistanceUnit = 'mi' | 'yd' | 'ft' | 'in' | 'km' | 'm' | 'cm' | 'mm' | 'nmi';\n\ntype GeoBoundingBoxFilter = {\n operator: ElasticsearchGeoOperator.boundingBox;\n data: BoundingBoxCoordinates | BoundingBoxWKT | BoundingBoxVertices;\n};\n\ntype GeoDistanceFilter = {\n operator: ElasticsearchGeoOperator.distance;\n data: {\n distance: `${number}${GeoDistanceUnit}`;\n coords: ElasticSearchCoordinates;\n };\n};\n\ntype GeoPolygonFilter = {\n operator: ElasticsearchGeoOperator.polygon;\n data: {\n points: ElasticSearchCoordinates[];\n };\n};\n\nexport type GeoFilter = { fieldId: string } & (\n | GeoBoundingBoxFilter\n | GeoDistanceFilter\n | GeoPolygonFilter\n);\n\nexport type ComplexFilter<OP = ElasticsearchOperator> = {\n condition: ConditionType;\n filters: Array<Filter<OP> | ComplexFilter<OP>>;\n};\n\nexport type SearchResponse<T = any> = {\n took: number;\n timed_out: boolean;\n _scroll_id?: string;\n _shards: unknown;\n hits: {\n total: {\n value: number;\n relation: 'eq' | 'gte';\n };\n max_score: number;\n hits: Array<{\n _index: string;\n _type: string;\n _id: string;\n _score: number;\n _source?: T;\n _version?: number;\n _explanation?: unknown;\n fields?: any;\n highlight?: any;\n inner_hits?: any;\n matched_queries?: string[];\n sort?: Array<string | number>;\n }>;\n };\n aggregations?: { [aggName: string]: object };\n};\n\n///////////////////////////////////////////////////////\n// Search\n///////////////////////////////////////////////////////\n\nexport const FILTER_RANGE_SEPARATOR = '__';\n\nexport enum SortOrder {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport type SortFilter = {\n fieldId: string;\n order: SortOrder;\n};\n\nexport type BaseSearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n};\n\ntype InfiniteSearchRequest = {\n infinite: true;\n nextToken?: string;\n};\n\ntype PaginatedSearchRequest = {\n infinite?: false;\n offset?: number;\n};\n\nexport type SearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n geoFilters?: GeoFilter[];\n sortBy?: SortFilter[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchRequest = {\n fullText: string;\n limit: number;\n} & {\n entityIds: BusinessEntityIds[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchResult = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n title: string;\n description: string;\n tags?: string[];\n};\n\nexport type GlobalSearchByIdRequest = {\n ids: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n }[];\n};\n\nexport type PublicSearchRequest = {\n limit: number;\n offset?: number;\n query?: ComplexFilter;\n sortBy?: SortFilter[];\n};\n\n///////////////////////////////////////////////////////\n// Aggregations\n///////////////////////////////////////////////////////\n\nexport type AggFilterOperator =\n | ElasticsearchOperator.is\n | ElasticsearchOperator.greaterThan\n | ElasticsearchOperator.lessThan\n | ElasticsearchOperator.greaterThanOrEqual\n | ElasticsearchOperator.lessThanEqual;\n\nexport enum AggregationType {\n term = 'TERM',\n range = 'RANGE',\n}\n\nexport type TermAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.term;\n\n orderBy?: 'count' | 'field';\n} & (\n | {\n fieldType: FieldTypes.picklist;\n picklistId: string;\n }\n | {\n fieldType: FieldTypes.number;\n meta?: NumberMeta;\n }\n | {\n fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;\n }\n);\n\nexport type Range =\n | {\n start: number;\n end?: number;\n }\n | {\n start?: number;\n end: number;\n }\n | {\n start: number;\n end: number;\n };\n\nexport type RangeAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.range;\n step: number;\n ranges: Range[];\n format?: NumberMeta;\n};\n\nexport type Aggregation = TermAggregation | RangeAggregation;\n\nexport type AggregationRequest = {\n fullText?: string;\n filters: ComplexFilter<AggFilterOperator>[];\n geoFilters?: GeoFilter[];\n};\n\nexport type AggregationResult = {\n value: string;\n count: number;\n label?: string;\n from?: number;\n to?: number;\n};\n\nexport type AggregationResultSet = {\n [field: string]: AggregationResult[];\n};\n\nexport type AggregationResponse<M = {}> = {\n results: AggregationResultSet;\n meta: M;\n};\n"]}
|
package/lib/servers.js
CHANGED
|
@@ -14,7 +14,7 @@ export var LambdaServer;
|
|
|
14
14
|
LambdaServer[LambdaServer["BECRIS"] = 11] = "BECRIS";
|
|
15
15
|
LambdaServer[LambdaServer["TRACK_AND_TRACE"] = 12] = "TRACK_AND_TRACE";
|
|
16
16
|
LambdaServer[LambdaServer["TASKS"] = 13] = "TASKS";
|
|
17
|
-
})(LambdaServer || (LambdaServer = {}));
|
|
17
|
+
})(LambdaServer = LambdaServer || (LambdaServer = {}));
|
|
18
18
|
export const getServerPort = (server) => 2000 +
|
|
19
19
|
Object.values(LambdaServer)
|
|
20
20
|
.filter((v) => typeof v === 'number')
|
package/lib/servers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.js","sourceRoot":"/","sources":["servers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,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,KAAZ,YAAY,QAevB;AAED,MAAM,CAAC,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","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"]}
|
|
1
|
+
{"version":3,"file":"servers.js","sourceRoot":"/","sources":["servers.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,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,YAAY,KAAZ,YAAY,QAevB;AAED,MAAM,CAAC,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","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/storage.js
CHANGED
|
@@ -2,10 +2,10 @@ export var UploadProviders;
|
|
|
2
2
|
(function (UploadProviders) {
|
|
3
3
|
UploadProviders["Vimeo"] = "vimeo";
|
|
4
4
|
UploadProviders["S3"] = "s3";
|
|
5
|
-
})(UploadProviders || (UploadProviders = {}));
|
|
5
|
+
})(UploadProviders = UploadProviders || (UploadProviders = {}));
|
|
6
6
|
export var MediaExportResolution;
|
|
7
7
|
(function (MediaExportResolution) {
|
|
8
8
|
MediaExportResolution["Low"] = "low";
|
|
9
9
|
MediaExportResolution["High"] = "high";
|
|
10
|
-
})(MediaExportResolution || (MediaExportResolution = {}));
|
|
10
|
+
})(MediaExportResolution = MediaExportResolution || (MediaExportResolution = {}));
|
|
11
11
|
//# sourceMappingURL=storage.js.map
|
package/lib/storage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAsCD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types.js';\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"]}
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,GAAf,eAAe,KAAf,eAAe,QAG1B;AAsCD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,GAArB,qBAAqB,KAArB,qBAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types.js';\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/tasks.js
CHANGED
|
@@ -4,10 +4,10 @@ export var TaskPriority;
|
|
|
4
4
|
TaskPriority[TaskPriority["Normal"] = 30] = "Normal";
|
|
5
5
|
TaskPriority[TaskPriority["High"] = 20] = "High";
|
|
6
6
|
TaskPriority[TaskPriority["Urgent"] = 10] = "Urgent";
|
|
7
|
-
})(TaskPriority || (TaskPriority = {}));
|
|
7
|
+
})(TaskPriority = TaskPriority || (TaskPriority = {}));
|
|
8
8
|
export var TaskStatus;
|
|
9
9
|
(function (TaskStatus) {
|
|
10
10
|
TaskStatus["Open"] = "open";
|
|
11
11
|
TaskStatus["Done"] = "done";
|
|
12
|
-
})(TaskStatus || (TaskStatus = {}));
|
|
12
|
+
})(TaskStatus = TaskStatus || (TaskStatus = {}));
|
|
13
13
|
//# sourceMappingURL=tasks.js.map
|
package/lib/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEpD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB","sourcesContent":["import { BusinessEntityIds } from './constants.js';\nimport { NextRequest } from './types.js';\n\nexport const TASK_REMINDER_ORIGIN = 'task-reminder';\n\nexport enum TaskPriority {\n Normal = 30,\n High = 20,\n Urgent = 10,\n}\n\nexport enum TaskStatus {\n Open = 'open',\n Done = 'done',\n}\n\ntype RecordData = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n};\n\ntype BaseTask = {\n assignee?: string;\n dueDate?: string;\n priority: TaskPriority;\n status: TaskStatus;\n title: string;\n};\n\nexport type TaskUpdate = Partial<\n Omit<BaseTask, 'assignee' | 'dueDate'> & {\n assignee?: string | null;\n dueDate?: string | null;\n }\n>;\n\nexport type NewTask = BaseTask &\n RecordData & {\n createdAt?: undefined;\n createdBy?: undefined;\n id?: undefined;\n };\n\nexport type Task = BaseTask &\n RecordData & {\n createdAt: string;\n createdBy: string;\n deletedAt?: string;\n id: string;\n };\n\nexport type TaskAudit = Partial<Task> & {\n changedAt: string;\n changedBy: string;\n};\n\nexport type TaskNotificationData = {\n snippet?: string;\n taskId: string;\n};\n\nexport type TasksQuery = {\n assignee?: string;\n showDone?: boolean;\n} & NextRequest;\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEpD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,GAAZ,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,GAAV,UAAU,KAAV,UAAU,QAGrB","sourcesContent":["import { BusinessEntityIds } from './constants.js';\nimport { NextRequest } from './types.js';\n\nexport const TASK_REMINDER_ORIGIN = 'task-reminder';\n\nexport enum TaskPriority {\n Normal = 30,\n High = 20,\n Urgent = 10,\n}\n\nexport enum TaskStatus {\n Open = 'open',\n Done = 'done',\n}\n\ntype RecordData = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n};\n\ntype BaseTask = {\n assignee?: string;\n dueDate?: string;\n priority: TaskPriority;\n status: TaskStatus;\n title: string;\n};\n\nexport type TaskUpdate = Partial<\n Omit<BaseTask, 'assignee' | 'dueDate'> & {\n assignee?: string | null;\n dueDate?: string | null;\n }\n>;\n\nexport type NewTask = BaseTask &\n RecordData & {\n createdAt?: undefined;\n createdBy?: undefined;\n id?: undefined;\n };\n\nexport type Task = BaseTask &\n RecordData & {\n createdAt: string;\n createdBy: string;\n deletedAt?: string;\n id: string;\n };\n\nexport type TaskAudit = Partial<Task> & {\n changedAt: string;\n changedBy: string;\n};\n\nexport type TaskNotificationData = {\n snippet?: string;\n taskId: string;\n};\n\nexport type TasksQuery = {\n assignee?: string;\n showDone?: boolean;\n} & NextRequest;\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n"]}
|
package/lib/types.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export var Region;
|
|
2
2
|
(function (Region) {
|
|
3
3
|
Region["euWest1"] = "eu-west-1";
|
|
4
|
-
})(Region || (Region = {}));
|
|
4
|
+
})(Region = Region || (Region = {}));
|
|
5
5
|
export var TransactionType;
|
|
6
6
|
(function (TransactionType) {
|
|
7
7
|
TransactionType["sale"] = "sale";
|
|
8
8
|
TransactionType["purchase"] = "purchase";
|
|
9
|
-
})(TransactionType || (TransactionType = {}));
|
|
9
|
+
})(TransactionType = TransactionType || (TransactionType = {}));
|
|
10
10
|
//# sourceMappingURL=types.js.map
|
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAN,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,KAAN,MAAM,QAEjB;AA8GD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { AppRoles, TopLevelActions } from './constants.js';\nimport { LocationValue } from './locations.js';\n\nexport type { GPSCoord, LocationValue } from './locations.js';\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 NextRequest = {\n limit?: number;\n nextToken?: string;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\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 VatLayerResponseLog = {\n response: VatLayerResponse;\n raw: any;\n};\n\nexport type VatLayerResponse = {\n vatNumber: string;\n viesStatus: 'ok' | 'failure';\n} & (\n | { formatValid: boolean; viesValid: false; validAt?: undefined; countryCode?: string }\n | {\n formatValid: true;\n viesValid: boolean;\n validAt: string;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n viesStatus: 'ok' | 'failure';\n countryCode?: string;\n} & (\n | { viesValid: false; validAt?: undefined }\n | {\n viesValid: true;\n validAt: string;\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 CurrencyListResponse = {\n currencies: Record<string, { label: string }>;\n};\n\nexport type CurrencyConversionRequest = {\n sourceCurrency: string;\n targetCurrency?: string;\n};\n\nexport type CurrencyConversionResponse = {\n sourceCurrency: string;\n rates: Record<string, string>;\n};\n\nexport enum TransactionType {\n sale = 'sale',\n purchase = 'purchase',\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAN,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,MAAM,KAAN,MAAM,QAEjB;AA8GD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,GAAf,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { AppRoles, TopLevelActions } from './constants.js';\nimport { LocationValue } from './locations.js';\n\nexport type { GPSCoord, LocationValue } from './locations.js';\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 NextRequest = {\n limit?: number;\n nextToken?: string;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\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 VatLayerResponseLog = {\n response: VatLayerResponse;\n raw: any;\n};\n\nexport type VatLayerResponse = {\n vatNumber: string;\n viesStatus: 'ok' | 'failure';\n} & (\n | { formatValid: boolean; viesValid: false; validAt?: undefined; countryCode?: string }\n | {\n formatValid: true;\n viesValid: boolean;\n validAt: string;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n viesStatus: 'ok' | 'failure';\n countryCode?: string;\n} & (\n | { viesValid: false; validAt?: undefined }\n | {\n viesValid: true;\n validAt: string;\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 CurrencyListResponse = {\n currencies: Record<string, { label: string }>;\n};\n\nexport type CurrencyConversionRequest = {\n sourceCurrency: string;\n targetCurrency?: string;\n};\n\nexport type CurrencyConversionResponse = {\n sourceCurrency: string;\n rates: Record<string, string>;\n};\n\nexport enum TransactionType {\n sale = 'sale',\n purchase = 'purchase',\n}\n"]}
|
package/lib/utils.js
CHANGED
|
@@ -2,5 +2,5 @@ export var PricePercentageMode;
|
|
|
2
2
|
(function (PricePercentageMode) {
|
|
3
3
|
PricePercentageMode["CURRENCY"] = "currency";
|
|
4
4
|
PricePercentageMode["PERCENTAGE"] = "percentage";
|
|
5
|
-
})(PricePercentageMode || (PricePercentageMode = {}));
|
|
5
|
+
})(PricePercentageMode = PricePercentageMode || (PricePercentageMode = {}));
|
|
6
6
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"/","sources":["utils.ts"],"names":[],"mappings":"AAgDA,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;AAC3B,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B","sourcesContent":["import { AdHocPicklistValueDisplay } from './picklists.js';\nimport { MultiLangValue } from './types.js';\n\nexport type CountryInfo = {\n code: string; // code is ISO 3166-1 alpha-2\n name: string;\n labels: {\n city: string;\n state: string;\n postalCode?: string;\n };\n required: {\n city: boolean;\n state: boolean;\n postalCode: boolean;\n };\n dialCode: number;\n currencyCode: string;\n states?: {\n [code: string]: string; // code is ISO 3166-2\n };\n postalCodeFormat?: string;\n postalCodeEx?: string;\n};\n\nexport type Country = {\n code: string;\n name: string;\n dialCode: number;\n};\n\nexport type ReferenceData = {\n recordTitles: AdHocRecordTitles;\n picklistTitles: AdHocPicklistValueDisplay;\n};\n\nexport type AdHocRecordTitles = {\n [businessEntityId: string]: {\n [recordId: string]: string | MultiLangValue;\n };\n};\n\nexport type DataRecord<T, M = undefined> = {\n record: T;\n meta?: M; // typically ReferenceData\n actions: string[];\n};\n\nexport enum PricePercentageMode {\n CURRENCY = 'currency',\n PERCENTAGE = 'percentage',\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"/","sources":["utils.ts"],"names":[],"mappings":"AAgDA,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;AAC3B,CAAC,EAHW,mBAAmB,GAAnB,mBAAmB,KAAnB,mBAAmB,QAG9B","sourcesContent":["import { AdHocPicklistValueDisplay } from './picklists.js';\nimport { MultiLangValue } from './types.js';\n\nexport type CountryInfo = {\n code: string; // code is ISO 3166-1 alpha-2\n name: string;\n labels: {\n city: string;\n state: string;\n postalCode?: string;\n };\n required: {\n city: boolean;\n state: boolean;\n postalCode: boolean;\n };\n dialCode: number;\n currencyCode: string;\n states?: {\n [code: string]: string; // code is ISO 3166-2\n };\n postalCodeFormat?: string;\n postalCodeEx?: string;\n};\n\nexport type Country = {\n code: string;\n name: string;\n dialCode: number;\n};\n\nexport type ReferenceData = {\n recordTitles: AdHocRecordTitles;\n picklistTitles: AdHocPicklistValueDisplay;\n};\n\nexport type AdHocRecordTitles = {\n [businessEntityId: string]: {\n [recordId: string]: string | MultiLangValue;\n };\n};\n\nexport type DataRecord<T, M = undefined> = {\n record: T;\n meta?: M; // typically ReferenceData\n actions: string[];\n};\n\nexport enum PricePercentageMode {\n CURRENCY = 'currency',\n PERCENTAGE = 'percentage',\n}\n"]}
|
package/package.json
CHANGED
package/src/money.ts
CHANGED
|
@@ -2,3 +2,7 @@ import { Decimal } from 'decimal.js';
|
|
|
2
2
|
|
|
3
3
|
export const roundMoney = (value: Decimal | string) =>
|
|
4
4
|
new Decimal(value).toDecimalPlaces(2, Decimal.ROUND_HALF_EVEN);
|
|
5
|
+
|
|
6
|
+
// We tolerate a 10 cent rounding difference
|
|
7
|
+
export const isAmountWithinToleranceSame = (amount1: Decimal | string, amount2: Decimal | string) =>
|
|
8
|
+
roundMoney(amount1).minus(roundMoney(amount2)).abs().lessThanOrEqualTo(0.1);
|
package/src/notifications.ts
CHANGED