@bisondesk/commons-sdk 1.0.318 → 1.0.319
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{types/becris.d.ts → becris.d.ts} +1 -1
- package/lib/{types/becris.d.ts.map → becris.d.ts.map} +1 -1
- package/lib/becris.js +1 -2
- package/lib/becris.js.map +1 -1
- package/lib/{types/constants.d.ts → constants.d.ts} +5 -1
- package/lib/constants.d.ts.map +1 -0
- package/lib/constants.js +26 -25
- package/lib/constants.js.map +1 -1
- package/lib/date-utils.d.ts +6 -0
- package/lib/date-utils.d.ts.map +1 -0
- package/lib/date-utils.js +7 -0
- package/lib/date-utils.js.map +1 -0
- package/lib/{types/discussions.d.ts → discussions.d.ts} +1 -1
- package/lib/discussions.d.ts.map +1 -0
- package/lib/discussions.js +1 -4
- package/lib/discussions.js.map +1 -1
- package/lib/{types/errors.d.ts → errors.d.ts} +2 -2
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +7 -17
- package/lib/errors.js.map +1 -1
- package/lib/{types/exact.d.ts → exact.d.ts} +12 -0
- package/lib/{types/exact.d.ts.map → exact.d.ts.map} +1 -1
- package/lib/exact.js +1 -2
- package/lib/exact.js.map +1 -1
- package/lib/{types/fetch.d.ts → fetch.d.ts} +2 -2
- package/lib/fetch.d.ts.map +1 -0
- package/lib/fetch.js +10 -18
- package/lib/fetch.js.map +1 -1
- package/lib/formatting.js +2 -7
- package/lib/formatting.js.map +1 -1
- package/lib/ids.js +5 -9
- package/lib/ids.js.map +1 -1
- package/lib/insurance.js +1 -2
- package/lib/{types/location-utils.d.ts → location-utils.d.ts} +1 -1
- package/lib/{types/location-utils.d.ts.map → location-utils.d.ts.map} +1 -1
- package/lib/location-utils.js +3 -8
- package/lib/location-utils.js.map +1 -1
- package/lib/locations.js +4 -9
- package/lib/locations.js.map +1 -1
- package/lib/{types/messages.d.ts → messages.d.ts} +1 -1
- package/lib/{types/messages.d.ts.map → messages.d.ts.map} +1 -1
- package/lib/messages.js +1 -2
- package/lib/messages.js.map +1 -1
- package/lib/{types/notifications.d.ts → notifications.d.ts} +1 -1
- package/lib/notifications.d.ts.map +1 -0
- package/lib/notifications.js +6 -9
- package/lib/notifications.js.map +1 -1
- package/lib/{types/pdf-gen.d.ts → pdf-gen.d.ts} +6 -2
- package/lib/pdf-gen.d.ts.map +1 -0
- package/lib/pdf-gen.js +1 -2
- package/lib/pdf-gen.js.map +1 -1
- package/lib/servers.js +3 -7
- package/lib/servers.js.map +1 -1
- package/lib/{types/storage.d.ts → storage.d.ts} +1 -1
- package/lib/{types/storage.d.ts.map → storage.d.ts.map} +1 -1
- package/lib/storage.js +4 -7
- package/lib/storage.js.map +1 -1
- package/lib/{types/tasks.d.ts → tasks.d.ts} +3 -4
- package/lib/tasks.d.ts.map +1 -0
- package/lib/tasks.js +4 -7
- package/lib/tasks.js.map +1 -1
- package/lib/{types/types.d.ts → types.d.ts} +22 -6
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +7 -5
- package/lib/types.js.map +1 -1
- package/package.json +12 -21
- package/src/becris.ts +1 -1
- package/src/constants.ts +4 -0
- package/src/date-utils.ts +14 -0
- package/src/discussions.ts +1 -1
- package/src/errors.ts +3 -3
- package/src/exact.ts +15 -0
- package/src/fetch.ts +4 -5
- package/src/location-utils.ts +1 -1
- package/src/messages.ts +1 -1
- package/src/notifications.ts +1 -1
- package/src/pdf-gen.ts +7 -2
- package/src/storage.ts +1 -1
- package/src/tasks.ts +3 -4
- package/src/types.ts +25 -7
- package/tsconfig.deploy.json +4 -0
- package/tsconfig.deploy.tsbuildinfo +1 -0
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/becris.js +0 -3
- package/lib/cjs/becris.js.map +0 -1
- package/lib/cjs/constants.js +0 -107
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/dayjs-utils.js +0 -26
- package/lib/cjs/dayjs-utils.js.map +0 -1
- package/lib/cjs/discussions.js +0 -5
- package/lib/cjs/discussions.js.map +0 -1
- package/lib/cjs/errors.js +0 -67
- package/lib/cjs/errors.js.map +0 -1
- package/lib/cjs/exact.js +0 -3
- package/lib/cjs/exact.js.map +0 -1
- package/lib/cjs/fetch.js +0 -40
- package/lib/cjs/fetch.js.map +0 -1
- package/lib/cjs/formatting.js +0 -20
- package/lib/cjs/formatting.js.map +0 -1
- package/lib/cjs/ids.js +0 -35
- package/lib/cjs/ids.js.map +0 -1
- package/lib/cjs/insurance.js +0 -3
- package/lib/cjs/insurance.js.map +0 -1
- package/lib/cjs/location-utils.js +0 -21
- package/lib/cjs/location-utils.js.map +0 -1
- package/lib/cjs/locations.js +0 -95
- package/lib/cjs/locations.js.map +0 -1
- package/lib/cjs/messages.js +0 -3
- package/lib/cjs/messages.js.map +0 -1
- package/lib/cjs/notifications.js +0 -18
- package/lib/cjs/notifications.js.map +0 -1
- package/lib/cjs/pdf-gen.js +0 -3
- package/lib/cjs/pdf-gen.js.map +0 -1
- package/lib/cjs/servers.js +0 -26
- package/lib/cjs/servers.js.map +0 -1
- package/lib/cjs/storage.js +0 -14
- package/lib/cjs/storage.js.map +0 -1
- package/lib/cjs/tasks.js +0 -15
- package/lib/cjs/tasks.js.map +0 -1
- package/lib/cjs/types.js +0 -8
- package/lib/cjs/types.js.map +0 -1
- package/lib/dayjs-utils.js +0 -25
- package/lib/dayjs-utils.js.map +0 -1
- package/lib/esm/becris.js +0 -2
- package/lib/esm/becris.js.map +0 -1
- package/lib/esm/constants.js +0 -104
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/dayjs-utils.js +0 -18
- package/lib/esm/dayjs-utils.js.map +0 -1
- package/lib/esm/discussions.js +0 -2
- package/lib/esm/discussions.js.map +0 -1
- package/lib/esm/errors.js +0 -57
- package/lib/esm/errors.js.map +0 -1
- package/lib/esm/exact.js +0 -2
- package/lib/esm/exact.js.map +0 -1
- package/lib/esm/fetch.js +0 -32
- package/lib/esm/fetch.js.map +0 -1
- package/lib/esm/formatting.js +0 -15
- package/lib/esm/formatting.js.map +0 -1
- package/lib/esm/ids.js +0 -31
- package/lib/esm/ids.js.map +0 -1
- package/lib/esm/insurance.js +0 -2
- package/lib/esm/insurance.js.map +0 -1
- package/lib/esm/location-utils.js +0 -16
- package/lib/esm/location-utils.js.map +0 -1
- package/lib/esm/locations.js +0 -90
- package/lib/esm/locations.js.map +0 -1
- package/lib/esm/messages.js +0 -2
- package/lib/esm/messages.js.map +0 -1
- package/lib/esm/notifications.js +0 -15
- package/lib/esm/notifications.js.map +0 -1
- package/lib/esm/pdf-gen.js +0 -2
- package/lib/esm/pdf-gen.js.map +0 -1
- package/lib/esm/servers.js +0 -22
- package/lib/esm/servers.js.map +0 -1
- package/lib/esm/storage.js +0 -11
- package/lib/esm/storage.js.map +0 -1
- package/lib/esm/tasks.js +0 -12
- package/lib/esm/tasks.js.map +0 -1
- package/lib/esm/types.js +0 -5
- package/lib/esm/types.js.map +0 -1
- package/lib/tsconfig.cjs.tsbuildinfo +0 -1
- package/lib/tsconfig.esm.tsbuildinfo +0 -1
- package/lib/types/constants.d.ts.map +0 -1
- package/lib/types/dayjs-utils.d.ts +0 -8
- package/lib/types/dayjs-utils.d.ts.map +0 -1
- package/lib/types/discussions.d.ts.map +0 -1
- package/lib/types/errors.d.ts.map +0 -1
- package/lib/types/fetch.d.ts.map +0 -1
- package/lib/types/notifications.d.ts.map +0 -1
- package/lib/types/pdf-gen.d.ts.map +0 -1
- package/lib/types/tasks.d.ts.map +0 -1
- package/lib/types/types.d.ts.map +0 -1
- package/src/dayjs-utils.ts +0 -30
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.esm.json +0 -8
- /package/lib/{types/formatting.d.ts → formatting.d.ts} +0 -0
- /package/lib/{types/formatting.d.ts.map → formatting.d.ts.map} +0 -0
- /package/lib/{types/ids.d.ts → ids.d.ts} +0 -0
- /package/lib/{types/ids.d.ts.map → ids.d.ts.map} +0 -0
- /package/lib/{types/insurance.d.ts → insurance.d.ts} +0 -0
- /package/lib/{types/insurance.d.ts.map → insurance.d.ts.map} +0 -0
- /package/lib/{types/locations.d.ts → locations.d.ts} +0 -0
- /package/lib/{types/locations.d.ts.map → locations.d.ts.map} +0 -0
- /package/lib/{types/servers.d.ts → servers.d.ts} +0 -0
- /package/lib/{types/servers.d.ts.map → servers.d.ts.map} +0 -0
package/lib/cjs/tasks.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskStatus = exports.TaskPriority = void 0;
|
|
4
|
-
var TaskPriority;
|
|
5
|
-
(function (TaskPriority) {
|
|
6
|
-
TaskPriority[TaskPriority["Normal"] = 30] = "Normal";
|
|
7
|
-
TaskPriority[TaskPriority["High"] = 20] = "High";
|
|
8
|
-
TaskPriority[TaskPriority["Urgent"] = 10] = "Urgent";
|
|
9
|
-
})(TaskPriority = exports.TaskPriority || (exports.TaskPriority = {}));
|
|
10
|
-
var TaskStatus;
|
|
11
|
-
(function (TaskStatus) {
|
|
12
|
-
TaskStatus["Open"] = "open";
|
|
13
|
-
TaskStatus["Done"] = "done";
|
|
14
|
-
})(TaskStatus = exports.TaskStatus || (exports.TaskStatus = {}));
|
|
15
|
-
//# sourceMappingURL=tasks.js.map
|
package/lib/cjs/tasks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"/","sources":["tasks.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,oDAAW,CAAA;IACX,gDAAS,CAAA;IACT,oDAAW,CAAA;AACb,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB","sourcesContent":["import { BusinessEntityIds } from './constants';\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};\n\nexport type TasksQuery = {\n limit?: number;\n nextToken?: string;\n assignee?: string;\n showDone?: boolean;\n};\n\nexport type AssigneeTasksBetweenDatesQuery = {\n assignee: string;\n start: string;\n end: string;\n};\n"]}
|
package/lib/cjs/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Region = void 0;
|
|
4
|
-
var Region;
|
|
5
|
-
(function (Region) {
|
|
6
|
-
Region["euWest1"] = "eu-west-1";
|
|
7
|
-
})(Region = exports.Region || (exports.Region = {}));
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
package/lib/cjs/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":";;;AA8CA,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,GAAN,cAAM,KAAN,cAAM,QAEjB","sourcesContent":["import { AppRoles, TopLevelActions } from './constants';\nimport { LocationValue } from './locations';\nexport { GPSCoord, LocationValue } from './locations';\n\nexport type PaginatedList<T, M = {}> = {\n results: T[];\n nextToken?: undefined;\n meta: M;\n totalCount: number;\n};\n\nexport type PaginationRequest = {\n limit: number;\n offset: number;\n};\n\nexport type NextList<T, M = {}> = {\n results: T[];\n nextToken?: string;\n meta: M;\n totalCount?: number;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\n};\n\nexport type Requester = {\n lang: string;\n roles: AppRoles[];\n actions: TopLevelActions[];\n tenantId: string;\n tenantLang: string;\n userAgent?: string;\n source?: string;\n userId: string;\n isApi: boolean;\n};\n\nexport type Option = {\n value: string | number;\n label: string;\n color?: string;\n};\n\nexport enum Region {\n euWest1 = 'eu-west-1',\n}\n\nexport type ErrorResponse = {\n message?: string;\n data?: unknown;\n};\n\nexport type MultiLangValue = { key?: string } & { [languageCode: string]: string };\n\nexport type CognitoInfo = {\n userPoolId: string;\n appClientId: string;\n region: Region;\n};\n\nexport type SearchPermissions = {\n users: string[];\n roles: AppRoles[];\n};\n\nexport type PhoneNumberValue = {\n country: string;\n e164: string;\n international: string;\n national: string;\n};\n\nexport type PhoneNumberRawValue = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type LinkValue = {\n text?: string;\n url: string;\n};\n\nexport type Document = {\n type: string; // passport, driving_license, ...\n displayName: string;\n file: AttachmentValue;\n};\n\nexport type AttachmentValue = {\n contentType: string;\n fileName: string;\n id: string;\n previewSrc?: string;\n size: number;\n uploadedAt: string;\n uploadedBy: string;\n url: string;\n descriptions?: string | MultiLangValue;\n};\n\nexport type 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 CurrencyLayerResponse = {\n conversionRate: number;\n targetCurrency: string;\n sourceCurrency: string;\n};\n"]}
|
package/lib/dayjs-utils.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.businessDaysAdd = exports.isBetween = exports.isSameOrBefore = exports.isSameOrAfter = exports.utc = exports.tz = void 0;
|
|
4
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
5
|
-
const dayjs_business_days_1 = __importDefault(require("dayjs-business-days"));
|
|
6
|
-
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
7
|
-
const isoWeek_1 = __importDefault(require("dayjs/plugin/isoWeek"));
|
|
8
|
-
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
9
|
-
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
10
|
-
dayjs_1.default.extend(dayjs_business_days_1.default);
|
|
11
|
-
dayjs_1.default.extend(isoWeek_1.default);
|
|
12
|
-
dayjs_1.default.extend(customParseFormat_1.default);
|
|
13
|
-
dayjs_1.default.extend(utc_1.default);
|
|
14
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
15
|
-
exports.tz = dayjs_1.default.tz;
|
|
16
|
-
exports.utc = dayjs_1.default.utc;
|
|
17
|
-
const isSameOrAfter = (value, reference) => value.isAfter(reference) || value.isSame(reference);
|
|
18
|
-
exports.isSameOrAfter = isSameOrAfter;
|
|
19
|
-
const isSameOrBefore = (value, reference) => value.isBefore(reference) || value.isSame(reference);
|
|
20
|
-
exports.isSameOrBefore = isSameOrBefore;
|
|
21
|
-
const isBetween = (value, startInclusive, endExclusive) => (0, exports.isSameOrAfter)(value, startInclusive) && value.isBefore(endExclusive);
|
|
22
|
-
exports.isBetween = isBetween;
|
|
23
|
-
const businessDaysAdd = (value, days) => value.businessDaysAdd(days);
|
|
24
|
-
exports.businessDaysAdd = businessDaysAdd;
|
|
25
|
-
//# sourceMappingURL=dayjs-utils.js.map
|
package/lib/dayjs-utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs-utils.js","sourceRoot":"/","sources":["dayjs-utils.ts"],"names":[],"mappings":";;;AAAA,kDAAqC;AACrC,8EAAoD;AACpD,uFAA+D;AAC/D,mEAA2C;AAC3C,qEAA6C;AAC7C,2DAAwC;AAExC,eAAK,CAAC,MAAM,CAAC,6BAAiB,CAAC,CAAC;AAChC,eAAK,CAAC,MAAM,CAAC,iBAAO,CAAC,CAAC;AACtB,eAAK,CAAC,MAAM,CAAC,2BAAiB,CAAC,CAAC;AAChC,eAAK,CAAC,MAAM,CAAC,aAAQ,CAAC,CAAC;AACvB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAIV,QAAA,EAAE,GAAG,eAAK,CAAC,EAAE,CAAC;AAEd,QAAA,GAAG,GAAG,eAAK,CAAC,GAAG,CAAC;AAEtB,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACvE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AADzC,QAAA,aAAa,iBAC4B;AAE/C,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACxE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAD1C,QAAA,cAAc,kBAC4B;AAEhD,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,cAAqB,EAAE,YAAmB,EAAW,EAAE,CAC7F,IAAA,qBAAa,EAAC,KAAK,EAAE,cAAc,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAD1D,QAAA,SAAS,aACiD;AAEhE,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,IAAY,EAAS,EAAE,CAClE,KAAa,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAD1B,QAAA,eAAe,mBACW","sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\nimport dayjsBusinessDays from 'dayjs-business-days';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport IsoWeek from 'dayjs/plugin/isoWeek';\nimport timezone from 'dayjs/plugin/timezone';\nimport dayjsUtc from 'dayjs/plugin/utc';\n\ndayjs.extend(dayjsBusinessDays);\ndayjs.extend(IsoWeek);\ndayjs.extend(customParseFormat);\ndayjs.extend(dayjsUtc);\ndayjs.extend(timezone);\n\n// Exists only to make Typescript happy, otherwise the build would fail with\n// \"Property 'tz' does not exist on type 'Dayjs'\"\nexport const tz = dayjs.tz;\n\nexport const utc = dayjs.utc;\n\nexport const isSameOrAfter = (value: Dayjs, reference: Dayjs): boolean =>\n value.isAfter(reference) || value.isSame(reference);\n\nexport const isSameOrBefore = (value: Dayjs, reference: Dayjs): boolean =>\n value.isBefore(reference) || value.isSame(reference);\n\nexport const isBetween = (value: Dayjs, startInclusive: Dayjs, endExclusive: Dayjs): boolean =>\n isSameOrAfter(value, startInclusive) && value.isBefore(endExclusive);\n\nexport const businessDaysAdd = (value: Dayjs, days: number): Dayjs =>\n (value as any).businessDaysAdd(days);\n"]}
|
package/lib/esm/becris.js
DELETED
package/lib/esm/becris.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"becris.js","sourceRoot":"/","sources":["becris.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type LeasingCreditorBranch = {\n bciNumber: string;\n vatNumber: string;\n licenceDate: string;\n becrisFirstReportDate: string;\n becrisStartDate: string;\n};\n\nexport type LeasingCreditorSettings = {\n [branchId: string]: LeasingCreditorBranch;\n};\n\nexport type BecrisDeclaration = {\n createdAt: string;\n endDate: string;\n endingInstruments: number;\n existingInstruments: number;\n file: AttachmentValue;\n id: string;\n newInstruments: number;\n startDate: string;\n};\n\nexport type BecrisInstrument = {\n clientId: string;\n clientExternalId: string;\n contractId: string;\n contractNumber: string;\n endDate?: string;\n id: string; // Hyperportal's LCT process id if it exists, otherwise the contract id\n inceptionDate: string;\n instrumentNumber: string;\n legalFinalMaturityDate: string;\n outstandingNominalAmount: string; // updated when creating a new declaration\n settlementDate: string;\n totalCommitmentAmountAtInception: string;\n vatNumber: string;\n\n /**\n * Becris state\n */\n active: boolean; // false if undeclaredAt is not null, useful for filtering in dynamodb\n declaredAt?: string;\n undeclaredAt?: string;\n};\n"]}
|
package/lib/esm/constants.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export var AppRoles;
|
|
2
|
-
(function (AppRoles) {
|
|
3
|
-
AppRoles["Accountant"] = "accountant";
|
|
4
|
-
AppRoles["Admin"] = "admins";
|
|
5
|
-
AppRoles["Administrative"] = "administrative";
|
|
6
|
-
AppRoles["Commercial"] = "commercial";
|
|
7
|
-
AppRoles["Manager"] = "manager";
|
|
8
|
-
AppRoles["ParkLogistics"] = "park_logistics";
|
|
9
|
-
AppRoles["AppManager"] = "app_manager";
|
|
10
|
-
})(AppRoles || (AppRoles = {}));
|
|
11
|
-
export var TopLevelActions;
|
|
12
|
-
(function (TopLevelActions) {
|
|
13
|
-
TopLevelActions["AdministrationAll"] = "admin:*";
|
|
14
|
-
TopLevelActions["DocumentsBrowse"] = "docs:finance:browse";
|
|
15
|
-
TopLevelActions["LeadsAll"] = "leads:*";
|
|
16
|
-
TopLevelActions["LeasingDebtorsView"] = "leasing:debtors:view";
|
|
17
|
-
TopLevelActions["LeasingOverduesView"] = "leasing:overdues:view";
|
|
18
|
-
TopLevelActions["LeasingContractsExport"] = "leasing:contracts:export";
|
|
19
|
-
TopLevelActions["LeasingContractsRsExport"] = "leasing:contracts:rs:export-rs";
|
|
20
|
-
TopLevelActions["LeasingDebtorsExport"] = "leasing:debtors:export";
|
|
21
|
-
TopLevelActions["MarketBrowse"] = "market:browse";
|
|
22
|
-
TopLevelActions["MarketInsights"] = "insights:market";
|
|
23
|
-
TopLevelActions["VehicleInsights"] = "insights:vehicle";
|
|
24
|
-
TopLevelActions["SettingsAll"] = "settings:*";
|
|
25
|
-
TopLevelActions["VehicleCreate"] = "vehicle:create";
|
|
26
|
-
TopLevelActions["TasksAll"] = "tasks:*";
|
|
27
|
-
TopLevelActions["TrackAndTraceDevices"] = "tt:devices:*";
|
|
28
|
-
})(TopLevelActions || (TopLevelActions = {}));
|
|
29
|
-
export const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'];
|
|
30
|
-
export const TENANT_ID_ADMIN_HEADER = 'tenant-id';
|
|
31
|
-
export const SERVICE_ID_ADMIN_HEADER = 'service-id';
|
|
32
|
-
export const NO_TENANT_ID_VALUE = 'notenant';
|
|
33
|
-
export const SYSTEM_USER_ID = 'system';
|
|
34
|
-
export var BusinessEntityIds;
|
|
35
|
-
(function (BusinessEntityIds) {
|
|
36
|
-
BusinessEntityIds["BecrisDeclarations"] = "becris_declarations";
|
|
37
|
-
BusinessEntityIds["Contacts"] = "contacts";
|
|
38
|
-
BusinessEntityIds["Emails"] = "emails";
|
|
39
|
-
BusinessEntityIds["FinanceDocuments"] = "finance_documents";
|
|
40
|
-
BusinessEntityIds["InternetVehicles"] = "internet-vehicles";
|
|
41
|
-
BusinessEntityIds["LeasingContracts"] = "leasing_contracts";
|
|
42
|
-
BusinessEntityIds["LeasingUploadAutomation"] = "leasing_upload_automation";
|
|
43
|
-
BusinessEntityIds["Opportunities"] = "opportunities";
|
|
44
|
-
BusinessEntityIds["Organizations"] = "organizations";
|
|
45
|
-
BusinessEntityIds["PdfTemplates"] = "pdf_templates";
|
|
46
|
-
BusinessEntityIds["Users"] = "users";
|
|
47
|
-
BusinessEntityIds["Vehicles"] = "vehicles";
|
|
48
|
-
BusinessEntityIds["VehiclesPriceLists"] = "vehicles_price_lists";
|
|
49
|
-
BusinessEntityIds["Debtors"] = "debtors";
|
|
50
|
-
})(BusinessEntityIds || (BusinessEntityIds = {}));
|
|
51
|
-
export const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';
|
|
52
|
-
export const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';
|
|
53
|
-
export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID = 'leasing_contract_amortization_template';
|
|
54
|
-
export const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID = 'leasing_contract_amortization_print_version_template';
|
|
55
|
-
export const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';
|
|
56
|
-
export const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';
|
|
57
|
-
export const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';
|
|
58
|
-
export const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';
|
|
59
|
-
export const EU_VAT_COUNTRY_CODES = [
|
|
60
|
-
'at',
|
|
61
|
-
'be',
|
|
62
|
-
'bg',
|
|
63
|
-
'hr',
|
|
64
|
-
'cy',
|
|
65
|
-
'cz',
|
|
66
|
-
'dk',
|
|
67
|
-
'ee',
|
|
68
|
-
'fi',
|
|
69
|
-
'fr',
|
|
70
|
-
'de',
|
|
71
|
-
'el',
|
|
72
|
-
'hu',
|
|
73
|
-
'ie',
|
|
74
|
-
'it',
|
|
75
|
-
'lv',
|
|
76
|
-
'lt',
|
|
77
|
-
'lu',
|
|
78
|
-
'mt',
|
|
79
|
-
'nl',
|
|
80
|
-
'pl',
|
|
81
|
-
'pt',
|
|
82
|
-
'ro',
|
|
83
|
-
'sk',
|
|
84
|
-
'si',
|
|
85
|
-
'es',
|
|
86
|
-
'se',
|
|
87
|
-
'xi',
|
|
88
|
-
];
|
|
89
|
-
export const HEXON_LANG_CODES = [
|
|
90
|
-
'en',
|
|
91
|
-
'nl',
|
|
92
|
-
'de',
|
|
93
|
-
'fr',
|
|
94
|
-
'es',
|
|
95
|
-
'pt',
|
|
96
|
-
'it',
|
|
97
|
-
'pl',
|
|
98
|
-
'ru',
|
|
99
|
-
'ro',
|
|
100
|
-
'el',
|
|
101
|
-
'bg',
|
|
102
|
-
];
|
|
103
|
-
export const DEFAULT_SLB_PARTNER = 'To be announced';
|
|
104
|
-
//# sourceMappingURL=constants.js.map
|
package/lib/esm/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"/","sources":["constants.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,4BAAgB,CAAA;IAChB,6CAAiC,CAAA;IACjC,qCAAyB,CAAA;IACzB,+BAAmB,CAAA;IACnB,4CAAgC,CAAA;IAChC,sCAA0B,CAAA;AAC5B,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,CAAN,IAAY,eAgBX;AAhBD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,0DAAuC,CAAA;IACvC,uCAAoB,CAAA;IACpB,8DAA2C,CAAA;IAC3C,gEAA6C,CAAA;IAC7C,sEAAmD,CAAA;IACnD,8EAA2D,CAAA;IAC3D,kEAA+C,CAAA;IAC/C,iDAA8B,CAAA;IAC9B,qDAAkC,CAAA;IAClC,uDAAoC,CAAA;IACpC,6CAA0B,CAAA;IAC1B,mDAAgC,CAAA;IAChC,uCAAoB,CAAA;IACpB,wDAAqC,CAAA;AACvC,CAAC,EAhBW,eAAe,KAAf,eAAe,QAgB1B;AAKD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAKjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAKpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AAKvC,MAAM,CAAN,IAAY,iBAeX;AAfD,WAAY,iBAAiB;IAC3B,+DAA0C,CAAA;IAC1C,0CAAqB,CAAA;IACrB,sCAAiB,CAAA;IACjB,2DAAsC,CAAA;IACtC,2DAAsC,CAAA;IACtC,2DAAsC,CAAA;IACtC,0EAAqD,CAAA;IACrD,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;IAC/B,mDAA8B,CAAA;IAC9B,oCAAe,CAAA;IACf,0CAAqB,CAAA;IACrB,gEAA2C,CAAA;IAC3C,wCAAmB,CAAA;AACrB,CAAC,EAfW,iBAAiB,KAAjB,iBAAiB,QAe5B;AAKD,MAAM,CAAC,MAAM,+BAA+B,GAAG,wBAAwB,CAAC;AACxE,MAAM,CAAC,MAAM,wCAAwC,GAAG,iCAAiC,CAAC;AAC1F,MAAM,CAAC,MAAM,+CAA+C,GAC1D,wCAAwC,CAAC;AAC3C,MAAM,CAAC,MAAM,6DAA6D,GACxE,sDAAsD,CAAC;AACzD,MAAM,CAAC,MAAM,+BAA+B,GAAG,iCAAiC,CAAC;AACjF,MAAM,CAAC,MAAM,qCAAqC,GAAG,8BAA8B,CAAC;AACpF,MAAM,CAAC,MAAM,sCAAsC,GAAG,+BAA+B,CAAC;AACtF,MAAM,CAAC,MAAM,uCAAuC,GAAG,gCAAgC,CAAC;AAKxF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA0B;IACrD,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC","sourcesContent":["//\n// STATIC ROLES\n//\nexport enum AppRoles {\n Accountant = 'accountant',\n Admin = 'admins',\n Administrative = 'administrative',\n Commercial = 'commercial',\n Manager = 'manager',\n ParkLogistics = 'park_logistics',\n AppManager = 'app_manager',\n}\n\nexport enum TopLevelActions {\n AdministrationAll = 'admin:*',\n DocumentsBrowse = 'docs:finance:browse',\n LeadsAll = 'leads:*',\n LeasingDebtorsView = 'leasing:debtors:view',\n LeasingOverduesView = 'leasing:overdues:view',\n LeasingContractsExport = 'leasing:contracts:export',\n LeasingContractsRsExport = 'leasing:contracts:rs:export-rs', // rs stands for rental solutions\n LeasingDebtorsExport = 'leasing:debtors:export',\n MarketBrowse = 'market:browse',\n MarketInsights = 'insights:market',\n VehicleInsights = 'insights:vehicle',\n SettingsAll = 'settings:*',\n VehicleCreate = 'vehicle:create',\n TasksAll = 'tasks:*',\n TrackAndTraceDevices = 'tt:devices:*',\n}\n\n//\n// I18N\n//\nexport const SUPPORTED_LANGUAGES = ['en', 'fr', 'nl', 'es', 'de', 'pt'] as const;\n\n//\n// Headers\n//\nexport const TENANT_ID_ADMIN_HEADER = 'tenant-id';\nexport const SERVICE_ID_ADMIN_HEADER = 'service-id';\n\n//\n// AUTH\n//\nexport const NO_TENANT_ID_VALUE = 'notenant';\nexport const SYSTEM_USER_ID = 'system';\n\n//\n// Business Entity IDs\n//\nexport enum BusinessEntityIds {\n BecrisDeclarations = 'becris_declarations',\n Contacts = 'contacts',\n Emails = 'emails',\n FinanceDocuments = 'finance_documents',\n InternetVehicles = 'internet-vehicles',\n LeasingContracts = 'leasing_contracts',\n LeasingUploadAutomation = 'leasing_upload_automation',\n Opportunities = 'opportunities',\n Organizations = 'organizations',\n PdfTemplates = 'pdf_templates',\n Users = 'users',\n Vehicles = 'vehicles',\n VehiclesPriceLists = 'vehicles_price_lists',\n Debtors = 'debtors',\n}\n\n//\n// PDF Templates IDs\n//\nexport const LEASING_QUOTE_TEMPLATE_GROUP_ID = 'leasing_quote_template';\nexport const LEASING_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'leasing_quote_proforma_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_GROUP_ID =\n 'leasing_contract_amortization_template';\nexport const LEASING_CONTRACT_AMORTIZATION_TEMPLATE_PRINT_VERSION_GROUP_ID =\n 'leasing_contract_amortization_print_version_template';\nexport const LEASING_QUOTE_LOCATION_TEMPLATE = 'leasing_quote_location_template';\nexport const LEASING_CONTRACT_TC_TEMPLATE_GROUP_ID = 'leasing_contract_tc_template';\nexport const SALES_QUOTE_PROFORMA_TEMPLATE_GROUP_ID = 'sales_quote_proforma_template';\nexport const SALES_QUOTE_AGREEMENT_TEMPLATE_GROUP_ID = 'sales_quote_agreement_template';\n\n//\n// VAT Prefixes for EU Countries and Great Britain & Northern Ireland\n//\nexport const EU_VAT_COUNTRY_CODES = [\n 'at',\n 'be',\n 'bg',\n 'hr',\n 'cy',\n 'cz',\n 'dk',\n 'ee',\n 'fi',\n 'fr',\n 'de',\n 'el',\n 'hu',\n 'ie',\n 'it',\n 'lv',\n 'lt',\n 'lu',\n 'mt',\n 'nl',\n 'pl',\n 'pt',\n 'ro',\n 'sk',\n 'si',\n 'es',\n 'se',\n 'xi', // Northern Ireland\n];\n\nexport const HEXON_LANG_CODES: [string, ...string[]] = [\n 'en',\n 'nl',\n 'de',\n 'fr',\n 'es',\n 'pt',\n 'it',\n 'pl',\n 'ru',\n 'ro',\n 'el',\n 'bg',\n];\n\nexport const DEFAULT_SLB_PARTNER = 'To be announced';\n"]}
|
package/lib/esm/dayjs-utils.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import dayjsBusinessDays from 'dayjs-business-days';
|
|
3
|
-
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
4
|
-
import IsoWeek from 'dayjs/plugin/isoWeek';
|
|
5
|
-
import timezone from 'dayjs/plugin/timezone';
|
|
6
|
-
import dayjsUtc from 'dayjs/plugin/utc';
|
|
7
|
-
dayjs.extend(dayjsBusinessDays);
|
|
8
|
-
dayjs.extend(IsoWeek);
|
|
9
|
-
dayjs.extend(customParseFormat);
|
|
10
|
-
dayjs.extend(dayjsUtc);
|
|
11
|
-
dayjs.extend(timezone);
|
|
12
|
-
export const tz = dayjs.tz;
|
|
13
|
-
export const utc = dayjs.utc;
|
|
14
|
-
export const isSameOrAfter = (value, reference) => value.isAfter(reference) || value.isSame(reference);
|
|
15
|
-
export const isSameOrBefore = (value, reference) => value.isBefore(reference) || value.isSame(reference);
|
|
16
|
-
export const isBetween = (value, startInclusive, endExclusive) => isSameOrAfter(value, startInclusive) && value.isBefore(endExclusive);
|
|
17
|
-
export const businessDaysAdd = (value, days) => value.businessDaysAdd(days);
|
|
18
|
-
//# sourceMappingURL=dayjs-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dayjs-utils.js","sourceRoot":"/","sources":["dayjs-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AACrC,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAExC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtB,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAIvB,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;AAE3B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACvE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAEtD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,SAAgB,EAAW,EAAE,CACxE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,cAAqB,EAAE,YAAmB,EAAW,EAAE,CAC7F,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,IAAY,EAAS,EAAE,CAClE,KAAa,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import dayjs, { Dayjs } from 'dayjs';\nimport dayjsBusinessDays from 'dayjs-business-days';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport IsoWeek from 'dayjs/plugin/isoWeek';\nimport timezone from 'dayjs/plugin/timezone';\nimport dayjsUtc from 'dayjs/plugin/utc';\n\ndayjs.extend(dayjsBusinessDays);\ndayjs.extend(IsoWeek);\ndayjs.extend(customParseFormat);\ndayjs.extend(dayjsUtc);\ndayjs.extend(timezone);\n\n// Exists only to make Typescript happy, otherwise the build would fail with\n// \"Property 'tz' does not exist on type 'Dayjs'\"\nexport const tz = dayjs.tz;\n\nexport const utc = dayjs.utc;\n\nexport const isSameOrAfter = (value: Dayjs, reference: Dayjs): boolean =>\n value.isAfter(reference) || value.isSame(reference);\n\nexport const isSameOrBefore = (value: Dayjs, reference: Dayjs): boolean =>\n value.isBefore(reference) || value.isSame(reference);\n\nexport const isBetween = (value: Dayjs, startInclusive: Dayjs, endExclusive: Dayjs): boolean =>\n isSameOrAfter(value, startInclusive) && value.isBefore(endExclusive);\n\nexport const businessDaysAdd = (value: Dayjs, days: number): Dayjs =>\n (value as any).businessDaysAdd(days);\n"]}
|
package/lib/esm/discussions.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discussions.js","sourceRoot":"/","sources":["discussions.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport type Discussion = {\n businessEntityId: BusinessEntityIds;\n createdAt: string;\n followers: string[];\n id: string;\n recordId: string;\n title?: string;\n};\n\nexport type DiscussionData = {\n discussion: Discussion;\n messages: Message[];\n};\n\nexport type NewDiscussion = {\n businessEntityId: BusinessEntityIds;\n content: MessageContent;\n recordId: string;\n title?: string;\n followers: string[];\n};\n\nexport type Message = {\n author: string;\n content?: MessageContent; // optional if the content is deleted\n createdAt: string;\n deletedAt?: string;\n id: string;\n};\n\nexport type MessageContent = {\n value: string;\n mentions: string[];\n};\n\nexport const MESSAGE_NOTIFICATION_ORIGIN = 'message';\n\nexport type MessageNotificationData = {\n snippet: string;\n id: string;\n mention?: boolean;\n};\n\nexport type NewDiscussionEvent = {\n discussion: NewDiscussion;\n tenantId: string;\n author: string;\n};\n"]}
|
package/lib/esm/errors.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export class XError extends Error {
|
|
2
|
-
constructor(message, errorCtx) {
|
|
3
|
-
super(message);
|
|
4
|
-
this.name = 'XError';
|
|
5
|
-
this.errorCtx = errorCtx;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
export class WrappedError extends Error {
|
|
9
|
-
constructor(err, errorCtx) {
|
|
10
|
-
super(err.message);
|
|
11
|
-
this.name = err.name;
|
|
12
|
-
this.stack = err.stack;
|
|
13
|
-
this.errorCtx = errorCtx;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export class AsyncStopError extends Error {
|
|
17
|
-
constructor(message) {
|
|
18
|
-
super(message);
|
|
19
|
-
this.name = 'AsyncStopError';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export class ForbiddenError extends Error {
|
|
23
|
-
constructor(message) {
|
|
24
|
-
super(message);
|
|
25
|
-
this.name = 'ForbiddenError';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export class EntryAlreadyExistsError extends Error {
|
|
29
|
-
constructor(message) {
|
|
30
|
-
super(message);
|
|
31
|
-
this.name = 'EntryAlreadyExistsError';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export class InvalidArgumentsError extends Error {
|
|
35
|
-
constructor(message, errors, errorCtx) {
|
|
36
|
-
super(message);
|
|
37
|
-
this.isValidation = true;
|
|
38
|
-
this.name = 'InvalidArgumentsError';
|
|
39
|
-
this.errorCtx = errorCtx;
|
|
40
|
-
if (errors != null) {
|
|
41
|
-
this.validationErrors = {
|
|
42
|
-
errors: errors.details.map(({ path, type, message }) => ({
|
|
43
|
-
message,
|
|
44
|
-
path,
|
|
45
|
-
type: type === 'custom' ? message : type,
|
|
46
|
-
})),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export class UnauthorizedError extends Error {
|
|
52
|
-
constructor(message) {
|
|
53
|
-
super(message);
|
|
54
|
-
this.name = 'UnauthorizedError';
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=errors.js.map
|
package/lib/esm/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"/","sources":["errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,MAAO,SAAQ,KAAK;IAG/B,YAAY,OAAgB,EAAE,QAAc;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,KAAK;IAGrC,YAAY,GAAU,EAAE,QAAc;QACpC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;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;IAK9C,YAAY,OAAgB,EAAE,MAAwB,EAAE,QAAc;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,iBAAY,GAAG,IAAI,CAAC;QAKlB,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,gBAAgB,GAAG;gBACtB,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CACxB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAuB,EAAwB,EAAE,CAAC,CAAC;oBACvE,OAAO;oBACP,IAAI;oBACJ,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;iBACzC,CAAC,CACH;aACF,CAAC;SACH;IACH,CAAC;CACF;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 { ValidationError, ValidationErrorItem } from 'joi';\n\nexport class XError extends Error {\n errorCtx: any;\n\n constructor(message?: string, errorCtx?: any) {\n super(message);\n this.name = 'XError';\n this.errorCtx = errorCtx;\n }\n}\n\nexport class WrappedError extends Error {\n errorCtx: any;\n\n constructor(err: Error, errorCtx?: any) {\n super(err.message);\n this.name = err.name;\n this.stack = err.stack;\n this.errorCtx = errorCtx;\n }\n}\n\nexport class AsyncStopError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'AsyncStopError';\n }\n}\n\nexport class ForbiddenError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'ForbiddenError';\n }\n}\n\nexport class EntryAlreadyExistsError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'EntryAlreadyExistsError';\n }\n}\n\ntype FieldValidationError = {\n message: string;\n path: Array<string | number>;\n type: string;\n};\nexport class InvalidArgumentsError extends Error {\n validationErrors?: { errors: FieldValidationError[] };\n isValidation = true;\n errorCtx: any;\n\n constructor(message?: string, errors?: ValidationError, errorCtx?: any) {\n super(message);\n this.name = 'InvalidArgumentsError';\n this.errorCtx = errorCtx;\n\n if (errors != null) {\n this.validationErrors = {\n errors: errors.details.map(\n ({ path, type, message }: ValidationErrorItem): FieldValidationError => ({\n message,\n path,\n type: type === 'custom' ? message : type,\n })\n ),\n };\n }\n }\n}\n\nexport class UnauthorizedError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = 'UnauthorizedError';\n }\n}\n"]}
|
package/lib/esm/exact.js
DELETED
package/lib/esm/exact.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export type NewExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n exactTld: string;\n};\n\nexport type ExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n lastAuthenticatedAt?: string;\n expiresAt?: string;\n exactTld: string;\n authenticated: boolean;\n};\n"]}
|
package/lib/esm/fetch.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import fetch from 'node-fetch';
|
|
2
|
-
import { TENANT_ID_ADMIN_HEADER } from './constants';
|
|
3
|
-
import { InvalidArgumentsError, XError } from './errors';
|
|
4
|
-
export const fetchJson = async (url, init) => {
|
|
5
|
-
url = url.toString().replace(/([^:]\/)\/+/g, '$1');
|
|
6
|
-
const response = await fetch(url, init);
|
|
7
|
-
if (!response.ok) {
|
|
8
|
-
const body = await response.text();
|
|
9
|
-
throw new XError(response.statusText, {
|
|
10
|
-
url,
|
|
11
|
-
body: init?.body,
|
|
12
|
-
response: body,
|
|
13
|
-
status: response.status,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return response.status === 200 ? response.json() : undefined;
|
|
17
|
-
};
|
|
18
|
-
export const getAdminAuth = async () => {
|
|
19
|
-
if (!process.env.ADMIN_KEY) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
return `AdminKey ${process.env.ADMIN_KEY}`;
|
|
23
|
-
};
|
|
24
|
-
export const getTenantIdHeader = (headers) => {
|
|
25
|
-
const tenantId = headers[TENANT_ID_ADMIN_HEADER];
|
|
26
|
-
if (!tenantId || typeof tenantId !== 'string') {
|
|
27
|
-
throw new InvalidArgumentsError('Missing or invalid tenantId');
|
|
28
|
-
}
|
|
29
|
-
return tenantId;
|
|
30
|
-
};
|
|
31
|
-
export const cleanHeaders = (headers) => Object.entries(headers).filter((h) => h[1] != null);
|
|
32
|
-
//# sourceMappingURL=fetch.js.map
|
package/lib/esm/fetch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEzD,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,GAAa,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,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 } from 'node-fetch';\nimport fetch, { RequestInfo, RequestInit, Response } from 'node-fetch';\nimport type { URL } from 'node:url';\nimport { TENANT_ID_ADMIN_HEADER } from './constants';\nimport { InvalidArgumentsError, XError } from './errors';\n\nexport const fetchJson = async <T>(\n url: URL | RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\n // sometimes the origin ends with a slash and when we append the path it gets a double slash\n url = url.toString().replace(/([^:]\\/)\\/+/g, '$1');\n\n const response: Response = await fetch(url, init);\n\n if (!response.ok) {\n const body = await response.text();\n throw new XError(response.statusText, {\n url,\n body: init?.body,\n response: body,\n status: response.status,\n });\n }\n\n return response.status === 200 ? (response.json() as Promise<T>) : undefined;\n};\n\nexport const getAdminAuth = async (): Promise<string> => {\n if (!process.env.ADMIN_KEY) {\n return '';\n }\n\n return `AdminKey ${process.env.ADMIN_KEY}`;\n};\n\nexport const getTenantIdHeader = (headers: { [name: string]: unknown }): string => {\n const tenantId = headers[TENANT_ID_ADMIN_HEADER];\n if (!tenantId || typeof tenantId !== 'string') {\n throw new InvalidArgumentsError('Missing or invalid tenantId');\n }\n\n return tenantId;\n};\n\nexport const cleanHeaders = (headers: { [key: string]: string | undefined }): HeadersInit =>\n Object.entries(headers).filter((h): h is [string, string] => h[1] != null);\n"]}
|
package/lib/esm/formatting.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const DEFAULT_SEPARATOR = ' • ';
|
|
2
|
-
export const joinWithSeparator = (text, { separator = DEFAULT_SEPARATOR, filter = Boolean, } = {}) => text.filter(filter).join(separator);
|
|
3
|
-
export const formatCurrency = (amount, locale = 'de-DE', showCurrencySign = false, options = { currency: 'EUR' }) => {
|
|
4
|
-
return new Intl.NumberFormat(locale, {
|
|
5
|
-
minimumFractionDigits: 2,
|
|
6
|
-
maximumFractionDigits: 2,
|
|
7
|
-
style: 'currency',
|
|
8
|
-
useGrouping: true,
|
|
9
|
-
...options,
|
|
10
|
-
})
|
|
11
|
-
.formatToParts(Number(amount))
|
|
12
|
-
.map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))
|
|
13
|
-
.join('');
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=formatting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.js","sourceRoot":"/","sources":["formatting.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAA4C,EAC5C,EACE,SAAS,GAAG,iBAAiB,EAC7B,MAAM,GAAG,OAAO,MAC4C,EAAE,EAChE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,MAAc,EACd,MAAM,GAAG,OAAO,EAChB,gBAAgB,GAAG,KAAK,EACxB,UAAoC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAC/C,EAAE;IACV,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACnC,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;QACxB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,IAAI;QACjB,GAAG,OAAO;KACX,CAAC;SACC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9F,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC,CAAC","sourcesContent":["const DEFAULT_SEPARATOR = ' • ';\n\nexport const joinWithSeparator = (\n text: (string | number | undefined | null)[],\n {\n separator = DEFAULT_SEPARATOR,\n filter = Boolean,\n }: { separator?: string; filter?: (value: any) => boolean } = {}\n) => text.filter(filter).join(separator);\n\nexport const formatCurrency = (\n amount: string,\n locale = 'de-DE',\n showCurrencySign = false,\n options: Intl.NumberFormatOptions = { currency: 'EUR' }\n): string => {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n style: 'currency',\n useGrouping: true,\n ...options,\n })\n .formatToParts(Number(amount))\n .map((p) => (showCurrencySign || (p.type != 'literal' && p.type != 'currency') ? p.value : ''))\n .join('');\n};\n"]}
|
package/lib/esm/ids.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { customAlphabet } from 'nanoid';
|
|
2
|
-
export var Alphabet;
|
|
3
|
-
(function (Alphabet) {
|
|
4
|
-
Alphabet["Full"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
|
|
5
|
-
Alphabet["Alphanumeric"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
6
|
-
Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
|
|
7
|
-
Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
8
|
-
Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
|
|
9
|
-
})(Alphabet || (Alphabet = {}));
|
|
10
|
-
export const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
|
|
11
|
-
const nanoid = customAlphabet(alphabet, idLength);
|
|
12
|
-
while (true) {
|
|
13
|
-
const id = nanoid();
|
|
14
|
-
if (isValid(id)) {
|
|
15
|
-
return id;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const isValid = (id) => {
|
|
20
|
-
if (!Number.isNaN(Number.parseInt(id[0]))) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (id.endsWith('_') || id.startsWith('_')) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
if (id.includes('__')) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=ids.js.map
|
package/lib/esm/ids.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;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"]}
|
package/lib/esm/insurance.js
DELETED
package/lib/esm/insurance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insurance.js","sourceRoot":"/","sources":["insurance.ts"],"names":[],"mappings":"","sourcesContent":["export type InsuranceEntry = {\n checkedAt: string;\n insured: boolean;\n};\n\nexport type InsuranceCheckEvent = {\n contractId: string;\n tenantId: string;\n vin: string;\n licensePlate?: string;\n};\n\nexport type InsuranceCheckResponseEvent = InsuranceCheckEvent & {\n insurance: InsuranceEntry;\n};\n\nexport type InsuranceHistoryRequest = {\n contractId: string;\n tenantId: string;\n limit?: number;\n nextToken?: string;\n};\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const getAddressText = (address, joinBy = '<br>') => {
|
|
2
|
-
const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]
|
|
3
|
-
.filter((n) => !!n)
|
|
4
|
-
.join(', ');
|
|
5
|
-
const filteredParts = [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n);
|
|
6
|
-
if (filteredParts.length === 0) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
return filteredParts.join(joinBy);
|
|
10
|
-
};
|
|
11
|
-
export const getFormatedAddressFromLocationValue = (location) => {
|
|
12
|
-
const PARTS_JOINER = ', ';
|
|
13
|
-
const address = getAddressText(location, PARTS_JOINER);
|
|
14
|
-
return address;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=location-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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';\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/esm/locations.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
export var RouteLabel;
|
|
2
|
-
(function (RouteLabel) {
|
|
3
|
-
RouteLabel["Unspecified"] = "ROUTE_LABEL_UNSPECIFIED";
|
|
4
|
-
RouteLabel["Default"] = "DEFAULT_ROUTE";
|
|
5
|
-
RouteLabel["DefaultAlternate"] = "DEFAULT_ROUTE_ALTERNATE";
|
|
6
|
-
RouteLabel["FuelEfficient"] = "FUEL_EFFICIENT";
|
|
7
|
-
})(RouteLabel || (RouteLabel = {}));
|
|
8
|
-
export const isEUCountry = (country) => [
|
|
9
|
-
'AT',
|
|
10
|
-
'BE',
|
|
11
|
-
'BG',
|
|
12
|
-
'CY',
|
|
13
|
-
'CZ',
|
|
14
|
-
'DE',
|
|
15
|
-
'DK',
|
|
16
|
-
'EE',
|
|
17
|
-
'ES',
|
|
18
|
-
'FI',
|
|
19
|
-
'FR',
|
|
20
|
-
'GR',
|
|
21
|
-
'HR',
|
|
22
|
-
'HU',
|
|
23
|
-
'IE',
|
|
24
|
-
'IT',
|
|
25
|
-
'LT',
|
|
26
|
-
'LU',
|
|
27
|
-
'LV',
|
|
28
|
-
'MT',
|
|
29
|
-
'NL',
|
|
30
|
-
'PL',
|
|
31
|
-
'PT',
|
|
32
|
-
'RO',
|
|
33
|
-
'SE',
|
|
34
|
-
'SI',
|
|
35
|
-
'SK',
|
|
36
|
-
].includes(country.toUpperCase());
|
|
37
|
-
export const isEuropeanCountry = (country) => [
|
|
38
|
-
'AL',
|
|
39
|
-
'AD',
|
|
40
|
-
'AM',
|
|
41
|
-
'AT',
|
|
42
|
-
'AZ',
|
|
43
|
-
'BY',
|
|
44
|
-
'BE',
|
|
45
|
-
'BA',
|
|
46
|
-
'BG',
|
|
47
|
-
'HR',
|
|
48
|
-
'CY',
|
|
49
|
-
'CZ',
|
|
50
|
-
'DK',
|
|
51
|
-
'EE',
|
|
52
|
-
'FO',
|
|
53
|
-
'FI',
|
|
54
|
-
'FR',
|
|
55
|
-
'GE',
|
|
56
|
-
'DE',
|
|
57
|
-
'GI',
|
|
58
|
-
'GR',
|
|
59
|
-
'HU',
|
|
60
|
-
'IS',
|
|
61
|
-
'IE',
|
|
62
|
-
'IT',
|
|
63
|
-
'KZ',
|
|
64
|
-
'XK',
|
|
65
|
-
'LV',
|
|
66
|
-
'LI',
|
|
67
|
-
'LT',
|
|
68
|
-
'LU',
|
|
69
|
-
'MK',
|
|
70
|
-
'MT',
|
|
71
|
-
'MD',
|
|
72
|
-
'MC',
|
|
73
|
-
'ME',
|
|
74
|
-
'NL',
|
|
75
|
-
'NO',
|
|
76
|
-
'PL',
|
|
77
|
-
'PT',
|
|
78
|
-
'RO',
|
|
79
|
-
'RU',
|
|
80
|
-
'SM',
|
|
81
|
-
'RS',
|
|
82
|
-
'SK',
|
|
83
|
-
'SI',
|
|
84
|
-
'ES',
|
|
85
|
-
'SE',
|
|
86
|
-
'CH',
|
|
87
|
-
'UA',
|
|
88
|
-
'GB',
|
|
89
|
-
].includes(country.toUpperCase());
|
|
90
|
-
//# sourceMappingURL=locations.js.map
|
package/lib/esm/locations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
package/lib/esm/messages.js
DELETED
package/lib/esm/messages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
|
package/lib/esm/notifications.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export var GroupableNotificationOrigin;
|
|
2
|
-
(function (GroupableNotificationOrigin) {
|
|
3
|
-
GroupableNotificationOrigin["Message"] = "message";
|
|
4
|
-
})(GroupableNotificationOrigin || (GroupableNotificationOrigin = {}));
|
|
5
|
-
export var NotificationVisibility;
|
|
6
|
-
(function (NotificationVisibility) {
|
|
7
|
-
NotificationVisibility["UNREAD"] = "unread";
|
|
8
|
-
NotificationVisibility["READ"] = "read";
|
|
9
|
-
})(NotificationVisibility || (NotificationVisibility = {}));
|
|
10
|
-
export var NotificationsFilter;
|
|
11
|
-
(function (NotificationsFilter) {
|
|
12
|
-
NotificationsFilter["Unread"] = "unread";
|
|
13
|
-
NotificationsFilter["Archived"] = "archived";
|
|
14
|
-
})(NotificationsFilter || (NotificationsFilter = {}));
|
|
15
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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';\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/esm/pdf-gen.js
DELETED
package/lib/esm/pdf-gen.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants';\nimport { AttachmentValue } from './types';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n"]}
|
package/lib/esm/servers.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export var LambdaServer;
|
|
2
|
-
(function (LambdaServer) {
|
|
3
|
-
LambdaServer[LambdaServer["HYPERPORTAL_SYNC"] = 0] = "HYPERPORTAL_SYNC";
|
|
4
|
-
LambdaServer[LambdaServer["CORE"] = 1] = "CORE";
|
|
5
|
-
LambdaServer[LambdaServer["CUSTOMER_MANAGEMENT"] = 2] = "CUSTOMER_MANAGEMENT";
|
|
6
|
-
LambdaServer[LambdaServer["MIGRATIONS"] = 3] = "MIGRATIONS";
|
|
7
|
-
LambdaServer[LambdaServer["NOTIFICATIONS"] = 4] = "NOTIFICATIONS";
|
|
8
|
-
LambdaServer[LambdaServer["DISCUSSIONS"] = 5] = "DISCUSSIONS";
|
|
9
|
-
LambdaServer[LambdaServer["PDF_GEN"] = 6] = "PDF_GEN";
|
|
10
|
-
LambdaServer[LambdaServer["MACHINES"] = 7] = "MACHINES";
|
|
11
|
-
LambdaServer[LambdaServer["INSURANCE_CHECK"] = 8] = "INSURANCE_CHECK";
|
|
12
|
-
LambdaServer[LambdaServer["EXACT"] = 9] = "EXACT";
|
|
13
|
-
LambdaServer[LambdaServer["STORAGE"] = 10] = "STORAGE";
|
|
14
|
-
LambdaServer[LambdaServer["BECRIS"] = 11] = "BECRIS";
|
|
15
|
-
LambdaServer[LambdaServer["TRACK_AND_TRACE"] = 12] = "TRACK_AND_TRACE";
|
|
16
|
-
LambdaServer[LambdaServer["TASKS"] = 13] = "TASKS";
|
|
17
|
-
})(LambdaServer || (LambdaServer = {}));
|
|
18
|
-
export const getServerPort = (server) => 2000 +
|
|
19
|
-
Object.values(LambdaServer)
|
|
20
|
-
.filter((v) => typeof v === 'number')
|
|
21
|
-
.indexOf(server);
|
|
22
|
-
//# sourceMappingURL=servers.js.map
|