Skip to content

Commit 3c163dc

Browse files
committed
Bump securelay sdk to v0.0.3
1 parent 71f92ac commit 3c163dc

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

app/utils.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Brief: Helper utilities.
33
*/
44

5-
import securelayEndpoint, * as securelay from 'https://cdn.jsdelivr.net/gh/securelay/[email protected].2/script.js';
5+
import securelayEndpoint, * as securelay from 'https://cdn.jsdelivr.net/gh/securelay/[email protected].3/script.js';
66

77
/*
88
Brief: Returns the first block of hex chars from a v4 UUID as a unique string
@@ -93,30 +93,30 @@ Brief: GET at private path of Securelay.
9393
Arg: Key is string of the format `<privateKey>@<endpointID>`. Optionally provide webhook URL.
9494
Error: Throws status code of the response when promise is rejected.
9595
*/
96-
export async function syncSecurelay (key, webhook = null, timeout = 5000) {
96+
export async function syncSecurelay (key, { webhook, timeout = 5000 } = {}) {
9797
const [privateKey, endpointID] = key.split('@');
98-
return securelay.sync(privateKey, endpointID, webhook, timeout);
98+
return securelay.sync(privateKey, endpointID, { webhook: webhook, timeout: timeout });
9999
}
100100

101-
export async function keySecurelay (timeout = 5000) {
102-
const [_, endpointID] = await securelayEndpoint();
103-
const privateKey = await securelay.key(endpointID, timeout);
101+
export async function keySecurelay ({ timeout = 5000 } = {}) {
102+
const [, endpointID] = await securelayEndpoint();
103+
const privateKey = await securelay.key(endpointID, { timeout: timeout });
104104
return `${privateKey}@${endpointID}`;
105105
}
106106

107-
export async function privateUrlSecurelay (key, timeout = 5000) {
107+
export async function privateUrlSecurelay (key, { timeout = 5000 } = {}) {
108108
const [privateKey, endpointID] = key.split('@');
109-
return securelay.privateUrl(privateKey, endpointID, timeout);
109+
return securelay.privateUrl(privateKey, endpointID, { timeout: timeout });
110110
}
111111

112-
export async function publicUrlSecurelay (key, timeout = 5000) {
112+
export async function publicUrlSecurelay (key, { timeout = 5000 } = {}) {
113113
const [privateKey, endpointID] = key.split('@');
114-
return securelay.publicUrl(privateKey, endpointID, timeout);
114+
return securelay.publicUrl(privateKey, endpointID, { timeout: timeout });
115115
}
116116

117-
export async function appIdSecurelay (key, app='formonit', timeout = 5000) {
117+
export async function appIdSecurelay (key, { app = 'formonit', timeout = 5000 } = {}) {
118118
const [privateKey, endpointID] = key.split('@');
119-
return securelay.appId(endpointID, app, timeout);
119+
return securelay.appId(endpointID, app, { timeout: timeout });
120120
}
121121

122122
/*

app/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function pollPipe (callback, errHandler, pollInterval = 0, timeout = null) {
2525
}
2626

2727
function pollSecurelay (callback, errHandler, pollInterval = 3600000, timeout = 10000) {
28-
syncSecurelay(cache.get('appKey'), cache.get('webhook'), timeout)
28+
syncSecurelay(cache.get('appKey'), { webhook: cache.get('webhook'), timeout: timeout })
2929
.then((dataObj) => callback(dataObj))
3030
.catch((err) => {
3131
err.cause = 'securelay';

0 commit comments

Comments
 (0)