@pushwoosh/rpc-v2-http-api-data 0.2.36 → 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",
@@ -22896,7 +22908,9 @@ export const data = {
22896
22908
  "values": [
22897
22909
  "UNDEFINED",
22898
22910
  "TEMPLATE",
22899
- "BUILDER"
22911
+ "BUILDER",
22912
+ "SMARTCARDS",
22913
+ "NATIVE"
22900
22914
  ]
22901
22915
  },
22902
22916
  "pushwoosh.rpc_v2.rich_medias.RichMedia": {
@@ -23444,6 +23458,59 @@ export const data = {
23444
23458
  }
23445
23459
  }
23446
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
+ },
23447
23514
  "pushwoosh.rpc_v2.rich_medias.CloneRequest": {
23448
23515
  "type": "I",
23449
23516
  "fields": {
@@ -23516,6 +23583,9 @@ export const data = {
23516
23583
  "closeButtonType": {
23517
23584
  "type": "boolean",
23518
23585
  "optional": true
23586
+ },
23587
+ "createdType": {
23588
+ "type": "pushwoosh.rpc_v2.rich_medias.RichMedia.CreatedType"
23519
23589
  }
23520
23590
  }
23521
23591
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.36",
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;
@@ -41,10 +54,21 @@ export type Metrics = {
41
54
  uniqueShown: number;
42
55
  uniqueInteraction: number;
43
56
  };
44
- export type RichMedia_CreatedType = 'UNDEFINED' | 'TEMPLATE' | 'BUILDER';
57
+ export type RichMedia_CreatedType = 'UNDEFINED' | 'TEMPLATE' | 'BUILDER'
58
+ /**
59
+ * Built with the AI (smart-blocks) builder; `editor_json` carries the
60
+ * AiBuilderDocument JSON instead of an Unlayer design.
61
+ */
62
+ | 'SMARTCARDS'
63
+ /** Rendered natively by the SDK from native-config.json (no HTML). */
64
+ | 'NATIVE';
45
65
  export type RichMedia = {
46
66
  code: string;
47
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
+ */
48
72
  content: string;
49
73
  params: string;
50
74
  baseUrl: string;
@@ -225,6 +249,36 @@ export type CreateResponse = {
225
249
  code: string;
226
250
  isBlockBased: boolean;
227
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
+ };
228
282
  export type CloneRequest = {
229
283
  code?: string;
230
284
  name?: string;
@@ -250,6 +304,7 @@ export type GetBlockTemplateResponse = {
250
304
  inputGroups: string;
251
305
  editorJson: string;
252
306
  closeButtonType?: boolean;
307
+ createdType: RichMedia_CreatedType;
253
308
  };
254
309
  export type SaveBlockTemplateRequest = {
255
310
  code?: string;