Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Commits
ce972e7e
Commit
ce972e7e
authored
5 years ago
by
Damyan Mitev
Browse files
Options
Downloads
Patches
Plain Diff
implement WopiAPI.createDocument
parent
cacc4624
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!48
269 implement workflow for signing already uploaded document dev
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
javascript/src/iframe/wopiapi-iframe.js
+27
-0
27 additions, 0 deletions
javascript/src/iframe/wopiapi-iframe.js
with
27 additions
and
0 deletions
javascript/src/iframe/wopiapi-iframe.js
+
27
−
0
View file @
ce972e7e
import
{
encodeResponse
}
from
"
../utilities/appUtility
"
;
const
axios
=
require
(
'
axios
'
);
function
WopiAPI
()
{}
...
...
@@ -20,6 +22,31 @@ WopiAPI.prototype.getPassports = function (resourceID, contentType) {
return
axios
(
requestConfig
);
};
WopiAPI
.
prototype
.
createDocument
=
async
(
passportUUID
,
path
,
contentType
,
title
)
=>
{
const
authenticationPublicKey
=
localStorage
.
getItem
(
"
authenticatedIdentity
"
);
if
(
!
authenticationPublicKey
||
!
window
.
loadedIdentities
[
authenticationPublicKey
]
||
!
extendPinCodeTtl
(
authenticationPublicKey
)
)
{
return
encodeResponse
(
"
400
"
,
""
,
"
Identity not authenticated
"
);
}
const
config
=
{
headers
:
{
path
,
passportuuid
:
passportUUID
,
contentType
,
title
}
};
const
response
=
await
executeRestfulFunction
(
"
private
"
,
window
.
viamApi
,
window
.
viamApi
.
documentCreateDocument
,
config
);
const
resourceID
=
response
.
data
;
return
await
this
.
getPassports
(
resourceID
,
contentType
);
};
WopiAPI
.
prototype
.
putDocument
=
function
(
resourceID
,
accessToken
,
file
)
{
const
{
publicKey
,
uuid
,
token
,
deviceHash
}
=
window
.
viamApi
.
getConfig
().
headers
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment