@pushwoosh/rpc-v2-http-api-data 0.2.470 → 0.2.472

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.
@@ -0,0 +1,128 @@
1
+ import { RpcMethod } from './commonTypes';
2
+ export type chatPresetsService_List = RpcMethod<ListChatPresetsRequest, ListChatPresetsResponse>;
3
+ export type chatPresetsService_Get = RpcMethod<GetChatPresetRequest, GetChatPresetResponse>;
4
+ export type chatPresetsService_Create = RpcMethod<CreateChatPresetRequest, CreateChatPresetResponse>;
5
+ export type chatPresetsService_Update = RpcMethod<UpdateChatPresetRequest, UpdateChatPresetResponse>;
6
+ export type chatPresetsService_Delete = RpcMethod<DeleteChatPresetRequest, DeleteChatPresetResponse>;
7
+ export type chatPresetsService_Clone = RpcMethod<CloneChatPresetRequest, CloneChatPresetResponse>;
8
+ export type chatPresetsService_Validate = RpcMethod<ValidateChatPresetRequest, ValidateChatPresetResponse>;
9
+ export interface chatPresetsService {
10
+ /** Lists chat presets of an application: one rich message (cards, carousels, buttons, lists) shared by RCS, WhatsApp, Facebook Messenger and LINE, each with its per-channel compatibility. Use to browse presets or find a code before get, update, clone or delete. */
11
+ List: chatPresetsService_List;
12
+ /** Returns one chat preset by code with its localized content and the compatibility verdict for every chat channel. */
13
+ Get: chatPresetsService_Get;
14
+ /** Creates a chat preset from localized rich content, assigning a fresh code and button ids where they are missing. Each call makes a new preset; use update_chat_preset to change an existing one. */
15
+ Create: chatPresetsService_Create;
16
+ /** Overwrites the name, category and localized content of an existing chat preset and recomputes its channel compatibility. Button ids already set are kept as sent. */
17
+ Update: chatPresetsService_Update;
18
+ /** Permanently deletes a chat preset by code; the removal cannot be undone. */
19
+ Delete: chatPresetsService_Delete;
20
+ /** Copies a chat preset into a target application as a new preset with its own code. */
21
+ Clone: chatPresetsService_Clone;
22
+ /** Checks localized rich content against every chat channel without saving it and returns the per-channel compatibility the editor shows. */
23
+ Validate: chatPresetsService_Validate;
24
+ }
25
+ export type ChannelIssue = {
26
+ /** Field path inside the content, e.g. "cards[1].buttons[0].title". */
27
+ path: string;
28
+ /** Machine code, e.g. "too_long", "type_unsupported". */
29
+ code: string;
30
+ /** "error" blocks the channel, "fallback" sends the fallback text there, "warning" is informational. */
31
+ severity: string;
32
+ message: string;
33
+ };
34
+ export type ChannelCompat = {
35
+ /** "compatible", "partial" (some of it goes out as fallback text) or "incompatible". */
36
+ status: string;
37
+ /** Issues keyed by language prefix: "<lang>:<path>" in path when the preset has several languages. */
38
+ issues: ChannelIssue[];
39
+ };
40
+ export type ChatPreset = {
41
+ code: string;
42
+ name: string;
43
+ /** Application code (XXXXX-XXXXX) the preset belongs to. */
44
+ application: string;
45
+ /** WhatsApp template category: "marketing" or "utility". */
46
+ category: string;
47
+ /** Rich content per language, each value a JSON object of the channel-agnostic model (type, body, media, buttons, cards...). */
48
+ localizedContent: Record<string, string>;
49
+ /** Compatibility per channel: "rcs", "whatsapp", "fbmessenger", "line". */
50
+ compat: Record<string, ChannelCompat>;
51
+ created: Date;
52
+ updated: Date;
53
+ };
54
+ export type ListChatPresetsRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED';
55
+ export type ListChatPresetsRequest_OrderDirection = 'ASC' | 'DESC';
56
+ export type ListChatPresetsRequest = {
57
+ /** Application code (XXXXX-XXXXX) whose chat presets to list. */
58
+ application?: string;
59
+ orderBy?: ListChatPresetsRequest_OrderBy;
60
+ orderDirection?: ListChatPresetsRequest_OrderDirection;
61
+ page?: number;
62
+ perPage?: number;
63
+ /** Free-text substring matched against preset name OR preset code (case-insensitive). */
64
+ searchByName?: string;
65
+ };
66
+ export type ListChatPresetsResponse = {
67
+ presets: ChatPreset[];
68
+ page: number;
69
+ perPage: number;
70
+ total: number;
71
+ };
72
+ export type GetChatPresetRequest = {
73
+ /** Chat preset code to fetch. */
74
+ code?: string;
75
+ };
76
+ export type GetChatPresetResponse = {
77
+ preset: ChatPreset;
78
+ };
79
+ export type CreateChatPresetRequest = {
80
+ /** Application code (XXXXX-XXXXX) the new preset belongs to. */
81
+ application?: string;
82
+ name?: string;
83
+ /** WhatsApp template category: "marketing" or "utility"; empty means marketing. */
84
+ category?: string;
85
+ /** Rich content per language as JSON of the channel-agnostic model, e.g. {"default": "{\"type\":\"text\",\"body\":\"Hi\"}"}. */
86
+ localizedContent?: Record<string, string>;
87
+ };
88
+ export type CreateChatPresetResponse = {
89
+ preset: ChatPreset;
90
+ };
91
+ export type UpdateChatPresetRequest = {
92
+ /** Chat preset code to update. */
93
+ code?: string;
94
+ /** New name; empty keeps the current one. */
95
+ name?: string;
96
+ /** New WhatsApp category; empty keeps the current one. */
97
+ category?: string;
98
+ /** Replaces the whole localized content when set. */
99
+ localizedContent?: Record<string, string>;
100
+ };
101
+ export type UpdateChatPresetResponse = {
102
+ preset: ChatPreset;
103
+ };
104
+ export type DeleteChatPresetRequest = {
105
+ /** Chat preset code to delete. */
106
+ code?: string;
107
+ };
108
+ export type DeleteChatPresetResponse = {};
109
+ export type CloneChatPresetRequest = {
110
+ /** Code of the source chat preset to copy. */
111
+ chatPresetCode?: string;
112
+ /** Application code (XXXXX-XXXXX) the copy is created in. */
113
+ applicationCode?: string;
114
+ };
115
+ export type CloneChatPresetResponse = {
116
+ chatPresetCode: string;
117
+ };
118
+ export type ValidateChatPresetRequest = {
119
+ /** Application code (XXXXX-XXXXX) the content is meant for. */
120
+ application?: string;
121
+ category?: string;
122
+ /** Rich content per language as JSON of the channel-agnostic model. */
123
+ localizedContent?: Record<string, string>;
124
+ };
125
+ export type ValidateChatPresetResponse = {
126
+ /** Compatibility per channel: "rcs", "whatsapp", "fbmessenger", "line". */
127
+ compat: Record<string, ChannelCompat>;
128
+ };
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};
package/data.js CHANGED
@@ -11477,6 +11477,293 @@ export const data = {
11477
11477
  }
