@onesignal/node-onesignal 1.0.0-beta3 → 1.0.0-beta5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.github/ISSUE_TEMPLATE/ask-question.yml +25 -0
  2. package/.github/ISSUE_TEMPLATE/bug-report.yml +51 -0
  3. package/.github/ISSUE_TEMPLATE/general-feedback.yml +25 -0
  4. package/.github/pull_request_template.md +44 -0
  5. package/.github/workflows/npm_deploy.yml +21 -0
  6. package/CHANGELOG.md +26 -0
  7. package/DefaultApi.md +1232 -0
  8. package/LICENSE +24 -0
  9. package/README.md +205 -102
  10. package/RELEASE_INSTRUCTIONS.md +2 -0
  11. package/apis/DefaultApi.ts +519 -532
  12. package/apis/baseapi.ts +4 -4
  13. package/apis/exception.ts +4 -3
  14. package/auth/auth.ts +4 -1
  15. package/configuration.ts +21 -2
  16. package/http/http.ts +26 -26
  17. package/index.ts +1 -0
  18. package/middleware.ts +1 -1
  19. package/models/App.ts +8 -8
  20. package/models/BasicNotification.ts +1019 -0
  21. package/models/BasicNotificationAllOf.ts +897 -0
  22. package/models/{NotificationAllOfAndroidBackgroundLayout.ts → BasicNotificationAllOfAndroidBackgroundLayout.ts} +4 -4
  23. package/models/Button.ts +2 -2
  24. package/models/CancelNotificationSuccessResponse.ts +31 -0
  25. package/models/{InlineResponse400.ts → CreateNotificationBadRequestResponse.ts} +4 -4
  26. package/models/{InlineResponse200.ts → CreateNotificationSuccessResponse.ts} +7 -6
  27. package/models/{InlineResponse2004.ts → CreatePlayerSuccessResponse.ts} +4 -4
  28. package/models/CreateSegmentBadRequestResponse.ts +38 -0
  29. package/models/{InlineResponse409.ts → CreateSegmentConflictResponse.ts} +4 -4
  30. package/models/{InlineResponse201.ts → CreateSegmentSuccessResponse.ts} +4 -4
  31. package/models/DeletePlayerBadRequestResponse.ts +31 -0
  32. package/models/DeletePlayerNotFoundResponse.ts +31 -0
  33. package/models/{InlineResponse2003.ts → DeletePlayerSuccessResponse.ts} +4 -4
  34. package/models/{InlineResponse4002.ts → DeleteSegmentBadRequestResponse.ts} +4 -4
  35. package/models/DeleteSegmentNotFoundResponse.ts +31 -0
  36. package/models/DeleteSegmentSuccessResponse.ts +31 -0
  37. package/models/DeliveryData.ts +17 -2
  38. package/models/ExportPlayersRequestBody.ts +5 -5
  39. package/models/{InlineResponse2005.ts → ExportPlayersSuccessResponse.ts} +4 -4
  40. package/models/Filter.ts +4 -4
  41. package/models/FilterExpressions.ts +4 -4
  42. package/models/FilterNotificationTarget.ts +2 -2
  43. package/models/GetNotificationRequestBody.ts +2 -2
  44. package/models/InvalidIdentifierError.ts +44 -0
  45. package/models/Notification.ts +72 -174
  46. package/models/Notification200Errors.ts +45 -0
  47. package/models/NotificationAllOf.ts +3 -858
  48. package/models/{InlineResponse4001.ts → NotificationHistoryBadRequestResponse.ts} +4 -4
  49. package/models/{InlineResponse2002.ts → NotificationHistorySuccessResponse.ts} +6 -6
  50. package/models/NotificationSlice.ts +5 -5
  51. package/models/NotificationTarget.ts +3 -124
  52. package/models/NotificationWithMeta.ts +1127 -0
  53. package/models/NotificationWithMetaAllOf.ts +132 -0
  54. package/models/ObjectSerializer.ts +97 -46
  55. package/models/Operator.ts +2 -2
  56. package/models/OutcomeData.ts +2 -2
  57. package/models/OutcomesData.ts +32 -0
  58. package/models/PlatformDeliveryData.ts +18 -2
  59. package/models/PlatformDeliveryDataEmailAllOf.ts +94 -0
  60. package/models/PlatformDeliveryDataSmsAllOf.ts +54 -0
  61. package/models/Player.ts +14 -14
  62. package/models/PlayerNotificationTarget.ts +3 -3
  63. package/models/PlayerSlice.ts +2 -2
  64. package/models/Purchase.ts +2 -2
  65. package/models/Segment.ts +3 -3
  66. package/models/SegmentNotificationTarget.ts +2 -2
  67. package/models/StringMap.ts +3 -3
  68. package/models/{InlineResponse2001.ts → UpdatePlayerSuccessResponse.ts} +6 -6
  69. package/models/UpdatePlayerTagsRequestBody.ts +4 -4
  70. package/models/UpdatePlayerTagsSuccessResponse.ts +31 -0
  71. package/models/all.ts +28 -13
  72. package/package.json +14 -9
  73. package/tsconfig.json +1 -2
  74. package/types/ObjectParamAPI.ts +101 -86
  75. package/types/ObservableAPI.ts +116 -101
  76. package/types/PromiseAPI.ts +97 -82
  77. package/util.ts +10 -1
  78. package/git_push.sh +0 -52
