@bisondesk/commons-sdk 1.0.344 → 1.0.346

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.
@@ -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,MAAM,aAAa,CAAC;AAWzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,OAA6B,EACO,EAAE;IACtC,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,0BAA0B,EAAE;QAC/F,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC,IAAI,EAAS,CAAC;IAChC,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,GAA2B,EAAqB,EAAE;IACzF,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAElC,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,wBAAwB,EAAE;QAC7F,MAAM,EAAE,MAAM;QACd,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M,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,CAAC;QAChB,OAAO,QAAQ,CAAC,IAAI,EAAS,CAAC;IAChC,CAAC;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"]}
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,MAAM,aAAa,CAAC;AAWzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,OAA6B,EACO,EAAE;IACtC,MAAM,IAAI,GAAG,MAAM,YAAY,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,MAAM,KAAK,CAAC,GAAG,OA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E,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/becris.d.ts CHANGED
@@ -19,6 +19,11 @@ export type BecrisDeclaration = {
19
19
  newInstruments: number;
20
20
  startDate: string;
21
21
  };
22
+ export type BecrisInstrumentRef = {
23
+ id: string;
24
+ instrumentNumber: string;
25
+ contractId: string;
26
+ };
22
27
  export type BecrisInstrument = {
23
28
  clientId: string;
24
29
  clientExternalId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"becris.d.ts","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,M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,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,gCAAgC,EAAE,MAAM,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
package/lib/becris.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types.js';\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"]}
1
+ {"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types.js';\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 BecrisInstrumentRef = {\n id: string;\n instrumentNumber: string;\n contractId: 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"]}
@@ -7,7 +7,8 @@ export declare enum AppRoles {
7
7
  Commercial = "commercial",
8
8
  Manager = "manager",
9
9
  ParkLogistics = "park_logistics",
10
- SeniorAccountant = "senior_accountant"
10
+ SeniorAccountant = "senior_accountant",
11
+ TrackAndTraceManager = "track_and_trace_manager"
11
12
  }
12
13
  export declare enum TopLevelActions {
13
14
  AdministrationAll = "admin:*",
@@ -1 +1 @@
1
- {"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,CAAC;AAKjF,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAClD,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAKpD,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAC7C,eAAO,MAAM,cAAc,WAAW,CAAC;AAKvC,oBAAY,iBAAiB;IAC3B,kBAAkB,wBAAwB;IAC1C,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,gBAAgB,sBAAsB;IACtC,uBAAuB,6BAA6B;IACpD,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,uBAAuB,8BAA8B;IACrD,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,kBAAkB;IAC9B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;IAC3C,OAAO,YAAY;IACnB,cAAc,oBAAoB;IAClC,oBAAoB,4BAA4B;CACjD;AAKD,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AACxE,eAAO,MAAM,wCAAwC,oCAAoC,CAAC;AAC1F,eAAO,MAAM,+CAA+C,2CAClB,CAAC;AAC3C,eAAO,MAAM,6DAA6D,yDAClB,CAAC;AACzD,eAAO,MAAM,+BAA+B,oCAAoC,CAAC;AACjF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AACpF,eAAO,MAAM,sCAAsC,kCAAkC,CAAC;AACtF,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AAKxF,eAAO,MAAM,oBAAoB,UA6BhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAalD,CAAC;AAEF,eAAO,MAAM,mBAAmB,oBAAoB,CAAC"}
package/lib/constants.js CHANGED
@@ -9,7 +9,8 @@ export var AppRoles;
9
9
  AppRoles["Manager"] = "manager";
10
10
  AppRoles["ParkLogistics"] = "park_logistics";
11
11
  AppRoles["SeniorAccountant"] = "senior_accountant";
12
- })(AppRoles || (AppRoles = {}));
12
+ AppRoles["TrackAndTraceManager"] = "track_and_trace_manager";
13
+ })(AppRoles = AppRoles || (AppRoles = {}));
13
14
  export var TopLevelActions;
