@globus/sdk 5.2.0 → 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 (33) hide show
  1. package/dist/cjs/core/authorization/index.js +10 -5
  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 +13 -8
  6. package/dist/cjs/index.js.map +2 -2
  7. package/dist/cjs/services/globus-connect-server/client.js +1 -1
  8. package/dist/cjs/services/globus-connect-server/client.js.map +1 -1
  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/package.json +1 -1
  24. package/dist/esm/services/auth/service/identities/consents.js +1 -1
  25. package/dist/esm/services/auth/service/identities/consents.js.map +1 -1
  26. package/dist/esm/services/auth/service/identities/index.js +2 -2
  27. package/dist/esm/services/auth/service/identities/index.js.map +1 -1
  28. package/dist/esm/services/auth/service/oauth2/token.d.ts +14 -0
  29. package/dist/esm/services/auth/service/oauth2/token.d.ts.map +1 -1
  30. package/dist/esm/services/auth/service/oauth2/token.js.map +1 -1
  31. package/dist/umd/globus.production.js +2 -2
  32. package/dist/umd/globus.production.js.map +2 -2
  33. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -71,7 +71,7 @@ function toString(info2) {
71
71
  }
72
72
 
73
73
  // src/core/info/version.ts
74
- var VERSION = "5.2.0";
74
+ var VERSION = "5.3.0";
75
75
 
76
76
  // src/core/info/index.ts
77
77
  var VERSION2 = VERSION;
@@ -593,7 +593,7 @@ var getAll = function(identity_id, options = {}, sdkOptions) {
593
593
  {
594
594
  service: ID7,
595
595
  scope: SCOPES6.VIEW_IDENTITIES,
596
- path: `/identities/${identity_id}/consents`
596
+ path: `/v2/api/identities/${identity_id}/consents`
597
597
  },
598
598
  options,
599
599
  sdkOptions
@@ -606,7 +606,7 @@ var get = function(identity_id, options = {}, sdkOptions) {
606
606
  {
607
607
  service: ID7,
608
608
  scope: SCOPES6.VIEW_IDENTITIES,
609
- path: `/identities/${identity_id}`
609
+ path: `/v2/api/identities/${identity_id}`
610
610
  },
611
611
  options,
612
612
  sdkOptions
@@ -617,7 +617,7 @@ var getAll2 = function(options = {}, sdkOptions) {
617
617
  {
618
618
  service: ID7,
619
619
  scope: SCOPES6.VIEW_IDENTITIES,
620
- path: `/identities`
620
+ path: `/v2/api/identities`
621
621
  },
622
622
  options,
623
623
  sdkOptions
@@ -864,7 +864,7 @@ var RedirectTransport = class _RedirectTransport {
864
864
  * Parse the current URL for the authorization code (`?code=...`) and exchange it for an access token when available.
865
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.
866
866
  */
867
- async getToken(options = { shouldReplace: true }) {
867
+ async getToken(options = { shouldReplace: true, includeConsentedScopes: false }) {
868
868
  const url2 = new URL(window.location.href);
869
869
  const params = new URLSearchParams(url2.search);
870
870
  if (params.get("error")) {
@@ -896,6 +896,9 @@ var RedirectTransport = class _RedirectTransport {
896
896
  grant_type: "authorization_code"
897
897
  };
898
898
  const response = await (await oauth2_exports.token.exchange({
899
+ query: options.includeConsentedScopes ? {
900
+ include_consented_scopes: true
901
+ } : void 0,
899
902
  payload
900
903
  })).json();
901
904
  if (options.shouldReplace) {
@@ -997,6 +1000,9 @@ var TokenManager = class {
997
1000
  });
998
1001
  }
999
1002
  }
1003
+ remove(token2) {
1004
+ this.#manager.storage.removeItem(`${this.#manager.storageKeyPrefix}${token2.resource_server}`);
1005
+ }
1000
1006
  /**
1001
1007
  * Determines whether or not a stored token is expired.
1002
1008
  * @param token The token to check.
@@ -1235,8 +1241,6 @@ var AuthorizationManager = class {
1235
1241
  scopes: scopesToRequest,
1236
1242
  ...overrides,
1237
1243
  params: {
1238
- // @todo @todo Decide if we want to include the `include_consented_scopes` parameter by default.
1239
- // include_consented_scopes: 'true',
1240
1244
  ...overrides?.params
1241
1245
  }
1242
1246
  });
@@ -1268,7 +1272,8 @@ var AuthorizationManager = class {
1268
1272
  async handleCodeRedirect(options = { shouldReplace: true, additionalParams: {} }) {
1269
1273
  log("debug", "AuthorizationManager.handleCodeRedirect");
1270
1274
  const response = await this.#buildTransport({ params: options?.additionalParams }).getToken({
1271
- shouldReplace: options?.shouldReplace
1275
+ shouldReplace: options?.shouldReplace,
1276
+ includeConsentedScopes: options?.includeConsentedScopes
1272
1277
  });
1273
1278
  if (isGlobusAuthTokenResponse(response)) {
1274
1279
  log(