@@ -3,32 +3,45 @@ import * as models from '../models/all';
3
3
  import { Configuration} from '../configuration'
4
4
 
5
5
  import { App } from '../models/App';
6
+ import { BasicNotification } from '../models/BasicNotification';
7
+ import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf';
8
+ import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout';
6
9
  import { Button } from '../models/Button';
10
+ import { CancelNotificationSuccessResponse } from '../models/CancelNotificationSuccessResponse';
11
+ import { CreateNotificationBadRequestResponse } from '../models/CreateNotificationBadRequestResponse';
12
+ import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
13
+ import { CreatePlayerSuccessResponse } from '../models/CreatePlayerSuccessResponse';
14
+ import { CreateSegmentBadRequestResponse } from '../models/CreateSegmentBadRequestResponse';
15
+ import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
16
+ import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
17
+ import { DeletePlayerBadRequestResponse } from '../models/DeletePlayerBadRequestResponse';
18
+ import { DeletePlayerNotFoundResponse } from '../models/DeletePlayerNotFoundResponse';
19
+ import { DeletePlayerSuccessResponse } from '../models/DeletePlayerSuccessResponse';
20
+ import { DeleteSegmentBadRequestResponse } from '../models/DeleteSegmentBadRequestResponse';
21
+ import { DeleteSegmentNotFoundResponse } from '../models/DeleteSegmentNotFoundResponse';
22
+ import { DeleteSegmentSuccessResponse } from '../models/DeleteSegmentSuccessResponse';
7
23
  import { DeliveryData } from '../models/DeliveryData';
8
24
  import { ExportPlayersRequestBody } from '../models/ExportPlayersRequestBody';
25
+ import { ExportPlayersSuccessResponse } from '../models/ExportPlayersSuccessResponse';
9
26
  import { Filter } from '../models/Filter';
10
27
  import { FilterExpressions } from '../models/FilterExpressions';
11
- import { FilterNotificationTarget } from '../models/FilterNotificationTarget';
12
28
  import { GetNotificationRequestBody } from '../models/GetNotificationRequestBody';
13
- import { InlineResponse200 } from '../models/InlineResponse200';
14
- import { InlineResponse2001 } from '../models/InlineResponse2001';
15
- import { InlineResponse2002 } from '../models/InlineResponse2002';
16
- import { InlineResponse2003 } from '../models/InlineResponse2003';
17
- import { InlineResponse2004 } from '../models/InlineResponse2004';
18
- import { InlineResponse2005 } from '../models/InlineResponse2005';
19
- import { InlineResponse201 } from '../models/InlineResponse201';
20
- import { InlineResponse400 } from '../models/InlineResponse400';
21
- import { InlineResponse4001 } from '../models/InlineResponse4001';
22
- import { InlineResponse4002 } from '../models/InlineResponse4002';
23
- import { InlineResponse409 } from '../models/InlineResponse409';
29
+ import { InvalidIdentifierError } from '../models/InvalidIdentifierError';
24
30
  import { Notification } from '../models/Notification';
31
+ import { Notification200Errors } from '../models/Notification200Errors';
25
32
  import { NotificationAllOf } from '../models/NotificationAllOf';
26
- import { NotificationAllOfAndroidBackgroundLayout } from '../models/NotificationAllOfAndroidBackgroundLayout';
33
+ import { NotificationHistoryBadRequestResponse } from '../models/NotificationHistoryBadRequestResponse';
34
+ import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
27
35
  import { NotificationSlice } from '../models/NotificationSlice';
