@webiny/app-record-locking 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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 (270) hide show
  1. package/README.md +8 -9
  2. package/RecordLockingModule.d.ts +2 -0
  3. package/RecordLockingModule.js +74 -0
  4. package/RecordLockingModule.js.map +1 -0
  5. package/SecurityPermissions.d.ts +2 -0
  6. package/SecurityPermissions.js +15 -0
  7. package/SecurityPermissions.js.map +1 -0
  8. package/features/acquireLock/AcquireLockGateway.d.ts +12 -0
  9. package/features/acquireLock/AcquireLockGateway.js +43 -0
  10. package/features/acquireLock/AcquireLockGateway.js.map +1 -0
  11. package/features/acquireLock/AcquireLockUseCase.d.ts +10 -0
  12. package/features/acquireLock/AcquireLockUseCase.js +18 -0
  13. package/features/acquireLock/AcquireLockUseCase.js.map +1 -0
  14. package/features/acquireLock/abstractions.d.ts +19 -0
  15. package/features/acquireLock/abstractions.js +6 -0
  16. package/features/acquireLock/abstractions.js.map +1 -0
  17. package/features/acquireLock/feature.d.ts +3 -0
  18. package/features/acquireLock/feature.js +19 -0
  19. package/features/acquireLock/feature.js.map +1 -0
  20. package/features/checkLockStatus/CheckLockStatusGateway.d.ts +12 -0
  21. package/features/checkLockStatus/CheckLockStatusGateway.js +43 -0
  22. package/features/checkLockStatus/CheckLockStatusGateway.js.map +1 -0
  23. package/features/checkLockStatus/CheckLockStatusUseCase.d.ts +10 -0
  24. package/features/checkLockStatus/CheckLockStatusUseCase.js +18 -0
  25. package/features/checkLockStatus/CheckLockStatusUseCase.js.map +1 -0
  26. package/features/checkLockStatus/abstractions.d.ts +19 -0
  27. package/features/checkLockStatus/abstractions.js +6 -0
  28. package/features/checkLockStatus/abstractions.js.map +1 -0
  29. package/features/checkLockStatus/feature.d.ts +3 -0
  30. package/features/checkLockStatus/feature.js +19 -0
  31. package/features/checkLockStatus/feature.js.map +1 -0
  32. package/features/feature.d.ts +1 -0
  33. package/features/feature.js +19 -0
  34. package/features/feature.js.map +1 -0
  35. package/features/forceUnlock/ForceUnlockGateway.d.ts +12 -0
  36. package/features/forceUnlock/ForceUnlockGateway.js +44 -0
  37. package/features/forceUnlock/ForceUnlockGateway.js.map +1 -0
  38. package/features/forceUnlock/ForceUnlockUseCase.d.ts +10 -0
  39. package/features/forceUnlock/ForceUnlockUseCase.js +18 -0
  40. package/features/forceUnlock/ForceUnlockUseCase.js.map +1 -0
  41. package/features/forceUnlock/abstractions.d.ts +19 -0
  42. package/features/forceUnlock/abstractions.js +6 -0
  43. package/features/forceUnlock/abstractions.js.map +1 -0
  44. package/features/forceUnlock/feature.d.ts +3 -0
  45. package/features/forceUnlock/feature.js +19 -0
  46. package/features/forceUnlock/feature.js.map +1 -0
  47. package/{domain/graphql/fields.js → features/graphqlFields.js} +4 -3
  48. package/features/graphqlFields.js.map +1 -0
  49. package/features/listLockRecords/ListLockRecordsGateway.d.ts +12 -0
  50. package/features/listLockRecords/ListLockRecordsGateway.js +48 -0
  51. package/features/listLockRecords/ListLockRecordsGateway.js.map +1 -0
  52. package/features/listLockRecords/ListLockRecordsUseCase.d.ts +10 -0
  53. package/features/listLockRecords/ListLockRecordsUseCase.js +18 -0
  54. package/features/listLockRecords/ListLockRecordsUseCase.js.map +1 -0
  55. package/features/listLockRecords/abstractions.d.ts +22 -0
  56. package/features/listLockRecords/abstractions.js +6 -0
  57. package/features/listLockRecords/abstractions.js.map +1 -0
  58. package/features/listLockRecords/feature.d.ts +3 -0
  59. package/features/listLockRecords/feature.js +19 -0
  60. package/features/listLockRecords/feature.js.map +1 -0
  61. package/features/permissions/abstractions.d.ts +17 -0
  62. package/features/permissions/abstractions.js +6 -0
  63. package/features/permissions/abstractions.js.map +1 -0
  64. package/features/permissions/feature.d.ts +14 -0
  65. package/features/permissions/feature.js +7 -0
  66. package/features/permissions/feature.js.map +1 -0
  67. package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
  68. package/features/releaseLock/ReleaseLockGateway.js +44 -0
  69. package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
  70. package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
  71. package/features/releaseLock/ReleaseLockUseCase.js +18 -0
  72. package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
  73. package/features/releaseLock/abstractions.d.ts +19 -0
  74. package/features/releaseLock/abstractions.js +6 -0
  75. package/features/releaseLock/abstractions.js.map +1 -0
  76. package/features/releaseLock/feature.d.ts +3 -0
  77. package/features/releaseLock/feature.js +19 -0
  78. package/features/releaseLock/feature.js.map +1 -0
  79. package/index.d.ts +0 -5
  80. package/index.js +21 -26
  81. package/index.js.map +1 -1
  82. package/package.json +26 -33
  83. package/permissions/permissionsSchema.d.ts +6 -0
  84. package/permissions/permissionsSchema.js +10 -0
  85. package/permissions/permissionsSchema.js.map +1 -0
  86. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.d.ts +23 -0
  87. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js +64 -0
  88. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js.map +1 -0
  89. package/presentation/entryLocking/RecordLockingPresenter.d.ts +32 -0
  90. package/presentation/entryLocking/RecordLockingPresenter.js +164 -0
  91. package/presentation/entryLocking/RecordLockingPresenter.js.map +1 -0
  92. package/presentation/entryLocking/SingleEntryContentDecorator.d.ts +2 -0
  93. package/presentation/entryLocking/SingleEntryContentDecorator.js +72 -0
  94. package/presentation/entryLocking/SingleEntryContentDecorator.js.map +1 -0
  95. package/presentation/entryLocking/SingleEntryPresenterDecorator.d.ts +15 -0
  96. package/presentation/entryLocking/SingleEntryPresenterDecorator.js +40 -0
  97. package/presentation/entryLocking/SingleEntryPresenterDecorator.js.map +1 -0
  98. package/presentation/entryLocking/abstractions.d.ts +26 -0
  99. package/presentation/entryLocking/abstractions.js +5 -0
  100. package/presentation/entryLocking/abstractions.js.map +1 -0
  101. package/presentation/entryLocking/components/ForceUnlockButton.d.ts +11 -0
  102. package/presentation/entryLocking/components/ForceUnlockButton.js +37 -0
  103. package/presentation/entryLocking/components/ForceUnlockButton.js.map +1 -0
  104. package/presentation/entryLocking/components/LockedEntryOverlay.d.ts +10 -0
  105. package/presentation/entryLocking/components/LockedEntryOverlay.js +52 -0
  106. package/presentation/entryLocking/components/LockedEntryOverlay.js.map +1 -0
  107. package/presentation/entryLocking/components/RecordLockingGuard.d.ts +12 -0
  108. package/presentation/entryLocking/components/RecordLockingGuard.js +74 -0
  109. package/presentation/entryLocking/components/RecordLockingGuard.js.map +1 -0
  110. package/presentation/entryLocking/feature.d.ts +3 -0
  111. package/presentation/entryLocking/feature.js +21 -0
  112. package/presentation/entryLocking/feature.js.map +1 -0
  113. package/presentation/listLocking/ContentEntriesPresenterDecorator.d.ts +25 -0
  114. package/presentation/listLocking/ContentEntriesPresenterDecorator.js +70 -0
  115. package/presentation/listLocking/ContentEntriesPresenterDecorator.js.map +1 -0
  116. package/presentation/listLocking/ListLockRecordsPresenter.d.ts +17 -0
  117. package/presentation/listLocking/ListLockRecordsPresenter.js +52 -0
  118. package/presentation/listLocking/ListLockRecordsPresenter.js.map +1 -0
  119. package/presentation/listLocking/abstractions.d.ts +16 -0
  120. package/presentation/listLocking/abstractions.js +5 -0
  121. package/presentation/listLocking/abstractions.js.map +1 -0
  122. package/presentation/listLocking/components/ListLockRecordsSync.d.ts +4 -0
  123. package/presentation/listLocking/components/ListLockRecordsSync.js +26 -0
  124. package/presentation/listLocking/components/ListLockRecordsSync.js.map +1 -0
  125. package/presentation/listLocking/components/LockIndicatorCell.d.ts +2 -0
  126. package/presentation/listLocking/components/LockIndicatorCell.js +39 -0
  127. package/presentation/listLocking/components/LockIndicatorCell.js.map +1 -0
  128. package/presentation/listLocking/feature.d.ts +3 -0
  129. package/presentation/listLocking/feature.js +19 -0
  130. package/presentation/listLocking/feature.js.map +1 -0
  131. package/types.d.ts +5 -49
  132. package/types.js +0 -3
  133. package/components/HeadlessCmsActionsAcoCell.d.ts +0 -2
  134. package/components/HeadlessCmsActionsAcoCell.js +0 -60
  135. package/components/HeadlessCmsActionsAcoCell.js.map +0 -1
  136. package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +0 -9
  137. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +0 -40
  138. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +0 -1
  139. package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +0 -18
  140. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +0 -106
  141. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +0 -1
  142. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.d.ts +0 -2
  143. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +0 -90
  144. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +0 -1
  145. package/components/HeadlessCmsContentEntry/index.d.ts +0 -1
  146. package/components/HeadlessCmsContentEntry/index.js +0 -3
  147. package/components/HeadlessCmsContentEntry/index.js.map +0 -1
  148. package/components/LockedRecord/LockedRecord.d.ts +0 -6
  149. package/components/LockedRecord/LockedRecord.js +0 -66
  150. package/components/LockedRecord/LockedRecord.js.map +0 -1
  151. package/components/LockedRecord/LockedRecordForceUnlock.d.ts +0 -9
  152. package/components/LockedRecord/LockedRecordForceUnlock.js +0 -75
  153. package/components/LockedRecord/LockedRecordForceUnlock.js.map +0 -1
  154. package/components/LockedRecord/index.d.ts +0 -1
  155. package/components/LockedRecord/index.js +0 -3
  156. package/components/LockedRecord/index.js.map +0 -1
  157. package/components/RecordLockingProvider.d.ts +0 -7
  158. package/components/RecordLockingProvider.js +0 -125
  159. package/components/RecordLockingProvider.js.map +0 -1
  160. package/components/decorators/UseContentEntriesListHookDecorator.d.ts +0 -2
  161. package/components/decorators/UseContentEntriesListHookDecorator.js +0 -21
  162. package/components/decorators/UseContentEntriesListHookDecorator.js.map +0 -1
  163. package/components/decorators/UseRecordsDecorator.d.ts +0 -9
  164. package/components/decorators/UseRecordsDecorator.js +0 -25
  165. package/components/decorators/UseRecordsDecorator.js.map +0 -1
  166. package/components/decorators/UseSaveEntryDecorator.d.ts +0 -2
  167. package/components/decorators/UseSaveEntryDecorator.js +0 -55
  168. package/components/decorators/UseSaveEntryDecorator.js.map +0 -1
  169. package/components/permissionRenderer/RecordLockingPermissions.d.ts +0 -7
  170. package/components/permissionRenderer/RecordLockingPermissions.js +0 -71
  171. package/components/permissionRenderer/RecordLockingPermissions.js.map +0 -1
  172. package/components/permissionRenderer/index.d.ts +0 -2
  173. package/components/permissionRenderer/index.js +0 -21
  174. package/components/permissionRenderer/index.js.map +0 -1
  175. package/domain/RecordLocking.d.ts +0 -28
  176. package/domain/RecordLocking.js +0 -320
  177. package/domain/RecordLocking.js.map +0 -1
  178. package/domain/RecordLockingClient.d.ts +0 -12
  179. package/domain/RecordLockingClient.js +0 -19
  180. package/domain/RecordLockingClient.js.map +0 -1
  181. package/domain/RecordLockingGetLockRecord.d.ts +0 -11
  182. package/domain/RecordLockingGetLockRecord.js +0 -21
  183. package/domain/RecordLockingGetLockRecord.js.map +0 -1
  184. package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +0 -11
  185. package/domain/RecordLockingGetLockedEntryLockRecord.js +0 -19
  186. package/domain/RecordLockingGetLockedEntryLockRecord.js.map +0 -1
  187. package/domain/RecordLockingIsEntryLocked.d.ts +0 -11
  188. package/domain/RecordLockingIsEntryLocked.js +0 -19
  189. package/domain/RecordLockingIsEntryLocked.js.map +0 -1
  190. package/domain/RecordLockingListLockRecords.d.ts +0 -12
  191. package/domain/RecordLockingListLockRecords.js +0 -31
  192. package/domain/RecordLockingListLockRecords.js.map +0 -1
  193. package/domain/RecordLockingLockEntry.d.ts +0 -11
  194. package/domain/RecordLockingLockEntry.js +0 -15
  195. package/domain/RecordLockingLockEntry.js.map +0 -1
  196. package/domain/RecordLockingUnlockEntry.d.ts +0 -11
  197. package/domain/RecordLockingUnlockEntry.js +0 -19
  198. package/domain/RecordLockingUnlockEntry.js.map +0 -1
  199. package/domain/RecordLockingUpdateEntryLock.d.ts +0 -11
  200. package/domain/RecordLockingUpdateEntryLock.js +0 -19
  201. package/domain/RecordLockingUpdateEntryLock.js.map +0 -1
  202. package/domain/abstractions/IRecordLocking.d.ts +0 -25
  203. package/domain/abstractions/IRecordLocking.js +0 -3
  204. package/domain/abstractions/IRecordLocking.js.map +0 -1
  205. package/domain/abstractions/IRecordLockingClient.d.ts +0 -6
  206. package/domain/abstractions/IRecordLockingClient.js +0 -3
  207. package/domain/abstractions/IRecordLockingClient.js.map +0 -1
  208. package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +0 -12
  209. package/domain/abstractions/IRecordLockingGetLockRecord.js +0 -3
  210. package/domain/abstractions/IRecordLockingGetLockRecord.js.map +0 -1
  211. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +0 -12
  212. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +0 -3
  213. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js.map +0 -1
  214. package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +0 -8
  215. package/domain/abstractions/IRecordLockingIsEntryLocked.js +0 -3
  216. package/domain/abstractions/IRecordLockingIsEntryLocked.js.map +0 -1
  217. package/domain/abstractions/IRecordLockingListLockRecords.d.ts +0 -19
  218. package/domain/abstractions/IRecordLockingListLockRecords.js +0 -3
  219. package/domain/abstractions/IRecordLockingListLockRecords.js.map +0 -1
  220. package/domain/abstractions/IRecordLockingLockEntry.d.ts +0 -12
  221. package/domain/abstractions/IRecordLockingLockEntry.js +0 -3
  222. package/domain/abstractions/IRecordLockingLockEntry.js.map +0 -1
  223. package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +0 -13
  224. package/domain/abstractions/IRecordLockingUnlockEntry.js +0 -3
  225. package/domain/abstractions/IRecordLockingUnlockEntry.js.map +0 -1
  226. package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +0 -12
  227. package/domain/abstractions/IRecordLockingUpdateEntryLock.js +0 -3
  228. package/domain/abstractions/IRecordLockingUpdateEntryLock.js.map +0 -1
  229. package/domain/graphql/fields.js.map +0 -1
  230. package/domain/graphql/getLockRecord.d.ts +0 -12
  231. package/domain/graphql/getLockRecord.js +0 -18
  232. package/domain/graphql/getLockRecord.js.map +0 -1
  233. package/domain/graphql/getLockedEntryLockRecord.d.ts +0 -12
  234. package/domain/graphql/getLockedEntryLockRecord.js +0 -18
  235. package/domain/graphql/getLockedEntryLockRecord.js.map +0 -1
  236. package/domain/graphql/isEntryLocked.d.ts +0 -12
  237. package/domain/graphql/isEntryLocked.js +0 -16
  238. package/domain/graphql/isEntryLocked.js.map +0 -1
  239. package/domain/graphql/listLockRecords.d.ts +0 -17
  240. package/domain/graphql/listLockRecords.js +0 -26
  241. package/domain/graphql/listLockRecords.js.map +0 -1
  242. package/domain/graphql/lockEntry.d.ts +0 -12
  243. package/domain/graphql/lockEntry.js +0 -20
  244. package/domain/graphql/lockEntry.js.map +0 -1
  245. package/domain/graphql/unlockEntry.d.ts +0 -12
  246. package/domain/graphql/unlockEntry.js +0 -18
  247. package/domain/graphql/unlockEntry.js.map +0 -1
  248. package/domain/graphql/updateEntryLock.d.ts +0 -12
  249. package/domain/graphql/updateEntryLock.js +0 -18
  250. package/domain/graphql/updateEntryLock.js.map +0 -1
  251. package/domain/utils/createRecordLockingClient.d.ts +0 -3
  252. package/domain/utils/createRecordLockingClient.js +0 -12
  253. package/domain/utils/createRecordLockingClient.js.map +0 -1
  254. package/domain/utils/createRecordLockingError.d.ts +0 -6
  255. package/domain/utils/createRecordLockingError.js +0 -16
  256. package/domain/utils/createRecordLockingError.js.map +0 -1
  257. package/hooks/index.d.ts +0 -2
  258. package/hooks/index.js +0 -4
  259. package/hooks/index.js.map +0 -1
  260. package/hooks/usePermission.d.ts +0 -3
  261. package/hooks/usePermission.js +0 -21
  262. package/hooks/usePermission.js.map +0 -1
  263. package/hooks/useRecordLocking.d.ts +0 -2
  264. package/hooks/useRecordLocking.js +0 -12
  265. package/hooks/useRecordLocking.js.map +0 -1
  266. package/types.js.map +0 -1
  267. package/utils/createCacheKey.d.ts +0 -3
  268. package/utils/createCacheKey.js +0 -15
  269. package/utils/createCacheKey.js.map +0 -1
  270. /package/{domain/graphql/fields.d.ts → features/graphqlFields.d.ts} +0 -0
@@ -1,16 +0,0 @@
1
- export const createRecordLockingError = error => {
2
- if (error instanceof Error) {
3
- return {
4
- message: error.message,
5
- code: error.code || "UNKNOWN_ERROR",
6
- data: error.data
7
- };
8
- }
9
- return {
10
- message: error.message,
11
- code: error.code,
12
- data: error.data
13
- };
14
- };
15
-
16
- //# sourceMappingURL=createRecordLockingError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createRecordLockingError","error","Error","message","code","data"],"sources":["createRecordLockingError.ts"],"sourcesContent":["import type { IRecordLockingError } from \"~/types\";\n\nexport interface IError extends Error {\n code?: string;\n data?: any;\n}\n\nexport const createRecordLockingError = (\n error: IError | IRecordLockingError\n): IRecordLockingError => {\n if (error instanceof Error) {\n return {\n message: error.message,\n code: error.code || \"UNKNOWN_ERROR\",\n data: error.data\n };\n }\n return {\n message: error.message,\n code: error.code,\n data: error.data\n };\n};\n"],"mappings":"AAOA,OAAO,MAAMA,wBAAwB,GACjCC,KAAmC,IACb;EACtB,IAAIA,KAAK,YAAYC,KAAK,EAAE;IACxB,OAAO;MACHC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI,IAAI,eAAe;MACnCC,IAAI,EAAEJ,KAAK,CAACI;IAChB,CAAC;EACL;EACA,OAAO;IACHF,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,IAAI,EAAEJ,KAAK,CAACI;EAChB,CAAC;AACL,CAAC","ignoreList":[]}
package/hooks/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./useRecordLocking";
2
- export * from "./usePermission";
package/hooks/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from "./useRecordLocking";
2
- export * from "./usePermission";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useRecordLocking\";\nexport * from \"./usePermission\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export declare const usePermission: () => {
2
- canForceUnlock: boolean;
3
- };
@@ -1,21 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useSecurity } from "@webiny/app-security";
3
- export const usePermission = () => {
4
- const {
5
- identity,
6
- getPermission
7
- } = useSecurity();
8
- const canForceUnlock = useMemo(() => {
9
- const hasFullAccess = !!getPermission("recordLocking.*");
10
- if (hasFullAccess) {
11
- return true;
12
- }
13
- const permission = getPermission("recordLocking");
14
- return permission?.canForceUnlock === "yes";
15
- }, [identity?.permissions]);
16
- return {
17
- canForceUnlock
18
- };
19
- };
20
-
21
- //# sourceMappingURL=usePermission.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useMemo","useSecurity","usePermission","identity","getPermission","canForceUnlock","hasFullAccess","permission","permissions"],"sources":["usePermission.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useSecurity } from \"@webiny/app-security\";\n\nexport const usePermission = () => {\n const { identity, getPermission } = useSecurity();\n\n const canForceUnlock = useMemo(() => {\n const hasFullAccess = !!getPermission(\"recordLocking.*\");\n if (hasFullAccess) {\n return true;\n }\n const permission = getPermission(\"recordLocking\");\n return permission?.canForceUnlock === \"yes\";\n }, [identity?.permissions]);\n\n return {\n canForceUnlock\n };\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,WAAW,QAAQ,sBAAsB;AAElD,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGH,WAAW,CAAC,CAAC;EAEjD,MAAMI,cAAc,GAAGL,OAAO,CAAC,MAAM;IACjC,MAAMM,aAAa,GAAG,CAAC,CAACF,aAAa,CAAC,iBAAiB,CAAC;IACxD,IAAIE,aAAa,EAAE;MACf,OAAO,IAAI;IACf;IACA,MAAMC,UAAU,GAAGH,aAAa,CAAC,eAAe,CAAC;IACjD,OAAOG,UAAU,EAAEF,cAAc,KAAK,KAAK;EAC/C,CAAC,EAAE,CAACF,QAAQ,EAAEK,WAAW,CAAC,CAAC;EAE3B,OAAO;IACHH;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { IRecordLockingContext, IPossiblyRecordLockingRecord } from "../types";
2
- export declare const useRecordLocking: <T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord>() => IRecordLockingContext<T>;
@@ -1,12 +0,0 @@
1
- import { WebinyError } from "@webiny/error";
2
- import { useContext } from "react";
3
- import { RecordLockingContext } from "../components/RecordLockingProvider";
4
- export const useRecordLocking = () => {
5
- const context = useContext(RecordLockingContext);
6
- if (!context) {
7
- throw new WebinyError("useRecordLocking must be used within a RecordLockingProvider.");
8
- }
9
- return context;
10
- };
11
-
12
- //# sourceMappingURL=useRecordLocking.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","useContext","RecordLockingContext","useRecordLocking","context"],"sources":["useRecordLocking.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { useContext } from \"react\";\nimport { RecordLockingContext } from \"~/components/RecordLockingProvider\";\nimport type { IRecordLockingContext, IPossiblyRecordLockingRecord } from \"~/types\";\n\nexport const useRecordLocking = <\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n>() => {\n const context = useContext(RecordLockingContext);\n if (!context) {\n throw new WebinyError(\"useRecordLocking must be used within a RecordLockingProvider.\");\n }\n return context as IRecordLockingContext<T>;\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,OAAO;AAClC,SAASC,oBAAoB;AAG7B,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAEzB;EACH,MAAMC,OAAO,GAAGH,UAAU,CAACC,oBAAoB,CAAC;EAChD,IAAI,CAACE,OAAO,EAAE;IACV,MAAM,IAAIJ,WAAW,CAAC,+DAA+D,CAAC;EAC1F;EACA,OAAOI,OAAO;AAClB,CAAC","ignoreList":[]}
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsContentEntry } from \"@webiny/app-headless-cms/types\";\nimport type { GenericRecord } from \"@webiny/app/types\";\nimport type { IRecordLockingUnlockEntryResult } from \"~/domain/abstractions/IRecordLockingUnlockEntry\";\nimport type { SecurityPermission } from \"@webiny/app-security/types\";\nimport type { IRecordLockingUpdateEntryLockResult } from \"~/domain/abstractions/IRecordLocking.js\";\n\nexport interface IRecordLockingIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IRecordLockingRecordLocked {\n lockedBy: IRecordLockingIdentity;\n lockedOn: string;\n expiresOn: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IPossiblyRecordLockingRecord extends CmsContentEntry {\n $lockingType?: string;\n $locked?: IRecordLockingRecordLocked | null;\n}\n\nexport interface IRecordLockingRecord extends IPossiblyRecordLockingRecord {\n $lockingType: string;\n}\n\nexport type IIsRecordLockedParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUpdateEntryLockParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUnlockEntryParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockedEntryLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport interface IFetchLockRecordResult {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n}\n\nexport interface IRecordLockingContext<\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n> {\n readonly loading: boolean;\n readonly records: IPossiblyRecordLockingRecord[];\n readonly error?: IRecordLockingError | null;\n setRecords(folderId: string, type: string, records: T[]): Promise<void>;\n updateEntryLock(params: IUpdateEntryLockParams): Promise<IRecordLockingUpdateEntryLockResult>;\n isRecordLocked(params?: IIsRecordLockedParams): boolean;\n getLockRecordEntry(id: string): IRecordLockingRecord | undefined;\n fetchLockRecord(params: IFetchLockRecordParams): Promise<IFetchLockRecordResult>;\n fetchLockedEntryLockRecord(\n params: IFetchLockedEntryLockRecordParams\n ): Promise<IRecordLockingLockRecord | null>;\n unlockEntry(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n removeEntryLock(params: IUnlockEntryParams): void;\n unlockEntryForce(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n isLockExpired(input: Date | string): boolean;\n}\n\nexport interface IRecordLockingLockRecordAction {\n type: string;\n message: string;\n createdBy: IRecordLockingIdentity;\n createdOn: string;\n}\n\nexport interface IRecordLockingLockRecord {\n id: string;\n lockedOn: string;\n expiresOn: string;\n lockedBy: IRecordLockingIdentity;\n targetId: string;\n type: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IRecordLockingMeta {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\nexport interface IRecordLockingError<T = GenericRecord> {\n message: string;\n code: string;\n data?: T;\n}\n\nexport interface RecordLockingSecurityPermission extends SecurityPermission {\n canForceUnlock?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { GenericRecord } from "@webiny/app/types";
2
- export type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];
3
- export declare const createCacheKey: (input: ICreateCacheKeyInput) => Promise<string>;
@@ -1,15 +0,0 @@
1
- import { sha1 } from "crypto-hash";
2
- const createKey = input => {
3
- if (typeof input === "string") {
4
- return input;
5
- }
6
- return JSON.stringify(input);
7
- };
8
- export const createCacheKey = input => {
9
- const key = createKey(input);
10
- return sha1(key, {
11
- outputFormat: "hex"
12
- });
13
- };
14
-
15
- //# sourceMappingURL=createCacheKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["sha1","createKey","input","JSON","stringify","createCacheKey","key","outputFormat"],"sources":["createCacheKey.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/app/types\";\nimport { sha1 } from \"crypto-hash\";\n\nexport type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];\n\nconst createKey = (input: ICreateCacheKeyInput): string => {\n if (typeof input === \"string\") {\n return input;\n }\n return JSON.stringify(input);\n};\n\nexport const createCacheKey = (input: ICreateCacheKeyInput): Promise<string> => {\n const key = createKey(input);\n\n return sha1(key, {\n outputFormat: \"hex\"\n });\n};\n"],"mappings":"AACA,SAASA,IAAI,QAAQ,aAAa;AAIlC,MAAMC,SAAS,GAAIC,KAA2B,IAAa;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAED,OAAO,MAAMG,cAAc,GAAIH,KAA2B,IAAsB;EAC5E,MAAMI,GAAG,GAAGL,SAAS,CAACC,KAAK,CAAC;EAE5B,OAAOF,IAAI,CAACM,GAAG,EAAE;IACbC,YAAY,EAAE;EAClB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}