@pushwoosh/rpc-v2-http-api-data 0.2.37 → 0.2.38

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/data.js CHANGED
@@ -22757,6 +22757,18 @@ export const data = {
22757
22757
  "method": "post",
22758
22758
  "path": "/api/rich-medias"
22759
22759
  },
22760
+ "CreateNative": {
22761
+ "request": "pushwoosh.rpc_v2.rich_medias.CreateNativeRequest",
22762
+ "response": "pushwoosh.rpc_v2.rich_medias.CreateNativeResponse",
22763
+ "method": "post",
22764
+ "path": "/api/rich-medias:createNative"
22765
+ },
22766
+ "UpdateNative": {
22767
+ "request": "pushwoosh.rpc_v2.rich_medias.UpdateNativeRequest",
22768
+ "response": "pushwoosh.rpc_v2.rich_medias.UpdateNativeResponse",
22769
+ "method": "post",
22770
+ "path": "/api/rich-medias/{code}:updateNative"
22771
+ },
22760
22772
  "Clone": {
22761
22773
  "request": "pushwoosh.rpc_v2.rich_medias.CloneRequest",
22762
22774
  "response": "pushwoosh.rpc_v2.rich_medias.CloneResponse",
@@ -22897,7 +22909,8 @@ export const data = {
22897
22909
  "UNDEFINED",
22898
22910
  "TEMPLATE",
22899
22911
  "BUILDER",
22900
- "SMARTCARDS"
22912
+ "SMARTCARDS",
22913
+ "NATIVE"
22901
22914
  ]
22902
22915
  },
22903
22916
  "pushwoosh.rpc_v2.rich_medias.RichMedia": {
@@ -23445,6 +23458,59 @@ export const data = {
23445
23458
  }
23446
23459
  }
23447
23460
  },
23461
+ "pushwoosh.rpc_v2.rich_medias.CreateNativeRequest": {
23462
+ "type": "I",
23463
+ "fields": {
23464
+ "name": {
23465
+ "type": "string"
23466
+ },
23467
+ "content": {
23468
+ "type": "string"
23469
+ },
23470
+ "localization": {
23471
+ "type": "string"
23472
+ },
23473
+ "defaultLanguage": {
23474
+ "type": "string"
23475
+ }
23476
+ }
23477
+ },
23478
+ "pushwoosh.rpc_v2.rich_medias.CreateNativeResponse": {
23479
+ "type": "I",
23480
+ "fields": {
23481
+ "code": {
23482
+ "type": "string"
23483
+ }
23484
+ }
23485
+ },
23486
+ "pushwoosh.rpc_v2.rich_medias.UpdateNativeRequest": {
23487
+ "type": "I",
23488
+ "fields": {
23489
+ "code": {
23490
+ "type": "string"
23491
+ },
23492
+ "name": {
23493
+ "type": "string"
23494
+ },
23495
+ "content": {
23496
+ "type": "string"
23497
+ },
23498
+ "localization": {
23499
+ "type": "string"
23500
+ },
23501
+ "defaultLanguage": {
23502
+ "type": "string"
23503
+ }
23504
+ }
23505
+ },
23506
+ "pushwoosh.rpc_v2.rich_medias.UpdateNativeResponse": {
23507
+ "type": "I",
23508
+ "fields": {
23509
+ "code": {
23510
+ "type": "string"
23511
+ }
23512
+ }
23513
+ },
23448
23514
  "pushwoosh.rpc_v2.rich_medias.CloneRequest": {
23449
23515
  "type": "I",
23450
23516
  "fields": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
package/rich_medias.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { RpcMethod } from './commonTypes';
2
2
  export type RichMediaService_Create = RpcMethod<CreateRequest, CreateResponse>;
3
+ export type RichMediaService_CreateNative = RpcMethod<CreateNativeRequest, CreateNativeResponse>;
4
+ export type RichMediaService_UpdateNative = RpcMethod<UpdateNativeRequest, UpdateNativeResponse>;
3
5
  export type RichMediaService_Clone = RpcMethod<CloneRequest, CloneResponse>;
4
6
  export type RichMediaService_Delete = RpcMethod<DeleteRequest, DeleteResponse>;
5
7
  export type RichMediaService_Get = RpcMethod<GetRequest, GetResponse>;
@@ -13,6 +15,17 @@ export type RichMediaService_GetDevices = RpcMethod<GetDevicesRequest, GetDevice
13
15
  export type RichMediaService_GetEvents = RpcMethod<GetEventsRequest, GetEventsResponse>;
14
16
  export interface RichMediaService {
15
17
  Create: RichMediaService_Create;
18
+ /**
19
+ * Create new native Rich Media. The server validates the payload and builds the zip archive
20
+ * (native-config.json + pushwoosh.json) from the request fields.
21
+ * Rich Media code will be generated by server and returned in response.
22
+ */
23
+ CreateNative: RichMediaService_CreateNative;
24
+ /**
25
+ * Update existing native Rich Media, replacing its content.
26
+ * Fails if the Rich Media is not of the NATIVE created type.
27
+ */
28
+ UpdateNative: RichMediaService_UpdateNative;
16
29
  Clone: RichMediaService_Clone;
17
30
  Delete: RichMediaService_Delete;
18
31
  Get: RichMediaService_Get;
@@ -46,10 +59,16 @@ export type RichMedia_CreatedType = 'UNDEFINED' | 'TEMPLATE' | 'BUILDER'
46
59
  * Built with the AI (smart-blocks) builder; `editor_json` carries the
47
60
  * AiBuilderDocument JSON instead of an Unlayer design.
48
61
  */
49
- | 'SMARTCARDS';
62
+ | 'SMARTCARDS'
63
+ /** Rendered natively by the SDK from native-config.json (no HTML). */
64
+ | 'NATIVE';
50
65
  export type RichMedia = {
51
66
  code: string;
52
67
  name: string;
68
+ /**
69
+ * For NATIVE created type — the JSON from native-config.json;
70
+ * for all other created types — the HTML from index.html.
71
+ */
53
72
  content: string;
54
73
  params: string;
55
74
  baseUrl: string;
@@ -230,6 +249,36 @@ export type CreateResponse = {
230
249
  code: string;
231
250
  isBlockBased: boolean;
232
251
  };
252
+ export type CreateNativeRequest = {
253
+ /** Name of Rich Media. */
254
+ name?: string;
255
+ /** Content of native-config.json: json object with displayName and the matching display block. */
256
+ content?: string;
257
+ /** Json object of localizations keyed by language code, e.g. {"en": {...}}. */
258
+ localization?: string;
259
+ /** Default language. Must be present in localization. */
260
+ defaultLanguage?: string;
261
+ };
262
+ export type CreateNativeResponse = {
263
+ /** Code of the created Rich Media. */
264
+ code: string;
265
+ };
266
+ export type UpdateNativeRequest = {
267
+ /** Code of the Rich Media to update. Must be of NATIVE created type. */
268
+ code?: string;
269
+ /** Name of Rich Media. */
270
+ name?: string;
271
+ /** Content of native-config.json: json object with displayName and the matching display block. */
272
+ content?: string;
273
+ /** Json object of localizations keyed by language code, e.g. {"en": {...}}. */
274
+ localization?: string;
275
+ /** Default language. Must be present in localization. */
276
+ defaultLanguage?: string;
277
+ };
278
+ export type UpdateNativeResponse = {
279
+ /** Code of the updated Rich Media. */
280
+ code: string;
281
+ };
233
282
  export type CloneRequest = {
234
283
  code?: string;
235
284
  name?: string;