@bisondesk/commons-sdk 1.0.274 → 1.0.276
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/becris.js +3 -0
- package/lib/becris.js.map +1 -0
- package/lib/cjs/becris.js +3 -0
- package/lib/cjs/becris.js.map +1 -0
- package/lib/cjs/constants.js +103 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/dayjs-utils.js +26 -0
- package/lib/cjs/dayjs-utils.js.map +1 -0
- package/lib/cjs/discussions.js +5 -0
- package/lib/cjs/discussions.js.map +1 -0
- package/lib/cjs/errors.js +67 -0
- package/lib/cjs/errors.js.map +1 -0
- package/lib/cjs/exact.js +3 -0
- package/lib/cjs/exact.js.map +1 -0
- package/lib/cjs/fetch.js +21 -0
- package/lib/cjs/fetch.js.map +1 -0
- package/lib/cjs/ids.js +35 -0
- package/lib/cjs/ids.js.map +1 -0
- package/lib/cjs/insurance.js +3 -0
- package/lib/cjs/insurance.js.map +1 -0
- package/lib/cjs/location-utils.js +11 -0
- package/lib/cjs/location-utils.js.map +1 -0
- package/lib/cjs/locations.js +95 -0
- package/lib/cjs/locations.js.map +1 -0
- package/lib/cjs/messages.js +3 -0
- package/lib/cjs/messages.js.map +1 -0
- package/lib/cjs/notifications.js +13 -0
- package/lib/cjs/notifications.js.map +1 -0
- package/lib/cjs/pdf-gen.js +3 -0
- package/lib/cjs/pdf-gen.js.map +1 -0
- package/lib/cjs/storage.js +14 -0
- package/lib/cjs/storage.js.map +1 -0
- package/lib/cjs/types.js +8 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/constants.js +103 -0
- package/lib/constants.js.map +1 -0
- package/lib/dayjs-utils.js +25 -0
- package/lib/dayjs-utils.js.map +1 -0
- package/lib/discussions.js +5 -0
- package/lib/discussions.js.map +1 -0
- package/lib/errors.js +67 -0
- package/lib/errors.js.map +1 -0
- package/lib/esm/becris.js +2 -0
- package/lib/esm/becris.js.map +1 -0
- package/lib/esm/constants.js +100 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/dayjs-utils.js +18 -0
- package/lib/esm/dayjs-utils.js.map +1 -0
- package/lib/esm/discussions.js +2 -0
- package/lib/esm/discussions.js.map +1 -0
- package/lib/esm/errors.js +57 -0
- package/lib/esm/errors.js.map +1 -0
- package/lib/esm/exact.js +2 -0
- package/lib/esm/exact.js.map +1 -0
- package/lib/esm/fetch.js +16 -0
- package/lib/esm/fetch.js.map +1 -0
- package/lib/esm/ids.js +31 -0
- package/lib/esm/ids.js.map +1 -0
- package/lib/esm/insurance.js +2 -0
- package/lib/esm/insurance.js.map +1 -0
- package/lib/esm/location-utils.js +7 -0
- package/lib/esm/location-utils.js.map +1 -0
- package/lib/esm/locations.js +90 -0
- package/lib/esm/locations.js.map +1 -0
- package/lib/esm/messages.js +2 -0
- package/lib/esm/messages.js.map +1 -0
- package/lib/esm/notifications.js +10 -0
- package/lib/esm/notifications.js.map +1 -0
- package/lib/esm/pdf-gen.js +2 -0
- package/lib/esm/pdf-gen.js.map +1 -0
- package/lib/esm/storage.js +11 -0
- package/lib/esm/storage.js.map +1 -0
- package/lib/esm/types.js +5 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/exact.js +3 -0
- package/lib/exact.js.map +1 -0
- package/lib/fetch.js +20 -0
- package/lib/fetch.js.map +1 -0
- package/lib/ids.js +35 -0
- package/lib/ids.js.map +1 -0
- package/lib/insurance.js +3 -0
- package/lib/insurance.js.map +1 -0
- package/lib/location-utils.js +11 -0
- package/lib/location-utils.js.map +1 -0
- package/lib/locations.js +95 -0
- package/lib/locations.js.map +1 -0
- package/lib/messages.js +3 -0
- package/lib/messages.js.map +1 -0
- package/lib/notifications.js +13 -0
- package/lib/notifications.js.map +1 -0
- package/lib/pdf-gen.js +3 -0
- package/lib/pdf-gen.js.map +1 -0
- package/lib/storage.js +14 -0
- package/lib/storage.js.map +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/types/becris.d.ts +40 -0
- package/lib/types/becris.d.ts.map +1 -0
- package/lib/types/constants.d.ts +55 -0
- package/lib/types/constants.d.ts.map +1 -0
- package/lib/types/dayjs-utils.d.ts +8 -0
- package/lib/types/dayjs-utils.d.ts.map +1 -0
- package/lib/types/discussions.d.ts +43 -0
- package/lib/types/discussions.d.ts.map +1 -0
- package/lib/types/errors.d.ts +36 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/exact.d.ts +10 -0
- package/lib/types/exact.d.ts.map +1 -0
- package/lib/types/fetch.d.ts +3 -0
- package/lib/types/fetch.d.ts.map +1 -0
- package/lib/types/ids.d.ts +9 -0
- package/lib/types/ids.d.ts.map +1 -0
- package/lib/types/insurance.d.ts +20 -0
- package/lib/types/insurance.d.ts.map +1 -0
- package/lib/types/location-utils.d.ts +3 -0
- package/lib/types/location-utils.d.ts.map +1 -0
- package/lib/types/locations.d.ts +34 -0
- package/lib/types/locations.d.ts.map +1 -0
- package/lib/types/messages.d.ts +57 -0
- package/lib/types/messages.d.ts.map +1 -0
- package/lib/types/notifications.d.ts +51 -0
- package/lib/types/notifications.d.ts.map +1 -0
- package/lib/types/pdf-gen.d.ts +40 -0
- package/lib/types/pdf-gen.d.ts.map +1 -0
- package/lib/types/storage.d.ts +63 -0
- package/lib/types/storage.d.ts.map +1 -0
- package/lib/types/types.d.ts +124 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types.js +8 -0
- package/lib/types.js.map +1 -0
- package/package.json +1 -1
- package/src/constants.ts +2 -1
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":"AAoBA,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};\n\nexport type LocationValue = {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n postalCode?: string;\n gps?: GPSCoord;\n};\n\nexport type RoutesRequest = {\n origin: LocationValue;\n destination: LocationValue;\n};\n\nexport enum RouteLabel {\n Unspecified = 'ROUTE_LABEL_UNSPECIFIED',\n Default = 'DEFAULT_ROUTE',\n DefaultAlternate = 'DEFAULT_ROUTE_ALTERNATE',\n FuelEfficient = 'FUEL_EFFICIENT',\n}\n\nexport type Route = {\n duration: string;\n distanceMeters: number;\n routeLabels: RouteLabel[];\n};\n\nexport type RoutesResponse = {\n routes: Route[];\n};\n\nexport const isEUCountry = (country: string): boolean =>\n [\n 'AT',\n 'BE',\n 'BG',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GR',\n 'HR',\n 'HU',\n 'IE',\n 'IT',\n 'LT',\n 'LU',\n 'LV',\n 'MT',\n 'NL',\n 'PL',\n 'PT',\n 'RO',\n 'SE',\n 'SI',\n 'SK',\n ].includes(country.toUpperCase());\n\nexport const isEuropeanCountry = (country: string): boolean =>\n [\n 'AL',\n 'AD',\n 'AM',\n 'AT',\n 'AZ',\n 'BY',\n 'BE',\n 'BA',\n 'BG',\n 'HR',\n 'CY',\n 'CZ',\n 'DK',\n 'EE',\n 'FO',\n 'FI',\n 'FR',\n 'GE',\n 'DE',\n 'GI',\n 'GR',\n 'HU',\n 'IS',\n 'IE',\n 'IT',\n 'KZ',\n 'XK',\n 'LV',\n 'LI',\n 'LT',\n 'LU',\n 'MK',\n 'MT',\n 'MD',\n 'MC',\n 'ME',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SM',\n 'RS',\n 'SK',\n 'SI',\n 'ES',\n 'SE',\n 'CH',\n 'UA',\n 'GB',\n ].includes(country.toUpperCase());\n\n//I want the isEuropeanCountry but with countries in lowercase\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +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","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport enum GroupableNotificationOrigin {\n Message = 'message',\n}\nexport enum NotificationVisibility {\n UNREAD = 'unread',\n READ = 'read',\n}\n\ntype BaseMeta = {\n snippet?: string;\n};\n\nexport type NewNotificationsEvent<T extends BaseMeta = BaseMeta> = {\n tenantId: string;\n notifications: NewNotification<T>[];\n};\n\ntype BaseNotification<T extends BaseMeta = BaseMeta> = {\n sourceId: string; // userId\n destinationId: string; // userId\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n meta: T;\n origin: string;\n};\n\nexport type NewNotification<T extends BaseMeta = BaseMeta> = BaseNotification<T>;\n\nexport type Notification<T extends BaseMeta = BaseMeta> = BaseNotification<T> & {\n id: string;\n createdAt: string;\n visibility: NotificationVisibility;\n};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationsInfo = NotificationsStats & {\n externalPushAppId?: string;\n};\n\nexport type NotificationsStats = {\n unreadCount: number;\n unseen: boolean;\n latestSeenAt?: string;\n latestNotificationAt?: string;\n};\n\nexport type NotificationsQuery = {\n limit?: number;\n unreadOnly?: boolean;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants';\nimport { AttachmentValue } from './types';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export var UploadProviders;
|
|
2
|
+
(function (UploadProviders) {
|
|
3
|
+
UploadProviders["Vimeo"] = "vimeo";
|
|
4
|
+
UploadProviders["S3"] = "s3";
|
|
5
|
+
})(UploadProviders || (UploadProviders = {}));
|
|
6
|
+
export var MediaExportResolution;
|
|
7
|
+
(function (MediaExportResolution) {
|
|
8
|
+
MediaExportResolution["Low"] = "low";
|
|
9
|
+
MediaExportResolution["High"] = "high";
|
|
10
|
+
})(MediaExportResolution || (MediaExportResolution = {}));
|
|
11
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +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';\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/esm/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"/","sources":["types.ts"],"names":[],"mappings":"AA8CA,MAAM,CAAN,IAAY,MAEX;AAFD,WAAY,MAAM;IAChB,+BAAqB,CAAA;AACvB,CAAC,EAFW,MAAM,KAAN,MAAM,QAEjB","sourcesContent":["import { AppRoles, TopLevelActions } from './constants';\nimport { LocationValue } from './locations';\nexport { GPSCoord, LocationValue } from './locations';\n\nexport type PaginatedList<T, M = {}> = {\n results: T[];\n nextToken?: undefined;\n meta: M;\n totalCount: number;\n};\n\nexport type PaginationRequest = {\n limit: number;\n offset: number;\n};\n\nexport type NextList<T, M = {}> = {\n results: T[];\n nextToken?: string;\n meta: M;\n totalCount?: number;\n};\n\nexport type PaginatedRequest = {\n limit?: number;\n offset?: number;\n};\n\nexport type Requester = {\n lang: string;\n roles: AppRoles[];\n actions: TopLevelActions[];\n tenantId: string;\n tenantLang: string;\n userAgent?: string;\n source?: string;\n userId: string;\n isApi: boolean;\n};\n\nexport type Option = {\n value: string | number;\n label: string;\n color?: string;\n};\n\nexport enum Region {\n euWest1 = 'eu-west-1',\n}\n\nexport type ErrorResponse = {\n message?: string;\n data?: unknown;\n};\n\nexport type MultiLangValue = { key?: string } & { [languageCode: string]: string };\n\nexport type CognitoInfo = {\n userPoolId: string;\n appClientId: string;\n region: Region;\n};\n\nexport type SearchPermissions = {\n users: string[];\n roles: AppRoles[];\n};\n\nexport type PhoneNumberValue = {\n country: string;\n e164: string;\n international: string;\n national: string;\n};\n\nexport type PhoneNumberRawValue = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type LinkValue = {\n text?: string;\n url: string;\n};\n\nexport type Document = {\n type: string; // passport, driving_license, ...\n displayName: string;\n file: AttachmentValue;\n};\n\nexport type AttachmentValue = {\n contentType: string;\n fileName: string;\n id: string;\n previewSrc?: string;\n size: number;\n uploadedAt: string;\n uploadedBy: string;\n url: string;\n descriptions?: string | MultiLangValue;\n};\n\nexport type VatLayerResponse = { vatNumber: string } & (\n | { formatValid: false; viesValid: false }\n | {\n formatValid: true;\n viesValid: boolean;\n countryCode: string;\n name: string;\n addressLines: string[];\n }\n);\n\nexport type VatValidationResponse = {\n vatNumber: string;\n formatValid?: boolean;\n countryCode?: string;\n} & (\n | { viesValid: false }\n | {\n viesValid: true;\n name?: string;\n normalizedAddress?: LocationValue;\n officialAddress?: string[];\n }\n);\n\nexport type VatValidationRequest = {\n defaultCountry?: string;\n input: string;\n};\n\nexport type CurrencyLayerResponse = {\n conversionRate: number;\n targetCurrency: string;\n sourceCurrency: string;\n};\n"]}
|
package/lib/exact.js
ADDED
package/lib/exact.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exact.js","sourceRoot":"/","sources":["exact.ts"],"names":[],"mappings":"","sourcesContent":["export type ExactClientAccount = {\n branchId: string;\n division: number;\n clientId: string;\n lastAuthenticatedAt?: string;\n expiresAt?: string;\n exactTld: string;\n authenticated: boolean;\n};\n"]}
|
package/lib/fetch.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchJson = void 0;
|
|
4
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
5
|
+
const errors_1 = require("./errors");
|
|
6
|
+
const fetchJson = async (url, init) => {
|
|
7
|
+
const response = await (0, node_fetch_1.default)(url, init);
|
|
8
|
+
if (!response.ok) {
|
|
9
|
+
const body = await response.text();
|
|
10
|
+
throw new errors_1.XError(response.statusText, {
|
|
11
|
+
url,
|
|
12
|
+
body: init?.body,
|
|
13
|
+
response: body,
|
|
14
|
+
status: response.status,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return response.status === 200 ? response.json() : undefined;
|
|
18
|
+
};
|
|
19
|
+
exports.fetchJson = fetchJson;
|
|
20
|
+
//# sourceMappingURL=fetch.js.map
|
package/lib/fetch.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"/","sources":["fetch.ts"],"names":[],"mappings":";;;AAAA,4DAAuE;AACvE,qCAAkC;AAE3B,MAAM,SAAS,GAAG,KAAK,EAC5B,GAAgB,EAChB,IAAkB,EACM,EAAE;IAC1B,MAAM,QAAQ,GAAa,MAAM,IAAA,oBAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,eAAM,CAAC,QAAQ,CAAC,UAAU,EAAE;YACpC,GAAG;YACH,IAAI,EAAE,IAAI,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC,CAAC;KACJ;IAED,OAAO,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAE,QAAQ,CAAC,IAAI,EAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC,CAAC;AAjBW,QAAA,SAAS,aAiBpB","sourcesContent":["import fetch, { RequestInfo, RequestInit, Response } from 'node-fetch';\nimport { XError } from './errors';\n\nexport const fetchJson = async <T>(\n url: RequestInfo,\n init?: RequestInit\n): Promise<T | undefined> => {\n const response: Response = await fetch(url, init);\n\n if (!response.ok) {\n const body = await response.text();\n throw new XError(response.statusText, {\n url,\n body: init?.body,\n response: body,\n status: response.status,\n });\n }\n\n return response.status === 200 ? (response.json() as Promise<T>) : undefined;\n};\n"]}
|
package/lib/ids.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateId = exports.Alphabet = void 0;
|
|
4
|
+
const nanoid_1 = require("nanoid");
|
|
5
|
+
var Alphabet;
|
|
6
|
+
(function (Alphabet) {
|
|
7
|
+
Alphabet["Full"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
|
|
8
|
+
Alphabet["Alphanumeric"] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
9
|
+
Alphabet["Lowercase"] = "abcdefghijklmnopqrstuvwxyz";
|
|
10
|
+
Alphabet["LowerAlphanumeric"] = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
11
|
+
Alphabet["ReferenceCode"] = "123456789ABCDEFGHJKMNPQRSTUVWXYZ";
|
|
12
|
+
})(Alphabet = exports.Alphabet || (exports.Alphabet = {}));
|
|
13
|
+
const generateId = (idLength = 15, alphabet = Alphabet.Full) => {
|
|
14
|
+
const nanoid = (0, nanoid_1.customAlphabet)(alphabet, idLength);
|
|
15
|
+
while (true) {
|
|
16
|
+
const id = nanoid();
|
|
17
|
+
if (isValid(id)) {
|
|
18
|
+
return id;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.generateId = generateId;
|
|
23
|
+
const isValid = (id) => {
|
|
24
|
+
if (!Number.isNaN(Number.parseInt(id[0]))) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (id.endsWith('_') || id.startsWith('_')) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (id.includes('__')) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ids.js.map
|
package/lib/ids.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"/","sources":["ids.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,oFAAwE,CAAA;IACxE,2FAA+E,CAAA;IAC/E,oDAAwC,CAAA;IACxC,sEAA0D,CAAA;IAC1D,8DAAkD,CAAA;AACpD,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB;AAIM,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,WAAqB,QAAQ,CAAC,IAAI,EAAU,EAAE;IAC9F,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,EAAE,CAAC,EAAE;YACf,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEF,MAAM,OAAO,GAAG,CAAC,EAAU,EAAW,EAAE;IACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC1C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import { customAlphabet } from 'nanoid';\n\nexport enum Alphabet {\n Full = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_',\n Alphanumeric = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n Lowercase = 'abcdefghijklmnopqrstuvwxyz',\n LowerAlphanumeric = '0123456789abcdefghijklmnopqrstuvwxyz',\n ReferenceCode = '123456789ABCDEFGHJKMNPQRSTUVWXYZ',\n}\n\n// The ID can contain only alphabets and numbers and underscore.\n// The ID should start with an alphabet and should not have two consecutive underscores or end with an underscore.\nexport const generateId = (idLength: number = 15, alphabet: Alphabet = Alphabet.Full): string => {\n const nanoid = customAlphabet(alphabet, idLength);\n while (true) {\n const id = nanoid();\n if (isValid(id)) {\n return id;\n }\n }\n};\n\nconst isValid = (id: string): boolean => {\n if (!Number.isNaN(Number.parseInt(id[0]))) {\n return false;\n }\n\n if (id.endsWith('_') || id.startsWith('_')) {\n return false;\n }\n\n if (id.includes('__')) {\n return false;\n }\n\n return true;\n};\n"]}
|
package/lib/insurance.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insurance.js","sourceRoot":"/","sources":["insurance.ts"],"names":[],"mappings":"","sourcesContent":["export type InsuranceEntry = {\n checkedAt: string;\n insured: boolean;\n};\n\nexport type InsuranceCheckEvent = {\n contractId: string;\n tenantId: string;\n vin: string;\n licensePlate?: string;\n};\n\nexport type InsuranceCheckResponseEvent = InsuranceCheckEvent & {\n insurance: InsuranceEntry;\n};\n\nexport type InsuranceHistoryRequest = {\n contractId: string;\n tenantId: string;\n limit?: number;\n nextToken?: string;\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAddressText = void 0;
|
|
4
|
+
const getAddressText = (address, joinBy = '<br>') => {
|
|
5
|
+
const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]
|
|
6
|
+
.filter((n) => !!n)
|
|
7
|
+
.join(', ');
|
|
8
|
+
return [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n).join(joinBy);
|
|
9
|
+
};
|
|
10
|
+
exports.getAddressText = getAddressText;
|
|
11
|
+
//# sourceMappingURL=location-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-utils.js","sourceRoot":"/","sources":["location-utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,OAAsB,EAAE,SAAiB,MAAM,EAAU,EAAE;IACxF,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;SAClF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnG,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB","sourcesContent":["import { LocationValue } from './types';\n\nexport const getAddressText = (address: LocationValue, joinBy: string = '<br>'): string => {\n const regionLines = [address.postalCode, address.city, address.country.toUpperCase()]\n .filter((n) => !!n)\n .join(', ');\n\n return [address.addressLine1, address.addressLine2, regionLines].filter((n) => !!n).join(joinBy);\n};\n"]}
|
package/lib/locations.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEuropeanCountry = exports.isEUCountry = exports.RouteLabel = void 0;
|
|
4
|
+
var RouteLabel;
|
|
5
|
+
(function (RouteLabel) {
|
|
6
|
+
RouteLabel["Unspecified"] = "ROUTE_LABEL_UNSPECIFIED";
|
|
7
|
+
RouteLabel["Default"] = "DEFAULT_ROUTE";
|
|
8
|
+
RouteLabel["DefaultAlternate"] = "DEFAULT_ROUTE_ALTERNATE";
|
|
9
|
+
RouteLabel["FuelEfficient"] = "FUEL_EFFICIENT";
|
|
10
|
+
})(RouteLabel = exports.RouteLabel || (exports.RouteLabel = {}));
|
|
11
|
+
const isEUCountry = (country) => [
|
|
12
|
+
'AT',
|
|
13
|
+
'BE',
|
|
14
|
+
'BG',
|
|
15
|
+
'CY',
|
|
16
|
+
'CZ',
|
|
17
|
+
'DE',
|
|
18
|
+
'DK',
|
|
19
|
+
'EE',
|
|
20
|
+
'ES',
|
|
21
|
+
'FI',
|
|
22
|
+
'FR',
|
|
23
|
+
'GR',
|
|
24
|
+
'HR',
|
|
25
|
+
'HU',
|
|
26
|
+
'IE',
|
|
27
|
+
'IT',
|
|
28
|
+
'LT',
|
|
29
|
+
'LU',
|
|
30
|
+
'LV',
|
|
31
|
+
'MT',
|
|
32
|
+
'NL',
|
|
33
|
+
'PL',
|
|
34
|
+
'PT',
|
|
35
|
+
'RO',
|
|
36
|
+
'SE',
|
|
37
|
+
'SI',
|
|
38
|
+
'SK',
|
|
39
|
+
].includes(country.toUpperCase());
|
|
40
|
+
exports.isEUCountry = isEUCountry;
|
|
41
|
+
const isEuropeanCountry = (country) => [
|
|
42
|
+
'AL',
|
|
43
|
+
'AD',
|
|
44
|
+
'AM',
|
|
45
|
+
'AT',
|
|
46
|
+
'AZ',
|
|
47
|
+
'BY',
|
|
48
|
+
'BE',
|
|
49
|
+
'BA',
|
|
50
|
+
'BG',
|
|
51
|
+
'HR',
|
|
52
|
+
'CY',
|
|
53
|
+
'CZ',
|
|
54
|
+
'DK',
|
|
55
|
+
'EE',
|
|
56
|
+
'FO',
|
|
57
|
+
'FI',
|
|
58
|
+
'FR',
|
|
59
|
+
'GE',
|
|
60
|
+
'DE',
|
|
61
|
+
'GI',
|
|
62
|
+
'GR',
|
|
63
|
+
'HU',
|
|
64
|
+
'IS',
|
|
65
|
+
'IE',
|
|
66
|
+
'IT',
|
|
67
|
+
'KZ',
|
|
68
|
+
'XK',
|
|
69
|
+
'LV',
|
|
70
|
+
'LI',
|
|
71
|
+
'LT',
|
|
72
|
+
'LU',
|
|
73
|
+
'MK',
|
|
74
|
+
'MT',
|
|
75
|
+
'MD',
|
|
76
|
+
'MC',
|
|
77
|
+
'ME',
|
|
78
|
+
'NL',
|
|
79
|
+
'NO',
|
|
80
|
+
'PL',
|
|
81
|
+
'PT',
|
|
82
|
+
'RO',
|
|
83
|
+
'RU',
|
|
84
|
+
'SM',
|
|
85
|
+
'RS',
|
|
86
|
+
'SK',
|
|
87
|
+
'SI',
|
|
88
|
+
'ES',
|
|
89
|
+
'SE',
|
|
90
|
+
'CH',
|
|
91
|
+
'UA',
|
|
92
|
+
'GB',
|
|
93
|
+
].includes(country.toUpperCase());
|
|
94
|
+
exports.isEuropeanCountry = isEuropeanCountry;
|
|
95
|
+
//# sourceMappingURL=locations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locations.js","sourceRoot":"/","sources":["locations.ts"],"names":[],"mappings":";;;AAoBA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,0DAA4C,CAAA;IAC5C,8CAAgC,CAAA;AAClC,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB;AAYM,MAAM,WAAW,GAAG,CAAC,OAAe,EAAW,EAAE,CACtD;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AA7BvB,QAAA,WAAW,eA6BY;AAE7B,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAW,EAAE,CAC5D;IACE,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AArDvB,QAAA,iBAAiB,qBAqDM","sourcesContent":["export type GPSCoord = {\n lat: number;\n lon: number;\n alt?: number;\n};\n\nexport type LocationValue = {\n addressLine1?: string;\n addressLine2?: string;\n city?: string;\n country: string;\n postalCode?: string;\n gps?: GPSCoord;\n};\n\nexport type RoutesRequest = {\n origin: LocationValue;\n destination: LocationValue;\n};\n\nexport enum RouteLabel {\n Unspecified = 'ROUTE_LABEL_UNSPECIFIED',\n Default = 'DEFAULT_ROUTE',\n DefaultAlternate = 'DEFAULT_ROUTE_ALTERNATE',\n FuelEfficient = 'FUEL_EFFICIENT',\n}\n\nexport type Route = {\n duration: string;\n distanceMeters: number;\n routeLabels: RouteLabel[];\n};\n\nexport type RoutesResponse = {\n routes: Route[];\n};\n\nexport const isEUCountry = (country: string): boolean =>\n [\n 'AT',\n 'BE',\n 'BG',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GR',\n 'HR',\n 'HU',\n 'IE',\n 'IT',\n 'LT',\n 'LU',\n 'LV',\n 'MT',\n 'NL',\n 'PL',\n 'PT',\n 'RO',\n 'SE',\n 'SI',\n 'SK',\n ].includes(country.toUpperCase());\n\nexport const isEuropeanCountry = (country: string): boolean =>\n [\n 'AL',\n 'AD',\n 'AM',\n 'AT',\n 'AZ',\n 'BY',\n 'BE',\n 'BA',\n 'BG',\n 'HR',\n 'CY',\n 'CZ',\n 'DK',\n 'EE',\n 'FO',\n 'FI',\n 'FR',\n 'GE',\n 'DE',\n 'GI',\n 'GR',\n 'HU',\n 'IS',\n 'IE',\n 'IT',\n 'KZ',\n 'XK',\n 'LV',\n 'LI',\n 'LT',\n 'LU',\n 'MK',\n 'MT',\n 'MD',\n 'MC',\n 'ME',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SM',\n 'RS',\n 'SK',\n 'SI',\n 'ES',\n 'SE',\n 'CH',\n 'UA',\n 'GB',\n ].includes(country.toUpperCase());\n\n//I want the isEuropeanCountry but with countries in lowercase\n"]}
|
package/lib/messages.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"/","sources":["messages.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from './types';\n\nexport type EmailAddress = {\n name?: string;\n email: string;\n};\n\nexport type EmailDestination = EmailAddress & {\n organizationId?: string;\n contactId?: string;\n addressType: 'TO' | 'CC' | 'BCC';\n};\n\nexport type EmailContent = {\n subject: string;\n body: {\n text?: string;\n html?: string;\n };\n};\n\nexport type EmailMessage = {\n id: string;\n sentAt: string;\n sentBy: string;\n content?: AttachmentValue;\n subject: string;\n source: EmailAddress;\n replyTo?: EmailAddress;\n destinations: EmailDestination[];\n};\n\nexport type EmailMessageEvent = {\n tenantId: string;\n message: EmailMessage;\n};\n\nexport type TemplatedEmailRequest = {\n data: Record<string, unknown>;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n template: string;\n attachments?: AttachmentValue[];\n};\n\nexport type EmailRequest = {\n references?: string[] | string;\n /* messageId of the email to reply to */\n inReplyTo?: string;\n destinations: EmailDestination[];\n replyTo?: EmailAddress;\n source: EmailAddress;\n subject: string;\n attachments?: AttachmentValue[];\n body:\n | {\n text?: string;\n html: string;\n }\n | {\n html?: string;\n text: string;\n };\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationVisibility = exports.GroupableNotificationOrigin = void 0;
|
|
4
|
+
var GroupableNotificationOrigin;
|
|
5
|
+
(function (GroupableNotificationOrigin) {
|
|
6
|
+
GroupableNotificationOrigin["Message"] = "message";
|
|
7
|
+
})(GroupableNotificationOrigin = exports.GroupableNotificationOrigin || (exports.GroupableNotificationOrigin = {}));
|
|
8
|
+
var NotificationVisibility;
|
|
9
|
+
(function (NotificationVisibility) {
|
|
10
|
+
NotificationVisibility["UNREAD"] = "unread";
|
|
11
|
+
NotificationVisibility["READ"] = "read";
|
|
12
|
+
})(NotificationVisibility = exports.NotificationVisibility || (exports.NotificationVisibility = {}));
|
|
13
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"/","sources":["notifications.ts"],"names":[],"mappings":";;;AAEA,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;AACrB,CAAC,EAFW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAEtC;AACD,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;AACf,CAAC,EAHW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAGjC","sourcesContent":["import { BusinessEntityIds } from './constants';\n\nexport enum GroupableNotificationOrigin {\n Message = 'message',\n}\nexport enum NotificationVisibility {\n UNREAD = 'unread',\n READ = 'read',\n}\n\ntype BaseMeta = {\n snippet?: string;\n};\n\nexport type NewNotificationsEvent<T extends BaseMeta = BaseMeta> = {\n tenantId: string;\n notifications: NewNotification<T>[];\n};\n\ntype BaseNotification<T extends BaseMeta = BaseMeta> = {\n sourceId: string; // userId\n destinationId: string; // userId\n businessEntityId: BusinessEntityIds;\n recordId: string;\n recordTitle?: string;\n meta: T;\n origin: string;\n};\n\nexport type NewNotification<T extends BaseMeta = BaseMeta> = BaseNotification<T>;\n\nexport type Notification<T extends BaseMeta = BaseMeta> = BaseNotification<T> & {\n id: string;\n createdAt: string;\n visibility: NotificationVisibility;\n};\n\nexport type NotificationReadUpdates = {\n /* not passing a value means read all */\n notificationIds: string[] | undefined;\n origin?: GroupableNotificationOrigin;\n};\n\nexport type NotificationsInfo = NotificationsStats & {\n externalPushAppId?: string;\n};\n\nexport type NotificationsStats = {\n unreadCount: number;\n unseen: boolean;\n latestSeenAt?: string;\n latestNotificationAt?: string;\n};\n\nexport type NotificationsQuery = {\n limit?: number;\n unreadOnly?: boolean;\n nextToken?: string;\n origin?: GroupableNotificationOrigin;\n};\n"]}
|
package/lib/pdf-gen.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-gen.js","sourceRoot":"/","sources":["pdf-gen.ts"],"names":[],"mappings":"","sourcesContent":["import { BusinessEntityIds } from './constants';\nimport { AttachmentValue } from './types';\n\nexport type TemplateData = { [key: string]: unknown };\n\nexport type NewPdfTemplateGroup = {\n exampleData?: TemplateData;\n title: string;\n id: string; // [a-z][a-z0-9_]*\n};\n\nexport type PdfTemplateGroup = NewPdfTemplateGroup & {\n modifiedAt: string;\n modifiedBy: string;\n};\n\ntype BasePdfTemplate = {\n branch: string;\n docx: AttachmentValue;\n groupId: string;\n language: string;\n};\n\nexport type PdfTemplate = BasePdfTemplate & {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n pdf: AttachmentValue;\n};\n\nexport type NewPdfTemplate = BasePdfTemplate & {\n id?: string;\n};\n\nexport type GeneratePdfEvent = {\n branch: string;\n businessEntityId: BusinessEntityIds;\n data: TemplateData;\n groupId: string;\n language: string;\n outputFilename?: string;\n tenantId: string;\n};\n"]}
|
package/lib/storage.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaExportResolution = exports.UploadProviders = void 0;
|
|
4
|
+
var UploadProviders;
|
|
5
|
+
(function (UploadProviders) {
|
|
6
|
+
UploadProviders["Vimeo"] = "vimeo";
|
|
7
|
+
UploadProviders["S3"] = "s3";
|
|
8
|
+
})(UploadProviders = exports.UploadProviders || (exports.UploadProviders = {}));
|
|
9
|
+
var MediaExportResolution;
|
|
10
|
+
(function (MediaExportResolution) {
|
|
11
|
+
MediaExportResolution["Low"] = "low";
|
|
12
|
+
MediaExportResolution["High"] = "high";
|
|
13
|
+
})(MediaExportResolution = exports.MediaExportResolution || (exports.MediaExportResolution = {}));
|
|
14
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"/","sources":["storage.ts"],"names":[],"mappings":";;;AAyBA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,4BAAS,CAAA;AACX,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAsCD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,oCAAW,CAAA;IACX,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC","sourcesContent":["import type Joi from 'joi';\nimport { Requester } from './types';\n\nexport type UploadInfo = {\n id: string;\n uploadUrl: string;\n downloadPath: string;\n method: 'POST' | 'PATCH' | 'PUT';\n headers?: {\n [name: string]: string;\n };\n};\n\nexport type VideoDownloadInfo = {\n url: string;\n quality: string;\n size: number;\n};\n\nexport type VideoInfo = {\n status: 'SUCCESS' | 'PROCESSING' | 'ERROR';\n downloads: VideoDownloadInfo[];\n id: string;\n};\n\nexport enum UploadProviders {\n Vimeo = 'vimeo',\n S3 = 's3',\n}\n\ntype BaseUploadUrlRequest = {\n contentType: string;\n};\n\nexport type VimeoUploadRequest = BaseUploadUrlRequest & {\n size: number;\n name: string;\n};\n\nexport type S3UploadRequest = BaseUploadUrlRequest & {\n // is the file supposed to be shared by all tenants that need it, or will each tenant have its copy\n shared: boolean;\n fileName: string;\n businessEntityId: string;\n};\n\nexport type UploadUrlRequest<Provider extends UploadProviders> =\n Provider extends UploadProviders.Vimeo\n ? VimeoUploadRequest\n : Provider extends UploadProviders.S3\n ? S3UploadRequest\n : {};\n\nexport type UploadProvider = {\n validationSchema: Joi.ObjectSchema<any>;\n getVideoListInfo: (requester: Requester, videoIds: string[]) => Promise<VideoInfo[]>;\n getUploadInfo(\n requester: Requester,\n request: UploadUrlRequest<UploadProviders>\n ): Promise<UploadInfo>;\n};\n\nexport type UploadProvidersDefinition = {\n [key in UploadProviders]: UploadProvider;\n};\n\nexport enum MediaExportResolution {\n Low = 'low',\n High = 'high',\n}\n\nexport type MediaExportRequest = {\n urls: string[];\n resolution?: MediaExportResolution;\n};\n\nexport type MediaExportEvent = {\n s3Keys: string[];\n outputId: string;\n tenantId: string;\n entityId: string;\n resolution: MediaExportResolution;\n};\n"]}
|