Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
aa83a1a8
Commit
aa83a1a8
authored
Sep 17, 2024
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update appAPI.js
parent
1438cb26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
21 deletions
+36
-21
constructor/library/appAPI.js
constructor/library/appAPI.js
+36
-21
No files found.
constructor/library/appAPI.js
View file @
aa83a1a8
...
...
@@ -245,37 +245,52 @@ this.appAPI = {
getAsfDataUUID
:
async
function
(
documentID
)
{
return
new
Promise
(
async
resolve
=>
{
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
`rest/api/formPlayer/getAsfDataUUID?documentID=
${
documentID
}
`
,
resolve
,
'
text
'
,
null
,
err
=>
{
console
.
log
(
`ERROR [ getAsfDataUUID ]:
${
JSON
.
stringify
(
err
)}
`
);
resolve
(
null
);
}
);
try
{
const
{
login
,
password
}
=
Cons
.
creds
;
const
auth
=
"
Basic
"
+
btoa
(
unescape
(
encodeURIComponent
(
`
${
login
}
:
${
password
}
`
)));
const
url
=
`../Synergy/rest/api/formPlayer/getAsfDataUUID?documentID=
${
documentID
}
`
;
const
response
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
headers
:
{
"
Authorization
"
:
auth
}});
if
(
!
response
.
ok
)
throw
new
Error
(
await
response
.
text
());
resolve
(
response
.
text
());
}
catch
(
err
)
{
console
.
log
(
`ERROR [ getAsfDataUUID ]:
${
err
.
message
}
`
);
resolve
(
null
);
}
});
},
getDocumentIdentifier
:
async
function
(
dataUUID
)
{
return
new
Promise
(
async
resolve
=>
{
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
`rest/api/formPlayer/documentIdentifier?dataUUID=
${
dataUUID
}
`
,
resolve
,
'
text
'
,
null
,
err
=>
{
console
.
log
(
`ERROR [ getDocumentIdentifier ]:
${
JSON
.
stringify
(
err
)}
`
);
resolve
(
null
);
}
);
try
{
const
{
login
,
password
}
=
Cons
.
creds
;
const
auth
=
"
Basic
"
+
btoa
(
unescape
(
encodeURIComponent
(
`
${
login
}
:
${
password
}
`
)));
const
url
=
`../Synergy/rest/api/formPlayer/documentIdentifier?dataUUID=
${
dataUUID
}
`
;
const
response
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
headers
:
{
"
Authorization
"
:
auth
}});
if
(
!
response
.
ok
)
throw
new
Error
(
await
response
.
text
());
resolve
(
response
.
text
());
}
catch
(
err
)
{
console
.
log
(
`ERROR [ getDocumentIdentifier ]:
${
err
.
message
}
`
);
resolve
(
null
);
}
});
},
getDocMeaningContent
:
async
function
(
asfDataUUID
)
{
return
new
Promise
(
async
resolve
=>
{
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
`rest/api/formPlayer/getDocMeaningContent?asfDataUUID=
${
asfDataUUID
}
`
,
resolve
,
'
text
'
,
null
,
err
=>
{
console
.
log
(
`ERROR [ getDocMeaningContent ]:
${
JSON
.
stringify
(
err
)}
`
);
resolve
(
null
);
}
);
try
{
const
{
login
,
password
}
=
Cons
.
creds
;
const
auth
=
"
Basic
"
+
btoa
(
unescape
(
encodeURIComponent
(
`
${
login
}
:
${
password
}
`
)));
const
url
=
`../Synergy/rest/api/formPlayer/getDocMeaningContent?asfDataUUID=
${
asfDataUUID
}
`
;
const
response
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
headers
:
{
"
Authorization
"
:
auth
}});
if
(
!
response
.
ok
)
throw
new
Error
(
await
response
.
text
());
resolve
(
response
.
text
());
}
catch
(
err
)
{
console
.
log
(
`ERROR [ getDocMeaningContent ]:
${
err
.
message
}
`
);
resolve
(
null
);
}
});
},
...
...
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