@onesignal/node-onesignal 5.3.0-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.
- package/dist/apis/DefaultApi.js +44 -44
- package/package.json +9 -3
- package/.github/ISSUE_TEMPLATE/ask-question.yml +0 -25
- package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -51
- package/.github/ISSUE_TEMPLATE/general-feedback.yml +0 -25
- package/.github/pull_request_template.md +0 -44
- package/.github/workflows/asana-add-comment.yml +0 -47
- package/.github/workflows/asana-create-task.yml +0 -119
- package/.github/workflows/asana-update-issue.yml +0 -172
- package/.github/workflows/npm_deploy.yml +0 -22
- package/.github/workflows/project.yml +0 -17
- package/CHANGELOG.md +0 -48
- package/DefaultApi.md +0 -3293
- package/RELEASE_INSTRUCTIONS.md +0 -2
- package/apis/DefaultApi.ts +0 -4673
- package/apis/baseapi.ts +0 -37
- package/apis/exception.ts +0 -15
- package/auth/auth.ts +0 -110
- package/configuration.ts +0 -85
- package/dist/apis/DefaultApi.js.map +0 -1
- package/dist/apis/baseapi.js.map +0 -1
- package/dist/apis/exception.js.map +0 -1
- package/dist/auth/auth.js.map +0 -1
- package/dist/configuration.js.map +0 -1
- package/dist/http/http.js.map +0 -1
- package/dist/http/isomorphic-fetch.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/middleware.js.map +0 -1
- package/dist/models/ApiKeyToken.js.map +0 -1
- package/dist/models/ApiKeyTokensListResponse.js.map +0 -1
- package/dist/models/App.js.map +0 -1
- package/dist/models/BasicNotification.js.map +0 -1
- package/dist/models/BasicNotificationAllOf.js.map +0 -1
- package/dist/models/BasicNotificationAllOfAndroidBackgroundLayout.js.map +0 -1
- package/dist/models/Button.js.map +0 -1
- package/dist/models/CopyTemplateRequest.js.map +0 -1
- package/dist/models/CreateApiKeyRequest.js.map +0 -1
- package/dist/models/CreateApiKeyResponse.js.map +0 -1
- package/dist/models/CreateNotificationSuccessResponse.js.map +0 -1
- package/dist/models/CreateSegmentConflictResponse.js.map +0 -1
- package/dist/models/CreateSegmentSuccessResponse.js.map +0 -1
- package/dist/models/CreateTemplateRequest.js.map +0 -1
- package/dist/models/CreateUserConflictResponse.js.map +0 -1
- package/dist/models/CreateUserConflictResponseErrorsInner.js.map +0 -1
- package/dist/models/CreateUserConflictResponseErrorsItemsMeta.js.map +0 -1
- package/dist/models/CustomEvent.js.map +0 -1
- package/dist/models/CustomEventsRequest.js.map +0 -1
- package/dist/models/DeliveryData.js.map +0 -1
- package/dist/models/ExportEventsSuccessResponse.js.map +0 -1
- package/dist/models/ExportSubscriptionsRequestBody.js.map +0 -1
- package/dist/models/ExportSubscriptionsSuccessResponse.js.map +0 -1
- package/dist/models/Filter.js.map +0 -1
- package/dist/models/FilterExpression.js.map +0 -1
- package/dist/models/GenericError.js.map +0 -1
- package/dist/models/GenericSuccessBoolResponse.js.map +0 -1
- package/dist/models/GetNotificationHistoryRequestBody.js.map +0 -1
- package/dist/models/GetSegmentsSuccessResponse.js.map +0 -1
- package/dist/models/LanguageStringMap.js.map +0 -1
- package/dist/models/Notification.js.map +0 -1
- package/dist/models/NotificationAllOf.js.map +0 -1
- package/dist/models/NotificationHistorySuccessResponse.js.map +0 -1
- package/dist/models/NotificationSlice.js.map +0 -1
- package/dist/models/NotificationTarget.js.map +0 -1
- package/dist/models/NotificationWithMeta.js.map +0 -1
- package/dist/models/NotificationWithMetaAllOf.js.map +0 -1
- package/dist/models/ObjectSerializer.js.map +0 -1
- package/dist/models/Operator.js.map +0 -1
- package/dist/models/OutcomeData.js.map +0 -1
- package/dist/models/OutcomesData.js.map +0 -1
- package/dist/models/PlatformDeliveryData.js.map +0 -1
- package/dist/models/PlatformDeliveryDataEmailAllOf.js.map +0 -1
- package/dist/models/PlatformDeliveryDataSmsAllOf.js.map +0 -1
- package/dist/models/PropertiesBody.js.map +0 -1
- package/dist/models/PropertiesDeltas.js.map +0 -1
- package/dist/models/PropertiesObject.js.map +0 -1
- package/dist/models/Purchase.js.map +0 -1
- package/dist/models/RateLimitError.js.map +0 -1
- package/dist/models/Segment.js.map +0 -1
- package/dist/models/SegmentData.js.map +0 -1
- package/dist/models/SegmentNotificationTarget.js.map +0 -1
- package/dist/models/StartLiveActivityRequest.js.map +0 -1
- package/dist/models/StartLiveActivitySuccessResponse.js.map +0 -1
- package/dist/models/Subscription.js.map +0 -1
- package/dist/models/SubscriptionBody.js.map +0 -1
- package/dist/models/SubscriptionNotificationTarget.js.map +0 -1
- package/dist/models/TemplateResource.js.map +0 -1
- package/dist/models/TemplatesListResponse.js.map +0 -1
- package/dist/models/TransferSubscriptionRequestBody.js.map +0 -1
- package/dist/models/UpdateApiKeyRequest.js.map +0 -1
- package/dist/models/UpdateLiveActivityRequest.js.map +0 -1
- package/dist/models/UpdateLiveActivitySuccessResponse.js.map +0 -1
- package/dist/models/UpdateTemplateRequest.js.map +0 -1
- package/dist/models/UpdateUserRequest.js.map +0 -1
- package/dist/models/User.js.map +0 -1
- package/dist/models/UserIdentityBody.js.map +0 -1
- package/dist/models/WebButton.js.map +0 -1
- package/dist/models/all.js.map +0 -1
- package/dist/rxjsStub.js.map +0 -1
- package/dist/servers.js.map +0 -1
- package/dist/types/ObjectParamAPI.js.map +0 -1
- package/dist/types/ObservableAPI.js.map +0 -1
- package/dist/types/PromiseAPI.js.map +0 -1
- package/dist/util.js.map +0 -1
- package/http/http.ts +0 -205
- package/http/isomorphic-fetch.ts +0 -30
- package/index.ts +0 -12
- package/middleware.ts +0 -66
- package/models/ApiKeyToken.ts +0 -69
- package/models/ApiKeyTokensListResponse.ts +0 -32
- package/models/App.ts +0 -328
- package/models/BasicNotification.ts +0 -1088
- package/models/BasicNotificationAllOf.ts +0 -958
- package/models/BasicNotificationAllOfAndroidBackgroundLayout.ts +0 -57
- package/models/Button.ts +0 -45
- package/models/CopyTemplateRequest.ts +0 -34
- package/models/CreateApiKeyRequest.ts +0 -48
- package/models/CreateApiKeyResponse.ts +0 -38
- package/models/CreateNotificationSuccessResponse.ts +0 -48
- package/models/CreateSegmentConflictResponse.ts +0 -38
- package/models/CreateSegmentSuccessResponse.ts +0 -41
- package/models/CreateTemplateRequest.ts +0 -102
- package/models/CreateUserConflictResponse.ts +0 -32
- package/models/CreateUserConflictResponseErrorsInner.ts +0 -46
- package/models/CreateUserConflictResponseErrorsItemsMeta.ts +0 -31
- package/models/CustomEvent.ts +0 -74
- package/models/CustomEventsRequest.ts +0 -32
- package/models/DeliveryData.ts +0 -74
- package/models/ExportEventsSuccessResponse.ts +0 -31
- package/models/ExportSubscriptionsRequestBody.ts +0 -54
- package/models/ExportSubscriptionsSuccessResponse.ts +0 -31
- package/models/Filter.ts +0 -107
- package/models/FilterExpression.ts +0 -120
- package/models/GenericError.ts +0 -45
- package/models/GenericSuccessBoolResponse.ts +0 -31
- package/models/GetNotificationHistoryRequestBody.ts +0 -54
- package/models/GetSegmentsSuccessResponse.ts +0 -65
- package/models/LanguageStringMap.ts +0 -454
- package/models/Notification.ts +0 -1098
- package/models/NotificationAllOf.ts +0 -34
- package/models/NotificationHistorySuccessResponse.ts +0 -38
- package/models/NotificationSlice.ts +0 -53
- package/models/NotificationTarget.ts +0 -156
- package/models/NotificationWithMeta.ts +0 -1206
- package/models/NotificationWithMetaAllOf.ts +0 -142
- package/models/ObjectSerializer.ts +0 -442
- package/models/Operator.ts +0 -37
- package/models/OutcomeData.ts +0 -48
- package/models/OutcomesData.ts +0 -32
- package/models/PlatformDeliveryData.ts +0 -86
- package/models/PlatformDeliveryDataEmailAllOf.ts +0 -94
- package/models/PlatformDeliveryDataSmsAllOf.ts +0 -54
- package/models/PropertiesBody.ts +0 -32
- package/models/PropertiesDeltas.ts +0 -46
- package/models/PropertiesObject.ts +0 -102
- package/models/Purchase.ts +0 -61
- package/models/RateLimitError.ts +0 -38
- package/models/Segment.ts +0 -55
- package/models/SegmentData.ts +0 -94
- package/models/SegmentNotificationTarget.ts +0 -44
- package/models/StartLiveActivityRequest.ts +0 -177
- package/models/StartLiveActivitySuccessResponse.ts +0 -31
- package/models/Subscription.ts +0 -146
- package/models/SubscriptionBody.ts +0 -32
- package/models/SubscriptionNotificationTarget.ts +0 -134
- package/models/TemplateResource.ts +0 -72
- package/models/TemplatesListResponse.ts +0 -32
- package/models/TransferSubscriptionRequestBody.ts +0 -31
- package/models/UpdateApiKeyRequest.ts +0 -48
- package/models/UpdateLiveActivityRequest.ts +0 -109
- package/models/UpdateLiveActivitySuccessResponse.ts +0 -31
- package/models/UpdateTemplateRequest.ts +0 -92
- package/models/UpdateUserRequest.ts +0 -47
- package/models/User.ts +0 -47
- package/models/UserIdentityBody.ts +0 -31
- package/models/WebButton.ts +0 -52
- package/models/all.ts +0 -67
- package/onesignal-node-onesignal-5.3.0-beta1.tgz +0 -0
- package/rxjsStub.ts +0 -27
- package/servers.ts +0 -53
- package/tsconfig.json +0 -28
- package/types/ObjectParamAPI.ts +0 -1270
- package/types/ObservableAPI.ts +0 -1201
- package/types/PromiseAPI.ts +0 -585
- package/util.ts +0 -37
package/types/PromiseAPI.ts
DELETED
|
@@ -1,585 +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 { ApiKeyToken } from '../models/ApiKeyToken';
|
|
6
|
-
import { ApiKeyTokensListResponse } from '../models/ApiKeyTokensListResponse';
|
|
7
|
-
import { App } from '../models/App';
|
|
8
|
-
import { BasicNotification } from '../models/BasicNotification';
|
|
9
|
-
import { BasicNotificationAllOf } from '../models/BasicNotificationAllOf';
|
|
10
|
-
import { BasicNotificationAllOfAndroidBackgroundLayout } from '../models/BasicNotificationAllOfAndroidBackgroundLayout';
|
|
11
|
-
import { Button } from '../models/Button';
|
|
12
|
-
import { CopyTemplateRequest } from '../models/CopyTemplateRequest';
|
|
13
|
-
import { CreateApiKeyRequest } from '../models/CreateApiKeyRequest';
|
|
14
|
-
import { CreateApiKeyResponse } from '../models/CreateApiKeyResponse';
|
|
15
|
-
import { CreateNotificationSuccessResponse } from '../models/CreateNotificationSuccessResponse';
|
|
16
|
-
import { CreateSegmentConflictResponse } from '../models/CreateSegmentConflictResponse';
|
|
17
|
-
import { CreateSegmentSuccessResponse } from '../models/CreateSegmentSuccessResponse';
|
|
18
|
-
import { CreateTemplateRequest } from '../models/CreateTemplateRequest';
|
|
19
|
-
import { CreateUserConflictResponse } from '../models/CreateUserConflictResponse';
|
|
20
|
-
import { CreateUserConflictResponseErrorsInner } from '../models/CreateUserConflictResponseErrorsInner';
|
|
21
|
-
import { CreateUserConflictResponseErrorsItemsMeta } from '../models/CreateUserConflictResponseErrorsItemsMeta';
|
|
22
|
-
import { CustomEvent } from '../models/CustomEvent';
|
|
23
|
-
import { CustomEventsRequest } from '../models/CustomEventsRequest';
|
|
24
|
-
import { DeliveryData } from '../models/DeliveryData';
|
|
25
|
-
import { ExportEventsSuccessResponse } from '../models/ExportEventsSuccessResponse';
|
|
26
|
-
import { ExportSubscriptionsRequestBody } from '../models/ExportSubscriptionsRequestBody';
|
|
27
|
-
import { ExportSubscriptionsSuccessResponse } from '../models/ExportSubscriptionsSuccessResponse';
|
|
28
|
-
import { Filter } from '../models/Filter';
|
|
29
|
-
import { FilterExpression } from '../models/FilterExpression';
|
|
30
|
-
import { GenericError } from '../models/GenericError';
|
|
31
|
-
import { GenericSuccessBoolResponse } from '../models/GenericSuccessBoolResponse';
|
|
32
|
-
import { GetNotificationHistoryRequestBody } from '../models/GetNotificationHistoryRequestBody';
|
|
33
|
-
import { GetSegmentsSuccessResponse } from '../models/GetSegmentsSuccessResponse';
|
|
34
|
-
import { LanguageStringMap } from '../models/LanguageStringMap';
|
|
35
|
-
import { Notification } from '../models/Notification';
|
|
36
|
-
import { NotificationAllOf } from '../models/NotificationAllOf';
|
|
37
|
-
import { NotificationHistorySuccessResponse } from '../models/NotificationHistorySuccessResponse';
|
|
38
|
-
import { NotificationSlice } from '../models/NotificationSlice';
|
|
39
|
-
import { NotificationTarget } from '../models/NotificationTarget';
|
|
40
|
-
import { NotificationWithMeta } from '../models/NotificationWithMeta';
|
|
41
|
-
import { NotificationWithMetaAllOf } from '../models/NotificationWithMetaAllOf';
|
|
42
|
-
import { Operator } from '../models/Operator';
|
|
43
|
-
import { OutcomeData } from '../models/OutcomeData';
|
|
44
|
-
import { OutcomesData } from '../models/OutcomesData';
|
|
45
|
-
import { PlatformDeliveryData } from '../models/PlatformDeliveryData';
|
|
46
|
-
import { PlatformDeliveryDataEmailAllOf } from '../models/PlatformDeliveryDataEmailAllOf';
|
|
47
|
-
import { PlatformDeliveryDataSmsAllOf } from '../models/PlatformDeliveryDataSmsAllOf';
|
|
48
|
-
import { PropertiesBody } from '../models/PropertiesBody';
|
|
49
|
-
import { PropertiesDeltas } from '../models/PropertiesDeltas';
|
|
50
|
-
import { PropertiesObject } from '../models/PropertiesObject';
|
|
51
|
-
import { Purchase } from '../models/Purchase';
|
|
52
|
-
import { RateLimitError } from '../models/RateLimitError';
|
|
53
|
-
import { Segment } from '../models/Segment';
|
|
54
|
-
import { SegmentData } from '../models/SegmentData';
|
|
55
|
-
import { SegmentNotificationTarget } from '../models/SegmentNotificationTarget';
|
|
56
|
-
import { StartLiveActivityRequest } from '../models/StartLiveActivityRequest';
|
|
57
|
-
import { StartLiveActivitySuccessResponse } from '../models/StartLiveActivitySuccessResponse';
|
|
58
|
-
import { Subscription } from '../models/Subscription';
|
|
59
|
-
import { SubscriptionBody } from '../models/SubscriptionBody';
|
|
60
|
-
import { SubscriptionNotificationTarget } from '../models/SubscriptionNotificationTarget';
|
|
61
|
-
import { TemplateResource } from '../models/TemplateResource';
|
|
62
|
-
import { TemplatesListResponse } from '../models/TemplatesListResponse';
|
|
63
|
-
import { TransferSubscriptionRequestBody } from '../models/TransferSubscriptionRequestBody';
|
|
64
|
-
import { UpdateApiKeyRequest } from '../models/UpdateApiKeyRequest';
|
|
65
|
-
import { UpdateLiveActivityRequest } from '../models/UpdateLiveActivityRequest';
|
|
66
|
-
import { UpdateLiveActivitySuccessResponse } from '../models/UpdateLiveActivitySuccessResponse';
|
|
67
|
-
import { UpdateTemplateRequest } from '../models/UpdateTemplateRequest';
|
|
68
|
-
import { UpdateUserRequest } from '../models/UpdateUserRequest';
|
|
69
|
-
import { User } from '../models/User';
|
|
70
|
-
import { UserIdentityBody } from '../models/UserIdentityBody';
|
|
71
|
-
import { WebButton } from '../models/WebButton';
|
|
72
|
-
import { ObservableDefaultApi } from './ObservableAPI';
|
|
73
|
-
|
|
74
|
-
import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi";
|
|
75
|
-
export class PromiseDefaultApi {
|
|
76
|
-
private api: ObservableDefaultApi
|
|
77
|
-
|
|
78
|
-
public constructor(
|
|
79
|
-
configuration: Configuration,
|
|
80
|
-
requestFactory?: DefaultApiRequestFactory,
|
|
81
|
-
responseProcessor?: DefaultApiResponseProcessor
|
|
82
|
-
) {
|
|
83
|
-
this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Used to stop a scheduled or currently outgoing notification
|
|
88
|
-
* Stop a scheduled or currently outgoing notification
|
|
89
|
-
* @param appId
|
|
90
|
-
* @param notificationId
|
|
91
|
-
*/
|
|
92
|
-
public cancelNotification(appId: string, notificationId: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
|
|
93
|
-
const result = this.api.cancelNotification(appId, notificationId, _options);
|
|
94
|
-
return result.toPromise();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Copy a template to a destination app.
|
|
99
|
-
* Copy template to another app
|
|
100
|
-
* @param templateId
|
|
101
|
-
* @param appId
|
|
102
|
-
* @param copyTemplateRequest
|
|
103
|
-
*/
|
|
104
|
-
public copyTemplateToApp(templateId: string, appId: string, copyTemplateRequest: CopyTemplateRequest, _options?: Configuration): Promise<TemplateResource> {
|
|
105
|
-
const result = this.api.copyTemplateToApp(templateId, appId, copyTemplateRequest, _options);
|
|
106
|
-
return result.toPromise();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
|
|
111
|
-
* @param appId
|
|
112
|
-
* @param aliasLabel
|
|
113
|
-
* @param aliasId
|
|
114
|
-
* @param userIdentityBody
|
|
115
|
-
*/
|
|
116
|
-
public createAlias(appId: string, aliasLabel: string, aliasId: string, userIdentityBody: UserIdentityBody, _options?: Configuration): Promise<UserIdentityBody> {
|
|
117
|
-
const result = this.api.createAlias(appId, aliasLabel, aliasId, userIdentityBody, _options);
|
|
118
|
-
return result.toPromise();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Upserts one or more Aliases for the User identified by :subscription_id.
|
|
123
|
-
* @param appId
|
|
124
|
-
* @param subscriptionId
|
|
125
|
-
* @param userIdentityBody
|
|
126
|
-
*/
|
|
127
|
-
public createAliasBySubscription(appId: string, subscriptionId: string, userIdentityBody: UserIdentityBody, _options?: Configuration): Promise<UserIdentityBody> {
|
|
128
|
-
const result = this.api.createAliasBySubscription(appId, subscriptionId, userIdentityBody, _options);
|
|
129
|
-
return result.toPromise();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting.
|
|
134
|
-
* Create API key
|
|
135
|
-
* @param appId
|
|
136
|
-
* @param createApiKeyRequest
|
|
137
|
-
*/
|
|
138
|
-
public createApiKey(appId: string, createApiKeyRequest: CreateApiKeyRequest, _options?: Configuration): Promise<CreateApiKeyResponse> {
|
|
139
|
-
const result = this.api.createApiKey(appId, createApiKeyRequest, _options);
|
|
140
|
-
return result.toPromise();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Creates a new OneSignal app
|
|
145
|
-
* Create an app
|
|
146
|
-
* @param app
|
|
147
|
-
*/
|
|
148
|
-
public createApp(app: App, _options?: Configuration): Promise<App> {
|
|
149
|
-
const result = this.api.createApp(app, _options);
|
|
150
|
-
return result.toPromise();
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.
|
|
155
|
-
* Create custom events
|
|
156
|
-
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
157
|
-
* @param customEventsRequest
|
|
158
|
-
*/
|
|
159
|
-
public createCustomEvents(appId: string, customEventsRequest: CustomEventsRequest, _options?: Configuration): Promise<object> {
|
|
160
|
-
const result = this.api.createCustomEvents(appId, customEventsRequest, _options);
|
|
161
|
-
return result.toPromise();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Sends notifications to your users
|
|
166
|
-
* Create notification
|
|
167
|
-
* @param notification
|
|
168
|
-
*/
|
|
169
|
-
public createNotification(notification: Notification, _options?: Configuration): Promise<CreateNotificationSuccessResponse> {
|
|
170
|
-
const result = this.api.createNotification(notification, _options);
|
|
171
|
-
return result.toPromise();
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* 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. 🚧 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.
|
|
176
|
-
* Create Segment
|
|
177
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
178
|
-
* @param segment
|
|
179
|
-
*/
|
|
180
|
-
public createSegment(appId: string, segment?: Segment, _options?: Configuration): Promise<CreateSegmentSuccessResponse> {
|
|
181
|
-
const result = this.api.createSegment(appId, segment, _options);
|
|
182
|
-
return result.toPromise();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
|
|
187
|
-
* @param appId
|
|
188
|
-
* @param aliasLabel
|
|
189
|
-
* @param aliasId
|
|
190
|
-
* @param subscriptionBody
|
|
191
|
-
*/
|
|
192
|
-
public createSubscription(appId: string, aliasLabel: string, aliasId: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<SubscriptionBody> {
|
|
193
|
-
const result = this.api.createSubscription(appId, aliasLabel, aliasId, subscriptionBody, _options);
|
|
194
|
-
return result.toPromise();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Create reusable message templates for push, email, and SMS channels.
|
|
199
|
-
* Create template
|
|
200
|
-
* @param createTemplateRequest
|
|
201
|
-
*/
|
|
202
|
-
public createTemplate(createTemplateRequest: CreateTemplateRequest, _options?: Configuration): Promise<TemplateResource> {
|
|
203
|
-
const result = this.api.createTemplate(createTemplateRequest, _options);
|
|
204
|
-
return result.toPromise();
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* 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.
|
|
209
|
-
* @param appId
|
|
210
|
-
* @param user
|
|
211
|
-
*/
|
|
212
|
-
public createUser(appId: string, user: User, _options?: Configuration): Promise<User> {
|
|
213
|
-
const result = this.api.createUser(appId, user, _options);
|
|
214
|
-
return result.toPromise();
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Deletes an alias by alias label
|
|
219
|
-
* @param appId
|
|
220
|
-
* @param aliasLabel
|
|
221
|
-
* @param aliasId
|
|
222
|
-
* @param aliasLabelToDelete
|
|
223
|
-
*/
|
|
224
|
-
public deleteAlias(appId: string, aliasLabel: string, aliasId: string, aliasLabelToDelete: string, _options?: Configuration): Promise<UserIdentityBody> {
|
|
225
|
-
const result = this.api.deleteAlias(appId, aliasLabel, aliasId, aliasLabelToDelete, _options);
|
|
226
|
-
return result.toPromise();
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself.
|
|
231
|
-
* Delete API key
|
|
232
|
-
* @param appId
|
|
233
|
-
* @param tokenId
|
|
234
|
-
*/
|
|
235
|
-
public deleteApiKey(appId: string, tokenId: string, _options?: Configuration): Promise<object> {
|
|
236
|
-
const result = this.api.deleteApiKey(appId, tokenId, _options);
|
|
237
|
-
return result.toPromise();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* 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.
|
|
242
|
-
* Delete Segment
|
|
243
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
244
|
-
* @param segmentId The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
|
245
|
-
*/
|
|
246
|
-
public deleteSegment(appId: string, segmentId: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
|
|
247
|
-
const result = this.api.deleteSegment(appId, segmentId, _options);
|
|
248
|
-
return result.toPromise();
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Deletes the Subscription.
|
|
253
|
-
* @param appId
|
|
254
|
-
* @param subscriptionId
|
|
255
|
-
*/
|
|
256
|
-
public deleteSubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise<void> {
|
|
257
|
-
const result = this.api.deleteSubscription(appId, subscriptionId, _options);
|
|
258
|
-
return result.toPromise();
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Delete a template by id.
|
|
263
|
-
* Delete template
|
|
264
|
-
* @param templateId
|
|
265
|
-
* @param appId
|
|
266
|
-
*/
|
|
267
|
-
public deleteTemplate(templateId: string, appId: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
|
|
268
|
-
const result = this.api.deleteTemplate(templateId, appId, _options);
|
|
269
|
-
return result.toPromise();
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
|
|
274
|
-
* @param appId
|
|
275
|
-
* @param aliasLabel
|
|
276
|
-
* @param aliasId
|
|
277
|
-
*/
|
|
278
|
-
public deleteUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<void> {
|
|
279
|
-
const result = this.api.deleteUser(appId, aliasLabel, aliasId, _options);
|
|
280
|
-
return result.toPromise();
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* 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.
|
|
285
|
-
* Export CSV of Events
|
|
286
|
-
* @param notificationId The ID of the notification to export events from.
|
|
287
|
-
* @param appId The ID of the app that the notification belongs to.
|
|
288
|
-
*/
|
|
289
|
-
public exportEvents(notificationId: string, appId: string, _options?: Configuration): Promise<ExportEventsSuccessResponse> {
|
|
290
|
-
const result = this.api.exportEvents(notificationId, appId, _options);
|
|
291
|
-
return result.toPromise();
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* 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. |
|
|
296
|
-
* Export CSV of Subscriptions
|
|
297
|
-
* @param appId The app ID that you want to export devices from
|
|
298
|
-
* @param exportSubscriptionsRequestBody
|
|
299
|
-
*/
|
|
300
|
-
public exportSubscriptions(appId: string, exportSubscriptionsRequestBody?: ExportSubscriptionsRequestBody, _options?: Configuration): Promise<ExportSubscriptionsSuccessResponse> {
|
|
301
|
-
const result = this.api.exportSubscriptions(appId, exportSubscriptionsRequestBody, _options);
|
|
302
|
-
return result.toPromise();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Lists all Aliases for the User identified by (:alias_label, :alias_id).
|
|
307
|
-
* @param appId
|
|
308
|
-
* @param aliasLabel
|
|
309
|
-
* @param aliasId
|
|
310
|
-
*/
|
|
311
|
-
public getAliases(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<UserIdentityBody> {
|
|
312
|
-
const result = this.api.getAliases(appId, aliasLabel, aliasId, _options);
|
|
313
|
-
return result.toPromise();
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Lists all Aliases for the User identified by :subscription_id.
|
|
318
|
-
* @param appId
|
|
319
|
-
* @param subscriptionId
|
|
320
|
-
*/
|
|
321
|
-
public getAliasesBySubscription(appId: string, subscriptionId: string, _options?: Configuration): Promise<UserIdentityBody> {
|
|
322
|
-
const result = this.api.getAliasesBySubscription(appId, subscriptionId, _options);
|
|
323
|
-
return result.toPromise();
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* View the details of a single OneSignal app
|
|
328
|
-
* View an app
|
|
329
|
-
* @param appId An app id
|
|
330
|
-
*/
|
|
331
|
-
public getApp(appId: string, _options?: Configuration): Promise<App> {
|
|
332
|
-
const result = this.api.getApp(appId, _options);
|
|
333
|
-
return result.toPromise();
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* View the details of all of your current OneSignal apps
|
|
338
|
-
* View apps
|
|
339
|
-
*/
|
|
340
|
-
public getApps(_options?: Configuration): Promise<Array<App>> {
|
|
341
|
-
const result = this.api.getApps(_options);
|
|
342
|
-
return result.toPromise();
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* View the details of a single notification and outcomes associated with it
|
|
347
|
-
* View notification
|
|
348
|
-
* @param appId
|
|
349
|
-
* @param notificationId
|
|
350
|
-
*/
|
|
351
|
-
public getNotification(appId: string, notificationId: string, _options?: Configuration): Promise<NotificationWithMeta> {
|
|
352
|
-
const result = this.api.getNotification(appId, notificationId, _options);
|
|
353
|
-
return result.toPromise();
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* -> 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.
|
|
358
|
-
* Notification History
|
|
359
|
-
* @param notificationId The \"id\" of the message found in the Notification object
|
|
360
|
-
* @param getNotificationHistoryRequestBody
|
|
361
|
-
*/
|
|
362
|
-
public getNotificationHistory(notificationId: string, getNotificationHistoryRequestBody: GetNotificationHistoryRequestBody, _options?: Configuration): Promise<NotificationHistorySuccessResponse> {
|
|
363
|
-
const result = this.api.getNotificationHistory(notificationId, getNotificationHistoryRequestBody, _options);
|
|
364
|
-
return result.toPromise();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* View the details of multiple notifications
|
|
369
|
-
* View notifications
|
|
370
|
-
* @param appId The app ID that you want to view notifications from
|
|
371
|
-
* @param limit How many notifications to return. Max is 50. Default is 50.
|
|
372
|
-
* @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.
|
|
373
|
-
* @param kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
|
|
374
|
-
*/
|
|
375
|
-
public getNotifications(appId: string, limit?: number, offset?: number, kind?: 0 | 1 | 3, _options?: Configuration): Promise<NotificationSlice> {
|
|
376
|
-
const result = this.api.getNotifications(appId, limit, offset, kind, _options);
|
|
377
|
-
return result.toPromise();
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* 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.
|
|
382
|
-
* View Outcomes
|
|
383
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
384
|
-
* @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 \"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
|
|
385
|
-
* @param outcomeNames2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name.
|
|
386
|
-
* @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.
|
|
387
|
-
* @param outcomePlatforms Optional Platform id. Refer device\'s platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
|
|
388
|
-
* @param outcomeAttribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
|
|
389
|
-
*/
|
|
390
|
-
public getOutcomes(appId: string, outcomeNames: string, outcomeNames2?: string, outcomeTimeRange?: string, outcomePlatforms?: string, outcomeAttribution?: string, _options?: Configuration): Promise<OutcomesData> {
|
|
391
|
-
const result = this.api.getOutcomes(appId, outcomeNames, outcomeNames2, outcomeTimeRange, outcomePlatforms, outcomeAttribution, _options);
|
|
392
|
-
return result.toPromise();
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Returns an array of segments from an app.
|
|
397
|
-
* Get Segments
|
|
398
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
399
|
-
* @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.
|
|
400
|
-
* @param limit The amount of Segments in the response. Maximum 300.
|
|
401
|
-
*/
|
|
402
|
-
public getSegments(appId: string, offset?: number, limit?: number, _options?: Configuration): Promise<GetSegmentsSuccessResponse> {
|
|
403
|
-
const result = this.api.getSegments(appId, offset, limit, _options);
|
|
404
|
-
return result.toPromise();
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Returns the User’s properties, Aliases, and Subscriptions.
|
|
409
|
-
* @param appId
|
|
410
|
-
* @param aliasLabel
|
|
411
|
-
* @param aliasId
|
|
412
|
-
*/
|
|
413
|
-
public getUser(appId: string, aliasLabel: string, aliasId: string, _options?: Configuration): Promise<User> {
|
|
414
|
-
const result = this.api.getUser(appId, aliasLabel, aliasId, _options);
|
|
415
|
-
return result.toPromise();
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch.
|
|
420
|
-
* Rotate API key
|
|
421
|
-
* @param appId
|
|
422
|
-
* @param tokenId
|
|
423
|
-
*/
|
|
424
|
-
public rotateApiKey(appId: string, tokenId: string, _options?: Configuration): Promise<CreateApiKeyResponse> {
|
|
425
|
-
const result = this.api.rotateApiKey(appId, tokenId, _options);
|
|
426
|
-
return result.toPromise();
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Remotely start a Live Activity on iOS devices via OneSignal’s REST API.
|
|
431
|
-
* Start Live Activity
|
|
432
|
-
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
433
|
-
* @param activityType The name of the Live Activity defined in your app. This should match the attributes struct used in your app\'s Live Activity implementation.
|
|
434
|
-
* @param startLiveActivityRequest
|
|
435
|
-
*/
|
|
436
|
-
public startLiveActivity(appId: string, activityType: string, startLiveActivityRequest: StartLiveActivityRequest, _options?: Configuration): Promise<StartLiveActivitySuccessResponse> {
|
|
437
|
-
const result = this.api.startLiveActivity(appId, activityType, startLiveActivityRequest, _options);
|
|
438
|
-
return result.toPromise();
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Transfers this Subscription to the User identified by the identity in the payload.
|
|
443
|
-
* @param appId
|
|
444
|
-
* @param subscriptionId
|
|
445
|
-
* @param transferSubscriptionRequestBody
|
|
446
|
-
*/
|
|
447
|
-
public transferSubscription(appId: string, subscriptionId: string, transferSubscriptionRequestBody: TransferSubscriptionRequestBody, _options?: Configuration): Promise<UserIdentityBody> {
|
|
448
|
-
const result = this.api.transferSubscription(appId, subscriptionId, transferSubscriptionRequestBody, _options);
|
|
449
|
-
return result.toPromise();
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Unsubscribe an email with a token when using your own custom email unsubscribe landing page
|
|
454
|
-
* Unsubscribe with token
|
|
455
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
456
|
-
* @param notificationId The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
|
|
457
|
-
* @param token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
|
|
458
|
-
*/
|
|
459
|
-
public unsubscribeEmailWithToken(appId: string, notificationId: string, token: string, _options?: Configuration): Promise<GenericSuccessBoolResponse> {
|
|
460
|
-
const result = this.api.unsubscribeEmailWithToken(appId, notificationId, token, _options);
|
|
461
|
-
return result.toPromise();
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Update a Rich Authentication Token (App API Key) for a OneSignal app.
|
|
466
|
-
* Update API key
|
|
467
|
-
* @param appId
|
|
468
|
-
* @param tokenId
|
|
469
|
-
* @param updateApiKeyRequest
|
|
470
|
-
*/
|
|
471
|
-
public updateApiKey(appId: string, tokenId: string, updateApiKeyRequest: UpdateApiKeyRequest, _options?: Configuration): Promise<object> {
|
|
472
|
-
const result = this.api.updateApiKey(appId, tokenId, updateApiKeyRequest, _options);
|
|
473
|
-
return result.toPromise();
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Updates the name or configuration settings of an existing OneSignal app
|
|
478
|
-
* Update an app
|
|
479
|
-
* @param appId An app id
|
|
480
|
-
* @param app
|
|
481
|
-
*/
|
|
482
|
-
public updateApp(appId: string, app: App, _options?: Configuration): Promise<App> {
|
|
483
|
-
const result = this.api.updateApp(appId, app, _options);
|
|
484
|
-
return result.toPromise();
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Updates a specified live activity.
|
|
489
|
-
* Update a Live Activity via Push
|
|
490
|
-
* @param appId The OneSignal App ID for your app. Available in Keys & IDs.
|
|
491
|
-
* @param activityId Live Activity record ID
|
|
492
|
-
* @param updateLiveActivityRequest
|
|
493
|
-
*/
|
|
494
|
-
public updateLiveActivity(appId: string, activityId: string, updateLiveActivityRequest: UpdateLiveActivityRequest, _options?: Configuration): Promise<UpdateLiveActivitySuccessResponse> {
|
|
495
|
-
const result = this.api.updateLiveActivity(appId, activityId, updateLiveActivityRequest, _options);
|
|
496
|
-
return result.toPromise();
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Updates an existing Subscription’s properties.
|
|
501
|
-
* @param appId
|
|
502
|
-
* @param subscriptionId
|
|
503
|
-
* @param subscriptionBody
|
|
504
|
-
*/
|
|
505
|
-
public updateSubscription(appId: string, subscriptionId: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<void> {
|
|
506
|
-
const result = this.api.updateSubscription(appId, subscriptionId, subscriptionBody, _options);
|
|
507
|
-
return result.toPromise();
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Update properties on an existing OneSignal subscription using its token.
|
|
512
|
-
* Update subscription by token
|
|
513
|
-
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
514
|
-
* @param tokenType The type of token to use when looking up the subscription. See Subscription Types.
|
|
515
|
-
* @param token The value of the token to lookup by (e.g., email address, phone number).
|
|
516
|
-
* @param subscriptionBody
|
|
517
|
-
*/
|
|
518
|
-
public updateSubscriptionByToken(appId: string, tokenType: string, token: string, subscriptionBody: SubscriptionBody, _options?: Configuration): Promise<object> {
|
|
519
|
-
const result = this.api.updateSubscriptionByToken(appId, tokenType, token, subscriptionBody, _options);
|
|
520
|
-
return result.toPromise();
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Update an existing template.
|
|
525
|
-
* Update template
|
|
526
|
-
* @param templateId
|
|
527
|
-
* @param appId
|
|
528
|
-
* @param updateTemplateRequest
|
|
529
|
-
*/
|
|
530
|
-
public updateTemplate(templateId: string, appId: string, updateTemplateRequest: UpdateTemplateRequest, _options?: Configuration): Promise<TemplateResource> {
|
|
531
|
-
const result = this.api.updateTemplate(templateId, appId, updateTemplateRequest, _options);
|
|
532
|
-
return result.toPromise();
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* Updates an existing User’s properties.
|
|
537
|
-
* @param appId
|
|
538
|
-
* @param aliasLabel
|
|
539
|
-
* @param aliasId
|
|
540
|
-
* @param updateUserRequest
|
|
541
|
-
*/
|
|
542
|
-
public updateUser(appId: string, aliasLabel: string, aliasId: string, updateUserRequest: UpdateUserRequest, _options?: Configuration): Promise<PropertiesBody> {
|
|
543
|
-
const result = this.api.updateUser(appId, aliasLabel, aliasId, updateUserRequest, _options);
|
|
544
|
-
return result.toPromise();
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app.
|
|
549
|
-
* View API keys
|
|
550
|
-
* @param appId
|
|
551
|
-
*/
|
|
552
|
-
public viewApiKeys(appId: string, _options?: Configuration): Promise<ApiKeyTokensListResponse> {
|
|
553
|
-
const result = this.api.viewApiKeys(appId, _options);
|
|
554
|
-
return result.toPromise();
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Fetch a single template by id.
|
|
559
|
-
* View template
|
|
560
|
-
* @param templateId
|
|
561
|
-
* @param appId
|
|
562
|
-
*/
|
|
563
|
-
public viewTemplate(templateId: string, appId: string, _options?: Configuration): Promise<TemplateResource> {
|
|
564
|
-
const result = this.api.viewTemplate(templateId, appId, _options);
|
|
565
|
-
return result.toPromise();
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* List templates for an app.
|
|
570
|
-
* View templates
|
|
571
|
-
* @param appId Your OneSignal App ID in UUID v4 format.
|
|
572
|
-
* @param limit Maximum number of templates. Default and max is 50.
|
|
573
|
-
* @param offset Pagination offset.
|
|
574
|
-
* @param channel Filter by delivery channel.
|
|
575
|
-
*/
|
|
576
|
-
public viewTemplates(appId: string, limit?: number, offset?: number, channel?: 'push' | 'email' | 'sms', _options?: Configuration): Promise<TemplatesListResponse> {
|
|
577
|
-
const result = this.api.viewTemplates(appId, limit, offset, channel, _options);
|
|
578
|
-
return result.toPromise();
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
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
|
-
}
|