Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
backbone-adapter-javascript
Commits
7dfb8ec8
Unverified
Commit
7dfb8ec8
authored
2 years ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
fix: check presence of config
parent
20f10b52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
30 deletions
+33
-30
dist/adapter.esm.js
dist/adapter.esm.js
+11
-10
dist/adapter.js
dist/adapter.js
+11
-10
src/adapter/index.js
src/adapter/index.js
+11
-10
No files found.
dist/adapter.esm.js
View file @
7dfb8ec8
...
...
@@ -68,12 +68,13 @@ class Adapter {
* @returns {object}
*/
auth
()
{
let
config
=
this
.
config
;
let
adapterConfig
=
this
.
config
;
console
.
error
(
'
config
'
,
adapterConfig
);
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/token`
,
{
.
get
(
`
${
adapterC
onfig
.
api
}
/token`
,
{
params
:
{
client_id
:
c
onfig
.
client_id
,
secret
:
c
onfig
.
secret
,
client_id
:
adapterC
onfig
.
client_id
,
secret
:
adapterC
onfig
.
secret
,
},
})
.
then
((
response
)
=>
{
...
...
@@ -89,10 +90,10 @@ class Adapter {
* @returns {object}
*/
poll
()
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/receive`
,
{
return
this
.
axios
.
get
(
`
${
adapterC
onfig
.
api
}
/receive`
,
{
headers
,
});
})
...
...
@@ -118,11 +119,11 @@ class Adapter {
* @returns
*/
publish
(
topic
,
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/send`
,
`
${
adapterC
onfig
.
api
}
/send`
,
{
topic
,
body
,
...
...
@@ -149,11 +150,11 @@ class Adapter {
* @returns
*/
broadcast
(
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/notify`
,
`
${
adapterC
onfig
.
api
}
/notify`
,
{
body
,
},
...
...
This diff is collapsed.
Click to expand it.
dist/adapter.js
View file @
7dfb8ec8
...
...
@@ -70,12 +70,13 @@ class Adapter {
* @returns {object}
*/
auth
()
{
let
config
=
this
.
config
;
let
adapterConfig
=
this
.
config
;
console
.
error
(
'
config
'
,
adapterConfig
);
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/token`
,
{
.
get
(
`
${
adapterC
onfig
.
api
}
/token`
,
{
params
:
{
client_id
:
c
onfig
.
client_id
,
secret
:
c
onfig
.
secret
,
client_id
:
adapterC
onfig
.
client_id
,
secret
:
adapterC
onfig
.
secret
,
},
})
.
then
((
response
)
=>
{
...
...
@@ -91,10 +92,10 @@ class Adapter {
* @returns {object}
*/
poll
()
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/receive`
,
{
return
this
.
axios
.
get
(
`
${
adapterC
onfig
.
api
}
/receive`
,
{
headers
,
});
})
...
...
@@ -120,11 +121,11 @@ class Adapter {
* @returns
*/
publish
(
topic
,
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/send`
,
`
${
adapterC
onfig
.
api
}
/send`
,
{
topic
,
body
,
...
...
@@ -151,11 +152,11 @@ class Adapter {
* @returns
*/
broadcast
(
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/notify`
,
`
${
adapterC
onfig
.
api
}
/notify`
,
{
body
,
},
...
...
This diff is collapsed.
Click to expand it.
src/adapter/index.js
View file @
7dfb8ec8
...
...
@@ -68,12 +68,13 @@ export class Adapter {
* @returns {object}
*/
auth
()
{
let
config
=
this
.
config
;
let
adapterConfig
=
this
.
config
;
console
.
error
(
'
config
'
,
adapterConfig
);
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/token`
,
{
.
get
(
`
${
adapterC
onfig
.
api
}
/token`
,
{
params
:
{
client_id
:
c
onfig
.
client_id
,
secret
:
c
onfig
.
secret
,
client_id
:
adapterC
onfig
.
client_id
,
secret
:
adapterC
onfig
.
secret
,
},
})
.
then
((
response
)
=>
{
...
...
@@ -89,10 +90,10 @@ export class Adapter {
* @returns {object}
*/
poll
()
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
get
(
`
${
c
onfig
.
api
}
/receive`
,
{
return
this
.
axios
.
get
(
`
${
adapterC
onfig
.
api
}
/receive`
,
{
headers
,
});
})
...
...
@@ -118,11 +119,11 @@ export class Adapter {
* @returns
*/
publish
(
topic
,
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/send`
,
`
${
adapterC
onfig
.
api
}
/send`
,
{
topic
,
body
,
...
...
@@ -149,11 +150,11 @@ export class Adapter {
* @returns
*/
broadcast
(
body
)
{
let
c
onfig
=
this
.
config
;
let
adapterC
onfig
=
this
.
config
;
return
this
.
getAuthorizationHeader
()
.
then
((
headers
)
=>
{
return
this
.
axios
.
post
(
`
${
c
onfig
.
api
}
/notify`
,
`
${
adapterC
onfig
.
api
}
/notify`
,
{
body
,
},
...
...
This diff is collapsed.
Click to expand it.
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