Skip to content

Commit

Permalink
Merge pull request #55 from OneSignal/api
Browse files Browse the repository at this point in the history
Dependency Update
  • Loading branch information
kesheshyan authored Apr 18, 2023
2 parents 1951a9c + 7e46275 commit f40b4bd
Show file tree
Hide file tree
Showing 78 changed files with 101 additions and 135 deletions.
7 changes: 3 additions & 4 deletions DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ let body:.DefaultApiCreateUserRequest = {
sku: "sku_example",
amount: "amount_example",
iso: "iso_example",
count: 3.14,
},
],
ip: "ip_example",
Expand Down Expand Up @@ -2370,6 +2371,7 @@ let body:.DefaultApiUpdateUserRequest = {
sku: "sku_example",
amount: "amount_example",
iso: "iso_example",
count: 3.14,
},
],
ip: "ip_example",
Expand All @@ -2378,18 +2380,16 @@ let body:.DefaultApiUpdateUserRequest = {
deltas: {
session_time: 3.14,
session_count: 3.14,
amount_spent: 3.14,
purchases: [
{
sku: "sku_example",
amount: "amount_example",
iso: "iso_example",
count: 3.14,
},
],
},
},
// string (optional)
subscriptionId: "subscription_id_example",
};

apiInstance.updateUser(body).then((data:any) => {
Expand All @@ -2406,7 +2406,6 @@ Name | Type | Description | Notes
**appId** | [**string**] | | defaults to undefined
**aliasLabel** | [**string**] | | defaults to undefined
**aliasId** | [**string**] | | defaults to undefined
**subscriptionId** | [**string**] | | (optional) defaults to undefined


### Return type
Expand Down
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const configuration = OneSignal.createConfiguration({
const client = new OneSignal.DefaultApi(configuration);
```

#### Advanced Usage: Creating a brand new app
#### Advanced Usage: Creating a brand-new app
If creating a new app via the client, the response will return the app's API key via the `basic_auth_key` response
parameter. You can then use this to modify your configuration object and create a new client that will have both user-level and app-level authentication set up.

Expand All @@ -86,6 +86,8 @@ const client = new OneSignal.DefaultApi(configuration);
---
## API Reference

> See the full list of [API Endpoints](DefaultApi.MD).
To make stateful changes requests should take on the following pattern:
1. create or get an object
2. make changes to that object
Expand All @@ -96,28 +98,6 @@ Examples of important OneSignal objects include `App`, `Notification`, `Player`,
For example, see the section below on creating an app. First an app object is created via the instantiation of the `App`
class. Then, the app instance is modified directly. Finally, we use the `client` to create the app via a remote request.

| Function | HTTP Request | Description |
|---------------------------------------------------------|------------------------------------------------|-----------------------------------------------------|
| [cancelNotification](#canceling-a-notification) | Delete `/notifications/{notification_id}` | Stop a scheduled or currently outgoing notification |
| [createApp](#creating-an-app) | Post `/apps` | Create an app |
| [createNotification](#creating-a-notification) | Post `/notifications` | Create notification |
| [createPlayer](#creating-a-player) | Post `/players` | Add a device |
| [createSegments](#creating-a-segment) | Post `/apps/{app_id}/segments` | Create Segments |
| [deletePlayer](#deleting-a-player) | Delete `/players/{player_id}` | Delete a user record |
| [deleteSegments](#deleting-a-segment) | Delete `/apps/{app_id}/segments/{segment_id}` | Delete Segments |
| [exportPlayers](#exporting-a-player) | Post `/players/csv_export?app_id={app_id}` | CSV export |
| [getApp](#getting-an-app) | Get `/apps/{app_id}` | View an app |
| [getApps](#getting-multiple-apps) | Get `/apps` | View apps |
| [getNotification](#getting-a-notification) | Get `/notifications/{notification_id}` | View notification |
| [getNotificationHistory](#getting-notification-history) | Post `/notifications/{notification_id}/history` | Notification History |
| [getNotifications](#getting-a-notification) | Get `/notifications` | View notifications |
| [getOutcomes](#getting-outcomes) | Get `/apps/{app_id}/outcomes` | View Outcomes |
| [getPlayer](#getting-a-player) | Get `/players/{player_id}` | View device |
| [getPlayers](#getting-players) | Get `/players` | View devices |
| [updateApp](#getting-an-app) | Put `/apps/{app_id}` | Update an app |
| [updatePlayer](#updating-a-player) | Put `/players/{player_id}` | Edit device |
| [updatePlayerTags](#updating-player-tags) | Put `/apps/{app_id}/users/{external_user_id}` | Edit tags with external user id |

### Creating an app
Creates a new OneSignal app.

Expand Down Expand Up @@ -604,6 +584,6 @@ Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2022 [OneSignal](https://github.com/OneSignal).
Copyright © 2023 [OneSignal](https://github.com/OneSignal).

This project is [MIT](https://github.com/OneSignal/node-onesignal/blob/main/LICENSE) licensed.
7 changes: 1 addition & 6 deletions apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1971,9 +1971,8 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
* @param aliasLabel
* @param aliasId
* @param updateUserRequest
* @param subscriptionId
*/
public async updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, subscriptionId?: string, _options?: Configuration): Promise<RequestContext> {
public async updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, _options?: Configuration): Promise<RequestContext> {
let _config = _options || this.configuration;

// verify required parameter 'appId' is not null or undefined
Expand All @@ -2000,7 +1999,6 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
}



// Path Params
const localVarPath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'
.replace('{' + 'app_id' + '}', encodeURIComponent(String(appId)))
Expand All @@ -2011,9 +2009,6 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PATCH);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")

// Header Params
requestContext.setHeaderParam("subscription_id", ObjectSerializer.serialize(subscriptionId, "string", ""));


// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
Expand Down
2 changes: 1 addition & 1 deletion models/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/BadRequestError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/BasicNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/BasicNotificationAllOf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/BasicNotificationAllOfAndroidBackgroundLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/BeginLiveActivityRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CancelNotificationSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
6 changes: 3 additions & 3 deletions models/CreateNotificationSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
* OneSignal
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
*
* API Version: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

import { Notification200Errors } from './Notification200Errors';
import { HttpFile } from '../http/http';

export class CreateNotificationSuccessResponse {
'id': string;
'id'?: string;
/**
* Estimated number of subscribers targetted by notification.
*/
'recipients': number;
'recipients'?: number;
'external_id'?: string;
'errors'?: Notification200Errors;

Expand Down
2 changes: 1 addition & 1 deletion models/CreatePlayerSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateSegmentConflictResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateSegmentSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateSubscriptionRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateUserConflictResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateUserConflictResponseErrorsInner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/CreateUserConflictResponseErrorsItemsMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/DeletePlayerNotFoundResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/DeletePlayerSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/DeleteSegmentNotFoundResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/DeleteSegmentSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/DeliveryData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/ExportPlayersRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/ExportPlayersSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/Filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/FilterExpressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/GetNotificationRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/IdentifyUserConflictResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
2 changes: 1 addition & 1 deletion models/IdentifyUserConflictResponseErrorsInner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: 1.1.0
* API Version: 1.2.1
* Contact: [email protected]
*/

Expand Down
Loading

0 comments on commit f40b4bd

Please sign in to comment.