@bindu-dashing/dam-solution-v2 5.8.6

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 (259) hide show
  1. package/README.md +53 -0
  2. package/build/AssetType/AddFieldProperties.d.ts +9 -0
  3. package/build/AssetType/AddFieldProperties.js +197 -0
  4. package/build/AssetType/AssetTemplatesTable.d.ts +10 -0
  5. package/build/AssetType/AssetTemplatesTable.js +153 -0
  6. package/build/AssetType/CreateAssetTemplate.d.ts +3 -0
  7. package/build/AssetType/CreateAssetTemplate.js +68 -0
  8. package/build/AssetType/CreateOrEditAssetTemplate.d.ts +1 -0
  9. package/build/AssetType/CreateOrEditAssetTemplate.js +77 -0
  10. package/build/AssetType/DraggedField.d.ts +14 -0
  11. package/build/AssetType/DraggedField.js +40 -0
  12. package/build/AssetType/EditAssetTemplate.d.ts +5 -0
  13. package/build/AssetType/EditAssetTemplate.js +179 -0
  14. package/build/AssetType/FieldsSection.d.ts +14 -0
  15. package/build/AssetType/FieldsSection.js +239 -0
  16. package/build/AssetType/assetTemplatesContainer.d.ts +2 -0
  17. package/build/AssetType/assetTemplatesContainer.js +71 -0
  18. package/build/AssetType/fieldProperties/DateField.d.ts +5 -0
  19. package/build/AssetType/fieldProperties/DateField.js +23 -0
  20. package/build/AssetType/fieldProperties/NumberField.d.ts +5 -0
  21. package/build/AssetType/fieldProperties/NumberField.js +91 -0
  22. package/build/AssetType/fieldProperties/OptionsField.d.ts +6 -0
  23. package/build/AssetType/fieldProperties/OptionsField.js +55 -0
  24. package/build/AssetType/fieldProperties/TextField.d.ts +5 -0
  25. package/build/AssetType/fieldProperties/TextField.js +92 -0
  26. package/build/AssetType/index.d.ts +11 -0
  27. package/build/AssetType/index.js +24 -0
  28. package/build/AssetType/routes.d.ts +3 -0
  29. package/build/AssetType/routes.js +17 -0
  30. package/build/BookView/ProductDescription.d.ts +4 -0
  31. package/build/BookView/ProductDescription.js +20 -0
  32. package/build/BookView/bookDetail.d.ts +4 -0
  33. package/build/BookView/bookDetail.js +106 -0
  34. package/build/BookView/bookInfo.d.ts +4 -0
  35. package/build/BookView/bookInfo.js +17 -0
  36. package/build/BookView/description.d.ts +4 -0
  37. package/build/BookView/description.js +5 -0
  38. package/build/BookView/index.d.ts +10 -0
  39. package/build/BookView/index.js +23 -0
  40. package/build/CreateClient/CreateClientBtn.d.ts +8 -0
  41. package/build/CreateClient/CreateClientBtn.js +12 -0
  42. package/build/CreateClient/CreateClientForm.d.ts +9 -0
  43. package/build/CreateClient/CreateClientForm.js +165 -0
  44. package/build/CreateClient/index.d.ts +14 -0
  45. package/build/CreateClient/index.js +18 -0
  46. package/build/ImagePicker/MetaFieldOptions.d.ts +14 -0
  47. package/build/ImagePicker/MetaFieldOptions.js +75 -0
  48. package/build/ImagePicker/TestImagePickerModal.d.ts +8 -0
  49. package/build/ImagePicker/TestImagePickerModal.js +61 -0
  50. package/build/ImagePicker/TestImgFromMetaData.d.ts +7 -0
  51. package/build/ImagePicker/TestImgFromMetaData.js +82 -0
  52. package/build/ImagePicker/imagePickerComponent.d.ts +6 -0
  53. package/build/ImagePicker/imagePickerComponent.js +63 -0
  54. package/build/ImagePicker/index.d.ts +13 -0
  55. package/build/ImagePicker/index.js +24 -0
  56. package/build/ImagePicker/routes.d.ts +6 -0
  57. package/build/ImagePicker/routes.js +17 -0
  58. package/build/ImagePickerFilters/ImagePickerFiltersComponent.d.ts +8 -0
  59. package/build/ImagePickerFilters/ImagePickerFiltersComponent.js +223 -0
  60. package/build/ImagePickerFilters/index.d.ts +12 -0
  61. package/build/ImagePickerFilters/index.js +19 -0
  62. package/build/MyDrive/ActionBar.d.ts +6 -0
  63. package/build/MyDrive/ActionBar.js +165 -0
  64. package/build/MyDrive/AddDrive.d.ts +3 -0
  65. package/build/MyDrive/AddDrive.js +169 -0
  66. package/build/MyDrive/AddFolder.d.ts +10 -0
  67. package/build/MyDrive/AddFolder.js +150 -0
  68. package/build/MyDrive/BreadCrumbList.d.ts +9 -0
  69. package/build/MyDrive/BreadCrumbList.js +86 -0
  70. package/build/MyDrive/BulkUploadModal.d.ts +2 -0
  71. package/build/MyDrive/BulkUploadModal.js +279 -0
  72. package/build/MyDrive/DriveContainer.d.ts +13 -0
  73. package/build/MyDrive/DriveContainer.js +276 -0
  74. package/build/MyDrive/FileDownloadHistory.d.ts +7 -0
  75. package/build/MyDrive/FileDownloadHistory.js +94 -0
  76. package/build/MyDrive/FileMenuOptions.d.ts +11 -0
  77. package/build/MyDrive/FileMenuOptions.js +397 -0
  78. package/build/MyDrive/FilesGridView.d.ts +9 -0
  79. package/build/MyDrive/FilesGridView.js +25 -0
  80. package/build/MyDrive/FolderGridView.d.ts +19 -0
  81. package/build/MyDrive/FolderGridView.js +91 -0
  82. package/build/MyDrive/FolderListView.d.ts +25 -0
  83. package/build/MyDrive/FolderListView.js +188 -0
  84. package/build/MyDrive/FolderMenuOptions.d.ts +5 -0
  85. package/build/MyDrive/FolderMenuOptions.js +350 -0
  86. package/build/MyDrive/FolderTree.d.ts +8 -0
  87. package/build/MyDrive/FolderTree.js +342 -0
  88. package/build/MyDrive/ImageEditor/EditImage.d.ts +6 -0
  89. package/build/MyDrive/ImageEditor/EditImage.js +97 -0
  90. package/build/MyDrive/ImageEditor/EditImageModal.d.ts +8 -0
  91. package/build/MyDrive/ImageEditor/EditImageModal.js +30 -0
  92. package/build/MyDrive/ImageEditor/TuiImageEditor.d.ts +10 -0
  93. package/build/MyDrive/ImageEditor/TuiImageEditor.js +99 -0
  94. package/build/MyDrive/ImagePickerBreadCrumbList.d.ts +8 -0
  95. package/build/MyDrive/ImagePickerBreadCrumbList.js +35 -0
  96. package/build/MyDrive/ImagePickerDrive.d.ts +1 -0
  97. package/build/MyDrive/ImagePickerDrive.js +41 -0
  98. package/build/MyDrive/MyDriveMainContainer.d.ts +1 -0
  99. package/build/MyDrive/MyDriveMainContainer.js +32 -0
  100. package/build/MyDrive/SearchFilter.d.ts +8 -0
  101. package/build/MyDrive/SearchFilter.js +73 -0
  102. package/build/MyDrive/ShareBtn.d.ts +5 -0
  103. package/build/MyDrive/ShareBtn.js +19 -0
  104. package/build/MyDrive/ToggleView.d.ts +4 -0
  105. package/build/MyDrive/ToggleView.js +12 -0
  106. package/build/MyDrive/UploadStatusModal.d.ts +12 -0
  107. package/build/MyDrive/UploadStatusModal.js +40 -0
  108. package/build/MyDrive/fileDetails/CommentEntity.d.ts +8 -0
  109. package/build/MyDrive/fileDetails/CommentEntity.js +102 -0
  110. package/build/MyDrive/fileDetails/Comments.d.ts +6 -0
  111. package/build/MyDrive/fileDetails/Comments.js +65 -0
  112. package/build/MyDrive/fileDetails/Compliance.d.ts +2 -0
  113. package/build/MyDrive/fileDetails/Compliance.js +18 -0
  114. package/build/MyDrive/fileDetails/CreateComment.d.ts +7 -0
  115. package/build/MyDrive/fileDetails/CreateComment.js +48 -0
  116. package/build/MyDrive/fileDetails/Editor.d.ts +6 -0
  117. package/build/MyDrive/fileDetails/Editor.js +55 -0
  118. package/build/MyDrive/fileDetails/EmojiPicker.d.ts +5 -0
  119. package/build/MyDrive/fileDetails/EmojiPicker.js +6 -0
  120. package/build/MyDrive/fileDetails/FileDetails.d.ts +10 -0
  121. package/build/MyDrive/fileDetails/FileDetails.js +78 -0
  122. package/build/MyDrive/fileDetails/FileHeader.d.ts +7 -0
  123. package/build/MyDrive/fileDetails/FileHeader.js +25 -0
  124. package/build/MyDrive/fileDetails/FileViewer.d.ts +10 -0
  125. package/build/MyDrive/fileDetails/FileViewer.js +31 -0
  126. package/build/MyDrive/fileDetails/ImageOptions.d.ts +2 -0
  127. package/build/MyDrive/fileDetails/ImageOptions.js +44 -0
  128. package/build/MyDrive/fileDetails/ImageViewer.d.ts +5 -0
  129. package/build/MyDrive/fileDetails/ImageViewer.js +16 -0
  130. package/build/MyDrive/fileDetails/ManageFile.d.ts +7 -0
  131. package/build/MyDrive/fileDetails/ManageFile.js +34 -0
  132. package/build/MyDrive/fileDetails/MetaForm.d.ts +15 -0
  133. package/build/MyDrive/fileDetails/MetaForm.js +195 -0
  134. package/build/MyDrive/fileDetails/Metadata.d.ts +8 -0
  135. package/build/MyDrive/fileDetails/Metadata.js +52 -0
  136. package/build/MyDrive/fileDetails/PdfOptions.d.ts +9 -0
  137. package/build/MyDrive/fileDetails/PdfOptions.js +35 -0
  138. package/build/MyDrive/fileDetails/PdfViewer.d.ts +8 -0
  139. package/build/MyDrive/fileDetails/PdfViewer.js +18 -0
  140. package/build/MyDrive/fileDetails/Previewdetails.d.ts +9 -0
  141. package/build/MyDrive/fileDetails/Previewdetails.js +53 -0
  142. package/build/MyDrive/fileDetails/VideoPlayer.d.ts +4 -0
  143. package/build/MyDrive/fileDetails/VideoPlayer.js +21 -0
  144. package/build/MyDrive/files/AssetSelectionFormItem.d.ts +7 -0
  145. package/build/MyDrive/files/AssetSelectionFormItem.js +14 -0
  146. package/build/MyDrive/files/FolderTabs.d.ts +6 -0
  147. package/build/MyDrive/files/FolderTabs.js +83 -0
  148. package/build/MyDrive/files/MapFile.d.ts +8 -0
  149. package/build/MyDrive/files/MapFile.js +217 -0
  150. package/build/MyDrive/files/MoveToAnotherFolder.d.ts +9 -0
  151. package/build/MyDrive/files/MoveToAnotherFolder.js +53 -0
  152. package/build/MyDrive/filesListView.d.ts +2 -0
  153. package/build/MyDrive/filesListView.js +57 -0
  154. package/build/MyDrive/index.d.ts +10 -0
  155. package/build/MyDrive/index.js +35 -0
  156. package/build/MyDrive/routes.d.ts +7 -0
  157. package/build/MyDrive/routes.js +17 -0
  158. package/build/PenView/PenDetails.d.ts +4 -0
  159. package/build/PenView/PenDetails.js +114 -0
  160. package/build/PenView/ProductDescription.d.ts +5 -0
  161. package/build/PenView/ProductDescription.js +51 -0
  162. package/build/PenView/index.d.ts +10 -0
  163. package/build/PenView/index.js +23 -0
  164. package/build/RefreshKey/RefreshKeyBtn.d.ts +1 -0
  165. package/build/RefreshKey/RefreshKeyBtn.js +42 -0
  166. package/build/RefreshKey/index.d.ts +9 -0
  167. package/build/RefreshKey/index.js +23 -0
  168. package/build/ShoesView/ProductDescription.d.ts +4 -0
  169. package/build/ShoesView/ProductDescription.js +25 -0
  170. package/build/ShoesView/ShoeDetails.d.ts +4 -0
  171. package/build/ShoesView/ShoeDetails.js +96 -0
  172. package/build/ShoesView/index.d.ts +10 -0
  173. package/build/ShoesView/index.js +23 -0
  174. package/build/common/Button.d.ts +2 -0
  175. package/build/common/Button.js +18 -0
  176. package/build/common/CustomElements.d.ts +98 -0
  177. package/build/common/CustomElements.js +77 -0
  178. package/build/common/LoadMoreItems.d.ts +7 -0
  179. package/build/common/LoadMoreItems.js +33 -0
  180. package/build/common/RenderFormItem.d.ts +42 -0
  181. package/build/common/RenderFormItem.js +98 -0
  182. package/build/common/RenderThumnail.d.ts +7 -0
  183. package/build/common/RenderThumnail.js +6 -0
  184. package/build/common/deleteModal.d.ts +1 -0
  185. package/build/common/deleteModal.js +12 -0
  186. package/build/common/folders/TypeAndDateFilters.d.ts +10 -0
  187. package/build/common/folders/TypeAndDateFilters.js +59 -0
  188. package/build/common/folders/getFolderOrFileIcon.d.ts +2 -0
  189. package/build/common/folders/getFolderOrFileIcon.js +41 -0
  190. package/build/common/loader/CustomLoader.d.ts +7 -0
  191. package/build/common/loader/CustomLoader.js +8 -0
  192. package/build/common/loader/loader.d.ts +1 -0
  193. package/build/common/loader/loader.js +6 -0
  194. package/build/common/notifications.d.ts +2 -0
  195. package/build/common/notifications.js +30 -0
  196. package/build/common/steps.d.ts +4 -0
  197. package/build/common/steps.js +7 -0
  198. package/build/hocs/AppProvider.d.ts +3 -0
  199. package/build/hocs/AppProvider.js +11 -0
  200. package/build/hocs/DamConfigContext.d.ts +2 -0
  201. package/build/hocs/DamConfigContext.js +108 -0
  202. package/build/hocs/ThemeContext.d.ts +15 -0
  203. package/build/hocs/ThemeContext.js +131 -0
  204. package/build/hocs/ToastProvider.d.ts +2 -0
  205. package/build/hocs/ToastProvider.js +6 -0
  206. package/build/hocs/appConstants.d.ts +124 -0
  207. package/build/hocs/appConstants.js +211 -0
  208. package/build/hocs/configureAxios.d.ts +2 -0
  209. package/build/hocs/configureAxios.js +65 -0
  210. package/build/hocs/helpers.d.ts +15 -0
  211. package/build/hocs/helpers.js +177 -0
  212. package/build/index.d.ts +11 -0
  213. package/build/index.js +11 -0
  214. package/build/react-query/hooks/brand-hooks.d.ts +3 -0
  215. package/build/react-query/hooks/brand-hooks.js +10 -0
  216. package/build/react-query/hooks/folder-hooks.d.ts +7 -0
  217. package/build/react-query/hooks/folder-hooks.js +119 -0
  218. package/build/react-query/services/brand-services.d.ts +3 -0
  219. package/build/react-query/services/brand-services.js +30 -0
  220. package/build/react-query/services/file-services.d.ts +43 -0
  221. package/build/react-query/services/file-services.js +69 -0
  222. package/build/react-query/services/folder-services.d.ts +44 -0
  223. package/build/react-query/services/folder-services.js +87 -0
  224. package/build/react-query/services/image-picker-services.d.ts +5 -0
  225. package/build/react-query/services/image-picker-services.js +48 -0
  226. package/build/settings/InviteTeamModal.d.ts +12 -0
  227. package/build/settings/InviteTeamModal.js +174 -0
  228. package/build/settings/UpdateInvitationAccessType.d.ts +9 -0
  229. package/build/settings/UpdateInvitationAccessType.js +96 -0
  230. package/build/settings/getUserAvatar.d.ts +7 -0
  231. package/build/settings/getUserAvatar.js +11 -0
  232. package/build/style.css +1 -0
  233. package/build/types/assetType.d.ts +8 -0
  234. package/build/types/assetType.js +1 -0
  235. package/build/ui/pageTitle.d.ts +3 -0
  236. package/build/ui/pageTitle.js +4 -0
  237. package/build/utilities/FoldersContext.d.ts +14 -0
  238. package/build/utilities/FoldersContext.js +10 -0
  239. package/build/utilities/NavigatorProvider.d.ts +2 -0
  240. package/build/utilities/NavigatorProvider.js +10 -0
  241. package/build/utilities/constants/apiUrls.d.ts +95 -0
  242. package/build/utilities/constants/apiUrls.js +115 -0
  243. package/build/utilities/constants/imageUrls.d.ts +6 -0
  244. package/build/utilities/constants/imageUrls.js +6 -0
  245. package/build/utilities/constants/interface.d.ts +371 -0
  246. package/build/utilities/constants/interface.js +142 -0
  247. package/build/utilities/constants/messages.d.ts +54 -0
  248. package/build/utilities/constants/messages.js +54 -0
  249. package/build/utilities/constants/queryKeys.d.ts +16 -0
  250. package/build/utilities/constants/queryKeys.js +33 -0
  251. package/build/utilities/constants/routes.d.ts +22 -0
  252. package/build/utilities/constants/routes.js +22 -0
  253. package/build/utilities/helpers/validators.d.ts +12 -0
  254. package/build/utilities/helpers/validators.js +89 -0
  255. package/build/utilities/useAppNavigate.d.ts +2 -0
  256. package/build/utilities/useAppNavigate.js +19 -0
  257. package/build/utilities/useAppParams.d.ts +6 -0
  258. package/build/utilities/useAppParams.js +27 -0
  259. package/package.json +93 -0
