@girder/core 3.2.1 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.md +61 -0
  2. package/dist-lib/Girder_Favicon.png +0 -0
  3. package/dist-lib/girder-core.js +48623 -0
  4. package/dist-lib/girder-core.js.map +1 -0
  5. package/dist-lib/girder-core.umd.cjs +633 -0
  6. package/dist-lib/girder-core.umd.cjs.map +1 -0
  7. package/dist-lib/girder-swagger.js +64 -0
  8. package/dist-lib/index.d.ts +1 -0
  9. package/{auth.js → dist-lib/src/auth.js} +7 -9
  10. package/dist-lib/src/index.d.ts +22 -0
  11. package/dist-lib/src/index.ts +80 -0
  12. package/dist-lib/src/main.ts +37 -0
  13. package/{models → dist-lib/src/models}/FolderModel.js +1 -1
  14. package/{rest.js → dist-lib/src/rest.js} +2 -11
  15. package/{routes.js → dist-lib/src/routes.js} +65 -67
  16. package/{stylesheets → dist-lib/src/stylesheets}/layout/global.styl +1 -1
  17. package/{stylesheets → dist-lib/src/stylesheets}/widgets/userOtpManagementWidget.styl +2 -2
  18. package/{templates → dist-lib/src/templates}/body/frontPage.pug +1 -1
  19. package/dist-lib/src/version.js +8 -0
  20. package/{views → dist-lib/src/views}/View.js +2 -1
  21. package/{views → dist-lib/src/views}/layout/LoginView.js +1 -1
  22. package/{views → dist-lib/src/views}/layout/RegisterView.js +5 -2
  23. package/{views → dist-lib/src/views}/widgets/ApiKeyListWidget.js +1 -1
  24. package/{views → dist-lib/src/views}/widgets/DateTimeRangeWidget.js +2 -1
  25. package/{views → dist-lib/src/views}/widgets/DateTimeWidget.js +2 -1
  26. package/{views → dist-lib/src/views}/widgets/ItemListWidget.js +1 -1
  27. package/{views → dist-lib/src/views}/widgets/MetadataWidget.js +7 -3
  28. package/{views → dist-lib/src/views}/widgets/PaginateWidget.js +2 -2
  29. package/{views → dist-lib/src/views}/widgets/RootSelectorWidget.js +1 -1
  30. package/{views → dist-lib/src/views}/widgets/SearchPaginateWidget.js +2 -2
  31. package/{views → dist-lib/src/views}/widgets/SortCollectionWidget.js +1 -1
  32. package/dist-lib/src/vite-env.d.ts +5 -0
  33. package/dist-lib/style.css +16 -0
  34. package/package.json +79 -31
  35. package/index.js +0 -31
  36. package/main.js +0 -21
  37. package/version.js +0 -10
  38. /package/{assets → dist-lib}/Girder_Mark.png +0 -0
  39. /package/{collections → dist-lib/src/collections}/ApiKeyCollection.js +0 -0
  40. /package/{collections → dist-lib/src/collections}/AssetstoreCollection.js +0 -0
  41. /package/{collections → dist-lib/src/collections}/Collection.js +0 -0
  42. /package/{collections → dist-lib/src/collections}/CollectionCollection.js +0 -0
  43. /package/{collections → dist-lib/src/collections}/FileCollection.js +0 -0
  44. /package/{collections → dist-lib/src/collections}/FolderCollection.js +0 -0
  45. /package/{collections → dist-lib/src/collections}/GroupCollection.js +0 -0
  46. /package/{collections → dist-lib/src/collections}/ItemCollection.js +0 -0
  47. /package/{collections → dist-lib/src/collections}/UserCollection.js +0 -0
  48. /package/{collections → dist-lib/src/collections}/index.js +0 -0
  49. /package/{constants.js → dist-lib/src/constants.js} +0 -0
  50. /package/{dialog.js → dist-lib/src/dialog.js} +0 -0
  51. /package/{events.js → dist-lib/src/events.js} +0 -0
  52. /package/{misc.js → dist-lib/src/misc.js} +0 -0
  53. /package/{models → dist-lib/src/models}/AccessControlledModel.js +0 -0
  54. /package/{models → dist-lib/src/models}/ApiKeyModel.js +0 -0
  55. /package/{models → dist-lib/src/models}/AssetstoreModel.js +0 -0
  56. /package/{models → dist-lib/src/models}/CollectionCreationPolicyModel.js +0 -0
  57. /package/{models → dist-lib/src/models}/CollectionModel.js +0 -0
  58. /package/{models → dist-lib/src/models}/FileModel.js +0 -0
  59. /package/{models → dist-lib/src/models}/GroupModel.js +0 -0
  60. /package/{models → dist-lib/src/models}/ItemModel.js +0 -0
  61. /package/{models → dist-lib/src/models}/MetadataMixin.js +0 -0
  62. /package/{models → dist-lib/src/models}/Model.js +0 -0
  63. /package/{models → dist-lib/src/models}/UserModel.js +0 -0
  64. /package/{models → dist-lib/src/models}/index.js +0 -0
  65. /package/{pluginUtils.js → dist-lib/src/pluginUtils.js} +0 -0
  66. /package/{router.js → dist-lib/src/router.js} +0 -0
  67. /package/{stylesheets → dist-lib/src/stylesheets}/apidocs/apidocs.styl +0 -0
  68. /package/{stylesheets → dist-lib/src/stylesheets}/body/adminConsole.styl +0 -0
  69. /package/{stylesheets → dist-lib/src/stylesheets}/body/assetstores.styl +0 -0
  70. /package/{stylesheets → dist-lib/src/stylesheets}/body/collectionList.styl +0 -0
  71. /package/{stylesheets → dist-lib/src/stylesheets}/body/collectionPage.styl +0 -0
  72. /package/{stylesheets → dist-lib/src/stylesheets}/body/frontPage.styl +0 -0
  73. /package/{stylesheets → dist-lib/src/stylesheets}/body/groupList.styl +0 -0
  74. /package/{stylesheets → dist-lib/src/stylesheets}/body/groupPage.styl +0 -0
  75. /package/{stylesheets → dist-lib/src/stylesheets}/body/itemPage.styl +0 -0
  76. /package/{stylesheets → dist-lib/src/stylesheets}/body/plugins.styl +0 -0
  77. /package/{stylesheets → dist-lib/src/stylesheets}/body/searchResultsList.styl +0 -0
  78. /package/{stylesheets → dist-lib/src/stylesheets}/body/systemConfig.styl +0 -0
  79. /package/{stylesheets → dist-lib/src/stylesheets}/body/userAccount.styl +0 -0
  80. /package/{stylesheets → dist-lib/src/stylesheets}/body/userList.styl +0 -0
  81. /package/{stylesheets → dist-lib/src/stylesheets}/body/userPage.styl +0 -0
  82. /package/{stylesheets → dist-lib/src/stylesheets}/layout/footer.styl +0 -0
  83. /package/{stylesheets → dist-lib/src/stylesheets}/layout/globalNav.styl +0 -0
  84. /package/{stylesheets → dist-lib/src/stylesheets}/layout/header.styl +0 -0
  85. /package/{stylesheets → dist-lib/src/stylesheets}/layout/headerUser.styl +0 -0
  86. /package/{stylesheets → dist-lib/src/stylesheets}/layout/layout.styl +0 -0
  87. /package/{stylesheets → dist-lib/src/stylesheets}/layout/layoutVars.styl +0 -0
  88. /package/{stylesheets → dist-lib/src/stylesheets}/layout/loading.styl +0 -0
  89. /package/{stylesheets → dist-lib/src/stylesheets}/layout/progressArea.styl +0 -0
  90. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/accessWidget.styl +0 -0
  91. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/browserWidget.styl +0 -0
  92. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/hierarchyWidget.styl +0 -0
  93. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/markdownWidget.styl +0 -0
  94. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/metadataWidget.styl +0 -0
  95. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/searchFieldWidget.styl +0 -0
  96. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/taskProgress.styl +0 -0
  97. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/timelineWidget.styl +0 -0
  98. /package/{stylesheets → dist-lib/src/stylesheets}/widgets/uploadWidget.styl +0 -0
  99. /package/{templates → dist-lib/src/templates}/body/adminConsole.pug +0 -0
  100. /package/{templates → dist-lib/src/templates}/body/assetstores.pug +0 -0
  101. /package/{templates → dist-lib/src/templates}/body/collectionList.pug +0 -0
  102. /package/{templates → dist-lib/src/templates}/body/collectionPage.pug +0 -0
  103. /package/{templates → dist-lib/src/templates}/body/filesystemImport.pug +0 -0
  104. /package/{templates → dist-lib/src/templates}/body/groupList.pug +0 -0
  105. /package/{templates → dist-lib/src/templates}/body/groupPage.pug +0 -0
  106. /package/{templates → dist-lib/src/templates}/body/itemPage.pug +0 -0
  107. /package/{templates → dist-lib/src/templates}/body/plugins.pug +0 -0
  108. /package/{templates → dist-lib/src/templates}/body/s3Import.pug +0 -0
  109. /package/{templates → dist-lib/src/templates}/body/searchResults.pug +0 -0
  110. /package/{templates → dist-lib/src/templates}/body/searchResultsType.pug +0 -0
  111. /package/{templates → dist-lib/src/templates}/body/systemConfiguration.pug +0 -0
  112. /package/{templates → dist-lib/src/templates}/body/userAccount.pug +0 -0
  113. /package/{templates → dist-lib/src/templates}/body/userList.pug +0 -0
  114. /package/{templates → dist-lib/src/templates}/body/userPage.pug +0 -0
  115. /package/{templates → dist-lib/src/templates}/layout/alert.pug +0 -0
  116. /package/{templates → dist-lib/src/templates}/layout/layout.pug +0 -0
  117. /package/{templates → dist-lib/src/templates}/layout/layoutFooter.pug +0 -0
  118. /package/{templates → dist-lib/src/templates}/layout/layoutGlobalNav.pug +0 -0
  119. /package/{templates → dist-lib/src/templates}/layout/layoutHeader.pug +0 -0
  120. /package/{templates → dist-lib/src/templates}/layout/layoutHeaderUser.pug +0 -0
  121. /package/{templates → dist-lib/src/templates}/layout/layoutProgressArea.pug +0 -0
  122. /package/{templates → dist-lib/src/templates}/layout/loginDialog.pug +0 -0
  123. /package/{templates → dist-lib/src/templates}/layout/registerDialog.pug +0 -0
  124. /package/{templates → dist-lib/src/templates}/layout/resetPasswordDialog.pug +0 -0
  125. /package/{templates → dist-lib/src/templates}/widgets/accessEditor.pug +0 -0
  126. /package/{templates → dist-lib/src/templates}/widgets/accessEditorMixins.pug +0 -0
  127. /package/{templates → dist-lib/src/templates}/widgets/accessEditorNonModal.pug +0 -0
  128. /package/{templates → dist-lib/src/templates}/widgets/accessEntry.pug +0 -0
  129. /package/{templates → dist-lib/src/templates}/widgets/apiKeyList.pug +0 -0
  130. /package/{templates → dist-lib/src/templates}/widgets/browserWidget.pug +0 -0
  131. /package/{templates → dist-lib/src/templates}/widgets/checkedActionsMenu.pug +0 -0
  132. /package/{templates → dist-lib/src/templates}/widgets/collectionInfoDialog.pug +0 -0
  133. /package/{templates → dist-lib/src/templates}/widgets/confirmDialog.pug +0 -0
  134. /package/{templates → dist-lib/src/templates}/widgets/dateTimeRangeWidget.pug +0 -0
  135. /package/{templates → dist-lib/src/templates}/widgets/dateTimeWidget.pug +0 -0
  136. /package/{templates → dist-lib/src/templates}/widgets/editApiKeyWidget.pug +0 -0
  137. /package/{templates → dist-lib/src/templates}/widgets/editAssetstoreWidget.pug +0 -0
  138. /package/{templates → dist-lib/src/templates}/widgets/editCollectionWidget.pug +0 -0
  139. /package/{templates → dist-lib/src/templates}/widgets/editFileWidget.pug +0 -0
  140. /package/{templates → dist-lib/src/templates}/widgets/editFolderWidget.pug +0 -0
  141. /package/{templates → dist-lib/src/templates}/widgets/editGroupWidget.pug +0 -0
  142. /package/{templates → dist-lib/src/templates}/widgets/editItemWidget.pug +0 -0
  143. /package/{templates → dist-lib/src/templates}/widgets/fileInfoDialog.pug +0 -0
  144. /package/{templates → dist-lib/src/templates}/widgets/fileList.pug +0 -0
  145. /package/{templates → dist-lib/src/templates}/widgets/folderInfoDialog.pug +0 -0
  146. /package/{templates → dist-lib/src/templates}/widgets/folderList.pug +0 -0
  147. /package/{templates → dist-lib/src/templates}/widgets/groupAdminList.pug +0 -0
  148. /package/{templates → dist-lib/src/templates}/widgets/groupInviteDialog.pug +0 -0
  149. /package/{templates → dist-lib/src/templates}/widgets/groupInviteList.pug +0 -0
  150. /package/{templates → dist-lib/src/templates}/widgets/groupMemberList.pug +0 -0
  151. /package/{templates → dist-lib/src/templates}/widgets/groupModList.pug +0 -0
  152. /package/{templates → dist-lib/src/templates}/widgets/hierarchyBreadcrumb.pug +0 -0
  153. /package/{templates → dist-lib/src/templates}/widgets/hierarchyPaginated.pug +0 -0
  154. /package/{templates → dist-lib/src/templates}/widgets/hierarchyWidget.pug +0 -0
  155. /package/{templates → dist-lib/src/templates}/widgets/itemBreadcrumb.pug +0 -0
  156. /package/{templates → dist-lib/src/templates}/widgets/itemList.pug +0 -0
  157. /package/{templates → dist-lib/src/templates}/widgets/jsonMetadatumEditWidget.pug +0 -0
  158. /package/{templates → dist-lib/src/templates}/widgets/jsonMetadatumView.pug +0 -0
  159. /package/{templates → dist-lib/src/templates}/widgets/loadingAnimation.pug +0 -0
  160. /package/{templates → dist-lib/src/templates}/widgets/markdownWidget.pug +0 -0
  161. /package/{templates → dist-lib/src/templates}/widgets/metadataWidget.pug +0 -0
  162. /package/{templates → dist-lib/src/templates}/widgets/metadatumEditWidget.pug +0 -0
  163. /package/{templates → dist-lib/src/templates}/widgets/metadatumView.pug +0 -0
  164. /package/{templates → dist-lib/src/templates}/widgets/newAssetstore.pug +0 -0
  165. /package/{templates → dist-lib/src/templates}/widgets/paginateWidget.pug +0 -0
  166. /package/{templates → dist-lib/src/templates}/widgets/pluginConfigBreadcrumb.pug +0 -0
  167. /package/{templates → dist-lib/src/templates}/widgets/rootSelectorWidget.pug +0 -0
  168. /package/{templates → dist-lib/src/templates}/widgets/searchField.pug +0 -0
  169. /package/{templates → dist-lib/src/templates}/widgets/searchHelp.pug +0 -0
  170. /package/{templates → dist-lib/src/templates}/widgets/searchModeSelect.pug +0 -0
  171. /package/{templates → dist-lib/src/templates}/widgets/searchResults.pug +0 -0
  172. /package/{templates → dist-lib/src/templates}/widgets/sortCollectionWidget.pug +0 -0
  173. /package/{templates → dist-lib/src/templates}/widgets/taskProgress.pug +0 -0
  174. /package/{templates → dist-lib/src/templates}/widgets/timeline.pug +0 -0
  175. /package/{templates → dist-lib/src/templates}/widgets/uploadWidget.pug +0 -0
  176. /package/{templates → dist-lib/src/templates}/widgets/uploadWidgetMixins.pug +0 -0
  177. /package/{templates → dist-lib/src/templates}/widgets/uploadWidgetNonModal.pug +0 -0
  178. /package/{templates → dist-lib/src/templates}/widgets/userOtpBegin.pug +0 -0
  179. /package/{templates → dist-lib/src/templates}/widgets/userOtpDisable.pug +0 -0
  180. /package/{templates → dist-lib/src/templates}/widgets/userOtpEnable.pug +0 -0
  181. /package/{utilities → dist-lib/src/utilities}/EventStream.js +0 -0
  182. /package/{utilities → dist-lib/src/utilities}/PluginUtils.js +0 -0
  183. /package/{utilities → dist-lib/src/utilities}/S3UploadHandler.js +0 -0
  184. /package/{utilities → dist-lib/src/utilities}/index.js +0 -0
  185. /package/{utilities → dist-lib/src/utilities}/jquery/girderEnable.js +0 -0
  186. /package/{utilities → dist-lib/src/utilities}/jquery/girderModal.js +0 -0
  187. /package/{views → dist-lib/src/views}/App.js +0 -0
  188. /package/{views → dist-lib/src/views}/body/AdminView.js +0 -0
  189. /package/{views → dist-lib/src/views}/body/AssetstoresView.js +0 -0
  190. /package/{views → dist-lib/src/views}/body/CollectionView.js +0 -0
  191. /package/{views → dist-lib/src/views}/body/CollectionsView.js +0 -0
  192. /package/{views → dist-lib/src/views}/body/FilesystemImportView.js +0 -0
  193. /package/{views → dist-lib/src/views}/body/FolderView.js +0 -0
  194. /package/{views → dist-lib/src/views}/body/FrontPageView.js +0 -0
  195. /package/{views → dist-lib/src/views}/body/GroupView.js +0 -0
  196. /package/{views → dist-lib/src/views}/body/GroupsView.js +0 -0
  197. /package/{views → dist-lib/src/views}/body/ItemView.js +0 -0
  198. /package/{views → dist-lib/src/views}/body/PluginsView.js +0 -0
  199. /package/{views → dist-lib/src/views}/body/S3ImportView.js +0 -0
  200. /package/{views → dist-lib/src/views}/body/SearchResultsView.js +0 -0
  201. /package/{views → dist-lib/src/views}/body/SystemConfigurationView.js +0 -0
  202. /package/{views → dist-lib/src/views}/body/UserAccountView.js +0 -0
  203. /package/{views → dist-lib/src/views}/body/UserView.js +0 -0
  204. /package/{views → dist-lib/src/views}/body/UsersView.js +0 -0
  205. /package/{views → dist-lib/src/views}/body/index.js +0 -0
  206. /package/{views → dist-lib/src/views}/index.js +0 -0
  207. /package/{views → dist-lib/src/views}/layout/FooterView.js +0 -0
  208. /package/{views → dist-lib/src/views}/layout/GlobalNavView.js +0 -0
  209. /package/{views → dist-lib/src/views}/layout/HeaderUserView.js +0 -0
  210. /package/{views → dist-lib/src/views}/layout/HeaderView.js +0 -0
  211. /package/{views → dist-lib/src/views}/layout/ProgressListView.js +0 -0
  212. /package/{views → dist-lib/src/views}/layout/ResetPasswordView.js +0 -0
  213. /package/{views → dist-lib/src/views}/layout/index.js +0 -0
  214. /package/{views → dist-lib/src/views}/widgets/AccessWidget.js +0 -0
  215. /package/{views → dist-lib/src/views}/widgets/BrowserWidget.js +0 -0
  216. /package/{views → dist-lib/src/views}/widgets/CheckedMenuWidget.js +0 -0
  217. /package/{views → dist-lib/src/views}/widgets/CollectionInfoWidget.js +0 -0
  218. /package/{views → dist-lib/src/views}/widgets/EditApiKeyWidget.js +0 -0
  219. /package/{views → dist-lib/src/views}/widgets/EditAssetstoreWidget.js +0 -0
  220. /package/{views → dist-lib/src/views}/widgets/EditCollectionWidget.js +0 -0
  221. /package/{views → dist-lib/src/views}/widgets/EditFileWidget.js +0 -0
  222. /package/{views → dist-lib/src/views}/widgets/EditFolderWidget.js +0 -0
  223. /package/{views → dist-lib/src/views}/widgets/EditGroupWidget.js +0 -0
  224. /package/{views → dist-lib/src/views}/widgets/EditItemWidget.js +0 -0
  225. /package/{views → dist-lib/src/views}/widgets/FileInfoWidget.js +0 -0
  226. /package/{views → dist-lib/src/views}/widgets/FileListWidget.js +0 -0
  227. /package/{views → dist-lib/src/views}/widgets/FolderInfoWidget.js +0 -0
  228. /package/{views → dist-lib/src/views}/widgets/FolderListWidget.js +0 -0
  229. /package/{views → dist-lib/src/views}/widgets/GroupAdminsWidget.js +0 -0
  230. /package/{views → dist-lib/src/views}/widgets/GroupInvitesWidget.js +0 -0
  231. /package/{views → dist-lib/src/views}/widgets/GroupMembersWidget.js +0 -0
  232. /package/{views → dist-lib/src/views}/widgets/GroupModsWidget.js +0 -0
  233. /package/{views → dist-lib/src/views}/widgets/HierarchyWidget.js +0 -0
  234. /package/{views → dist-lib/src/views}/widgets/ItemBreadcrumbWidget.js +0 -0
  235. /package/{views → dist-lib/src/views}/widgets/LoadingAnimation.js +0 -0
  236. /package/{views → dist-lib/src/views}/widgets/MarkdownWidget.js +0 -0
  237. /package/{views → dist-lib/src/views}/widgets/NewAssetstoreWidget.js +0 -0
  238. /package/{views → dist-lib/src/views}/widgets/PluginConfigBreadcrumbWidget.js +0 -0
  239. /package/{views → dist-lib/src/views}/widgets/SearchFieldWidget.js +0 -0
  240. /package/{views → dist-lib/src/views}/widgets/TaskProgressWidget.js +0 -0
  241. /package/{views → dist-lib/src/views}/widgets/TimelineWidget.js +0 -0
  242. /package/{views → dist-lib/src/views}/widgets/UploadWidget.js +0 -0
  243. /package/{views → dist-lib/src/views}/widgets/UserOtpManagementWidget.js +0 -0
  244. /package/{views → dist-lib/src/views}/widgets/index.js +0 -0
@@ -0,0 +1,64 @@
1
+ /* eslint-env jquery */
2
+ $(function () {
3
+ var apiRoot = $('#g-global-info-apiroot').text().replace(
4
+ '%HOST%', window.location.origin);
5
+ if (!apiRoot) {
6
+ apiRoot = window.location.origin + window.location.pathname;
7
+ }
8
+ var swaggerUi = new window.SwaggerUIBundle({
9
+ url: apiRoot + '/describe',
10
+ dom_id: '#swagger-ui-container',
11
+ supportHeaderParams: false,
12
+ supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
13
+ onComplete: function () {
14
+ addApiKeyAuthorization();
15
+ },
16
+ onFailure: function (data) {
17
+ if (console) {
18
+ console.log('Unable to Load SwaggerUI');
19
+ console.log(data);
20
+ }
21
+ },
22
+ docExpansion: 'none',
23
+ jsonEditor: false,
24
+ apisSorter: 'alpha',
25
+ operationsSorter: sortOperations,
26
+ defaultModelRendering: 'model',
27
+ showRequestHeaders: false,
28
+ validatorUrl: null,
29
+ tryItOutEnabled: true,
30
+ defaultModelsExpandDepth: -1,
31
+ deepLinking: true
32
+ });
33
+
34
+ var methodOrder = ['get', 'put', 'post', 'patch', 'delete'];
35
+
36
+ // Comparator to sort operations by path and method.
37
+ // Methods not in the pre-defined ordered list are placed at the end and
38
+ // sorted alphabetically.
39
+ function sortOperations(op1, op2) {
40
+ var pathCmp = op1.get('path').localeCompare(op2.get('path'));
41
+ if (pathCmp !== 0) {
42
+ return pathCmp;
43
+ }
44
+ var index1 = methodOrder.indexOf(op1.get('method'));
45
+ var index2 = methodOrder.indexOf(op2.get('method'));
46
+ if (index1 > -1 && index2 > -1) {
47
+ return index1 > index2 ? 1 : (index1 < index2 ? -1 : 0);
48
+ }
49
+ if (index1 > -1) {
50
+ return -1;
51
+ }
52
+ if (index2 > -1) {
53
+ return 1;
54
+ }
55
+ return op1.get('method').localeCompare(op2.get('method'));
56
+ }
57
+
58
+ function addApiKeyAuthorization() {
59
+ const girderToken = localStorage.getItem('girderToken');
60
+ if (girderToken) {
61
+ swaggerUi.preauthorizeApiKey('Girder-Token', girderToken);
62
+ }
63
+ }
64
+ });
@@ -0,0 +1 @@
1
+ export * from './src/index'
@@ -8,7 +8,6 @@ import { restRequest } from '@girder/core/rest';
8
8
  // girder.corsAuth could be an override. See login doc below.