28
36
  import { NotificationTarget } from '../models/NotificationTarget';
37
+ import { NotificationWithMeta } from '../models/NotificationWithMeta';
38
+ import { NotificationWithMetaAllOf } from '../models/NotificationWithMetaAllOf';
29
39
  import { Operator } from '../models/Operator';
30
40
  import { OutcomeData } from '../models/OutcomeData';
41
+ import { OutcomesData } from '../models/OutcomesData';
31
42
  import { PlatformDeliveryData } from '../models/PlatformDeliveryData';
43
+ import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEmailAllOf';
44
+ import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf';
32
45
  import { Player } from '../models/Player';
33
46
  import { PlayerNotificationTarget } from '../models/PlayerNotificationTarget';
34
47
  import { PlayerSlice } from '../models/PlayerSlice';
@@ -36,7 +49,9 @@ import { Purchase } from '../models/Purchase';
36
49
  import { Segment } from '../models/Segment';
37
50
  import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget';
38
51
  import { StringMap } from '../models/StringMap';
52
+ import { UpdatePlayerSuccessResponse } from '../models/UpdatePlayerSuccessResponse';
39
53
  import { UpdatePlayerTagsRequestBody } from '../models/UpdatePlayerTagsRequestBody';
54
+ import { UpdatePlayerTagsSuccessResponse } from '../models/UpdatePlayerTagsSuccessResponse';
40
55
  import { ObservableDefaultApi } from './ObservableAPI';
41
56
 
42
57
  import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi";
@@ -54,11 +69,11 @@ export class PromiseDefaultApi {
54
69
  /**
55
70
  * Used to stop a scheduled or currently outgoing notification
56
71
  * Stop a scheduled or currently outgoing notification
57
- * @param app_id
58
- * @param notification_id
72
+ * @param appId
73
+ * @param notificationId
59
74
  */
60
- public cancelNotification(app_id: string, notification_id: string, _options?: Configuration): Promise<InlineResponse2001> {
61
- const result = this.api.cancelNotification(app_id, notification_id, _options);
75
+ public cancelNotification(appId: string, notificationId: string, _options?: Configuration): Promise<CancelNotificationSuccessResponse> {
76
+ const result = this.api.cancelNotification(appId, notificationId, _options);
62
77
  return result.toPromise();
63
78
  }
64
79
 
@@ -77,72 +92,72 @@ export class PromiseDefaultApi {
77
92
  * Create notification
78
93
  * @param notification
79
94
  */
80
- public createNotification(notification: Notification, _options?: Configuration): Promise<InlineResponse200> {
95
+ public createNotification(notification: Notification, _options?: Configuration): Promise<CreateNotificationSuccessResponse> {
81
96
  const result = this.api.createNotification(notification, _options);
82
97
  return result.toPromise();
83
98
  }
84
99
 
85
100
  /**
86
- * Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
101
+ * Register a new device to one of your OneSignal apps &#x1F6A7; Don\'t use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won\'t work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
87
102
  * Add a device
88
103
  * @param player
89
104
  */
90
- public createPlayer(player: Player, _options?: Configuration): Promise<InlineResponse2004> {
105
+ public createPlayer(player: Player, _options?: Configuration): Promise<CreatePlayerSuccessResponse> {
91
106
  const result = this.api.createPlayer(player, _options);
92
107
  return result.toPromise();
93
108
  }
94
109
 
95
110
  /**
96
- * Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
111
+ * Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator\'s. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
97
112
  * Create Segments
98
- * @param app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
113
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
99
114
  * @param segment
100
115
  */
101
- public createSegments(app_id: string, segment?: Segment, _options?: Configuration): Promise<InlineResponse201> {
102
- const result = this.api.createSegments(app_id, segment, _options);
116
+ public createSegments(appId: string, segment?: Segment, _options?: Configuration): Promise<CreateSegmentSuccessResponse> {
117
+ const result = this.api.createSegments(appId, segment, _options);
103
118
  return result.toPromise();
104
119
  }
105
120
 
106
121
  /**
107
122
  * Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
108
123
  * Delete a user record
109
- * @param app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
110
- * @param player_id The OneSignal player_id
124
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
125
+ * @param playerId The OneSignal player_id
111
126
  */
112
- public deletePlayer(app_id: string, player_id: string, _options?: Configuration): Promise<InlineResponse2001> {
113
- const result = this.api.deletePlayer(app_id, player_id, _options);
127
+ public deletePlayer(appId: string, playerId: string, _options?: Configuration): Promise<DeletePlayerSuccessResponse> {
128
+ const result = this.api.deletePlayer(appId, playerId, _options);
114
129
  return result.toPromise();
115
130
  }
116
131
 
117
132
  /**
118
133
  * Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
119
134
  * Delete Segments
120
- * @param app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
121
- * @param segment_id The segment_id can be found in the URL of the segment when viewing it in the dashboard.
135
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
136
+ * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard.
122
137
  */
123
- public deleteSegments(app_id: string, segment_id: string, _options?: Configuration): Promise<InlineResponse2003> {
124
- const result = this.api.deleteSegments(app_id, segment_id, _options);
138
+ public deleteSegments(appId: string, segmentId: string, _options?: Configuration): Promise<DeleteSegmentSuccessResponse> {
139
+ const result = this.api.deleteSegments(appId, segmentId, _options);
125
140
  return result.toPromise();
126
141
  }
127
142
 
128
143
  /**
129
- * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
144
+ * Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. |
130
145
  * CSV export
131
- * @param app_id The app ID that you want to export devices from
132
- * @param export_players_request_body
146
+ * @param appId The app ID that you want to export devices from
147
+ * @param exportPlayersRequestBody
133
148
  */
134
- public exportPlayers(app_id: string, export_players_request_body?: ExportPlayersRequestBody, _options?: Configuration): Promise<InlineResponse2005> {
135
- const result = this.api.exportPlayers(app_id, export_players_request_body, _options);
149
+ public exportPlayers(appId: string, exportPlayersRequestBody?: ExportPlayersRequestBody, _options?: Configuration): Promise<ExportPlayersSuccessResponse> {
150
+ const result = this.api.exportPlayers(appId, exportPlayersRequestBody, _options);
136
151
  return result.toPromise();
137
152
  }
138
153
 
139
154
  /**
140
155
  * View the details of a single OneSignal app
141
156
  * View an app
142
- * @param app_id An app id
157
+ * @param appId An app id
143
158
  */
144
- public getApp(app_id: string, _options?: Configuration): Promise<App> {
145
- const result = this.api.getApp(app_id, _options);
159
+ public getApp(appId: string, _options?: Configuration): Promise<App> {
160
+ const result = this.api.getApp(appId, _options);
146
161
  return result.toPromise();
147
162
  }
148
163
 
@@ -150,7 +165,7 @@ export class PromiseDefaultApi {
150
165
  * View the details of all of your current OneSignal apps
151
166
  * View apps
152
167
  */
153
- public getApps(_options?: Configuration): Promise<string> {
168
+ public getApps(_options?: Configuration): Promise<Array<App>> {
154
169
  const result = this.api.getApps(_options);
155
170
  return result.toPromise();
156
171
  }
@@ -158,108 +173,108 @@ export class PromiseDefaultApi {
158
173
  /**
159
174
  * View the details of a single notification and outcomes associated with it
160
175
  * View notification
161
- * @param app_id
162
- * @param notification_id
176
+ * @param appId
177
+ * @param notificationId
163
178
  */
164
- public getNotification(app_id: string, notification_id: string, _options?: Configuration): Promise<Notification> {
165
- const result = this.api.getNotification(app_id, notification_id, _options);
179
+ public getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<NotificationWithMeta> {
180
+ const result = this.api.getNotification(appId, notificationId, _options);
166
181
  return result.toPromise();
167
182
  }
168
183
 
169
184
  /**
170
- * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs.
185
+ * -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App\'s REST API Key, available in Keys & IDs.
171
186
  * Notification History
172
- * @param notification_id The \&quot;id\&quot; of the message found in the Notification object
173
- * @param get_notification_request_body
187
+ * @param notificationId The \&quot;id\&quot; of the message found in the Notification object
188
+ * @param getNotificationRequestBody
174
189
  */
175
- public getNotificationHistory(notification_id: string, get_notification_request_body: GetNotificationRequestBody, _options?: Configuration): Promise<InlineResponse2002> {
176
- const result = this.api.getNotificationHistory(notification_id, get_notification_request_body, _options);
190
+ public getNotificationHistory(notificationId: string, getNotificationRequestBody: GetNotificationRequestBody, _options?: Configuration): Promise<NotificationHistorySuccessResponse> {
191
+ const result = this.api.getNotificationHistory(notificationId, getNotificationRequestBody, _options);
177
192
  return result.toPromise();
178
193
  }
179
194
 
180
195
  /**
181
196
  * View the details of multiple notifications
182
197
  * View notifications
183
- * @param app_id The app ID that you want to view notifications from
198
+ * @param appId The app ID that you want to view notifications from
184
199
  * @param limit How many notifications to return. Max is 50. Default is 50.
185
200
  * @param offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
186
201
  * @param kind Kind of notifications returned: * unset - All notification types (default) * &#x60;0&#x60; - Dashboard only * &#x60;1&#x60; - API only * &#x60;3&#x60; - Automated only
187
202
  */
188
- public getNotifications(app_id: string, limit?: string, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<NotificationSlice> {
189
- const result = this.api.getNotifications(app_id, limit, offset, kind, _options);
203
+ public getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<NotificationSlice> {
204
+ const result = this.api.getNotifications(appId, limit, offset, kind, _options);
190
205
  return result.toPromise();
191
206
  }
192
207
 
193
208
  /**
194
- * View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it.
209
+ * View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App\'s REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it.
195
210
  * View Outcomes
196
- * @param app_id The OneSignal App ID for your app. Available in Keys &amp; IDs.
197
- * @param outcome_names Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the os prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
198
- * @param outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where Sales, Purchase is the custom outcomes with a comma in the name.
199
- * @param outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.
200
- * @param outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
201
- * @param outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
211
+ * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
212
+ * @param outcomeNames Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \&quot;os\&quot; prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum
213
+ * @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name.
214
+ * @param outcomeTimeRange Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted.
215
+ * @param outcomePlatforms Optional Platform id. Refer device\&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
216
+ * @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
202
217
  */
203
- public getOutcomes(app_id: string, outcome_names: string, outcome_names2?: string, outcome_time_range?: string, outcome_platforms?: string, outcome_attribution?: string, _options?: Configuration): Promise<Array<OutcomeData>> {
204
- const result = this.api.getOutcomes(app_id, outcome_names, outcome_names2, outcome_time_range, outcome_platforms, outcome_attribution, _options);
218
+ public getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<OutcomesData> {
219
+ const result = this.api.getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _options);
205
220
  return result.toPromise();
206
221
  }
207
222
 
208
223
  /**
209
224
  * View the details of an existing device in one of your OneSignal apps
210
225
  * View device
211
- * @param app_id Your app_id for this device
212
- * @param player_id Player&#39;s OneSignal ID
213
- * @param email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
226
+ * @param appId Your app_id for this device
227
+ * @param playerId Player\&#39;s OneSignal ID
228
+ * @param emailAuthHash Email - Only required if you have enabled Identity Verification and device_type is email (11).
214
229
  */
215
- public getPlayer(app_id: string, player_id: string, email_auth_hash?: string, _options?: Configuration): Promise<Player> {
216
- const result = this.api.getPlayer(app_id, player_id, email_auth_hash, _options);
230
+ public getPlayer(appId: string, playerId: string, emailAuthHash?: string, _options?: Configuration): Promise<Player> {
231
+ const result = this.api.getPlayer(appId, playerId, emailAuthHash, _options);
217
232
  return result.toPromise();
218
233
  }
219
234
 
220
235
  /**
221
236
  * View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant.
222
237
  * View devices
223
- * @param app_id The app ID that you want to view players from
238
+ * @param appId The app ID that you want to view players from
224
239
  * @param limit How many devices to return. Max is 300. Default is 300
225
240
  * @param offset Result offset. Default is 0. Results are sorted by id;
226
241
  */
227
- public getPlayers(app_id: string, limit?: string, offset?: number, _options?: Configuration): Promise<PlayerSlice> {
228
- const result = this.api.getPlayers(app_id, limit, offset, _options);
242
+ public getPlayers(appId: string, limit?: number, offset?: number, _options?: Configuration): Promise<PlayerSlice> {
243
+ const result = this.api.getPlayers(appId, limit, offset, _options);
229
244
  return result.toPromise();
230
245
  }
231
246
 
232
247
  /**
233
248
  * Updates the name or configuration settings of an existing OneSignal app
234
249
  * Update an app
235
- * @param app_id An app id
250
+ * @param appId An app id
236
251
  * @param app
237
252
  */
238
- public updateApp(app_id: string, app: App, _options?: Configuration): Promise<App> {
239
- const result = this.api.updateApp(app_id, app, _options);
253
+ public updateApp(appId: string, app: App, _options?: Configuration): Promise<App> {
254
+ const result = this.api.updateApp(appId, app, _options);
240
255
  return result.toPromise();
241
256
  }
242
257
 
243
258
  /**
244
259
  * Update an existing device in one of your OneSignal apps
245
260
  * Edit device
246
- * @param player_id Player&#39;s OneSignal ID
261
+ * @param playerId Player\&#39;s OneSignal ID
247
262
  * @param player
248
263
  */
249
- public updatePlayer(player_id: string, player: Player, _options?: Configuration): Promise<InlineResponse2001> {
250
- const result = this.api.updatePlayer(player_id, player, _options);
264
+ public updatePlayer(playerId: string, player: Player, _options?: Configuration): Promise<UpdatePlayerSuccessResponse> {
265
+ const result = this.api.updatePlayer(playerId, player, _options);
251
266
  return result.toPromise();
252
267
  }
253
268
 
254
269
  /**
255
- * Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
270
+ * Update an existing device\'s tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device\'s tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
256
271
  * Edit tags with external user id
257
- * @param app_id The OneSignal App ID the user record is found under.
258
- * @param external_user_id The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
259
- * @param update_player_tags_request_body
272
+ * @param appId The OneSignal App ID the user record is found under.
273
+ * @param externalUserId The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
274
+ * @param updatePlayerTagsRequestBody
260
275
  */
261
- public updatePlayerTags(app_id: string, external_user_id: string, update_player_tags_request_body?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<InlineResponse2003> {
262
- const result = this.api.updatePlayerTags(app_id, external_user_id, update_player_tags_request_body, _options);
276
+ public updatePlayerTags(appId: string, externalUserId: string, updatePlayerTagsRequestBody?: UpdatePlayerTagsRequestBody, _options?: Configuration): Promise<UpdatePlayerTagsSuccessResponse> {
277
+ const result = this.api.updatePlayerTags(appId, externalUserId, updatePlayerTagsRequestBody, _options);
263
278
  return result.toPromise();
264
279
  }
265
280
 
package/util.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Returns if a specific http code is in a given code range
3
- * where the code range is defined as a combination of digits
3
+ * where the code range is defined as a combination of digits
4
4
  * and "X" (the letter X) with a length of 3
5
5
  *
6
6
  * @param codeRange string with length 3 consisting of digits and "X" (the letter X)
@@ -26,3 +26,12 @@ export function isCodeInRange(codeRange: string, code: number): boolean {
26
26
  return true;
27
27
  }
28
28
  }
29
+
30
+ /**
31
+ * Returns if it can consume form
32
+ *
33
+ * @param consumes array
34
+ */
35
+ export function canConsumeForm(contentTypes: string[]): boolean {
36
+ return contentTypes.indexOf('multipart/form-data') !== -1
37
+ }
package/git_push.sh DELETED
@@ -1,52 +0,0 @@
1
- #!/bin/sh
2
- # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
- #
4
- # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
5
-
6
- git_user_id=$1
7
- git_repo_id=$2
8
- release_note=$3
9
-
10
- if [ "$git_user_id" = "" ]; then
11
- git_user_id="GIT_USER_ID"
12
- echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
13
- fi
14
-
15
- if [ "$git_repo_id" = "" ]; then
16
- git_repo_id="GIT_REPO_ID"
17
- echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
18
- fi
19
-
20
- if [ "$release_note" = "" ]; then
21
- release_note="Minor update"
22
- echo "[INFO] No command line input provided. Set \$release_note to $release_note"
23
- fi
24
-
25
- # Initialize the local directory as a Git repository
26
- git init
27
-
28
- # Adds the files in the local repository and stages them for commit.
29
- git add .
30
-
31
- # Commits the tracked changes and prepares them to be pushed to a remote repository.
32
- git commit -m "$release_note"
33
-
34
- # Sets the new remote
35
- git_remote=`git remote`
36
- if [ "$git_remote" = "" ]; then # git remote not defined
37
-
38
- if [ "$GIT_TOKEN" = "" ]; then
39
- echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
40
- git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
41
- else
42
- git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
43
- fi
44
-
45
- fi
46
-
47
- git pull origin master
48
-
49
- # Pushes (Forces) the changes in the local repository up to the remote repository
50
- echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
51
- git push origin master 2>&1 | grep -v 'To https'
52
-