@verdocs/js-sdk 5.1.0 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1203,7 +1203,7 @@ class VerdocsEndpoint {
|
|
|
1203
1203
|
environment = 'verdocs';
|
|
1204
1204
|
sessionType = 'user';
|
|
1205
1205
|
persist = true;
|
|
1206
|
-
baseURL = BETA_ORIGINS.includes(window
|
|
1206
|
+
baseURL = BETA_ORIGINS.includes(window?.location?.origin || '') ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';
|
|
1207
1207
|
clientID = 'not-set';
|
|
1208
1208
|
timeout = 60000;
|
|
1209
1209
|
token = null;
|
|
@@ -1409,15 +1409,15 @@ class VerdocsEndpoint {
|
|
|
1409
1409
|
*/
|
|
1410
1410
|
setToken(token, sessionType = 'user') {
|
|
1411
1411
|
if (!token) {
|
|
1412
|
-
window
|
|
1412
|
+
window?.console?.log('[JS_SDK] Clearing token');
|
|
1413
1413
|
return this.clearSession();
|
|
1414
1414
|
}
|
|
1415
1415
|
const session = decodeAccessTokenBody(token);
|
|
1416
1416
|
if (session === null || (session.exp && session.exp * 1000 < new Date().getTime())) {
|
|
1417
|
-
window
|
|
1417
|
+
window?.console?.warn('[JS_SDK] Ignoring attempt to use expired session token');
|
|
1418
1418
|
return this.clearSession();
|
|
1419
1419
|
}
|
|
1420
|
-
window
|
|
1420
|
+
window?.console?.log('[JS_SDK] Setting token', sessionType);
|
|
1421
1421
|
this.token = token;
|
|
1422
1422
|
this.session = session;
|
|
1423
1423
|
this.sub = session.sub;
|
|
@@ -2629,6 +2629,7 @@ const getOrganizationUsage = (endpoint, organizationId, params) => endpoint.api
|
|
|
2629
2629
|
* @api POST /v2/organizations Create organization
|
|
2630
2630
|
* @apiDescription The caller will be assigned an "Owner" profile in the new organization, and it will be set to "current" automatically. A new set of session tokens will be issued to the caller, and the caller should update their endpoint to use the new tokens.
|
|
2631
2631
|
* @apiBody string name The name of the new organization
|
|
2632
|
+
* @apiBody string parent_id? If set, the new organization will be created as a child of the specified parent organization. The caller must be an admin of the parent organization.
|
|
2632
2633
|
* @apiBody string contact_email? Contact email for the new organization
|
|
2633
2634
|
* @apiBody string url? URL for the new organization
|
|
2634
2635
|
* @apiBody string full_logo_url? URL of a large-format PNG logo
|