@bisondesk/core-sdk 1.0.652 → 1.0.654
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/templates.d.ts +0 -22
- package/lib/types/templates.d.ts.map +1 -1
- package/lib/types/templates.js.map +1 -1
- package/lib/utils/organizations.d.ts +3 -0
- package/lib/utils/organizations.d.ts.map +1 -0
- package/lib/utils/organizations.js +15 -0
- package/lib/utils/organizations.js.map +1 -0
- package/package.json +1 -1
- package/src/types/templates.ts +0 -27
- package/src/utils/organizations.ts +30 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/src/types/activities.js +0 -13
- package/src/types/activities.js.map +0 -1
- package/src/types/comparables.js +0 -2
- package/src/types/comparables.js.map +0 -1
- package/src/types/crm.js +0 -58
- package/src/types/crm.js.map +0 -1
- package/src/types/dashboard.js +0 -2
- package/src/types/dashboard.js.map +0 -1
- package/src/types/definitions.js +0 -2
- package/src/types/definitions.js.map +0 -1
- package/src/types/fields.js +0 -2
- package/src/types/fields.js.map +0 -1
- package/src/types/insights.js +0 -2
- package/src/types/insights.js.map +0 -1
- package/src/types/interests.js +0 -6
- package/src/types/interests.js.map +0 -1
- package/src/types/internal-events.js +0 -18
- package/src/types/internal-events.js.map +0 -1
- package/src/types/internet-opportunities.js +0 -2
- package/src/types/internet-opportunities.js.map +0 -1
- package/src/types/internet-vehicles.js +0 -2
- package/src/types/internet-vehicles.js.map +0 -1
- package/src/types/leasing-administration.js +0 -2
- package/src/types/leasing-administration.js.map +0 -1
- package/src/types/leasing-debtors.js +0 -2
- package/src/types/leasing-debtors.js.map +0 -1
- package/src/types/leasing-search.js +0 -2
- package/src/types/leasing-search.js.map +0 -1
- package/src/types/leasing-settings.js +0 -7
- package/src/types/leasing-settings.js.map +0 -1
- package/src/types/leasing.js +0 -38
- package/src/types/leasing.js.map +0 -1
- package/src/types/marketing.js +0 -35
- package/src/types/marketing.js.map +0 -1
- package/src/types/offers.js +0 -56
- package/src/types/opportunities.js +0 -107
- package/src/types/opportunities.js.map +0 -1
- package/src/types/payments.js +0 -7
- package/src/types/picklists.js +0 -2
- package/src/types/picklists.js.map +0 -1
- package/src/types/quotes.js +0 -42
- package/src/types/recently-viewed.js +0 -2
- package/src/types/recently-viewed.js.map +0 -1
- package/src/types/reservations.js +0 -5
- package/src/types/reservations.js.map +0 -1
- package/src/types/roi-ratings.js +0 -5
- package/src/types/roi-ratings.js.map +0 -1
- package/src/types/saved-filters.js +0 -9
- package/src/types/saved-filters.js.map +0 -1
- package/src/types/search.js +0 -2
- package/src/types/search.js.map +0 -1
- package/src/types/settings.js +0 -2
- package/src/types/settings.js.map +0 -1
- package/src/types/templates.js +0 -2
- package/src/types/templates.js.map +0 -1
- package/src/types/tenants.js +0 -21
- package/src/types/tenants.js.map +0 -1
- package/src/types/user-performance.js +0 -7
- package/src/types/user-performance.js.map +0 -1
- package/src/types/utils.js +0 -2
- package/src/types/validation.js +0 -2
- package/src/types/validation.js.map +0 -1
- package/src/types/vehicle-sales.js +0 -6
- package/src/types/vehicle-sales.js.map +0 -1
- package/src/types/vehicles.js +0 -98
- package/src/types/vehicles.js.map +0 -1
- package/src/utils/leasing.js +0 -6
- package/src/utils/leasing.js.map +0 -1
- package/src/utils/opportunities.js +0 -48
- package/src/utils/opportunities.js.map +0 -1
package/lib/types/templates.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { EmailContent, EmailRequest } from '@bisondesk/commons-sdk/messages';
|
|
2
1
|
export type TemplateContent = {
|
|
3
2
|
subject: string;
|
|
4
3
|
content: {
|
|
@@ -31,25 +30,4 @@ export type UpdateTemplateInfoRequest = {
|
|
|
31
30
|
name: string;
|
|
32
31
|
tags?: any;
|
|
33
32
|
};
|
|
34
|
-
export type CodeEmailTemplateInfo = Pick<TemplateInfo, 'id' | 'name' | 'countries'> & {
|
|
35
|
-
format: 'react-email';
|
|
36
|
-
};
|
|
37
|
-
export type TemplateCatalogueEntry = (TemplateInfo & {
|
|
38
|
-
format: 'html';
|
|
39
|
-
}) | CodeEmailTemplateInfo;
|
|
40
|
-
export type TemplateEmailRequest<T extends Record<string, unknown> = Record<string, unknown>> = Omit<EmailRequest, 'subject' | 'body'> & {
|
|
41
|
-
templateId: string;
|
|
42
|
-
country: string;
|
|
43
|
-
fallbackCountry?: string;
|
|
44
|
-
data: T;
|
|
45
|
-
subject?: string;
|
|
46
|
-
};
|
|
47
|
-
export type EmailTemplatePreviewRequest = {
|
|
48
|
-
data?: Record<string, unknown>;
|
|
49
|
-
subject?: string;
|
|
50
|
-
};
|
|
51
|
-
export type EmailTemplatePreview = {
|
|
52
|
-
content: EmailContent;
|
|
53
|
-
data: Record<string, unknown>;
|
|
54
|
-
};
|
|
55
33
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"/","sources":["types/templates.ts"],"names":[],"mappings":"","sourcesContent":["export type TemplateContent = {\n subject: string;\n content: {\n html: string;\n design: any;\n };\n};\n\nexport type NewTemplateRequest = {\n id?: string;\n country: string;\n tags?: any;\n name: string;\n} & TemplateContent;\n\nexport type Template = {\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n tags?: any;\n\n country: string;\n name: string;\n} & TemplateContent;\n\nexport type TemplateInfo = {\n id: string;\n countries: string[];\n modifiedAt: string;\n name: string;\n tags?: any;\n};\n\nexport type UpdateTemplateInfoRequest = {\n name: string;\n tags?: any;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"/","sources":["utils/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAoB5D,eAAO,MAAM,mBAAmB,cACnB,MAAM,GAAG,SAAS,UACtB,QAAQ,EAAE,KAChB,OAMF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AppRoles } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import { addMonths, isBefore } from 'date-fns';
|
|
3
|
+
const ORG_IDENTITY_LOCK_MONTHS = 1;
|
|
4
|
+
const ORG_IDENTITY_EDIT_ROLES = [
|
|
5
|
+
AppRoles.Administrative,
|
|
6
|
+
AppRoles.GeneralManager,
|
|
7
|
+
AppRoles.Admin,
|
|
8
|
+
];
|
|
9
|
+
export const isOrgIdentityLocked = (createdAt, roles = []) => {
|
|
10
|
+
if (createdAt == null || roles.some((role) => ORG_IDENTITY_EDIT_ROLES.includes(role))) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return isBefore(addMonths(new Date(createdAt), ORG_IDENTITY_LOCK_MONTHS), new Date());
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"/","sources":["utils/organizations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC,MAAM,uBAAuB,GAAe;IAC1C,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,cAAc;IACvB,QAAQ,CAAC,KAAK;CACf,CAAC;AAWF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,SAA6B,EAC7B,KAAK,GAAe,EAAE,EACb,EAAE;IACX,IAAI,SAAS,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,wBAAwB,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;AACxF,CAAC,CAAC","sourcesContent":["import { AppRoles } from '@bisondesk/commons-sdk/constants';\nimport { addMonths, isBefore } from 'date-fns';\n\nconst ORG_IDENTITY_LOCK_MONTHS = 1;\n\nconst ORG_IDENTITY_EDIT_ROLES: AppRoles[] = [\n AppRoles.Administrative,\n AppRoles.GeneralManager,\n AppRoles.Admin,\n];\n\n/**\n * An organization's name and VAT number are its legal identity: the values invoices and contracts\n * are issued against. They stay open for correction right after creation, then freeze for everyone\n * except ORG_IDENTITY_EDIT_ROLES — by then they are already printed on legal documents.\n *\n * Shared so the server guard and the form's disabled state read one rule. Fails open on a missing\n * createdAt: the org update path doubles as a create path for HyperDMS, and an org with no stored\n * date must not be frozen out of its own first write.\n */\nexport const isOrgIdentityLocked = (\n createdAt: string | undefined,\n roles: AppRoles[] = [],\n): boolean => {\n if (createdAt == null || roles.some((role) => ORG_IDENTITY_EDIT_ROLES.includes(role))) {\n return false;\n }\n\n return isBefore(addMonths(new Date(createdAt), ORG_IDENTITY_LOCK_MONTHS), new Date());\n};\n"]}
|
package/package.json
CHANGED
package/src/types/templates.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { EmailContent, EmailRequest } from '@bisondesk/commons-sdk/messages';
|
|
2
|
-
|
|
3
1
|
export type TemplateContent = {
|
|
4
2
|
subject: string;
|
|
5
3
|
content: {
|
|
@@ -37,28 +35,3 @@ export type UpdateTemplateInfoRequest = {
|
|
|
37
35
|
name: string;
|
|
38
36
|
tags?: any;
|
|
39
37
|
};
|
|
40
|
-
|
|
41
|
-
export type CodeEmailTemplateInfo = Pick<TemplateInfo, 'id' | 'name' | 'countries'> & {
|
|
42
|
-
format: 'react-email';
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type TemplateCatalogueEntry = (TemplateInfo & { format: 'html' }) | CodeEmailTemplateInfo;
|
|
46
|
-
|
|
47
|
-
export type TemplateEmailRequest<T extends Record<string, unknown> = Record<string, unknown>> =
|
|
48
|
-
Omit<EmailRequest, 'subject' | 'body'> & {
|
|
49
|
-
templateId: string;
|
|
50
|
-
country: string;
|
|
51
|
-
fallbackCountry?: string;
|
|
52
|
-
data: T;
|
|
53
|
-
subject?: string;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export type EmailTemplatePreviewRequest = {
|
|
57
|
-
data?: Record<string, unknown>;
|
|
58
|
-
subject?: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export type EmailTemplatePreview = {
|
|
62
|
-
content: EmailContent;
|
|
63
|
-
data: Record<string, unknown>;
|
|
64
|
-
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AppRoles } from '@bisondesk/commons-sdk/constants';
|
|
2
|
+
import { addMonths, isBefore } from 'date-fns';
|
|
3
|
+
|
|
4
|
+
const ORG_IDENTITY_LOCK_MONTHS = 1;
|
|
5
|
+
|
|
6
|
+
const ORG_IDENTITY_EDIT_ROLES: AppRoles[] = [
|
|
7
|
+
AppRoles.Administrative,
|
|
8
|
+
AppRoles.GeneralManager,
|
|
9
|
+
AppRoles.Admin,
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An organization's name and VAT number are its legal identity: the values invoices and contracts
|
|
14
|
+
* are issued against. They stay open for correction right after creation, then freeze for everyone
|
|
15
|
+
* except ORG_IDENTITY_EDIT_ROLES — by then they are already printed on legal documents.
|
|
16
|
+
*
|
|
17
|
+
* Shared so the server guard and the form's disabled state read one rule. Fails open on a missing
|
|
18
|
+
* createdAt: the org update path doubles as a create path for HyperDMS, and an org with no stored
|
|
19
|
+
* date must not be frozen out of its own first write.
|
|
20
|
+
*/
|
|
21
|
+
export const isOrgIdentityLocked = (
|
|
22
|
+
createdAt: string | undefined,
|
|
23
|
+
roles: AppRoles[] = [],
|
|
24
|
+
): boolean => {
|
|
25
|
+
if (createdAt == null || roles.some((role) => ORG_IDENTITY_EDIT_ROLES.includes(role))) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return isBefore(addMonths(new Date(createdAt), ORG_IDENTITY_LOCK_MONTHS), new Date());
|
|
30
|
+
};
|