@onesignal/node-onesignal 5.2.1-beta1 → 5.3.1-beta1

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 (198) hide show
  1. package/dist/apis/DefaultApi.d.ts +40 -0
  2. package/dist/apis/DefaultApi.js +1363 -100
  3. package/dist/models/ApiKeyToken.d.ts +23 -0
  4. package/dist/models/ApiKeyToken.js +52 -0
  5. package/dist/models/ApiKeyTokensListResponse.d.ts +18 -0
  6. package/dist/models/ApiKeyTokensListResponse.js +22 -0
  7. package/dist/models/CopyTemplateRequest.d.ts +17 -0
  8. package/dist/models/CopyTemplateRequest.js +22 -0
  9. package/dist/models/CreateApiKeyRequest.d.ts +20 -0
  10. package/dist/models/CreateApiKeyRequest.js +34 -0
  11. package/dist/models/CreateApiKeyResponse.d.ts +18 -0
  12. package/dist/models/CreateApiKeyResponse.js +28 -0
  13. package/dist/models/CreateTemplateRequest.d.ts +25 -0
  14. package/dist/models/CreateTemplateRequest.js +64 -0
  15. package/dist/models/CustomEvent.d.ts +23 -0
  16. package/dist/models/CustomEvent.js +46 -0
  17. package/dist/models/CustomEventsRequest.d.ts +18 -0
  18. package/dist/models/CustomEventsRequest.js +22 -0
  19. package/dist/models/NotificationWithMeta.d.ts +1 -0
  20. package/dist/models/NotificationWithMeta.js +6 -0
  21. package/dist/models/NotificationWithMetaAllOf.d.ts +1 -0
  22. package/dist/models/NotificationWithMetaAllOf.js +6 -0
  23. package/dist/models/ObjectSerializer.d.ts +14 -0
  24. package/dist/models/ObjectSerializer.js +47 -0
  25. package/dist/models/StartLiveActivityRequest.d.ts +37 -0
  26. package/dist/models/StartLiveActivityRequest.js +112 -0
  27. package/dist/models/StartLiveActivitySuccessResponse.d.ts +17 -0
  28. package/dist/models/StartLiveActivitySuccessResponse.js +22 -0
  29. package/dist/models/TemplateResource.d.ts +25 -0
  30. package/dist/models/TemplateResource.js +52 -0
  31. package/dist/models/TemplatesListResponse.d.ts +18 -0
  32. package/dist/models/TemplatesListResponse.js +22 -0
  33. package/dist/models/UpdateApiKeyRequest.d.ts +20 -0
  34. package/dist/models/UpdateApiKeyRequest.js +34 -0
  35. package/dist/models/UpdateTemplateRequest.d.ts +24 -0
  36. package/dist/models/UpdateTemplateRequest.js +58 -0
  37. package/dist/models/all.d.ts +14 -0
  38. package/dist/models/all.js +14 -0
  39. package/dist/types/ObjectParamAPI.d.ts +88 -0
  40. package/dist/types/ObjectParamAPI.js +42 -0
  41. package/dist/types/ObservableAPI.d.ts +26 -0
  42. package/dist/types/ObservableAPI.js +422 -86
  43. package/dist/types/PromiseAPI.d.ts +26 -0
  44. package/dist/types/PromiseAPI.js +56 -0
  45. package/package.json +9 -3
  46. package/.github/ISSUE_TEMPLATE/ask-question.yml +0 -25
  47. package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -51
  48. package/.github/ISSUE_TEMPLATE/general-feedback.yml +0 -25
  49. package/.github/pull_request_template.md +0 -44
  50. package/.github/workflows/asana-add-comment.yml +0 -47
  51. package/.github/workflows/asana-create-task.yml +0 -119
  52. package/.github/workflows/asana-update-issue.yml +0 -172
  53. package/.github/workflows/npm_deploy.yml +0 -22
  54. package/.github/workflows/project.yml +0 -17
  55. package/CHANGELOG.md +0 -48
  56. package/DefaultApi.md +0 -2177
  57. package/RELEASE_INSTRUCTIONS.md +0 -2
  58. package/apis/DefaultApi.ts +0 -3270
  59. package/apis/baseapi.ts +0 -37
  60. package/apis/exception.ts +0 -15
  61. package/auth/auth.ts +0 -110
  62. package/configuration.ts +0 -85
  63. package/dist/apis/DefaultApi.js.map +0 -1
  64. package/dist/apis/baseapi.js.map +0 -1
  65. package/dist/apis/exception.js.map +0 -1
  66. package/dist/auth/auth.js.map +0 -1
  67. package/dist/configuration.js.map +0 -1
  68. package/dist/http/http.js.map +0 -1
  69. package/dist/http/isomorphic-fetch.js.map +0 -1
  70. package/dist/index.js.map +0 -1
  71. package/dist/middleware.js.map +0 -1
  72. package/dist/models/App.js.map +0 -1
  73. package/dist/models/BasicNotification.js.map +0 -1
  74. package/dist/models/BasicNotificationAllOf.js.map +0 -1
  75. package/dist/models/BasicNotificationAllOfAndroidBackgroundLayout.js.map +0 -1
  76. package/dist/models/Button.js.map +0 -1
  77. package/dist/models/CreateNotificationSuccessResponse.js.map +0 -1
  78. package/dist/models/CreateSegmentConflictResponse.js.map +0 -1
  79. package/dist/models/CreateSegmentSuccessResponse.js.map +0 -1
  80. package/dist/models/CreateUserConflictResponse.js.map +0 -1
  81. package/dist/models/CreateUserConflictResponseErrorsInner.js.map +0 -1
  82. package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js.map +0 -1
  83. package/dist/models/DeliveryData.js.map +0 -1
  84. package/dist/models/ExportEventsSuccessResponse.js.map +0 -1
  85. package/dist/models/ExportSubscriptionsRequestBody.js.map +0 -1
  86. package/dist/models/ExportSubscriptionsSuccessResponse.js.map +0 -1
  87. package/dist/models/Filter.js.map +0 -1
  88. package/dist/models/FilterExpression.js.map +0 -1
  89. package/dist/models/GenericError.js.map +0 -1
  90. package/dist/models/GenericSuccessBoolResponse.js.map +0 -1
  91. package/dist/models/GetNotificationHistoryRequestBody.js.map +0 -1
  92. package/dist/models/GetSegmentsSuccessResponse.js.map +0 -1
  93. package/dist/models/LanguageStringMap.js.map +0 -1
  94. package/dist/models/Notification.js.map +0 -1
  95. package/dist/models/NotificationAllOf.js.map +0 -1
  96. package/dist/models/NotificationHistorySuccessResponse.js.map +0 -1
  97. package/dist/models/NotificationSlice.js.map +0 -1
  98. package/dist/models/NotificationTarget.js.map +0 -1
  99. package/dist/models/NotificationWithMeta.js.map +0 -1
  100. package/dist/models/NotificationWithMetaAllOf.js.map +0 -1
  101. package/dist/models/ObjectSerializer.js.map +0 -1
  102. package/dist/models/Operator.js.map +0 -1
  103. package/dist/models/OutcomeData.js.map +0 -1
  104. package/dist/models/OutcomesData.js.map +0 -1
  105. package/dist/models/PlatformDeliveryData.js.map +0 -1
  106. package/dist/models/PlatformDeliveryDataEmailAllOf.js.map +0 -1
  107. package/dist/models/PlatformDeliveryDataSmsAllOf.js.map +0 -1
  108. package/dist/models/PropertiesBody.js.map +0 -1
  109. package/dist/models/PropertiesDeltas.js.map +0 -1
  110. package/dist/models/PropertiesObject.js.map +0 -1
  111. package/dist/models/Purchase.js.map +0 -1
  112. package/dist/models/RateLimitError.js.map +0 -1
  113. package/dist/models/Segment.js.map +0 -1
  114. package/dist/models/SegmentData.js.map +0 -1
  115. package/dist/models/SegmentNotificationTarget.js.map +0 -1
  116. package/dist/models/Subscription.js.map +0 -1
  117. package/dist/models/SubscriptionBody.js.map +0 -1
  118. package/dist/models/SubscriptionNotificationTarget.js.map +0 -1
  119. package/dist/models/TransferSubscriptionRequestBody.js.map +0 -1
  120. package/dist/models/UpdateLiveActivityRequest.js.map +0 -1
  121. package/dist/models/UpdateLiveActivitySuccessResponse.js.map +0 -1
  122. package/dist/models/UpdateUserRequest.js.map +0 -1
  123. package/dist/models/User.js.map +0 -1
  124. package/dist/models/UserIdentityBody.js.map +0 -1
  125. package/dist/models/WebButton.js.map +0 -1
  126. package/dist/models/all.js.map +0 -1
  127. package/dist/rxjsStub.js.map +0 -1
  128. package/dist/servers.js.map +0 -1
  129. package/dist/types/ObjectParamAPI.js.map +0 -1
  130. package/dist/types/ObservableAPI.js.map +0 -1
  131. package/dist/types/PromiseAPI.js.map +0 -1
  132. package/dist/util.js.map +0 -1
  133. package/http/http.ts +0 -205
  134. package/http/isomorphic-fetch.ts +0 -30
  135. package/index.ts +0 -12
  136. package/middleware.ts +0 -66
  137. package/models/App.ts +0 -328
  138. package/models/BasicNotification.ts +0 -1088
  139. package/models/BasicNotificationAllOf.ts +0 -958
  140. package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +0 -57
  141. package/models/Button.ts +0 -45
  142. package/models/CreateNotificationSuccessResponse.ts +0 -48
  143. package/models/CreateSegmentConflictResponse.ts +0 -38
  144. package/models/CreateSegmentSuccessResponse.ts +0 -41
  145. package/models/CreateUserConflictResponse.ts +0 -32
  146. package/models/CreateUserConflictResponseErrorsInner.ts +0 -46
  147. package/models/CreateUserConflictResponseErrorsItemsMeta.ts +0 -31
  148. package/models/DeliveryData.ts +0 -74
  149. package/models/ExportEventsSuccessResponse.ts +0 -31
  150. package/models/ExportSubscriptionsRequestBody.ts +0 -54
  151. package/models/ExportSubscriptionsSuccessResponse.ts +0 -31
  152. package/models/Filter.ts +0 -107
  153. package/models/FilterExpression.ts +0 -120
  154. package/models/GenericError.ts +0 -45
  155. package/models/GenericSuccessBoolResponse.ts +0 -31
  156. package/models/GetNotificationHistoryRequestBody.ts +0 -54
  157. package/models/GetSegmentsSuccessResponse.ts +0 -65
  158. package/models/LanguageStringMap.ts +0 -454
  159. package/models/Notification.ts +0 -1098
  160. package/models/NotificationAllOf.ts +0 -34
  161. package/models/NotificationHistorySuccessResponse.ts +0 -38
  162. package/models/NotificationSlice.ts +0 -53
  163. package/models/NotificationTarget.ts +0 -156
  164. package/models/NotificationWithMeta.ts +0 -1196
  165. package/models/NotificationWithMetaAllOf.ts +0 -132
  166. package/models/ObjectSerializer.ts +0 -395
  167. package/models/Operator.ts +0 -37
  168. package/models/OutcomeData.ts +0 -48
  169. package/models/OutcomesData.ts +0 -32
  170. package/models/PlatformDeliveryData.ts +0 -86
  171. package/models/PlatformDeliveryDataEmailAllOf.ts +0 -94
  172. package/models/PlatformDeliveryDataSmsAllOf.ts +0 -54
  173. package/models/PropertiesBody.ts +0 -32
  174. package/models/PropertiesDeltas.ts +0 -46
  175. package/models/PropertiesObject.ts +0 -102
  176. package/models/Purchase.ts +0 -61
  177. package/models/RateLimitError.ts +0 -38
  178. package/models/Segment.ts +0 -55
  179. package/models/SegmentData.ts +0 -94
  180. package/models/SegmentNotificationTarget.ts +0 -44
  181. package/models/Subscription.ts +0 -146
  182. package/models/SubscriptionBody.ts +0 -32
  183. package/models/SubscriptionNotificationTarget.ts +0 -134
  184. package/models/TransferSubscriptionRequestBody.ts +0 -31
  185. package/models/UpdateLiveActivityRequest.ts +0 -109
  186. package/models/UpdateLiveActivitySuccessResponse.ts +0 -31
  187. package/models/UpdateUserRequest.ts +0 -47
  188. package/models/User.ts +0 -47
  189. package/models/UserIdentityBody.ts +0 -31
  190. package/models/WebButton.ts +0 -52
  191. package/models/all.ts +0 -53
  192. package/rxjsStub.ts +0 -27
  193. package/servers.ts +0 -53
  194. package/tsconfig.json +0 -28
  195. package/types/ObjectParamAPI.ts +0 -884
  196. package/types/ObservableAPI.ts +0 -831
  197. package/types/PromiseAPI.ts +0 -411
  198. package/util.ts +0 -37
