@pushwoosh/rpc-gateway-messaging 0.6.219 → 0.6.220

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/commonTypes.d.ts CHANGED
@@ -1,10 +1,22 @@
1
1
  export type Duration = number;
2
- export type RpcMethod<Req, Res> = ((request: Req) => Promise<Res>) & {
3
- safe(request: Req): Promise<[{
2
+ /** Arbitrary JSON value (google.protobuf.Value). */
3
+ export type JsonValue = string | number | boolean | null | JsonValue[] | {
4
+ [key: string]: JsonValue;
5
+ };
6
+ /** Arbitrary JSON object (google.protobuf.Struct). */
7
+ export type JsonObject = {
8
+ [key: string]: JsonValue;
9
+ };
10
+ /** Per-call options accepted by every method. */
11
+ export type RpcCallOptions = {
12
+ signal?: AbortSignal;
13
+ };
14
+ export type RpcMethod<Req, Res> = ((request: Req, options?: RpcCallOptions) => Promise<Res>) & {
15
+ safe(request: Req, options?: RpcCallOptions): Promise<[{
4
16
  error: unknown;
5
17
  }, null] | [null, Res]>;
6
18
  };
7
- export type RpcMethodV3<Req, Res, Err> = ((request: Req) => Promise<Res>) & {
8
- safe(request: Req): Promise<[Err, null] | [null, Res]>;
19
+ export type RpcMethodV3<Req, Res, Err> = ((request: Req, options?: RpcCallOptions) => Promise<Res>) & {
20
+ safe(request: Req, options?: RpcCallOptions): Promise<[Err, null] | [null, Res]>;
9
21
  parseError(e: unknown): Err;
10
22
  };
package/data.js CHANGED
@@ -313,7 +313,7 @@ export const data = {
313
313
  "type": "pushwoosh.channels.messagingApi.v2.SendRate"
314
314
  },
315
315
  "metaData": {
316
- "type": "object"
316
+ "type": "JsonObject"
317
317
  },
318
318
  "dynamicContentPlaceholders": {
319
319
  "type": "string",
@@ -338,7 +338,7 @@ export const data = {
338
338
  "type": "pushwoosh.channels.messagingApi.v2.MessageTypeSource"
339
339
  },
340
340
  "contentPlaceholders": {
341
- "type": "object"
341
+ "type": "JsonObject"
342
342
  },
343
343
  "resend": {
344
344
  "type": "pushwoosh.channels.messagingApi.v2.Resend"
@@ -463,7 +463,7 @@ export const data = {
463
463
  "type": "pushwoosh.channels.messagingApi.v2.SendRate"
464
464
  },
465
465
  "metaData": {
466
- "type": "object"
466
+ "type": "JsonObject"
467
467
  },
468
468
  "dynamicContentPlaceholders": {
469
469
  "type": "string",
@@ -491,7 +491,7 @@ export const data = {
491
491
  "type": "pushwoosh.channels.messagingApi.v2.MessageTypeSource"
492
492
  },
493
493
  "contentPlaceholders": {
494
- "type": "object"
494
+ "type": "JsonObject"
495
495
  },
496
496
  "resend": {
497
497
  "type": "pushwoosh.channels.messagingApi.v2.Resend"
@@ -671,7 +671,7 @@ export const data = {
671
671
  "type": "number"
672
672
  },
673
673
  "contentState": {
674
- "type": "object"
674
+ "type": "JsonObject"
675
675
  },
676
676
  "staleDate": {
677
677
  "type": "number"
@@ -683,7 +683,7 @@ export const data = {
683
683
  "type": "string"
684
684
  },
685
685
  "attributes": {
686
- "type": "object"
686
+ "type": "JsonObject"
687
687
  },
688
688
  "start": {
689
689
  "type": "number"
@@ -765,7 +765,7 @@ export const data = {
765
765
  "array": true
766
766
  },
767
767
  "extras": {
768
- "type": "object"
768
+ "type": "JsonObject"
769
769
  },
770
770
  "when": {
771
771
  "type": "number"
@@ -972,7 +972,7 @@ export const data = {
972
972
  "type": "string"
973
973
  },
974
974
  "rootParams": {
975
- "type": "object"
975
+ "type": "JsonObject"
976
976
  },
977
977
  "liveActivity": {
978
978
  "type": "pushwoosh.channels.messagingApi.v2.LiveActivity"
@@ -1040,7 +1040,7 @@ export const data = {
1040
1040
  "type": "boolean"
1041
1041
  },
1042
1042
  "rootParams": {
1043
- "type": "object"
1043
+ "type": "JsonObject"
1044
1044
  },
1045
1045
  "customIcon": {
1046
1046
  "type": "string"
@@ -1084,7 +1084,7 @@ export const data = {
1084
1084
  "type": "string"
1085
1085
  },
1086
1086
  "rootParams": {
1087
- "type": "object"
1087
+ "type": "JsonObject"
1088
1088
  },
1089
1089
  "duration": {
1090
1090
  "type": "Duration"
@@ -1119,7 +1119,7 @@ export const data = {
1119
1119
  "type": "string"
1120
1120
  },
1121
1121
  "rootParams": {
1122
- "type": "object"
1122
+ "type": "JsonObject"
1123
1123
  },
1124
1124
  "inbox": {
1125
1125
  "type": "pushwoosh.channels.messagingApi.v2.Inbox"
@@ -1175,7 +1175,7 @@ export const data = {
1175
1175
  "type": "string"
1176
1176
  },
1177
1177
  "rootParams": {
1178
- "type": "object"
1178
+ "type": "JsonObject"
1179
1179
  },
1180
1180
  "inbox": {
1181
1181
  "type": "pushwoosh.channels.messagingApi.v2.Inbox"
@@ -1207,7 +1207,7 @@ export const data = {
1207
1207
  "type": "boolean"
1208
1208
  },
1209
1209
  "rootParams": {
1210
- "type": "object"
1210
+ "type": "JsonObject"
1211
1211
  },
1212
1212
  "icon": {
1213
1213
  "type": "string"
@@ -1266,7 +1266,7 @@ export const data = {
1266
1266
  "type": "boolean"
1267
1267
  },
1268
1268
  "rootParams": {
1269
- "type": "object"
1269
+ "type": "JsonObject"
1270
1270
  },
1271
1271
  "customIcon": {
1272
1272
  "type": "string"
@@ -1328,7 +1328,7 @@ export const data = {
1328
1328
  "type": "boolean"
1329
1329
  },
1330
1330
  "rootParams": {
1331
- "type": "object"
1331
+ "type": "JsonObject"
1332
1332
  },
1333
1333
  "customIcon": {
1334
1334
  "type": "string"
@@ -1458,7 +1458,7 @@ export const data = {
1458
1458
  "type": "pushwoosh.channels.messagingApi.v2.OpenAction"
1459
1459
  },
1460
1460
  "customData": {
1461
- "type": "object"
1461
+ "type": "JsonObject"
1462
1462
  },
1463
1463
  "layoutType": {
1464
1464
  "type": "string"
@@ -1748,7 +1748,7 @@ export const data = {
1748
1748
  "type": "boolean"
1749
1749
  },
1750
1750
  "customData": {
1751
- "type": "object"
1751
+ "type": "JsonObject"
1752
1752
  },
1753
1753
  "openAction": {
1754
1754
  "type": "pushwoosh.channels.messagingApi.v2.OpenAction"
@@ -1894,7 +1894,7 @@ export const data = {
1894
1894
  "type": "pushwoosh.channels.messagingApi.v2.RichMedia"
1895
1895
  },
1896
1896
  "customData": {
1897
- "type": "object"
1897
+ "type": "JsonObject"
1898
1898
  },
1899
1899
  "timeToLive": {
1900
1900
  "type": "Duration"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-messaging",
3
- "version": "0.6.219",
3
+ "version": "0.6.220",
4
4
  "description": "Channels Messaging API gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,4 +1,4 @@
1
- import { RpcMethod, Duration } from './commonTypes';
1
+ import { RpcMethod, JsonObject, Duration } from './commonTypes';
2
2
  import { FilterExpression as pushwoosh_objects_filters_v1_FilterExpression } from './pushwoosh_objects_filters_v1';
3
3
  export type MessagingService_Notify = RpcMethod<NotifyRequest, NotifyResponse>;
4
4
  export type MessagingService_NotifyBatch = RpcMethod<NotifyBatchRequest, NotifyBatchResponse>;
@@ -239,7 +239,7 @@ export type NotifySegment = {
239
239
  /** Throttling for this message. */
240
240
  sendRate: SendRate;
241
241
  /** Free-form JSON stored with the message and echoed in tracking-log events. */
242
- metaData: object;
242
+ metaData: JsonObject;
243
243
  /** Placeholder name to the value substituted into the message content. */
244
244
  dynamicContentPlaceholders: Record<string, string>;
245
245
  /**
@@ -267,7 +267,7 @@ export type NotifySegment = {
267
267
  /** Internal: where message_type came from, e.g. a journey default baked at publish; ignored for external requests. */
268
268
  messageTypeSource: MessageTypeSource;
269
269
  /** Placeholder name to the value substituted into the message content; wins over dynamic_content_placeholders on the same key. */
270
- contentPlaceholders: object;
270
+ contentPlaceholders: JsonObject;
271
271
  resend: Resend;
272
272
  geoZone: GeoZone;
273
273
  /** Application silent hours for this message. */
@@ -346,7 +346,7 @@ export type NotifyTransactional = {
346
346
  /** Throttling for this message. */
347
347
  sendRate: SendRate;
348
348
  /** Free-form JSON stored with the message and echoed in tracking-log events. */
349
- metaData: object;
349
+ metaData: JsonObject;
350
350
  /** Placeholder name to the value substituted into the message content. */
351
351
  dynamicContentPlaceholders: Record<string, string>;
352
352
  /**
@@ -381,7 +381,7 @@ export type NotifyTransactional = {
381
381
  /** Internal: where message_type came from, e.g. a journey default baked at publish; ignored for external requests. */
382
382
  messageTypeSource: MessageTypeSource;
383
383
  /** Placeholder name to the value substituted into the message content; wins over dynamic_content_placeholders on the same key. */
384
- contentPlaceholders: object;
384
+ contentPlaceholders: JsonObject;
385
385
  resend: Resend;
386
386
  /** Application silent hours for this message. */
387
387
  silentHours: SilentHoursOptions;
@@ -479,7 +479,7 @@ export type LiveActivity = {
479
479
  /** Unix time after which an ended activity is dismissed. */
480
480
  dismissalDate: number;
481
481
  /** Dynamic ContentState of the activity. */
482
- contentState: object;
482
+ contentState: JsonObject;
483
483
  /** Unix time after which the shown content counts as stale. */
484
484
  staleDate: number;
485
485
  /** Ordering hint when several activities compete for the same slot. */
@@ -487,7 +487,7 @@ export type LiveActivity = {
487
487
  /** Name of the ActivityAttributes type; required to start an activity. */
488
488
  attributesType: string;
489
489
  /** Static attributes passed when the activity starts. */
490
- attributes: object;
490
+ attributes: JsonObject;
491
491
  /** Unix time the activity starts. */
492
492
  start: number;
493
493
  };
@@ -542,7 +542,7 @@ export type LiveUpdate = {
542
542
  /** Colored segments the progress bar is split into. */
543
543
  segments: LiveUpdate_Segment[];
544
544
  /** Free-form data passed to the app with the update. */
545
- extras: object;
545
+ extras: JsonObject;
546
546
  /** Unix time the update refers to. */
547
547
  when: number;
548
548
  /** Render `when` as a running timer. */
@@ -651,7 +651,7 @@ export type Content_PlatformPropertiesIos = {
651
651
  /** iOS interruption level: passive, active, time-sensitive or critical. */
652
652
  interruptionLevel: string;
653
653
  /** Raw platform payload overrides merged into the outgoing push. */
654
- rootParams: object;
654
+ rootParams: JsonObject;
655
655
  /** Live Activity payload. */
656
656
  liveActivity: LiveActivity;
657
657
  /** APNs collapse identifier: a newer notification replaces one with the same id. */
@@ -697,7 +697,7 @@ export type Content_PlatformPropertiesAndroid = {
697
697
  /** Show the notification on the lock screen. */
698
698
  showOnLockscreen: boolean;
699
699
  /** Raw platform payload overrides merged into the outgoing push. */
700
- rootParams: object;
700
+ rootParams: JsonObject;
701
701
  /** URL of a large custom icon. */
702
702
  customIcon: string;
703
703
  /** In-tray notification priority. */
@@ -724,7 +724,7 @@ export type Content_PlatformPropertiesChrome = {
724
724
  /** Large image URL. */
725
725
  image: string;
726
726
  /** Raw platform payload overrides merged into the outgoing push. */
727
- rootParams: object;
727
+ rootParams: JsonObject;
728
728
  /** Auto-close timer for the notification. */
729
729
  duration: Duration;
730
730
  /** Label of the first action button. */
@@ -746,7 +746,7 @@ export type Content_PlatformPropertiesFirefox = {
746
746
  /** Notification small icon. */
747
747
  icon: string;
748
748
  /** Raw platform payload overrides merged into the outgoing push. */
749
- rootParams: object;
749
+ rootParams: JsonObject;
750
750
  /** Message Inbox entry created for this notification. */
751
751
  inbox: Inbox;
752
752
  };
@@ -780,7 +780,7 @@ export type Content_PlatformPropertiesMacOS = {
780
780
  /** Badge value: absolute ("5") or relative ("+1"). */
781
781
  badges: string;
782
782
  /** Raw platform payload overrides merged into the outgoing push. */
783
- rootParams: object;
783
+ rootParams: JsonObject;
784
784
  /** Message Inbox entry created for this notification. */
785
785
  inbox: Inbox;
786
786
  /** Notification subtitle. */
@@ -800,7 +800,7 @@ export type Content_PlatformPropertiesAmazon = {
800
800
  /** Enables or suppresses the notification sound. */
801
801
  soundEnabled: boolean;
802
802
  /** Raw platform payload overrides merged into the outgoing push. */
803
- rootParams: object;
803
+ rootParams: JsonObject;
804
804
  /** Notification small icon. */
805
805
  icon: string;
806
806
  /** URL of a large custom icon. */
@@ -838,7 +838,7 @@ export type Content_PlatformPropertiesBaiduAndroid = {
838
838
  /** Show the notification on the lock screen. */
839
839
  showOnLockscreen: boolean;
840
840
  /** Raw platform payload overrides merged into the outgoing push. */
841
- rootParams: object;
841
+ rootParams: JsonObject;
842
842
  /** URL of a large custom icon. */
843
843
  customIcon: string;
844
844
  /** In-tray notification priority. */
@@ -877,7 +877,7 @@ export type Content_PlatformPropertiesHuaweiAndroid = {
877
877
  /** Show the notification on the lock screen. */
878
878
  showOnLockscreen: boolean;
879
879
  /** Raw platform payload overrides merged into the outgoing push. */
880
- rootParams: object;
880
+ rootParams: JsonObject;
881
881
  /** URL of a large custom icon. */
882
882
  customIcon: string;
883
883
  /** In-tray notification priority. */
@@ -949,7 +949,7 @@ export type Content_PlatformPropertiesAppInbox = {
949
949
  /** Action performed when the user taps the entry. */
950
950
  openAction: OpenAction;
951
951
  /** Free-form JSON delivered to the SDK with the entry. */
952
- customData: object;
952
+ customData: JsonObject;
953
953
  /** Inbox cell layout: classic (default when empty), captioned, banner or carousel. */
954
954
  layoutType: string;
955
955
  /** Slides of the carousel layout. */
@@ -1173,7 +1173,7 @@ export type Payload = {
1173
1173
  */
1174
1174
  preset: string;
1175
1175
  /** Free-form JSON delivered to the SDK as the `u` parameter. */
1176
- customData: object;
1176
+ customData: JsonObject;
1177
1177
  /** Action performed when the user opens the notification. */
1178
1178
  openAction: OpenAction;
1179
1179
  /** Per-platform override of open_action, keyed by the numeric platform code. */
@@ -1266,7 +1266,7 @@ export type InAppPayload = {
1266
1266
  /** Rich media page to show: a code or a remote page URL. Required. */
1267
1267
  richMedia: RichMedia;
1268
1268
  /** Free-form JSON delivered to the SDK as the `u` parameter. */
1269
- customData: object;
1269
+ customData: JsonObject;
1270
1270
  /** How long the push service keeps the message for an offline device on iOS, Android and Huawei. */
1271
1271
  timeToLive: Duration;
1272
1272
  };