@onesignal/node-onesignal 5.7.0 → 5.9.0

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.
Files changed (92) hide show
  1. package/README.md +9 -0
  2. package/dist/apis/DefaultApi.js +2282 -4372
  3. package/dist/apis/baseapi.js +11 -30
  4. package/dist/apis/exception.d.ts +1 -0
  5. package/dist/apis/exception.js +52 -26
  6. package/dist/auth/auth.js +17 -83
  7. package/dist/configuration.js +9 -9
  8. package/dist/errors.d.ts +8 -0
  9. package/dist/errors.js +11 -0
  10. package/dist/helpers.d.ts +12 -0
  11. package/dist/helpers.js +79 -0
  12. package/dist/http/http.js +53 -132
  13. package/dist/http/isomorphic-fetch.js +15 -18
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +2 -0
  16. package/dist/middleware.js +8 -9
  17. package/dist/models/ApiKeyToken.js +45 -46
  18. package/dist/models/ApiKeyTokensListResponse.js +15 -16
  19. package/dist/models/App.js +213 -214
  20. package/dist/models/BasicNotification.js +711 -712
  21. package/dist/models/BasicNotificationAllOf.js +627 -628
  22. package/dist/models/BasicNotificationAllOfAndroidBackgroundLayout.js +27 -28
  23. package/dist/models/Button.js +27 -28
  24. package/dist/models/CopyTemplateRequest.js +15 -16
  25. package/dist/models/CreateApiKeyRequest.js +27 -28
  26. package/dist/models/CreateApiKeyResponse.js +21 -22
  27. package/dist/models/CreateNotificationSuccessResponse.js +27 -28
  28. package/dist/models/CreateSegmentConflictResponse.js +21 -22
  29. package/dist/models/CreateSegmentSuccessResponse.js +21 -22
  30. package/dist/models/CreateTemplateRequest.js +75 -76
  31. package/dist/models/CreateUserConflictResponse.js +15 -16
  32. package/dist/models/CreateUserConflictResponseErrorsInner.js +27 -28
  33. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js +15 -16
  34. package/dist/models/CustomEvent.js +39 -40
  35. package/dist/models/CustomEventsRequest.js +15 -16
  36. package/dist/models/DeliveryData.js +39 -40
  37. package/dist/models/ExportEventsSuccessResponse.js +15 -16
  38. package/dist/models/ExportSubscriptionsRequestBody.js +27 -28
  39. package/dist/models/ExportSubscriptionsSuccessResponse.js +15 -16
  40. package/dist/models/Filter.js +57 -58
  41. package/dist/models/FilterExpression.js +63 -64
  42. package/dist/models/GenericError.js +27 -28
  43. package/dist/models/GenericSuccessBoolResponse.js +15 -16
  44. package/dist/models/GetNotificationHistoryRequestBody.js +27 -28
  45. package/dist/models/GetSegmentsSuccessResponse.js +33 -34
  46. package/dist/models/LanguageStringMap.js +267 -268
  47. package/dist/models/Notification.js +717 -718
  48. package/dist/models/NotificationAllOf.js +15 -16
  49. package/dist/models/NotificationHistorySuccessResponse.js +21 -22
  50. package/dist/models/NotificationSlice.js +33 -34
  51. package/dist/models/NotificationTarget.js +93 -94
  52. package/dist/models/NotificationWithMeta.js +789 -790
  53. package/dist/models/NotificationWithMetaAllOf.js +93 -94
  54. package/dist/models/ObjectSerializer.js +111 -115
  55. package/dist/models/Operator.js +15 -16
  56. package/dist/models/OutcomeData.js +27 -28
  57. package/dist/models/OutcomesData.js +15 -16
  58. package/dist/models/PlatformDeliveryData.js +57 -58
  59. package/dist/models/PlatformDeliveryDataEmailAllOf.js +51 -52
  60. package/dist/models/PlatformDeliveryDataSmsAllOf.js +27 -28
  61. package/dist/models/PropertiesBody.js +15 -16
  62. package/dist/models/PropertiesDeltas.js +27 -28
  63. package/dist/models/PropertiesObject.js +75 -76
  64. package/dist/models/Purchase.js +33 -34
  65. package/dist/models/RateLimitError.js +21 -22
  66. package/dist/models/Segment.js +27 -28
  67. package/dist/models/SegmentData.js +51 -52
  68. package/dist/models/SegmentNotificationTarget.js +21 -22
  69. package/dist/models/StartLiveActivityRequest.js +105 -106
  70. package/dist/models/StartLiveActivitySuccessResponse.js +15 -16
  71. package/dist/models/Subscription.js +111 -112
  72. package/dist/models/SubscriptionBody.js +15 -16
  73. package/dist/models/SubscriptionNotificationTarget.js +81 -82
  74. package/dist/models/TemplateResource.js +45 -46
  75. package/dist/models/TemplatesListResponse.js +15 -16
  76. package/dist/models/TransferSubscriptionRequestBody.js +15 -16
  77. package/dist/models/UpdateApiKeyRequest.js +27 -28
  78. package/dist/models/UpdateLiveActivityRequest.js +63 -64
  79. package/dist/models/UpdateLiveActivitySuccessResponse.js +15 -16
  80. package/dist/models/UpdateTemplateRequest.js +69 -70
  81. package/dist/models/UpdateUserRequest.js +27 -28
  82. package/dist/models/User.js +27 -28
  83. package/dist/models/UserIdentityBody.js +15 -16
  84. package/dist/models/WebButton.js +33 -34
  85. package/dist/rxjsStub.js +8 -9
  86. package/dist/servers.js +14 -15
  87. package/dist/types/ObjectParamAPI.js +92 -94
  88. package/dist/types/ObservableAPI.js +534 -931
  89. package/dist/types/PromiseAPI.d.ts +4 -0
  90. package/dist/types/PromiseAPI.js +141 -137
  91. package/dist/util.js +2 -2
  92. package/package.json +4 -2
package/README.md CHANGED
@@ -62,6 +62,15 @@ const response = await client.createNotification(notification);
62
62
  console.log('Notification ID:', response.id);
63
63
  ```
64
64
 
65
+ ## Send with idempotent retries
66
+
67
+ `createNotificationWithRetry` generates a UUIDv4 `idempotency_key` when absent (a caller-provided key is respected), retries 429 / 503 / transport errors with the **same** key (honoring `Retry-After`, exponential backoff otherwise; `maxRetries` / `baseDelayMs` configurable via the options object), fails fast on other errors, and reports via `wasReplayed` whether the server answered from a previously completed request (`Idempotent-Replayed` response header). It is a `DefaultApi` method, so the call mirrors `createNotification`:
68
+
69
+ ```javascript
70
+ const result = await client.createNotificationWithRetry(notification);
71
+ console.log('Notification ID:', result.response.id, 'replayed:', result.wasReplayed);
72
+ ```
73
+
65
74
  ## Send a push notification by External ID
66
75
 
67
76
  Target specific users with the alias label `external_id` (snake_case). This is different from the notification-level `external_id` field, which is only for [idempotent requests](https://documentation.onesignal.com/docs/idempotent-notification-requests).