From 11e06e648b3859e3d25a6140ea3ff088a1037d01 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Wed, 17 Jun 2026 22:47:30 +0000 Subject: [PATCH] feat: add v5.8.0 package updates --- DefaultApi.md | 278 ++++++++++++------ README.md | 9 + apis/exception.ts | 54 ++++ dist/apis/exception.d.ts | 1 + dist/apis/exception.js | 43 +++ dist/apis/exception.js.map | 2 +- dist/index.d.ts | 2 + dist/index.js | 2 + dist/index.js.map | 2 +- dist/types/PromiseAPI.d.ts | 4 + dist/types/PromiseAPI.js | 5 + dist/types/PromiseAPI.js.map | 2 +- errors.ts | 25 ++ helpers.ts | 128 ++++++++ index.ts | 2 + models/ApiKeyToken.ts | 2 +- models/ApiKeyTokensListResponse.ts | 2 +- models/App.ts | 2 +- models/BasicNotification.ts | 2 +- models/BasicNotificationAllOf.ts | 2 +- ...otificationAllOfAndroidBackgroundLayout.ts | 2 +- models/Button.ts | 2 +- models/CopyTemplateRequest.ts | 2 +- models/CreateApiKeyRequest.ts | 2 +- models/CreateApiKeyResponse.ts | 2 +- models/CreateNotificationSuccessResponse.ts | 2 +- models/CreateSegmentConflictResponse.ts | 2 +- models/CreateSegmentSuccessResponse.ts | 2 +- models/CreateTemplateRequest.ts | 2 +- models/CreateUserConflictResponse.ts | 2 +- .../CreateUserConflictResponseErrorsInner.ts | 2 +- ...eateUserConflictResponseErrorsItemsMeta.ts | 2 +- models/CustomEvent.ts | 2 +- models/CustomEventsRequest.ts | 2 +- models/DeliveryData.ts | 2 +- models/ExportEventsSuccessResponse.ts | 2 +- models/ExportSubscriptionsRequestBody.ts | 2 +- models/ExportSubscriptionsSuccessResponse.ts | 2 +- models/Filter.ts | 2 +- models/FilterExpression.ts | 2 +- models/GenericError.ts | 2 +- models/GenericSuccessBoolResponse.ts | 2 +- models/GetNotificationHistoryRequestBody.ts | 2 +- models/GetSegmentsSuccessResponse.ts | 2 +- models/LanguageStringMap.ts | 2 +- models/Notification.ts | 2 +- models/NotificationAllOf.ts | 2 +- models/NotificationHistorySuccessResponse.ts | 2 +- models/NotificationSlice.ts | 2 +- models/NotificationTarget.ts | 2 +- models/NotificationWithMeta.ts | 2 +- models/NotificationWithMetaAllOf.ts | 2 +- models/Operator.ts | 2 +- models/OutcomeData.ts | 2 +- models/OutcomesData.ts | 2 +- models/PlatformDeliveryData.ts | 2 +- models/PlatformDeliveryDataEmailAllOf.ts | 2 +- models/PlatformDeliveryDataSmsAllOf.ts | 2 +- models/PropertiesBody.ts | 2 +- models/PropertiesDeltas.ts | 2 +- models/PropertiesObject.ts | 2 +- models/Purchase.ts | 2 +- models/RateLimitError.ts | 2 +- models/Segment.ts | 2 +- models/SegmentData.ts | 2 +- models/SegmentNotificationTarget.ts | 2 +- models/StartLiveActivityRequest.ts | 2 +- models/StartLiveActivitySuccessResponse.ts | 2 +- models/Subscription.ts | 2 +- models/SubscriptionBody.ts | 2 +- models/SubscriptionNotificationTarget.ts | 2 +- models/TemplateResource.ts | 2 +- models/TemplatesListResponse.ts | 2 +- models/TransferSubscriptionRequestBody.ts | 2 +- models/UpdateApiKeyRequest.ts | 2 +- models/UpdateLiveActivityRequest.ts | 2 +- models/UpdateLiveActivitySuccessResponse.ts | 2 +- models/UpdateTemplateRequest.ts | 2 +- models/UpdateUserRequest.ts | 2 +- models/User.ts | 2 +- models/UserIdentityBody.ts | 2 +- models/WebButton.ts | 2 +- types/PromiseAPI.ts | 15 + yarn.lock | 10 +- 84 files changed, 554 insertions(+), 164 deletions(-) create mode 100644 errors.ts create mode 100644 helpers.ts diff --git a/DefaultApi.md b/DefaultApi.md index 02733d0..69d619b 100644 --- a/DefaultApi.md +++ b/DefaultApi.md @@ -62,9 +62,16 @@ Every operation requires either a **REST API Key** (App-scoped, used by ~77% of `POST /notifications` accepts a top-level `idempotency_key` (UUIDv4) that the server uses for request dedup within a **30-day window**. Pass a freshly-generated UUID per logical send so that network-level retries are safe. Never reuse a key across distinct sends — the server returns the original response instead of acting on the new payload. The hero `createNotification` example below demonstrates the call. +Prefer the bundled `createNotificationWithRetry` helper over wiring this up by hand: it generates the 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 available as a `DefaultApi` method so the call mirrors `createNotification`: + +```typescript +const result = await client.createNotificationWithRetry(notification); +console.log(result.response.id, result.wasReplayed); +``` + ### Error handling -When a request fails, the SDK rejects the returned Promise with an `Onesignal.ApiException`. Wrap each call in `try { ... } catch (e) { ... }` and narrow with `e instanceof Onesignal.ApiException`. The HTTP status code is `e.code` (number); the parsed error body is `e.body`. Most envelopes match `{ "errors": ["..."] }` (an array of strings) but a few endpoints return `{ "errors": [{"code": ..., "title": ..., "meta": {...}}] }` (an array of structured error objects — used by `POST /apps/{app_id}/users` 409 conflict, see `CreateUserConflictResponse`), `{ "errors": "..." }` (string), or `{ "success": false }` (no `errors` field at all). Robust error-handling code should tolerate all four shapes. +When a request fails, the SDK rejects the returned Promise with an `Onesignal.ApiException`. Wrap each call in `try { ... } catch (e) { ... }` and narrow with `e instanceof Onesignal.ApiException`. The HTTP status code is `e.code` (number); the parsed error body is `e.body`. Most envelopes match `{ "errors": ["..."] }` (an array of strings) but a few endpoints return `{ "errors": [{"code": ..., "title": ..., "meta": {...}}] }` (an array of structured error objects — used by `POST /apps/{app_id}/users` 409 conflict, see `CreateUserConflictResponse`), `{ "errors": "..." }` (string), or `{ "success": false }` (no `errors` field at all). Robust error-handling code should tolerate all four shapes. The `e.errorMessages` getter does this for you, normalizing every shape to a flat `string[]` (empty when the body carries no `errors`). To branch on a specific error without hard-coding message strings, test membership against the generated [`OneSignalErrors`](https://github.com/OneSignal/node-onesignal/blob/main/errors.ts) catalog — e.g. `e.errorMessages.includes(Onesignal.OneSignalErrors.NO_TARGETING_SPECIFIED)`. ### Polymorphic 200 from POST /notifications @@ -106,8 +113,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("cancelNotification failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("cancelNotification failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -179,8 +187,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("copyTemplateToApp failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("copyTemplateToApp failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -255,8 +264,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createAlias failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createAlias failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -333,8 +343,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createAliasBySubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createAliasBySubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -410,8 +421,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createApiKey failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createApiKey failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -497,8 +509,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createApp failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createApp failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -574,8 +587,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createCustomEvents failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createCustomEvents failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -662,8 +676,46 @@ try { } } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createNotification failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createNotification failed: HTTP " + e.code, e.errorMessages); + } else { + throw e; + } +} +``` + +#### Using `createNotificationWithRetry` (preferred for safe, idempotent retries) + +The `createNotificationWithRetry` method mirrors `createNotification` but generates the `idempotency_key` for you, transparently retries transient failures (HTTP 429 / 503 / transport errors) with the **same** key, and reports via `wasReplayed` whether the server answered from a previously-completed request. + +```typescript +import Onesignal from '@onesignal/node-onesignal'; + +const configuration = Onesignal.createConfiguration({ + restApiKey: '', +}); +const client = new Onesignal.DefaultApi(configuration); + +const notification = new Onesignal.Notification(); +notification.app_id = 'YOUR_APP_ID'; +notification.contents = { en: 'Hello from OneSignal!' }; +notification.include_aliases = { external_id: ['YOUR_USER_EXTERNAL_ID'] }; +notification.target_channel = 'push'; +// No idempotency_key set: the helper generates a UUIDv4 and reuses it across retries. +// Set your own (e.g. an order ID) to also dedup across process restarts. + +try { + // maxRetries / baseDelayMs are optional (defaults: 3 retries, 1000ms backoff base). + const result = await client.createNotificationWithRetry(notification, { maxRetries: 5, baseDelayMs: 500 }); + if (result.wasReplayed) { + console.log("Server replayed a prior send (no duplicate):", result.response.id); + } else { + console.log("Notification created:", result.response.id); + } +} catch (e) { + if (e instanceof Onesignal.ApiException) { + console.error("createNotificationWithRetry failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -735,8 +787,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createSegment failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createSegment failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -828,8 +881,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createSubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createSubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1045,8 +1099,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createTemplate failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createTemplate failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1157,8 +1212,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("createUser failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("createUser failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1166,6 +1222,18 @@ try { ``` +### Reading the 409 conflict metadata + +A `409` from this endpoint deserializes to a typed `Onesignal.CreateUserConflictResponse` on `e.body`. The `e.errorMessages` getter flattens each error to its `title`/`code` and omits the structured `meta` object (currently `conflicting_aliases`); read it from the typed body: + +```typescript +if (e instanceof Onesignal.ApiException && e.code === 409) { + const conflict = e.body as Onesignal.CreateUserConflictResponse; + conflict.errors?.forEach((err) => + console.log(err.title, err.meta?.conflicting_aliases)); +} +``` + ### Parameters Name | Type | Description | Notes @@ -1232,8 +1300,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteAlias failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteAlias failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1304,8 +1373,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteApiKey failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteApiKey failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1371,8 +1441,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteSegment failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteSegment failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1440,8 +1511,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteSubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteSubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1510,8 +1582,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteTemplate failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteTemplate failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1580,8 +1653,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("deleteUser failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("deleteUser failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1650,8 +1724,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("exportEvents failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("exportEvents failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1725,8 +1800,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("exportSubscriptions failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("exportSubscriptions failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1795,8 +1871,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getAliases failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getAliases failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1865,8 +1942,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getAliasesBySubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getAliasesBySubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1931,8 +2009,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getApp failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getApp failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -1991,8 +2070,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getApps failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getApps failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2055,8 +2135,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getNotification failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getNotification failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2128,8 +2209,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getNotificationHistory failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getNotificationHistory failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2201,8 +2283,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getNotifications failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getNotifications failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2279,8 +2362,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getOutcomes failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getOutcomes failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2353,8 +2437,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getSegments failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getSegments failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2424,8 +2509,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("getUser failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("getUser failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2494,8 +2580,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("rotateApiKey failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("rotateApiKey failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2680,8 +2767,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("startLiveActivity failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("startLiveActivity failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2755,8 +2843,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("transferSubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("transferSubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2828,8 +2917,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("unsubscribeEmailWithToken failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("unsubscribeEmailWithToken failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2905,8 +2995,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateApiKey failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateApiKey failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -2995,8 +3086,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateApp failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateApp failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3163,8 +3255,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateLiveActivity failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateLiveActivity failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3254,8 +3347,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateSubscription failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateSubscription failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3349,8 +3443,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateSubscriptionByToken failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateSubscriptionByToken failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3566,8 +3661,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateTemplate failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateTemplate failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3672,8 +3768,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("updateUser failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("updateUser failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3741,8 +3838,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("viewApiKeys failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("viewApiKeys failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3807,8 +3905,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("viewTemplate failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("viewTemplate failed: HTTP " + e.code, e.errorMessages); } else { throw e; } @@ -3879,8 +3978,9 @@ try { console.log(response); } catch (e) { if (e instanceof Onesignal.ApiException) { - // `e.body` is the parsed error response (typically `{ errors: string[] }`). - console.error("viewTemplates failed: HTTP " + e.code, e.body); + // `e.errorMessages` flattens any error-envelope shape to a `string[]`; + // the raw parsed body remains on `e.body`. + console.error("viewTemplates failed: HTTP " + e.code, e.errorMessages); } else { throw e; } diff --git a/README.md b/README.md index 079f834..1ea7166 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,15 @@ const response = await client.createNotification(notification); console.log('Notification ID:', response.id); ``` +## Send with idempotent retries + +`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`: + +```javascript +const result = await client.createNotificationWithRetry(notification); +console.log('Notification ID:', result.response.id, 'replayed:', result.wasReplayed); +``` + ## Send a push notification by External ID 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). diff --git a/apis/exception.ts b/apis/exception.ts index d538883..e5d8241 100644 --- a/apis/exception.ts +++ b/apis/exception.ts @@ -21,4 +21,58 @@ export class ApiException extends Error { // Reference: https://github.com/microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work Object.setPrototypeOf(this, ApiException.prototype); } + + /** + * The error messages carried by the response body, normalized to a flat + * string array regardless of which envelope shape the API returned + * (`{ errors: "..." }`, `{ errors: ["..."] }`, `{ errors: [{ code, title }] }`, + * or an object map such as `{ errors: { invalid_aliases: {...} } }`, which is + * surfaced as `": "` entries). Returns an empty array when the + * body is not a recognizable error envelope. The raw body remains on `body`. + */ + public get errorMessages(): string[] { + let parsed: any = this.body; + if (typeof parsed === "string") { + try { + parsed = JSON.parse(parsed); + } catch { + return []; + } + } + if (parsed === null || typeof parsed !== "object") { + return []; + } + const errors: any = parsed.errors; + if (typeof errors === "string") { + return [errors]; + } + if (Array.isArray(errors)) { + return errors + .map((e: any) => { + if (typeof e === "string") { + return e; + } + if (e !== null && typeof e === "object") { + const title = typeof e.title === "string" ? e.title : undefined; + const code = typeof e.code === "string" ? e.code : (e.code != null ? String(e.code) : undefined); + return title || code; + } + return undefined; + }) + .filter((m: any): m is string => typeof m === "string"); + } + if (errors !== null && typeof errors === "object") { + // Object-shaped envelopes (e.g. { invalid_aliases: {...} }) carry data + // under arbitrary keys; surface each so it isn't silently dropped. Key + // order is unspecified, so sort for deterministic output. + return Object.keys(errors) + .map((key: string) => { + const value: any = errors[key]; + const rendered = typeof value === "string" ? value : JSON.stringify(value); + return key + ": " + rendered; + }) + .sort(); + } + return []; + } } diff --git a/dist/apis/exception.d.ts b/dist/apis/exception.d.ts index bfcc642..074d3ad 100644 --- a/dist/apis/exception.d.ts +++ b/dist/apis/exception.d.ts @@ -7,4 +7,5 @@ export declare class ApiException extends Error { constructor(code: number, message: string, body: T, headers: { [key: string]: string; }); + get errorMessages(): string[]; } diff --git a/dist/apis/exception.js b/dist/apis/exception.js index 47a7555..71c1265 100644 --- a/dist/apis/exception.js +++ b/dist/apis/exception.js @@ -10,6 +10,49 @@ class ApiException extends Error { this.headers = headers; Object.setPrototypeOf(this, ApiException.prototype); } + get errorMessages() { + let parsed = this.body; + if (typeof parsed === "string") { + try { + parsed = JSON.parse(parsed); + } + catch { + return []; + } + } + if (parsed === null || typeof parsed !== "object") { + return []; + } + const errors = parsed.errors; + if (typeof errors === "string") { + return [errors]; + } + if (Array.isArray(errors)) { + return errors + .map((e) => { + if (typeof e === "string") { + return e; + } + if (e !== null && typeof e === "object") { + const title = typeof e.title === "string" ? e.title : undefined; + const code = typeof e.code === "string" ? e.code : (e.code != null ? String(e.code) : undefined); + return title || code; + } + return undefined; + }) + .filter((m) => typeof m === "string"); + } + if (errors !== null && typeof errors === "object") { + return Object.keys(errors) + .map((key) => { + const value = errors[key]; + const rendered = typeof value === "string" ? value : JSON.stringify(value); + return key + ": " + rendered; + }) + .sort(); + } + return []; + } } exports.ApiException = ApiException; //# sourceMappingURL=exception.js.map \ No newline at end of file diff --git a/dist/apis/exception.js.map b/dist/apis/exception.js.map index 65e5314..37a21d2 100644 --- a/dist/apis/exception.js.map +++ b/dist/apis/exception.js.map @@ -1 +1 @@ -{"version":3,"file":"exception.js","sourceRoot":"","sources":["../../apis/exception.ts"],"names":[],"mappings":";;;AASA,MAAa,YAAgB,SAAQ,KAAK;IACtC,YAA0B,IAAY,EAAE,OAAe,EAAS,IAAO,EAAS,OAAmC;QAC/G,KAAK,CAAC,aAAa,GAAG,IAAI,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa;YACxG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAFF,SAAI,GAAJ,IAAI,CAAQ;QAA0B,SAAI,GAAJ,IAAI,CAAG;QAAS,YAAO,GAAP,OAAO,CAA4B;QAW/G,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACJ;AAdD,oCAcC"} \ No newline at end of file +{"version":3,"file":"exception.js","sourceRoot":"","sources":["../../apis/exception.ts"],"names":[],"mappings":";;;AASA,MAAa,YAAgB,SAAQ,KAAK;IACtC,YAA0B,IAAY,EAAE,OAAe,EAAS,IAAO,EAAS,OAAmC;QAC/G,KAAK,CAAC,aAAa,GAAG,IAAI,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,IAAI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AI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;oBACjG,OAAO,KAAK,IAAI,IAAI,CAAC;iBACxB;gBACD,OAAO,SAAS,CAAC;YACrB,CAAC,CAAC;iBACD,MAAM,CAAC,CAAC,CAAM,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;SAC/D;QACD,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAI/C,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;iBACrB,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE;gBACjB,MAAM,KAAK,GAAQ,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC/B,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;gBAC3E,OAAO,GAAG,GAAG,IAAI,GAAG,QAAQ,CAAC;YACjC,CAAC,CAAC;iBACD,IAAI,EAAE,CAAC;SACf;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AApED,oCAoEC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index 58bad12..e29fdfa 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -4,7 +4,9 @@ export * from "./models/all"; export { createConfiguration } from "./configuration"; export { Configuration, ConfigurationParameters } from "./configuration"; export * from "./apis/exception"; +export * from "./helpers"; export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export { PromiseMiddleware as Middleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; +export * from "./errors"; diff --git a/dist/index.js b/dist/index.js index 7008601..1589d21 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21,9 +21,11 @@ __exportStar(require("./models/all"), exports); var configuration_1 = require("./configuration"); Object.defineProperty(exports, "createConfiguration", { enumerable: true, get: function () { return configuration_1.createConfiguration; } }); __exportStar(require("./apis/exception"), exports); +__exportStar(require("./helpers"), exports); __exportStar(require("./servers"), exports); var baseapi_1 = require("./apis/baseapi"); Object.defineProperty(exports, "RequiredError", { enumerable: true, get: function () { return baseapi_1.RequiredError; } }); var PromiseAPI_1 = require("./types/PromiseAPI"); Object.defineProperty(exports, "DefaultApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseDefaultApi; } }); +__exportStar(require("./errors"), exports); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map index a3657eb..61fe2d1 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAAqD;AAA5C,oHAAA,mBAAmB,OAAA;AAE5B,mDAAiC;AACjC,4CAA0B;AAC1B,0CAA+C;AAAtC,wGAAA,aAAa,OAAA;AAGtB,iDAAqE;AAA5D,wGAAA,iBAAiB,OAAc"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAAqD;AAA5C,oHAAA,mBAAmB,OAAA;AAE5B,mDAAiC;AACjC,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAA+C;AAAtC,wGAAA,aAAa,OAAA;AAGtB,iDAAqE;AAA5D,wGAAA,iBAAiB,OAAc;AAExC,2CAAyB"} \ No newline at end of file diff --git a/dist/types/PromiseAPI.d.ts b/dist/types/PromiseAPI.d.ts index 5a30e9c..9aa5f0a 100644 --- a/dist/types/PromiseAPI.d.ts +++ b/dist/types/PromiseAPI.d.ts @@ -1,4 +1,6 @@ +import * as models from '../models/all'; import { Configuration } from '../configuration'; +import { CreateNotificationWithRetryOptions, CreateNotificationWithRetryResult } from '../helpers'; import { ApiKeyTokensListResponse } from '../models/ApiKeyTokensListResponse'; import { App } from '../models/App'; import { CopyTemplateRequest } from '../models/CopyTemplateRequest'; @@ -37,7 +39,9 @@ import { UserIdentityBody } from '../models/UserIdentityBody'; import { DefaultApiRequestFactory, DefaultApiResponseProcessor } from "../apis/DefaultApi"; export declare class PromiseDefaultApi { private api; + private configuration; constructor(configuration: Configuration, requestFactory?: DefaultApiRequestFactory, responseProcessor?: DefaultApiResponseProcessor); + createNotificationWithRetry(notification: models.Notification, options?: CreateNotificationWithRetryOptions): Promise; cancelNotification(appId: string, notificationId: string, _options?: Configuration): Promise; copyTemplateToApp(templateId: string, appId: string, copyTemplateRequest: CopyTemplateRequest, _options?: Configuration): Promise; createAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityBody: UserIdentityBody, _options?: Configuration): Promise; diff --git a/dist/types/PromiseAPI.js b/dist/types/PromiseAPI.js index 643788d..b7b2187 100644 --- a/dist/types/PromiseAPI.js +++ b/dist/types/PromiseAPI.js @@ -1,10 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PromiseDefaultApi = void 0; +const helpers_1 = require("../helpers"); const ObservableAPI_1 = require("./ObservableAPI"); class PromiseDefaultApi { constructor(configuration, requestFactory, responseProcessor) { this.api = new ObservableAPI_1.ObservableDefaultApi(configuration, requestFactory, responseProcessor); + this.configuration = configuration; + } + createNotificationWithRetry(notification, options) { + return (0, helpers_1.createNotificationWithRetry)(this.configuration, notification, options); } cancelNotification(appId, notificationId, _options) { const result = this.api.cancelNotification(appId, notificationId, _options); diff --git a/dist/types/PromiseAPI.js.map b/dist/types/PromiseAPI.js.map index fe3ed6f..a119c80 100644 --- a/dist/types/PromiseAPI.js.map +++ b/dist/types/PromiseAPI.js.map @@ -1 +1 @@ -{"version":3,"file":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,CAAC,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;QAC3F,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;IASM,UAAU,CAAC,KAAa,EAAE,UAAkB,EAAE,OAAe,EAAE,iBAAoC,EAAE,QAAwB;QAChI,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QAC5F,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;IAOM,WAAW,CAAC,KAAa,EAAE,QAAwB;QACtD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;IAQM,YAAY,CAAC,UAAkB,EAAE,KAAa,EAAE,QAAwB;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAClE,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;IAUM,aAAa,CAAC,KAAa,EAAE,KAAc,EAAE,MAAe,EAAE,OAAkC,EAAE,QAAwB;QAC7H,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC/E,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;CAGJ;AAxgBD,8CAwgBC"} \ No newline at end of file diff --git a/errors.ts b/errors.ts new file mode 100644 index 0000000..c68f2c4 --- /dev/null +++ b/errors.ts @@ -0,0 +1,25 @@ +// Generated from inputs/api/error-catalog.json. Do not edit by hand. + +/** + * Sentinel error message strings the OneSignal API can return. Each value + * equals the literal message the server emits, so you can test membership + * against `ApiException.errorMessages` (e.g. NO_TARGETING_SPECIFIED). + * + * Note: 200-status sentinels such as NO_SUBSCRIBERS arrive on a successful + * response (CreateNotificationSuccessResponse.errors), not via the exception + * accessor — read the response's `errors` field for those. + */ +export const OneSignalErrors = { + /** HTTP 403 | retryable: no | emitted by: any API-key-authenticated endpoint (REST or Organization key) | note: Generic auth-failure message the public api.onesignal.com edge returns for any invalid or mismatched key — REST or Organization — so a single sentinel covers both. Supersedes the Rails-monolith INVALID_REST_API_KEY / INVALID_USER_AUTH_KEY strings, which the public host no longer returns verbatim. Note the double space after 'denied.' */ + INVALID_API_KEY: "Access denied. Please include an 'Authorization: ...' header with a valid API key (https://documentation.onesignal.com/docs/en/keys-and-ids#api-keys).", + /** HTTP 400, 404 | retryable: no | emitted by: POST /notifications/{id}/history, POST /notifications/{id}/messages, GET /notifications/{id} (export) | note: Verified live 2026-06-16: GET /notifications/{bogus-uuid} returns 404 with this exact message. */ + NOTIFICATION_NOT_FOUND: "Notification not found", + /** HTTP 200 | retryable: no | emitted by: POST /notifications | note: Returned with HTTP 200 OK (id is empty), not an error status. The flagship case for the errorMessages accessor — lets callers distinguish a sent notification from a no-op without parsing the polymorphic 200 body. */ + NO_SUBSCRIBERS: "All included players are not subscribed", + /** HTTP 400 | retryable: no | emitted by: POST /notifications | note: Verified live 2026-06-16: a no-targeting POST /notifications returns 400 with this exact message. */ + NO_TARGETING_SPECIFIED: "You must include which players, segments, or tags you wish to send this notification to.", + /** HTTP 503 | retryable: yes | emitted by: any endpoint (pgbouncer rejection) | note: Transient DB/pgbouncer failure — the canonical retryable sentinel. */ + SERVICE_UNAVAILABLE: "Service temporarily unavailable", +} as const; + +export type OneSignalErrorMessage = typeof OneSignalErrors[keyof typeof OneSignalErrors]; diff --git a/helpers.ts b/helpers.ts new file mode 100644 index 0000000..9e238dd --- /dev/null +++ b/helpers.ts @@ -0,0 +1,128 @@ +import { randomBytes } from 'crypto'; + +import { Configuration } from './configuration'; +import { ResponseContext } from './http/http'; +import { DefaultApiRequestFactory, DefaultApiResponseProcessor } from './apis/DefaultApi'; +import { Notification } from './models/Notification'; +import { CreateNotificationSuccessResponse } from './models/CreateNotificationSuccessResponse'; + +export interface CreateNotificationWithRetryOptions { + /** Retries after the initial attempt. Default 3. */ + maxRetries?: number; + /** Backoff base in milliseconds when Retry-After is absent. Clamped to + * [1000, 60000]. Default 1000. */ + baseDelayMs?: number; +} + +/** + * Result of createNotificationWithRetry: the create response plus whether the + * server replayed a previously completed request (Idempotent-Replayed + * response header). + */ +export interface CreateNotificationWithRetryResult { + response: CreateNotificationSuccessResponse; + wasReplayed: boolean; +} + +const RETRYABLE_STATUSES = [429, 503]; +const MIN_BASE_DELAY_MS = 1000; +const MAX_BASE_DELAY_MS = 60000; + +/** + * Create a notification with safe, idempotent retries. + * + * Ensures `notification.idempotency_key` is set (generating a UUIDv4 when + * absent) so the server can deduplicate, then calls `createNotification`. + * Transient failures (HTTP 429, HTTP 503, or transport-level errors) are + * retried with the SAME idempotency key, honoring the `Retry-After` response + * header when present and falling back to exponential backoff + * (`baseDelayMs * 2^attempt`) otherwise. Other errors are thrown immediately + * (non-2xx statuses surface as the usual `ApiException`). + */ +export async function createNotificationWithRetry( + configuration: Configuration, + notification: Notification, + options?: CreateNotificationWithRetryOptions +): Promise { + const maxRetries = options && options.maxRetries !== undefined ? options.maxRetries : 3; + // Clamp the backoff base so a stray value can neither hammer the API + // (too small) nor stall the caller for an unbounded stretch (too large). + const requestedBaseDelayMs = + options && typeof options.baseDelayMs === 'number' && isFinite(options.baseDelayMs) + ? options.baseDelayMs + : MIN_BASE_DELAY_MS; + const baseDelayMs = Math.min(MAX_BASE_DELAY_MS, Math.max(MIN_BASE_DELAY_MS, requestedBaseDelayMs)); + + if (!notification.idempotency_key) { + notification.idempotency_key = generateUuidV4(); + } + + const requestFactory = new DefaultApiRequestFactory(configuration); + const responseProcessor = new DefaultApiResponseProcessor(); + + let attempt = 0; + while (true) { + let response: ResponseContext; + try { + const requestContext = await requestFactory.createNotification(notification, configuration); + response = await configuration.httpApi.send(requestContext).toPromise(); + } catch (e) { + if (attempt >= maxRetries) { + throw e; + } + await sleep(baseDelayMs * Math.pow(2, attempt)); + attempt++; + continue; + } + + if (RETRYABLE_STATUSES.indexOf(response.httpStatusCode) !== -1 && attempt < maxRetries) { + await sleep(retryDelayMs(response.headers, attempt, baseDelayMs)); + attempt++; + continue; + } + + const body = await responseProcessor.createNotification(response); + return { response: body, wasReplayed: isReplayed(response.headers) }; + } +} + +function headerValue(headers: { [key: string]: string }, name: string): string | undefined { + const target = name.toLowerCase(); + for (const key in headers) { + if (Object.prototype.hasOwnProperty.call(headers, key) && key.toLowerCase() === target) { + return headers[key]; + } + } + return undefined; +} + +function isReplayed(headers: { [key: string]: string }): boolean { + const value = headerValue(headers, 'idempotent-replayed'); + return value !== undefined && value.trim().toLowerCase() === 'true'; +} + +function retryDelayMs(headers: { [key: string]: string }, attempt: number, baseDelayMs: number): number { + const retryAfter = headerValue(headers, 'retry-after'); + if (retryAfter !== undefined && /^\d+$/.test(retryAfter.trim())) { + return parseInt(retryAfter.trim(), 10) * 1000; + } + return baseDelayMs * Math.pow(2, attempt); +} + +function generateUuidV4(): string { + const bytes = randomBytes(16); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + const hex = bytes.toString('hex'); + return ( + hex.substring(0, 8) + '-' + + hex.substring(8, 12) + '-' + + hex.substring(12, 16) + '-' + + hex.substring(16, 20) + '-' + + hex.substring(20) + ); +} + +function sleep(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/index.ts b/index.ts index 4892c06..930152e 100644 --- a/index.ts +++ b/index.ts @@ -4,9 +4,11 @@ export * from "./models/all"; export { createConfiguration } from "./configuration" export { Configuration, ConfigurationParameters } from "./configuration" export * from "./apis/exception"; +export * from "./helpers"; export * from "./servers"; export { RequiredError } from "./apis/baseapi"; export { PromiseMiddleware as Middleware } from './middleware'; export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI'; +export * from "./errors"; diff --git a/models/ApiKeyToken.ts b/models/ApiKeyToken.ts index f738395..885f814 100644 --- a/models/ApiKeyToken.ts +++ b/models/ApiKeyToken.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/ApiKeyTokensListResponse.ts b/models/ApiKeyTokensListResponse.ts index 326a38b..9dd2ec3 100644 --- a/models/ApiKeyTokensListResponse.ts +++ b/models/ApiKeyTokensListResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/App.ts b/models/App.ts index 7f578c4..1967e53 100644 --- a/models/App.ts +++ b/models/App.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotification.ts b/models/BasicNotification.ts index 81c64d4..e51a439 100644 --- a/models/BasicNotification.ts +++ b/models/BasicNotification.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotificationAllOf.ts b/models/BasicNotificationAllOf.ts index 4c3922f..5cca8ba 100644 --- a/models/BasicNotificationAllOf.ts +++ b/models/BasicNotificationAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/BasicNotificationAllOfAndroidBackgroundLayout.ts b/models/BasicNotificationAllOfAndroidBackgroundLayout.ts index 09c642c..313991c 100644 --- a/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +++ b/models/BasicNotificationAllOfAndroidBackgroundLayout.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Button.ts b/models/Button.ts index e3d89fa..0bb4858 100644 --- a/models/Button.ts +++ b/models/Button.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CopyTemplateRequest.ts b/models/CopyTemplateRequest.ts index 59ef1c1..2d455dc 100644 --- a/models/CopyTemplateRequest.ts +++ b/models/CopyTemplateRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateApiKeyRequest.ts b/models/CreateApiKeyRequest.ts index 59318f6..bdf9c63 100644 --- a/models/CreateApiKeyRequest.ts +++ b/models/CreateApiKeyRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateApiKeyResponse.ts b/models/CreateApiKeyResponse.ts index 092624d..487ed17 100644 --- a/models/CreateApiKeyResponse.ts +++ b/models/CreateApiKeyResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateNotificationSuccessResponse.ts b/models/CreateNotificationSuccessResponse.ts index f368138..44c4a37 100644 --- a/models/CreateNotificationSuccessResponse.ts +++ b/models/CreateNotificationSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentConflictResponse.ts b/models/CreateSegmentConflictResponse.ts index 870fd44..de2c666 100644 --- a/models/CreateSegmentConflictResponse.ts +++ b/models/CreateSegmentConflictResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateSegmentSuccessResponse.ts b/models/CreateSegmentSuccessResponse.ts index 04d5179..0778dee 100644 --- a/models/CreateSegmentSuccessResponse.ts +++ b/models/CreateSegmentSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateTemplateRequest.ts b/models/CreateTemplateRequest.ts index ffc1f59..81cab55 100644 --- a/models/CreateTemplateRequest.ts +++ b/models/CreateTemplateRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateUserConflictResponse.ts b/models/CreateUserConflictResponse.ts index 0229266..629aec2 100644 --- a/models/CreateUserConflictResponse.ts +++ b/models/CreateUserConflictResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateUserConflictResponseErrorsInner.ts b/models/CreateUserConflictResponseErrorsInner.ts index df0e5ac..029c4c1 100644 --- a/models/CreateUserConflictResponseErrorsInner.ts +++ b/models/CreateUserConflictResponseErrorsInner.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CreateUserConflictResponseErrorsItemsMeta.ts b/models/CreateUserConflictResponseErrorsItemsMeta.ts index b68be0e..e900b27 100644 --- a/models/CreateUserConflictResponseErrorsItemsMeta.ts +++ b/models/CreateUserConflictResponseErrorsItemsMeta.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CustomEvent.ts b/models/CustomEvent.ts index 9522789..d20bd59 100644 --- a/models/CustomEvent.ts +++ b/models/CustomEvent.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/CustomEventsRequest.ts b/models/CustomEventsRequest.ts index 1d7ed4b..404cce3 100644 --- a/models/CustomEventsRequest.ts +++ b/models/CustomEventsRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/DeliveryData.ts b/models/DeliveryData.ts index 0f73f8f..0652b3d 100644 --- a/models/DeliveryData.ts +++ b/models/DeliveryData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/ExportEventsSuccessResponse.ts b/models/ExportEventsSuccessResponse.ts index 71bfef5..1b9eba8 100644 --- a/models/ExportEventsSuccessResponse.ts +++ b/models/ExportEventsSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/ExportSubscriptionsRequestBody.ts b/models/ExportSubscriptionsRequestBody.ts index a61b4d4..28c63d2 100644 --- a/models/ExportSubscriptionsRequestBody.ts +++ b/models/ExportSubscriptionsRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/ExportSubscriptionsSuccessResponse.ts b/models/ExportSubscriptionsSuccessResponse.ts index 4383a69..f7e21ec 100644 --- a/models/ExportSubscriptionsSuccessResponse.ts +++ b/models/ExportSubscriptionsSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Filter.ts b/models/Filter.ts index f9e3488..96119a5 100644 --- a/models/Filter.ts +++ b/models/Filter.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/FilterExpression.ts b/models/FilterExpression.ts index 765dd18..7d7feb4 100644 --- a/models/FilterExpression.ts +++ b/models/FilterExpression.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/GenericError.ts b/models/GenericError.ts index 35c3002..82e16b0 100644 --- a/models/GenericError.ts +++ b/models/GenericError.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/GenericSuccessBoolResponse.ts b/models/GenericSuccessBoolResponse.ts index 8a4bc54..9f8c4cc 100644 --- a/models/GenericSuccessBoolResponse.ts +++ b/models/GenericSuccessBoolResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/GetNotificationHistoryRequestBody.ts b/models/GetNotificationHistoryRequestBody.ts index 6682205..b728e0c 100644 --- a/models/GetNotificationHistoryRequestBody.ts +++ b/models/GetNotificationHistoryRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/GetSegmentsSuccessResponse.ts b/models/GetSegmentsSuccessResponse.ts index a911c1e..bfefe94 100644 --- a/models/GetSegmentsSuccessResponse.ts +++ b/models/GetSegmentsSuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/LanguageStringMap.ts b/models/LanguageStringMap.ts index 1b64f2c..27a884a 100644 --- a/models/LanguageStringMap.ts +++ b/models/LanguageStringMap.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Notification.ts b/models/Notification.ts index fb50e26..3690848 100644 --- a/models/Notification.ts +++ b/models/Notification.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationAllOf.ts b/models/NotificationAllOf.ts index f0230cc..e165139 100644 --- a/models/NotificationAllOf.ts +++ b/models/NotificationAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationHistorySuccessResponse.ts b/models/NotificationHistorySuccessResponse.ts index 28b1068..0557029 100644 --- a/models/NotificationHistorySuccessResponse.ts +++ b/models/NotificationHistorySuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationSlice.ts b/models/NotificationSlice.ts index 656d083..15f6171 100644 --- a/models/NotificationSlice.ts +++ b/models/NotificationSlice.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationTarget.ts b/models/NotificationTarget.ts index 90a0dbd..b42a97c 100644 --- a/models/NotificationTarget.ts +++ b/models/NotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationWithMeta.ts b/models/NotificationWithMeta.ts index 29e2e3c..239c5eb 100644 --- a/models/NotificationWithMeta.ts +++ b/models/NotificationWithMeta.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/NotificationWithMetaAllOf.ts b/models/NotificationWithMetaAllOf.ts index 99e71df..820d7f0 100644 --- a/models/NotificationWithMetaAllOf.ts +++ b/models/NotificationWithMetaAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Operator.ts b/models/Operator.ts index 2ac9ef1..84385d6 100644 --- a/models/Operator.ts +++ b/models/Operator.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomeData.ts b/models/OutcomeData.ts index 5abd552..43d364c 100644 --- a/models/OutcomeData.ts +++ b/models/OutcomeData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/OutcomesData.ts b/models/OutcomesData.ts index e21e196..4ad4b28 100644 --- a/models/OutcomesData.ts +++ b/models/OutcomesData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryData.ts b/models/PlatformDeliveryData.ts index 835f507..346645b 100644 --- a/models/PlatformDeliveryData.ts +++ b/models/PlatformDeliveryData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataEmailAllOf.ts b/models/PlatformDeliveryDataEmailAllOf.ts index ef8b2cc..f94c9d4 100644 --- a/models/PlatformDeliveryDataEmailAllOf.ts +++ b/models/PlatformDeliveryDataEmailAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PlatformDeliveryDataSmsAllOf.ts b/models/PlatformDeliveryDataSmsAllOf.ts index eaea037..b1e61f9 100644 --- a/models/PlatformDeliveryDataSmsAllOf.ts +++ b/models/PlatformDeliveryDataSmsAllOf.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PropertiesBody.ts b/models/PropertiesBody.ts index bd7a5e1..e9eba4f 100644 --- a/models/PropertiesBody.ts +++ b/models/PropertiesBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PropertiesDeltas.ts b/models/PropertiesDeltas.ts index da13e4b..e347e7d 100644 --- a/models/PropertiesDeltas.ts +++ b/models/PropertiesDeltas.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/PropertiesObject.ts b/models/PropertiesObject.ts index 1780470..55e6667 100644 --- a/models/PropertiesObject.ts +++ b/models/PropertiesObject.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Purchase.ts b/models/Purchase.ts index 9b98a9d..b9262ad 100644 --- a/models/Purchase.ts +++ b/models/Purchase.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/RateLimitError.ts b/models/RateLimitError.ts index d2c00a6..8ce08ce 100644 --- a/models/RateLimitError.ts +++ b/models/RateLimitError.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Segment.ts b/models/Segment.ts index ac84f3c..38e5739 100644 --- a/models/Segment.ts +++ b/models/Segment.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/SegmentData.ts b/models/SegmentData.ts index 3ad8596..ded4ecf 100644 --- a/models/SegmentData.ts +++ b/models/SegmentData.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/SegmentNotificationTarget.ts b/models/SegmentNotificationTarget.ts index 80b994e..df6d1b9 100644 --- a/models/SegmentNotificationTarget.ts +++ b/models/SegmentNotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/StartLiveActivityRequest.ts b/models/StartLiveActivityRequest.ts index 5b52a8c..26c8039 100644 --- a/models/StartLiveActivityRequest.ts +++ b/models/StartLiveActivityRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/StartLiveActivitySuccessResponse.ts b/models/StartLiveActivitySuccessResponse.ts index b5bf440..701eb47 100644 --- a/models/StartLiveActivitySuccessResponse.ts +++ b/models/StartLiveActivitySuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/Subscription.ts b/models/Subscription.ts index 6613f2e..88f7cbd 100644 --- a/models/Subscription.ts +++ b/models/Subscription.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/SubscriptionBody.ts b/models/SubscriptionBody.ts index 3da8327..c0c2388 100644 --- a/models/SubscriptionBody.ts +++ b/models/SubscriptionBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/SubscriptionNotificationTarget.ts b/models/SubscriptionNotificationTarget.ts index bce8075..4806332 100644 --- a/models/SubscriptionNotificationTarget.ts +++ b/models/SubscriptionNotificationTarget.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/TemplateResource.ts b/models/TemplateResource.ts index c06a799..45b54ca 100644 --- a/models/TemplateResource.ts +++ b/models/TemplateResource.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/TemplatesListResponse.ts b/models/TemplatesListResponse.ts index 140cd0c..b9e6cc9 100644 --- a/models/TemplatesListResponse.ts +++ b/models/TemplatesListResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/TransferSubscriptionRequestBody.ts b/models/TransferSubscriptionRequestBody.ts index 34f0908..ad8b0a7 100644 --- a/models/TransferSubscriptionRequestBody.ts +++ b/models/TransferSubscriptionRequestBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateApiKeyRequest.ts b/models/UpdateApiKeyRequest.ts index e669aad..6a191c4 100644 --- a/models/UpdateApiKeyRequest.ts +++ b/models/UpdateApiKeyRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateLiveActivityRequest.ts b/models/UpdateLiveActivityRequest.ts index a91471e..73dda6d 100644 --- a/models/UpdateLiveActivityRequest.ts +++ b/models/UpdateLiveActivityRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateLiveActivitySuccessResponse.ts b/models/UpdateLiveActivitySuccessResponse.ts index 071b5f1..03a73a0 100644 --- a/models/UpdateLiveActivitySuccessResponse.ts +++ b/models/UpdateLiveActivitySuccessResponse.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateTemplateRequest.ts b/models/UpdateTemplateRequest.ts index 3fa16dc..be0f69f 100644 --- a/models/UpdateTemplateRequest.ts +++ b/models/UpdateTemplateRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UpdateUserRequest.ts b/models/UpdateUserRequest.ts index 0d12748..36d3427 100644 --- a/models/UpdateUserRequest.ts +++ b/models/UpdateUserRequest.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/User.ts b/models/User.ts index 5d63165..90dc735 100644 --- a/models/User.ts +++ b/models/User.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/UserIdentityBody.ts b/models/UserIdentityBody.ts index 70836ad..9721b58 100644 --- a/models/UserIdentityBody.ts +++ b/models/UserIdentityBody.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/models/WebButton.ts b/models/WebButton.ts index 66c90ec..20d8f76 100644 --- a/models/WebButton.ts +++ b/models/WebButton.ts @@ -2,7 +2,7 @@ * OneSignal * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * API Version: 5.6.0 + * API Version: 5.7.0 * Contact: devrel@onesignal.com */ diff --git a/types/PromiseAPI.ts b/types/PromiseAPI.ts index 9e8b858..8a3e5b4 100644 --- a/types/PromiseAPI.ts +++ b/types/PromiseAPI.ts @@ -1,6 +1,8 @@ import { ResponseContext, RequestContext, HttpFile } from '../http/http'; import * as models from '../models/all'; import { Configuration} from '../configuration' +// OneSignal: surface the idempotent-retry helper as a client method (see helpers.ts). +import { createNotificationWithRetry, CreateNotificationWithRetryOptions, CreateNotificationWithRetryResult } from '../helpers'; import { ApiKeyToken } from '../models/ApiKeyToken'; import { ApiKeyTokensListResponse } from '../models/ApiKeyTokensListResponse'; @@ -74,6 +76,8 @@ import { ObservableDefaultApi } from './ObservableAPI'; import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; export class PromiseDefaultApi { private api: ObservableDefaultApi + // OneSignal: retained so the createNotificationWithRetry method can reuse it. + private configuration: Configuration public constructor( configuration: Configuration, @@ -81,6 +85,17 @@ export class PromiseDefaultApi { responseProcessor?: DefaultApiResponseProcessor ) { this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + this.configuration = configuration; + } + + /** + * OneSignal: create a notification with safe, idempotent retries. Thin + * wrapper over the createNotificationWithRetry helper that reuses this + * client's configuration so the call mirrors createNotification(). See + * helpers.ts for the full retry/idempotency contract. + */ + public createNotificationWithRetry(notification: models.Notification, options?: CreateNotificationWithRetryOptions): Promise { + return createNotificationWithRetry(this.configuration, notification, options); } /** diff --git a/yarn.lock b/yarn.lock index f58b110..57562cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -81,14 +81,14 @@ es-set-tostringtag@^2.1.0: hasown "^2.0.2" form-data@^2.5.0: - version "2.5.5" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.5.tgz#a5f6364ad7e4e67e95b4a07e2d8c6f711c74f624" - integrity sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A== + version "2.5.6" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.6.tgz#ef39b3d99e2fc9f25420c0db7962fe36cafcd244" + integrity sha512-Ogz/E85h9tlfJzpI6TuFpGcHZFhLrb9Gw8wq9v40CxSCPnv7ahKr6Xgtkn0KYCDQJ8DNn5VoMO8EXr9V5PadyA== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" es-set-tostringtag "^2.1.0" - hasown "^2.0.2" + hasown "^2.0.4" mime-types "^2.1.35" safe-buffer "^5.2.1" @@ -138,7 +138,7 @@ has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" -hasown@^2.0.2: +hasown@^2.0.2, hasown@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.4.tgz#8c62d8cb90beb2aad5d0a5b67581ad9854c3f003" integrity sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==