@globus/sdk
Advanced tools
Comparing version 0.1.3-alpha.0 to 0.1.4-alpha.0
@@ -1,1 +0,1 @@ | ||
"use strict";var xe=Object.create;var T=Object.defineProperty,_e=Object.defineProperties,Ie=Object.getOwnPropertyDescriptor,De=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertyNames,te=Object.getOwnPropertySymbols,we=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var oe=(t,e,o)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,s=(t,e)=>{for(var o in e||={})re.call(e,o)&&oe(t,o,e[o]);if(te)for(var o of te(e))Ne.call(e,o)&&oe(t,o,e[o]);return t},ne=(t,e)=>_e(t,De(e));var p=(t,e)=>{for(var o in e)T(t,o,{get:e[o],enumerable:!0})},se=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ae(e))!re.call(t,n)&&n!==o&&T(t,n,{get:()=>e[n],enumerable:!(r=Ie(e,n))||r.enumerable});return t};var ie=(t,e,o)=>(o=t!=null?xe(we(t)):{},se(e||!t||!t.__esModule?T(o,"default",{value:t,enumerable:!0}):o,t)),Ce=t=>se(T({},"__esModule",{value:!0}),t);var V=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var u=(t,e,o)=>(V(t,e,"read from private field"),o?o.call(t):e.get(t)),f=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},h=(t,e,o,r)=>(V(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var Y=(t,e,o)=>(V(t,e,"access private method"),o);var ae=(t,e,o)=>new Promise((r,n)=>{var Ee=g=>{try{q(o.next(g))}catch(B){n(B)}},Re=g=>{try{q(o.throw(g))}catch(B){n(B)}},q=g=>g.done?r(g.value):Promise.resolve(g.value).then(Ee,Re);q((o=o.apply(t,e)).next())});var ot={};p(ot,{auth:()=>w,authorization:()=>U,sdk:()=>Oe,search:()=>W,transfer:()=>M});module.exports=Ce(ot);function Oe(){return"@globus/sdk"}var U={};p(U,{PKCEAuthorization:()=>E,incremental:()=>qe,pkce:()=>We});var de=ie(require("js-pkce"));var w={};p(w,{CONFIG:()=>Ge,getAuthorizationEndpoint:()=>X,getTokenEndpoint:()=>Z});var x={};p(x,{HOSTS:()=>$,ID:()=>m});var m="AUTH",$={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var _={};p(_,{HOSTS:()=>J,ID:()=>i});var i="TRANSFER",J={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var I="FLOWS",ce={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var D={};p(D,{HOSTS:()=>z,ID:()=>l,SCOPES:()=>j});var l="SEARCH",z={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},j={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var A=class extends Error{constructor(o,r){super();this.name="EnvironmentConfigurationError";this.message=`Invalid configuration value provided for ${o} (${r}).`}};function He(){return typeof window!="undefined"?window:process}function Pe(t){return typeof window==typeof t}function ue(t,e=void 0){let o=He(),r;return Pe(o)?r=o:r=o.env,t in r?r[t]:e}var pe={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function Q(){let t=ue("GLOBUS_SDK_ENVIRONMENT",pe.PRODUCTION);if(!t||!Object.values(pe).includes(t))throw new A("GLOBUS_SDK_ENVIRONMENT",t);return t}var at={[m]:m,[i]:i,[I]:I,[l]:l},Ue={[m]:$,[i]:J,[I]:ce,[l]:z};function Le(t,e){return Ue[t][e]}function fe(t,e=Q()){let o=Le(t,e);return ue(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function Fe(t,e="",o=Q()){let r=fe(t,o);return new URL(e,r)}function a(t,e,o){let r=Fe(t,e);if(o&&o.search){let n=new URLSearchParams(o.search);r.search=n.toString()}return r.toString()}var Ge=x;function X(){return a(m,"/v2/oauth2/authorize")}function Z(){return a(m,"/v2/oauth2/token")}var S,N=class{constructor(){f(this,S,{})}get(e){return u(this,S)[e]}set(e,o){u(this,S)[e]=o}remove(e){delete u(this,S)[e]}clear(){h(this,S,{})}};S=new WeakMap;var C=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var v;function me(t="memory"){if(!v){let e;t==="localStorage"?e=C:t==="memory"?e=N:e=t,v=new e}return v}function O(){if(!v)throw Error("You must create a storage system.");return v}function Me(t){let e=t;return!!(e.token_type&&e.access_token)}function ge(t){t.scope.split(" ").forEach(e=>{O().set(e,t)})}function le(t){ge(t),"other_tokens"in t&&t.other_tokens.forEach(ge)}function k(t){let e=O().get(t);return!e||!Me(e)?null:`${e.token_type} ${e.access_token}`}function Se(){O().clear()}var Ke,b,y,R,H,he,P,be,E=class{constructor(e){f(this,H);f(this,P);f(this,b,void 0);f(this,y,void 0);f(this,R,void 0);if(Ke=me("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");h(this,y,s({client_id:e.client_id,authorization_endpoint:X(),token_endpoint:Z()},e)),h(this,b,Y(this,H,he).call(this))}reset(){Y(this,P,be).call(this),Se()}redirect(){this.reset(),window.location.replace(u(this,b).authorizeUrl())}handleCodeRedirect(){return ae(this,arguments,function*(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let n=yield u(this,b).exchangeForAccessToken(o.toString());h(this,R,n),le(u(this,R)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))})}hasToken(){return u(this,y).requested_scopes.split(" ").every(e=>!!k(e))}revoke(){this.reset()}};b=new WeakMap,y=new WeakMap,R=new WeakMap,H=new WeakSet,he=function(){return new de.default(u(this,y))},P=new WeakSet,be=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function We(t){return new E(t)}function qe(t){return new E(t)}var M={};p(M,{CONFIG:()=>Xe,endpoint:()=>G,endpointSearch:()=>Ze,fileOperations:()=>L,taskSubmission:()=>F});var ye=ie(require("cross-fetch")),Te=ye.default;function c(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let n=k(t);n&&(r.Authorization=n)}return Te(e,ne(s({},o),{headers:r}))}function ee(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/endpoint_search",{search:t!=null?t:{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)}var L={};p(L,{ls:()=>Be,mkdir:()=>Ve,rename:()=>Ye,symlink:()=>$e});function d(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Be=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Ve=function(t,e,o){var n;let r=s({DATA_TYPE:"mkdir"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/mkdir`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))},Ye=function(t,e,o){var n;let r=s({DATA_TYPE:"rename"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/rename`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))},$e=function(t,e,o){var n;let r=s({DATA_TYPE:"symlink"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/symlink`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))};var F={};p(F,{submissionId:()=>je,submitDelete:()=>Je,submitTransfer:()=>ze});var Je=function(t,e){var r;let o=s({DATA_TYPE:"delete"},t==null?void 0:t.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/delete"),s({method:"post",body:JSON.stringify(o),headers:d("post")},(r=e==null?void 0:e.fetch)==null?void 0:r.options))},ze=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/transfer"),s({method:"post",body:JSON.stringify(s({DATA_TYPE:"transfer"},t==null?void 0:t.payload)),headers:d("post")},(o=e==null?void 0:e.fetch)==null?void 0:o.options))};function je(t){var e;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/submission_id"),s({},(e=t==null?void 0:t.fetch)==null?void 0:e.options))}var G={};p(G,{get:()=>Qe});var Qe=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/endpoint/${t}`),s({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var Xe=_,Ze=ee;var W={};p(W,{CONFIG:()=>tt,query:()=>K});var K={};p(K,{get:()=>et});var et=function(t,e,o){var r;return c(j.SEARCH,a(l,`/v1/index/${t}/search`,{search:e}),s({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var tt=D; | ||
"use strict";var xe=Object.create;var T=Object.defineProperty,_e=Object.defineProperties,Ie=Object.getOwnPropertyDescriptor,De=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,we=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var te=(t,e,o)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,s=(t,e)=>{for(var o in e||={})oe.call(e,o)&&te(t,o,e[o]);if(ee)for(var o of ee(e))Ne.call(e,o)&&te(t,o,e[o]);return t},re=(t,e)=>_e(t,De(e));var u=(t,e)=>{for(var o in e)T(t,o,{get:e[o],enumerable:!0})},ne=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ae(e))!oe.call(t,n)&&n!==o&&T(t,n,{get:()=>e[n],enumerable:!(r=Ie(e,n))||r.enumerable});return t};var se=(t,e,o)=>(o=t!=null?xe(we(t)):{},ne(e||!t||!t.__esModule?T(o,"default",{value:t,enumerable:!0}):o,t)),Ce=t=>ne(T({},"__esModule",{value:!0}),t);var V=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(V(t,e,"read from private field"),o?o.call(t):e.get(t)),f=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},h=(t,e,o,r)=>(V(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var Y=(t,e,o)=>(V(t,e,"access private method"),o);var ie=(t,e,o)=>new Promise((r,n)=>{var Ee=g=>{try{q(o.next(g))}catch(B){n(B)}},Re=g=>{try{q(o.throw(g))}catch(B){n(B)}},q=g=>g.done?r(g.value):Promise.resolve(g.value).then(Ee,Re);q((o=o.apply(t,e)).next())});var rt={};u(rt,{auth:()=>w,authorization:()=>k,sdk:()=>He,search:()=>W,transfer:()=>M});module.exports=Ce(rt);function He(){return"@globus/sdk"}var k={};u(k,{PKCEAuthorization:()=>E,incremental:()=>qe,pkce:()=>We});var Se=se(require("js-pkce"));var w={};u(w,{CONFIG:()=>Ge,getAuthorizationEndpoint:()=>X,getTokenEndpoint:()=>Z});var x={};u(x,{HOSTS:()=>$,ID:()=>m});var m="AUTH",$={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var _={};u(_,{HOSTS:()=>J,ID:()=>i});var i="TRANSFER",J={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var I="FLOWS",ae={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var D={};u(D,{HOSTS:()=>z,ID:()=>l,SCOPES:()=>j});var l="SEARCH",z={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},j={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var A=class extends Error{constructor(o,r){super();this.name="EnvironmentConfigurationError";this.message=`Invalid configuration value provided for ${o} (${r}).`}};function Oe(){return typeof window!="undefined"?window:process}function Ue(t){return typeof window==typeof t}function ue(t,e=void 0){let o=Oe(),r;return Ue(o)?r=o:r=o.env,t in r?r[t]:e}var ce={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function Q(){let t=ue("GLOBUS_SDK_ENVIRONMENT",ce.PRODUCTION);if(!t||!Object.values(ce).includes(t))throw new A("GLOBUS_SDK_ENVIRONMENT",t);return t}var ct={[m]:m,[i]:i,[I]:I,[l]:l},ke={[m]:$,[i]:J,[I]:ae,[l]:z};function Le(t,e){return ke[t][e]}function pe(t,e=Q()){let o=Le(t,e);return ue(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function Fe(t,e="",o=Q()){let r=pe(t,o);return new URL(e,r)}function a(t,e,o){let r=Fe(t,e);if(o&&o.search){let n=new URLSearchParams(o.search);r.search=n.toString()}return r.toString()}var Ge=x;function X(){return a(m,"/v2/oauth2/authorize")}function Z(){return a(m,"/v2/oauth2/token")}var S,N=class{constructor(){f(this,S,{})}get(e){return p(this,S)[e]}set(e,o){p(this,S)[e]=o}remove(e){delete p(this,S)[e]}clear(){h(this,S,{})}};S=new WeakMap;var C=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var v;function fe(t="memory"){if(!v){let e;t==="localStorage"?e=C:t==="memory"?e=N:e=t,v=new e}return v}function H(){if(!v)throw Error("You must create a storage system.");return v}function Me(t){let e=t;return!!(e.token_type&&e.access_token)}function me(t){t.scope.split(" ").forEach(e=>{H().set(e,t)})}function ge(t){me(t),"other_tokens"in t&&t.other_tokens.forEach(me)}function P(t){let e=H().get(t);return!e||!Me(e)?null:`${e.token_type} ${e.access_token}`}function le(){H().clear()}var Ke,b,y,R,O,de,U,he,E=class{constructor(e){f(this,O);f(this,U);f(this,b,void 0);f(this,y,void 0);f(this,R,void 0);if(Ke=fe("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");h(this,y,s({client_id:e.client_id,authorization_endpoint:X(),token_endpoint:Z()},e)),h(this,b,Y(this,O,de).call(this))}reset(){Y(this,U,he).call(this),le()}redirect(){this.reset(),window.location.replace(p(this,b).authorizeUrl())}handleCodeRedirect(){return ie(this,arguments,function*(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let n=yield p(this,b).exchangeForAccessToken(o.toString());h(this,R,n),ge(p(this,R)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))})}hasToken(){return p(this,y).requested_scopes.split(" ").every(e=>!!P(e))}revoke(){this.reset()}};b=new WeakMap,y=new WeakMap,R=new WeakMap,O=new WeakSet,de=function(){return new Se.default(p(this,y))},U=new WeakSet,he=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function We(t){return new E(t)}function qe(t){return new E(t)}var M={};u(M,{CONFIG:()=>Ze,endpoint:()=>G,endpointSearch:()=>et,fileOperations:()=>L,taskSubmission:()=>F});var be=se(require("cross-fetch")),ye=be.default;function c(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let n=P(t);n&&(r.Authorization=n)}return ye(e,re(s({},o),{headers:r}))}var Be=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/endpoint_search",{search:t!=null?t:{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)},Te=Be;var L={};u(L,{ls:()=>Ve,mkdir:()=>Ye,rename:()=>$e,symlink:()=>Je});function d(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Ve=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Ye=function(t,e,o){var n;let r=s({DATA_TYPE:"mkdir"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/mkdir`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))},$e=function(t,e,o){var n;let r=s({DATA_TYPE:"rename"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/rename`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))},Je=function(t,e,o){var n;let r=s({DATA_TYPE:"symlink"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/symlink`),s({method:"post",body:JSON.stringify(r),headers:d("post")},(n=o==null?void 0:o.fetch)==null?void 0:n.options))};var F={};u(F,{submissionId:()=>Qe,submitDelete:()=>ze,submitTransfer:()=>je});var ze=function(t,e){var r;let o=s({DATA_TYPE:"delete"},t==null?void 0:t.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/delete"),s({method:"post",body:JSON.stringify(o),headers:d("post")},(r=e==null?void 0:e.fetch)==null?void 0:r.options))},je=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/transfer"),s({method:"post",body:JSON.stringify(s({DATA_TYPE:"transfer"},t==null?void 0:t.payload)),headers:d("post")},(o=e==null?void 0:e.fetch)==null?void 0:o.options))};function Qe(t){var e;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/submission_id"),s({},(e=t==null?void 0:t.fetch)==null?void 0:e.options))}var G={};u(G,{get:()=>Xe});var Xe=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/endpoint/${t}`),s({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var Ze=_,et=Te;var W={};u(W,{CONFIG:()=>ot,query:()=>K});var K={};u(K,{get:()=>tt});var tt=function(t,e,o){var r;return c(j.SEARCH,a(l,`/v1/index/${t}/search`,{search:e}),s({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var ot=D; |
@@ -1,1 +0,1 @@ | ||
var oe=Object.defineProperty,ye=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var ee=Object.getOwnPropertySymbols;var ve=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var te=(t,e,o)=>e in t?oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,n=(t,e)=>{for(var o in e||={})ve.call(e,o)&&te(t,o,e[o]);if(ee)for(var o of ee(e))Ee.call(e,o)&&te(t,o,e[o]);return t},re=(t,e)=>ye(t,Te(e));var p=(t,e)=>{for(var o in e)oe(t,o,{get:e[o],enumerable:!0})};var M=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var u=(t,e,o)=>(M(t,e,"read from private field"),o?o.call(t):e.get(t)),f=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},h=(t,e,o,r)=>(M(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var K=(t,e,o)=>(M(t,e,"access private method"),o);var ne=(t,e,o)=>new Promise((r,s)=>{var he=g=>{try{F(o.next(g))}catch(G){s(G)}},be=g=>{try{F(o.throw(g))}catch(G){s(G)}},F=g=>g.done?r(g.value):Promise.resolve(g.value).then(he,be);F((o=o.apply(t,e)).next())});function ze(){return"@globus/sdk"}var j={};p(j,{PKCEAuthorization:()=>v,incremental:()=>He,pkce:()=>ke});import Ce from"js-pkce";var z={};p(z,{CONFIG:()=>we,getAuthorizationEndpoint:()=>$,getTokenEndpoint:()=>J});var R={};p(R,{HOSTS:()=>W,ID:()=>m});var m="AUTH",W={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var x={};p(x,{HOSTS:()=>q,ID:()=>i});var i="TRANSFER",q={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var _="FLOWS",se={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var I={};p(I,{HOSTS:()=>B,ID:()=>l,SCOPES:()=>V});var l="SEARCH",B={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},V={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var D=class extends Error{constructor(o,r){super();this.name="EnvironmentConfigurationError";this.message=`Invalid configuration value provided for ${o} (${r}).`}};function xe(){return typeof window!="undefined"?window:process}function _e(t){return typeof window==typeof t}function ae(t,e=void 0){let o=xe(),r;return _e(o)?r=o:r=o.env,t in r?r[t]:e}var ie={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function Y(){let t=ae("GLOBUS_SDK_ENVIRONMENT",ie.PRODUCTION);if(!t||!Object.values(ie).includes(t))throw new D("GLOBUS_SDK_ENVIRONMENT",t);return t}var Ze={[m]:m,[i]:i,[_]:_,[l]:l},Ie={[m]:W,[i]:q,[_]:se,[l]:B};function De(t,e){return Ie[t][e]}function ce(t,e=Y()){let o=De(t,e);return ae(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function Ae(t,e="",o=Y()){let r=ce(t,o);return new URL(e,r)}function a(t,e,o){let r=Ae(t,e);if(o&&o.search){let s=new URLSearchParams(o.search);r.search=s.toString()}return r.toString()}var we=R;function $(){return a(m,"/v2/oauth2/authorize")}function J(){return a(m,"/v2/oauth2/token")}var S,A=class{constructor(){f(this,S,{})}get(e){return u(this,S)[e]}set(e,o){u(this,S)[e]=o}remove(e){delete u(this,S)[e]}clear(){h(this,S,{})}};S=new WeakMap;var w=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var T;function pe(t="memory"){if(!T){let e;t==="localStorage"?e=w:t==="memory"?e=A:e=t,T=new e}return T}function N(){if(!T)throw Error("You must create a storage system.");return T}function Ne(t){let e=t;return!!(e.token_type&&e.access_token)}function ue(t){t.scope.split(" ").forEach(e=>{N().set(e,t)})}function fe(t){ue(t),"other_tokens"in t&&t.other_tokens.forEach(ue)}function C(t){let e=N().get(t);return!e||!Ne(e)?null:`${e.token_type} ${e.access_token}`}function me(){N().clear()}var Oe,b,y,E,O,ge,k,le,v=class{constructor(e){f(this,O);f(this,k);f(this,b,void 0);f(this,y,void 0);f(this,E,void 0);if(Oe=pe("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");h(this,y,n({client_id:e.client_id,authorization_endpoint:$(),token_endpoint:J()},e)),h(this,b,K(this,O,ge).call(this))}reset(){K(this,k,le).call(this),me()}redirect(){this.reset(),window.location.replace(u(this,b).authorizeUrl())}handleCodeRedirect(){return ne(this,arguments,function*(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let s=yield u(this,b).exchangeForAccessToken(o.toString());h(this,E,s),fe(u(this,E)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))})}hasToken(){return u(this,y).requested_scopes.split(" ").every(e=>!!C(e))}revoke(){this.reset()}};b=new WeakMap,y=new WeakMap,E=new WeakMap,O=new WeakSet,ge=function(){return new Ce(u(this,y))},k=new WeakSet,le=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function ke(t){return new v(t)}function He(t){return new v(t)}var X={};p(X,{CONFIG:()=>Be,endpoint:()=>U,endpointSearch:()=>Ve,fileOperations:()=>H,taskSubmission:()=>P});import Pe from"cross-fetch";var Se=Pe;function c(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let s=C(t);s&&(r.Authorization=s)}return Se(e,re(n({},o),{headers:r}))}function Q(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/endpoint_search",{search:t!=null?t:{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)}var H={};p(H,{ls:()=>Ue,mkdir:()=>Le,rename:()=>Fe,symlink:()=>Ge});function d(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Ue=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Le=function(t,e,o){var s;let r=n({DATA_TYPE:"mkdir"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/mkdir`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))},Fe=function(t,e,o){var s;let r=n({DATA_TYPE:"rename"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/rename`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))},Ge=function(t,e,o){var s;let r=n({DATA_TYPE:"symlink"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/symlink`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))};var P={};p(P,{submissionId:()=>We,submitDelete:()=>Me,submitTransfer:()=>Ke});var Me=function(t,e){var r;let o=n({DATA_TYPE:"delete"},t==null?void 0:t.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/delete"),n({method:"post",body:JSON.stringify(o),headers:d("post")},(r=e==null?void 0:e.fetch)==null?void 0:r.options))},Ke=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/transfer"),n({method:"post",body:JSON.stringify(n({DATA_TYPE:"transfer"},t==null?void 0:t.payload)),headers:d("post")},(o=e==null?void 0:e.fetch)==null?void 0:o.options))};function We(t){var e;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/submission_id"),n({},(e=t==null?void 0:t.fetch)==null?void 0:e.options))}var U={};p(U,{get:()=>qe});var qe=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/endpoint/${t}`),n({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var Be=x,Ve=Q;var Z={};p(Z,{CONFIG:()=>$e,query:()=>L});var L={};p(L,{get:()=>Ye});var Ye=function(t,e,o){var r;return c(V.SEARCH,a(l,`/v1/index/${t}/search`,{search:e}),n({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var $e=I;export{z as auth,j as authorization,ze as sdk,Z as search,X as transfer}; | ||
var te=Object.defineProperty,ye=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var ve=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable;var ee=(t,e,o)=>e in t?te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,n=(t,e)=>{for(var o in e||={})ve.call(e,o)&&ee(t,o,e[o]);if(Z)for(var o of Z(e))Ee.call(e,o)&&ee(t,o,e[o]);return t},oe=(t,e)=>ye(t,Te(e));var u=(t,e)=>{for(var o in e)te(t,o,{get:e[o],enumerable:!0})};var M=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(M(t,e,"read from private field"),o?o.call(t):e.get(t)),f=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},h=(t,e,o,r)=>(M(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var K=(t,e,o)=>(M(t,e,"access private method"),o);var re=(t,e,o)=>new Promise((r,s)=>{var he=g=>{try{F(o.next(g))}catch(G){s(G)}},be=g=>{try{F(o.throw(g))}catch(G){s(G)}},F=g=>g.done?r(g.value):Promise.resolve(g.value).then(he,be);F((o=o.apply(t,e)).next())});function je(){return"@globus/sdk"}var j={};u(j,{PKCEAuthorization:()=>v,incremental:()=>Oe,pkce:()=>Pe});import Ce from"js-pkce";var z={};u(z,{CONFIG:()=>we,getAuthorizationEndpoint:()=>$,getTokenEndpoint:()=>J});var R={};u(R,{HOSTS:()=>W,ID:()=>m});var m="AUTH",W={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var x={};u(x,{HOSTS:()=>q,ID:()=>i});var i="TRANSFER",q={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var _="FLOWS",ne={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var I={};u(I,{HOSTS:()=>B,ID:()=>l,SCOPES:()=>V});var l="SEARCH",B={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},V={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var D=class extends Error{constructor(o,r){super();this.name="EnvironmentConfigurationError";this.message=`Invalid configuration value provided for ${o} (${r}).`}};function xe(){return typeof window!="undefined"?window:process}function _e(t){return typeof window==typeof t}function ie(t,e=void 0){let o=xe(),r;return _e(o)?r=o:r=o.env,t in r?r[t]:e}var se={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function Y(){let t=ie("GLOBUS_SDK_ENVIRONMENT",se.PRODUCTION);if(!t||!Object.values(se).includes(t))throw new D("GLOBUS_SDK_ENVIRONMENT",t);return t}var et={[m]:m,[i]:i,[_]:_,[l]:l},Ie={[m]:W,[i]:q,[_]:ne,[l]:B};function De(t,e){return Ie[t][e]}function ae(t,e=Y()){let o=De(t,e);return ie(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function Ae(t,e="",o=Y()){let r=ae(t,o);return new URL(e,r)}function a(t,e,o){let r=Ae(t,e);if(o&&o.search){let s=new URLSearchParams(o.search);r.search=s.toString()}return r.toString()}var we=R;function $(){return a(m,"/v2/oauth2/authorize")}function J(){return a(m,"/v2/oauth2/token")}var S,A=class{constructor(){f(this,S,{})}get(e){return p(this,S)[e]}set(e,o){p(this,S)[e]=o}remove(e){delete p(this,S)[e]}clear(){h(this,S,{})}};S=new WeakMap;var w=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var T;function ce(t="memory"){if(!T){let e;t==="localStorage"?e=w:t==="memory"?e=A:e=t,T=new e}return T}function N(){if(!T)throw Error("You must create a storage system.");return T}function Ne(t){let e=t;return!!(e.token_type&&e.access_token)}function ue(t){t.scope.split(" ").forEach(e=>{N().set(e,t)})}function pe(t){ue(t),"other_tokens"in t&&t.other_tokens.forEach(ue)}function C(t){let e=N().get(t);return!e||!Ne(e)?null:`${e.token_type} ${e.access_token}`}function fe(){N().clear()}var He,b,y,E,H,me,P,ge,v=class{constructor(e){f(this,H);f(this,P);f(this,b,void 0);f(this,y,void 0);f(this,E,void 0);if(He=ce("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");h(this,y,n({client_id:e.client_id,authorization_endpoint:$(),token_endpoint:J()},e)),h(this,b,K(this,H,me).call(this))}reset(){K(this,P,ge).call(this),fe()}redirect(){this.reset(),window.location.replace(p(this,b).authorizeUrl())}handleCodeRedirect(){return re(this,arguments,function*(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let s=yield p(this,b).exchangeForAccessToken(o.toString());h(this,E,s),pe(p(this,E)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))})}hasToken(){return p(this,y).requested_scopes.split(" ").every(e=>!!C(e))}revoke(){this.reset()}};b=new WeakMap,y=new WeakMap,E=new WeakMap,H=new WeakSet,me=function(){return new Ce(p(this,y))},P=new WeakSet,ge=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function Pe(t){return new v(t)}function Oe(t){return new v(t)}var Q={};u(Q,{CONFIG:()=>Ve,endpoint:()=>k,endpointSearch:()=>Ye,fileOperations:()=>O,taskSubmission:()=>U});import Ue from"cross-fetch";var le=Ue;function c(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let s=C(t);s&&(r.Authorization=s)}return le(e,oe(n({},o),{headers:r}))}var ke=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/endpoint_search",{search:t!=null?t:{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)},Se=ke;var O={};u(O,{ls:()=>Le,mkdir:()=>Fe,rename:()=>Ge,symlink:()=>Me});function d(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Le=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Fe=function(t,e,o){var s;let r=n({DATA_TYPE:"mkdir"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/mkdir`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))},Ge=function(t,e,o){var s;let r=n({DATA_TYPE:"rename"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/rename`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))},Me=function(t,e,o){var s;let r=n({DATA_TYPE:"symlink"},e==null?void 0:e.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/operation/endpoint/${t}/symlink`),n({method:"post",body:JSON.stringify(r),headers:d("post")},(s=o==null?void 0:o.fetch)==null?void 0:s.options))};var U={};u(U,{submissionId:()=>qe,submitDelete:()=>Ke,submitTransfer:()=>We});var Ke=function(t,e){var r;let o=n({DATA_TYPE:"delete"},t==null?void 0:t.payload);return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/delete"),n({method:"post",body:JSON.stringify(o),headers:d("post")},(r=e==null?void 0:e.fetch)==null?void 0:r.options))},We=function(t,e){var o;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/transfer"),n({method:"post",body:JSON.stringify(n({DATA_TYPE:"transfer"},t==null?void 0:t.payload)),headers:d("post")},(o=e==null?void 0:e.fetch)==null?void 0:o.options))};function qe(t){var e;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,"/v0.10/submission_id"),n({},(e=t==null?void 0:t.fetch)==null?void 0:e.options))}var k={};u(k,{get:()=>Be});var Be=function(t,e,o){var r;return c("urn:globus:auth:scope:transfer.api.globus.org:all",a(i,`/v0.10/endpoint/${t}`),n({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var Ve=x,Ye=Se;var X={};u(X,{CONFIG:()=>Je,query:()=>L});var L={};u(L,{get:()=>$e});var $e=function(t,e,o){var r;return c(V.SEARCH,a(l,`/v1/index/${t}/search`,{search:e}),n({},(r=o==null?void 0:o.fetch)==null?void 0:r.options))};var Je=I;export{z as auth,j as authorization,je as sdk,X as search,Q as transfer}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var ge=Object.create;var v=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},Q=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Se(e))!he.call(t,n)&&n!==o&&v(t,n,{get:()=>e[n],enumerable:!(r=le(e,n))||r.enumerable});return t};var X=(t,e,o)=>(o=t!=null?ge(de(t)):{},Q(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),be=t=>Q(v({},"__esModule",{value:!0}),t);var k=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(k(t,e,"read from private field"),o?o.call(t):e.get(t)),u=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},S=(t,e,o,r)=>(k(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var H=(t,e,o)=>(k(t,e,"access private method"),o);var qe={};c(qe,{auth:()=>W,authorization:()=>q,sdk:()=>ye,search:()=>j,transfer:()=>J});module.exports=be(qe);function ye(){return"@globus/sdk"}var q={};c(q,{PKCEAuthorization:()=>y,incremental:()=>Ne,pkce:()=>we});var ae=X(require("js-pkce"));var W={};c(W,{CONFIG:()=>Ie,getAuthorizationEndpoint:()=>M,getTokenEndpoint:()=>K});var E={};c(E,{HOSTS:()=>P,ID:()=>m});var m="AUTH",P={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var R={};c(R,{HOSTS:()=>U,ID:()=>s});var s="TRANSFER",U={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var x="FLOWS",Z={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var _={};c(_,{HOSTS:()=>L,ID:()=>f,SCOPES:()=>F});var f="SEARCH",L={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},F={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var I=class extends Error{name="EnvironmentConfigurationError";constructor(e,o){super(),this.message=`Invalid configuration value provided for ${e} (${o}).`}};function ve(){return typeof window<"u"?window:process}function Ee(t){return typeof window==typeof t}function te(t,e=void 0){let o=ve(),r;return Ee(o)?r=o:r=o.env,t in r?r[t]:e}var ee={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function G(){let t=te("GLOBUS_SDK_ENVIRONMENT",ee.PRODUCTION);if(!t||!Object.values(ee).includes(t))throw new I("GLOBUS_SDK_ENVIRONMENT",t);return t}var Je={[m]:m,[s]:s,[x]:x,[f]:f},Re={[m]:P,[s]:U,[x]:Z,[f]:L};function xe(t,e){return Re[t][e]}function oe(t,e=G()){let o=xe(t,e);return te(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function _e(t,e="",o=G()){let r=oe(t,o);return new URL(e,r)}function i(t,e,o){let r=_e(t,e);if(o&&o.search){let n=new URLSearchParams(o.search);r.search=n.toString()}return r.toString()}var Ie=E;function M(){return i(m,"/v2/oauth2/authorize")}function K(){return i(m,"/v2/oauth2/token")}var g,D=class{constructor(){u(this,g,{})}get(e){return p(this,g)[e]}set(e,o){p(this,g)[e]=o}remove(e){delete p(this,g)[e]}clear(){S(this,g,{})}};g=new WeakMap;var A=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var b;function re(t="memory"){if(!b){let e;t==="localStorage"?e=A:t==="memory"?e=D:e=t,b=new e}return b}function w(){if(!b)throw Error("You must create a storage system.");return b}function De(t){let e=t;return!!(e.token_type&&e.access_token)}function ne(t){t.scope.split(" ").forEach(e=>{w().set(e,t)})}function se(t){ne(t),"other_tokens"in t&&t.other_tokens.forEach(ne)}function N(t){let e=w().get(t);return!e||!De(e)?null:`${e.token_type} ${e.access_token}`}function ie(){w().clear()}var Ae,d,h,T,C,ce,O,pe,y=class{constructor(e){u(this,C);u(this,O);u(this,d,void 0);u(this,h,void 0);u(this,T,void 0);if(Ae=re("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");S(this,h,{client_id:e.client_id,authorization_endpoint:M(),token_endpoint:K(),...e}),S(this,d,H(this,C,ce).call(this))}reset(){H(this,O,pe).call(this),ie()}redirect(){this.reset(),window.location.replace(p(this,d).authorizeUrl())}async handleCodeRedirect(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let n=await p(this,d).exchangeForAccessToken(o.toString());S(this,T,n),se(p(this,T)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))}hasToken(){return p(this,h).requested_scopes.split(" ").every(e=>!!N(e))}revoke(){this.reset()}};d=new WeakMap,h=new WeakMap,T=new WeakMap,C=new WeakSet,ce=function(){return new ae.default(p(this,h))},O=new WeakSet,pe=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function we(t){return new y(t)}function Ne(t){return new y(t)}var J={};c(J,{CONFIG:()=>Ge,endpoint:()=>$,endpointSearch:()=>Me,fileOperations:()=>V,taskSubmission:()=>Y});var ue=X(require("cross-fetch")),me=ue.default;function a(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let n=N(t);n&&(r.Authorization=n)}return me(e,{...o,headers:r})}function B(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/endpoint_search",{search:t??{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)}var V={};c(V,{ls:()=>Ce,mkdir:()=>Oe,rename:()=>ke,symlink:()=>He});function l(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Ce=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Oe=function(t,e,o){var n;let r={DATA_TYPE:"mkdir",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/mkdir`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})},ke=function(t,e,o){var n;let r={DATA_TYPE:"rename",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/rename`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})},He=function(t,e,o){var n;let r={DATA_TYPE:"symlink",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/symlink`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})};var Y={};c(Y,{submissionId:()=>Le,submitDelete:()=>Pe,submitTransfer:()=>Ue});var Pe=function(t,e){var r;let o={DATA_TYPE:"delete",...t==null?void 0:t.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/delete"),{method:"post",body:JSON.stringify(o),headers:l("post"),...(r=e==null?void 0:e.fetch)==null?void 0:r.options})},Ue=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/transfer"),{method:"post",body:JSON.stringify({DATA_TYPE:"transfer",...t==null?void 0:t.payload}),headers:l("post"),...(o=e==null?void 0:e.fetch)==null?void 0:o.options})};function Le(t){var e;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/submission_id"),{...(e=t==null?void 0:t.fetch)==null?void 0:e.options})}var $={};c($,{get:()=>Fe});var Fe=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/endpoint/${t}`),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var Ge=R,Me=B;var j={};c(j,{CONFIG:()=>We,query:()=>z});var z={};c(z,{get:()=>Ke});var Ke=function(t,e,o){var r;return a(F.SEARCH,i(f,`/v1/index/${t}/search`,{search:e}),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var We=_; | ||
"use strict";var ge=Object.create;var v=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,he=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)v(t,o,{get:e[o],enumerable:!0})},j=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Se(e))!he.call(t,n)&&n!==o&&v(t,n,{get:()=>e[n],enumerable:!(r=le(e,n))||r.enumerable});return t};var Q=(t,e,o)=>(o=t!=null?ge(de(t)):{},j(e||!t||!t.__esModule?v(o,"default",{value:t,enumerable:!0}):o,t)),be=t=>j(v({},"__esModule",{value:!0}),t);var P=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(P(t,e,"read from private field"),o?o.call(t):e.get(t)),u=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},S=(t,e,o,r)=>(P(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var O=(t,e,o)=>(P(t,e,"access private method"),o);var Be={};c(Be,{auth:()=>W,authorization:()=>q,sdk:()=>ye,search:()=>z,transfer:()=>$});module.exports=be(Be);function ye(){return"@globus/sdk"}var q={};c(q,{PKCEAuthorization:()=>y,incremental:()=>Ne,pkce:()=>we});var ie=Q(require("js-pkce"));var W={};c(W,{CONFIG:()=>Ie,getAuthorizationEndpoint:()=>M,getTokenEndpoint:()=>K});var E={};c(E,{HOSTS:()=>U,ID:()=>f});var f="AUTH",U={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var R={};c(R,{HOSTS:()=>k,ID:()=>s});var s="TRANSFER",k={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var x="FLOWS",X={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var _={};c(_,{HOSTS:()=>L,ID:()=>m,SCOPES:()=>F});var m="SEARCH",L={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},F={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var I=class extends Error{name="EnvironmentConfigurationError";constructor(e,o){super(),this.message=`Invalid configuration value provided for ${e} (${o}).`}};function ve(){return typeof window<"u"?window:process}function Ee(t){return typeof window==typeof t}function ee(t,e=void 0){let o=ve(),r;return Ee(o)?r=o:r=o.env,t in r?r[t]:e}var Z={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function G(){let t=ee("GLOBUS_SDK_ENVIRONMENT",Z.PRODUCTION);if(!t||!Object.values(Z).includes(t))throw new I("GLOBUS_SDK_ENVIRONMENT",t);return t}var ze={[f]:f,[s]:s,[x]:x,[m]:m},Re={[f]:U,[s]:k,[x]:X,[m]:L};function xe(t,e){return Re[t][e]}function te(t,e=G()){let o=xe(t,e);return ee(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function _e(t,e="",o=G()){let r=te(t,o);return new URL(e,r)}function i(t,e,o){let r=_e(t,e);if(o&&o.search){let n=new URLSearchParams(o.search);r.search=n.toString()}return r.toString()}var Ie=E;function M(){return i(f,"/v2/oauth2/authorize")}function K(){return i(f,"/v2/oauth2/token")}var g,D=class{constructor(){u(this,g,{})}get(e){return p(this,g)[e]}set(e,o){p(this,g)[e]=o}remove(e){delete p(this,g)[e]}clear(){S(this,g,{})}};g=new WeakMap;var A=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var b;function oe(t="memory"){if(!b){let e;t==="localStorage"?e=A:t==="memory"?e=D:e=t,b=new e}return b}function w(){if(!b)throw Error("You must create a storage system.");return b}function De(t){let e=t;return!!(e.token_type&&e.access_token)}function re(t){t.scope.split(" ").forEach(e=>{w().set(e,t)})}function ne(t){re(t),"other_tokens"in t&&t.other_tokens.forEach(re)}function N(t){let e=w().get(t);return!e||!De(e)?null:`${e.token_type} ${e.access_token}`}function se(){w().clear()}var Ae,d,h,T,C,ae,H,ce,y=class{constructor(e){u(this,C);u(this,H);u(this,d,void 0);u(this,h,void 0);u(this,T,void 0);if(Ae=oe("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");S(this,h,{client_id:e.client_id,authorization_endpoint:M(),token_endpoint:K(),...e}),S(this,d,O(this,C,ae).call(this))}reset(){O(this,H,ce).call(this),se()}redirect(){this.reset(),window.location.replace(p(this,d).authorizeUrl())}async handleCodeRedirect(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let n=await p(this,d).exchangeForAccessToken(o.toString());S(this,T,n),ne(p(this,T)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))}hasToken(){return p(this,h).requested_scopes.split(" ").every(e=>!!N(e))}revoke(){this.reset()}};d=new WeakMap,h=new WeakMap,T=new WeakMap,C=new WeakSet,ae=function(){return new ie.default(p(this,h))},H=new WeakSet,ce=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function we(t){return new y(t)}function Ne(t){return new y(t)}var $={};c($,{CONFIG:()=>Me,endpoint:()=>Y,endpointSearch:()=>Ke,fileOperations:()=>B,taskSubmission:()=>V});var pe=Q(require("cross-fetch")),ue=pe.default;function a(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let n=N(t);n&&(r.Authorization=n)}return ue(e,{...o,headers:r})}var Ce=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/endpoint_search",{search:t??{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)},fe=Ce;var B={};c(B,{ls:()=>He,mkdir:()=>Pe,rename:()=>Oe,symlink:()=>Ue});function l(t){return t==="get"?{}:{"Content-Type":"application/json"}}var He=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Pe=function(t,e,o){var n;let r={DATA_TYPE:"mkdir",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/mkdir`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})},Oe=function(t,e,o){var n;let r={DATA_TYPE:"rename",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/rename`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})},Ue=function(t,e,o){var n;let r={DATA_TYPE:"symlink",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/operation/endpoint/${t}/symlink`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(n=o==null?void 0:o.fetch)==null?void 0:n.options})};var V={};c(V,{submissionId:()=>Fe,submitDelete:()=>ke,submitTransfer:()=>Le});var ke=function(t,e){var r;let o={DATA_TYPE:"delete",...t==null?void 0:t.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/delete"),{method:"post",body:JSON.stringify(o),headers:l("post"),...(r=e==null?void 0:e.fetch)==null?void 0:r.options})},Le=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/transfer"),{method:"post",body:JSON.stringify({DATA_TYPE:"transfer",...t==null?void 0:t.payload}),headers:l("post"),...(o=e==null?void 0:e.fetch)==null?void 0:o.options})};function Fe(t){var e;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,"/v0.10/submission_id"),{...(e=t==null?void 0:t.fetch)==null?void 0:e.options})}var Y={};c(Y,{get:()=>Ge});var Ge=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",i(s,`/v0.10/endpoint/${t}`),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var Me=R,Ke=fe;var z={};c(z,{CONFIG:()=>qe,query:()=>J});var J={};c(J,{get:()=>We});var We=function(t,e,o){var r;return a(F.SEARCH,i(m,`/v1/index/${t}/search`,{search:e}),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var qe=_; |
@@ -1,1 +0,1 @@ | ||
var ce=Object.defineProperty;var c=(t,e)=>{for(var o in e)ce(t,o,{get:e[o],enumerable:!0})};var O=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(O(t,e,"read from private field"),o?o.call(t):e.get(t)),u=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},S=(t,e,o,r)=>(O(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var k=(t,e,o)=>(O(t,e,"access private method"),o);function Pe(){return"@globus/sdk"}var re={};c(re,{PKCEAuthorization:()=>y,incremental:()=>Te,pkce:()=>ye});import he from"js-pkce";var j={};c(j,{CONFIG:()=>Se,getAuthorizationEndpoint:()=>G,getTokenEndpoint:()=>M});var v={};c(v,{HOSTS:()=>H,ID:()=>m});var m="AUTH",H={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var E={};c(E,{HOSTS:()=>P,ID:()=>n});var n="TRANSFER",P={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var R="FLOWS",Y={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var x={};c(x,{HOSTS:()=>U,ID:()=>f,SCOPES:()=>L});var f="SEARCH",U={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},L={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var _=class extends Error{name="EnvironmentConfigurationError";constructor(e,o){super(),this.message=`Invalid configuration value provided for ${e} (${o}).`}};function ue(){return typeof window<"u"?window:process}function me(t){return typeof window==typeof t}function J(t,e=void 0){let o=ue(),r;return me(o)?r=o:r=o.env,t in r?r[t]:e}var $={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function F(){let t=J("GLOBUS_SDK_ENVIRONMENT",$.PRODUCTION);if(!t||!Object.values($).includes(t))throw new _("GLOBUS_SDK_ENVIRONMENT",t);return t}var Ge={[m]:m,[n]:n,[R]:R,[f]:f},fe={[m]:H,[n]:P,[R]:Y,[f]:U};function ge(t,e){return fe[t][e]}function z(t,e=F()){let o=ge(t,e);return J(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function le(t,e="",o=F()){let r=z(t,o);return new URL(e,r)}function s(t,e,o){let r=le(t,e);if(o&&o.search){let i=new URLSearchParams(o.search);r.search=i.toString()}return r.toString()}var Se=v;function G(){return s(m,"/v2/oauth2/authorize")}function M(){return s(m,"/v2/oauth2/token")}var g,I=class{constructor(){u(this,g,{})}get(e){return p(this,g)[e]}set(e,o){p(this,g)[e]=o}remove(e){delete p(this,g)[e]}clear(){S(this,g,{})}};g=new WeakMap;var D=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var b;function Q(t="memory"){if(!b){let e;t==="localStorage"?e=D:t==="memory"?e=I:e=t,b=new e}return b}function A(){if(!b)throw Error("You must create a storage system.");return b}function de(t){let e=t;return!!(e.token_type&&e.access_token)}function X(t){t.scope.split(" ").forEach(e=>{A().set(e,t)})}function Z(t){X(t),"other_tokens"in t&&t.other_tokens.forEach(X)}function w(t){let e=A().get(t);return!e||!de(e)?null:`${e.token_type} ${e.access_token}`}function ee(){A().clear()}var be,d,h,T,N,te,C,oe,y=class{constructor(e){u(this,N);u(this,C);u(this,d,void 0);u(this,h,void 0);u(this,T,void 0);if(be=Q("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");S(this,h,{client_id:e.client_id,authorization_endpoint:G(),token_endpoint:M(),...e}),S(this,d,k(this,N,te).call(this))}reset(){k(this,C,oe).call(this),ee()}redirect(){this.reset(),window.location.replace(p(this,d).authorizeUrl())}async handleCodeRedirect(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let i=await p(this,d).exchangeForAccessToken(o.toString());S(this,T,i),Z(p(this,T)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))}hasToken(){return p(this,h).requested_scopes.split(" ").every(e=>!!w(e))}revoke(){this.reset()}};d=new WeakMap,h=new WeakMap,T=new WeakMap,N=new WeakSet,te=function(){return new he(p(this,h))},C=new WeakSet,oe=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function ye(t){return new y(t)}function Te(t){return new y(t)}var ie={};c(ie,{CONFIG:()=>Ne,endpoint:()=>B,endpointSearch:()=>Ce,fileOperations:()=>W,taskSubmission:()=>q});import ve from"cross-fetch";var ne=ve;function a(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let i=w(t);i&&(r.Authorization=i)}return ne(e,{...o,headers:r})}function K(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/endpoint_search",{search:t??{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)}var W={};c(W,{ls:()=>Ee,mkdir:()=>Re,rename:()=>xe,symlink:()=>_e});function l(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Ee=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},Re=function(t,e,o){var i;let r={DATA_TYPE:"mkdir",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/mkdir`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})},xe=function(t,e,o){var i;let r={DATA_TYPE:"rename",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/rename`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})},_e=function(t,e,o){var i;let r={DATA_TYPE:"symlink",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/symlink`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})};var q={};c(q,{submissionId:()=>Ae,submitDelete:()=>Ie,submitTransfer:()=>De});var Ie=function(t,e){var r;let o={DATA_TYPE:"delete",...t==null?void 0:t.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/delete"),{method:"post",body:JSON.stringify(o),headers:l("post"),...(r=e==null?void 0:e.fetch)==null?void 0:r.options})},De=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/transfer"),{method:"post",body:JSON.stringify({DATA_TYPE:"transfer",...t==null?void 0:t.payload}),headers:l("post"),...(o=e==null?void 0:e.fetch)==null?void 0:o.options})};function Ae(t){var e;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/submission_id"),{...(e=t==null?void 0:t.fetch)==null?void 0:e.options})}var B={};c(B,{get:()=>we});var we=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/endpoint/${t}`),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var Ne=E,Ce=K;var ae={};c(ae,{CONFIG:()=>ke,query:()=>V});var V={};c(V,{get:()=>Oe});var Oe=function(t,e,o){var r;return a(L.SEARCH,s(f,`/v1/index/${t}/search`,{search:e}),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var ke=x;export{j as auth,re as authorization,Pe as sdk,ae as search,ie as transfer}; | ||
var ce=Object.defineProperty;var c=(t,e)=>{for(var o in e)ce(t,o,{get:e[o],enumerable:!0})};var H=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)};var p=(t,e,o)=>(H(t,e,"read from private field"),o?o.call(t):e.get(t)),u=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},S=(t,e,o,r)=>(H(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o);var P=(t,e,o)=>(H(t,e,"access private method"),o);function ke(){return"@globus/sdk"}var oe={};c(oe,{PKCEAuthorization:()=>y,incremental:()=>Te,pkce:()=>ye});import he from"js-pkce";var z={};c(z,{CONFIG:()=>Se,getAuthorizationEndpoint:()=>G,getTokenEndpoint:()=>M});var v={};c(v,{HOSTS:()=>O,ID:()=>f});var f="AUTH",O={integration:"auth.integration.globuscs.info",sandbox:"auth.sandbox.globuscs.info",production:"auth.globus.org",test:"auth.test.globuscs.info",staging:"auth.staging.globuscs.info",preview:"auth.preview.globus.org"};var E={};c(E,{HOSTS:()=>U,ID:()=>n});var n="TRANSFER",U={sandbox:"transfer.sandbox.globuscs.info",production:"transfer.api.globusonline.org",staging:"transfer.api.staging.globuscs.info",integration:"transfer.api.integration.globuscs.info",test:"transfer.api.test.globuscs.info",preview:"transfer.api.preview.globus.org"};var R="FLOWS",V={sandbox:"sandbox.flows.automate.globus.org",production:"flows.globus.org",staging:"staging.flows.automate.globus.org",integration:"integration.flows.automate.globus.org",test:"test.flows.automate.globus.org",preview:"preview.flows.automate.globus.org"};var x={};c(x,{HOSTS:()=>k,ID:()=>m,SCOPES:()=>L});var m="SEARCH",k={sandbox:"search.api.sandbox.globuscs.info",production:"search.api.globus.org",staging:"search.api.staging.globuscs.info",integration:"search.api.integration.globuscs.info",test:"search.api.test.globuscs.info",preview:"search.api.preview.globus.org"},L={ALL:"urn:globus:auth:scope:search.api.globus.org:all",INGEST:"urn:globus:auth:scope:search.api.globus.org:ingest",SEARCH:"urn:globus:auth:scope:search.api.globus.org:search"};var _=class extends Error{name="EnvironmentConfigurationError";constructor(e,o){super(),this.message=`Invalid configuration value provided for ${e} (${o}).`}};function ue(){return typeof window<"u"?window:process}function fe(t){return typeof window==typeof t}function $(t,e=void 0){let o=ue(),r;return fe(o)?r=o:r=o.env,t in r?r[t]:e}var Y={PRODUCTION:"production",PREVIEW:"preview",STAGING:"staging",SANDBOX:"sandbox",INTEGRATION:"integration",TEST:"test"};function F(){let t=$("GLOBUS_SDK_ENVIRONMENT",Y.PRODUCTION);if(!t||!Object.values(Y).includes(t))throw new _("GLOBUS_SDK_ENVIRONMENT",t);return t}var Me={[f]:f,[n]:n,[R]:R,[m]:m},me={[f]:O,[n]:U,[R]:V,[m]:k};function ge(t,e){return me[t][e]}function J(t,e=F()){let o=ge(t,e);return $(`GLOBUS_SDK_SERVICE_URL_${t}`,o?`https://${o}`:void 0)}function le(t,e="",o=F()){let r=J(t,o);return new URL(e,r)}function s(t,e,o){let r=le(t,e);if(o&&o.search){let i=new URLSearchParams(o.search);r.search=i.toString()}return r.toString()}var Se=v;function G(){return s(f,"/v2/oauth2/authorize")}function M(){return s(f,"/v2/oauth2/token")}var g,I=class{constructor(){u(this,g,{})}get(e){return p(this,g)[e]}set(e,o){p(this,g)[e]=o}remove(e){delete p(this,g)[e]}clear(){S(this,g,{})}};g=new WeakMap;var D=class{get(e){let o=localStorage.getItem(e);return o!==null?JSON.parse(o):null}set(e,o){localStorage.setItem(e,JSON.stringify(o))}remove(e){localStorage.removeItem(e)}clear(){localStorage.clear()}};var b;function j(t="memory"){if(!b){let e;t==="localStorage"?e=D:t==="memory"?e=I:e=t,b=new e}return b}function A(){if(!b)throw Error("You must create a storage system.");return b}function de(t){let e=t;return!!(e.token_type&&e.access_token)}function Q(t){t.scope.split(" ").forEach(e=>{A().set(e,t)})}function X(t){Q(t),"other_tokens"in t&&t.other_tokens.forEach(Q)}function w(t){let e=A().get(t);return!e||!de(e)?null:`${e.token_type} ${e.access_token}`}function Z(){A().clear()}var be,d,h,T,N,ee,C,te,y=class{constructor(e){u(this,N);u(this,C);u(this,d,void 0);u(this,h,void 0);u(this,T,void 0);if(be=j("localStorage"),!e.client_id)throw new Error("You must provide a `client_id`.");S(this,h,{client_id:e.client_id,authorization_endpoint:G(),token_endpoint:M(),...e}),S(this,d,P(this,N,ee).call(this))}reset(){P(this,C,te).call(this),Z()}redirect(){this.reset(),window.location.replace(p(this,d).authorizeUrl())}async handleCodeRedirect(e={removeStateAndReplaceLocation:!0}){let o=new URL(window.location.href),r=new URLSearchParams(o.search);if(!r.get("code"))return;let i=await p(this,d).exchangeForAccessToken(o.toString());S(this,T,i),X(p(this,T)),e.removeStateAndReplaceLocation&&(r.delete("code"),r.delete("state"),o.search=r.toString(),window.location.replace(o))}hasToken(){return p(this,h).requested_scopes.split(" ").every(e=>!!w(e))}revoke(){this.reset()}};d=new WeakMap,h=new WeakMap,T=new WeakMap,N=new WeakSet,ee=function(){return new he(p(this,h))},C=new WeakSet,te=function(){sessionStorage.removeItem("pkce_state"),sessionStorage.removeItem("pkce_code_verifier")};function ye(t){return new y(t)}function Te(t){return new y(t)}var ie={};c(ie,{CONFIG:()=>Ce,endpoint:()=>q,endpointSearch:()=>He,fileOperations:()=>K,taskSubmission:()=>W});import ve from"cross-fetch";var re=ve;function a(t,e,o={}){let r=o.headers||{};if(!(r!=null&&r.Authorization)){let i=w(t);i&&(r.Authorization=i)}return re(e,{...o,headers:r})}var Ee=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/endpoint_search",{search:t??{}}),(o=e==null?void 0:e.fetch)==null?void 0:o.options)},ne=Ee;var K={};c(K,{ls:()=>Re,mkdir:()=>xe,rename:()=>_e,symlink:()=>Ie});function l(t){return t==="get"?{}:{"Content-Type":"application/json"}}var Re=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/ls`,{search:e}),(r=o==null?void 0:o.fetch)==null?void 0:r.options)},xe=function(t,e,o){var i;let r={DATA_TYPE:"mkdir",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/mkdir`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})},_e=function(t,e,o){var i;let r={DATA_TYPE:"rename",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/rename`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})},Ie=function(t,e,o){var i;let r={DATA_TYPE:"symlink",...e==null?void 0:e.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/operation/endpoint/${t}/symlink`),{method:"post",body:JSON.stringify(r),headers:l("post"),...(i=o==null?void 0:o.fetch)==null?void 0:i.options})};var W={};c(W,{submissionId:()=>we,submitDelete:()=>De,submitTransfer:()=>Ae});var De=function(t,e){var r;let o={DATA_TYPE:"delete",...t==null?void 0:t.payload};return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/delete"),{method:"post",body:JSON.stringify(o),headers:l("post"),...(r=e==null?void 0:e.fetch)==null?void 0:r.options})},Ae=function(t,e){var o;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/transfer"),{method:"post",body:JSON.stringify({DATA_TYPE:"transfer",...t==null?void 0:t.payload}),headers:l("post"),...(o=e==null?void 0:e.fetch)==null?void 0:o.options})};function we(t){var e;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,"/v0.10/submission_id"),{...(e=t==null?void 0:t.fetch)==null?void 0:e.options})}var q={};c(q,{get:()=>Ne});var Ne=function(t,e,o){var r;return a("urn:globus:auth:scope:transfer.api.globus.org:all",s(n,`/v0.10/endpoint/${t}`),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var Ce=E,He=ne;var ae={};c(ae,{CONFIG:()=>Oe,query:()=>B});var B={};c(B,{get:()=>Pe});var Pe=function(t,e,o){var r;return a(L.SEARCH,s(m,`/v1/index/${t}/search`,{search:e}),{...(r=o==null?void 0:o.fetch)==null?void 0:r.options})};var Oe=x;export{z as auth,oe as authorization,ke as sdk,ae as search,ie as transfer}; |
{ | ||
"name": "@globus/sdk", | ||
"version": "0.1.3-alpha.0", | ||
"version": "0.1.4-alpha.0", | ||
"private": false, | ||
@@ -22,3 +22,3 @@ "description": "The Globus SDK for Javascript", | ||
"coverage": "jest --coverage", | ||
"build": "node esbuild.js && tsc --emitDeclarationOnly --outDir dist/types", | ||
"build": "node esbuild.js", | ||
"watch": "tsc --watch", | ||
@@ -37,3 +37,3 @@ "generate:docs": "npx typedoc ./src/index.ts", | ||
"typedoc": "^0.24.6", | ||
"typescript": "5.0.4" | ||
"typescript": "5.1.3" | ||
}, | ||
@@ -47,3 +47,3 @@ "engines": { | ||
}, | ||
"gitHead": "560d555e09cb6b3eaee9df00c2b1d486ba9f028a" | ||
"gitHead": "6ed421d302f0ef2f9392208ba304a5763e4d6603" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
37084
6
135