11478
11478
  }
11479
11479
  },
11480
+ "pushwoosh.rpc_v2.chat_presets.chatPresetsService": {
11481
+ "type": "S",
11482
+ "key": "chatPresets",
11483
+ "methods": {
11484
+ "List": {
11485
+ "request": "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest",
11486
+ "response": "pushwoosh.rpc_v2.chat_presets.ListChatPresetsResponse",
11487
+ "method": "get",
11488
+ "path": "/api/chat_presets"
11489
+ },
11490
+ "Get": {
11491
+ "request": "pushwoosh.rpc_v2.chat_presets.GetChatPresetRequest",
11492
+ "response": "pushwoosh.rpc_v2.chat_presets.GetChatPresetResponse",
11493
+ "method": "get",
11494
+ "path": "/api/chat_presets/{code}"
11495
+ },
11496
+ "Create": {
11497
+ "request": "pushwoosh.rpc_v2.chat_presets.CreateChatPresetRequest",
11498
+ "response": "pushwoosh.rpc_v2.chat_presets.CreateChatPresetResponse",
11499
+ "method": "post",
11500
+ "path": "/api/chat_presets"
11501
+ },
11502
+ "Update": {
11503
+ "request": "pushwoosh.rpc_v2.chat_presets.UpdateChatPresetRequest",
11504
+ "response": "pushwoosh.rpc_v2.chat_presets.UpdateChatPresetResponse",
11505
+ "method": "put",
11506
+ "path": "/api/chat_presets/{code}"
11507
+ },
11508
+ "Delete": {
11509
+ "request": "pushwoosh.rpc_v2.chat_presets.DeleteChatPresetRequest",
11510
+ "response": "pushwoosh.rpc_v2.chat_presets.DeleteChatPresetResponse",
11511
+ "method": "delete",
11512
+ "path": "/api/chat_presets/{code}"
11513
+ },
11514
+ "Clone": {
11515
+ "request": "pushwoosh.rpc_v2.chat_presets.CloneChatPresetRequest",
11516
+ "response": "pushwoosh.rpc_v2.chat_presets.CloneChatPresetResponse",
11517
+ "method": "post",
11518
+ "path": "/api/chat_presets:clone"
11519
+ },
11520
+ "Validate": {
11521
+ "request": "pushwoosh.rpc_v2.chat_presets.ValidateChatPresetRequest",
11522
+ "response": "pushwoosh.rpc_v2.chat_presets.ValidateChatPresetResponse",
11523
+ "method": "post",
11524
+ "path": "/api/chat_presets:validate"
11525
+ }
11526
+ }
11527
+ },
11528
+ "pushwoosh.rpc_v2.chat_presets.ChannelIssue": {
11529
+ "type": "I",
11530
+ "fields": {
11531
+ "path": {
11532
+ "type": "string"
11533
+ },
11534
+ "code": {
11535
+ "type": "string"
11536
+ },
11537
+ "severity": {
11538
+ "type": "string"
11539
+ },
11540
+ "message": {
11541
+ "type": "string"
11542
+ }
11543
+ }
11544
+ },
11545
+ "pushwoosh.rpc_v2.chat_presets.ChannelCompat": {
11546
+ "type": "I",
11547
+ "fields": {
11548
+ "status": {
11549
+ "type": "string"
11550
+ },
11551
+ "issues": {
11552
+ "type": "pushwoosh.rpc_v2.chat_presets.ChannelIssue",
11553
+ "array": true
11554
+ }
11555
+ }
11556
+ },
11557
+ "pushwoosh.rpc_v2.chat_presets.ChatPreset": {
11558
+ "type": "I",
11559
+ "fields": {
11560
+ "code": {
11561
+ "type": "string"
11562
+ },
11563
+ "name": {
11564
+ "type": "string"
11565
+ },
11566
+ "application": {
11567
+ "type": "string"
11568
+ },
11569
+ "category": {
11570
+ "type": "string"
11571
+ },
11572
+ "localizedContent": {
11573
+ "type": "string",
11574
+ "mapKeyType": "string"
11575
+ },
11576
+ "compat": {
11577
+ "type": "pushwoosh.rpc_v2.chat_presets.ChannelCompat",
11578
+ "mapKeyType": "string"
11579
+ },
11580
+ "created": {
11581
+ "type": "Date"
11582
+ },
11583
+ "updated": {
11584
+ "type": "Date"
11585
+ }
11586
+ }
11587
+ },
11588
+ "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest.OrderBy": {
11589
+ "type": "E",
11590
+ "values": [
11591
+ "NAME",
11592
+ "CREATED",
11593
+ "UPDATED"
11594
+ ]
11595
+ },
11596
+ "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest.OrderDirection": {
11597
+ "type": "E",
11598
+ "values": [
11599
+ "ASC",
11600
+ "DESC"
11601
+ ]
11602
+ },
11603
+ "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest": {
11604
+ "type": "I",
11605
+ "fields": {
11606
+ "application": {
11607
+ "type": "string"
11608
+ },
11609
+ "orderBy": {
11610
+ "type": "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest.OrderBy"
11611
+ },
11612
+ "orderDirection": {
11613
+ "type": "pushwoosh.rpc_v2.chat_presets.ListChatPresetsRequest.OrderDirection"
11614
+ },
11615
+ "page": {
11616
+ "type": "number"
11617
+ },
11618
+ "perPage": {
11619
+ "type": "number"
11620
+ },
11621
+ "searchByName": {
11622
+ "type": "string"
11623
+ }
11624
+ }
11625
+ },
11626
+ "pushwoosh.rpc_v2.chat_presets.ListChatPresetsResponse": {
11627
+ "type": "I",
11628
+ "fields": {
11629
+ "presets": {
11630
+ "type": "pushwoosh.rpc_v2.chat_presets.ChatPreset",
11631
+ "array": true
11632
+ },
11633
+ "page": {
11634
+ "type": "number"
11635
+ },
11636
+ "perPage": {
11637
+ "type": "number"
11638
+ },
11639
+ "total": {
11640
+ "type": "number"
11641
+ }
11642
+ }
11643
+ },
11644
+ "pushwoosh.rpc_v2.chat_presets.GetChatPresetRequest": {
11645
+ "type": "I",
11646
+ "fields": {
11647
+ "code": {
11648
+ "type": "string"
11649
+ }
11650
+ }
11651
+ },
11652
+ "pushwoosh.rpc_v2.chat_presets.GetChatPresetResponse": {
11653
+ "type": "I",
11654
+ "fields": {
11655
+ "preset": {
11656
+ "type": "pushwoosh.rpc_v2.chat_presets.ChatPreset"
11657
+ }
11658
+ }
11659
+ },
11660
+ "pushwoosh.rpc_v2.chat_presets.CreateChatPresetRequest": {
11661
+ "type": "I",
11662
+ "fields": {
11663
+ "application": {
11664
+ "type": "string"
11665
+ },
11666
+ "name": {
11667
+ "type": "string"
11668
+ },
11669
+ "category": {
11670
+ "type": "string"
11671
+ },
11672
+ "localizedContent": {
11673
+ "type": "string",
11674
+ "mapKeyType": "string"
11675
+ }
11676
+ }
11677
+ },
11678
+ "pushwoosh.rpc_v2.chat_presets.CreateChatPresetResponse": {
11679
+ "type": "I",
11680
+ "fields": {
11681
+ "preset": {
11682
+ "type": "pushwoosh.rpc_v2.chat_presets.ChatPreset"
11683
+ }
11684
+ }
11685
+ },
11686
+ "pushwoosh.rpc_v2.chat_presets.UpdateChatPresetRequest": {
11687
+ "type": "I",
11688
+ "fields": {
11689
+ "code": {
11690
+ "type": "string"
11691
+ },
11692
+ "name": {
11693
+ "type": "string"
11694
+ },
11695
+ "category": {
11696
+ "type": "string"
11697
+ },
11698
+ "localizedContent": {
11699
+ "type": "string",
11700
+ "mapKeyType": "string"
11701
+ }
11702
+ }
11703
+ },
11704
+ "pushwoosh.rpc_v2.chat_presets.UpdateChatPresetResponse": {
11705
+ "type": "I",
11706
+ "fields": {
11707
+ "preset": {
11708
+ "type": "pushwoosh.rpc_v2.chat_presets.ChatPreset"
11709
+ }
11710
+ }
11711
+ },
11712
+ "pushwoosh.rpc_v2.chat_presets.DeleteChatPresetRequest": {
11713
+ "type": "I",
11714
+ "fields": {
11715
+ "code": {
11716
+ "type": "string"
11717
+ }
11718
+ }
11719
+ },
11720
+ "pushwoosh.rpc_v2.chat_presets.DeleteChatPresetResponse": {
11721
+ "type": "I",
11722
+ "fields": {}
11723
+ },
11724
+ "pushwoosh.rpc_v2.chat_presets.CloneChatPresetRequest": {
11725
+ "type": "I",
11726
+ "fields": {
11727
+ "chatPresetCode": {
11728
+ "type": "string"
11729
+ },
11730
+ "applicationCode": {
11731
+ "type": "string"
11732
+ }
11733
+ }
11734
+ },
11735
+ "pushwoosh.rpc_v2.chat_presets.CloneChatPresetResponse": {
11736
+ "type": "I",
11737
+ "fields": {
11738
+ "chatPresetCode": {
11739
+ "type": "string"
11740
+ }
11741
+ }
11742
+ },
11743
+ "pushwoosh.rpc_v2.chat_presets.ValidateChatPresetRequest": {
11744
+ "type": "I",
11745
+ "fields": {
11746
+ "application": {
11747
+ "type": "string"
11748
+ },
11749
+ "category": {
11750
+ "type": "string"
11751
+ },
11752
+ "localizedContent": {
11753
+ "type": "string",
11754
+ "mapKeyType": "string"
11755
+ }
11756
+ }
11757
+ },
11758
+ "pushwoosh.rpc_v2.chat_presets.ValidateChatPresetResponse": {
11759
+ "type": "I",
11760
+ "fields": {
11761
+ "compat": {
11762
+ "type": "pushwoosh.rpc_v2.chat_presets.ChannelCompat",
11763
+ "mapKeyType": "string"
11764
+ }
11765
+ }
11766
+ },
11480
11767
  "pushwoosh.rpc_v2.cloud_pages.CloudPagesService": {
11481
11768
  "type": "S",
11482
11769
  "key": "cloudPages",
@@ -36923,6 +37210,21 @@ export const data = {
36923
37210
  },
36924
37211
  "contentVariables": {
36925
37212
  "type": "string"
37213
+ },
37214
+ "quickReplies": {
37215
+ "type": "pushwoosh.rpc_v2.sms_presets.SmsRcsQuickReply",
37216
+ "array": true
37217
+ }
37218
+ }
37219
+ },
37220
+ "pushwoosh.rpc_v2.sms_presets.SmsRcsQuickReply": {
37221
+ "type": "I",
37222
+ "fields": {
37223
+ "id": {
37224
+ "type": "string"
37225
+ },
37226
+ "title": {
37227
+ "type": "string"
36926
37228
  }
36927
37229
  }
36928
37230
  },
@@ -37206,6 +37508,10 @@ export const data = {
37206
37508
  },
37207
37509
  "hasSmsFallback": {
37208
37510
  "type": "boolean"
37511
+ },
37512
+ "quickReplies": {
37513
+ "type": "pushwoosh.rpc_v2.sms_presets.SmsRcsQuickReply",
37514
+ "array": true
37209
37515
  }
37210
37516
  }
37211
37517
  },
package/index.d.ts CHANGED
@@ -23,6 +23,7 @@ import { CatalogService as pushwoosh_rpc_v2_catalog_CatalogService } from './cat
23
23
  import { CategoriesService as pushwoosh_rpc_v2_categories_CategoriesService } from './categories';
24
24
  import { MessagesInProgressService as pushwoosh_channels_messagingApi_v2_MessagesInProgressService } from './pushwoosh_channels_messagingApi_v2';
25
25
  import { MessagingService as pushwoosh_channels_messagingApi_v2_MessagingService } from './pushwoosh_channels_messagingApi_v2';
26
+ import { chatPresetsService as pushwoosh_rpc_v2_chat_presets_chatPresetsService } from './chat_presets';
26
27
  import { CloudPagesService as pushwoosh_rpc_v2_cloud_pages_CloudPagesService } from './cloud_pages';
