@bisondesk/core-sdk 1.0.637 → 1.0.638
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/whatsapp.d.ts
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WhatsappTemplateTranslation } from '@bisondesk/commons-sdk/notifications-whatsapp';
|
|
2
2
|
import { BusinessEntityIds } from '../constants.js';
|
|
3
3
|
import { Activity } from './activities.js';
|
|
4
4
|
import { DataRecord } from './utils.js';
|
|
5
|
-
export type { WhatsappActivityTemplateName };
|
|
6
5
|
export type WhatsappTemplateLanguage = {
|
|
7
6
|
language: string;
|
|
8
7
|
status: string;
|
|
9
8
|
};
|
|
10
9
|
export type WhatsappTemplateSummary = {
|
|
11
|
-
name:
|
|
10
|
+
name: string;
|
|
12
11
|
languages: WhatsappTemplateLanguage[];
|
|
12
|
+
variableCount: number;
|
|
13
13
|
};
|
|
14
|
-
export type WhatsappActivityTemplateTranslation = WhatsappTemplateTranslation<WhatsappActivityTemplateName>;
|
|
15
14
|
export type WhatsappTemplatePreview = {
|
|
16
|
-
sent:
|
|
17
|
-
canonical?:
|
|
15
|
+
sent: WhatsappTemplateTranslation;
|
|
16
|
+
canonical?: WhatsappTemplateTranslation;
|
|
18
17
|
};
|
|
19
18
|
export type WhatsappRecipient = {
|
|
20
19
|
contactId?: string;
|
|
@@ -25,13 +24,26 @@ export type WhatsappRecipient = {
|
|
|
25
24
|
export type WhatsappActivityContext = {
|
|
26
25
|
businessEntityId: BusinessEntityIds;
|
|
27
26
|
recordId: string;
|
|
28
|
-
organizationId?: string;
|
|
29
27
|
};
|
|
30
28
|
export type SendWhatsappActivityTemplateRequest = {
|
|
31
|
-
templateName:
|
|
29
|
+
templateName: string;
|
|
32
30
|
language: string;
|
|
33
31
|
recipient: Pick<WhatsappRecipient, 'contactId' | 'phone'>;
|
|
34
32
|
context: WhatsappActivityContext;
|
|
35
33
|
};
|
|
36
34
|
export type SendWhatsappActivityTemplateResponse = DataRecord<Activity>;
|
|
35
|
+
export declare const WHATSAPP_TEMPLATE_ENTITIES: readonly [BusinessEntityIds.Contacts, BusinessEntityIds.Organizations, BusinessEntityIds.Opportunities, BusinessEntityIds.Prospects, BusinessEntityIds.DebtorsDossier];
|
|
36
|
+
export type WhatsappTemplateSettings = {
|
|
37
|
+
name: string;
|
|
38
|
+
entities: BusinessEntityIds[];
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type WhatsappTemplateSettingsUpdate = Pick<WhatsappTemplateSettings, 'entities' | 'enabled'>;
|
|
42
|
+
export type WhatsappTemplateOverview = WhatsappTemplateSettings & {
|
|
43
|
+
languages: WhatsappTemplateLanguage[];
|
|
44
|
+
variableCount: number;
|
|
45
|
+
sendable: boolean;
|
|
46
|
+
text: string;
|
|
47
|
+
syncedAt: string;
|
|
48
|
+
};
|
|
37
49
|
//# sourceMappingURL=whatsapp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"/","sources":["types/whatsapp.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"/","sources":["types/whatsapp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,wBAAwB,EAAE,CAAC;IACtC,aA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whatsapp.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { BusinessEntityIds } from '../constants.js';
|
|
2
|
+
export const WHATSAPP_TEMPLATE_ENTITIES = [
|
|
3
|
+
BusinessEntityIds.Contacts,
|
|
4
|
+
BusinessEntityIds.Organizations,
|
|
5
|
+
BusinessEntityIds.Opportunities,
|
|
6
|
+
BusinessEntityIds.Prospects,
|
|
7
|
+
BusinessEntityIds.DebtorsDossier,
|
|
8
|
+
];
|
|
2
9
|
//# sourceMappingURL=whatsapp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.js","sourceRoot":"/","sources":["types/whatsapp.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"whatsapp.js","sourceRoot":"/","sources":["types/whatsapp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAkDpD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,iBAAiB,CAAC,QAAQ;IAC1B,iBAAiB,CAAC,aAAa;IAC/B,iBAAiB,CAAC,aAAa;IAC/B,iBAAiB,CAAC,SAAS;IAC3B,iBAAiB,CAAC,cAAc;CACe,CAAC","sourcesContent":["import { WhatsappTemplateTranslation } from '@bisondesk/commons-sdk/notifications-whatsapp';\nimport { BusinessEntityIds } from '../constants.js';\nimport { Activity } from './activities.js';\nimport { DataRecord } from './utils.js';\n\nexport type WhatsappTemplateLanguage = {\n language: string;\n status: string;\n};\n\n/**\n * One offerable template for a record: the languages it is approved in, and how many parameters\n * it takes. Templates the tenant has disabled, or that don't belong on this record's page, never\n * appear here.\n */\nexport type WhatsappTemplateSummary = {\n name: string;\n languages: WhatsappTemplateLanguage[];\n variableCount: number;\n};\n\nexport type WhatsappTemplatePreview = {\n sent: WhatsappTemplateTranslation;\n canonical?: WhatsappTemplateTranslation;\n};\n\nexport type WhatsappRecipient = {\n contactId?: string;\n organizationId?: string;\n phone: string;\n countryLanguage?: string;\n};\n\nexport type WhatsappActivityContext = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n};\n\nexport type SendWhatsappActivityTemplateRequest = {\n templateName: string;\n language: string;\n recipient: Pick<WhatsappRecipient, 'contactId' | 'phone'>;\n context: WhatsappActivityContext;\n};\n\nexport type SendWhatsappActivityTemplateResponse = DataRecord<Activity>;\n\n/**\n * The record pages a WhatsApp template can be offered on. The single source of truth: the send\n * schema validates against it, and the settings drawer lists exactly these.\n */\nexport const WHATSAPP_TEMPLATE_ENTITIES = [\n BusinessEntityIds.Contacts,\n BusinessEntityIds.Organizations,\n BusinessEntityIds.Opportunities,\n BusinessEntityIds.Prospects,\n BusinessEntityIds.DebtorsDossier,\n] as const satisfies readonly BusinessEntityIds[];\n\n/** A tenant's choices for one template: where it may be used, and whether it is offered at all. */\nexport type WhatsappTemplateSettings = {\n name: string;\n entities: BusinessEntityIds[];\n enabled: boolean;\n};\n\nexport type WhatsappTemplateSettingsUpdate = Pick<WhatsappTemplateSettings, 'entities' | 'enabled'>;\n\n/**\n * A row of the settings page: what the provider says about the template, merged with the tenant's\n * choices, plus whether BisonDesk knows how to fill its parameters.\n */\nexport type WhatsappTemplateOverview = WhatsappTemplateSettings & {\n languages: WhatsappTemplateLanguage[];\n variableCount: number;\n /** False when the template takes parameters no resolver can supply — it can never be offered. */\n sendable: boolean;\n text: string;\n syncedAt: string;\n};\n"]}
|
package/package.json
CHANGED
package/src/types/whatsapp.ts
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WhatsappActivityTemplateName,
|
|
3
|
-
WhatsappTemplateTranslation,
|
|
4
|
-
} from '@bisondesk/commons-sdk/notifications-whatsapp';
|
|
1
|
+
import { WhatsappTemplateTranslation } from '@bisondesk/commons-sdk/notifications-whatsapp';
|
|
5
2
|
import { BusinessEntityIds } from '../constants.js';
|
|
6
3
|
import { Activity } from './activities.js';
|
|
7
4
|
import { DataRecord } from './utils.js';
|
|
8
5
|
|
|
9
|
-
export type { WhatsappActivityTemplateName };
|
|
10
|
-
|
|
11
6
|
export type WhatsappTemplateLanguage = {
|
|
12
7
|
language: string;
|
|
13
8
|
status: string;
|
|
14
9
|
};
|
|
15
10
|
|
|
11
|
+
/**
|
|
12
|
+
* One offerable template for a record: the languages it is approved in, and how many parameters
|
|
13
|
+
* it takes. Templates the tenant has disabled, or that don't belong on this record's page, never
|
|
14
|
+
* appear here.
|
|
15
|
+
*/
|
|
16
16
|
export type WhatsappTemplateSummary = {
|
|
17
|
-
name:
|
|
17
|
+
name: string;
|
|
18
18
|
languages: WhatsappTemplateLanguage[];
|
|
19
|
+
variableCount: number;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export type WhatsappActivityTemplateTranslation =
|
|
22
|
-
WhatsappTemplateTranslation<WhatsappActivityTemplateName>;
|
|
23
|
-
|
|
24
22
|
export type WhatsappTemplatePreview = {
|
|
25
|
-
sent:
|
|
26
|
-
canonical?:
|
|
23
|
+
sent: WhatsappTemplateTranslation;
|
|
24
|
+
canonical?: WhatsappTemplateTranslation;
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
export type WhatsappRecipient = {
|
|
@@ -36,14 +34,47 @@ export type WhatsappRecipient = {
|
|
|
36
34
|
export type WhatsappActivityContext = {
|
|
37
35
|
businessEntityId: BusinessEntityIds;
|
|
38
36
|
recordId: string;
|
|
39
|
-
organizationId?: string;
|
|
40
37
|
};
|
|
41
38
|
|
|
42
39
|
export type SendWhatsappActivityTemplateRequest = {
|
|
43
|
-
templateName:
|
|
40
|
+
templateName: string;
|
|
44
41
|
language: string;
|
|
45
42
|
recipient: Pick<WhatsappRecipient, 'contactId' | 'phone'>;
|
|
46
43
|
context: WhatsappActivityContext;
|
|
47
44
|
};
|
|
48
45
|
|
|
49
46
|
export type SendWhatsappActivityTemplateResponse = DataRecord<Activity>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The record pages a WhatsApp template can be offered on. The single source of truth: the send
|
|
50
|
+
* schema validates against it, and the settings drawer lists exactly these.
|
|
51
|
+
*/
|
|
52
|
+
export const WHATSAPP_TEMPLATE_ENTITIES = [
|
|
53
|
+
BusinessEntityIds.Contacts,
|
|
54
|
+
BusinessEntityIds.Organizations,
|
|
55
|
+
BusinessEntityIds.Opportunities,
|
|
56
|
+
BusinessEntityIds.Prospects,
|
|
57
|
+
BusinessEntityIds.DebtorsDossier,
|
|
58
|
+
] as const satisfies readonly BusinessEntityIds[];
|
|
59
|
+
|
|
60
|
+
/** A tenant's choices for one template: where it may be used, and whether it is offered at all. */
|
|
61
|
+
export type WhatsappTemplateSettings = {
|
|
62
|
+
name: string;
|
|
63
|
+
entities: BusinessEntityIds[];
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type WhatsappTemplateSettingsUpdate = Pick<WhatsappTemplateSettings, 'entities' | 'enabled'>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A row of the settings page: what the provider says about the template, merged with the tenant's
|
|
71
|
+
* choices, plus whether BisonDesk knows how to fill its parameters.
|
|
72
|
+
*/
|
|
73
|
+
export type WhatsappTemplateOverview = WhatsappTemplateSettings & {
|
|
74
|
+
languages: WhatsappTemplateLanguage[];
|
|
75
|
+
variableCount: number;
|
|
76
|
+
/** False when the template takes parameters no resolver can supply — it can never be offered. */
|
|
77
|
+
sendable: boolean;
|
|
78
|
+
text: string;
|
|
79
|
+
syncedAt: string;
|
|
80
|
+
};
|