@@ -1,411 +0,0 @@
1
- import { ResponseContext, RequestContext, HttpFile } from '../http/http';
2
- import * as models from '../models/all';
3
- import { Configuration} from '../configuration'
4
-
5
- import { App } from '../models/App';
6
- import { BasicNotification } from '../models/BasicNotification';
7
- import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf';
8
- import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout';
9
- import { Button } from '../models/Button';
10
- import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
11
- import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
12
- import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
13
- import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse';
14
- import { CreateUserConflictResponseErrorsInner } from '../models/CreateUserConflictResponseErrorsInner';
15
- import { CreateUserConflictResponseErrorsItemsMeta } from '../models/CreateUserConflictResponseErrorsItemsMeta';
16
- import { DeliveryData } from '../models/DeliveryData';
17
- import { ExportEventsSuccessResponse } from '../models/ExportEventsSuccessResponse';
18
- import { ExportSubscriptionsRequestBody } from '../models/ExportSubscriptionsRequestBody';
19
- import { ExportSubscriptionsSuccessResponse } from '../models/ExportSubscriptionsSuccessResponse';
20
- import { Filter } from '../models/Filter';
21
- import { FilterExpression } from '../models/FilterExpression';
22
- import { GenericError } from '../models/GenericError';
23
- import { GenericSuccessBoolResponse } from '../models/GenericSuccessBoolResponse';
24
- import { GetNotificationHistoryRequestBody } from '../models/GetNotificationHistoryRequestBody';
25
- import { GetSegmentsSuccessResponse } from '../models/GetSegmentsSuccessResponse';
26
- import { LanguageStringMap } from '../models/LanguageStringMap';
27
- import { Notification } from '../models/Notification';
28
- import { NotificationAllOf } from '../models/NotificationAllOf';
29
- import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
30
- import { NotificationSlice } from '../models/NotificationSlice';
31
- import { NotificationTarget } from '../models/NotificationTarget';
32
- import { NotificationWithMeta } from '../models/NotificationWithMeta';
33
- import { NotificationWithMetaAllOf } from '../models/NotificationWithMetaAllOf';
34
- import { Operator } from '../models/Operator';
35
- import { OutcomeData } from '../models/OutcomeData';
36
- import { OutcomesData } from '../models/OutcomesData';
37
- import { PlatformDeliveryData } from '../models/PlatformDeliveryData';
38
- import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEmailAllOf';
39
- import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf';
40
- import { PropertiesBody } from '../models/PropertiesBody';
41
- import { PropertiesDeltas } from '../models/PropertiesDeltas';
42
- import { PropertiesObject } from '../models/PropertiesObject';
43
- import { Purchase } from '../models/Purchase';
44
- import { RateLimitError } from '../models/RateLimitError';
45
- import { Segment } from '../models/Segment';
46
- import { SegmentData } from '../models/SegmentData';
47
- import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget';
48
- import { Subscription } from '../models/Subscription';
49
- import { SubscriptionBody } from '../models/SubscriptionBody';
50
- import { SubscriptionNotificationTarget } from '../models/SubscriptionNotificationTarget';
51
- import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody';
52
- import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest';
53
- import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse';
54
- import { UpdateUserRequest } from '../models/UpdateUserRequest';
55
- import { User } from '../models/User';
56
- import { UserIdentityBody } from '../models/UserIdentityBody';
57
- import { WebButton } from '../models/WebButton';
58
- import { ObservableDefaultApi } from './ObservableAPI';
59
-
60
- import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi";
61
- export class PromiseDefaultApi {
62
- private api: ObservableDefaultApi
63
-
64
- public constructor(
65
- configuration: Configuration,
66
- requestFactory?: DefaultApiRequestFactory,
67
- responseProcessor?: DefaultApiResponseProcessor
68
- ) {
69
- this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor);
70
- }
71
-
72
- /**
73
- * Used to stop a scheduled or currently outgoing notification
74
- * Stop a scheduled or currently outgoing notification
75
- * @param appId
76
- * @param notificationId
77
- */
78
- public cancelNotification(appId: string, notificationId: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
79
- const result = this.api.cancelNotification(appId, notificationId, _options);
80
- return result.toPromise();
81
- }
82
-
83
- /**
84
- * Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
85
- * @param appId
86
- * @param aliasLabel
87
- * @param aliasId
88
- * @param userIdentityBody
89
- */
90
- public createAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityBody: UserIdentityBody, _options?: Configuration): Promise<UserIdentityBody> {
91
- const result = this.api.createAlias(appId, aliasLabel, aliasId, userIdentityBody, _options);
92
- return result.toPromise();
93
- }
94
-
95
- /**
96
- * Upserts one or more Aliases for the User identified by :subscription_id.
97
- * @param appId
98
- * @param subscriptionId
99
- * @param userIdentityBody
100
- */
101
- public createAliasBySubscription(appId: string, subscriptionId: string, userIdentityBody: UserIdentityBody, _options?: Configuration): Promise<UserIdentityBody> {
102
- const result = this.api.createAliasBySubscription(appId, subscriptionId, userIdentityBody, _options);
103
- return result.toPromise();
104
- }
105
-
106
- /**
107
- * Creates a new OneSignal app
108
- * Create an app
109
- * @param app
110
- */
111
- public createApp(app: App, _options?: Configuration): Promise<App> {
112
- const result = this.api.createApp(app, _options);
113
- return result.toPromise();
114
- }
115
-
116
- /**
117
- * Sends notifications to your users
118
- * Create notification
119
- * @param notification
120
- */
121
- public createNotification(notification: Notification, _options?: Configuration): Promise<CreateNotificationSuccessResponse> {
122
- const result = this.api.createNotification(notification, _options);
123
- return result.toPromise();
124
- }
125
-
126
- /**
127
- * Create a segment 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 Segment endpoint and re-create it with this endpoint to edit.
128
- * Create Segment
129
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
130
- * @param segment
131
- */
132
- public createSegment(appId: string, segment?: Segment, _options?: Configuration): Promise<CreateSegmentSuccessResponse> {
133
- const result = this.api.createSegment(appId, segment, _options);
134
- return result.toPromise();
135
- }
136
-
137
- /**
138
- * Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
139
- * @param appId
140
- * @param aliasLabel
141
- * @param aliasId
142
- * @param subscriptionBody
143
- */
144
- public createSubscription(appId: string, aliasLabel: string, aliasId: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<SubscriptionBody> {
145
- const result = this.api.createSubscription(appId, aliasLabel, aliasId, subscriptionBody, _options);
146
- return result.toPromise();
147
- }
148
-
149
- /**
150
- * Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User.
151
- * @param appId
152
- * @param user
153
- */
154
- public createUser(appId: string, user: User, _options?: Configuration): Promise<User> {
155
- const result = this.api.createUser(appId, user, _options);
156
- return result.toPromise();
157
- }
158
-
159
- /**
160
- * Deletes an alias by alias label
161
- * @param appId
162
- * @param aliasLabel
163
- * @param aliasId
164
- * @param aliasLabelToDelete
165
- */
166
- public deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: string, _options?: Configuration): Promise<UserIdentityBody> {
167
- const result = this.api.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete, _options);
168
- return result.toPromise();
169
- }
170
-
171
- /**
172
- * Delete a segment (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.
173
- * Delete Segment
174
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
175
- * @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard.
176
- */
177
- public deleteSegment(appId: string, segmentId: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
178
- const result = this.api.deleteSegment(appId, segmentId, _options);
179
- return result.toPromise();
180
- }
181
-
182
- /**
183
- * Deletes the Subscription.
184
- * @param appId
185
- * @param subscriptionId
186
- */
187
- public deleteSubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise<void> {
188
- const result = this.api.deleteSubscription(appId, subscriptionId, _options);
189
- return result.toPromise();
190
- }
191
-
192
- /**
193
- * Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
194
- * @param appId
195
- * @param aliasLabel
196
- * @param aliasId
197
- */
198
- public deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<void> {
199
- const result = this.api.deleteUser(appId, aliasLabel, aliasId, _options);
200
- return result.toPromise();
201
- }
202
-
203
- /**
204
- * Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
205
- * Export CSV of Events
206
- * @param notificationId The ID of the notification to export events from.
207
- * @param appId The ID of the app that the notification belongs to.
208
- */
209
- public exportEvents(notificationId: string, appId: string, _options?: Configuration): Promise<ExportEventsSuccessResponse> {
210
- const result = this.api.exportEvents(notificationId, appId, _options);
211
- return result.toPromise();
212
- }
213
-
214
- /**
215
- * 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. |
216
- * Export CSV of Subscriptions
217
- * @param appId The app ID that you want to export devices from
218
- * @param exportSubscriptionsRequestBody
219
- */
220
- public exportSubscriptions(appId: string, exportSubscriptionsRequestBody?: ExportSubscriptionsRequestBody, _options?: Configuration): Promise<ExportSubscriptionsSuccessResponse> {
221
- const result = this.api.exportSubscriptions(appId, exportSubscriptionsRequestBody, _options);
222
- return result.toPromise();
223
- }
224
-
225
- /**
226
- * Lists all Aliases for the User identified by (:alias_label, :alias_id).
227
- * @param appId
228
- * @param aliasLabel
229
- * @param aliasId
230
- */
231
- public getAliases(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<UserIdentityBody> {
232
- const result = this.api.getAliases(appId, aliasLabel, aliasId, _options);
233
- return result.toPromise();
234
- }
235
-
236
- /**
237
- * Lists all Aliases for the User identified by :subscription_id.
238
- * @param appId
239
- * @param subscriptionId
240
- */
241
- public getAliasesBySubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise<UserIdentityBody> {
242
- const result = this.api.getAliasesBySubscription(appId, subscriptionId, _options);
243
- return result.toPromise();
244
- }
245
-
246
- /**
247
- * View the details of a single OneSignal app
248
- * View an app
249
- * @param appId An app id
250
- */
251
- public getApp(appId: string, _options?: Configuration): Promise<App> {
252
- const result = this.api.getApp(appId, _options);
253
- return result.toPromise();
254
- }
255
-
256
- /**
257
- * View the details of all of your current OneSignal apps
258
- * View apps
259
- */
260
- public getApps(_options?: Configuration): Promise<Array<App>> {
261
- const result = this.api.getApps(_options);
262
- return result.toPromise();
263
- }
264
-
265
- /**
266
- * View the details of a single notification and outcomes associated with it
267
- * View notification
268
- * @param appId
269
- * @param notificationId
270
- */
271
- public getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<NotificationWithMeta> {
272
- const result = this.api.getNotification(appId, notificationId, _options);
273
- return result.toPromise();
274
- }
275
-
276
- /**
277
- * -> 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.
278
- * Notification History
279
- * @param notificationId The \&quot;id\&quot; of the message found in the Notification object
280
- * @param getNotificationHistoryRequestBody
281
- */
282
- public getNotificationHistory(notificationId: string, getNotificationHistoryRequestBody: GetNotificationHistoryRequestBody, _options?: Configuration): Promise<NotificationHistorySuccessResponse> {
283
- const result = this.api.getNotificationHistory(notificationId, getNotificationHistoryRequestBody, _options);
284
- return result.toPromise();
285
- }
286
-
287
- /**
288
- * View the details of multiple notifications
289
- * View notifications
290
- * @param appId The app ID that you want to view notifications from
291
- * @param limit How many notifications to return. Max is 50. Default is 50.
292
- * @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.
293
- * @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
294
- */
295
- public getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<NotificationSlice> {
296
- const result = this.api.getNotifications(appId, limit, offset, kind, _options);
297
- return result.toPromise();
298
- }
299
-
300
- /**
301
- * 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.
302
- * View Outcomes
303
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
304
- * @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
305
- * @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.
306
- * @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.
307
- * @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.
308
- * @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.
309
- */
310
- public getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<OutcomesData> {
311
- const result = this.api.getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _options);
312
- return result.toPromise();
313
- }
314
-
315
- /**
316
- * Returns an array of segments from an app.
317
- * Get Segments
318
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
319
- * @param offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.
320
- * @param limit The amount of Segments in the response. Maximum 300.
321
- */
322
- public getSegments(appId: string, offset?: number, limit?: number, _options?: Configuration): Promise<GetSegmentsSuccessResponse> {
323
- const result = this.api.getSegments(appId, offset, limit, _options);
324
- return result.toPromise();
325
- }
326
-
327
- /**
328
- * Returns the User’s properties, Aliases, and Subscriptions.
329
- * @param appId
330
- * @param aliasLabel
331
- * @param aliasId
332
- */
333
- public getUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<User> {
334
- const result = this.api.getUser(appId, aliasLabel, aliasId, _options);
335
- return result.toPromise();
336
- }
337
-
338
- /**
339
- * Transfers this Subscription to the User identified by the identity in the payload.
340
- * @param appId
341
- * @param subscriptionId
342
- * @param transferSubscriptionRequestBody
343
- */
344
- public transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _options?: Configuration): Promise<UserIdentityBody> {
345
- const result = this.api.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody, _options);
346
- return result.toPromise();
347
- }
348
-
349
- /**
350
- * Unsubscribe an email with a token when using your own custom email unsubscribe landing page
351
- * Unsubscribe with token
352
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
353
- * @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
354
- * @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
355
- */
356
- public unsubscribeEmailWithToken(appId: string, notificationId: string, token: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
357
- const result = this.api.unsubscribeEmailWithToken(appId, notificationId, token, _options);
358
- return result.toPromise();
359
- }
360
-
361
- /**
362
- * Updates the name or configuration settings of an existing OneSignal app
363
- * Update an app
364
- * @param appId An app id
365
- * @param app
366
- */
367
- public updateApp(appId: string, app: App, _options?: Configuration): Promise<App> {
368
- const result = this.api.updateApp(appId, app, _options);
369
- return result.toPromise();
370
- }
371
-
372
- /**
373
- * Updates a specified live activity.
374
- * Update a Live Activity via Push
375
- * @param appId The OneSignal App ID for your app. Available in Keys &amp; IDs.
376
- * @param activityId Live Activity record ID
377
- * @param updateLiveActivityRequest
378
- */
379
- public updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise<UpdateLiveActivitySuccessResponse> {
380
- const result = this.api.updateLiveActivity(appId, activityId, updateLiveActivityRequest, _options);
381
- return result.toPromise();
382
- }
383
-
384
- /**
385
- * Updates an existing Subscription’s properties.
386
- * @param appId
387
- * @param subscriptionId
388
- * @param subscriptionBody
389
- */
390
- public updateSubscription(appId: string, subscriptionId: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<void> {
391
- const result = this.api.updateSubscription(appId, subscriptionId, subscriptionBody, _options);
392
- return result.toPromise();
393
- }
394
-
395
- /**
396
- * Updates an existing User’s properties.
397
- * @param appId
398
- * @param aliasLabel
399
- * @param aliasId
400
- * @param updateUserRequest
401
- */
402
- public updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, _options?: Configuration): Promise<PropertiesBody> {
403
- const result = this.api.updateUser(appId, aliasLabel, aliasId, updateUserRequest, _options);
404
- return result.toPromise();
405
- }
406
-
407
-
408
- }
409
-
410
-
411
-
package/util.ts DELETED
@@ -1,37 +0,0 @@
1
- /**
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
4
- * and "X" (the letter X) with a length of 3
5
- *
6
- * @param codeRange string with length 3 consisting of digits and "X" (the letter X)
7
- * @param code the http status code to be checked against the code range
8
- */
9
- export function isCodeInRange(codeRange: string, code: number): boolean {
10
- // This is how the default value is encoded in OAG
11
- if (codeRange === "0") {
12
- return true;
13
- }
14
- if (codeRange == code.toString()) {
15
- return true;
16
- } else {
17
- const codeString = code.toString();
18
- if (codeString.length != codeRange.length) {
19
- return false;
20
- }
21
- for (let i = 0; i < codeString.length; i++) {
22
- if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
23
- return false;
24
- }
25
- }
26
- return true;
27
- }
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
- }