27
28
  import { CustomerJourneyService as pushwoosh_rpc_v2_customer_journey_CustomerJourneyService } from './customer_journey';
28
29
  import { DataErasureService as pushwoosh_rpc_v2_data_erasure_DataErasureService } from './data_erasure';
@@ -106,6 +107,7 @@ export type API = {
106
107
  categories: pushwoosh_rpc_v2_categories_CategoriesService;
107
108
  messagesInProgress: pushwoosh_channels_messagingApi_v2_MessagesInProgressService;
108
109
  messaging: pushwoosh_channels_messagingApi_v2_MessagingService;
110
+ chatPresets: pushwoosh_rpc_v2_chat_presets_chatPresetsService;
109
111
  cloudPages: pushwoosh_rpc_v2_cloud_pages_CloudPagesService;
110
112
  customerJourney: pushwoosh_rpc_v2_customer_journey_CustomerJourneyService;
111
113
  dataErasure: pushwoosh_rpc_v2_data_erasure_DataErasureService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.470",
3
+ "version": "0.2.472",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
package/sms_presets.d.ts CHANGED
@@ -53,6 +53,15 @@ export type SmsPresetRcs = {
53
53
  contentSid: string;
54
54
  /** JSON object of template variables, e.g. {"1": "{FirstName|regular|}"}; values may hold tags and Liquid. */
55
55
  contentVariables: string;
56
+ /** Read only: the template's reply buttons as of the last save; a journey branches on their ids. */
57
+ quickReplies: SmsRcsQuickReply[];
58
+ };
59
+ /** One RCS reply button of a Twilio Content template. */
60
+ export type SmsRcsQuickReply = {
61
+ /** Button id from the template; Twilio returns it as ButtonPayload when the button is tapped. */
62
+ id: string;
63
+ /** Text shown on the button. */
64
+ title: string;
56
65
  };
57
66
  export type SmsProductsSource_Rule = {
58
67
  /** Catalog category to pick from; empty = any category. */
@@ -208,6 +217,8 @@ export type SmsRcsTemplate = {
208
217
  variables: Record<string, string>;
209
218
  /** True when the template has a twilio/text variant, the SMS a phone without RCS receives. */
210
219
  hasSmsFallback: boolean;
220
+ /** Reply buttons of the template (quick replies of quick-reply, card and carousel types). */
221
+ quickReplies: SmsRcsQuickReply[];
211
222
  };
212
223
  export type ListSmsRcsTemplatesResponse = {
213
224
  templates: SmsRcsTemplate[];