9
9
  var corsAuth = false;
10
10
 
11
- // TODO delete in next major version
12
11
  var cookie = {
13
12
  findAll: function () {
14
13
  var cookies = {};
@@ -44,7 +43,7 @@ var cookie = {
44
43
  };
45
44
 
46
45
  var currentUser = null;
47
- var currentToken = window.localStorage.getItem('girderToken');
46
+ var currentToken = cookie.find('girderToken');
48
47
 
49
48
  function getCurrentUser() {
50
49
  return currentUser;
@@ -85,12 +84,9 @@ function basicAuthEncode(username, password) {
85
84
  *
86
85
  * @param username The username or email to login as.
87
86
  * @param password The password to use.
88
- * @param cors If the girder server is on a different origin, set this
89
- * to "true" to save the auth cookie on the current domain. Alternatively,
90
- * you may set the global option "girder.corsAuth = true".
91
87
  * @param otpToken An optional one-time password to include with the login.
92
88
  */
93
- function login(username, password, cors = corsAuth, otpToken = null) {
89
+ function login(username, password, otpToken = null) {
94
90
  var auth = basicAuthEncode(username, password);
95
91
 
96
92
  const headers = {
@@ -111,7 +107,11 @@ function login(username, password, cors = corsAuth, otpToken = null) {
111
107
  setCurrentUser(new UserModel(response.user));
112
108
  setCurrentToken(response.user.token.token);
113
109
 
114
- window.localStorage.setItem('girderToken', response.user.token.token);
110
+ if (!cookie.find('girderToken')) {
111
+ // For cross-origin requests, we should write the token into
112
+ // this document's cookie also.
113
+ document.cookie = 'girderToken=' + getCurrentToken();
114
+ }
115
115
 
116
116
  events.trigger('g:login.success', response.user);
117
117
  events.trigger('g:login', response);
@@ -130,8 +130,6 @@ function logout() {
130
130
  setCurrentUser(null);
131
131
  setCurrentToken(null);
132
132
 
133
- window.localStorage.removeItem('girderToken');
134
-
135
133
  events.trigger('g:login', null);
136
134
  events.trigger('g:logout.success');
137
135
  }).fail(function (jqxhr) {
@@ -0,0 +1,22 @@
1
+ declare const girder: {
2
+ $: any;
3
+ _: any;
4
+ moment: any;
5
+ initializeDefaultApp: (apiRoot: string, el?: string | HTMLElement) => Promise<unknown>;
6
+ auth: any;
7
+ collections: any;
8
+ constants: any;
9
+ dialog: any;
10
+ events: any;
11
+ misc: any;
12
+ models: any;
13
+ plugins: {};
14
+ pluginUtils: any;
15
+ rest: any;
16
+ router: any;
17
+ utilities: any;
18
+ version: any;
19
+ views: any;
20
+ };
21
+ export type Girder = typeof girder;
22
+ export { girder, };
@@ -0,0 +1,80 @@
1
+ import $ from 'jquery';
2
+
3
+ import _ from 'underscore';
4
+
5
+ import Backbone from 'backbone';
6
+
7
+ import moment from 'moment';
8
+
9
+ import * as auth from './auth';
10
+ import * as collections from './collections';
11
+ import * as constants from './constants';
12
+ import * as dialog from './dialog';
13
+ import * as misc from './misc';
14
+ import * as models from './models';
15
+ import * as pluginUtils from './pluginUtils';
16
+ import * as rest from './rest';
17
+ import * as utilities from './utilities';
18
+ import * as views from './views';
19
+ import events from './events';
20
+ import router from './router';
21
+ import version from './version';
22
+
23
+ const initializeDefaultApp = async (apiRoot: string, el: string | HTMLElement = 'body') => {
24
+ return new Promise((resolve, reject) => {
25
+ $(() => {
26
+ rest.setApiRoot(apiRoot);
27
+ events.trigger('g:appload.before');
28
+ rest.restRequest({
29
+ url: `system/public_settings`,
30
+ method: 'GET',
31
+ }).done((resp: any) => {
32
+ const app = new views.App({
33
+ el,
34
+ parentView: null,
35
+ contactEmail: resp['core.contact_email_address'],
36
+ privacyNoticeHref: resp['core.privacy_notice'],
37
+ brandName: resp['core.brand_name'],
38
+ bannerColor: resp['core.banner_color'],
39
+ registrationPolicy: resp['core.registration_policy'],
40
+ enablePasswordLogin: resp['core.enable_password_login'],
41
+ });
42
+ app.render();
43
+ document.title = resp['core.brand_name'];
44
+ events.trigger('g:appload.after', app);
45
+ resolve(app);
46
+ }).fail((resp: any) => {
47
+ events.trigger('g:error', resp);
48
+ reject(new Error("Could not retrieve public settings from server."));
49
+ });
50
+ });
51
+ });
52
+ };
53
+
54
+ const girder = {
55
+ $,
56
+ _,
57
+ Backbone,
58
+ moment,
59
+ initializeDefaultApp,
60
+ auth,
61
+ collections,
62
+ constants,
63
+ dialog,
64
+ events,
65
+ misc,
66
+ models,
67
+ plugins: {},
68
+ pluginUtils,
69
+ rest,
70
+ router,
71
+ utilities,
72
+ version,
73
+ views
74
+ };
75
+
76
+ export type Girder = typeof girder;
77
+
78
+ export {
79
+ girder,
80
+ };
@@ -0,0 +1,37 @@
1
+ import { girder } from '.';
2
+
3
+ declare global {
4
+ interface Window {
5
+ girder: typeof girder;
6
+ }
7
+ }
8
+ window.girder = girder;
9
+
10
+ interface StaticFilesSpec {
11
+ css: string[],
12
+ js: string[],
13
+ }
14
+
15
+ const apiRoot = import.meta.env.VITE_API_ROOT ?? '/api/v1';
16
+
17
+ (async () => {
18
+ const staticFilesResp = await fetch(`${apiRoot}/system/plugin_static_files`);
19
+ const staticFiles: StaticFilesSpec = await staticFilesResp.json();
20
+
21
+ staticFiles.css.forEach((href) => {
22
+ const link = document.createElement('link');
23
+ link.rel = 'stylesheet';
24
+ link.type = 'text/css';
25
+ link.href = href;
26
+ document.head.appendChild(link);
27
+ });
28
+
29
+ staticFiles.js.forEach((src) => {
30
+ const script = document.createElement('script');
31
+ script.type = 'text/javascript';
32
+ script.src = src;
33
+ document.head.appendChild(script);
34
+ })
35
+
36
+ await girder.initializeDefaultApp(apiRoot);
37
+ })();
@@ -20,7 +20,7 @@ var FolderModel = AccessControlledModel.extend({
20
20
  return restRequest({
21
21
  url: `${this.resourceName}/${this.id}/contents`,
22
22
  method: 'DELETE'
23
- }).done((resp) => {
23
+ }).done(() => {
24
24
  this.trigger('g:success');
25
25
  }).fail((err) => {
26
26
  this.trigger('g:error', err);
@@ -3,7 +3,7 @@ import _ from 'underscore';
3
3
  import Backbone from 'backbone';
4
4
 
5
5
  import events from '@girder/core/events';
6
- import { getCurrentToken, setCurrentUser, setCurrentToken } from '@girder/core/auth';
6
+ import { getCurrentToken, cookie } from '@girder/core/auth';
7
7
 
8
8
  let apiRoot;
9
9
  var uploadHandlers = {};
@@ -31,13 +31,6 @@ function setApiRoot(root) {
31
31
  apiRoot = root.replace(/\/$/, '');
32
32
  }
33
33
 
34
- // Initialize the API root (at JS load time)
35
- // This could be overridden when the App is started, but we need sensible defaults so models, etc.
36
- // can be easily used without having to start an App or explicitly set these values
37
- setApiRoot(
38
- $('#g-global-info-apiroot').text().replace('%HOST%', window.location.origin) || '/api/v1'
39
- );
40
-
41
34
  /**
42
35
  * Make a request to the REST API.
43
36
  *
@@ -70,13 +63,11 @@ const restRequest = function (opts) {
70
63
  const defaults = {
71
64
  // the default 'method' is 'GET', as set by 'jquery.ajax'
72
65
 
73
- girderToken: getCurrentToken() || window.localStorage.getItem('girderToken'),
66
+ girderToken: getCurrentToken() || cookie.find('girderToken'),
74
67
 
75
68
  error: (error, status) => {
76
69
  let info;
77
70
  if (error.status === 401) {
78
- setCurrentUser(null);
79
- setCurrentToken(null);
80
71
  events.trigger('g:loginUi');
81
72
  info = {
82
73
  text: 'You must log in to view this resource',
@@ -1,5 +1,3 @@
1
- /* eslint-disable import/first */
2
-
3
1
  import router from '@girder/core/router';
4
2
  import events from '@girder/core/events';
5
3
  import eventStream from '@girder/core/utilities/EventStream';
@@ -10,14 +8,76 @@ import { restRequest } from '@girder/core/rest';
10
8
  * Admin
11
9
  */
12
10
  import AdminView from '@girder/core/views/body/AdminView';
13
- router.route('admin', 'admin', function () {
14
- events.trigger('g:navigateTo', AdminView);
15
- });
16
11
 
17
12
  /**
18
13
  * Assetstores
19
14
  */
20
15
  import AssetstoresView from '@girder/core/views/body/AssetstoresView';
16
+
17
+ /**
18
+ * Collections
19
+ */
20
+ import CollectionsView from '@girder/core/views/body/CollectionsView';
21
+
22
+ /**
23
+ * Collection
24
+ */
25
+ import CollectionView from '@girder/core/views/body/CollectionView';
26
+
27
+ /**
28
+ * Folder
29
+ */
30
+ import FolderView from '@girder/core/views/body/FolderView';
31
+
32
+ /**
33
+ * FrontPage
34
+ */
35
+ import FrontPageView from '@girder/core/views/body/FrontPageView';
36
+
37
+ /**
38
+ * Groups
39
+ */
40
+ import GroupsView from '@girder/core/views/body/GroupsView';
41
+
42
+ /**
43
+ * Group
44
+ */
45
+ import GroupView from '@girder/core/views/body/GroupView';
46
+
47
+ /**
48
+ * Item
49
+ */
50
+ import ItemView from '@girder/core/views/body/ItemView';
51
+
52
+ /**
53
+ * Plugins
54
+ */
55
+ import PluginsView from '@girder/core/views/body/PluginsView';
56
+ import UsersView from '@girder/core/views/body/UsersView';
57
+
58
+ /**
59
+ * SystemConfiguration
60
+ */
61
+ import SystemConfigurationView from '@girder/core/views/body/SystemConfigurationView';
62
+
63
+ /**
64
+ * UserAccount
65
+ */
66
+ import UserAccountView from '@girder/core/views/body/UserAccountView';
67
+ import UserModel from '@girder/core/models/UserModel';
68
+
69
+ /**
70
+ * User
71
+ */
72
+ import UserView from '@girder/core/views/body/UserView';
73
+
74
+ /**
75
+ * SearchResults
76
+ */
77
+ import SearchResultsView from '@girder/core/views/body/SearchResultsView';
78
+ router.route('admin', 'admin', function () {
79
+ events.trigger('g:navigateTo', AdminView);
80
+ });
21
81
  router.route('assetstores', 'assetstores', function (params) {
22
82
  events.trigger('g:navigateTo', AssetstoresView, {
23
83
  assetstoreEdit: params.dialog === 'assetstoreedit' ? params.dialogid : false
@@ -26,20 +86,10 @@ router.route('assetstores', 'assetstores', function (params) {
26
86
  router.route('assetstore/:id/import', 'assetstoreImport', function (assetstoreId) {
27
87
  AssetstoresView.import(assetstoreId);
28
88
  });
29
-
30
- /**
31
- * Collections
32
- */
33
- import CollectionsView from '@girder/core/views/body/CollectionsView';
34
89
  router.route('collections', 'collections', function (params) {
35
90
  events.trigger('g:navigateTo', CollectionsView, params || {});
36
91
  events.trigger('g:highlightItem', 'CollectionsView');
37
92
  });
38
-
39
- /**
40
- * Collection
41
- */
42
- import CollectionView from '@girder/core/views/body/CollectionView';
43
93
  router.route('collection/:id', 'collectionAccess', function (cid, params) {
44
94
  CollectionView.fetchAndInit(cid, {
45
95
  access: params.dialog === 'access',
@@ -60,11 +110,6 @@ router.route('collection/:id/folder/:id', 'collectionFolder', function (cid, fol
60
110
  itemCreate: params.dialog === 'itemcreate'
61
111
  });
62
112
  });
63
-
64
- /**
65
- * Folder
66
- */
67
- import FolderView from '@girder/core/views/body/FolderView';
68
113
  router.route('folder/:id', 'folder', function (id, params) {
69
114
  FolderView.fetchAndInit(id, {
70
115
  upload: params.dialog === 'upload',
@@ -74,28 +119,13 @@ router.route('folder/:id', 'folder', function (id, params) {
74
119
  itemCreate: params.dialog === 'itemcreate'
75
120
  });
76
121
  });
77
-
78
- /**
79
- * FrontPage
80
- */
81
- import FrontPageView from '@girder/core/views/body/FrontPageView';
82
122
  router.route('', 'index', function () {
83
123
  events.trigger('g:navigateTo', FrontPageView);
84
124
  });
85
-
86
- /**
87
- * Groups
88
- */
89
- import GroupsView from '@girder/core/views/body/GroupsView';
90
125
  router.route('groups', 'groups', function (params) {
91
126
  events.trigger('g:navigateTo', GroupsView, params || {});
92
127
  events.trigger('g:highlightItem', 'GroupsView');
93
128
  });
94
-
95
- /**
96
- * Group
97
- */
98
- import GroupView from '@girder/core/views/body/GroupView';
99
129
  router.route('group/:id', 'groupView', function (groupId, params) {
100
130
  GroupView.fetchAndInit(groupId, {
101
131
  edit: params.dialog === 'edit'
@@ -107,11 +137,6 @@ router.route('group/:id/:tab', 'groupView', function (groupId, tab, params) {
107
137
  tab: tab
108
138
  });
109
139
  });
110
-
111
- /**
112
- * Item
113
- */
114
- import ItemView from '@girder/core/views/body/ItemView';
115
140
  router.route('item/:id', 'item', function (itemId, params) {
116
141
  ItemView.fetchAndInit(itemId, {
117
142
  edit: params.dialog === 'itemedit',
@@ -119,29 +144,12 @@ router.route('item/:id', 'item', function (itemId, params) {
119
144
  upload: params.dialog === 'upload' ? params.dialogid : false
120
145
  });
121
146
  });
122
-
123
- /**
124
- * Plugins
125
- */
126
- import PluginsView from '@girder/core/views/body/PluginsView';
127
- import UsersView from '@girder/core/views/body/UsersView';
128
147
  router.route('plugins', 'plugins', function () {
129
148
  events.trigger('g:navigateTo', PluginsView);
130
149
  });
131
-
132
- /**
133
- * SystemConfiguration
134
- */
135
- import SystemConfigurationView from '@girder/core/views/body/SystemConfigurationView';
136
150
  router.route('settings', 'settings', function () {
137
151
  events.trigger('g:navigateTo', SystemConfigurationView);
138
152
  });
139
-
140
- /**
141
- * UserAccount
142
- */
143
- import UserAccountView from '@girder/core/views/body/UserAccountView';
144
- import UserModel from '@girder/core/models/UserModel';
145
153
  router.route('useraccount/:id/:tab', 'accountTab', function (id, tab) {
146
154
  UserAccountView.fetchAndInit(id, tab);
147
155
  });
@@ -197,11 +205,6 @@ router.route('users', 'users', function (params) {
197
205
  events.trigger('g:navigateTo', UsersView, params || {});
198
206
  events.trigger('g:highlightItem', 'UsersView');
199
207
  });
200
-
201
- /**
202
- * User
203
- */
204
- import UserView from '@girder/core/views/body/UserView';
205
208
  router.route('user/:id', 'user', function (userId, params) {
206
209
  UserView.fetchAndInit(userId, {
207
210
  folderCreate: params.dialog === 'foldercreate',
@@ -218,11 +221,6 @@ router.route('user/:id/folder/:id', 'userFolder', function (userId, folderId, pa
218
221
  itemCreate: params.dialog === 'itemcreate'
219
222
  });
220
223
  });
221
-
222
- /**
223
- * SearchResults
224
- */
225
- import SearchResultsView from '@girder/core/views/body/SearchResultsView';
226
224
  router.route('search/results', 'SearchResults', function (params) {
227
225
  events.trigger('g:navigateTo', SearchResultsView, {
228
226
  query: params.query,
@@ -9,7 +9,7 @@ body
9
9
  word-wrap break-word
10
10
 
11
11
  i
12
- -webkit-font-smoothing antialiased
12
+ font-smoothing antialiased
13
13
 
14
14
  a
15
15
  cursor pointer
@@ -136,7 +136,7 @@
136
136
  font-size 20px
137
137
 
138
138
  // Responsive Goodness
139
- @media screen and (max-width 1156px)
139
+ @media screen and (max-width1156px)
140
140
  .g-account-otp-container
141
141
  .g-account-otp-steps
142
142
  .g-account-otp-step
@@ -146,7 +146,7 @@
146
146
  &:before
147
147
  display none
148
148
 
149
- @media screen and (max-width 960px)
149
+ @media screen and (max-width960px)
150
150
  .g-account-otp-container
151
151
  .g-account-otp-steps
152
152
  .g-account-otp-step
@@ -1,6 +1,6 @@
1
1
  .g-frontpage-header
2
2
  .g-frontpage-logo-container
3
- img.g-frontpage-logo(src=require('@girder/core/assets/Girder_Mark.png'))
3
+ img.g-frontpage-logo(src='/Girder_Mark.png')
4
4
  .g-frontpage-title-container
5
5
  .g-frontpage-title #{brandName}
6
6
  .g-frontpage-subtitle Data management platform
@@ -0,0 +1,8 @@
1
+ /* global process */
2
+
3
+ const versionRaw = process.env.GIRDER_VERSION || null;
4
+
5
+ // Enforce that it's a string or null to make TypeScript happy
6
+ const version = versionRaw === null ? null : `${versionRaw}`;
7
+
8
+ export default version;
@@ -5,7 +5,8 @@ import events from '@girder/core/events';
5
5
  import eventStream from '@girder/core/utilities/EventStream';
6
6
 
7
7
  var View = Backbone.View.extend({
8
- constructor: function (opts) { // eslint-disable-line backbone/no-constructor
8
+ // eslint-disable-next-line backbone/no-constructor
9
+ constructor: function (opts) {
9
10
  if (opts && _.has(opts, 'parentView')) {
10
11
  if (opts.parentView) {
11
12
  opts.parentView.registerChildView(this);
@@ -26,7 +26,7 @@ var LoginView = View.extend({
26
26
  const loginName = this.$('#g-login').val();
27
27
  const password = this.$('#g-password').val();
28
28
  const otpToken = this.$('#g-login-otp-group').hasClass('hidden') ? null : this.$('#g-login-otp').val();
29
- login(loginName, password, undefined, otpToken)
29
+ login(loginName, password, otpToken)
30
30
  .done(() => {
31
31
  this.$el.modal('hide');
32
32
  })
@@ -1,7 +1,7 @@
1
1
  import UserModel from '@girder/core/models/UserModel';
2
2
  import View from '@girder/core/views/View';
3
3
  import events from '@girder/core/events';
4
- import { getCurrentUser, setCurrentUser, getCurrentToken, setCurrentToken } from '@girder/core/auth';
4
+ import { getCurrentUser, setCurrentUser, getCurrentToken, setCurrentToken, corsAuth } from '@girder/core/auth';
5
5
  import { handleClose, handleOpen } from '@girder/core/dialog';
6
6
 
7
7
  import RegisterDialogTemplate from '@girder/core/templates/layout/registerDialog.pug';
@@ -44,7 +44,10 @@ var RegisterView = View.extend({
44
44
  if (authToken.token) {
45
45
  setCurrentUser(user);
46
46
  setCurrentToken(authToken.token);
47
- window.localStorage.setItem('girderToken', getCurrentToken());
47
+
48
+ if (corsAuth) {
49
+ document.cookie = 'girderToken=' + getCurrentToken();
50
+ }
48
51
 
49
52
  events.trigger('g:login');
50
53
  } else {
@@ -38,7 +38,7 @@ var ApiKeyListWidget = View.extend({
38
38
  }
39
39
  },
40
40
 
41
- 'click .g-api-key-new': function (e) {
41
+ 'click .g-api-key-new': function () {
42
42
  this._renderEditWidget();
43
43
  },
44
44
 
@@ -5,7 +5,8 @@ import View from '@girder/core/views/View';
5
5
 
6
6
  import dateTimeRangeWidgetTemplate from '@girder/core/templates/widgets/dateTimeRangeWidget.pug';
7
7
 
8
- import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
8
+ // Momentjs is not require()'d in the way this library expects
9
+ // import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
9
10
  import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css';
10
11
 
11
12
  /**
@@ -5,7 +5,8 @@ import View from '@girder/core/views/View';
5
5
 
6
6
  import dateTimeWidgetTemplate from '@girder/core/templates/widgets/dateTimeWidget.pug';
7
7
 
8
- import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
8
+ // Momentjs is not require()'d in the way this library expects
9
+ // import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
9
10
  import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css';
10
11
 
11
12
  /**
@@ -272,7 +272,7 @@ var ItemListWidget = View.extend({
272
272
  }
273
273
 
274
274
  // Event handler for loading images declared once
275
- const onLoadImage = (event) => {
275
+ const onLoadImage = () => {
276
276
  if (this.observer) {
277
277
  this.centerSelected();
278
278
  }