@bisondesk/core-sdk 1.0.638 → 1.0.639

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.
@@ -5,6 +5,7 @@ import { DataRecord } from './utils.js';
5
5
  export type WhatsappTemplateLanguage = {
6
6
  language: string;
7
7
  status: string;
8
+ text?: string;
8
9
  };
9
10
  export type WhatsappTemplateSummary = {
10
11
  name: string;
@@ -40,10 +41,9 @@ export type WhatsappTemplateSettings = {
40
41
  };
41
42
  export type WhatsappTemplateSettingsUpdate = Pick<WhatsappTemplateSettings, 'entities' | 'enabled'>;
42
43
  export type WhatsappTemplateOverview = WhatsappTemplateSettings & {
43
- languages: WhatsappTemplateLanguage[];
44
+ languages: Required<WhatsappTemplateLanguage>[];
44
45
  variableCount: number;
45
46
  sendable: boolean;
46
- text: string;
47
47
  syncedAt: string;
48
48
  };
49
49
  //# sourceMappingURL=whatsapp.d.ts.map
@@ -1 +1 @@
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,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,2BAA2B,CAAC;IAClC,SAAS,CAAC,EAAE,2BAA2B,CAAC;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AiB,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAMpG,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,GAAG;IAEhE,SAAS,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;IAEtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -1 +1 @@
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"]}
1
+ {"version":3,"file":"whatsapp.js","sourceRoot":"/","sources":["types/whatsapp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoDpD,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 /** The body as approved in this language. Absent from the tile summary, which never shows it. */\n text?: 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 /** Every approved language, the one that represents the template first. */\n languages: Required<WhatsappTemplateLanguage>[];\n variableCount: number;\n /** False when the template takes parameters no resolver can supply — it can never be offered. */\n sendable: boolean;\n syncedAt: string;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.638",
3
+ "version": "1.0.639",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "author": "TheTruckCompany",
@@ -6,6 +6,8 @@ import { DataRecord } from './utils.js';
6
6
  export type WhatsappTemplateLanguage = {
7
7
  language: string;
8
8
  status: string;
9
+ /** The body as approved in this language. Absent from the tile summary, which never shows it. */
10
+ text?: string;
9
11
  };
10
12
 
11
13
  /**
@@ -71,10 +73,10 @@ export type WhatsappTemplateSettingsUpdate = Pick<WhatsappTemplateSettings, 'ent
71
73
  * choices, plus whether BisonDesk knows how to fill its parameters.
72
74
  */
73
75
  export type WhatsappTemplateOverview = WhatsappTemplateSettings & {
74
- languages: WhatsappTemplateLanguage[];
76
+ /** Every approved language, the one that represents the template first. */
77
+ languages: Required<WhatsappTemplateLanguage>[];
75
78
  variableCount: number;
76
79
  /** False when the template takes parameters no resolver can supply — it can never be offered. */
77
80
  sendable: boolean;
78
- text: string;
79
81
  syncedAt: string;
80
82
  };