@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.
Files changed (507) hide show
  1. package/cjs/package.json +3 -0
  2. package/{src/index.ts → esm/index.d.ts} +1 -5
  3. package/esm/index.d.ts.map +1 -0
  4. package/esm/index.js +50 -0
  5. package/esm/index.js.map +1 -0
  6. package/esm/lib/core/authorization.d.ts +30 -0
  7. package/esm/lib/core/authorization.d.ts.map +1 -0
  8. package/esm/lib/core/authorization.js +87 -0
  9. package/esm/lib/core/authorization.js.map +1 -0
  10. package/esm/lib/core/consent.d.ts +6 -0
  11. package/esm/lib/core/consent.d.ts.map +1 -0
  12. package/esm/lib/core/consent.js +27 -0
  13. package/esm/lib/core/consent.js.map +1 -0
  14. package/esm/lib/core/errors.d.ts +5 -0
  15. package/esm/lib/core/errors.d.ts.map +1 -0
  16. package/esm/lib/core/errors.js +9 -0
  17. package/esm/lib/core/errors.js.map +1 -0
  18. package/esm/lib/core/fetch.d.ts +7 -0
  19. package/esm/lib/core/fetch.d.ts.map +1 -0
  20. package/esm/lib/core/fetch.js +23 -0
  21. package/esm/lib/core/fetch.js.map +1 -0
  22. package/esm/lib/core/global.d.ts +38 -0
  23. package/esm/lib/core/global.d.ts.map +1 -0
  24. package/esm/lib/core/global.js +92 -0
  25. package/esm/lib/core/global.js.map +1 -0
  26. package/esm/lib/core/internals/fetch.d.ts +2 -0
  27. package/esm/lib/core/internals/fetch.d.ts.map +1 -0
  28. package/{src/lib/core/internals/fetch.ts → esm/lib/core/internals/fetch.js} +1 -0
  29. package/esm/lib/core/internals/fetch.js.map +1 -0
  30. package/esm/lib/core/storage/index.d.ts +25 -0
  31. package/esm/lib/core/storage/index.d.ts.map +1 -0
  32. package/esm/lib/core/storage/index.js +38 -0
  33. package/esm/lib/core/storage/index.js.map +1 -0
  34. package/esm/lib/core/storage/local-storage.d.ts +8 -0
  35. package/esm/lib/core/storage/local-storage.d.ts.map +1 -0
  36. package/esm/lib/core/storage/local-storage.js +16 -0
  37. package/esm/lib/core/storage/local-storage.js.map +1 -0
  38. package/esm/lib/core/storage/memory.d.ts +9 -0
  39. package/esm/lib/core/storage/memory.d.ts.map +1 -0
  40. package/esm/lib/core/storage/memory.js +21 -0
  41. package/esm/lib/core/storage/memory.js.map +1 -0
  42. package/esm/lib/core/url.d.ts +31 -0
  43. package/esm/lib/core/url.d.ts.map +1 -0
  44. package/esm/lib/core/url.js +54 -0
  45. package/esm/lib/core/url.js.map +1 -0
  46. package/esm/lib/services/auth/config.d.ts +4 -0
  47. package/esm/lib/services/auth/config.d.ts.map +1 -0
  48. package/esm/lib/services/auth/config.js +10 -0
  49. package/esm/lib/services/auth/config.js.map +1 -0
  50. package/esm/lib/services/auth/index.d.ts +21 -0
  51. package/esm/lib/services/auth/index.d.ts.map +1 -0
  52. package/esm/lib/services/auth/index.js +20 -0
  53. package/esm/lib/services/auth/index.js.map +1 -0
  54. package/esm/lib/services/auth/types.d.ts +15 -0
  55. package/esm/lib/services/auth/types.d.ts.map +1 -0
  56. package/esm/lib/services/auth/types.js +2 -0
  57. package/esm/lib/services/auth/types.js.map +1 -0
  58. package/esm/lib/services/flows/config.d.ts +14 -0
  59. package/esm/lib/services/flows/config.d.ts.map +1 -0
  60. package/esm/lib/services/flows/config.js +20 -0
  61. package/esm/lib/services/flows/config.js.map +1 -0
  62. package/{src/lib/services/flows/index.ts → esm/lib/services/flows/index.d.ts} +2 -3
  63. package/esm/lib/services/flows/index.d.ts.map +1 -0
  64. package/esm/lib/services/flows/index.js +17 -0
  65. package/esm/lib/services/flows/index.js.map +1 -0
  66. package/esm/lib/services/flows/service/flows.d.ts +17 -0
  67. package/esm/lib/services/flows/service/flows.d.ts.map +1 -0
  68. package/esm/lib/services/flows/service/flows.js +27 -0
  69. package/esm/lib/services/flows/service/flows.js.map +1 -0
  70. package/esm/lib/services/flows/service/runs.d.ts +10 -0
  71. package/esm/lib/services/flows/service/runs.d.ts.map +1 -0
  72. package/esm/lib/services/flows/service/runs.js +14 -0
  73. package/esm/lib/services/flows/service/runs.js.map +1 -0
  74. package/esm/lib/services/globus-connect-server/client.d.ts +3461 -0
  75. package/esm/lib/services/globus-connect-server/client.d.ts.map +1 -0
  76. package/esm/lib/services/globus-connect-server/client.js +50 -0
  77. package/esm/lib/services/globus-connect-server/client.js.map +1 -0
  78. package/esm/lib/services/globus-connect-server/index.d.ts +47 -0
  79. package/esm/lib/services/globus-connect-server/index.d.ts.map +1 -0
  80. package/esm/lib/services/globus-connect-server/index.js +26 -0
  81. package/esm/lib/services/globus-connect-server/index.js.map +1 -0
  82. package/esm/lib/services/globus-connect-server/service/collections.d.ts +29 -0
  83. package/esm/lib/services/globus-connect-server/service/collections.d.ts.map +1 -0
  84. package/esm/lib/services/globus-connect-server/service/collections.js +20 -0
  85. package/esm/lib/services/globus-connect-server/service/collections.js.map +1 -0
  86. package/esm/lib/services/globus-connect-server/service/endpoint.d.ts +7 -0
  87. package/esm/lib/services/globus-connect-server/service/endpoint.d.ts.map +1 -0
  88. package/esm/lib/services/globus-connect-server/service/endpoint.js +11 -0
  89. package/esm/lib/services/globus-connect-server/service/endpoint.js.map +1 -0
  90. package/esm/lib/services/globus-connect-server/service/roles.d.ts +33 -0
  91. package/esm/lib/services/globus-connect-server/service/roles.d.ts.map +1 -0
  92. package/esm/lib/services/globus-connect-server/service/roles.js +36 -0
  93. package/esm/lib/services/globus-connect-server/service/roles.js.map +1 -0
  94. package/esm/lib/services/globus-connect-server/service/storage-gateways.d.ts +27 -0
  95. package/esm/lib/services/globus-connect-server/service/storage-gateways.d.ts.map +1 -0
  96. package/esm/lib/services/globus-connect-server/service/storage-gateways.js +22 -0
  97. package/esm/lib/services/globus-connect-server/service/storage-gateways.js.map +1 -0
  98. package/esm/lib/services/globus-connect-server/service/user-credentials.d.ts +20 -0
  99. package/esm/lib/services/globus-connect-server/service/user-credentials.d.ts.map +1 -0
  100. package/esm/lib/services/globus-connect-server/service/user-credentials.js +20 -0
  101. package/esm/lib/services/globus-connect-server/service/user-credentials.js.map +1 -0
  102. package/esm/lib/services/globus-connect-server/service/versioning.d.ts +8 -0
  103. package/esm/lib/services/globus-connect-server/service/versioning.d.ts.map +1 -0
  104. package/esm/lib/services/globus-connect-server/service/versioning.js +12 -0
  105. package/esm/lib/services/globus-connect-server/service/versioning.js.map +1 -0
  106. package/esm/lib/services/groups/config.d.ts +11 -0
  107. package/esm/lib/services/groups/config.d.ts.map +1 -0
  108. package/esm/lib/services/groups/config.js +17 -0
  109. package/esm/lib/services/groups/config.js.map +1 -0
  110. package/{src/lib/services/groups/index.ts → esm/lib/services/groups/index.d.ts} +2 -4
  111. package/esm/lib/services/groups/index.d.ts.map +1 -0
  112. package/esm/lib/services/groups/index.js +19 -0
  113. package/esm/lib/services/groups/index.js.map +1 -0
  114. package/esm/lib/services/groups/service/groups.d.ts +28 -0
  115. package/esm/lib/services/groups/service/groups.d.ts.map +1 -0
  116. package/esm/lib/services/groups/service/groups.js +22 -0
  117. package/esm/lib/services/groups/service/groups.js.map +1 -0
  118. package/esm/lib/services/groups/service/membership.d.ts +14 -0
  119. package/esm/lib/services/groups/service/membership.d.ts.map +1 -0
  120. package/esm/lib/services/groups/service/membership.js +14 -0
  121. package/esm/lib/services/groups/service/membership.js.map +1 -0
  122. package/esm/lib/services/groups/service/policies.d.ts +7 -0
  123. package/esm/lib/services/groups/service/policies.d.ts.map +1 -0
  124. package/esm/lib/services/groups/service/policies.js +11 -0
  125. package/esm/lib/services/groups/service/policies.js.map +1 -0
  126. package/esm/lib/services/search/config.d.ts +12 -0
  127. package/esm/lib/services/search/config.d.ts.map +1 -0
  128. package/esm/lib/services/search/config.js +18 -0
  129. package/esm/lib/services/search/config.js.map +1 -0
  130. package/{src/lib/services/search/index.ts → esm/lib/services/search/index.d.ts} +2 -3
  131. package/esm/lib/services/search/index.d.ts.map +1 -0
  132. package/esm/lib/services/search/index.js +15 -0
  133. package/esm/lib/services/search/index.js.map +1 -0
  134. package/esm/lib/services/search/service/query.d.ts +24 -0
  135. package/esm/lib/services/search/service/query.d.ts.map +1 -0
  136. package/esm/lib/services/search/service/query.js +15 -0
  137. package/esm/lib/services/search/service/query.js.map +1 -0
  138. package/esm/lib/services/shared.d.ts +7 -0
  139. package/esm/lib/services/shared.d.ts.map +1 -0
  140. package/esm/lib/services/shared.js +8 -0
  141. package/esm/lib/services/shared.js.map +1 -0
  142. package/esm/lib/services/transfer/config.d.ts +4 -0
  143. package/esm/lib/services/transfer/config.d.ts.map +1 -0
  144. package/esm/lib/services/transfer/config.js +10 -0
  145. package/esm/lib/services/transfer/config.js.map +1 -0
  146. package/{src/lib/services/transfer/index.ts → esm/lib/services/transfer/index.d.ts} +2 -3
  147. package/esm/lib/services/transfer/index.d.ts.map +1 -0
  148. package/esm/lib/services/transfer/index.js +21 -0
  149. package/esm/lib/services/transfer/index.js.map +1 -0
  150. package/esm/lib/services/transfer/service/endpoint-search.d.ts +18 -0
  151. package/esm/lib/services/transfer/service/endpoint-search.d.ts.map +1 -0
  152. package/esm/lib/services/transfer/service/endpoint-search.js +23 -0
  153. package/esm/lib/services/transfer/service/endpoint-search.js.map +1 -0
  154. package/esm/lib/services/transfer/service/endpoint.d.ts +5 -0
  155. package/esm/lib/services/transfer/service/endpoint.d.ts.map +1 -0
  156. package/esm/lib/services/transfer/service/endpoint.js +11 -0
  157. package/esm/lib/services/transfer/service/endpoint.js.map +1 -0
  158. package/esm/lib/services/transfer/service/file-operations.d.ts +63 -0
  159. package/esm/lib/services/transfer/service/file-operations.d.ts.map +1 -0
  160. package/esm/lib/services/transfer/service/file-operations.js +50 -0
  161. package/esm/lib/services/transfer/service/file-operations.js.map +1 -0
  162. package/esm/lib/services/transfer/service/task-submission.d.ts +30 -0
  163. package/esm/lib/services/transfer/service/task-submission.d.ts.map +1 -0
  164. package/esm/lib/services/transfer/service/task-submission.js +30 -0
  165. package/esm/lib/services/transfer/service/task-submission.js.map +1 -0
  166. package/esm/lib/services/transfer/shared.d.ts +3 -0
  167. package/esm/lib/services/transfer/shared.d.ts.map +1 -0
  168. package/esm/lib/services/transfer/shared.js +10 -0
  169. package/esm/lib/services/transfer/shared.js.map +1 -0
  170. package/esm/lib/services/transfer/types.d.ts +43 -0
  171. package/esm/lib/services/transfer/types.d.ts.map +1 -0
  172. package/esm/lib/services/transfer/types.js +2 -0
  173. package/esm/lib/services/transfer/types.js.map +1 -0
  174. package/esm/lib/services/types.d.ts +44 -0
  175. package/esm/lib/services/types.d.ts.map +1 -0
  176. package/esm/lib/services/types.js +2 -0
  177. package/esm/lib/services/types.js.map +1 -0
  178. package/esm/package.json +3 -0
  179. package/package.json +10 -8
  180. package/tsconfig.cjs.tsbuildinfo +1 -0
  181. package/tsconfig.tsbuildinfo +1 -0
  182. package/umd/globus.production.js +1 -0
  183. package/CHANGELOG.md +0 -148
  184. package/dist/LICENSE +0 -201
  185. package/dist/README.md +0 -48
  186. package/dist/package.json +0 -30
  187. package/dist/umd/globus.production.js +0 -1
  188. package/docs/.nojekyll +0 -1
  189. package/docs/assets/highlight.css +0 -85
  190. package/docs/assets/main.js +0 -58
  191. package/docs/assets/search.js +0 -1
  192. package/docs/assets/style.css +0 -1367
  193. package/docs/classes/_globus_sdk.authorization.PKCEAuthorization.html +0 -202
  194. package/docs/functions/Client___Globus_Connect_Server_Manager_API.getClient.html +0 -212
  195. package/docs/functions/_globus_sdk.auth.getAuthorizationEndpoint.html +0 -67
  196. package/docs/functions/_globus_sdk.auth.getTokenEndpoint.html +0 -67
  197. package/docs/functions/_globus_sdk.authorization.incremental.html +0 -71
  198. package/docs/functions/_globus_sdk.authorization.pkce.html +0 -71
  199. package/docs/functions/_globus_sdk.flows.flows.destroy.html +0 -84
  200. package/docs/functions/_globus_sdk.flows.flows.get.html +0 -84
  201. package/docs/functions/_globus_sdk.flows.flows.getAll.html +0 -82
  202. package/docs/functions/_globus_sdk.flows.runs.getAll.html +0 -80
  203. package/docs/functions/_globus_sdk.gcs.collections.get.html +0 -92
  204. package/docs/functions/_globus_sdk.gcs.collections.getAll.html +0 -90
  205. package/docs/functions/_globus_sdk.gcs.endpoint.get.html +0 -89
  206. package/docs/functions/_globus_sdk.gcs.getRequiredScopes.html +0 -77
  207. package/docs/functions/_globus_sdk.gcs.roles.get.html +0 -92
  208. package/docs/functions/_globus_sdk.gcs.roles.getAll.html +0 -90
  209. package/docs/functions/_globus_sdk.gcs.storageGateways.get.html +0 -92
  210. package/docs/functions/_globus_sdk.gcs.storageGateways.getAll.html +0 -90
  211. package/docs/functions/_globus_sdk.gcs.userCredentials.get.html +0 -92
  212. package/docs/functions/_globus_sdk.gcs.userCredentials.getAll.html +0 -90
  213. package/docs/functions/_globus_sdk.gcs.versioning.info.html +0 -89
  214. package/docs/functions/_globus_sdk.groups.groups.get.html +0 -84
  215. package/docs/functions/_globus_sdk.groups.groups.getMyGroups.html +0 -82
  216. package/docs/functions/_globus_sdk.groups.membership.act.html +0 -85
  217. package/docs/functions/_globus_sdk.groups.policies.get.html +0 -83
  218. package/docs/functions/_globus_sdk.search.query.get.html +0 -84
  219. package/docs/functions/_globus_sdk.transfer.endpoint.get.html +0 -84
  220. package/docs/functions/_globus_sdk.transfer.endpointSearch.html +0 -89
  221. package/docs/functions/_globus_sdk.transfer.fileOperations.ls.html +0 -90
  222. package/docs/functions/_globus_sdk.transfer.fileOperations.mkdir.html +0 -90
  223. package/docs/functions/_globus_sdk.transfer.fileOperations.rename.html +0 -92
  224. package/docs/functions/_globus_sdk.transfer.fileOperations.symlink.html +0 -90
  225. package/docs/functions/_globus_sdk.transfer.taskSubmission.submissionId.html +0 -85
  226. package/docs/functions/_globus_sdk.transfer.taskSubmission.submitDelete.html +0 -87
  227. package/docs/functions/_globus_sdk.transfer.taskSubmission.submitTransfer.html +0 -81
  228. package/docs/index.html +0 -114
  229. package/docs/modules/Client___Globus_Connect_Server_Manager_API.html +0 -61
  230. package/docs/modules/_globus_sdk.auth.html +0 -84
  231. package/docs/modules/_globus_sdk.authorization.html +0 -75
  232. package/docs/modules/_globus_sdk.flows.flows.html +0 -75
  233. package/docs/modules/_globus_sdk.flows.html +0 -77
  234. package/docs/modules/_globus_sdk.flows.runs.html +0 -71
  235. package/docs/modules/_globus_sdk.gcs.collections.html +0 -84
  236. package/docs/modules/_globus_sdk.gcs.endpoint.html +0 -78
  237. package/docs/modules/_globus_sdk.gcs.html +0 -94
  238. package/docs/modules/_globus_sdk.gcs.roles.html +0 -80
  239. package/docs/modules/_globus_sdk.gcs.storageGateways.html +0 -80
  240. package/docs/modules/_globus_sdk.gcs.userCredentials.html +0 -80
  241. package/docs/modules/_globus_sdk.gcs.versioning.html +0 -78
  242. package/docs/modules/_globus_sdk.groups.groups.html +0 -78
  243. package/docs/modules/_globus_sdk.groups.html +0 -79
  244. package/docs/modules/_globus_sdk.groups.membership.html +0 -72
  245. package/docs/modules/_globus_sdk.groups.policies.html +0 -72
  246. package/docs/modules/_globus_sdk.html +0 -95
  247. package/docs/modules/_globus_sdk.search.html +0 -75
  248. package/docs/modules/_globus_sdk.search.query.html +0 -70
  249. package/docs/modules/_globus_sdk.transfer.endpoint.html +0 -73
  250. package/docs/modules/_globus_sdk.transfer.fileOperations.html +0 -79
  251. package/docs/modules/_globus_sdk.transfer.html +0 -84
  252. package/docs/modules/_globus_sdk.transfer.taskSubmission.html +0 -77
  253. package/docs/types/_globus_sdk.auth.Token.html +0 -70
  254. package/docs/types/_globus_sdk.auth.TokenResponse.html +0 -73
  255. package/docs/types/_globus_sdk.gcs.GCSConfiguration.html +0 -87
  256. package/docs/types/_globus_sdk.gcs.GCSServiceMethod.html +0 -96
  257. package/docs/types/_globus_sdk.gcs.GCSServiceMethodDynamicSegments.html +0 -100
  258. package/docs/variables/_globus_sdk.auth.CONFIG.html +0 -64
  259. package/docs/variables/_globus_sdk.flows.CONFIG.html +0 -62
  260. package/docs/variables/_globus_sdk.groups.CONFIG.html +0 -63
  261. package/docs/variables/_globus_sdk.search.CONFIG.html +0 -61
  262. package/docs/variables/_globus_sdk.transfer.CONFIG.html +0 -64
  263. package/jest.config.ts +0 -12
  264. package/jest.setup.ts +0 -10
  265. package/mocks/handlers.ts +0 -54
  266. package/mocks/server.ts +0 -5
  267. package/scripts/generate-package-json.js +0 -38
  268. package/scripts/openapi-types.ts +0 -50
  269. package/src/__utils__/service-test-suite.ts +0 -31
  270. package/src/lib/core/__tests__/fetch.spec.ts +0 -22
  271. package/src/lib/core/__tests__/global.spec.ts +0 -69
  272. package/src/lib/core/__tests__/url.spec.ts +0 -105
  273. package/src/lib/core/authorization.ts +0 -113
  274. package/src/lib/core/consent.ts +0 -34
  275. package/src/lib/core/errors.ts +0 -8
  276. package/src/lib/core/fetch.ts +0 -38
  277. package/src/lib/core/global.ts +0 -128
  278. package/src/lib/core/internals/__mocks__/fetch.ts +0 -7
  279. package/src/lib/core/storage/index.ts +0 -57
  280. package/src/lib/core/storage/local-storage.ts +0 -20
  281. package/src/lib/core/storage/memory.ts +0 -21
  282. package/src/lib/core/storage/storage.spec.ts +0 -30
  283. package/src/lib/core/url.ts +0 -73
  284. package/src/lib/services/auth/config.ts +0 -11
  285. package/src/lib/services/auth/index.ts +0 -37
  286. package/src/lib/services/auth/types.ts +0 -15
  287. package/src/lib/services/flows/__tests__/flows.spec.ts +0 -12
  288. package/src/lib/services/flows/__tests__/runs.spec.ts +0 -12
  289. package/src/lib/services/flows/config.ts +0 -26
  290. package/src/lib/services/flows/service/flows.ts +0 -41
  291. package/src/lib/services/flows/service/runs.ts +0 -20
  292. package/src/lib/services/globus-connect-server/__tests__/client.spec.ts +0 -147
  293. package/src/lib/services/globus-connect-server/__tests__/collections.spec.ts +0 -73
  294. package/src/lib/services/globus-connect-server/__tests__/endpoint.spec.ts +0 -36
  295. package/src/lib/services/globus-connect-server/__tests__/roles.spec.ts +0 -151
  296. package/src/lib/services/globus-connect-server/__tests__/storage-gateways.spec.ts +0 -72
  297. package/src/lib/services/globus-connect-server/__tests__/user-credentials.spec.ts +0 -74
  298. package/src/lib/services/globus-connect-server/client.ts +0 -79
  299. package/src/lib/services/globus-connect-server/index.ts +0 -85
  300. package/src/lib/services/globus-connect-server/service/collections.ts +0 -63
  301. package/src/lib/services/globus-connect-server/service/endpoint.ts +0 -28
  302. package/src/lib/services/globus-connect-server/service/roles.ts +0 -113
  303. package/src/lib/services/globus-connect-server/service/storage-gateways.ts +0 -65
  304. package/src/lib/services/globus-connect-server/service/user-credentials.ts +0 -61
  305. package/src/lib/services/globus-connect-server/service/versioning.ts +0 -30
  306. package/src/lib/services/groups/__tests__/groups.spec.ts +0 -60
  307. package/src/lib/services/groups/__tests__/membership.spec.ts +0 -64
  308. package/src/lib/services/groups/__tests__/policies.spec.ts +0 -30
  309. package/src/lib/services/groups/config.ts +0 -20
  310. package/src/lib/services/groups/service/groups.ts +0 -67
  311. package/src/lib/services/groups/service/membership.ts +0 -39
  312. package/src/lib/services/groups/service/policies.ts +0 -33
  313. package/src/lib/services/search/__tests__/query.spec.ts +0 -35
  314. package/src/lib/services/search/config.ts +0 -20
  315. package/src/lib/services/search/service/query.ts +0 -39
  316. package/src/lib/services/shared.ts +0 -6
  317. package/src/lib/services/transfer/__tests__/endpoint-search.spec.ts +0 -34
  318. package/src/lib/services/transfer/__tests__/endpoint.spec.ts +0 -17
  319. package/src/lib/services/transfer/__tests__/file-operations.spec.ts +0 -87
  320. package/src/lib/services/transfer/__tests__/task-submission.spec.ts +0 -55
  321. package/src/lib/services/transfer/config.ts +0 -11
  322. package/src/lib/services/transfer/service/endpoint-search.ts +0 -38
  323. package/src/lib/services/transfer/service/endpoint.ts +0 -26
  324. package/src/lib/services/transfer/service/file-operations.ts +0 -114
  325. package/src/lib/services/transfer/service/task-submission.ts +0 -68
  326. package/src/lib/services/transfer/shared.ts +0 -12
  327. package/src/lib/services/transfer/types.ts +0 -42
  328. package/src/lib/services/types.ts +0 -67
  329. package/tsconfig.json +0 -19
  330. package/typedoc.json +0 -10
  331. package/webpack.config.cjs +0 -14
  332. /package/{dist/esm → cjs}/index.d.ts +0 -0
  333. /package/{dist/esm → cjs}/index.d.ts.map +0 -0
  334. /package/{dist/esm → cjs}/index.js +0 -0
  335. /package/{dist/esm → cjs}/index.js.map +0 -0
  336. /package/{dist/esm → cjs}/lib/core/authorization.d.ts +0 -0
  337. /package/{dist/esm → cjs}/lib/core/authorization.d.ts.map +0 -0
  338. /package/{dist/esm → cjs}/lib/core/authorization.js +0 -0
  339. /package/{dist/esm → cjs}/lib/core/authorization.js.map +0 -0
  340. /package/{dist/esm → cjs}/lib/core/consent.d.ts +0 -0
  341. /package/{dist/esm → cjs}/lib/core/consent.d.ts.map +0 -0
  342. /package/{dist/esm → cjs}/lib/core/consent.js +0 -0
  343. /package/{dist/esm → cjs}/lib/core/consent.js.map +0 -0
  344. /package/{dist/esm → cjs}/lib/core/errors.d.ts +0 -0
  345. /package/{dist/esm → cjs}/lib/core/errors.d.ts.map +0 -0
  346. /package/{dist/esm → cjs}/lib/core/errors.js +0 -0
  347. /package/{dist/esm → cjs}/lib/core/errors.js.map +0 -0
  348. /package/{dist/esm → cjs}/lib/core/fetch.d.ts +0 -0
  349. /package/{dist/esm → cjs}/lib/core/fetch.d.ts.map +0 -0
  350. /package/{dist/esm → cjs}/lib/core/fetch.js +0 -0
  351. /package/{dist/esm → cjs}/lib/core/fetch.js.map +0 -0
  352. /package/{dist/esm → cjs}/lib/core/global.d.ts +0 -0
  353. /package/{dist/esm → cjs}/lib/core/global.d.ts.map +0 -0
  354. /package/{dist/esm → cjs}/lib/core/global.js +0 -0
  355. /package/{dist/esm → cjs}/lib/core/global.js.map +0 -0
  356. /package/{dist/esm → cjs}/lib/core/internals/fetch.d.ts +0 -0
  357. /package/{dist/esm → cjs}/lib/core/internals/fetch.d.ts.map +0 -0
  358. /package/{dist/esm → cjs}/lib/core/internals/fetch.js +0 -0
  359. /package/{dist/esm → cjs}/lib/core/internals/fetch.js.map +0 -0
  360. /package/{dist/esm → cjs}/lib/core/storage/index.d.ts +0 -0
  361. /package/{dist/esm → cjs}/lib/core/storage/index.d.ts.map +0 -0
  362. /package/{dist/esm → cjs}/lib/core/storage/index.js +0 -0
  363. /package/{dist/esm → cjs}/lib/core/storage/index.js.map +0 -0
  364. /package/{dist/esm → cjs}/lib/core/storage/local-storage.d.ts +0 -0
  365. /package/{dist/esm → cjs}/lib/core/storage/local-storage.d.ts.map +0 -0
  366. /package/{dist/esm → cjs}/lib/core/storage/local-storage.js +0 -0
  367. /package/{dist/esm → cjs}/lib/core/storage/local-storage.js.map +0 -0
  368. /package/{dist/esm → cjs}/lib/core/storage/memory.d.ts +0 -0
  369. /package/{dist/esm → cjs}/lib/core/storage/memory.d.ts.map +0 -0
  370. /package/{dist/esm → cjs}/lib/core/storage/memory.js +0 -0
  371. /package/{dist/esm → cjs}/lib/core/storage/memory.js.map +0 -0
  372. /package/{dist/esm → cjs}/lib/core/url.d.ts +0 -0
  373. /package/{dist/esm → cjs}/lib/core/url.d.ts.map +0 -0
  374. /package/{dist/esm → cjs}/lib/core/url.js +0 -0
  375. /package/{dist/esm → cjs}/lib/core/url.js.map +0 -0
  376. /package/{dist/esm → cjs}/lib/services/auth/config.d.ts +0 -0
  377. /package/{dist/esm → cjs}/lib/services/auth/config.d.ts.map +0 -0
  378. /package/{dist/esm → cjs}/lib/services/auth/config.js +0 -0
  379. /package/{dist/esm → cjs}/lib/services/auth/config.js.map +0 -0
  380. /package/{dist/esm → cjs}/lib/services/auth/index.d.ts +0 -0
  381. /package/{dist/esm → cjs}/lib/services/auth/index.d.ts.map +0 -0
  382. /package/{dist/esm → cjs}/lib/services/auth/index.js +0 -0
  383. /package/{dist/esm → cjs}/lib/services/auth/index.js.map +0 -0
  384. /package/{dist/esm → cjs}/lib/services/auth/types.d.ts +0 -0
  385. /package/{dist/esm → cjs}/lib/services/auth/types.d.ts.map +0 -0
  386. /package/{dist/esm → cjs}/lib/services/auth/types.js +0 -0
  387. /package/{dist/esm → cjs}/lib/services/auth/types.js.map +0 -0
  388. /package/{dist/esm → cjs}/lib/services/flows/config.d.ts +0 -0
  389. /package/{dist/esm → cjs}/lib/services/flows/config.d.ts.map +0 -0
  390. /package/{dist/esm → cjs}/lib/services/flows/config.js +0 -0
  391. /package/{dist/esm → cjs}/lib/services/flows/config.js.map +0 -0
  392. /package/{dist/esm → cjs}/lib/services/flows/index.d.ts +0 -0
  393. /package/{dist/esm → cjs}/lib/services/flows/index.d.ts.map +0 -0
  394. /package/{dist/esm → cjs}/lib/services/flows/index.js +0 -0
  395. /package/{dist/esm → cjs}/lib/services/flows/index.js.map +0 -0
  396. /package/{dist/esm → cjs}/lib/services/flows/service/flows.d.ts +0 -0
  397. /package/{dist/esm → cjs}/lib/services/flows/service/flows.d.ts.map +0 -0
  398. /package/{dist/esm → cjs}/lib/services/flows/service/flows.js +0 -0
  399. /package/{dist/esm → cjs}/lib/services/flows/service/flows.js.map +0 -0
  400. /package/{dist/esm → cjs}/lib/services/flows/service/runs.d.ts +0 -0
  401. /package/{dist/esm → cjs}/lib/services/flows/service/runs.d.ts.map +0 -0
  402. /package/{dist/esm → cjs}/lib/services/flows/service/runs.js +0 -0
  403. /package/{dist/esm → cjs}/lib/services/flows/service/runs.js.map +0 -0
  404. /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.d.ts +0 -0
  405. /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.d.ts.map +0 -0
  406. /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.js +0 -0
  407. /package/{dist/esm → cjs}/lib/services/globus-connect-server/client.js.map +0 -0
  408. /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.d.ts +0 -0
  409. /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.d.ts.map +0 -0
  410. /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.js +0 -0
  411. /package/{dist/esm → cjs}/lib/services/globus-connect-server/index.js.map +0 -0
  412. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.d.ts +0 -0
  413. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.d.ts.map +0 -0
  414. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.js +0 -0
  415. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/collections.js.map +0 -0
  416. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.d.ts +0 -0
  417. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.d.ts.map +0 -0
  418. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.js +0 -0
  419. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/endpoint.js.map +0 -0
  420. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.d.ts +0 -0
  421. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.d.ts.map +0 -0
  422. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.js +0 -0
  423. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/roles.js.map +0 -0
  424. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.d.ts +0 -0
  425. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.d.ts.map +0 -0
  426. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.js +0 -0
  427. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/storage-gateways.js.map +0 -0
  428. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.d.ts +0 -0
  429. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.d.ts.map +0 -0
  430. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.js +0 -0
  431. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/user-credentials.js.map +0 -0
  432. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.d.ts +0 -0
  433. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.d.ts.map +0 -0
  434. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.js +0 -0
  435. /package/{dist/esm → cjs}/lib/services/globus-connect-server/service/versioning.js.map +0 -0
  436. /package/{dist/esm → cjs}/lib/services/groups/config.d.ts +0 -0
  437. /package/{dist/esm → cjs}/lib/services/groups/config.d.ts.map +0 -0
  438. /package/{dist/esm → cjs}/lib/services/groups/config.js +0 -0
  439. /package/{dist/esm → cjs}/lib/services/groups/config.js.map +0 -0
  440. /package/{dist/esm → cjs}/lib/services/groups/index.d.ts +0 -0
  441. /package/{dist/esm → cjs}/lib/services/groups/index.d.ts.map +0 -0
  442. /package/{dist/esm → cjs}/lib/services/groups/index.js +0 -0
  443. /package/{dist/esm → cjs}/lib/services/groups/index.js.map +0 -0
  444. /package/{dist/esm → cjs}/lib/services/groups/service/groups.d.ts +0 -0
  445. /package/{dist/esm → cjs}/lib/services/groups/service/groups.d.ts.map +0 -0
  446. /package/{dist/esm → cjs}/lib/services/groups/service/groups.js +0 -0
  447. /package/{dist/esm → cjs}/lib/services/groups/service/groups.js.map +0 -0
  448. /package/{dist/esm → cjs}/lib/services/groups/service/membership.d.ts +0 -0
  449. /package/{dist/esm → cjs}/lib/services/groups/service/membership.d.ts.map +0 -0
  450. /package/{dist/esm → cjs}/lib/services/groups/service/membership.js +0 -0
  451. /package/{dist/esm → cjs}/lib/services/groups/service/membership.js.map +0 -0
  452. /package/{dist/esm → cjs}/lib/services/groups/service/policies.d.ts +0 -0
  453. /package/{dist/esm → cjs}/lib/services/groups/service/policies.d.ts.map +0 -0
  454. /package/{dist/esm → cjs}/lib/services/groups/service/policies.js +0 -0
  455. /package/{dist/esm → cjs}/lib/services/groups/service/policies.js.map +0 -0
  456. /package/{dist/esm → cjs}/lib/services/search/config.d.ts +0 -0
  457. /package/{dist/esm → cjs}/lib/services/search/config.d.ts.map +0 -0
  458. /package/{dist/esm → cjs}/lib/services/search/config.js +0 -0
  459. /package/{dist/esm → cjs}/lib/services/search/config.js.map +0 -0
  460. /package/{dist/esm → cjs}/lib/services/search/index.d.ts +0 -0
  461. /package/{dist/esm → cjs}/lib/services/search/index.d.ts.map +0 -0
  462. /package/{dist/esm → cjs}/lib/services/search/index.js +0 -0
  463. /package/{dist/esm → cjs}/lib/services/search/index.js.map +0 -0
  464. /package/{dist/esm → cjs}/lib/services/search/service/query.d.ts +0 -0
  465. /package/{dist/esm → cjs}/lib/services/search/service/query.d.ts.map +0 -0
  466. /package/{dist/esm → cjs}/lib/services/search/service/query.js +0 -0
  467. /package/{dist/esm → cjs}/lib/services/search/service/query.js.map +0 -0
  468. /package/{dist/esm → cjs}/lib/services/shared.d.ts +0 -0
  469. /package/{dist/esm → cjs}/lib/services/shared.d.ts.map +0 -0
  470. /package/{dist/esm → cjs}/lib/services/shared.js +0 -0
  471. /package/{dist/esm → cjs}/lib/services/shared.js.map +0 -0
  472. /package/{dist/esm → cjs}/lib/services/transfer/config.d.ts +0 -0
  473. /package/{dist/esm → cjs}/lib/services/transfer/config.d.ts.map +0 -0
  474. /package/{dist/esm → cjs}/lib/services/transfer/config.js +0 -0
  475. /package/{dist/esm → cjs}/lib/services/transfer/config.js.map +0 -0
  476. /package/{dist/esm → cjs}/lib/services/transfer/index.d.ts +0 -0
  477. /package/{dist/esm → cjs}/lib/services/transfer/index.d.ts.map +0 -0
  478. /package/{dist/esm → cjs}/lib/services/transfer/index.js +0 -0
  479. /package/{dist/esm → cjs}/lib/services/transfer/index.js.map +0 -0
  480. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.d.ts +0 -0
  481. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.d.ts.map +0 -0
  482. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.js +0 -0
  483. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint-search.js.map +0 -0
  484. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.d.ts +0 -0
  485. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.d.ts.map +0 -0
  486. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.js +0 -0
  487. /package/{dist/esm → cjs}/lib/services/transfer/service/endpoint.js.map +0 -0
  488. /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.d.ts +0 -0
  489. /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.d.ts.map +0 -0
  490. /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.js +0 -0
  491. /package/{dist/esm → cjs}/lib/services/transfer/service/file-operations.js.map +0 -0
  492. /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.d.ts +0 -0
  493. /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.d.ts.map +0 -0
  494. /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.js +0 -0
  495. /package/{dist/esm → cjs}/lib/services/transfer/service/task-submission.js.map +0 -0
  496. /package/{dist/esm → cjs}/lib/services/transfer/shared.d.ts +0 -0
  497. /package/{dist/esm → cjs}/lib/services/transfer/shared.d.ts.map +0 -0
  498. /package/{dist/esm → cjs}/lib/services/transfer/shared.js +0 -0
  499. /package/{dist/esm → cjs}/lib/services/transfer/shared.js.map +0 -0
  500. /package/{dist/esm → cjs}/lib/services/transfer/types.d.ts +0 -0
  501. /package/{dist/esm → cjs}/lib/services/transfer/types.d.ts.map +0 -0
  502. /package/{dist/esm → cjs}/lib/services/transfer/types.js +0 -0
  503. /package/{dist/esm → cjs}/lib/services/transfer/types.js.map +0 -0
  504. /package/{dist/esm → cjs}/lib/services/types.d.ts +0 -0
  505. /package/{dist/esm → cjs}/lib/services/types.d.ts.map +0 -0
  506. /package/{dist/esm → cjs}/lib/services/types.js +0 -0
  507. /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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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,7 +0,0 @@
1
- const actual: typeof import("../fetch") =
2
- jest.requireActual("../fetch");
3
-
4
- module.exports = {
5
- ...actual,
6
- fetch: jest.fn().mockResolvedValue({}),
7
- };
@@ -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
- }
@@ -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
- };