@onesignal/node-onesignal 1.0.0-beta4 → 1.0.0-beta6
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/.github/ISSUE_TEMPLATE/ask-question.yml +25 -0
- package/.github/ISSUE_TEMPLATE/bug-report.yml +51 -0
- package/.github/ISSUE_TEMPLATE/general-feedback.yml +25 -0
- package/.github/pull_request_template.md +44 -0
- package/.github/workflows/npm_deploy.yml +23 -0
- package/CHANGELOG.md +29 -0
- package/DefaultApi.md +1232 -0
- package/LICENSE +24 -0
- package/README.md +205 -102
- package/RELEASE_INSTRUCTIONS.md +2 -0
- package/apis/DefaultApi.ts +519 -532
- package/apis/baseapi.ts +4 -4
- package/apis/exception.ts +4 -3
- package/auth/auth.ts +4 -1
- package/configuration.ts +21 -2
- package/http/http.ts +26 -26
- package/index.ts +1 -0
- package/middleware.ts +1 -1
- package/models/App.ts +8 -8
- package/models/BasicNotification.ts +1019 -0
- package/models/BasicNotificationAllOf.ts +897 -0
- package/models/{NotificationAllOfAndroidBackgroundLayout.ts → BasicNotificationAllOfAndroidBackgroundLayout.ts} +4 -4
- package/models/Button.ts +2 -2
- package/models/CancelNotificationSuccessResponse.ts +31 -0
- package/models/{InlineResponse400.ts → CreateNotificationBadRequestResponse.ts} +4 -4
- package/models/{InlineResponse200.ts → CreateNotificationSuccessResponse.ts} +7 -6
- package/models/{InlineResponse2004.ts → CreatePlayerSuccessResponse.ts} +4 -4
- package/models/CreateSegmentBadRequestResponse.ts +38 -0
- package/models/{InlineResponse409.ts → CreateSegmentConflictResponse.ts} +4 -4
- package/models/{InlineResponse201.ts → CreateSegmentSuccessResponse.ts} +4 -4
- package/models/DeletePlayerBadRequestResponse.ts +31 -0
- package/models/DeletePlayerNotFoundResponse.ts +31 -0
- package/models/{InlineResponse2003.ts → DeletePlayerSuccessResponse.ts} +4 -4
- package/models/{InlineResponse4002.ts → DeleteSegmentBadRequestResponse.ts} +4 -4
- package/models/DeleteSegmentNotFoundResponse.ts +31 -0
- package/models/DeleteSegmentSuccessResponse.ts +31 -0
- package/models/DeliveryData.ts +17 -2
- package/models/ExportPlayersRequestBody.ts +5 -5
- package/models/{InlineResponse2005.ts → ExportPlayersSuccessResponse.ts} +4 -4
- package/models/Filter.ts +4 -4
- package/models/FilterExpressions.ts +4 -4
- package/models/FilterNotificationTarget.ts +2 -2
- package/models/GetNotificationRequestBody.ts +2 -2
- package/models/InvalidIdentifierError.ts +44 -0
- package/models/Notification.ts +72 -174
- package/models/Notification200Errors.ts +45 -0
- package/models/NotificationAllOf.ts +3 -858
- package/models/{InlineResponse4001.ts → NotificationHistoryBadRequestResponse.ts} +4 -4
- package/models/{InlineResponse2002.ts → NotificationHistorySuccessResponse.ts} +6 -6
- package/models/NotificationSlice.ts +5 -5
- package/models/NotificationTarget.ts +3 -124
- package/models/NotificationWithMeta.ts +1127 -0
- package/models/NotificationWithMetaAllOf.ts +132 -0
- package/models/ObjectSerializer.ts +97 -46
- package/models/Operator.ts +2 -2
- package/models/OutcomeData.ts +2 -2
- package/models/OutcomesData.ts +32 -0
- package/models/PlatformDeliveryData.ts +18 -2
- package/models/PlatformDeliveryDataEmailAllOf.ts +94 -0
- package/models/PlatformDeliveryDataSmsAllOf.ts +54 -0
- package/models/Player.ts +14 -14
- package/models/PlayerNotificationTarget.ts +3 -3
- package/models/PlayerSlice.ts +2 -2
- package/models/Purchase.ts +2 -2
- package/models/Segment.ts +3 -3
- package/models/SegmentNotificationTarget.ts +2 -2
- package/models/StringMap.ts +3 -3
- package/models/{InlineResponse2001.ts → UpdatePlayerSuccessResponse.ts} +6 -6
- package/models/UpdatePlayerTagsRequestBody.ts +4 -4
- package/models/UpdatePlayerTagsSuccessResponse.ts +31 -0
- package/models/all.ts +28 -13
- package/package.json +14 -9
- package/tsconfig.json +1 -2
- package/types/ObjectParamAPI.ts +101 -86
- package/types/ObservableAPI.ts +116 -101
- package/types/PromiseAPI.ts +97 -82
- package/util.ts +10 -1
- package/dist/apis/DefaultApi.d.ts +0 -62
- package/dist/apis/DefaultApi.js +0 -1317
- package/dist/apis/DefaultApi.js.map +0 -1
- package/dist/apis/baseapi.d.ts +0 -16
- package/dist/apis/baseapi.js +0 -42
- package/dist/apis/baseapi.js.map +0 -1
- package/dist/apis/exception.d.ts +0 -5
- package/dist/apis/exception.js +0 -28
- package/dist/apis/exception.js.map +0 -1
- package/dist/auth/auth.d.ts +0 -40
- package/dist/auth/auth.js +0 -108
- package/dist/auth/auth.js.map +0 -1
- package/dist/configuration.d.ts +0 -18
- package/dist/configuration.js +0 -21
- package/dist/configuration.js.map +0 -1
- package/dist/http/http.d.ts +0 -72
- package/dist/http/http.js +0 -205
- package/dist/http/http.js.map +0 -1
- package/dist/http/isomorphic-fetch.d.ts +0 -5
- package/dist/http/isomorphic-fetch.js +0 -33
- package/dist/http/isomorphic-fetch.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/middleware.d.ts +0 -16
- package/dist/middleware.js +0 -18
- package/dist/middleware.js.map +0 -1
- package/dist/models/App.d.ts +0 -47
- package/dist/models/App.js +0 -196
- package/dist/models/App.js.map +0 -1
- package/dist/models/Button.d.ts +0 -19
- package/dist/models/Button.js +0 -34
- package/dist/models/Button.js.map +0 -1
- package/dist/models/DeliveryData.d.ts +0 -21
- package/dist/models/DeliveryData.js +0 -46
- package/dist/models/DeliveryData.js.map +0 -1
- package/dist/models/ExportPlayersRequestBody.d.ts +0 -19
- package/dist/models/ExportPlayersRequestBody.js +0 -34
- package/dist/models/ExportPlayersRequestBody.js.map +0 -1
- package/dist/models/Filter.d.ts +0 -21
- package/dist/models/Filter.js +0 -40
- package/dist/models/Filter.js.map +0 -1
- package/dist/models/FilterExpressions.d.ts +0 -23
- package/dist/models/FilterExpressions.js +0 -46
- package/dist/models/FilterExpressions.js.map +0 -1
- package/dist/models/FilterNotificationTarget.d.ts +0 -28
- package/dist/models/FilterNotificationTarget.js +0 -88
- package/dist/models/FilterNotificationTarget.js.map +0 -1
- package/dist/models/GetNotificationRequestBody.d.ts +0 -20
- package/dist/models/GetNotificationRequestBody.js +0 -34
- package/dist/models/GetNotificationRequestBody.js.map +0 -1
- package/dist/models/InlineResponse200.d.ts +0 -20
- package/dist/models/InlineResponse200.js +0 -40
- package/dist/models/InlineResponse200.js.map +0 -1
- package/dist/models/InlineResponse2001.d.ts +0 -17
- package/dist/models/InlineResponse2001.js +0 -22
- package/dist/models/InlineResponse2001.js.map +0 -1
- package/dist/models/InlineResponse2002.d.ts +0 -18
- package/dist/models/InlineResponse2002.js +0 -28
- package/dist/models/InlineResponse2002.js.map +0 -1
- package/dist/models/InlineResponse2003.d.ts +0 -17
- package/dist/models/InlineResponse2003.js +0 -22
- package/dist/models/InlineResponse2003.js.map +0 -1
- package/dist/models/InlineResponse2004.d.ts +0 -18
- package/dist/models/InlineResponse2004.js +0 -28
- package/dist/models/InlineResponse2004.js.map +0 -1
- package/dist/models/InlineResponse2005.d.ts +0 -17
- package/dist/models/InlineResponse2005.js +0 -22
- package/dist/models/InlineResponse2005.js.map +0 -1
- package/dist/models/InlineResponse201.d.ts +0 -18
- package/dist/models/InlineResponse201.js +0 -28
- package/dist/models/InlineResponse201.js.map +0 -1
- package/dist/models/InlineResponse400.d.ts +0 -17
- package/dist/models/InlineResponse400.js +0 -22
- package/dist/models/InlineResponse400.js.map +0 -1
- package/dist/models/InlineResponse4001.d.ts +0 -18
- package/dist/models/InlineResponse4001.js +0 -28
- package/dist/models/InlineResponse4001.js.map +0 -1
- package/dist/models/InlineResponse4002.d.ts +0 -17
- package/dist/models/InlineResponse4002.js +0 -22
- package/dist/models/InlineResponse4002.js.map +0 -1
- package/dist/models/InlineResponse409.d.ts +0 -18
- package/dist/models/InlineResponse409.js +0 -28
- package/dist/models/InlineResponse409.js.map +0 -1
- package/dist/models/Notification.d.ts +0 -132
- package/dist/models/Notification.js +0 -688
- package/dist/models/Notification.js.map +0 -1
- package/dist/models/NotificationAllOf.d.ts +0 -108
- package/dist/models/NotificationAllOf.js +0 -544
- package/dist/models/NotificationAllOf.js.map +0 -1
- package/dist/models/NotificationAllOfAndroidBackgroundLayout.d.ts +0 -19
- package/dist/models/NotificationAllOfAndroidBackgroundLayout.js +0 -34
- package/dist/models/NotificationAllOfAndroidBackgroundLayout.js.map +0 -1
- package/dist/models/NotificationSlice.d.ts +0 -21
- package/dist/models/NotificationSlice.js +0 -40
- package/dist/models/NotificationSlice.js.map +0 -1
- package/dist/models/NotificationTarget.d.ts +0 -40
- package/dist/models/NotificationTarget.js +0 -160
- package/dist/models/NotificationTarget.js.map +0 -1
- package/dist/models/ObjectSerializer.d.ts +0 -44
- package/dist/models/ObjectSerializer.js +0 -312
- package/dist/models/ObjectSerializer.js.map +0 -1
- package/dist/models/Operator.d.ts +0 -18
- package/dist/models/Operator.js +0 -22
- package/dist/models/Operator.js.map +0 -1
- package/dist/models/OutcomeData.d.ts +0 -20
- package/dist/models/OutcomeData.js +0 -34
- package/dist/models/OutcomeData.js.map +0 -1
- package/dist/models/PlatformDeliveryData.d.ts +0 -23
- package/dist/models/PlatformDeliveryData.js +0 -52
- package/dist/models/PlatformDeliveryData.js.map +0 -1
- package/dist/models/Player.d.ts +0 -43
- package/dist/models/Player.js +0 -178
- package/dist/models/Player.js.map +0 -1
- package/dist/models/PlayerNotificationTarget.d.ts +0 -26
- package/dist/models/PlayerNotificationTarget.js +0 -76
- package/dist/models/PlayerNotificationTarget.js.map +0 -1
- package/dist/models/PlayerSlice.d.ts +0 -21
- package/dist/models/PlayerSlice.js +0 -40
- package/dist/models/PlayerSlice.js.map +0 -1
- package/dist/models/Purchase.d.ts +0 -19
- package/dist/models/Purchase.js +0 -34
- package/dist/models/Purchase.js.map +0 -1
- package/dist/models/Segment.d.ts +0 -20
- package/dist/models/Segment.js +0 -34
- package/dist/models/Segment.js.map +0 -1
- package/dist/models/SegmentNotificationTarget.d.ts +0 -18
- package/dist/models/SegmentNotificationTarget.js +0 -28
- package/dist/models/SegmentNotificationTarget.js.map +0 -1
- package/dist/models/StringMap.d.ts +0 -59
- package/dist/models/StringMap.js +0 -274
- package/dist/models/StringMap.js.map +0 -1
- package/dist/models/UpdatePlayerTagsRequestBody.d.ts +0 -17
- package/dist/models/UpdatePlayerTagsRequestBody.js +0 -22
- package/dist/models/UpdatePlayerTagsRequestBody.js.map +0 -1
- package/dist/models/all.d.ts +0 -35
- package/dist/models/all.js +0 -48
- package/dist/models/all.js.map +0 -1
- package/dist/rxjsStub.d.ts +0 -10
- package/dist/rxjsStub.js +0 -33
- package/dist/rxjsStub.js.map +0 -1
- package/dist/servers.d.ts +0 -17
- package/dist/servers.js +0 -32
- package/dist/servers.js.map +0 -1
- package/dist/types/ObjectParamAPI.d.ts +0 -121
- package/dist/types/ObjectParamAPI.js +0 -69
- package/dist/types/ObjectParamAPI.js.map +0 -1
- package/dist/types/ObservableAPI.d.ts +0 -45
- package/dist/types/ObservableAPI.js +0 -472
- package/dist/types/ObservableAPI.js.map +0 -1
- package/dist/types/PromiseAPI.d.ts +0 -42
- package/dist/types/PromiseAPI.js +0 -88
- package/dist/types/PromiseAPI.js.map +0 -1
- package/dist/util.d.ts +0 -1
- package/dist/util.js +0 -25
- package/dist/util.js.map +0 -1
- package/git_push.sh +0 -52
package/apis/baseapi.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const COLLECTION_FORMATS = {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* @export
|
|
18
18
|
* @class BaseAPI
|
|
19
19
|
*/
|
|
@@ -24,14 +24,14 @@ export class BaseAPIRequestFactory {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
*
|
|
28
28
|
* @export
|
|
29
29
|
* @class RequiredError
|
|
30
30
|
* @extends {Error}
|
|
31
31
|
*/
|
|
32
32
|
export class RequiredError extends Error {
|
|
33
33
|
name: "RequiredError" = "RequiredError";
|
|
34
|
-
constructor(public
|
|
35
|
-
super(
|
|
34
|
+
constructor(public api: string, public method: string, public field: string) {
|
|
35
|
+
super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".");
|
|
36
36
|
}
|
|
37
37
|
}
|
package/apis/exception.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents an error caused by an api call i.e. it has attributes for a HTTP status code
|
|
2
|
+
* Represents an error caused by an api call i.e. it has attributes for a HTTP status code
|
|
3
3
|
* and the returned body object.
|
|
4
4
|
*
|
|
5
5
|
* Example
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
export class ApiException<T> extends Error {
|
|
11
|
-
public constructor(public code: number, public body: T) {
|
|
12
|
-
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body)
|
|
11
|
+
public constructor(public code: number, message: string, public body: T, public headers: { [key: string]: string; }) {
|
|
12
|
+
super("HTTP-Code: " + code + "\nMessage: " + message + "\nBody: " + JSON.stringify(body) + "\nHeaders: " +
|
|
13
|
+
JSON.stringify(headers))
|
|
13
14
|
}
|
|
14
15
|
}
|
package/auth/auth.ts
CHANGED
|
@@ -66,6 +66,7 @@ export class UserKeyAuthentication implements SecurityAuthentication {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
export type AuthMethods = {
|
|
69
|
+
"default"?: SecurityAuthentication,
|
|
69
70
|
"app_key"?: SecurityAuthentication,
|
|
70
71
|
"user_key"?: SecurityAuthentication
|
|
71
72
|
}
|
|
@@ -76,6 +77,7 @@ export type HttpBearerConfiguration = { tokenProvider: TokenProvider };
|
|
|
76
77
|
export type OAuth2Configuration = { accessToken: string };
|
|
77
78
|
|
|
78
79
|
export type AuthMethodsConfiguration = {
|
|
80
|
+
"default"?: SecurityAuthentication,
|
|
79
81
|
"app_key"?: HttpBearerConfiguration,
|
|
80
82
|
"user_key"?: HttpBearerConfiguration
|
|
81
83
|
}
|
|
@@ -90,6 +92,7 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine
|
|
|
90
92
|
if (!config) {
|
|
91
93
|
return authMethods;
|
|
92
94
|
}
|
|
95
|
+
authMethods["default"] = config["default"]
|
|
93
96
|
|
|
94
97
|
if (config["app_key"]) {
|
|
95
98
|
authMethods["app_key"] = new AppKeyAuthentication(
|
|
@@ -104,4 +107,4 @@ export function configureAuthMethods(config: AuthMethodsConfiguration | undefine
|
|
|
104
107
|
}
|
|
105
108
|
|
|
106
109
|
return authMethods;
|
|
107
|
-
}
|
|
110
|
+
}
|
package/configuration.ts
CHANGED
|
@@ -35,7 +35,12 @@ export interface ConfigurationParameters {
|
|
|
35
35
|
/**
|
|
36
36
|
* Configuration for the available authentication methods
|
|
37
37
|
*/
|
|
38
|
-
authMethods
|
|
38
|
+
authMethods?: AuthMethodsConfiguration;
|
|
39
|
+
/**
|
|
40
|
+
* Faster way to configure authentication methods
|
|
41
|
+
*/
|
|
42
|
+
appKey?: string;
|
|
43
|
+
userKey?: string;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
/**
|
|
@@ -51,11 +56,25 @@ export interface ConfigurationParameters {
|
|
|
51
56
|
* @param conf partial configuration
|
|
52
57
|
*/
|
|
53
58
|
export function createConfiguration(conf: ConfigurationParameters): Configuration {
|
|
59
|
+
|
|
60
|
+
const authMethods: AuthMethodsConfiguration = {
|
|
61
|
+
'app_key': {
|
|
62
|
+
tokenProvider: {
|
|
63
|
+
getToken: () => conf.appKey || ''
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
'user_key': {
|
|
67
|
+
tokenProvider: {
|
|
68
|
+
getToken: () => conf.userKey || ''
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
54
73
|
const configuration: Configuration = {
|
|
55
74
|
baseServer: conf.baseServer !== undefined ? conf.baseServer : server1,
|
|
56
75
|
httpApi: conf.httpApi || new DefaultHttpLibrary(),
|
|
57
76
|
middleware: conf.middleware || [],
|
|
58
|
-
authMethods: configureAuthMethods(conf.authMethods)
|
|
77
|
+
authMethods: configureAuthMethods(Object.assign(authMethods, conf.authMethods || {}))
|
|
59
78
|
};
|
|
60
79
|
if (conf.promiseMiddleware) {
|
|
61
80
|
conf.promiseMiddleware.forEach(
|
package/http/http.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// TODO: evaluate if we can easily get rid of this library
|
|
2
2
|
import * as FormData from "form-data";
|
|
3
|
-
// typings of url-parse are incorrect...
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import * as URLParse from "url-parse";
|
|
6
3
|
import { Observable, from } from '../rxjsStub';
|
|
7
4
|
|
|
8
5
|
export * from './isomorphic-fetch';
|
|
@@ -48,16 +45,16 @@ export type RequestBody = undefined | string | FormData;
|
|
|
48
45
|
export class RequestContext {
|
|
49
46
|
private headers: { [key: string]: string } = {};
|
|
50
47
|
private body: RequestBody = undefined;
|
|
51
|
-
private url:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
private url: URL;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Creates the request context using a http method and request resource url
|
|
52
|
+
*
|
|
53
|
+
* @param url url of the requested resource
|
|
54
|
+
* @param httpMethod http method
|
|
55
|
+
*/
|
|
59
56
|
public constructor(url: string, private httpMethod: HttpMethod) {
|
|
60
|
-
this.url = new
|
|
57
|
+
this.url = new URL(url);
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
/*
|
|
@@ -65,7 +62,7 @@ export class RequestContext {
|
|
|
65
62
|
*
|
|
66
63
|
*/
|
|
67
64
|
public getUrl(): string {
|
|
68
|
-
|
|
65
|
+
return this.url.toString();
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
/**
|
|
@@ -73,7 +70,7 @@ export class RequestContext {
|
|
|
73
70
|
*
|
|
74
71
|
*/
|
|
75
72
|
public setUrl(url: string) {
|
|
76
|
-
this.url = new
|
|
73
|
+
this.url = new URL(url);
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
/**
|
|
@@ -90,27 +87,25 @@ export class RequestContext {
|
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
public getHttpMethod(): HttpMethod {
|
|
93
|
-
|
|
90
|
+
return this.httpMethod;
|
|
94
91
|
}
|
|
95
92
|
|
|
96
93
|
public getHeaders(): { [key: string]: string } {
|
|
97
|
-
|
|
94
|
+
return this.headers;
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
public getBody(): RequestBody {
|
|
101
98
|
return this.body;
|
|
102
99
|
}
|
|
103
100
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
queryObj[name] = value;
|
|
107
|
-
this.url.set("query", queryObj);
|
|
101
|
+
public setQueryParam(name: string, value: string) {
|
|
102
|
+
this.url.searchParams.set(name, value);
|
|
108
103
|
}
|
|
109
104
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
|
107
|
+
*
|
|
108
|
+
*/
|
|
114
109
|
public addCookie(name: string, value: string): void {
|
|
115
110
|
if (!this.headers["Cookie"]) {
|
|
116
111
|
this.headers["Cookie"] = "";
|
|
@@ -118,7 +113,7 @@ export class RequestContext {
|
|
|
118
113
|
this.headers["Cookie"] += name + "=" + value + "; ";
|
|
119
114
|
}
|
|
120
115
|
|
|
121
|
-
public setHeaderParam(key: string, value: string): void {
|
|
116
|
+
public setHeaderParam(key: string, value: string): void {
|
|
122
117
|
this.headers[key] = value;
|
|
123
118
|
}
|
|
124
119
|
}
|
|
@@ -128,6 +123,7 @@ export interface ResponseBody {
|
|
|
128
123
|
binary(): Promise<Buffer>;
|
|
129
124
|
}
|
|
130
125
|
|
|
126
|
+
|
|
131
127
|
/**
|
|
132
128
|
* Helper class to generate a `ResponseBody` from binary data
|
|
133
129
|
*/
|
|
@@ -186,6 +182,10 @@ export class ResponseContext {
|
|
|
186
182
|
const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
|
|
187
183
|
return { data, name: fileName };
|
|
188
184
|
}
|
|
185
|
+
|
|
186
|
+
public async getBodyAsAny(): Promise<any> {
|
|
187
|
+
return this.body as any;
|
|
188
|
+
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export interface HttpLibrary {
|
|
@@ -202,4 +202,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
|
|
202
202
|
return from(promiseHttpLibrary.send(request));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
}
|
|
205
|
+
}
|
package/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { createConfiguration } from "./configuration"
|
|
|
5
5
|
export { Configuration } from "./configuration"
|
|
6
6
|
export * from "./apis/exception";
|
|
7
7
|
export * from "./servers";
|
|
8
|
+
export { RequiredError } from "./apis/baseapi";
|
|
8
9
|
|
|
9
10
|
export { PromiseMiddleware as Middleware } from './middleware';
|
|
10
11
|
export { PromiseDefaultApi as DefaultApi } from './types/PromiseAPI';
|
package/middleware.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
|
|
34
34
|
pre(context: RequestContext): Observable<RequestContext> {
|
|
35
35
|
return from(this.middleware.pre(context));
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
post(context: ResponseContext): Observable<ResponseContext> {
|
|
39
39
|
return from(this.middleware.post(context));
|
|
40
40
|
}
|
package/models/App.ts
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* OneSignal
|
|
3
3
|
* A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
|
4
4
|
*
|
|
5
|
-
* API Version: 1.0.
|
|
5
|
+
* API Version: 1.0.1
|
|
6
6
|
* Contact: devrel@onesignal.com
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { HttpFile } from '../http/http';
|
|
10
10
|
|
|
11
11
|
export class App {
|
|
12
|
-
'id'
|
|
12
|
+
'id'?: string;
|
|
13
13
|
/**
|
|
14
14
|
* The name of your app, as displayed on your apps list on the dashboard. This can be renamed.
|
|
15
15
|
*/
|
|
16
16
|
'name'?: string;
|
|
17
17
|
'players'?: number;
|
|
18
18
|
'messageable_players'?: number;
|
|
19
|
-
'updated_at'?:
|
|
20
|
-
'created_at'?:
|
|
19
|
+
'updated_at'?: string;
|
|
20
|
+
'created_at'?: string;
|
|
21
21
|
/**
|
|
22
22
|
* Android: Your Google Project number. Also known as Sender ID.
|
|
23
23
|
*/
|
|
@@ -87,7 +87,7 @@ export class App {
|
|
|
87
87
|
*/
|
|
88
88
|
'organization_id'?: string;
|
|
89
89
|
/**
|
|
90
|
-
* iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you're not using any other plugins, or not using OneSignal SDK methods to read the payload.
|
|
90
|
+
* iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you\'re not using any other plugins, or not using OneSignal SDK methods to read the payload.
|
|
91
91
|
*/
|
|
92
92
|
'additional_data_is_root_payload'?: boolean;
|
|
93
93
|
|
|
@@ -121,13 +121,13 @@ export class App {
|
|
|
121
121
|
{
|
|
122
122
|
"name": "updated_at",
|
|
123
123
|
"baseName": "updated_at",
|
|
124
|
-
"type": "
|
|
124
|
+
"type": "string",
|
|
125
125
|
"format": "date-time"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"name": "created_at",
|
|
129
129
|
"baseName": "created_at",
|
|
130
|
-
"type": "
|
|
130
|
+
"type": "string",
|
|
131
131
|
"format": "date-time"
|
|
132
132
|
},
|
|
133
133
|
{
|
|
@@ -278,7 +278,7 @@ export class App {
|
|
|
278
278
|
static getAttributeTypeMap() {
|
|
279
279
|
return App.attributeTypeMap;
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
public constructor() {
|
|
283
283
|
}
|
|
284
284
|
}
|