14
15
  (function (TopLevelActions) {
15
16
  TopLevelActions["AdministrationAll"] = "admin:*";
@@ -29,7 +30,7 @@ export var TopLevelActions;
29
30
  TopLevelActions["VehicleCreate"] = "vehicle:create";
30
31
  TopLevelActions["TasksAll"] = "tasks:*";
31
32
  TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
32
- })(TopLevelActions || (TopLevelActions = {}));
33
+ })(TopLevelActions = TopLevelActions || (TopLevelActions = {}));
33
34
  export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
34
35
  export const TENANT_ID_ADMIN_HEADER = 'tenant-id';
35
36
  export const SERVICE_ID_ADMIN_HEADER = 'service-id';
@@ -54,7 +55,7 @@ export var BusinessEntityIds;
54
55
  BusinessEntityIds["Debtors"] = "debtors";
55
56
  BusinessEntityIds["DocumentDrafts"] = "document_drafts";
56
57
  BusinessEntityIds["TrackAndTraceDevices"] = "track_and_trace_devices";
57
- })(BusinessEntityIds || (BusinessEntityIds = {}));
58
+ })(BusinessEntityIds = BusinessEntityIds || (BusinessEntityIds = {}));
58
59
  export const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
59
60
  export const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
60
61
  export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,QAUX;AAVD,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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\n AppManager = 'app_manager',\n Board = 'board',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n SeniorAccountant = 'senior_accountant',\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;I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AI;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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gB,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,CAAC;YACnB,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;QACJ,CAAC;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"]}
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,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>;
@@ -1 +1 @@
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,KACjB,QAAQ,CAAC,GAAG,SAAS,CAiBvB,CAAC;AAEF,eAAO,MAAM,YAAY,QAAa,QAAQ,MAAM,CAMnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAa;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,KAAG,MAOxE,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAAE,KAAG,WACF,CAAC"}
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,CAAC;QACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,MAAM,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;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,IAAqB,EAAE;IACtD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,YAAY,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAoC,EAAU,EAAE;IAChF,MAAM,QAAQ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9C,MAAM,IAAI,qBAAqB,CAAC,6BAA6B,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAA8C,EAAe,EAAE,CAC1F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC","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"]}
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;QAChB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,MAAM,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;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,IAAqB,EAAE;IACtD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE;QAC1B,OAAO,EAAE,CAAC;KACX;IAED,OAAO,YAAY,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAoC,EAAU,EAAE;IAChF,MAAM,QAAQ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAC7C,MAAM,IAAI,qBAAqB,CAAC,6BAA6B,CAAC,CAAC;KAChE;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAA8C,EAAe,EAAE,CAC1F,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAyB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC","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"]}
@@ -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
@@ -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,2BAIzC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,WACrB,CAAC;AAEzC,eAAO,MAAM,cAAc,WACjB,MAAM,yDAGL,KAAK,mBAAmB,KAChC,MAWF,CAAC"}
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,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAID,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC,CAAC;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,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;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
+ {"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,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,GAAR,QAAQ,KAAR,QAAQ,QAMnB;AAID,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE;YACf,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC,CAAC;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"]}
@@ -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,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;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"]}
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',
@@ -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,qDA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AAI;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,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
@@ -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;AAoDD,MAAM,CAAN,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;AACvB,CAAC,EAHW,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};\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"]}
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;AAoDD,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};\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')
@@ -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
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/commons-sdk",
3
- "version": "1.0.344",
3
+ "version": "1.0.346",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "npx tsc --build tsconfig.deploy.json",
package/src/becris.ts CHANGED
@@ -23,6 +23,12 @@ export type BecrisDeclaration = {
23
23
  startDate: string;
24
24
  };
25
25
 
26
+ export type BecrisInstrumentRef = {
27
+ id: string;
28
+ instrumentNumber: string;
29
+ contractId: string;
30
+ };
31
+
26
32
  export type BecrisInstrument = {
27
33
  clientId: string;
28
34
  clientExternalId: string;