@globus/sdk 1.0.0-alpha → 1.2.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +3 -0
- package/{src/index.ts → esm/index.d.ts} +1 -5
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +50 -0
- package/esm/index.js.map +1 -0
- package/esm/lib/core/authorization.d.ts +30 -0
- package/esm/lib/core/authorization.d.ts.map +1 -0
- package/esm/lib/core/authorization.js +87 -0
- package/esm/lib/core/authorization.js.map +1 -0
- package/esm/lib/core/consent.d.ts +6 -0
- package/esm/lib/core/consent.d.ts.map +1 -0
- package/esm/lib/core/consent.js +27 -0
- package/esm/lib/core/consent.js.map +1 -0
- package/esm/lib/core/errors.d.ts +5 -0
- package/esm/lib/core/errors.d.ts.map +1 -0
- package/esm/lib/core/errors.js +9 -0
- package/esm/lib/core/errors.js.map +1 -0
- package/esm/lib/core/fetch.d.ts +7 -0
- package/esm/lib/core/fetch.d.ts.map +1 -0
- package/esm/lib/core/fetch.js +23 -0
- package/esm/lib/core/fetch.js.map +1 -0
- package/esm/lib/core/global.d.ts +38 -0
- package/esm/lib/core/global.d.ts.map +1 -0
- package/esm/lib/core/global.js +92 -0
- package/esm/lib/core/global.js.map +1 -0
- package/esm/lib/core/internals/fetch.d.ts +2 -0
- package/esm/lib/core/internals/fetch.d.ts.map +1 -0
- package/{src/lib/core/internals/fetch.ts → esm/lib/core/internals/fetch.js} +1 -0
- package/esm/lib/core/internals/fetch.js.map +1 -0
- package/esm/lib/core/storage/index.d.ts +25 -0
- package/esm/lib/core/storage/index.d.ts.map +1 -0
- package/esm/lib/core/storage/index.js +38 -0
- package/esm/lib/core/storage/index.js.map +1 -0
- package/esm/lib/core/storage/local-storage.d.ts +8 -0
- package/esm/lib/core/storage/local-storage.d.ts.map +1 -0
- package/esm/lib/core/storage/local-storage.js +16 -0
- package/esm/lib/core/storage/local-storage.js.map +1 -0
- package/esm/lib/core/storage/memory.d.ts +9 -0
- package/esm/lib/core/storage/memory.d.ts.map +1 -0
- package/esm/lib/core/storage/memory.js +21 -0
- package/esm/lib/core/storage/memory.js.map +1 -0
- package/esm/lib/core/url.d.ts +31 -0
- package/esm/lib/core/url.d.ts.map +1 -0
- package/esm/lib/core/url.js +54 -0
- package/esm/lib/core/url.js.map +1 -0
- package/esm/lib/services/auth/config.d.ts +4 -0
- package/esm/lib/services/auth/config.d.ts.map +1 -0
- package/esm/lib/services/auth/config.js +10 -0
- package/esm/lib/services/auth/config.js.map +1 -0
- package/esm/lib/services/auth/index.d.ts +21 -0
- package/esm/lib/services/auth/index.d.ts.map +1 -0
- package/esm/lib/services/auth/index.js +20 -0
- package/esm/lib/services/auth/index.js.map +1 -0
- package/esm/lib/services/auth/types.d.ts +15 -0
- package/esm/lib/services/auth/types.d.ts.map +1 -0
- package/esm/lib/services/auth/types.js +2 -0
- package/esm/lib/services/auth/types.js.map +1 -0
- package/esm/lib/services/flows/config.d.ts +14 -0
- package/esm/lib/services/flows/config.d.ts.map +1 -0
- package/esm/lib/services/flows/config.js +20 -0
- package/esm/lib/services/flows/config.js.map +1 -0
- package/{src/lib/services/flows/index.ts → esm/lib/services/flows/index.d.ts} +2 -3
- package/esm/lib/services/flows/index.d.ts.map +1 -0
- package/esm/lib/services/flows/index.js +17 -0
- package/esm/lib/services/flows/index.js.map +1 -0
- package/esm/lib/services/flows/service/flows.d.ts +17 -0
- package/esm/lib/services/flows/service/flows.d.ts.map +1 -0
- package/esm/lib/services/flows/service/flows.js +27 -0
- package/esm/lib/services/flows/service/flows.js.map +1 -0
- package/esm/lib/services/flows/service/runs.d.ts +10 -0
- package/esm/lib/services/flows/service/runs.d.ts.map +1 -0
- package/esm/lib/services/flows/service/runs.js +14 -0
- package/esm/lib/services/flows/service/runs.js.map +1 -0
- package/esm/lib/services/globus-connect-server/client.d.ts +3461 -0
- package/esm/lib/services/globus-connect-server/client.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/client.js +50 -0
- package/esm/lib/services/globus-connect-server/client.js.map +1 -0
- package/esm/lib/services/globus-connect-server/index.d.ts +47 -0
- package/esm/lib/services/globus-connect-server/index.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/index.js +26 -0
- package/esm/lib/services/globus-connect-server/index.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/collections.d.ts +29 -0
- package/esm/lib/services/globus-connect-server/service/collections.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/collections.js +20 -0
- package/esm/lib/services/globus-connect-server/service/collections.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/endpoint.d.ts +7 -0
- package/esm/lib/services/globus-connect-server/service/endpoint.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/endpoint.js +11 -0
- package/esm/lib/services/globus-connect-server/service/endpoint.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/roles.d.ts +33 -0
- package/esm/lib/services/globus-connect-server/service/roles.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/roles.js +36 -0
- package/esm/lib/services/globus-connect-server/service/roles.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/storage-gateways.d.ts +27 -0
- package/esm/lib/services/globus-connect-server/service/storage-gateways.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/storage-gateways.js +22 -0
- package/esm/lib/services/globus-connect-server/service/storage-gateways.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/user-credentials.d.ts +20 -0
- package/esm/lib/services/globus-connect-server/service/user-credentials.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/user-credentials.js +20 -0
- package/esm/lib/services/globus-connect-server/service/user-credentials.js.map +1 -0
- package/esm/lib/services/globus-connect-server/service/versioning.d.ts +8 -0
- package/esm/lib/services/globus-connect-server/service/versioning.d.ts.map +1 -0
- package/esm/lib/services/globus-connect-server/service/versioning.js +12 -0
- package/esm/lib/services/globus-connect-server/service/versioning.js.map +1 -0
- package/esm/lib/services/groups/config.d.ts +11 -0
- package/esm/lib/services/groups/config.d.ts.map +1 -0
- package/esm/lib/services/groups/config.js +17 -0
- package/esm/lib/services/groups/config.js.map +1 -0
- package/{src/lib/services/groups/index.ts → esm/lib/services/groups/index.d.ts} +2 -4
- package/esm/lib/services/groups/index.d.ts.map +1 -0
- package/esm/lib/services/groups/index.js +19 -0
- package/esm/lib/services/groups/index.js.map +1 -0
- package/esm/lib/services/groups/service/groups.d.ts +28 -0
- package/esm/lib/services/groups/service/groups.d.ts.map +1 -0
- package/esm/lib/services/groups/service/groups.js +22 -0
- package/esm/lib/services/groups/service/groups.js.map +1 -0
- package/esm/lib/services/groups/service/membership.d.ts +14 -0
- package/esm/lib/services/groups/service/membership.d.ts.map +1 -0
- package/esm/lib/services/groups/service/membership.js +14 -0
- package/esm/lib/services/groups/service/membership.js.map +1 -0
- package/esm/lib/services/groups/service/policies.d.ts +7 -0
- package/esm/lib/services/groups/service/policies.d.ts.map +1 -0
- package/esm/lib/services/groups/service/policies.js +11 -0
- package/esm/lib/services/groups/service/policies.js.map +1 -0
- package/esm/lib/services/search/config.d.ts +12 -0
- package/esm/lib/services/search/config.d.ts.map +1 -0
- package/esm/lib/services/search/config.js +18 -0
- package/esm/lib/services/search/config.js.map +1 -0
- package/{src/lib/services/search/index.ts → esm/lib/services/search/index.d.ts} +2 -3
- package/esm/lib/services/search/index.d.ts.map +1 -0
- package/esm/lib/services/search/index.js +15 -0
- package/esm/lib/services/search/index.js.map +1 -0
- package/esm/lib/services/search/service/query.d.ts +24 -0
- package/esm/lib/services/search/service/query.d.ts.map +1 -0
- package/esm/lib/services/search/service/query.js +15 -0
- package/esm/lib/services/search/service/query.js.map +1 -0
- package/esm/lib/services/shared.d.ts +7 -0
- package/esm/lib/services/shared.d.ts.map +1 -0
- package/esm/lib/services/shared.js +8 -0
- package/esm/lib/services/shared.js.map +1 -0
- package/esm/lib/services/transfer/config.d.ts +4 -0
- package/esm/lib/services/transfer/config.d.ts.map +1 -0
- package/esm/lib/services/transfer/config.js +10 -0
- package/esm/lib/services/transfer/config.js.map +1 -0
- package/{src/lib/services/transfer/index.ts → esm/lib/services/transfer/index.d.ts} +2 -3
- package/esm/lib/services/transfer/index.d.ts.map +1 -0
- package/esm/lib/services/transfer/index.js +21 -0
- package/esm/lib/services/transfer/index.js.map +1 -0
- package/esm/lib/services/transfer/service/endpoint-search.d.ts +18 -0
- package/esm/lib/services/transfer/service/endpoint-search.d.ts.map +1 -0
- package/esm/lib/services/transfer/service/endpoint-search.js +23 -0
- package/esm/lib/services/transfer/service/endpoint-search.js.map +1 -0
- package/esm/lib/services/transfer/service/endpoint.d.ts +5 -0
- package/esm/lib/services/transfer/service/endpoint.d.ts.map +1 -0
- package/esm/lib/services/transfer/service/endpoint.js +11 -0
- package/esm/lib/services/transfer/service/endpoint.js.map +1 -0
- package/esm/lib/services/transfer/service/file-operations.d.ts +63 -0
- package/esm/lib/services/transfer/service/file-operations.d.ts.map +1 -0
- package/esm/lib/services/transfer/service/file-operations.js +50 -0
- package/esm/lib/services/transfer/service/file-operations.js.map +1 -0
- package/esm/lib/services/transfer/service/task-submission.d.ts +30 -0
- package/esm/lib/services/transfer/service/task-submission.d.ts.map +1 -0
- package/esm/lib/services/transfer/service/task-submission.js +30 -0
- package/esm/lib/services/transfer/service/task-submission.js.map +1 -0
- package/esm/lib/services/transfer/shared.d.ts +3 -0
- package/esm/lib/services/transfer/shared.d.ts.map +1 -0
- package/esm/lib/services/transfer/shared.js +10 -0
- package/esm/lib/services/transfer/shared.js.map +1 -0
- package/esm/lib/services/transfer/types.d.ts +43 -0
- package/esm/lib/services/transfer/types.d.ts.map +1 -0
- package/esm/lib/services/transfer/types.js +2 -0
- package/esm/lib/services/transfer/types.js.map +1 -0
- package/esm/lib/services/types.d.ts +44 -0
- package/esm/lib/services/types.d.ts.map +1 -0
- package/esm/lib/services/types.js +2 -0
- package/esm/lib/services/types.js.map +1 -0
- package/esm/package.json +3 -0
- package/package.json +10 -8
- package/tsconfig.cjs.tsbuildinfo +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/umd/globus.production.js +1 -0
- package/CHANGELOG.md +0 -148
- package/dist/LICENSE +0 -201
- package/dist/README.md +0 -48
- package/dist/package.json +0 -30
- package/dist/umd/globus.production.js +0 -1
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -85
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1367
- package/docs/classes/_globus_sdk.authorization.PKCEAuthorization.html +0 -202
- package/docs/functions/Client___Globus_Connect_Server_Manager_API.getClient.html +0 -212
- package/docs/functions/_globus_sdk.auth.getAuthorizationEndpoint.html +0 -67
- package/docs/functions/_globus_sdk.auth.getTokenEndpoint.html +0 -67
- package/docs/functions/_globus_sdk.authorization.incremental.html +0 -71
- package/docs/functions/_globus_sdk.authorization.pkce.html +0 -71
- package/docs/functions/_globus_sdk.flows.flows.destroy.html +0 -84
- package/docs/functions/_globus_sdk.flows.flows.get.html +0 -84
- package/docs/functions/_globus_sdk.flows.flows.getAll.html +0 -82
- package/docs/functions/_globus_sdk.flows.runs.getAll.html +0 -80
- package/docs/functions/_globus_sdk.gcs.collections.get.html +0 -92
- package/docs/functions/_globus_sdk.gcs.collections.getAll.html +0 -90
- package/docs/functions/_globus_sdk.gcs.endpoint.get.html +0 -89
- package/docs/functions/_globus_sdk.gcs.getRequiredScopes.html +0 -77
- package/docs/functions/_globus_sdk.gcs.roles.get.html +0 -92
- package/docs/functions/_globus_sdk.gcs.roles.getAll.html +0 -90
- package/docs/functions/_globus_sdk.gcs.storageGateways.get.html +0 -92
- package/docs/functions/_globus_sdk.gcs.storageGateways.getAll.html +0 -90
- package/docs/functions/_globus_sdk.gcs.userCredentials.get.html +0 -92
- package/docs/functions/_globus_sdk.gcs.userCredentials.getAll.html +0 -90
- package/docs/functions/_globus_sdk.gcs.versioning.info.html +0 -89
- package/docs/functions/_globus_sdk.groups.groups.get.html +0 -84
- package/docs/functions/_globus_sdk.groups.groups.getMyGroups.html +0 -82
- package/docs/functions/_globus_sdk.groups.membership.act.html +0 -85
- package/docs/functions/_globus_sdk.groups.policies.get.html +0 -83
- package/docs/functions/_globus_sdk.search.query.get.html +0 -84
- package/docs/functions/_globus_sdk.transfer.endpoint.get.html +0 -84
- package/docs/functions/_globus_sdk.transfer.endpointSearch.html +0 -89
- package/docs/functions/_globus_sdk.transfer.fileOperations.ls.html +0 -90
- package/docs/functions/_globus_sdk.transfer.fileOperations.mkdir.html +0 -90
- package/docs/functions/_globus_sdk.transfer.fileOperations.rename.html +0 -92
- package/docs/functions/_globus_sdk.transfer.fileOperations.symlink.html +0 -90
- package/docs/functions/_globus_sdk.transfer.taskSubmission.submissionId.html +0 -85
- package/docs/functions/_globus_sdk.transfer.taskSubmission.submitDelete.html +0 -87
- package/docs/functions/_globus_sdk.transfer.taskSubmission.submitTransfer.html +0 -81
- package/docs/index.html +0 -114
- package/docs/modules/Client___Globus_Connect_Server_Manager_API.html +0 -61
- package/docs/modules/_globus_sdk.auth.html +0 -84
- package/docs/modules/_globus_sdk.authorization.html +0 -75
- package/docs/modules/_globus_sdk.flows.flows.html +0 -75
- package/docs/modules/_globus_sdk.flows.html +0 -77
- package/docs/modules/_globus_sdk.flows.runs.html +0 -71
- package/docs/modules/_globus_sdk.gcs.collections.html +0 -84
- package/docs/modules/_globus_sdk.gcs.endpoint.html +0 -78
- package/docs/modules/_globus_sdk.gcs.html +0 -94
- package/docs/modules/_globus_sdk.gcs.roles.html +0 -80
- package/docs/modules/_globus_sdk.gcs.storageGateways.html +0 -80
- package/docs/modules/_globus_sdk.gcs.userCredentials.html +0 -80
- package/docs/modules/_globus_sdk.gcs.versioning.html +0 -78
- package/docs/modules/_globus_sdk.groups.groups.html +0 -78
- package/docs/modules/_globus_sdk.groups.html +0 -79
- package/docs/modules/_globus_sdk.groups.membership.html +0 -72
- package/docs/modules/_globus_sdk.groups.policies.html +0 -72
- package/docs/modules/_globus_sdk.html +0 -95
- package/docs/modules/_globus_sdk.search.html +0 -75
- package/docs/modules/_globus_sdk.search.query.html +0 -70
- package/docs/modules/_globus_sdk.transfer.endpoint.html +0 -73
- package/docs/modules/_globus_sdk.transfer.fileOperations.html +0 -79
- package/docs/modules/_globus_sdk.transfer.html +0 -84
- package/docs/modules/_globus_sdk.transfer.taskSubmission.html +0 -77
- package/docs/types/_globus_sdk.auth.Token.html +0 -70
- package/docs/types/_globus_sdk.auth.TokenResponse.html +0 -73
- package/docs/types/_globus_sdk.gcs.GCSConfiguration.html +0 -87
- package/docs/types/_globus_sdk.gcs.GCSServiceMethod.html +0 -96
- package/docs/types/_globus_sdk.gcs.GCSServiceMethodDynamicSegments.html +0 -100
- package/docs/variables/_globus_sdk.auth.CONFIG.html +0 -64
- package/docs/variables/_globus_sdk.flows.CONFIG.html +0 -62
- package/docs/variables/_globus_sdk.groups.CONFIG.html +0 -63
- package/docs/variables/_globus_sdk.search.CONFIG.html +0 -61
- package/docs/variables/_globus_sdk.transfer.CONFIG.html +0 -64
- package/jest.config.ts +0 -12
- package/jest.setup.ts +0 -10
- package/mocks/handlers.ts +0 -54
- package/mocks/server.ts +0 -5
- package/scripts/generate-package-json.js +0 -38
- package/scripts/openapi-types.ts +0 -50
- package/src/__utils__/service-test-suite.ts +0 -31
- package/src/lib/core/__tests__/fetch.spec.ts +0 -22
- package/src/lib/core/__tests__/global.spec.ts +0 -69
- package/src/lib/core/__tests__/url.spec.ts +0 -105
- package/src/lib/core/authorization.ts +0 -113
- package/src/lib/core/consent.ts +0 -34
- package/src/lib/core/errors.ts +0 -8
- package/src/lib/core/fetch.ts +0 -38
- package/src/lib/core/global.ts +0 -128
- package/src/lib/core/internals/__mocks__/fetch.ts +0 -7
- package/src/lib/core/storage/index.ts +0 -57
- package/src/lib/core/storage/local-storage.ts +0 -20
- package/src/lib/core/storage/memory.ts +0 -21
- package/src/lib/core/storage/storage.spec.ts +0 -30
- package/src/lib/core/url.ts +0 -73
- package/src/lib/services/auth/config.ts +0 -11
- package/src/lib/services/auth/index.ts +0 -37
- package/src/lib/services/auth/types.ts +0 -15
- package/src/lib/services/flows/__tests__/flows.spec.ts +0 -12
- package/src/lib/services/flows/__tests__/runs.spec.ts +0 -12
- package/src/lib/services/flows/config.ts +0 -26
- package/src/lib/services/flows/service/flows.ts +0 -41
- package/src/lib/services/flows/service/runs.ts +0 -20
- package/src/lib/services/globus-connect-server/__tests__/client.spec.ts +0 -147
- package/src/lib/services/globus-connect-server/__tests__/collections.spec.ts +0 -73
- package/src/lib/services/globus-connect-server/__tests__/endpoint.spec.ts +0 -36
- package/src/lib/services/globus-connect-server/__tests__/roles.spec.ts +0 -151
- package/src/lib/services/globus-connect-server/__tests__/storage-gateways.spec.ts +0 -72
- package/src/lib/services/globus-connect-server/__tests__/user-credentials.spec.ts +0 -74
- package/src/lib/services/globus-connect-server/client.ts +0 -79
- package/src/lib/services/globus-connect-server/index.ts +0 -85
- package/src/lib/services/globus-connect-server/service/collections.ts +0 -63
- package/src/lib/services/globus-connect-server/service/endpoint.ts +0 -28
- package/src/lib/services/globus-connect-server/service/roles.ts +0 -113
- package/src/lib/services/globus-connect-server/service/storage-gateways.ts +0 -65
- package/src/lib/services/globus-connect-server/service/user-credentials.ts +0 -61
- package/src/lib/services/globus-connect-server/service/versioning.ts +0 -30
- package/src/lib/services/groups/__tests__/groups.spec.ts +0 -60
- package/src/lib/services/groups/__tests__/membership.spec.ts +0 -64
- package/src/lib/services/groups/__tests__/policies.spec.ts +0 -30
- package/src/lib/services/groups/config.ts +0 -20
- package/src/lib/services/groups/service/groups.ts +0 -67
- package/src/lib/services/groups/service/membership.ts +0 -39
- package/src/lib/services/groups/service/policies.ts +0 -33
- package/src/lib/services/search/__tests__/query.spec.ts +0 -35
- package/src/lib/services/search/config.ts +0 -20
- package/src/lib/services/search/service/query.ts +0 -39
- package/src/lib/services/shared.ts +0 -6
- package/src/lib/services/transfer/__tests__/endpoint-search.spec.ts +0 -34
- package/src/lib/services/transfer/__tests__/endpoint.spec.ts +0 -17
- package/src/lib/services/transfer/__tests__/file-operations.spec.ts +0 -87
- package/src/lib/services/transfer/__tests__/task-submission.spec.ts +0 -55
- package/src/lib/services/transfer/config.ts +0 -11
- package/src/lib/services/transfer/service/endpoint-search.ts +0 -38
- package/src/lib/services/transfer/service/endpoint.ts +0 -26
- package/src/lib/services/transfer/service/file-operations.ts +0 -114
- package/src/lib/services/transfer/service/task-submission.ts +0 -68
- package/src/lib/services/transfer/shared.ts +0 -12
- package/src/lib/services/transfer/types.ts +0 -42
- package/src/lib/services/types.ts +0 -67
- package/tsconfig.json +0 -19
- package/typedoc.json +0 -10
- package/webpack.config.cjs +0 -14
- /package/{dist/esm → cjs}/index.d.ts +0 -0
- /package/{dist/esm → cjs}/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/index.js +0 -0
- /package/{dist/esm → cjs}/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/authorization.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/authorization.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/authorization.js +0 -0
- /package/{dist/esm → cjs}/lib/core/authorization.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/consent.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/consent.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/consent.js +0 -0
- /package/{dist/esm → cjs}/lib/core/consent.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/errors.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/errors.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/errors.js +0 -0
- /package/{dist/esm → cjs}/lib/core/errors.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/fetch.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/fetch.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/fetch.js +0 -0
- /package/{dist/esm → cjs}/lib/core/fetch.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/global.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/global.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/global.js +0 -0
- /package/{dist/esm → cjs}/lib/core/global.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/internals/fetch.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/internals/fetch.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/internals/fetch.js +0 -0
- /package/{dist/esm → cjs}/lib/core/internals/fetch.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/index.js +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/local-storage.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/local-storage.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/local-storage.js +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/local-storage.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/memory.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/memory.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/memory.js +0 -0
- /package/{dist/esm → cjs}/lib/core/storage/memory.js.map +0 -0
- /package/{dist/esm → cjs}/lib/core/url.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/core/url.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/core/url.js +0 -0
- /package/{dist/esm → cjs}/lib/core/url.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/config.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/config.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/config.js +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/config.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/types.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/types.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/types.js +0 -0
- /package/{dist/esm → cjs}/lib/services/auth/types.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/config.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/config.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/config.js +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/config.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/flows.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/flows.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/flows.js +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/flows.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/runs.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/runs.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/runs.js +0 -0
- /package/{dist/esm → cjs}/lib/services/flows/service/runs.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.js +0 -0
- /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/config.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/config.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/config.js +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/config.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/groups.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/groups.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/groups.js +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/groups.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/membership.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/membership.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/membership.js +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/membership.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/policies.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/policies.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/policies.js +0 -0
- /package/{dist/esm → cjs}/lib/services/groups/service/policies.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/config.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/search/config.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/config.js +0 -0
- /package/{dist/esm → cjs}/lib/services/search/config.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/search/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/search/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/service/query.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/search/service/query.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/search/service/query.js +0 -0
- /package/{dist/esm → cjs}/lib/services/search/service/query.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/shared.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/shared.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/shared.js +0 -0
- /package/{dist/esm → cjs}/lib/services/shared.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/config.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/config.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/config.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/config.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/index.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/index.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/index.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/index.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/shared.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/shared.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/shared.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/shared.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/types.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/types.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/types.js +0 -0
- /package/{dist/esm → cjs}/lib/services/transfer/types.js.map +0 -0
- /package/{dist/esm → cjs}/lib/services/types.d.ts +0 -0
- /package/{dist/esm → cjs}/lib/services/types.d.ts.map +0 -0
- /package/{dist/esm → cjs}/lib/services/types.js +0 -0
- /package/{dist/esm → cjs}/lib/services/types.js.map +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { EnvironmentConfigurationError } from "../errors";
|
|
2
|
-
import { ENVIRONMENTS } from "../global";
|
|
3
|
-
import { build, getServiceURL, stringifyParameters } from "../url";
|
|
4
|
-
|
|
5
|
-
describe.each(Object.values(ENVIRONMENTS))(
|
|
6
|
-
"getServiceUrl succeeds",
|
|
7
|
-
(environment) => {
|
|
8
|
-
it("should produce a valid Globus Auth service URL", () => {
|
|
9
|
-
expect(() => {
|
|
10
|
-
getServiceURL("AUTH", environment);
|
|
11
|
-
}).not.toThrow();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("should produce a valid Globus Transfer service URL", () => {
|
|
15
|
-
expect(() => {
|
|
16
|
-
getServiceURL("TRANSFER", environment);
|
|
17
|
-
}).not.toThrow();
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
describe("getServiceUrl failure", () => {
|
|
23
|
-
it("should throw an error when passed an invalid value", () => {
|
|
24
|
-
expect(() => {
|
|
25
|
-
getServiceURL("TRANSFER", "///%%%###");
|
|
26
|
-
}).toThrow();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe.each(Object.values(ENVIRONMENTS))(
|
|
31
|
-
"build succeeds for all environments",
|
|
32
|
-
(environment) => {
|
|
33
|
-
const ORIGINAL_ENV_VARS = process.env;
|
|
34
|
-
|
|
35
|
-
beforeEach(() => {
|
|
36
|
-
process.env = {
|
|
37
|
-
...ORIGINAL_ENV_VARS,
|
|
38
|
-
GLOBUS_SDK_ENVIRONMENT: environment,
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
afterAll(() => {
|
|
43
|
-
process.env = ORIGINAL_ENV_VARS;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("should not throw errors for all environments", () => {
|
|
47
|
-
expect(() => {
|
|
48
|
-
build("AUTH", "test-path");
|
|
49
|
-
}).not.toThrow();
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
describe("build fails when invalid GLOBUS_SDK_ENVIRONMENT is set", () => {
|
|
55
|
-
const ORIGINAL_ENV_VARS = process.env;
|
|
56
|
-
|
|
57
|
-
afterAll(() => {
|
|
58
|
-
process.env = ORIGINAL_ENV_VARS;
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("should throw an error", () => {
|
|
62
|
-
process.env["GLOBUS_SDK_ENVIRONMENT"] = "sindbox"; // <- intentional misspelling
|
|
63
|
-
|
|
64
|
-
expect(() => {
|
|
65
|
-
build("AUTH", "test-path");
|
|
66
|
-
}).toThrow(EnvironmentConfigurationError);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe("stringifyParameters", () => {
|
|
71
|
-
it("should serialize a simple object", () => {
|
|
72
|
-
expect(
|
|
73
|
-
stringifyParameters({ storage_gateway: "my-storage-gateway" })
|
|
74
|
-
).toEqual("storage_gateway=my-storage-gateway");
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it("should serialize an object with an array (single value)", () => {
|
|
78
|
-
/**
|
|
79
|
-
* Example from the GCS Manager API
|
|
80
|
-
* @see https://docs.globus.org/globus-connect-server/v5.4/api/openapi_Roles/#listRoles
|
|
81
|
-
*/
|
|
82
|
-
expect(stringifyParameters({ include: ["all_roles"] })).toEqual(
|
|
83
|
-
"include=all_roles"
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("should serialize an object with an array (many values)", () => {
|
|
88
|
-
/**
|
|
89
|
-
* Example from the Groups V2 API
|
|
90
|
-
* @see https://groups.api.globus.org/redoc?_gl=1*16m8wdi*_ga*MTI3NTI4MzEzMi4xNjc1MTk1MTMw*_ga_7ZB89HGG0P*MTY5MDU3OTExNS4xNjUuMS4xNjkwNTc5MTk2LjAuMC4w#tag/groups/operation/get_statuses_v2_groups_statuses_get
|
|
91
|
-
*/
|
|
92
|
-
expect(
|
|
93
|
-
stringifyParameters({
|
|
94
|
-
include: [
|
|
95
|
-
"memberships",
|
|
96
|
-
"my_memberships",
|
|
97
|
-
"policies",
|
|
98
|
-
"allowed_actions",
|
|
99
|
-
],
|
|
100
|
-
})
|
|
101
|
-
).toEqual(
|
|
102
|
-
"include=memberships%2Cmy_memberships%2Cpolicies%2Callowed_actions"
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
|
-
});
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description Session and authorization management via PKCE.
|
|
3
|
-
* @group Core
|
|
4
|
-
* @module
|
|
5
|
-
* @experimental
|
|
6
|
-
*/
|
|
7
|
-
import PKCE from "js-pkce";
|
|
8
|
-
|
|
9
|
-
import type IConfig from "js-pkce/dist/IConfig";
|
|
10
|
-
import type ITokenResponse from "js-pkce/dist/ITokenResponse";
|
|
11
|
-
import { getAuthorizationEndpoint, getTokenEndpoint } from "../services/auth";
|
|
12
|
-
import {
|
|
13
|
-
addTokenResponse,
|
|
14
|
-
getTokenForScope,
|
|
15
|
-
reset as resetTokens,
|
|
16
|
-
} from "./consent";
|
|
17
|
-
|
|
18
|
-
import { createStorage, StorageSystem } from "./storage";
|
|
19
|
-
|
|
20
|
-
let storage: StorageSystem;
|
|
21
|
-
|
|
22
|
-
type PKCEConfiguration = {
|
|
23
|
-
client_id?: IConfig["client_id"];
|
|
24
|
-
requested_scopes: IConfig["requested_scopes"];
|
|
25
|
-
redirect_uri: IConfig["redirect_uri"];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @experimental
|
|
30
|
-
*/
|
|
31
|
-
export class PKCEAuthorization {
|
|
32
|
-
#pkce: PKCE;
|
|
33
|
-
#configuration: IConfig;
|
|
34
|
-
#response: ITokenResponse | undefined;
|
|
35
|
-
|
|
36
|
-
constructor(configuration: PKCEConfiguration) {
|
|
37
|
-
storage = createStorage("localStorage");
|
|
38
|
-
if (!configuration.client_id) {
|
|
39
|
-
throw new Error("You must provide a `client_id`.");
|
|
40
|
-
}
|
|
41
|
-
this.#configuration = {
|
|
42
|
-
client_id: configuration.client_id,
|
|
43
|
-
authorization_endpoint: getAuthorizationEndpoint(),
|
|
44
|
-
token_endpoint: getTokenEndpoint(),
|
|
45
|
-
...configuration,
|
|
46
|
-
};
|
|
47
|
-
this.#pkce = this.#createPKCEInstance();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
#createPKCEInstance() {
|
|
51
|
-
return new PKCE(this.#configuration);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
#resetPKCE() {
|
|
55
|
-
/**
|
|
56
|
-
* Resets js-pkce state
|
|
57
|
-
* @see https://github.com/bpedroza/js-pkce/blob/master/src/PKCE.ts
|
|
58
|
-
*/
|
|
59
|
-
sessionStorage.removeItem("pkce_state");
|
|
60
|
-
sessionStorage.removeItem("pkce_code_verifier");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
reset() {
|
|
64
|
-
this.#resetPKCE();
|
|
65
|
-
resetTokens();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
redirect() {
|
|
69
|
-
this.reset();
|
|
70
|
-
window.location.replace(this.#pkce.authorizeUrl());
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async handleCodeRedirect(options = { removeStateAndReplaceLocation: true }) {
|
|
74
|
-
const url = new URL(window.location.href);
|
|
75
|
-
const params = new URLSearchParams(url.search);
|
|
76
|
-
|
|
77
|
-
if (!params.get("code")) return;
|
|
78
|
-
const response = await this.#pkce.exchangeForAccessToken(url.toString());
|
|
79
|
-
this.#response = response;
|
|
80
|
-
addTokenResponse(this.#response);
|
|
81
|
-
// Remove PKCE-state from the URL since we have a token.
|
|
82
|
-
if (options.removeStateAndReplaceLocation) {
|
|
83
|
-
params.delete("code");
|
|
84
|
-
params.delete("state");
|
|
85
|
-
url.search = params.toString();
|
|
86
|
-
window.location.replace(url);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
hasToken(): boolean {
|
|
91
|
-
return this.#configuration.requested_scopes
|
|
92
|
-
.split(" ")
|
|
93
|
-
.every((scope) => Boolean(getTokenForScope(scope)));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
revoke() {
|
|
97
|
-
this.reset();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @experimental
|
|
103
|
-
*/
|
|
104
|
-
export function pkce(configuration: PKCEConfiguration) {
|
|
105
|
-
return new PKCEAuthorization(configuration);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @experimental
|
|
110
|
-
*/
|
|
111
|
-
export function incremental(configuration: PKCEConfiguration) {
|
|
112
|
-
return new PKCEAuthorization(configuration);
|
|
113
|
-
}
|
package/src/lib/core/consent.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { getStorage } from "./storage";
|
|
2
|
-
import type { Token, TokenResponse } from "../services/auth";
|
|
3
|
-
|
|
4
|
-
import ITokenResponse from "js-pkce/dist/ITokenResponse";
|
|
5
|
-
|
|
6
|
-
function isValidToken(check: unknown): check is Token {
|
|
7
|
-
const maybe = check as Token;
|
|
8
|
-
return Boolean(maybe.token_type && maybe.access_token);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function store(token: ITokenResponse) {
|
|
12
|
-
token.scope.split(" ").forEach((scope) => {
|
|
13
|
-
getStorage().set(scope, token);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function addTokenResponse(token: ITokenResponse | TokenResponse) {
|
|
18
|
-
store(token);
|
|
19
|
-
if ("other_tokens" in token) {
|
|
20
|
-
token.other_tokens.forEach(store);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function getTokenForScope(scope: string) {
|
|
25
|
-
const token = getStorage().get(scope);
|
|
26
|
-
if (!token || !isValidToken(token)) {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return `${token.token_type} ${token.access_token}`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function reset() {
|
|
33
|
-
getStorage().clear();
|
|
34
|
-
}
|
package/src/lib/core/errors.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export class EnvironmentConfigurationError extends Error {
|
|
2
|
-
override name = "EnvironmentConfigurationError";
|
|
3
|
-
constructor(variable: string, value: unknown) {
|
|
4
|
-
super();
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
6
|
-
this.message = `Invalid configuration value provided for ${variable} (${value}).`;
|
|
7
|
-
}
|
|
8
|
-
}
|
package/src/lib/core/fetch.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { fetch } from "./internals/fetch";
|
|
2
|
-
import { getTokenForScope } from "./consent";
|
|
3
|
-
|
|
4
|
-
type GlobusScope = string;
|
|
5
|
-
|
|
6
|
-
export type FetchOverrides =
|
|
7
|
-
| (Omit<RequestInit, "headers"> & {
|
|
8
|
-
headers?: Record<string, string>;
|
|
9
|
-
})
|
|
10
|
-
| undefined;
|
|
11
|
-
|
|
12
|
-
export function fetchWithScope(
|
|
13
|
-
scope: GlobusScope,
|
|
14
|
-
input: RequestInfo | URL,
|
|
15
|
-
fetchOverrides: FetchOverrides = {}
|
|
16
|
-
) {
|
|
17
|
-
const headers = fetchOverrides.headers || {};
|
|
18
|
-
/**
|
|
19
|
-
* If an `Authorization` override header was provided, we skip any
|
|
20
|
-
* sort of lookup and use the provided value.
|
|
21
|
-
*/
|
|
22
|
-
if (!headers?.["Authorization"]) {
|
|
23
|
-
const token = getTokenForScope(scope);
|
|
24
|
-
if (token) {
|
|
25
|
-
headers["Authorization"] = token;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* If `Content-Type` header was not provided, and there is a body, we assume it is JSON.
|
|
30
|
-
*/
|
|
31
|
-
if (!headers?.["Content-Type"] && fetchOverrides?.body) {
|
|
32
|
-
headers["Content-Type"] = "application/json";
|
|
33
|
-
}
|
|
34
|
-
return fetch(input, {
|
|
35
|
-
...fetchOverrides,
|
|
36
|
-
headers,
|
|
37
|
-
});
|
|
38
|
-
}
|
package/src/lib/core/global.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as AUTH from "../services/auth/config";
|
|
2
|
-
import * as TRANSFER from "../services/transfer/config";
|
|
3
|
-
import * as FLOWS from "../services/flows/config";
|
|
4
|
-
import * as GROUPS from "../services/groups/config";
|
|
5
|
-
import * as SEARCH from "../services/search/config";
|
|
6
|
-
|
|
7
|
-
import { EnvironmentConfigurationError } from "./errors";
|
|
8
|
-
|
|
9
|
-
function getRuntime() {
|
|
10
|
-
return typeof window !== "undefined" ? window : process;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function isBrowser(runtime: Window | NodeJS.Process): runtime is Window {
|
|
14
|
-
return typeof window === typeof runtime;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function env<T extends string>(
|
|
18
|
-
key: string,
|
|
19
|
-
fallback: T | undefined = undefined
|
|
20
|
-
): T | undefined {
|
|
21
|
-
const runtime = getRuntime();
|
|
22
|
-
let envConfiguration;
|
|
23
|
-
if (isBrowser(runtime)) {
|
|
24
|
-
envConfiguration = runtime;
|
|
25
|
-
} else {
|
|
26
|
-
envConfiguration = runtime.env;
|
|
27
|
-
}
|
|
28
|
-
if (key in envConfiguration) {
|
|
29
|
-
return (envConfiguration as Record<typeof key, T>)[key];
|
|
30
|
-
}
|
|
31
|
-
return fallback;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Handlers for: GLOBUS_SDK_ENVIRONMENT
|
|
36
|
-
*/
|
|
37
|
-
export const ENVIRONMENTS = {
|
|
38
|
-
PRODUCTION: "production",
|
|
39
|
-
PREVIEW: "preview",
|
|
40
|
-
STAGING: "staging",
|
|
41
|
-
SANDBOX: "sandbox",
|
|
42
|
-
INTEGRATION: "integration",
|
|
43
|
-
TEST: "test",
|
|
44
|
-
} as const;
|
|
45
|
-
|
|
46
|
-
export type Environment = (typeof ENVIRONMENTS)[keyof typeof ENVIRONMENTS];
|
|
47
|
-
|
|
48
|
-
export function getEnvironment(): Environment {
|
|
49
|
-
const environment = env<Environment>(
|
|
50
|
-
"GLOBUS_SDK_ENVIRONMENT",
|
|
51
|
-
ENVIRONMENTS.PRODUCTION
|
|
52
|
-
);
|
|
53
|
-
if (!environment || !Object.values(ENVIRONMENTS).includes(environment)) {
|
|
54
|
-
throw new EnvironmentConfigurationError(
|
|
55
|
-
"GLOBUS_SDK_ENVIRONMENT",
|
|
56
|
-
environment
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return environment;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const SERVICES = {
|
|
63
|
-
[AUTH.ID]: AUTH.ID,
|
|
64
|
-
[TRANSFER.ID]: TRANSFER.ID,
|
|
65
|
-
[FLOWS.ID]: FLOWS.ID,
|
|
66
|
-
[GROUPS.ID]: GROUPS.ID,
|
|
67
|
-
[SEARCH.ID]: SEARCH.ID,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export type Service = keyof typeof SERVICES;
|
|
71
|
-
|
|
72
|
-
export const SERVICE_HOSTS: Record<
|
|
73
|
-
Service,
|
|
74
|
-
Partial<Record<Environment, string>>
|
|
75
|
-
> = {
|
|
76
|
-
[AUTH.ID]: AUTH.HOSTS,
|
|
77
|
-
[TRANSFER.ID]: TRANSFER.HOSTS,
|
|
78
|
-
[FLOWS.ID]: FLOWS.HOSTS,
|
|
79
|
-
[GROUPS.ID]: GROUPS.HOSTS,
|
|
80
|
-
[SEARCH.ID]: SEARCH.HOSTS,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Handlers for: GLOBUS_SDK_VERIFY_SSL
|
|
85
|
-
* Since disabling SSL is at least not-recommended, we consider
|
|
86
|
-
* this value to always be true, but provide a warning when it set
|
|
87
|
-
* to one of the falsey values for informational purposes.
|
|
88
|
-
*
|
|
89
|
-
* Taking direction from `globus-sdk-python` for possible false values
|
|
90
|
-
* @see https://github.com/globus/globus-sdk-python/blob/18eced9c12e2ec41745d1be183148845198b999c/src/globus_sdk/config/env_vars.py#L20
|
|
91
|
-
*/
|
|
92
|
-
export function getVerifySSL(): boolean {
|
|
93
|
-
const verifySSLTemp = (
|
|
94
|
-
env("GLOBUS_SDK_VERIFY_SSL", "true") as string
|
|
95
|
-
).toLowerCase();
|
|
96
|
-
if (["n", "no", "f", "false", "off", "0"].includes(verifySSLTemp)) {
|
|
97
|
-
console.warn(
|
|
98
|
-
"Setting GLOBUS_SDK_VERIFY_SSL to false is disallowed in the Globus Javascript SDK. It will always true in this context"
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Handlers for: GLOBUS_SDK_HTTP_TIMEOUT
|
|
106
|
-
*/
|
|
107
|
-
export function getHttpTimeout() {
|
|
108
|
-
const timeout = Number(env("GLOBUS_SDK_HTTP_TIMEOUT", "60"));
|
|
109
|
-
if (timeout === -1) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
return timeout;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function getServiceHost(service: Service, environment: Environment) {
|
|
116
|
-
return SERVICE_HOSTS[service][environment];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function getServiceBaseUrl(
|
|
120
|
-
service: Service,
|
|
121
|
-
environment: Environment = getEnvironment()
|
|
122
|
-
) {
|
|
123
|
-
const host = getServiceHost(service, environment);
|
|
124
|
-
return env(
|
|
125
|
-
`GLOBUS_SDK_SERVICE_URL_${service}`,
|
|
126
|
-
host ? `https://${host}` : undefined
|
|
127
|
-
);
|
|
128
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { MemoryStorage } from "./memory";
|
|
2
|
-
import { LocalStorage } from "./local-storage";
|
|
3
|
-
/**
|
|
4
|
-
* Acts as a basic wrapper for storage layers to make their surface APIs consistent.
|
|
5
|
-
*/
|
|
6
|
-
export interface StorageSystem {
|
|
7
|
-
get(key: string): unknown | undefined;
|
|
8
|
-
set(key: string, value: unknown): void;
|
|
9
|
-
remove(key: string): void;
|
|
10
|
-
clear(): void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let storage: undefined | StorageSystem;
|
|
14
|
-
type StorageOptions =
|
|
15
|
-
| "localStorage"
|
|
16
|
-
| "memory"
|
|
17
|
-
| {
|
|
18
|
-
new (): StorageSystem;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Returns the active storage system or creates an instance for the running process.
|
|
23
|
-
*/
|
|
24
|
-
export function createStorage(
|
|
25
|
-
storageType: StorageOptions = "memory"
|
|
26
|
-
): StorageSystem {
|
|
27
|
-
if (!storage) {
|
|
28
|
-
let Factory;
|
|
29
|
-
if (storageType === "localStorage") {
|
|
30
|
-
Factory = LocalStorage;
|
|
31
|
-
} else if (storageType === "memory") {
|
|
32
|
-
Factory = MemoryStorage;
|
|
33
|
-
} else {
|
|
34
|
-
Factory = storageType;
|
|
35
|
-
}
|
|
36
|
-
storage = new Factory();
|
|
37
|
-
}
|
|
38
|
-
return storage;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default createStorage;
|
|
42
|
-
|
|
43
|
-
export function getStorage() {
|
|
44
|
-
if (!storage) {
|
|
45
|
-
throw Error("You must create a storage system.");
|
|
46
|
-
}
|
|
47
|
-
return storage;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* A private method for resetting the storage system. This is primarily used to reset
|
|
52
|
-
* the storage system during testing.
|
|
53
|
-
* @private
|
|
54
|
-
*/
|
|
55
|
-
export function __reset() {
|
|
56
|
-
storage = undefined;
|
|
57
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { StorageSystem } from "./index";
|
|
2
|
-
|
|
3
|
-
export class LocalStorage implements StorageSystem {
|
|
4
|
-
get<T>(key: string): T | null | unknown {
|
|
5
|
-
const value = localStorage.getItem(key);
|
|
6
|
-
return value !== null ? JSON.parse(value) : null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
set(key: string, value: unknown) {
|
|
10
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
remove(key: string) {
|
|
14
|
-
localStorage.removeItem(key);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
clear() {
|
|
18
|
-
localStorage.clear();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { StorageSystem } from "./index";
|
|
2
|
-
|
|
3
|
-
export class MemoryStorage implements StorageSystem {
|
|
4
|
-
#cache: Record<string, unknown> = {};
|
|
5
|
-
|
|
6
|
-
get(key: string) {
|
|
7
|
-
return this.#cache[key];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
set(key: string, value: unknown) {
|
|
11
|
-
this.#cache[key] = value;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
remove(key: string) {
|
|
15
|
-
delete this.#cache[key];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
clear() {
|
|
19
|
-
this.#cache = {};
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { StorageSystem } from "./index";
|
|
2
|
-
|
|
3
|
-
import storage, { __reset } from "./index";
|
|
4
|
-
import { MemoryStorage } from "./memory";
|
|
5
|
-
import { LocalStorage } from "./local-storage";
|
|
6
|
-
|
|
7
|
-
describe("storage", () => {
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
__reset();
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("default storage interface (memory)", () => {
|
|
13
|
-
expect(storage()).toBeInstanceOf(MemoryStorage);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it("can be configured using known interface", () => {
|
|
17
|
-
expect(storage("localStorage")).toBeInstanceOf(LocalStorage);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("can be provided a custom storage interface", () => {
|
|
21
|
-
expect(storage(CustomStorage)).toBeInstanceOf(CustomStorage);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
class CustomStorage implements StorageSystem {
|
|
26
|
-
get(key: string) {}
|
|
27
|
-
set(key: string, value: any): void {}
|
|
28
|
-
remove(key: string): void {}
|
|
29
|
-
clear(): void {}
|
|
30
|
-
}
|
package/src/lib/core/url.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { getServiceBaseUrl, getEnvironment, Environment } from "./global";
|
|
2
|
-
import type { Service } from "./global";
|
|
3
|
-
import type { GCSConfiguration } from "../services/globus-connect-server";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Return the base URL for a service (based on the environment).
|
|
7
|
-
* @param service The service to build the URL for.
|
|
8
|
-
* @param path The path to the resource.
|
|
9
|
-
* @param environment The environment to use.
|
|
10
|
-
*/
|
|
11
|
-
export function getServiceURL(
|
|
12
|
-
service: Service,
|
|
13
|
-
path = "",
|
|
14
|
-
environment: Environment = getEnvironment()
|
|
15
|
-
): URL {
|
|
16
|
-
const base = getServiceBaseUrl(service, environment);
|
|
17
|
-
return new URL(path, base);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Build a URL for a service or GCSConfiguration.
|
|
22
|
-
*
|
|
23
|
-
* @param service The service identifier or GCSConfiguration object to build the URL for.
|
|
24
|
-
* @param path The path to the resource.
|
|
25
|
-
* @param options Additional options for the URL.
|
|
26
|
-
*/
|
|
27
|
-
export function build(
|
|
28
|
-
serviceOrConfiguration: Service | GCSConfiguration,
|
|
29
|
-
path: string,
|
|
30
|
-
options?: {
|
|
31
|
-
search?: Parameters<typeof stringifyParameters>[0];
|
|
32
|
-
}
|
|
33
|
-
) {
|
|
34
|
-
let url;
|
|
35
|
-
if (typeof serviceOrConfiguration === "object") {
|
|
36
|
-
url = new URL(path, serviceOrConfiguration.host);
|
|
37
|
-
} else {
|
|
38
|
-
url = getServiceURL(serviceOrConfiguration, path);
|
|
39
|
-
}
|
|
40
|
-
if (options && options.search) {
|
|
41
|
-
url.search = stringifyParameters(options.search);
|
|
42
|
-
}
|
|
43
|
-
return url.toString();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* An extremely simplified parameter serializer based on our current needs.
|
|
48
|
-
*
|
|
49
|
-
* **This is intended for internal @globus/sdk use only.**
|
|
50
|
-
*
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
|
-
export function stringifyParameters(parameters: {
|
|
54
|
-
[key: string]:
|
|
55
|
-
| string
|
|
56
|
-
| number
|
|
57
|
-
| Array<string | number | null | undefined>
|
|
58
|
-
| null
|
|
59
|
-
| undefined;
|
|
60
|
-
}) {
|
|
61
|
-
const search = new URLSearchParams();
|
|
62
|
-
for (const [key, value] of Object.entries(parameters)) {
|
|
63
|
-
if (Array.isArray(value)) {
|
|
64
|
-
/**
|
|
65
|
-
* Arrays are converted to comma-separated strings.
|
|
66
|
-
*/
|
|
67
|
-
search.set(key, value.join(","));
|
|
68
|
-
} else if (value !== undefined) {
|
|
69
|
-
search.set(key, String(value));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return search.toString();
|
|
73
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Environment } from "../../core/global";
|
|
2
|
-
|
|
3
|
-
export const ID = "AUTH";
|
|
4
|
-
export const HOSTS: Partial<Record<Environment, string>> = {
|
|
5
|
-
integration: "auth.integration.globuscs.info",
|
|
6
|
-
sandbox: "auth.sandbox.globuscs.info",
|
|
7
|
-
production: "auth.globus.org",
|
|
8
|
-
test: "auth.test.globuscs.info",
|
|
9
|
-
staging: "auth.staging.globuscs.info",
|
|
10
|
-
preview: "auth.preview.globus.org",
|
|
11
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description A wrapper around the Globus Auth service.
|
|
3
|
-
* @group Service
|
|
4
|
-
* @see [Globus Auth API Documentation](https://docs.globus.org/api/auth/)
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
import { build } from "../../core/url";
|
|
8
|
-
|
|
9
|
-
import * as AUTH from "./config";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export const CONFIG = AUTH;
|
|
16
|
-
|
|
17
|
-
import type ITokenResponse from "js-pkce/dist/ITokenResponse";
|
|
18
|
-
|
|
19
|
-
export function getAuthorizationEndpoint() {
|
|
20
|
-
return build(AUTH.ID, "/v2/oauth2/authorize");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function getTokenEndpoint() {
|
|
24
|
-
return build(AUTH.ID, "/v2/oauth2/token");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type Token = ITokenResponse & {
|
|
28
|
-
resource_server: string;
|
|
29
|
-
id_token?: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @see https://docs.globus.org/api/auth/reference/#authorization_code_grant_preferred
|
|
33
|
-
*/
|
|
34
|
-
export type TokenResponse = Token & {
|
|
35
|
-
state: string;
|
|
36
|
-
other_tokens: Token[];
|
|
37
|
-
};
|