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
eb7cb068
Unverified
Commit
eb7cb068
authored
2 years ago
by
Dan Jones
Browse files
Options
Download
Email Patches
Plain Diff
docs: add comments and examples
+ use response from implicit auth in get auth header
parent
dc9e90b9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
3 deletions
+25
-3
README.md
README.md
+4
-0
dist/adapter.esm.js
dist/adapter.esm.js
+1
-1
dist/adapter.js
dist/adapter.js
+1
-1
dist/protocol.esm.js
dist/protocol.esm.js
+6
-0
dist/protocol.js
dist/protocol.js
+6
-0
src/adapter/index.js
src/adapter/index.js
+1
-1
src/protocol/index.js
src/protocol/index.js
+6
-0
No files found.
README.md
View file @
eb7cb068
...
@@ -92,6 +92,10 @@ The topics have the following structure:
...
@@ -92,6 +92,10 @@ The topics have the following structure:
```
```
project.operator.vehicleType.vehicleID.[send|receive].messageType
project.operator.vehicleType.vehicleID.[send|receive].messageType
# eg
soar.noc.autosub.ah1.send.platform-mission
# or
soar.po.ecosub.eco1.receive.platform-status
```
```
Subscriptions may contain single-word wildcards (
*
) or multi-word wildcards (#).
Subscriptions may contain single-word wildcards (
*
) or multi-word wildcards (#).
...
...
This diff is collapsed.
Click to expand it.
dist/adapter.esm.js
View file @
eb7cb068
...
@@ -47,7 +47,7 @@ class Adapter {
...
@@ -47,7 +47,7 @@ class Adapter {
if
(
!
this
.
tokenValid
())
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
this
.
auth
().
then
((
response
)
=>
{
return
{
return
{
Authorization
:
`Bearer
${
this
.
credentials
.
token
}
`
,
Authorization
:
`Bearer
${
response
.
data
.
token
}
`
,
};
};
});
});
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
dist/adapter.js
View file @
eb7cb068
...
@@ -49,7 +49,7 @@ class Adapter {
...
@@ -49,7 +49,7 @@ class Adapter {
if
(
!
this
.
tokenValid
())
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
this
.
auth
().
then
((
response
)
=>
{
return
{
return
{
Authorization
:
`Bearer
${
this
.
credentials
.
token
}
`
,
Authorization
:
`Bearer
${
response
.
data
.
token
}
`
,
};
};
});
});
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
dist/protocol.esm.js
View file @
eb7cb068
...
@@ -59,6 +59,9 @@ class GenericProtocol {
...
@@ -59,6 +59,9 @@ class GenericProtocol {
/**
/**
* Invoked on receiving a message from the backbone
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {string} type
* @param {object} message
* @param {object} message
* @returns {*}
* @returns {*}
...
@@ -69,6 +72,9 @@ class GenericProtocol {
...
@@ -69,6 +72,9 @@ class GenericProtocol {
/**
/**
* Optionally invoked before delivering a message to the backbone
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {string} type
* @param {*} message
* @param {*} message
* @returns {object}
* @returns {object}
...
...
This diff is collapsed.
Click to expand it.
dist/protocol.js
View file @
eb7cb068
...
@@ -61,6 +61,9 @@ class GenericProtocol {
...
@@ -61,6 +61,9 @@ class GenericProtocol {
/**
/**
* Invoked on receiving a message from the backbone
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {string} type
* @param {object} message
* @param {object} message
* @returns {*}
* @returns {*}
...
@@ -71,6 +74,9 @@ class GenericProtocol {
...
@@ -71,6 +74,9 @@ class GenericProtocol {
/**
/**
* Optionally invoked before delivering a message to the backbone
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {string} type
* @param {*} message
* @param {*} message
* @returns {object}
* @returns {object}
...
...
This diff is collapsed.
Click to expand it.
src/adapter/index.js
View file @
eb7cb068
...
@@ -47,7 +47,7 @@ export class Adapter {
...
@@ -47,7 +47,7 @@ export class Adapter {
if
(
!
this
.
tokenValid
())
if
(
!
this
.
tokenValid
())
return
this
.
auth
().
then
((
response
)
=>
{
return
this
.
auth
().
then
((
response
)
=>
{
return
{
return
{
Authorization
:
`Bearer
${
this
.
credentials
.
token
}
`
,
Authorization
:
`Bearer
${
response
.
data
.
token
}
`
,
};
};
});
});
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
src/protocol/index.js
View file @
eb7cb068
...
@@ -59,6 +59,9 @@ export class GenericProtocol {
...
@@ -59,6 +59,9 @@ export class GenericProtocol {
/**
/**
* Invoked on receiving a message from the backbone
* Invoked on receiving a message from the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the decode method
* @param {string} type
* @param {string} type
* @param {object} message
* @param {object} message
* @returns {*}
* @returns {*}
...
@@ -69,6 +72,9 @@ export class GenericProtocol {
...
@@ -69,6 +72,9 @@ export class GenericProtocol {
/**
/**
* Optionally invoked before delivering a message to the backbone
* Optionally invoked before delivering a message to the backbone
*
* Whilst type isn't used in the generic stub it will
* be needed by sub-classes overriding the encode method
* @param {string} type
* @param {string} type
* @param {*} message
* @param {*} message
* @returns {object}
* @returns {object}
...
...
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