@@ -0,0 +1,177 @@
1
+ import dayjs from "dayjs";
2
+ import { first, get, last, split, toLower, toUpper } from "lodash";
3
+ import { DATE_FORMAT } from "./appConstants";
4
+ export const getProfileName = (name) => {
5
+ return name
6
+ ? name
7
+ .split(" ")
8
+ .map((word) => { var _a; return (_a = word === null || word === void 0 ? void 0 : word[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase(); })
9
+ .join("")
10
+ : "";
11
+ };
12
+ // export const humanFileSize = (size) => {
13
+ // var i = size == 0 ? 0 : Math.floor(Math.log(size) / Math.log(1024));
14
+ // return {
15
+ // size: (size / Math.pow(1024, i)).toFixed(2) * 1,
16
+ // sizeType: ["B", "kB", "MB", "GB", "TB"][i],
17
+ // };
18
+ // };
19
+ export function getProfileInitials(name) {
20
+ if (!name)
21
+ return "";
22
+ return name
23
+ .split(" ")
24
+ .map((word) => word.charAt(0).toUpperCase())
25
+ .join("");
26
+ }
27
+ export const addQueryParams = (params) => {
28
+ const paramStrings = Object.keys(params).reduce((acc, key) => {
29
+ const value = params[key];
30
+ let valueString;
31
+ if (typeof value === "object" && value !== null) {
32
+ valueString = encodeURIComponent(JSON.stringify(value));
33
+ }
34
+ else {
35
+ valueString = encodeURIComponent(value);
36
+ }
37
+ acc.push(`${key}=${valueString}`);
38
+ return acc;
39
+ }, []);
40
+ return paramStrings.join("&");
41
+ };
42
+ export const getProfile = (name) => {
43
+ const words = split(name, " ");
44
+ const firstName = first(words);
45
+ const lastName = last(words);
46
+ if (get(words, "length") > 1) {
47
+ return toUpper(first(firstName)) + toUpper(first(lastName));
48
+ }
49
+ else {
50
+ return toUpper(first(firstName));
51
+ }
52
+ };
53
+ export const formatBytes = (bytes, decimals = 2) => {
54
+ if (!bytes || bytes === 0)
55
+ return "0 Bytes";
56
+ const k = 1024;
57
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
58
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
59
+ const value = parseFloat((bytes / Math.pow(k, i)).toFixed(decimals));
60
+ return `${value} ${sizes[i]}`;
61
+ };
62
+ export const getDateRangeFromKey = (key) => {
63
+ const today = dayjs();
64
+ switch (key) {
65
+ case "today":
66
+ return {
67
+ startDate: today.format(DATE_FORMAT),
68
+ endDate: today.format(DATE_FORMAT),
69
+ };
70
+ case "last7":
71
+ return {
72
+ startDate: today.subtract(7, "day").format(DATE_FORMAT),
73
+ endDate: today.format(DATE_FORMAT),
74
+ };
75
+ case "last30":
76
+ return {
77
+ startDate: today.subtract(30, "day").format(DATE_FORMAT),
78
+ endDate: today.format(DATE_FORMAT),
79
+ };
80
+ case "thisYear":
81
+ return {
82
+ startDate: today.startOf("year").format(DATE_FORMAT),
83
+ endDate: today.endOf("year").format(DATE_FORMAT),
84
+ };
85
+ case "lastYear":
86
+ const lastYear = today.subtract(1, "year");
87
+ return {
88
+ startDate: lastYear.startOf("year").format(DATE_FORMAT),
89
+ endDate: lastYear.endOf("year").format(DATE_FORMAT),
90
+ };
91
+ default:
92
+ return {};
93
+ }
94
+ };
95
+ export const getBaseUrl = (appType) => {
96
+ switch (appType) {
97
+ case "reactJs":
98
+ return process.env.REACT_APP_API_URL || "https://yjeregc921.execute-api.ap-south-1.amazonaws.com/staging/v1";
99
+ case "nextJs":
100
+ return process.env.NEXT_PUBLIC_API_URL || "https://yjeregc921.execute-api.ap-south-1.amazonaws.com/staging/v1";
101
+ default:
102
+ return "https://yjeregc921.execute-api.ap-south-1.amazonaws.com/staging/v1";
103
+ }
104
+ };
105
+ export const getRelativeTime = (timestamp) => {
106
+ const now = new Date();
107
+ const created = new Date(timestamp);
108
+ const diff = Math.floor((now.getTime() - created.getTime()) / 1000); // in seconds
109
+ const minutes = Math.floor(diff / 60);
110
+ const hours = Math.floor(diff / 3600);
111
+ const days = Math.floor(diff / 86400);
112
+ const weeks = Math.floor(diff / (86400 * 7));
113
+ const years = Math.floor(diff / (86400 * 365));
114
+ if (diff < 60)
115
+ return "just now";
116
+ if (minutes < 60)
117
+ return `${minutes} min${minutes > 1 ? "s" : ""} ago`;
118
+ if (hours < 24)
119
+ return `${hours} hour${hours > 1 ? "s" : ""} ago`;
120
+ if (days < 7)
121
+ return `${days} day${days > 1 ? "s" : ""} ago`;
122
+ if (weeks < 52)
123
+ return `${weeks} week${weeks > 1 ? "s" : ""} ago`;
124
+ return `${years} year${years > 1 ? "s" : ""} ago`;
125
+ };
126
+ export const getReadableFileType = (file) => {
127
+ const mimetype = get(file, "mimetype", "");
128
+ const fileName = get(file, "name", "");
129
+ const extension = toLower(fileName.split(".").pop() || "");
130
+ const typeMap = {
131
+ "image/png": "PNG image",
132
+ "image/jpeg": "JPEG image",
133
+ "image/jpg": "JPG image",
134
+ "image/webp": "WEBP image",
135
+ "image/gif": "GIF image",
136
+ "application/pdf": "PDF document",
137
+ "application/msword": "Word document",
138
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "Word document",
139
+ "application/vnd.ms-excel": "Excel spreadsheet",
140
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "Excel spreadsheet",
141
+ "text/plain": "Text file",
142
+ "application/zip": "ZIP archive",
143
+ "application/json": "JSON file",
144
+ };
145
+ // Check mimetype first
146
+ const typeFromMime = get(typeMap, mimetype);
147
+ if (typeFromMime)
148
+ return typeFromMime;
149
+ // Final fallback based on extension
150
+ return extension ? `${extension.toUpperCase()} file` : "Unknown file";
151
+ };
152
+ export const humanFileSize = (size) => {
153
+ var i = size == 0 ? 0 : Math.floor(Math.log(size) / Math.log(1024));
154
+ return {
155
+ size: (size / Math.pow(1024, i)).toFixed(2) * 1,
156
+ sizeType: ["B", "kB", "MB", "GB", "TB"][i],
157
+ };
158
+ };
159
+ export const getFormattedValue = (outputFormatData, fileUrl, item) => {
160
+ const value = outputFormatData === null || outputFormatData === void 0 ? void 0 : outputFormatData.reduce((acc, field) => {
161
+ var _a;
162
+ if (field === null || field === void 0 ? void 0 : field.required) {
163
+ if ((field === null || field === void 0 ? void 0 : field.name) == "File URL") {
164
+ acc = (field === null || field === void 0 ? void 0 : field.separator) ? acc + fileUrl + " " : acc + fileUrl;
165
+ }
166
+ else {
167
+ const fieldValue = (_a = item === null || item === void 0 ? void 0 : item[field === null || field === void 0 ? void 0 : field.fieldId]) === null || _a === void 0 ? void 0 : _a.toString();
168
+ acc = acc + ((fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.trim()) ? fieldValue : "");
169
+ }
170
+ if (field === null || field === void 0 ? void 0 : field.separator) {
171
+ acc = acc + (field === null || field === void 0 ? void 0 : field.separator);
172
+ }
173
+ }
174
+ return acc;
175
+ }, "");
176
+ return value ? value : fileUrl;
177
+ };
@@ -0,0 +1,11 @@
1
+ import ImagePicker from "./ImagePicker";
2
+ import "./style.css";
3
+ import AssetTypes from "./AssetType";
4
+ import MyDrive from "./MyDrive";
5
+ import CreateClient from "./CreateClient";
6
+ import RefreshKey from "./RefreshKey";
7
+ import ImagePickerFilters from "./ImagePickerFilters";
8
+ import ShoesView from "./ShoesView";
9
+ import PenView from "./PenView";
10
+ import BookView from "./BookView";
11
+ export { AssetTypes, MyDrive, CreateClient, ImagePicker, RefreshKey, ImagePickerFilters, ShoesView, PenView, BookView };
package/build/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import ImagePicker from "./ImagePicker";
2
+ import "./style.css";
3
+ import AssetTypes from "./AssetType";
4
+ import MyDrive from "./MyDrive";
5
+ import CreateClient from "./CreateClient";
6
+ import RefreshKey from "./RefreshKey";
7
+ import ImagePickerFilters from "./ImagePickerFilters";
8
+ import ShoesView from "./ShoesView";
9
+ import PenView from "./PenView";
10
+ import BookView from "./BookView";
11
+ export { AssetTypes, MyDrive, CreateClient, ImagePicker, RefreshKey, ImagePickerFilters, ShoesView, PenView, BookView };
@@ -0,0 +1,3 @@
1
+ import { QueryClient } from "react-query";
2
+ export declare const getCurrentBrandData: (queryClient: QueryClient, brandId: string) => {} | null;
3
+ export declare const getCurrentBrandUsers: (queryClient: QueryClient, brandId: string) => never[];
@@ -0,0 +1,10 @@
1
+ import { QueryKeys } from "../../utilities/constants/queryKeys";
2
+ import { get } from "lodash";
3
+ export const getCurrentBrandData = (queryClient, brandId) => {
4
+ const brandData = queryClient.getQueryData([QueryKeys.BRAND, brandId]);
5
+ return brandData || null;
6
+ };
7
+ export const getCurrentBrandUsers = (queryClient, brandId) => {
8
+ const brandData = queryClient.getQueryData([QueryKeys.BRAND, brandId]);
9
+ return get(brandData, "users", []);
10
+ };
@@ -0,0 +1,7 @@
1
+ import { FolderEntity } from "../../utilities/constants/interface";
2
+ import { QueryClient } from "react-query";
3
+ export declare const updateFoldersCacheOnCreateFolder: (queryClient: QueryClient, id: string, folder: FolderEntity, key: string) => void;
4
+ export declare const updateFoldersCacheOnDeleteFolder: (queryClient: QueryClient, id: string, folderId: string, key: string, dataKeyName?: string) => void;
5
+ export declare const updateFoldersCacheOnUpdateFolder: (queryClient: QueryClient, id: string, newFolder: FolderEntity, key: string, dataKeyName?: string) => void;
6
+ export declare const getFolderData: (queryClient: QueryClient, folderId: string, key: string) => any[];
7
+ export declare const getSelectedFiles: (queryClient: QueryClient, folderId: string, key: string, fileIds: string[]) => any[];
@@ -0,0 +1,119 @@
1
+ import { DEFAULT_PAGE, DEFAULT_PAGE_SIZE } from "../../hocs/appConstants";
2
+ import { cloneDeep, filter, findIndex, flatMap, get, includes, remove, set, } from "lodash";
3
+ export const updateFoldersCacheOnCreateFolder = (queryClient, id, folder, key) => {
4
+ queryClient.setQueryData([key, id], (oldQueryData) => {
5
+ if (!oldQueryData) {
6
+ return {
7
+ pages: [
8
+ {
9
+ totalCount: DEFAULT_PAGE,
10
+ totalPages: DEFAULT_PAGE,
11
+ currentPage: DEFAULT_PAGE,
12
+ size: DEFAULT_PAGE_SIZE,
13
+ folders: [folder],
14
+ },
15
+ ],
16
+ pageParams: [null],
17
+ };
18
+ }
19
+ const newQueryData = cloneDeep(oldQueryData);
20
+ const lastPage = newQueryData.pages[get(newQueryData, "pages.length") - 1];
21
+ if (get(lastPage, `folders.length`) < DEFAULT_PAGE_SIZE) {
22
+ get(lastPage, `folders`).push(folder);
23
+ }
24
+ else {
25
+ if (lastPage) {
26
+ newQueryData.pages.push({
27
+ totalCount: get(lastPage, "totalCount", 0) + 1,
28
+ totalPages: get(lastPage, "totalPages", 0) + 1,
29
+ currentPage: get(lastPage, "currentPage", 0) + 1,
30
+ size: DEFAULT_PAGE_SIZE,
31
+ folders: [folder],
32
+ });
33
+ }
34
+ else {
35
+ newQueryData.pages = [
36
+ {
37
+ totalCount: 0,
38
+ totalPages: DEFAULT_PAGE,
39
+ currentPage: 1,
40
+ size: DEFAULT_PAGE_SIZE,
41
+ folders: [folder],
42
+ },
43
+ ];
44
+ }
45
+ }
46
+ const totalCount = get(newQueryData, "pages[0].totalCount") + 1;
47
+ const totalPages = Math.ceil(totalCount / DEFAULT_PAGE_SIZE);
48
+ newQueryData.pages.forEach((page) => {
49
+ page.totalCount = totalCount;
50
+ page.totalPages = totalPages;
51
+ page.size = DEFAULT_PAGE_SIZE;
52
+ });
53
+ return newQueryData;
54
+ });
55
+ };
56
+ export const updateFoldersCacheOnDeleteFolder = (queryClient, id, folderId, key, dataKeyName = "folders") => {
57
+ queryClient.setQueryData([key, id], (oldQueryData) => {
58
+ if (!oldQueryData || !get(oldQueryData, "pages")) {
59
+ return;
60
+ }
61
+ const newQueryData = cloneDeep(oldQueryData);
62
+ let itemRemoved = false;
63
+ for (let page of get(newQueryData, "pages")) {
64
+ const result = remove(get(page, `${dataKeyName}`), (folder) => get(folder, "_id") === folderId);
65
+ if (get(result, "length") > 0) {
66
+ itemRemoved = true;
67
+ }
68
+ }
69
+ if (itemRemoved) {
70
+ const allItems = get(newQueryData, "pages").flatMap((page) => get(page, `${dataKeyName}`));
71
+ const totalCount = get(allItems, "length");
72
+ const totalPages = Math.ceil(totalCount / DEFAULT_PAGE_SIZE);
73
+ newQueryData.pages = [];
74
+ for (let i = 0; i < totalPages; i++) {
75
+ const startIdx = i * DEFAULT_PAGE_SIZE;
76
+ const pageItems = allItems.slice(startIdx, startIdx + DEFAULT_PAGE_SIZE);
77
+ newQueryData.pages.push({
78
+ totalCount,
79
+ totalPages,
80
+ currentPage: i + 1,
81
+ size: DEFAULT_PAGE_SIZE,
82
+ [dataKeyName]: pageItems,
83
+ });
84
+ }
85
+ }
86
+ return newQueryData;
87
+ });
88
+ };
89
+ export const updateFoldersCacheOnUpdateFolder = (queryClient, id, newFolder, key, dataKeyName = "folders") => {
90
+ queryClient.setQueryData([key, id], (oldQueryData) => {
91
+ if (!oldQueryData || !get(oldQueryData, "pages")) {
92
+ return;
93
+ }
94
+ const newQueryData = cloneDeep(oldQueryData);
95
+ let itemUpdated = false;
96
+ newQueryData.pages.forEach((page) => {
97
+ const folders = get(page, dataKeyName);
98
+ const itemIndex = findIndex(folders, (folder) => get(folder, "_id") === get(newFolder, "_id"));
99
+ if (itemIndex > -1) {
100
+ set(folders, `[${itemIndex}]`, newFolder);
101
+ itemUpdated = true;
102
+ }
103
+ });
104
+ return newQueryData;
105
+ });
106
+ };
107
+ export const getFolderData = (queryClient, folderId, key) => {
108
+ const foldersPaginatedData = queryClient.getQueryData([key, folderId]);
109
+ return !!foldersPaginatedData
110
+ ? flatMap(get(foldersPaginatedData, "pages"), "folders")
111
+ : [];
112
+ };
113
+ export const getSelectedFiles = (queryClient, folderId, key, fileIds) => {
114
+ const foldersPaginatedData = queryClient.getQueryData([key, folderId]);
115
+ const files = !!foldersPaginatedData
116
+ ? flatMap(get(foldersPaginatedData, "pages"), "folders")
117
+ : [];
118
+ return filter(files, (file) => includes(fileIds, get(file, "_id")));
119
+ };
@@ -0,0 +1,3 @@
1
+ export declare function useCurrentBrand(headers: {
2
+ headers: any;
3
+ }, brandId: string, enabled: boolean): import("react-query").UseQueryResult<any, unknown>;
@@ -0,0 +1,30 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { FETCH_BRAND_URL } from "../../utilities/constants/apiUrls";
11
+ import { QueryKeys } from "../../utilities/constants/queryKeys";
12
+ import { get } from "lodash";
13
+ import { useQuery } from "react-query";
14
+ function fetchBrand(api, brandId) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ try {
17
+ const response = yield api.get(FETCH_BRAND_URL.replace(":brandId", brandId));
18
+ return get(response, "data");
19
+ }
20
+ catch (error) {
21
+ throw error;
22
+ }
23
+ });
24
+ }
25
+ export function useCurrentBrand(headers, brandId, enabled) {
26
+ return useQuery([QueryKeys.BRAND, brandId], () => fetchBrand(headers, brandId), {
27
+ enabled: enabled && !!get(headers, "headers.Authorization"),
28
+ refetchOnWindowFocus: false,
29
+ });
30
+ }
@@ -0,0 +1,43 @@
1
+ export declare const deleteFiles: ({ fileIds, folderIds, api, }: {
2
+ fileIds: string[];
3
+ folderIds: string[];
4
+ api: any;
5
+ }) => Promise<any>;
6
+ export declare const archiveFiles: ({ fileIds, folderIds, api, }: {
7
+ fileIds: string[];
8
+ folderIds: string[];
9
+ api: any;
10
+ }) => Promise<any>;
11
+ export declare const unarchiveFiles: ({ fileIds, folderIds, api, }: {
12
+ fileIds: string[];
13
+ folderIds: string[];
14
+ api: any;
15
+ }) => Promise<any>;
16
+ export declare const restoreFiles: ({ fileIds, folderIds, api, }: {
17
+ fileIds: string[];
18
+ folderIds: string[];
19
+ api: any;
20
+ }) => Promise<any>;
21
+ export declare const downloadFiles: ({ fileIds, folderIds, api, }: {
22
+ fileIds: string[];
23
+ folderIds: string[];
24
+ api: any;
25
+ }) => Promise<any>;
26
+ export declare const duplicateFiles: ({ fileIds, api, }: {
27
+ fileIds: string[];
28
+ api: any;
29
+ }) => Promise<any>;
30
+ export declare const moveFiles: ({ payload, api, }: {
31
+ payload: {
32
+ fileIds: string[];
33
+ destinationFolderId: string;
34
+ folderIds: string[];
35
+ };
36
+ api: any;
37
+ }) => Promise<any>;
38
+ export declare const useFile: (api: any, fileId?: string) => import("react-query").UseQueryResult<any, unknown>;
39
+ export declare const updateFile: ({ fileId, payload, api, }: {
40
+ fileId: string;
41
+ payload: any;
42
+ api: any;
43
+ }) => Promise<any>;
@@ -0,0 +1,69 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { addQueryParams } from "../../hocs/helpers";
11
+ import { ARCHIVE_FILES_URL, CREATE_FILE_URL, DOWNLOAD_FILES_URL, DUPLICATE_FILE_URL, FETCH_FILE_URL, MOVE_FILES_URL, RESTORE_FILES_URL, UNARCHIVE_FILES_URL, } from "../../utilities/constants/apiUrls";
12
+ import { QueryKeys } from "../../utilities/constants/queryKeys";
13
+ import { get, join } from "lodash";
14
+ import { useQuery } from "react-query";
15
+ //delete files
16
+ export const deleteFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, folderIds, api, }) {
17
+ return yield api.delete(`${CREATE_FILE_URL}?${addQueryParams({
18
+ fileIds: join(fileIds, ","),
19
+ folderIds: join(folderIds, ","),
20
+ })}`);
21
+ });
22
+ //archive files
23
+ export const archiveFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, folderIds, api, }) {
24
+ return yield api.put(`${ARCHIVE_FILES_URL}`, { fileIds, folderIds });
25
+ });
26
+ //unarchive files
27
+ export const unarchiveFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, folderIds, api, }) {
28
+ return yield api.put(UNARCHIVE_FILES_URL, { fileIds, folderIds });
29
+ });
30
+ //restore files
31
+ export const restoreFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, folderIds, api, }) {
32
+ return yield api.put(RESTORE_FILES_URL, { fileIds, folderIds });
33
+ });
34
+ //download files
35
+ export const downloadFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, folderIds, api, }) {
36
+ return yield api.post(`${DOWNLOAD_FILES_URL}`, { fileIds, folderIds });
37
+ });
38
+ //duplicate files
39
+ export const duplicateFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileIds, api, }) {
40
+ return yield api.put(DUPLICATE_FILE_URL, { fileIds });
41
+ });
42
+ //move files
43
+ export const moveFiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ payload, api, }) {
44
+ return yield api.put(MOVE_FILES_URL, payload);
45
+ });
46
+ function fetchFile(api, fileId) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ try {
49
+ const response = yield api.get(FETCH_FILE_URL.replace(":fileId", fileId));
50
+ return get(response, "data");
51
+ }
52
+ catch (error) {
53
+ throw error;
54
+ }
55
+ });
56
+ }
57
+ export const useFile = (api, fileId) => {
58
+ const isEnabled = !!fileId;
59
+ return useQuery({
60
+ queryKey: [QueryKeys.FILE, fileId],
61
+ queryFn: isEnabled ? () => fetchFile(api, fileId) : undefined,
62
+ enabled: isEnabled,
63
+ refetchOnWindowFocus: false,
64
+ });
65
+ };
66
+ //update file
67
+ export const updateFile = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileId, payload, api, }) {
68
+ return yield api.put(FETCH_FILE_URL.replace(":fileId", fileId), payload);
69
+ });
@@ -0,0 +1,44 @@
1
+ import { DriveModes } from "../../utilities/constants/interface";
2
+ import { QueryKeys } from "../../utilities/constants/queryKeys";
3
+ export declare const useFolders: (api: any, queryKey: QueryKeys, params: {
4
+ page?: number;
5
+ category?: DriveModes;
6
+ includeSubFoldersCount?: boolean;
7
+ includeFiles?: boolean;
8
+ fetchMainFolders?: boolean;
9
+ isPagination?: boolean;
10
+ }, folderId: string) => import("react-query").UseInfiniteQueryResult<any, unknown>;
11
+ export declare const deleteFolders: ({ folderIds, api, }: {
12
+ folderIds: string[];
13
+ api: any;
14
+ }) => Promise<any>;
15
+ export declare const archiveFolders: ({ folderIds, api, }: {
16
+ folderIds: string[];
17
+ api: any;
18
+ }) => Promise<any>;
19
+ export declare const duplicateFolder: ({ folderId, api, }: {
20
+ folderId: string;
21
+ api: any;
22
+ }) => Promise<any>;
23
+ export declare const restoreFolders: ({ folderIds, api, }: {
24
+ folderIds: string[];
25
+ api: any;
26
+ }) => Promise<any>;
27
+ export declare const unarchiveFolders: ({ folderIds, api, }: {
28
+ folderIds: string[];
29
+ api: any;
30
+ }) => Promise<any>;
31
+ export declare const addToFavFolders: ({ payload, api, }: {
32
+ payload: {
33
+ fileIds: string[];
34
+ folderIds: string[];
35
+ };
36
+ api: any;
37
+ }) => Promise<any>;
38
+ export declare const removeFromFavFolders: ({ payload, api, }: {
39
+ payload: {
40
+ folderIds: string[];
41
+ fileIds: string[];
42
+ };
43
+ api: any;
44
+ }) => Promise<any>;
@@ -0,0 +1,87 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { DEFAULT_PAGE } from "../../hocs/appConstants";
11
+ import { addQueryParams } from "../../hocs/helpers";
12
+ import { ARCHIVE_FOLDERS_URL, DELETE_FOLDERS_URL, DUPLICATE_FOLDER_URL, FETCH_FOLDER_URL, FETCH_RECENT_FOLDERS_URL, FETCH_SHARED_FOLDERS_URL, FETCH_STARRED_FOLDERS_URL, FETCH_TRASH_FOLDERS_URL, RESTORE_TRASHED_FOLDERS_URL, UNARCHIVE_FOLDERS_URL, VIEW_SHARED_FOLDER_URL, } from "../../utilities/constants/apiUrls";
13
+ import { DriveModes } from "../../utilities/constants/interface";
14
+ import { get, includes, join } from "lodash";
15
+ import { useInfiniteQuery } from "react-query";
16
+ function fetchFolders(api, params, folderId) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ try {
19
+ const response = yield api.get(`${get(params, "category") === DriveModes.STARRED
20
+ ? FETCH_STARRED_FOLDERS_URL
21
+ : get(params, "category") === DriveModes.RECENTS
22
+ ? FETCH_RECENT_FOLDERS_URL
23
+ : includes([DriveModes.ARCHIVES, DriveModes.TRASH], get(params, "category"))
24
+ ? FETCH_TRASH_FOLDERS_URL
25
+ : get(params, "category") === DriveModes.SHARED
26
+ ? FETCH_SHARED_FOLDERS_URL
27
+ : get(params, "category") === DriveModes.FOLDERS
28
+ ? VIEW_SHARED_FOLDER_URL.replace(":folderId", folderId)
29
+ : FETCH_FOLDER_URL.replace(":folderId", folderId)}?${addQueryParams(params)}`);
30
+ return get(response, "data");
31
+ }
32
+ catch (error) {
33
+ throw error;
34
+ }
35
+ });
36
+ }
37
+ export const useFolders = (api, queryKey, params, folderId) => {
38
+ return useInfiniteQuery({
39
+ queryKey: [queryKey, folderId],
40
+ queryFn: (_a) => __awaiter(void 0, [_a], void 0, function* ({ pageParam = DEFAULT_PAGE }) {
41
+ const updatedParams = Object.assign(Object.assign({}, params), { page: pageParam });
42
+ return fetchFolders(api, updatedParams, folderId);
43
+ }),
44
+ getNextPageParam: (lastPage, allPages) => {
45
+ const currentPage = Number(get(lastPage, "currentPage"));
46
+ const totalPages = get(lastPage, "totalPages");
47
+ if (currentPage < totalPages) {
48
+ return currentPage + 1;
49
+ }
50
+ else {
51
+ return undefined;
52
+ }
53
+ },
54
+ enabled: folderId ? true : false,
55
+ refetchOnWindowFocus: false,
56
+ });
57
+ };
58
+ //delete folder
59
+ export const deleteFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ folderIds, api, }) {
60
+ return yield api.delete(`${DELETE_FOLDERS_URL}?${addQueryParams({
61
+ folderIds: join(folderIds, ","),
62
+ })}`);
63
+ });
64
+ //archive folder
65
+ export const archiveFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ folderIds, api, }) {
66
+ return yield api.put(`${ARCHIVE_FOLDERS_URL}`, { folderIds });
67
+ });
68
+ //duplicate folder
69
+ export const duplicateFolder = (_a) => __awaiter(void 0, [_a], void 0, function* ({ folderId, api, }) {
70
+ return yield api.put(DUPLICATE_FOLDER_URL.replace(":folderId", folderId), {});
71
+ });
72
+ //restore folders
73
+ export const restoreFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ folderIds, api, }) {
74
+ return yield api.put(RESTORE_TRASHED_FOLDERS_URL, { folderIds });
75
+ });
76
+ //unarchive folders
77
+ export const unarchiveFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ folderIds, api, }) {
78
+ return yield api.put(UNARCHIVE_FOLDERS_URL, { folderIds });
79
+ });
80
+ //star the folder
81
+ export const addToFavFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ payload, api, }) {
82
+ return yield api.post(FETCH_STARRED_FOLDERS_URL, payload);
83
+ });
84
+ //unstar the folder
85
+ export const removeFromFavFolders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ payload, api, }) {
86
+ return yield api.put(FETCH_STARRED_FOLDERS_URL, payload);
87
+ });
@@ -0,0 +1,5 @@
1
+ export declare const useImagePickers: (headers: {
2
+ headers: any;
3
+ }, params: {
4
+ page?: number;
5
+ }, id: string) => import("react-query").UseInfiniteQueryResult<any, unknown>;