Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
onesignal-node
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Cedar Studios
onesignal-node
Commits
5da1d758
Commit
5da1d758
authored
Mar 15, 2018
by
Fellipe Capelli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update client file with code style used in other files and add editorconfig
parent
8402ed4e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
.editorconfig
.editorconfig
+12
-0
client.js
lib/client.js
+2
-4
constants.js
lib/constants.js
+0
-0
notification.js
lib/notification.js
+0
-0
No files found.
.editorconfig
0 → 100644
View file @
5da1d758
root = true
[*.js]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
lib/client.js
View file @
5da1d758
...
...
@@ -13,7 +13,7 @@ var ALLOWED_CREDENTIALS = [
* make a basic request
* @param url
* @param apiKey
* @param method : [ GET, POS
t
, PUT ...]
* @param method : [ GET, POS
T
, PUT ...]
* @param body
* @param callback (err, httpResponse, body)
*/
...
...
@@ -52,7 +52,7 @@ var basicRequest = function (url, apiKey, method, body, callback) {
* @returns {boolean}
*/
var
checkCredential
=
function
(
credentialName
,
credential
)
{
for
(
var
i
=
0
;
i
<
ALLOWED_CREDENTIALS
.
length
;
i
++
)
{
for
(
var
i
=
0
,
credentialLen
=
ALLOWED_CREDENTIALS
.
length
;
i
<
credentialLen
;
i
++
)
{
if
(
ALLOWED_CREDENTIALS
[
i
].
name
===
credentialName
)
{
if
(
typeof
credential
!==
ALLOWED_CREDENTIALS
[
i
].
type
)
{
throw
credentialName
+
' must be a '
+
ALLOWED_CREDENTIALS
[
i
].
type
;
...
...
@@ -127,7 +127,6 @@ Client.prototype.sendNotification = function (notification, callback) {
}
else
{
throw
'You must set either an "app" or "apps" on Client'
;
}
};
/**
...
...
@@ -308,5 +307,4 @@ Client.prototype.csvExport = function (body, callback) {
return
basicRequest
(
csvUri
,
this
.
app
.
appAuthKey
,
'POST'
,
body
,
callback
);
};
module
.
exports
=
Client
;
lib/constants.js
View file @
5da1d758
lib/notification.js
View file @
5da1d758
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment