@globus/sdk 5.1.2 → 5.3.0

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.
Files changed (98) hide show
  1. package/dist/cjs/core/authorization/index.js +14 -6
  2. package/dist/cjs/core/authorization/index.js.map +2 -2
  3. package/dist/cjs/core/info/index.js +1 -1
  4. package/dist/cjs/core/info/index.js.map +1 -1
  5. package/dist/cjs/index.js +155 -87
  6. package/dist/cjs/index.js.map +4 -4
  7. package/dist/cjs/services/globus-connect-server/client.js +191 -198
  8. package/dist/cjs/services/globus-connect-server/client.js.map +4 -4
  9. package/dist/esm/core/authorization/AuthorizationManager.d.ts +2 -1
  10. package/dist/esm/core/authorization/AuthorizationManager.d.ts.map +1 -1
  11. package/dist/esm/core/authorization/AuthorizationManager.js +1 -0
  12. package/dist/esm/core/authorization/AuthorizationManager.js.map +1 -1
  13. package/dist/esm/core/authorization/RedirectTransport.d.ts +8 -0
  14. package/dist/esm/core/authorization/RedirectTransport.d.ts.map +1 -1
  15. package/dist/esm/core/authorization/RedirectTransport.js +6 -1
  16. package/dist/esm/core/authorization/RedirectTransport.js.map +1 -1
  17. package/dist/esm/core/authorization/TokenManager.d.ts +1 -0
  18. package/dist/esm/core/authorization/TokenManager.d.ts.map +1 -1
  19. package/dist/esm/core/authorization/TokenManager.js +3 -0
  20. package/dist/esm/core/authorization/TokenManager.js.map +1 -1
  21. package/dist/esm/core/info/version.d.ts +1 -1
  22. package/dist/esm/core/info/version.js +1 -1
  23. package/dist/esm/core/url.d.ts +2 -2
  24. package/dist/esm/core/url.d.ts.map +1 -1
  25. package/dist/esm/core/url.js.map +1 -1
  26. package/dist/esm/package.json +1 -1
  27. package/dist/esm/services/auth/config.d.ts.map +1 -1
  28. package/dist/esm/services/auth/index.d.ts +1 -1
  29. package/dist/esm/services/auth/index.d.ts.map +1 -1
  30. package/dist/esm/services/auth/index.js +1 -1
  31. package/dist/esm/services/auth/index.js.map +1 -1
  32. package/dist/esm/services/auth/service/identities/consents.d.ts +26 -0
  33. package/dist/esm/services/auth/service/identities/consents.d.ts.map +1 -0
  34. package/dist/esm/services/auth/service/identities/consents.js +10 -0
  35. package/dist/esm/services/auth/service/identities/consents.js.map +1 -0
  36. package/dist/esm/services/auth/service/{identities.d.ts → identities/index.d.ts} +6 -5
  37. package/dist/esm/services/auth/service/identities/index.d.ts.map +1 -0
  38. package/dist/esm/services/auth/service/{identities.js → identities/index.js} +6 -5
  39. package/dist/esm/services/auth/service/identities/index.js.map +1 -0
  40. package/dist/esm/services/auth/service/oauth2/token.d.ts +14 -0
  41. package/dist/esm/services/auth/service/oauth2/token.d.ts.map +1 -1
  42. package/dist/esm/services/auth/service/oauth2/token.js.map +1 -1
  43. package/dist/esm/services/compute/config.d.ts.map +1 -1
  44. package/dist/esm/services/flows/config.d.ts.map +1 -1
  45. package/dist/esm/services/globus-connect-server/client.d.ts +1 -7
  46. package/dist/esm/services/globus-connect-server/client.d.ts.map +1 -1
  47. package/dist/esm/services/globus-connect-server/index.d.ts +17 -4
  48. package/dist/esm/services/globus-connect-server/index.d.ts.map +1 -1
  49. package/dist/esm/services/globus-connect-server/index.js +16 -2
  50. package/dist/esm/services/globus-connect-server/index.js.map +1 -1
  51. package/dist/esm/services/globus-connect-server/service/collections.d.ts +8 -8
  52. package/dist/esm/services/globus-connect-server/service/collections.d.ts.map +1 -1
  53. package/dist/esm/services/globus-connect-server/service/collections.js +8 -9
  54. package/dist/esm/services/globus-connect-server/service/collections.js.map +1 -1
  55. package/dist/esm/services/globus-connect-server/service/endpoint.d.ts +7 -7
  56. package/dist/esm/services/globus-connect-server/service/endpoint.d.ts.map +1 -1
  57. package/dist/esm/services/globus-connect-server/service/endpoint.js +7 -8
  58. package/dist/esm/services/globus-connect-server/service/endpoint.js.map +1 -1
  59. package/dist/esm/services/globus-connect-server/service/https.d.ts.map +1 -1
  60. package/dist/esm/services/globus-connect-server/service/https.js +3 -4
  61. package/dist/esm/services/globus-connect-server/service/https.js.map +1 -1
  62. package/dist/esm/services/globus-connect-server/service/nodes.d.ts +6 -6
  63. package/dist/esm/services/globus-connect-server/service/nodes.d.ts.map +1 -1
  64. package/dist/esm/services/globus-connect-server/service/nodes.js +6 -7
  65. package/dist/esm/services/globus-connect-server/service/nodes.js.map +1 -1
  66. package/dist/esm/services/globus-connect-server/service/roles.d.ts +4 -4
  67. package/dist/esm/services/globus-connect-server/service/roles.d.ts.map +1 -1
  68. package/dist/esm/services/globus-connect-server/service/roles.js +4 -5
  69. package/dist/esm/services/globus-connect-server/service/roles.js.map +1 -1
  70. package/dist/esm/services/globus-connect-server/service/storage-gateways.d.ts +6 -6
  71. package/dist/esm/services/globus-connect-server/service/storage-gateways.d.ts.map +1 -1
  72. package/dist/esm/services/globus-connect-server/service/storage-gateways.js +6 -7
  73. package/dist/esm/services/globus-connect-server/service/storage-gateways.js.map +1 -1
  74. package/dist/esm/services/globus-connect-server/service/user-credentials.d.ts +6 -6
  75. package/dist/esm/services/globus-connect-server/service/user-credentials.d.ts.map +1 -1
  76. package/dist/esm/services/globus-connect-server/service/user-credentials.js +6 -7
  77. package/dist/esm/services/globus-connect-server/service/user-credentials.js.map +1 -1
  78. package/dist/esm/services/globus-connect-server/service/versioning.d.ts +2 -2
  79. package/dist/esm/services/globus-connect-server/service/versioning.d.ts.map +1 -1
  80. package/dist/esm/services/globus-connect-server/service/versioning.js +1 -3
  81. package/dist/esm/services/globus-connect-server/service/versioning.js.map +1 -1
  82. package/dist/esm/services/globus-connect-server/utils.d.ts +11 -0
  83. package/dist/esm/services/globus-connect-server/utils.d.ts.map +1 -0
  84. package/dist/esm/services/globus-connect-server/utils.js +60 -0
  85. package/dist/esm/services/globus-connect-server/utils.js.map +1 -0
  86. package/dist/esm/services/groups/config.d.ts.map +1 -1
  87. package/dist/esm/services/search/config.d.ts.map +1 -1
  88. package/dist/esm/services/shared.d.ts +2 -2
  89. package/dist/esm/services/shared.d.ts.map +1 -1
  90. package/dist/esm/services/shared.js +9 -1
  91. package/dist/esm/services/shared.js.map +1 -1
  92. package/dist/esm/services/timer/config.d.ts.map +1 -1
  93. package/dist/esm/services/transfer/config.d.ts.map +1 -1
  94. package/dist/umd/globus.production.js +2 -2
  95. package/dist/umd/globus.production.js.map +4 -4
  96. package/package.json +2 -2
  97. package/dist/esm/services/auth/service/identities.d.ts.map +0 -1
  98. package/dist/esm/services/auth/service/identities.js.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
29
  // src/index.ts
30
- var src_exports = {};
31
- __export(src_exports, {
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
32
  auth: () => auth_exports,
33
33
  authorization: () => authorization_exports,
34
34
  compute: () => compute_exports,
@@ -43,7 +43,7 @@ __export(src_exports, {
43
43
  transfer: () => transfer_exports,
44
44
  webapp: () => web_exports
45
45
  });
46
- module.exports = __toCommonJS(src_exports);
46
+ module.exports = __toCommonJS(index_exports);
47
47
 
48
48
  // src/core/info/index.ts
49
49
  var info_exports = {};
@@ -71,7 +71,7 @@ function toString(info2) {
71
71
  }
72
72
 
73
73
  // src/core/info/version.ts
74
- var VERSION = "5.1.2";
74
+ var VERSION = "5.3.0";
75
75
 
76
76
  // src/core/info/index.ts
77
77
  var VERSION2 = VERSION;
@@ -474,11 +474,12 @@ function build(serviceOrConfiguration, path, options, sdkOptions) {
474
474
  return url2.toString();
475
475
  }
476
476
 
477
- // src/services/auth/service/identities.ts
477
+ // src/services/auth/service/identities/index.ts
478
478
  var identities_exports = {};
479
479
  __export(identities_exports, {
480
+ consents: () => consents_exports,
480
481
  get: () => get,
481
- getAll: () => getAll
482
+ getAll: () => getAll2
482
483
  });
483
484
 
484
485
  // src/services/shared.ts
@@ -503,7 +504,10 @@ async function serviceRequest(config, options, passedSdkOptions) {
503
504
  headers["Authorization"] = `Bearer ${token2.access_token}`;
504
505
  }
505
506
  }
506
- if (config.scope && manager) {
507
+ if (config.scope && manager && /**
508
+ * Only attempt to get a token if the `service` property is a string or has an `endpoint_id` property (GCSConfiguration).
509
+ */
510
+ (typeof config.service === "string" || "endpoint_id" in config.service)) {
507
511
  const resourceServer = typeof config.service === "string" ? RESOURCE_SERVERS[config.service] : (
508
512
  // For `GCSConfiguration` objects, the `endpoint_id` is the resource server.
509
513
  config.service.endpoint_id
@@ -579,24 +583,41 @@ async function serviceRequest(config, options, passedSdkOptions) {
579
583
  return initialResponse;
580
584
  }
581
585
 
582
- // src/services/auth/service/identities.ts
586
+ // src/services/auth/service/identities/consents.ts
587
+ var consents_exports = {};
588
+ __export(consents_exports, {
589
+ getAll: () => getAll
590
+ });
591
+ var getAll = function(identity_id, options = {}, sdkOptions) {
592
+ return serviceRequest(
593
+ {
594
+ service: ID7,
595
+ scope: SCOPES6.VIEW_IDENTITIES,
596
+ path: `/v2/api/identities/${identity_id}/consents`
597
+ },
598
+ options,
599
+ sdkOptions
600
+ );
601
+ };
602
+
603
+ // src/services/auth/service/identities/index.ts
583
604
  var get = function(identity_id, options = {}, sdkOptions) {
584
605
  return serviceRequest(
585
606
  {
586
607
  service: ID7,
587
608
  scope: SCOPES6.VIEW_IDENTITIES,
588
- path: `/identities/${identity_id}`
609
+ path: `/v2/api/identities/${identity_id}`
589
610
  },
590
611
  options,
591
612
  sdkOptions
592
613
  );
593
614
  };
594
- var getAll = function(options = {}, sdkOptions) {
615
+ var getAll2 = function(options = {}, sdkOptions) {
595
616
  return serviceRequest(
596
617
  {
597
618
  service: ID7,
598
619
  scope: SCOPES6.VIEW_IDENTITIES,
599
- path: `/identities`
620
+ path: `/v2/api/identities`
600
621
  },
601
622
  options,
602
623
  sdkOptions
@@ -843,7 +864,7 @@ var RedirectTransport = class _RedirectTransport {
843
864
  * Parse the current URL for the authorization code (`?code=...`) and exchange it for an access token when available.
844
865
  * - When the URL is processed and exchanged for an access token, the page is redirected to the current URL without the `?code=...&state=...` parameters.
845
866
  */
846
- async getToken(options = { shouldReplace: true }) {
867
+ async getToken(options = { shouldReplace: true, includeConsentedScopes: false }) {
847
868
  const url2 = new URL(window.location.href);
848
869
  const params = new URLSearchParams(url2.search);
849
870
  if (params.get("error")) {
@@ -875,6 +896,9 @@ var RedirectTransport = class _RedirectTransport {
875
896
  grant_type: "authorization_code"
876
897
  };
877
898
  const response = await (await oauth2_exports.token.exchange({
899
+ query: options.includeConsentedScopes ? {
900
+ include_consented_scopes: true
901
+ } : void 0,
878
902
  payload
879
903
  })).json();
880
904
  if (options.shouldReplace) {
@@ -976,6 +1000,9 @@ var TokenManager = class {
976
1000
  });
977
1001
  }
978
1002
  }
1003
+ remove(token2) {
1004
+ this.#manager.storage.removeItem(`${this.#manager.storageKeyPrefix}${token2.resource_server}`);
1005
+ }
979
1006
  /**
980
1007
  * Determines whether or not a stored token is expired.
981
1008
  * @param token The token to check.
@@ -1214,8 +1241,6 @@ var AuthorizationManager = class {
1214
1241
  scopes: scopesToRequest,
1215
1242
  ...overrides,
1216
1243
  params: {
1217
- // @todo @todo Decide if we want to include the `include_consented_scopes` parameter by default.
1218
- // include_consented_scopes: 'true',
1219
1244
  ...overrides?.params
1220
1245
  }
1221
1246
  });
@@ -1247,7 +1272,8 @@ var AuthorizationManager = class {
1247
1272
  async handleCodeRedirect(options = { shouldReplace: true, additionalParams: {} }) {
1248
1273
  log("debug", "AuthorizationManager.handleCodeRedirect");
1249
1274
  const response = await this.#buildTransport({ params: options?.additionalParams }).getToken({
1250
- shouldReplace: options?.shouldReplace
1275
+ shouldReplace: options?.shouldReplace,
1276
+ includeConsentedScopes: options?.includeConsentedScopes
1251
1277
  });
1252
1278
  if (isGlobusAuthTokenResponse(response)) {
1253
1279
  log(
@@ -1643,7 +1669,7 @@ var task_exports = {};
1643
1669
  __export(task_exports, {
1644
1670
  cancel: () => cancel,
1645
1671
  get: () => get3,
1646
- getAll: () => getAll2,
1672
+ getAll: () => getAll3,
1647
1673
  getEventList: () => getEventList,
1648
1674
  getPauseInfo: () => getPauseInfo,
1649
1675
  getSkippedErrors: () => getSkippedErrors,
@@ -1651,7 +1677,7 @@ __export(task_exports, {
1651
1677
  remove: () => remove2,
1652
1678
  update: () => update2
1653
1679
  });
1654
- var getAll2 = function(options = {}, sdkOptions) {
1680
+ var getAll3 = function(options = {}, sdkOptions) {
1655
1681
  return serviceRequest(
1656
1682
  {
1657
1683
  service: ID,
@@ -1759,11 +1785,11 @@ var access_exports = {};
1759
1785
  __export(access_exports, {
1760
1786
  create: () => create3,
1761
1787
  get: () => get4,
1762
- getAll: () => getAll3,
1788
+ getAll: () => getAll4,
1763
1789
  remove: () => remove3,
1764
1790
  update: () => update3
1765
1791
  });
1766
- var getAll3 = function(endpoint_xid, options, sdkOptions) {
1792
+ var getAll4 = function(endpoint_xid, options, sdkOptions) {
1767
1793
  return serviceRequest(
1768
1794
  {
1769
1795
  service: ID,
@@ -1827,11 +1853,11 @@ var collection_bookmarks_exports = {};
1827
1853
  __export(collection_bookmarks_exports, {
1828
1854
  create: () => create4,
1829
1855
  get: () => get5,
1830
- getAll: () => getAll4,
1856
+ getAll: () => getAll5,
1831
1857
  remove: () => remove4,
1832
1858
  update: () => update4
1833
1859
  });
1834
- var getAll4 = function(options, sdkOptions) {
1860
+ var getAll5 = function(options, sdkOptions) {
1835
1861
  return serviceRequest(
1836
1862
  {
1837
1863
  service: ID,
@@ -1956,11 +1982,11 @@ var pause_rule_exports = {};
1956
1982
  __export(pause_rule_exports, {
1957
1983
  create: () => create5,
1958
1984
  get: () => get7,
1959
- getAll: () => getAll5,
1985
+ getAll: () => getAll6,
1960
1986
  remove: () => remove5,
1961
1987
  update: () => update5
1962
1988
  });
1963
- var getAll5 = function(options, sdkOptions) {
1989
+ var getAll6 = function(options, sdkOptions) {
1964
1990
  return serviceRequest(
1965
1991
  {
1966
1992
  service: ID,
@@ -2025,7 +2051,7 @@ __export(task_exports2, {
2025
2051
  cancel: () => cancel2,
2026
2052
  get: () => get8,
2027
2053
  getAdminCancel: () => getAdminCancel,
2028
- getAll: () => getAll6,
2054
+ getAll: () => getAll7,
2029
2055
  getEventList: () => getEventList2,
2030
2056
  getPauseInfo: () => getPauseInfo2,
2031
2057
  getSkippedErrors: () => getSkippedErrors2,
@@ -2033,7 +2059,7 @@ __export(task_exports2, {
2033
2059
  pause: () => pause,
2034
2060
  resume: () => resume
2035
2061
  });
2036
- var getAll6 = function(options = {}, sdkOptions) {
2062
+ var getAll7 = function(options = {}, sdkOptions) {
2037
2063
  return serviceRequest(
2038
2064
  {
2039
2065
  service: ID,
@@ -2294,7 +2320,7 @@ var search_index_exports = {};
2294
2320
  __export(search_index_exports, {
2295
2321
  create: () => create6,
2296
2322
  get: () => get12,
2297
- getAll: () => getAll7,
2323
+ getAll: () => getAll8,
2298
2324
  ingest: () => ingest,
2299
2325
  remove: () => remove6,
2300
2326
  reopen: () => reopen
@@ -2310,7 +2336,7 @@ var get12 = function(index_id, options, sdkOptions) {
2310
2336
  sdkOptions
2311
2337
  );
2312
2338
  };
2313
- var getAll7 = function(options, sdkOptions) {
2339
+ var getAll8 = function(options, sdkOptions) {
2314
2340
  return serviceRequest(
2315
2341
  {
2316
2342
  service: ID5,
@@ -2464,12 +2490,12 @@ __export(flows_exports, {
2464
2490
  create: () => create7,
2465
2491
  deploy: () => deploy,
2466
2492
  get: () => get15,
2467
- getAll: () => getAll8,
2493
+ getAll: () => getAll9,
2468
2494
  remove: () => remove7,
2469
2495
  run: () => run,
2470
2496
  validate: () => validate2
2471
2497
  });
2472
- var getAll8 = function(options, sdkOptions) {
2498
+ var getAll9 = function(options, sdkOptions) {
2473
2499
  return serviceRequest(
2474
2500
  {
2475
2501
  service: ID2,
@@ -2545,10 +2571,10 @@ var deploy = create7;
2545
2571
  var runs_exports = {};
2546
2572
  __export(runs_exports, {
2547
2573
  cancel: () => cancel3,
2548
- getAll: () => getAll9,
2574
+ getAll: () => getAll10,
2549
2575
  getLog: () => getLog
2550
2576
  });
2551
- var getAll9 = function(options = {}, sdkOptions) {
2577
+ var getAll10 = function(options = {}, sdkOptions) {
2552
2578
  return serviceRequest(
2553
2579
  {
2554
2580
  service: ID2,
@@ -2591,12 +2617,13 @@ var globus_connect_server_exports = {};
2591
2617
  __export(globus_connect_server_exports, {
2592
2618
  collections: () => collections_exports,
2593
2619
  endpoint: () => endpoint_exports3,
2594
- getRequiredScopes: () => getRequiredScopes,
2620
+ getScopes: () => getScopes,
2595
2621
  https: () => https_exports,
2596
2622
  nodes: () => nodes_exports,
2597
2623
  roles: () => roles_exports,
2598
2624
  storageGateways: () => storage_gateways_exports,
2599
2625
  userCredentials: () => user_credentials_exports,
2626
+ utils: () => utils_exports2,
2600
2627
  versioning: () => versioning_exports
2601
2628
  });
2602
2629
 
@@ -2605,18 +2632,18 @@ var collections_exports = {};
2605
2632
  __export(collections_exports, {
2606
2633
  create: () => create8,
2607
2634
  get: () => get16,
2608
- getAll: () => getAll10,
2635
+ getAll: () => getAll11,
2609
2636
  patch: () => patch,
2610
2637
  remove: () => remove8,
2611
2638
  resetOwnerString: () => resetOwnerString,
2612
2639
  update: () => update6,
2613
2640
  updateOwnerString: () => updateOwnerString
2614
2641
  });
2615
- var getAll10 = function(configuration, options, sdkOptions) {
2642
+ var getAll11 = function(configuration, options, sdkOptions) {
2616
2643
  return serviceRequest(
2617
2644
  {
2618
2645
  service: configuration,
2619
- scope: getRequiredScopes(configuration),
2646
+ resource_server: configuration.endpoint_id,
2620
2647
  path: `/api/collections`
2621
2648
  },
2622
2649
  options,
@@ -2627,7 +2654,7 @@ var get16 = function(configuration, collection_id, options, sdkOptions) {
2627
2654
  return serviceRequest(
2628
2655
  {
2629
2656
  service: configuration,
2630
- scope: getRequiredScopes(configuration),
2657
+ resource_server: configuration.endpoint_id,
2631
2658
  path: `/api/collections/${collection_id}`
2632
2659
  },
2633
2660
  options,
@@ -2638,7 +2665,7 @@ var remove8 = function(configuration, collection_id, options, sdkOptions) {
2638
2665
  return serviceRequest(
2639
2666
  {
2640
2667
  service: configuration,
2641
- scope: getRequiredScopes(configuration),
2668
+ resource_server: configuration.endpoint_id,
2642
2669
  path: `/api/collections/${collection_id}`,
2643
2670
  method: "DELETE" /* DELETE */
2644
2671
  },
@@ -2650,7 +2677,7 @@ var create8 = function(configuration, options, sdkOptions) {
2650
2677
  return serviceRequest(
2651
2678
  {
2652
2679
  service: configuration,
2653
- scope: getRequiredScopes(configuration),
2680
+ resource_server: configuration.endpoint_id,
2654
2681
  path: `/api/collections`,
2655
2682
  method: "POST" /* POST */
2656
2683
  },
@@ -2662,7 +2689,7 @@ var update6 = function(configuration, collection_id, options, sdkOptions) {
2662
2689
  return serviceRequest(
2663
2690
  {
2664
2691
  service: configuration,
2665
- scope: getRequiredScopes(configuration),
2692
+ resource_server: configuration.endpoint_id,
2666
2693
  path: `/api/collections/${collection_id}`,
2667
2694
  method: "PUT" /* PUT */
2668
2695
  },
@@ -2674,7 +2701,7 @@ var patch = function(configuration, collection_id, options, sdkOptions) {
2674
2701
  return serviceRequest(
2675
2702
  {
2676
2703
  service: configuration,
2677
- scope: getRequiredScopes(configuration),
2704
+ resource_server: configuration.endpoint_id,
2678
2705
  path: `/api/collections/${collection_id}`,
2679
2706
  method: "PATCH" /* PATCH */
2680
2707
  },
@@ -2686,7 +2713,7 @@ var updateOwnerString = function(configuration, collection_id, options, sdkOptio
2686
2713
  return serviceRequest(
2687
2714
  {
2688
2715
  service: configuration,
2689
- scope: getRequiredScopes(configuration),
2716
+ resource_server: configuration.endpoint_id,
2690
2717
  path: `/api/collections/${collection_id}/owner_string`,
2691
2718
  method: "PUT" /* PUT */
2692
2719
  },
@@ -2698,7 +2725,7 @@ var resetOwnerString = function(configuration, collection_id, options, sdkOption
2698
2725
  return serviceRequest(
2699
2726
  {
2700
2727
  service: configuration,
2701
- scope: getRequiredScopes(configuration),
2728
+ resource_server: configuration.endpoint_id,
2702
2729
  path: `/api/collections/${collection_id}/owner_string`,
2703
2730
  method: "DELETE" /* DELETE */
2704
2731
  },
@@ -2722,7 +2749,7 @@ var get17 = function(configuration, options, sdkOptions) {
2722
2749
  return serviceRequest(
2723
2750
  {
2724
2751
  service: configuration,
2725
- scope: getRequiredScopes(configuration),
2752
+ resource_server: configuration.endpoint_id,
2726
2753
  path: `/api/endpoint`
2727
2754
  },
2728
2755
  options,
@@ -2733,7 +2760,7 @@ var update7 = function(configuration, options, sdkOptions) {
2733
2760
  return serviceRequest(
2734
2761
  {
2735
2762
  service: configuration,
2736
- scope: getRequiredScopes(configuration),
2763
+ resource_server: configuration.endpoint_id,
2737
2764
  path: `/api/endpoint`,
2738
2765
  method: "PUT" /* PUT */
2739
2766
  },
@@ -2745,7 +2772,7 @@ var patch2 = function(configuration, options, sdkOptions) {
2745
2772
  return serviceRequest(
2746
2773
  {
2747
2774
  service: configuration,
2748
- scope: getRequiredScopes(configuration),
2775
+ resource_server: configuration.endpoint_id,
2749
2776
  path: `/api/endpoint`,
2750
2777
  method: "PATCH" /* PATCH */
2751
2778
  },
@@ -2757,7 +2784,7 @@ var updateSubscriptionId = function(configuration, options, sdkOptions) {
2757
2784
  return serviceRequest(
2758
2785
  {
2759
2786
  service: configuration,
2760
- scope: getRequiredScopes(configuration),
2787
+ resource_server: configuration.endpoint_id,
2761
2788
  path: `/api/endpoint/subscription_id`,
2762
2789
  method: "PUT" /* PUT */
2763
2790
  },
@@ -2769,7 +2796,7 @@ var updateOwner = function(configuration, options, sdkOptions) {
2769
2796
  return serviceRequest(
2770
2797
  {
2771
2798
  service: configuration,
2772
- scope: getRequiredScopes(configuration),
2799
+ resource_server: configuration.endpoint_id,
2773
2800
  path: `/api/endpoint/owner`,
2774
2801
  method: "PUT" /* PUT */
2775
2802
  },
@@ -2781,7 +2808,7 @@ var updateOwnerString2 = function(configuration, options, sdkOptions) {
2781
2808
  return serviceRequest(
2782
2809
  {
2783
2810
  service: configuration,
2784
- scope: getRequiredScopes(configuration),
2811
+ resource_server: configuration.endpoint_id,
2785
2812
  path: `/api/endpoint/owner_string`,
2786
2813
  method: "PUT" /* PUT */
2787
2814
  },
@@ -2793,7 +2820,7 @@ var resetOwnerString2 = function(configuration, options, sdkOptions) {
2793
2820
  return serviceRequest(
2794
2821
  {
2795
2822
  service: configuration,
2796
- scope: getRequiredScopes(configuration),
2823
+ resource_server: configuration.endpoint_id,
2797
2824
  path: `/api/endpoint/owner_string`,
2798
2825
  method: "DELETE" /* DELETE */
2799
2826
  },
@@ -2813,7 +2840,7 @@ var get18 = function(configuration, path, options, sdkOptions) {
2813
2840
  return serviceRequest(
2814
2841
  {
2815
2842
  service: configuration,
2816
- scope: getRequiredScopes(configuration),
2843
+ resource_server: configuration.endpoint_id,
2817
2844
  path
2818
2845
  },
2819
2846
  options,
@@ -2824,7 +2851,7 @@ var remove9 = function(configuration, path, options, sdkOptions) {
2824
2851
  return serviceRequest(
2825
2852
  {
2826
2853
  service: configuration,
2827
- scope: getRequiredScopes(configuration),
2854
+ resource_server: configuration.endpoint_id,
2828
2855
  path,
2829
2856
  method: "DELETE" /* DELETE */
2830
2857
  },
@@ -2836,7 +2863,7 @@ var update8 = function(configuration, path, options, sdkOptions) {
2836
2863
  return serviceRequest(
2837
2864
  {
2838
2865
  service: configuration,
2839
- scope: getRequiredScopes(configuration),
2866
+ resource_server: configuration.endpoint_id,
2840
2867
  path,
2841
2868
  method: "PUT" /* PUT */
2842
2869
  },
@@ -2850,16 +2877,16 @@ var nodes_exports = {};
2850
2877
  __export(nodes_exports, {
2851
2878
  create: () => create9,
2852
2879
  get: () => get19,
2853
- getAll: () => getAll11,
2880
+ getAll: () => getAll12,
2854
2881
  patch: () => patch3,
2855
2882
  remove: () => remove10,
2856
2883
  update: () => update9
2857
2884
  });
2858
- var getAll11 = function(configuration, options, sdkOptions) {
2885
+ var getAll12 = function(configuration, options, sdkOptions) {
2859
2886
  return serviceRequest(
2860
2887
  {
2861
2888
  service: configuration,
2862
- scope: getRequiredScopes(configuration),
2889
+ resource_server: configuration.endpoint_id,
2863
2890
  path: `/api/nodes`
2864
2891
  },
2865
2892
  options,
@@ -2870,7 +2897,7 @@ var get19 = function(configuration, node_id, options, sdkOptions) {
2870
2897
  return serviceRequest(
2871
2898
  {
2872
2899
  service: configuration,
2873
- scope: getRequiredScopes(configuration),
2900
+ resource_server: configuration.endpoint_id,
2874
2901
  path: `/api/nodes/${node_id}`
2875
2902
  },
2876
2903
  options,
@@ -2881,7 +2908,7 @@ var remove10 = function(configuration, node_id, options, sdkOptions) {
2881
2908
  return serviceRequest(
2882
2909
  {
2883
2910
  service: configuration,
2884
- scope: getRequiredScopes(configuration),
2911
+ resource_server: configuration.endpoint_id,
2885
2912
  path: `/api/nodes/${node_id}`,
2886
2913
  method: "DELETE" /* DELETE */
2887
2914
  },
@@ -2893,7 +2920,7 @@ var create9 = function(configuration, options, sdkOptions) {
2893
2920
  return serviceRequest(
2894
2921
  {
2895
2922
  service: configuration,
2896
- scope: getRequiredScopes(configuration),
2923
+ resource_server: configuration.endpoint_id,
2897
2924
  path: `/api/nodes`,
2898
2925
  method: "POST" /* POST */
2899
2926
  },
@@ -2905,7 +2932,7 @@ var update9 = function(configuration, node_id, options, sdkOptions) {
2905
2932
  return serviceRequest(
2906
2933
  {
2907
2934
  service: configuration,
2908
- scope: getRequiredScopes(configuration),
2935
+ resource_server: configuration.endpoint_id,
2909
2936
  path: `/api/nodes/${node_id}`,
2910
2937
  method: "PUT" /* PUT */
2911
2938
  },
@@ -2917,7 +2944,7 @@ var patch3 = function(configuration, node_id, options, sdkOptions) {
2917
2944
  return serviceRequest(
2918
2945
  {
2919
2946
  service: configuration,
2920
- scope: getRequiredScopes(configuration),
2947
+ resource_server: configuration.endpoint_id,
2921
2948
  path: `/api/nodes/${node_id}`,
2922
2949
  method: "PATCH" /* PATCH */
2923
2950
  },
@@ -2931,14 +2958,14 @@ var roles_exports = {};
2931
2958
  __export(roles_exports, {
2932
2959
  create: () => create10,
2933
2960
  get: () => get20,
2934
- getAll: () => getAll12,
2961
+ getAll: () => getAll13,
2935
2962
  remove: () => remove11
2936
2963
  });
2937
- var getAll12 = function(configuration, options, sdkOptions) {
2964
+ var getAll13 = function(configuration, options, sdkOptions) {
2938
2965
  return serviceRequest(
2939
2966
  {
2940
2967
  service: configuration,
2941
- scope: getRequiredScopes(configuration),
2968
+ resource_server: configuration.endpoint_id,
2942
2969
  path: `/api/roles`
2943
2970
  },
2944
2971
  options,
@@ -2949,7 +2976,7 @@ var get20 = function(configuration, role_id, options, sdkOptions) {
2949
2976
  return serviceRequest(
2950
2977
  {
2951
2978
  service: configuration,
2952
- scope: getRequiredScopes(configuration),
2979
+ resource_server: configuration.endpoint_id,
2953
2980
  path: `/api/roles/${role_id}`
2954
2981
  },
2955
2982
  options,
@@ -2960,7 +2987,7 @@ var remove11 = function(configuration, role_id, options, sdkOptions) {
2960
2987
  return serviceRequest(
2961
2988
  {
2962
2989
  service: configuration,
2963
- scope: getRequiredScopes(configuration),
2990
+ resource_server: configuration.endpoint_id,
2964
2991
  path: `/api/roles/${role_id}`,
2965
2992
  method: "DELETE" /* DELETE */
2966
2993
  },
@@ -2972,7 +2999,7 @@ var create10 = function(configuration, options, sdkOptions) {
2972
2999
  return serviceRequest(
2973
3000
  {
2974
3001
  service: configuration,
2975
- scope: getRequiredScopes(configuration),
3002
+ resource_server: configuration.endpoint_id,
2976
3003
  path: `/api/roles`,
2977
3004
  method: "POST" /* POST */
2978
3005
  },
@@ -2986,16 +3013,16 @@ var storage_gateways_exports = {};
2986
3013
  __export(storage_gateways_exports, {
2987
3014
  create: () => create11,
2988
3015
  get: () => get21,
2989
- getAll: () => getAll13,
3016
+ getAll: () => getAll14,
2990
3017
  patch: () => patch4,
2991
3018
  remove: () => remove12,
2992
3019
  update: () => update10
2993
3020
  });
2994
- var getAll13 = function(configuration, options, sdkOptions) {
3021
+ var getAll14 = function(configuration, options, sdkOptions) {
2995
3022
  return serviceRequest(
2996
3023
  {
2997
3024
  service: configuration,
2998
- scope: getRequiredScopes(configuration),
3025
+ resource_server: configuration.endpoint_id,
2999
3026
  path: `/api/storage_gateways`
3000
3027
  },
3001
3028
  options,
@@ -3006,7 +3033,7 @@ var get21 = function(configuration, storage_gateway_id, options, sdkOptions) {
3006
3033
  return serviceRequest(
3007
3034
  {
3008
3035
  service: configuration,
3009
- scope: getRequiredScopes(configuration),
3036
+ resource_server: configuration.endpoint_id,
3010
3037
  path: `/api/storage_gateways/${storage_gateway_id}`
3011
3038
  },
3012
3039
  options,
@@ -3017,7 +3044,7 @@ var remove12 = function(configuration, storage_gateway_id, options, sdkOptions)
3017
3044
  return serviceRequest(
3018
3045
  {
3019
3046
  service: configuration,
3020
- scope: getRequiredScopes(configuration),
3047
+ resource_server: configuration.endpoint_id,
3021
3048
  path: `/api/storage_gateways/${storage_gateway_id}`,
3022
3049
  method: "DELETE" /* DELETE */
3023
3050
  },
@@ -3029,7 +3056,7 @@ var create11 = function(configuration, options, sdkOptions) {
3029
3056
  return serviceRequest(
3030
3057
  {
3031
3058
  service: configuration,
3032
- scope: getRequiredScopes(configuration),
3059
+ resource_server: configuration.endpoint_id,
3033
3060
  path: `/api/storage_gateways`,
3034
3061
  method: "POST" /* POST */
3035
3062
  },
@@ -3041,7 +3068,7 @@ var update10 = function(configuration, storage_gateway_id, options, sdkOptions)
3041
3068
  return serviceRequest(
3042
3069
  {
3043
3070
  service: configuration,
3044
- scope: getRequiredScopes(configuration),
3071
+ resource_server: configuration.endpoint_id,
3045
3072
  path: `/api/storage_gateways/${storage_gateway_id}`,
3046
3073
  method: "PUT" /* PUT */
3047
3074
  },
@@ -3053,7 +3080,7 @@ var patch4 = function(configuration, storage_gateway_id, options, sdkOptions) {
3053
3080
  return serviceRequest(
3054
3081
  {
3055
3082
  service: configuration,
3056
- scope: getRequiredScopes(configuration),
3083
+ resource_server: configuration.endpoint_id,
3057
3084
  path: `/api/storage_gateways/${storage_gateway_id}`,
3058
3085
  method: "PATCH" /* PATCH */
3059
3086
  },
@@ -3067,16 +3094,16 @@ var user_credentials_exports = {};
3067
3094
  __export(user_credentials_exports, {
3068
3095
  create: () => create12,
3069
3096
  get: () => get22,
3070
- getAll: () => getAll14,
3097
+ getAll: () => getAll15,
3071
3098
  patch: () => patch5,
3072
3099
  remove: () => remove13,
3073
3100
  update: () => update11
3074
3101
  });
3075
- var getAll14 = function(configuration, options, sdkOptions) {
3102
+ var getAll15 = function(configuration, options, sdkOptions) {
3076
3103
  return serviceRequest(
3077
3104
  {
3078
3105
  service: configuration,
3079
- scope: getRequiredScopes(configuration),
3106
+ resource_server: configuration.endpoint_id,
3080
3107
  path: `/api/user_credentials`
3081
3108
  },
3082
3109
  options,
@@ -3087,7 +3114,7 @@ var get22 = function(configuration, user_credential_id, options, sdkOptions) {
3087
3114
  return serviceRequest(
3088
3115
  {
3089
3116
  service: configuration,
3090
- scope: getRequiredScopes(configuration),
3117
+ resource_server: configuration.endpoint_id,
3091
3118
  path: `/api/user_credentials/${user_credential_id}`
3092
3119
  },
3093
3120
  options,
@@ -3098,7 +3125,7 @@ var remove13 = function(configuration, user_credential_id, options, sdkOptions)
3098
3125
  return serviceRequest(
3099
3126
  {
3100
3127
  service: configuration,
3101
- scope: getRequiredScopes(configuration),
3128
+ resource_server: configuration.endpoint_id,
3102
3129
  path: `/api/user_credentials/${user_credential_id}`,
3103
3130
  method: "DELETE" /* DELETE */
3104
3131
  },
@@ -3110,7 +3137,7 @@ var create12 = function(configuration, options, sdkOptions) {
3110
3137
  return serviceRequest(
3111
3138
  {
3112
3139
  service: configuration,
3113
- scope: getRequiredScopes(configuration),
3140
+ resource_server: configuration.endpoint_id,
3114
3141
  path: `/api/user_credentials`,
3115
3142
  method: "POST" /* POST */
3116
3143
  },
@@ -3122,7 +3149,7 @@ var update11 = function(configuration, user_credential_id, options, sdkOptions)
3122
3149
  return serviceRequest(
3123
3150
  {
3124
3151
  service: configuration,
3125
- scope: getRequiredScopes(configuration),
3152
+ resource_server: configuration.endpoint_id,
3126
3153
  path: `/api/user_credentials/${user_credential_id}`,
3127
3154
  method: "PUT" /* PUT */
3128
3155
  },
@@ -3134,7 +3161,7 @@ var patch5 = function(configuration, user_credential_id, options, sdkOptions) {
3134
3161
  return serviceRequest(
3135
3162
  {
3136
3163
  service: configuration,
3137
- scope: getRequiredScopes(configuration),
3164
+ resource_server: configuration.endpoint_id,
3138
3165
  path: `/api/user_credentials/${user_credential_id}`,
3139
3166
  method: "PATCH" /* PATCH */
3140
3167
  },
@@ -3152,7 +3179,6 @@ var info = function(configuration, options, sdkOptions) {
3152
3179
  return serviceRequest(
3153
3180
  {
3154
3181
  service: configuration,
3155
- scope: getRequiredScopes(configuration),
3156
3182
  path: `/api/info`
3157
3183
  },
3158
3184
  options,
@@ -3160,13 +3186,55 @@ var info = function(configuration, options, sdkOptions) {
3160
3186
  );
3161
3187
  };
3162
3188
 
3189
+ // src/services/globus-connect-server/utils.ts
3190
+ var utils_exports2 = {};
3191
+ __export(utils_exports2, {
3192
+ getEndpointIdFromURL: () => getEndpointIdFromURL,
3193
+ getGCSDomainFromURL: () => getGCSDomainFromURL
3194
+ });
3195
+ var GCS_DEFAULT_DOMAIN = "data.globus.org";
3196
+ function getGCSDomainFromURL(url2) {
3197
+ const { host: host2 } = typeof url2 === "string" ? new URL(url2) : url2;
3198
+ if (!host2.endsWith(GCS_DEFAULT_DOMAIN)) {
3199
+ return host2;
3200
+ }
3201
+ const [subdomain] = host2.split(`.${GCS_DEFAULT_DOMAIN}`);
3202
+ const parts = subdomain.split(".");
3203
+ return (parts.length === 2 ? [...parts, GCS_DEFAULT_DOMAIN] : [parts[1], parts[2], GCS_DEFAULT_DOMAIN]).join(".");
3204
+ }
3205
+ async function getEndpointIdFromURL(url2) {
3206
+ const u = typeof url2 === "string" ? new URL(url2) : url2;
3207
+ const isCustomDomain = !u.host.endsWith(GCS_DEFAULT_DOMAIN);
3208
+ if (isCustomDomain) {
3209
+ return null;
3210
+ }
3211
+ const res = await (await info({
3212
+ host: `https://${getGCSDomainFromURL(u)}`
3213
+ })).json();
3214
+ const i = res.data?.filter((d) => d.DATA_TYPE.startsWith("info#"))[0];
3215
+ return i && "endpoint_id" in i ? i.endpoint_id : null;
3216
+ }
3217
+
3163
3218
  // src/services/globus-connect-server/index.ts
3164
3219
  var SCOPES7 = {
3165
3220
  HIGH_ASSURANCE: "urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections",
3166
3221
  NON_HIGH_ASSURANCE: "urn:globus:auth:scope:<ENDPOINT_ID>:manage_collections[*https://auth.globus.org/scopes/<MAPPED_COLLECTION_ID>/data_access]"
3167
3222
  };
3168
- function getRequiredScopes(configuration) {
3169
- return SCOPES7.HIGH_ASSURANCE.replace("<ENDPOINT_ID>", configuration.endpoint_id);
3223
+ function getScopes(configuration, scope) {
3224
+ const { endpoint_id: id } = configuration;
3225
+ if (!id) {
3226
+ throw new Error(`An 'endpoint_id' is required to determine the required scopes`);
3227
+ }
3228
+ if (scope) {
3229
+ return SCOPES7[scope].replace("<ENDPOINT_ID>", id);
3230
+ }
3231
+ return Object.entries(SCOPES7).reduce(
3232
+ (reduc, [key, value]) => ({
3233
+ ...reduc,
3234
+ [key]: value.replace("<ENDPOINT_ID>", id)
3235
+ }),
3236
+ {}
3237
+ );
3170
3238
  }
3171
3239
 
3172
3240
  // src/services/timer/index.ts
@@ -3204,10 +3272,10 @@ __export(compute_exports, {
3204
3272
  var endpoints_exports = {};
3205
3273
  __export(endpoints_exports, {
3206
3274
  get: () => get23,
3207
- getAll: () => getAll15,
3275
+ getAll: () => getAll16,
3208
3276
  getStatus: () => getStatus
3209
3277
  });
3210
- var getAll15 = function(options, sdkOptions) {
3278
+ var getAll16 = function(options, sdkOptions) {
3211
3279
  return serviceRequest(
3212
3280
  {
3213
3281
  service: ID6,