@webiny/app-record-locking 0.0.0-unstable.ac6ebf63c6 → 0.0.0-unstable.b6d7105cee

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 (269) hide show
  1. package/RecordLockingModule.d.ts +2 -0
  2. package/RecordLockingModule.js +74 -0
  3. package/RecordLockingModule.js.map +1 -0
  4. package/SecurityPermissions.d.ts +2 -0
  5. package/SecurityPermissions.js +15 -0
  6. package/SecurityPermissions.js.map +1 -0
  7. package/features/acquireLock/AcquireLockGateway.d.ts +12 -0
  8. package/features/acquireLock/AcquireLockGateway.js +43 -0
  9. package/features/acquireLock/AcquireLockGateway.js.map +1 -0
  10. package/features/acquireLock/AcquireLockUseCase.d.ts +10 -0
  11. package/features/acquireLock/AcquireLockUseCase.js +18 -0
  12. package/features/acquireLock/AcquireLockUseCase.js.map +1 -0
  13. package/features/acquireLock/abstractions.d.ts +19 -0
  14. package/features/acquireLock/abstractions.js +6 -0
  15. package/features/acquireLock/abstractions.js.map +1 -0
  16. package/features/acquireLock/feature.d.ts +3 -0
  17. package/features/acquireLock/feature.js +19 -0
  18. package/features/acquireLock/feature.js.map +1 -0
  19. package/features/checkLockStatus/CheckLockStatusGateway.d.ts +12 -0
  20. package/features/checkLockStatus/CheckLockStatusGateway.js +43 -0
  21. package/features/checkLockStatus/CheckLockStatusGateway.js.map +1 -0
  22. package/features/checkLockStatus/CheckLockStatusUseCase.d.ts +10 -0
  23. package/features/checkLockStatus/CheckLockStatusUseCase.js +18 -0
  24. package/features/checkLockStatus/CheckLockStatusUseCase.js.map +1 -0
  25. package/features/checkLockStatus/abstractions.d.ts +19 -0
  26. package/features/checkLockStatus/abstractions.js +6 -0
  27. package/features/checkLockStatus/abstractions.js.map +1 -0
  28. package/features/checkLockStatus/feature.d.ts +3 -0
  29. package/features/checkLockStatus/feature.js +19 -0
  30. package/features/checkLockStatus/feature.js.map +1 -0
  31. package/features/feature.d.ts +1 -0
  32. package/features/feature.js +19 -0
  33. package/features/feature.js.map +1 -0
  34. package/features/forceUnlock/ForceUnlockGateway.d.ts +12 -0
  35. package/features/forceUnlock/ForceUnlockGateway.js +44 -0
  36. package/features/forceUnlock/ForceUnlockGateway.js.map +1 -0
  37. package/features/forceUnlock/ForceUnlockUseCase.d.ts +10 -0
  38. package/features/forceUnlock/ForceUnlockUseCase.js +18 -0
  39. package/features/forceUnlock/ForceUnlockUseCase.js.map +1 -0
  40. package/features/forceUnlock/abstractions.d.ts +19 -0
  41. package/features/forceUnlock/abstractions.js +6 -0
  42. package/features/forceUnlock/abstractions.js.map +1 -0
  43. package/features/forceUnlock/feature.d.ts +3 -0
  44. package/features/forceUnlock/feature.js +19 -0
  45. package/features/forceUnlock/feature.js.map +1 -0
  46. package/{domain/graphql/fields.js → features/graphqlFields.js} +4 -3
  47. package/features/graphqlFields.js.map +1 -0
  48. package/features/listLockRecords/ListLockRecordsGateway.d.ts +12 -0
  49. package/features/listLockRecords/ListLockRecordsGateway.js +48 -0
  50. package/features/listLockRecords/ListLockRecordsGateway.js.map +1 -0
  51. package/features/listLockRecords/ListLockRecordsUseCase.d.ts +10 -0
  52. package/features/listLockRecords/ListLockRecordsUseCase.js +18 -0
  53. package/features/listLockRecords/ListLockRecordsUseCase.js.map +1 -0
  54. package/features/listLockRecords/abstractions.d.ts +22 -0
  55. package/features/listLockRecords/abstractions.js +6 -0
  56. package/features/listLockRecords/abstractions.js.map +1 -0
  57. package/features/listLockRecords/feature.d.ts +3 -0
  58. package/features/listLockRecords/feature.js +19 -0
  59. package/features/listLockRecords/feature.js.map +1 -0
  60. package/features/permissions/abstractions.d.ts +17 -0
  61. package/features/permissions/abstractions.js +6 -0
  62. package/features/permissions/abstractions.js.map +1 -0
  63. package/features/permissions/feature.d.ts +14 -0
  64. package/features/permissions/feature.js +7 -0
  65. package/features/permissions/feature.js.map +1 -0
  66. package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
  67. package/features/releaseLock/ReleaseLockGateway.js +44 -0
  68. package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
  69. package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
  70. package/features/releaseLock/ReleaseLockUseCase.js +18 -0
  71. package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
  72. package/features/releaseLock/abstractions.d.ts +19 -0
  73. package/features/releaseLock/abstractions.js +6 -0
  74. package/features/releaseLock/abstractions.js.map +1 -0
  75. package/features/releaseLock/feature.d.ts +3 -0
  76. package/features/releaseLock/feature.js +19 -0
  77. package/features/releaseLock/feature.js.map +1 -0
  78. package/index.d.ts +0 -5
  79. package/index.js +21 -26
  80. package/index.js.map +1 -1
  81. package/package.json +24 -25
  82. package/permissions/permissionsSchema.d.ts +6 -0
  83. package/permissions/permissionsSchema.js +10 -0
  84. package/permissions/permissionsSchema.js.map +1 -0
  85. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.d.ts +22 -0
  86. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js +61 -0
  87. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js.map +1 -0
  88. package/presentation/entryLocking/RecordLockingPresenter.d.ts +32 -0
  89. package/presentation/entryLocking/RecordLockingPresenter.js +164 -0
  90. package/presentation/entryLocking/RecordLockingPresenter.js.map +1 -0
  91. package/presentation/entryLocking/SingleEntryContentDecorator.d.ts +2 -0
  92. package/presentation/entryLocking/SingleEntryContentDecorator.js +72 -0
  93. package/presentation/entryLocking/SingleEntryContentDecorator.js.map +1 -0
  94. package/presentation/entryLocking/SingleEntryPresenterDecorator.d.ts +15 -0
  95. package/presentation/entryLocking/SingleEntryPresenterDecorator.js +40 -0
  96. package/presentation/entryLocking/SingleEntryPresenterDecorator.js.map +1 -0
  97. package/presentation/entryLocking/abstractions.d.ts +26 -0
  98. package/presentation/entryLocking/abstractions.js +5 -0
  99. package/presentation/entryLocking/abstractions.js.map +1 -0
  100. package/presentation/entryLocking/components/ForceUnlockButton.d.ts +11 -0
  101. package/presentation/entryLocking/components/ForceUnlockButton.js +37 -0
  102. package/presentation/entryLocking/components/ForceUnlockButton.js.map +1 -0
  103. package/presentation/entryLocking/components/LockedEntryOverlay.d.ts +10 -0
  104. package/presentation/entryLocking/components/LockedEntryOverlay.js +52 -0
  105. package/presentation/entryLocking/components/LockedEntryOverlay.js.map +1 -0
  106. package/presentation/entryLocking/components/RecordLockingGuard.d.ts +12 -0
  107. package/presentation/entryLocking/components/RecordLockingGuard.js +74 -0
  108. package/presentation/entryLocking/components/RecordLockingGuard.js.map +1 -0
  109. package/presentation/entryLocking/feature.d.ts +3 -0
  110. package/presentation/entryLocking/feature.js +21 -0
  111. package/presentation/entryLocking/feature.js.map +1 -0
  112. package/presentation/listLocking/ContentEntriesPresenterDecorator.d.ts +24 -0
  113. package/presentation/listLocking/ContentEntriesPresenterDecorator.js +67 -0
  114. package/presentation/listLocking/ContentEntriesPresenterDecorator.js.map +1 -0
  115. package/presentation/listLocking/ListLockRecordsPresenter.d.ts +17 -0
  116. package/presentation/listLocking/ListLockRecordsPresenter.js +52 -0
  117. package/presentation/listLocking/ListLockRecordsPresenter.js.map +1 -0
  118. package/presentation/listLocking/abstractions.d.ts +16 -0
  119. package/presentation/listLocking/abstractions.js +5 -0
  120. package/presentation/listLocking/abstractions.js.map +1 -0
  121. package/presentation/listLocking/components/ListLockRecordsSync.d.ts +3 -0
  122. package/presentation/listLocking/components/ListLockRecordsSync.js +26 -0
  123. package/presentation/listLocking/components/ListLockRecordsSync.js.map +1 -0
  124. package/presentation/listLocking/components/LockIndicatorCell.d.ts +2 -0
  125. package/presentation/listLocking/components/LockIndicatorCell.js +39 -0
  126. package/presentation/listLocking/components/LockIndicatorCell.js.map +1 -0
  127. package/presentation/listLocking/feature.d.ts +3 -0
  128. package/presentation/listLocking/feature.js +19 -0
  129. package/presentation/listLocking/feature.js.map +1 -0
  130. package/types.d.ts +2 -63
  131. package/types.js +0 -3
  132. package/components/HeadlessCmsActionsAcoCell.d.ts +0 -2
  133. package/components/HeadlessCmsActionsAcoCell.js +0 -60
  134. package/components/HeadlessCmsActionsAcoCell.js.map +0 -1
  135. package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +0 -9
  136. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +0 -42
  137. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +0 -1
  138. package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +0 -18
  139. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +0 -106
  140. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +0 -1
  141. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.d.ts +0 -2
  142. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +0 -89
  143. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +0 -1
  144. package/components/HeadlessCmsContentEntry/index.d.ts +0 -1
  145. package/components/HeadlessCmsContentEntry/index.js +0 -3
  146. package/components/HeadlessCmsContentEntry/index.js.map +0 -1
  147. package/components/LockedRecord/LockedRecord.d.ts +0 -6
  148. package/components/LockedRecord/LockedRecord.js +0 -66
  149. package/components/LockedRecord/LockedRecord.js.map +0 -1
  150. package/components/LockedRecord/LockedRecordForceUnlock.d.ts +0 -9
  151. package/components/LockedRecord/LockedRecordForceUnlock.js +0 -71
  152. package/components/LockedRecord/LockedRecordForceUnlock.js.map +0 -1
  153. package/components/LockedRecord/index.d.ts +0 -1
  154. package/components/LockedRecord/index.js +0 -3
  155. package/components/LockedRecord/index.js.map +0 -1
  156. package/components/RecordLockingProvider.d.ts +0 -7
  157. package/components/RecordLockingProvider.js +0 -125
  158. package/components/RecordLockingProvider.js.map +0 -1
  159. package/components/decorators/UseContentEntriesListHookDecorator.d.ts +0 -1
  160. package/components/decorators/UseContentEntriesListHookDecorator.js +0 -23
  161. package/components/decorators/UseContentEntriesListHookDecorator.js.map +0 -1
  162. package/components/decorators/UseRecordsDecorator.d.ts +0 -8
  163. package/components/decorators/UseRecordsDecorator.js +0 -25
  164. package/components/decorators/UseRecordsDecorator.js.map +0 -1
  165. package/components/decorators/UseSaveEntryDecorator.d.ts +0 -1
  166. package/components/decorators/UseSaveEntryDecorator.js +0 -55
  167. package/components/decorators/UseSaveEntryDecorator.js.map +0 -1
  168. package/components/permissionRenderer/RecordLockingPermissions.d.ts +0 -7
  169. package/components/permissionRenderer/RecordLockingPermissions.js +0 -71
  170. package/components/permissionRenderer/RecordLockingPermissions.js.map +0 -1
  171. package/components/permissionRenderer/index.d.ts +0 -2
  172. package/components/permissionRenderer/index.js +0 -21
  173. package/components/permissionRenderer/index.js.map +0 -1
  174. package/domain/RecordLocking.d.ts +0 -28
  175. package/domain/RecordLocking.js +0 -321
  176. package/domain/RecordLocking.js.map +0 -1
  177. package/domain/RecordLockingClient.d.ts +0 -12
  178. package/domain/RecordLockingClient.js +0 -19
  179. package/domain/RecordLockingClient.js.map +0 -1
  180. package/domain/RecordLockingGetLockRecord.d.ts +0 -11
  181. package/domain/RecordLockingGetLockRecord.js +0 -21
  182. package/domain/RecordLockingGetLockRecord.js.map +0 -1
  183. package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +0 -11
  184. package/domain/RecordLockingGetLockedEntryLockRecord.js +0 -19
  185. package/domain/RecordLockingGetLockedEntryLockRecord.js.map +0 -1
  186. package/domain/RecordLockingIsEntryLocked.d.ts +0 -11
  187. package/domain/RecordLockingIsEntryLocked.js +0 -19
  188. package/domain/RecordLockingIsEntryLocked.js.map +0 -1
  189. package/domain/RecordLockingListLockRecords.d.ts +0 -12
  190. package/domain/RecordLockingListLockRecords.js +0 -31
  191. package/domain/RecordLockingListLockRecords.js.map +0 -1
  192. package/domain/RecordLockingLockEntry.d.ts +0 -11
  193. package/domain/RecordLockingLockEntry.js +0 -13
  194. package/domain/RecordLockingLockEntry.js.map +0 -1
  195. package/domain/RecordLockingUnlockEntry.d.ts +0 -11
  196. package/domain/RecordLockingUnlockEntry.js +0 -19
  197. package/domain/RecordLockingUnlockEntry.js.map +0 -1
  198. package/domain/RecordLockingUpdateEntryLock.d.ts +0 -11
  199. package/domain/RecordLockingUpdateEntryLock.js +0 -19
  200. package/domain/RecordLockingUpdateEntryLock.js.map +0 -1
  201. package/domain/abstractions/IRecordLocking.d.ts +0 -25
  202. package/domain/abstractions/IRecordLocking.js +0 -3
  203. package/domain/abstractions/IRecordLocking.js.map +0 -1
  204. package/domain/abstractions/IRecordLockingClient.d.ts +0 -6
  205. package/domain/abstractions/IRecordLockingClient.js +0 -3
  206. package/domain/abstractions/IRecordLockingClient.js.map +0 -1
  207. package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +0 -12
  208. package/domain/abstractions/IRecordLockingGetLockRecord.js +0 -3
  209. package/domain/abstractions/IRecordLockingGetLockRecord.js.map +0 -1
  210. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +0 -12
  211. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +0 -3
  212. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js.map +0 -1
  213. package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +0 -8
  214. package/domain/abstractions/IRecordLockingIsEntryLocked.js +0 -3
  215. package/domain/abstractions/IRecordLockingIsEntryLocked.js.map +0 -1
  216. package/domain/abstractions/IRecordLockingListLockRecords.d.ts +0 -19
  217. package/domain/abstractions/IRecordLockingListLockRecords.js +0 -3
  218. package/domain/abstractions/IRecordLockingListLockRecords.js.map +0 -1
  219. package/domain/abstractions/IRecordLockingLockEntry.d.ts +0 -12
  220. package/domain/abstractions/IRecordLockingLockEntry.js +0 -3
  221. package/domain/abstractions/IRecordLockingLockEntry.js.map +0 -1
  222. package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +0 -13
  223. package/domain/abstractions/IRecordLockingUnlockEntry.js +0 -3
  224. package/domain/abstractions/IRecordLockingUnlockEntry.js.map +0 -1
  225. package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +0 -12
  226. package/domain/abstractions/IRecordLockingUpdateEntryLock.js +0 -3
  227. package/domain/abstractions/IRecordLockingUpdateEntryLock.js.map +0 -1
  228. package/domain/graphql/fields.js.map +0 -1
  229. package/domain/graphql/getLockRecord.d.ts +0 -12
  230. package/domain/graphql/getLockRecord.js +0 -18
  231. package/domain/graphql/getLockRecord.js.map +0 -1
  232. package/domain/graphql/getLockedEntryLockRecord.d.ts +0 -12
  233. package/domain/graphql/getLockedEntryLockRecord.js +0 -18
  234. package/domain/graphql/getLockedEntryLockRecord.js.map +0 -1
  235. package/domain/graphql/isEntryLocked.d.ts +0 -12
  236. package/domain/graphql/isEntryLocked.js +0 -16
  237. package/domain/graphql/isEntryLocked.js.map +0 -1
  238. package/domain/graphql/listLockRecords.d.ts +0 -17
  239. package/domain/graphql/listLockRecords.js +0 -26
  240. package/domain/graphql/listLockRecords.js.map +0 -1
  241. package/domain/graphql/lockEntry.d.ts +0 -12
  242. package/domain/graphql/lockEntry.js +0 -20
  243. package/domain/graphql/lockEntry.js.map +0 -1
  244. package/domain/graphql/unlockEntry.d.ts +0 -12
  245. package/domain/graphql/unlockEntry.js +0 -18
  246. package/domain/graphql/unlockEntry.js.map +0 -1
  247. package/domain/graphql/updateEntryLock.d.ts +0 -12
  248. package/domain/graphql/updateEntryLock.js +0 -18
  249. package/domain/graphql/updateEntryLock.js.map +0 -1
  250. package/domain/utils/createRecordLockingClient.d.ts +0 -3
  251. package/domain/utils/createRecordLockingClient.js +0 -12
  252. package/domain/utils/createRecordLockingClient.js.map +0 -1
  253. package/domain/utils/createRecordLockingError.d.ts +0 -6
  254. package/domain/utils/createRecordLockingError.js +0 -16
  255. package/domain/utils/createRecordLockingError.js.map +0 -1
  256. package/hooks/index.d.ts +0 -2
  257. package/hooks/index.js +0 -4
  258. package/hooks/index.js.map +0 -1
  259. package/hooks/usePermission.d.ts +0 -3
  260. package/hooks/usePermission.js +0 -20
  261. package/hooks/usePermission.js.map +0 -1
  262. package/hooks/useRecordLocking.d.ts +0 -2
  263. package/hooks/useRecordLocking.js +0 -12
  264. package/hooks/useRecordLocking.js.map +0 -1
  265. package/types.js.map +0 -1
  266. package/utils/createCacheKey.d.ts +0 -3
  267. package/utils/createCacheKey.js +0 -15
  268. package/utils/createCacheKey.js.map +0 -1
  269. /package/{domain/graphql/fields.d.ts → features/graphqlFields.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const RecordLockingModule: () => React.JSX.Element;
@@ -0,0 +1,74 @@
1
+ import react from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { useContainer, useRouter } from "@webiny/app";
4
+ import { useWebsockets } from "@webiny/app-websockets";
5
+ import { useDialogs } from "@webiny/app-admin";
6
+ import { OverlayLoader } from "@webiny/admin-ui";
7
+ import { parseIdentifier } from "@webiny/utils";
8
+ import { ContentEntryFormContent } from "@webiny/app-headless-cms/presentation/contentEntries/views/layout/index.js";
9
+ import { RecordLockingPresenter } from "./presentation/entryLocking/abstractions.js";
10
+ import { LockedEntryOverlay } from "./presentation/entryLocking/components/LockedEntryOverlay.js";
11
+ import { RecordLockingCellActionsDecorator } from "./presentation/listLocking/components/LockIndicatorCell.js";
12
+ import { SingleEntryContentDecorator } from "./presentation/entryLocking/SingleEntryContentDecorator.js";
13
+ import { useContentEntryFormPresenter } from "@webiny/app-headless-cms/presentation/contentEntries/form/useContentEntryFormPresenter.js";
14
+ const ContentDecorator = ContentEntryFormContent.createDecorator((Original)=>observer(function(props) {
15
+ const container = useContainer();
16
+ const formPresenter = useContentEntryFormPresenter();
17
+ const websockets = useWebsockets();
18
+ const router = useRouter();
19
+ const { showDialog } = useDialogs();
20
+ const presenter = react.useMemo(()=>container.resolve(RecordLockingPresenter), [
21
+ container
22
+ ]);
23
+ const entry = formPresenter.vm.entry;
24
+ const model = formPresenter.vm.model;
25
+ react.useEffect(()=>{
26
+ if (!entry?.id) return;
27
+ presenter.init(entry.id, model.modelId);
28
+ return ()=>presenter.dispose();
29
+ }, [
30
+ entry?.id,
31
+ model.modelId
32
+ ]);
33
+ react.useEffect(()=>{
34
+ if (!entry?.id) return;
35
+ const { id } = parseIdentifier(entry.id);
36
+ const sub = websockets.onMessage(`recordLocking.entry.kickOut.${id}`, (incoming)=>presenter.handleKickOut(incoming.data));
37
+ return ()=>{
38
+ sub.off();
39
+ };
40
+ }, [
41
+ entry?.id,
42
+ model.modelId
43
+ ]);
44
+ react.useEffect(()=>{
45
+ if ("kicked-out" !== presenter.vm.status) return;
46
+ router.unblockTransition();
47
+ showDialog({
48
+ title: "Entry was forcefully unlocked!",
49
+ content: /*#__PURE__*/ react.createElement(react.Fragment, null, "The entry you were editing was forcefully unlocked by", " ", /*#__PURE__*/ react.createElement("strong", null, presenter.vm.lockRecord?.lockedBy?.displayName || "Unknown user"), ". Unfortunately, this means you lost the unsaved changes."),
50
+ acceptLabel: "Ok",
51
+ onClose: void 0,
52
+ cancelLabel: null
53
+ });
54
+ }, [
55
+ presenter.vm.status
56
+ ]);
57
+ if (!entry?.id) return /*#__PURE__*/ react.createElement(Original, props);
58
+ if ("checking" === presenter.vm.status) return /*#__PURE__*/ react.createElement("div", {
59
+ className: "h-screen w-screen fixed top-0 left-0 z-20"
60
+ }, /*#__PURE__*/ react.createElement(OverlayLoader, {
61
+ text: "Checking record status..."
62
+ }));
63
+ if ("locked" === presenter.vm.status) return /*#__PURE__*/ react.createElement(LockedEntryOverlay, {
64
+ vm: presenter.vm,
65
+ entryTitle: entry.meta?.title,
66
+ onForceUnlock: ()=>presenter.forceUnlock(),
67
+ onNavigateBack: ()=>router.goBack()
68
+ });
69
+ return /*#__PURE__*/ react.createElement(Original, props);
70
+ }));
71
+ const RecordLockingModule = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(ContentDecorator, null), /*#__PURE__*/ react.createElement(SingleEntryContentDecorator, null), /*#__PURE__*/ react.createElement(RecordLockingCellActionsDecorator, null));
72
+ export { RecordLockingModule };
73
+
74
+ //# sourceMappingURL=RecordLockingModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordLockingModule.js","sources":["../src/RecordLockingModule.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useContainer, useRouter } from \"@webiny/app\";\nimport { useWebsockets } from \"@webiny/app-websockets\";\nimport { useDialogs } from \"@webiny/app-admin\";\nimport { OverlayLoader } from \"@webiny/admin-ui\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { ContentEntryFormContent } from \"@webiny/app-headless-cms/presentation/contentEntries/views/layout/index.js\";\nimport { RecordLockingPresenter } from \"~/presentation/entryLocking/abstractions.js\";\nimport { LockedEntryOverlay } from \"~/presentation/entryLocking/components/LockedEntryOverlay.js\";\nimport { RecordLockingCellActionsDecorator } from \"~/presentation/listLocking/components/LockIndicatorCell.js\";\nimport { SingleEntryContentDecorator } from \"~/presentation/entryLocking/SingleEntryContentDecorator.js\";\nimport { useContentEntryFormPresenter } from \"@webiny/app-headless-cms/presentation/contentEntries/form/useContentEntryFormPresenter.js\";\nimport type { IKickOutData } from \"~/presentation/entryLocking/abstractions.js\";\nimport type { IncomingGenericData } from \"@webiny/app-websockets\";\n\ninterface KickOutMessage extends IncomingGenericData {\n data: IKickOutData;\n}\n\nconst ContentDecorator = ContentEntryFormContent.createDecorator(Original => {\n return observer(function RecordLockingContent(props) {\n const container = useContainer();\n const formPresenter = useContentEntryFormPresenter();\n const websockets = useWebsockets();\n const router = useRouter();\n const { showDialog } = useDialogs();\n\n const presenter = React.useMemo(\n () => container.resolve(RecordLockingPresenter),\n [container]\n );\n\n const entry = formPresenter.vm.entry;\n const model = formPresenter.vm.model;\n\n React.useEffect(() => {\n if (!entry?.id) {\n return;\n }\n presenter.init(entry.id, model.modelId);\n return () => presenter.dispose();\n }, [entry?.id, model.modelId]);\n\n React.useEffect(() => {\n if (!entry?.id) {\n return;\n }\n const { id } = parseIdentifier(entry.id);\n const sub = websockets.onMessage<KickOutMessage>(\n `recordLocking.entry.kickOut.${id}`,\n incoming => presenter.handleKickOut(incoming.data)\n );\n return () => {\n sub.off();\n };\n }, [entry?.id, model.modelId]);\n\n React.useEffect(() => {\n if (presenter.vm.status !== \"kicked-out\") {\n return;\n }\n\n router.unblockTransition();\n showDialog({\n title: \"Entry was forcefully unlocked!\",\n content: (\n <>\n The entry you were editing was forcefully unlocked by{\" \"}\n <strong>\n {presenter.vm.lockRecord?.lockedBy?.displayName || \"Unknown user\"}\n </strong>\n . Unfortunately, this means you lost the unsaved changes.\n </>\n ),\n acceptLabel: \"Ok\",\n onClose: undefined,\n cancelLabel: null\n });\n }, [presenter.vm.status]);\n\n if (!entry?.id) {\n return <Original {...props} />;\n }\n\n if (presenter.vm.status === \"checking\") {\n return (\n <div className={\"h-screen w-screen fixed top-0 left-0 z-20\"}>\n <OverlayLoader text={\"Checking record status...\"} />\n </div>\n );\n }\n\n if (presenter.vm.status === \"locked\") {\n return (\n <LockedEntryOverlay\n vm={presenter.vm}\n entryTitle={entry.meta?.title}\n onForceUnlock={() => presenter.forceUnlock()}\n onNavigateBack={() => router.goBack()}\n />\n );\n }\n\n return <Original {...props} />;\n });\n});\n\nexport const RecordLockingModule = () => {\n return (\n <>\n <ContentDecorator />\n <SingleEntryContentDecorator />\n <RecordLockingCellActionsDecorator />\n </>\n );\n};\n"],"names":["ContentDecorator","ContentEntryFormContent","Original","observer","props","container","useContainer","formPresenter","useContentEntryFormPresenter","websockets","useWebsockets","router","useRouter","showDialog","useDialogs","presenter","React","RecordLockingPresenter","entry","model","id","parseIdentifier","sub","incoming","undefined","OverlayLoader","LockedEntryOverlay","RecordLockingModule","SingleEntryContentDecorator","RecordLockingCellActionsDecorator"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,mBAAmBC,wBAAwB,eAAe,CAACC,CAAAA,WACtDC,SAAS,SAA8BC,KAAK;QAC/C,MAAMC,YAAYC;QAClB,MAAMC,gBAAgBC;QACtB,MAAMC,aAAaC;QACnB,MAAMC,SAASC;QACf,MAAM,EAAEC,UAAU,EAAE,GAAGC;QAEvB,MAAMC,YAAYC,MAAAA,OAAa,CAC3B,IAAMX,UAAU,OAAO,CAACY,yBACxB;YAACZ;SAAU;QAGf,MAAMa,QAAQX,cAAc,EAAE,CAAC,KAAK;QACpC,MAAMY,QAAQZ,cAAc,EAAE,CAAC,KAAK;QAEpCS,MAAAA,SAAe,CAAC;YACZ,IAAI,CAACE,OAAO,IACR;YAEJH,UAAU,IAAI,CAACG,MAAM,EAAE,EAAEC,MAAM,OAAO;YACtC,OAAO,IAAMJ,UAAU,OAAO;QAClC,GAAG;YAACG,OAAO;YAAIC,MAAM,OAAO;SAAC;QAE7BH,MAAAA,SAAe,CAAC;YACZ,IAAI,CAACE,OAAO,IACR;YAEJ,MAAM,EAAEE,EAAE,EAAE,GAAGC,gBAAgBH,MAAM,EAAE;YACvC,MAAMI,MAAMb,WAAW,SAAS,CAC5B,CAAC,4BAA4B,EAAEW,IAAI,EACnCG,CAAAA,WAAYR,UAAU,aAAa,CAACQ,SAAS,IAAI;YAErD,OAAO;gBACHD,IAAI,GAAG;YACX;QACJ,GAAG;YAACJ,OAAO;YAAIC,MAAM,OAAO;SAAC;QAE7BH,MAAAA,SAAe,CAAC;YACZ,IAAID,AAAwB,iBAAxBA,UAAU,EAAE,CAAC,MAAM,EACnB;YAGJJ,OAAO,iBAAiB;YACxBE,WAAW;gBACP,OAAO;gBACP,SAAS,WAAT,GACI,0CAAE,yDACwD,mBACtD,oBAAC,gBACIE,UAAU,EAAE,CAAC,UAAU,EAAE,UAAU,eAAe,iBAC9C;gBAIjB,aAAa;gBACb,SAASS;gBACT,aAAa;YACjB;QACJ,GAAG;YAACT,UAAU,EAAE,CAAC,MAAM;SAAC;QAExB,IAAI,CAACG,OAAO,IACR,OAAO,WAAP,GAAO,oBAAChB,UAAaE;QAGzB,IAAIW,AAAwB,eAAxBA,UAAU,EAAE,CAAC,MAAM,EACnB,OAAO,WAAP,GACI,oBAAC;YAAI,WAAW;yBACZ,oBAACU,eAAaA;YAAC,MAAM;;QAKjC,IAAIV,AAAwB,aAAxBA,UAAU,EAAE,CAAC,MAAM,EACnB,OAAO,WAAP,GACI,oBAACW,oBAAkBA;YACf,IAAIX,UAAU,EAAE;YAChB,YAAYG,MAAM,IAAI,EAAE;YACxB,eAAe,IAAMH,UAAU,WAAW;YAC1C,gBAAgB,IAAMJ,OAAO,MAAM;;QAK/C,OAAO,WAAP,GAAO,oBAACT,UAAaE;IACzB;AAGG,MAAMuB,sBAAsB,IACxB,WAAP,GACI,wDACI,oBAAC3B,kBAAgBA,OAAAA,WAAAA,GACjB,oBAAC4B,6BAA2BA,OAAAA,WAAAA,GAC5B,oBAACC,mCAAiCA"}
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const SecurityPermissions: () => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import react from "react";
2
+ import { AdminConfig } from "@webiny/app-admin";
3
+ import { ReactComponent } from "@webiny/icons/lock.svg";
4
+ import { RECORD_LOCKING_PERMISSIONS_SCHEMA } from "./permissions/permissionsSchema.js";
5
+ const { Security: Security } = AdminConfig;
6
+ const SecurityPermissions = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Security.Permissions, {
7
+ name: "record-locking",
8
+ title: "Record Locking",
9
+ description: "Manage Record Locking permissions.",
10
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
11
+ schema: RECORD_LOCKING_PERMISSIONS_SCHEMA
12
+ }));
13
+ export { SecurityPermissions };
14
+
15
+ //# sourceMappingURL=SecurityPermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityPermissions.js","sources":["../src/SecurityPermissions.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { ReactComponent as LockIcon } from \"@webiny/icons/lock.svg\";\nimport { RECORD_LOCKING_PERMISSIONS_SCHEMA } from \"~/permissions/permissionsSchema.js\";\n\nconst { Security } = AdminConfig;\n\nexport const SecurityPermissions = () => {\n return (\n <AdminConfig>\n <Security.Permissions\n name=\"record-locking\"\n title=\"Record Locking\"\n description=\"Manage Record Locking permissions.\"\n icon={<LockIcon />}\n schema={RECORD_LOCKING_PERMISSIONS_SCHEMA}\n />\n </AdminConfig>\n );\n};\n"],"names":["Security","AdminConfig","SecurityPermissions","LockIcon","RECORD_LOCKING_PERMISSIONS_SCHEMA"],"mappings":";;;;AAKA,MAAM,EAAEA,UAAAA,QAAQ,EAAE,GAAGC;AAEd,MAAMC,sBAAsB,IACxB,WAAP,GACI,oBAACD,aAAWA,MAAAA,WAAAA,GACR,oBAACD,SAAS,WAAW;QACjB,MAAK;QACL,OAAM;QACN,aAAY;QACZ,oBAAM,oBAACG,gBAAQA;QACf,QAAQC"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { AcquireLockGateway as GatewayAbstraction, type IAcquireLockParams } from "./abstractions.js";
3
+ import type { IRecordLockingLockRecord } from "../../types.js";
4
+ declare class AcquireLockGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(params: IAcquireLockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const AcquireLockGateway: typeof AcquireLockGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IAcquireLockGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,43 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "../graphqlFields.js";
3
+ import { AcquireLockGateway } from "./abstractions.js";
4
+ const ACQUIRE_LOCK_MUTATION = `
5
+ mutation RecordLockingUpdateEntryLock($id: ID!, $type: String!) {
6
+ recordLocking {
7
+ updateEntryLock(id: $id, type: $type) {
8
+ data {
9
+ ${LOCK_RECORD_FIELDS}
10
+ }
11
+ error {
12
+ ${ERROR_FIELDS}
13
+ }
14
+ }
15
+ }
16
+ }
17
+ `;
18
+ class AcquireLockGatewayImpl {
19
+ constructor(client){
20
+ this.client = client;
21
+ }
22
+ async execute(params) {
23
+ const response = await this.client.execute({
24
+ query: ACQUIRE_LOCK_MUTATION,
25
+ variables: {
26
+ id: params.id,
27
+ type: params.type
28
+ }
29
+ });
30
+ const { data, error } = response.recordLocking.updateEntryLock;
31
+ if (!data) throw new Error(error?.message || "Failed to acquire lock");
32
+ return data;
33
+ }
34
+ }
35
+ const AcquireLockGateway_AcquireLockGateway = AcquireLockGateway.createImplementation({
36
+ implementation: AcquireLockGatewayImpl,
37
+ dependencies: [
38
+ MainGraphQLClient
39
+ ]
40
+ });
41
+ export { AcquireLockGateway_AcquireLockGateway as AcquireLockGateway };
42
+
43
+ //# sourceMappingURL=AcquireLockGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/acquireLock/AcquireLockGateway.js","sources":["../../../src/features/acquireLock/AcquireLockGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { LOCK_RECORD_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n AcquireLockGateway as GatewayAbstraction,\n type IAcquireLockParams\n} from \"./abstractions.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\n\ninterface AcquireLockResponse {\n recordLocking: {\n updateEntryLock: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nconst ACQUIRE_LOCK_MUTATION = /* GraphQL */ `\n mutation RecordLockingUpdateEntryLock($id: ID!, $type: String!) {\n recordLocking {\n updateEntryLock(id: $id, type: $type) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\nclass AcquireLockGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: IAcquireLockParams) {\n const response = await this.client.execute<AcquireLockResponse>({\n query: ACQUIRE_LOCK_MUTATION,\n variables: { id: params.id, type: params.type }\n });\n\n const { data, error } = response.recordLocking.updateEntryLock;\n\n if (!data) {\n throw new Error(error?.message || \"Failed to acquire lock\");\n }\n\n return data;\n }\n}\n\nexport const AcquireLockGateway = GatewayAbstraction.createImplementation({\n implementation: AcquireLockGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["ACQUIRE_LOCK_MUTATION","LOCK_RECORD_FIELDS","ERROR_FIELDS","AcquireLockGatewayImpl","client","params","response","data","error","Error","AcquireLockGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAiBA,MAAMA,wBAAsC,CAAC;;;;;oBAKzB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAED,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA0B,EAAE;QACtC,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB;YAC5D,OAAON;YACP,WAAW;gBAAE,IAAIK,OAAO,EAAE;gBAAE,MAAMA,OAAO,IAAI;YAAC;QAClD;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,aAAa,CAAC,eAAe;QAE9D,IAAI,CAACC,MACD,MAAM,IAAIE,MAAMD,OAAO,WAAW;QAGtC,OAAOD;IACX;AACJ;AAEO,MAAMG,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { AcquireLockUseCase as UseCaseAbstraction, AcquireLockGateway, type IAcquireLockParams } from "./abstractions.js";
2
+ declare class AcquireLockUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private gateway;
4
+ constructor(gateway: AcquireLockGateway.Interface);
5
+ execute(params: IAcquireLockParams): Promise<import("../../types.js").IRecordLockingLockRecord>;
6
+ }
7
+ export declare const AcquireLockUseCase: typeof AcquireLockUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IAcquireLockUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { AcquireLockGateway, AcquireLockUseCase } from "./abstractions.js";
2
+ class AcquireLockUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ return this.gateway.execute(params);
8
+ }
9
+ }
10
+ const AcquireLockUseCase_AcquireLockUseCase = AcquireLockUseCase.createImplementation({
11
+ implementation: AcquireLockUseCaseImpl,
12
+ dependencies: [
13
+ AcquireLockGateway
14
+ ]
15
+ });
16
+ export { AcquireLockUseCase_AcquireLockUseCase as AcquireLockUseCase };
17
+
18
+ //# sourceMappingURL=AcquireLockUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/acquireLock/AcquireLockUseCase.js","sources":["../../../src/features/acquireLock/AcquireLockUseCase.ts"],"sourcesContent":["import {\n AcquireLockUseCase as UseCaseAbstraction,\n AcquireLockGateway,\n type IAcquireLockParams\n} from \"./abstractions.js\";\n\nclass AcquireLockUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: AcquireLockGateway.Interface) {}\n\n async execute(params: IAcquireLockParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const AcquireLockUseCase = UseCaseAbstraction.createImplementation({\n implementation: AcquireLockUseCaseImpl,\n dependencies: [AcquireLockGateway]\n});\n"],"names":["AcquireLockUseCaseImpl","gateway","params","AcquireLockUseCase","UseCaseAbstraction","AcquireLockGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAqC,CAAE;aAAvCA,OAAO,GAAPA;IAAwC;IAE5D,MAAM,QAAQC,MAA0B,EAAE;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
@@ -0,0 +1,19 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface IAcquireLockParams {
3
+ id: string;
4
+ type: string;
5
+ }
6
+ export interface IAcquireLockGateway {
7
+ execute(params: IAcquireLockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const AcquireLockGateway: import("@webiny/di").Abstraction<IAcquireLockGateway>;
10
+ export declare namespace AcquireLockGateway {
11
+ type Interface = IAcquireLockGateway;
12
+ }
13
+ export interface IAcquireLockUseCase {
14
+ execute(params: IAcquireLockParams): Promise<IRecordLockingLockRecord>;
15
+ }
16
+ export declare const AcquireLockUseCase: import("@webiny/di").Abstraction<IAcquireLockUseCase>;
17
+ export declare namespace AcquireLockUseCase {
18
+ type Interface = IAcquireLockUseCase;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const AcquireLockGateway = createAbstraction("AcquireLockGateway");
3
+ const AcquireLockUseCase = createAbstraction("AcquireLockUseCase");
4
+ export { AcquireLockGateway, AcquireLockUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/acquireLock/abstractions.js","sources":["../../../src/features/acquireLock/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IRecordLockingLockRecord } from \"~/types.js\";\n\nexport interface IAcquireLockParams {\n id: string;\n type: string;\n}\n\nexport interface IAcquireLockGateway {\n execute(params: IAcquireLockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const AcquireLockGateway = createAbstraction<IAcquireLockGateway>(\"AcquireLockGateway\");\n\nexport namespace AcquireLockGateway {\n export type Interface = IAcquireLockGateway;\n}\n\nexport interface IAcquireLockUseCase {\n execute(params: IAcquireLockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const AcquireLockUseCase = createAbstraction<IAcquireLockUseCase>(\"AcquireLockUseCase\");\n\nexport namespace AcquireLockUseCase {\n export type Interface = IAcquireLockUseCase;\n}\n"],"names":["AcquireLockGateway","createAbstraction","AcquireLockUseCase"],"mappings":";AAYO,MAAMA,qBAAqBC,kBAAuC;AAUlE,MAAMC,qBAAqBD,kBAAuC"}
@@ -0,0 +1,3 @@
1
+ export declare const AcquireLockFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").IAcquireLockUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { AcquireLockUseCase } from "./abstractions.js";
3
+ import { AcquireLockUseCase as external_AcquireLockUseCase_js_AcquireLockUseCase } from "./AcquireLockUseCase.js";
4
+ import { AcquireLockGateway } from "./AcquireLockGateway.js";
5
+ const AcquireLockFeature = createFeature({
6
+ name: "RecordLocking/AcquireLock",
7
+ register (container) {
8
+ container.register(external_AcquireLockUseCase_js_AcquireLockUseCase);
9
+ container.register(AcquireLockGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(AcquireLockUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { AcquireLockFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/acquireLock/feature.js","sources":["../../../src/features/acquireLock/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { AcquireLockUseCase as UseCase } from \"./abstractions.js\";\nimport { AcquireLockUseCase } from \"./AcquireLockUseCase.js\";\nimport { AcquireLockGateway } from \"./AcquireLockGateway.js\";\n\nexport const AcquireLockFeature = createFeature({\n name: \"RecordLocking/AcquireLock\",\n register(container) {\n container.register(AcquireLockUseCase);\n container.register(AcquireLockGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCase)\n };\n }\n});\n"],"names":["AcquireLockFeature","createFeature","container","AcquireLockUseCase","AcquireLockGateway","UseCase"],"mappings":";;;;AAKO,MAAMA,qBAAqBC,cAAc;IAC5C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,oBAAoB,gBAAgB;IAC3D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { CheckLockStatusGateway as GatewayAbstraction, type ICheckLockStatusParams } from "./abstractions.js";
3
+ import type { IRecordLockingLockRecord } from "../../types.js";
4
+ declare class CheckLockStatusGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(params: ICheckLockStatusParams): Promise<IRecordLockingLockRecord | null>;
8
+ }
9
+ export declare const CheckLockStatusGateway: typeof CheckLockStatusGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICheckLockStatusGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,43 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "../graphqlFields.js";
3
+ import { CheckLockStatusGateway } from "./abstractions.js";
4
+ const CHECK_LOCK_STATUS_QUERY = `
5
+ query RecordLockingGetLockedEntryLockRecord($id: ID!, $type: String!) {
6
+ recordLocking {
7
+ getLockedEntryLockRecord(id: $id, type: $type) {
8
+ data {
9
+ ${LOCK_RECORD_FIELDS}
10
+ }
11
+ error {
12
+ ${ERROR_FIELDS}
13
+ }
14
+ }
15
+ }
16
+ }
17
+ `;
18
+ class CheckLockStatusGatewayImpl {
19
+ constructor(client){
20
+ this.client = client;
21
+ }
22
+ async execute(params) {
23
+ const response = await this.client.execute({
24
+ query: CHECK_LOCK_STATUS_QUERY,
25
+ variables: {
26
+ id: params.id,
27
+ type: params.type
28
+ }
29
+ });
30
+ const { data, error } = response.recordLocking.getLockedEntryLockRecord;
31
+ if (error) throw new Error(error.message);
32
+ return data;
33
+ }
34
+ }
35
+ const CheckLockStatusGateway_CheckLockStatusGateway = CheckLockStatusGateway.createImplementation({
36
+ implementation: CheckLockStatusGatewayImpl,
37
+ dependencies: [
38
+ MainGraphQLClient
39
+ ]
40
+ });
41
+ export { CheckLockStatusGateway_CheckLockStatusGateway as CheckLockStatusGateway };
42
+
43
+ //# sourceMappingURL=CheckLockStatusGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/checkLockStatus/CheckLockStatusGateway.js","sources":["../../../src/features/checkLockStatus/CheckLockStatusGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { LOCK_RECORD_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n CheckLockStatusGateway as GatewayAbstraction,\n type ICheckLockStatusParams\n} from \"./abstractions.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\n\ninterface CheckLockStatusResponse {\n recordLocking: {\n getLockedEntryLockRecord: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nconst CHECK_LOCK_STATUS_QUERY = /* GraphQL */ `\n query RecordLockingGetLockedEntryLockRecord($id: ID!, $type: String!) {\n recordLocking {\n getLockedEntryLockRecord(id: $id, type: $type) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\nclass CheckLockStatusGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: ICheckLockStatusParams) {\n const response = await this.client.execute<CheckLockStatusResponse>({\n query: CHECK_LOCK_STATUS_QUERY,\n variables: { id: params.id, type: params.type }\n });\n\n const { data, error } = response.recordLocking.getLockedEntryLockRecord;\n\n if (error) {\n throw new Error(error.message);\n }\n\n return data;\n }\n}\n\nexport const CheckLockStatusGateway = GatewayAbstraction.createImplementation({\n implementation: CheckLockStatusGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["CHECK_LOCK_STATUS_QUERY","LOCK_RECORD_FIELDS","ERROR_FIELDS","CheckLockStatusGatewayImpl","client","params","response","data","error","Error","CheckLockStatusGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAiBA,MAAMA,0BAAwC,CAAC;;;;;oBAK3B,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAED,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA8B,EAAE;QAC1C,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0B;YAChE,OAAON;YACP,WAAW;gBAAE,IAAIK,OAAO,EAAE;gBAAE,MAAMA,OAAO,IAAI;YAAC;QAClD;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,aAAa,CAAC,wBAAwB;QAEvE,IAAIE,OACA,MAAM,IAAIC,MAAMD,MAAM,OAAO;QAGjC,OAAOD;IACX;AACJ;AAEO,MAAMG,gDAAyBC,uBAAAA,oBAAuC,CAAC;IAC1E,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { CheckLockStatusUseCase as UseCaseAbstraction, CheckLockStatusGateway, type ICheckLockStatusParams } from "./abstractions.js";
2
+ declare class CheckLockStatusUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private gateway;
4
+ constructor(gateway: CheckLockStatusGateway.Interface);
5
+ execute(params: ICheckLockStatusParams): Promise<import("../../types.js").IRecordLockingLockRecord | null>;
6
+ }
7
+ export declare const CheckLockStatusUseCase: typeof CheckLockStatusUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICheckLockStatusUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { CheckLockStatusGateway, CheckLockStatusUseCase } from "./abstractions.js";
2
+ class CheckLockStatusUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ return this.gateway.execute(params);
8
+ }
9
+ }
10
+ const CheckLockStatusUseCase_CheckLockStatusUseCase = CheckLockStatusUseCase.createImplementation({
11
+ implementation: CheckLockStatusUseCaseImpl,
12
+ dependencies: [
13
+ CheckLockStatusGateway
14
+ ]
15
+ });
16
+ export { CheckLockStatusUseCase_CheckLockStatusUseCase as CheckLockStatusUseCase };
17
+
18
+ //# sourceMappingURL=CheckLockStatusUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/checkLockStatus/CheckLockStatusUseCase.js","sources":["../../../src/features/checkLockStatus/CheckLockStatusUseCase.ts"],"sourcesContent":["import {\n CheckLockStatusUseCase as UseCaseAbstraction,\n CheckLockStatusGateway,\n type ICheckLockStatusParams\n} from \"./abstractions.js\";\n\nclass CheckLockStatusUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: CheckLockStatusGateway.Interface) {}\n\n async execute(params: ICheckLockStatusParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const CheckLockStatusUseCase = UseCaseAbstraction.createImplementation({\n implementation: CheckLockStatusUseCaseImpl,\n dependencies: [CheckLockStatusGateway]\n});\n"],"names":["CheckLockStatusUseCaseImpl","gateway","params","CheckLockStatusUseCase","UseCaseAbstraction","CheckLockStatusGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAyC,CAAE;aAA3CA,OAAO,GAAPA;IAA4C;IAEhE,MAAM,QAAQC,MAA8B,EAAE;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,gDAAyBC,uBAAAA,oBAAuC,CAAC;IAC1E,gBAAgBJ;IAChB,cAAc;QAACK;KAAuB;AAC1C"}
@@ -0,0 +1,19 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface ICheckLockStatusParams {
3
+ id: string;
4
+ type: string;
5
+ }
6
+ export interface ICheckLockStatusGateway {
7
+ execute(params: ICheckLockStatusParams): Promise<IRecordLockingLockRecord | null>;
8
+ }
9
+ export declare const CheckLockStatusGateway: import("@webiny/di").Abstraction<ICheckLockStatusGateway>;
10
+ export declare namespace CheckLockStatusGateway {
11
+ type Interface = ICheckLockStatusGateway;
12
+ }
13
+ export interface ICheckLockStatusUseCase {
14
+ execute(params: ICheckLockStatusParams): Promise<IRecordLockingLockRecord | null>;
15
+ }
16
+ export declare const CheckLockStatusUseCase: import("@webiny/di").Abstraction<ICheckLockStatusUseCase>;
17
+ export declare namespace CheckLockStatusUseCase {
18
+ type Interface = ICheckLockStatusUseCase;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const CheckLockStatusGateway = createAbstraction("CheckLockStatusGateway");
3
+ const CheckLockStatusUseCase = createAbstraction("CheckLockStatusUseCase");
4
+ export { CheckLockStatusGateway, CheckLockStatusUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/checkLockStatus/abstractions.js","sources":["../../../src/features/checkLockStatus/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IRecordLockingLockRecord } from \"~/types.js\";\n\nexport interface ICheckLockStatusParams {\n id: string;\n type: string;\n}\n\nexport interface ICheckLockStatusGateway {\n execute(params: ICheckLockStatusParams): Promise<IRecordLockingLockRecord | null>;\n}\n\nexport const CheckLockStatusGateway =\n createAbstraction<ICheckLockStatusGateway>(\"CheckLockStatusGateway\");\n\nexport namespace CheckLockStatusGateway {\n export type Interface = ICheckLockStatusGateway;\n}\n\nexport interface ICheckLockStatusUseCase {\n execute(params: ICheckLockStatusParams): Promise<IRecordLockingLockRecord | null>;\n}\n\nexport const CheckLockStatusUseCase =\n createAbstraction<ICheckLockStatusUseCase>(\"CheckLockStatusUseCase\");\n\nexport namespace CheckLockStatusUseCase {\n export type Interface = ICheckLockStatusUseCase;\n}\n"],"names":["CheckLockStatusGateway","createAbstraction","CheckLockStatusUseCase"],"mappings":";AAYO,MAAMA,yBACTC,kBAA2C;AAUxC,MAAMC,yBACTD,kBAA2C"}
@@ -0,0 +1,3 @@
1
+ export declare const CheckLockStatusFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").ICheckLockStatusUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { CheckLockStatusUseCase } from "./abstractions.js";
3
+ import { CheckLockStatusUseCase as external_CheckLockStatusUseCase_js_CheckLockStatusUseCase } from "./CheckLockStatusUseCase.js";
4
+ import { CheckLockStatusGateway } from "./CheckLockStatusGateway.js";
5
+ const CheckLockStatusFeature = createFeature({
6
+ name: "RecordLocking/CheckLockStatus",
7
+ register (container) {
8
+ container.register(external_CheckLockStatusUseCase_js_CheckLockStatusUseCase);
9
+ container.register(CheckLockStatusGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(CheckLockStatusUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { CheckLockStatusFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/checkLockStatus/feature.js","sources":["../../../src/features/checkLockStatus/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { CheckLockStatusUseCase as UseCase } from \"./abstractions.js\";\nimport { CheckLockStatusUseCase } from \"./CheckLockStatusUseCase.js\";\nimport { CheckLockStatusGateway } from \"./CheckLockStatusGateway.js\";\n\nexport const CheckLockStatusFeature = createFeature({\n name: \"RecordLocking/CheckLockStatus\",\n register(container) {\n container.register(CheckLockStatusUseCase);\n container.register(CheckLockStatusGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCase)\n };\n }\n});\n"],"names":["CheckLockStatusFeature","createFeature","container","CheckLockStatusUseCase","CheckLockStatusGateway","UseCase"],"mappings":";;;;AAKO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,wBAAwB,gBAAgB;IAC/D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1 @@
1
+ export declare const RecordLockingFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { AcquireLockFeature } from "./acquireLock/feature.js";
3
+ import { ReleaseLockFeature } from "./releaseLock/feature.js";
4
+ import { ForceUnlockFeature } from "./forceUnlock/feature.js";
5
+ import { CheckLockStatusFeature } from "./checkLockStatus/feature.js";
6
+ import { ListLockRecordsFeature } from "./listLockRecords/feature.js";
7
+ const RecordLockingFeature = createFeature({
8
+ name: "RecordLocking",
9
+ register (container) {
10
+ AcquireLockFeature.register(container);
11
+ ReleaseLockFeature.register(container);
12
+ ForceUnlockFeature.register(container);
13
+ CheckLockStatusFeature.register(container);
14
+ ListLockRecordsFeature.register(container);
15
+ }
16
+ });
17
+ export { RecordLockingFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/feature.js","sources":["../../src/features/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { AcquireLockFeature } from \"./acquireLock/feature.js\";\nimport { ReleaseLockFeature } from \"./releaseLock/feature.js\";\nimport { ForceUnlockFeature } from \"./forceUnlock/feature.js\";\nimport { CheckLockStatusFeature } from \"./checkLockStatus/feature.js\";\nimport { ListLockRecordsFeature } from \"./listLockRecords/feature.js\";\n\nexport const RecordLockingFeature = createFeature({\n name: \"RecordLocking\",\n register(container) {\n AcquireLockFeature.register(container);\n ReleaseLockFeature.register(container);\n ForceUnlockFeature.register(container);\n CheckLockStatusFeature.register(container);\n ListLockRecordsFeature.register(container);\n }\n});\n"],"names":["RecordLockingFeature","createFeature","container","AcquireLockFeature","ReleaseLockFeature","ForceUnlockFeature","CheckLockStatusFeature","ListLockRecordsFeature"],"mappings":";;;;;;AAOO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdC,mBAAmB,QAAQ,CAACD;QAC5BE,mBAAmB,QAAQ,CAACF;QAC5BG,mBAAmB,QAAQ,CAACH;QAC5BI,uBAAuB,QAAQ,CAACJ;QAChCK,uBAAuB,QAAQ,CAACL;IACpC;AACJ"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ForceUnlockGateway as GatewayAbstraction, type IForceUnlockParams } from "./abstractions.js";
3
+ import type { IRecordLockingLockRecord } from "../../types.js";
4
+ declare class ForceUnlockGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const ForceUnlockGateway: typeof ForceUnlockGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IForceUnlockGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,44 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "../graphqlFields.js";
3
+ import { ForceUnlockGateway } from "./abstractions.js";
4
+ const FORCE_UNLOCK_MUTATION = `
5
+ mutation RecordLockingUnlockEntry($id: ID!, $type: String!, $force: Boolean) {
6
+ recordLocking {
7
+ unlockEntry(id: $id, type: $type, force: $force) {
8
+ data {
9
+ ${LOCK_RECORD_FIELDS}
10
+ }
11
+ error {
12
+ ${ERROR_FIELDS}
13
+ }
14
+ }
15
+ }
16
+ }
17
+ `;
18
+ class ForceUnlockGatewayImpl {
19
+ constructor(client){
20
+ this.client = client;
21
+ }
22
+ async execute(params) {
23
+ const response = await this.client.execute({
24
+ query: FORCE_UNLOCK_MUTATION,
25
+ variables: {
26
+ id: params.id,
27
+ type: params.type,
28
+ force: true
29
+ }
30
+ });
31
+ const { data, error } = response.recordLocking.unlockEntry;
32
+ if (!data) throw new Error(error?.message || "Failed to force unlock");
33
+ return data;
34
+ }
35
+ }
36
+ const ForceUnlockGateway_ForceUnlockGateway = ForceUnlockGateway.createImplementation({
37
+ implementation: ForceUnlockGatewayImpl,
38
+ dependencies: [
39
+ MainGraphQLClient
40
+ ]
41
+ });
42
+ export { ForceUnlockGateway_ForceUnlockGateway as ForceUnlockGateway };
43
+
44
+ //# sourceMappingURL=ForceUnlockGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/forceUnlock/ForceUnlockGateway.js","sources":["../../../src/features/forceUnlock/ForceUnlockGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { LOCK_RECORD_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n ForceUnlockGateway as GatewayAbstraction,\n type IForceUnlockParams\n} from \"./abstractions.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\n\ninterface ForceUnlockResponse {\n recordLocking: {\n unlockEntry: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nconst FORCE_UNLOCK_MUTATION = /* GraphQL */ `\n mutation RecordLockingUnlockEntry($id: ID!, $type: String!, $force: Boolean) {\n recordLocking {\n unlockEntry(id: $id, type: $type, force: $force) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\nclass ForceUnlockGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: IForceUnlockParams) {\n const response = await this.client.execute<ForceUnlockResponse>({\n query: FORCE_UNLOCK_MUTATION,\n variables: { id: params.id, type: params.type, force: true }\n });\n\n const { data, error } = response.recordLocking.unlockEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Failed to force unlock\");\n }\n\n return data;\n }\n}\n\nexport const ForceUnlockGateway = GatewayAbstraction.createImplementation({\n implementation: ForceUnlockGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["FORCE_UNLOCK_MUTATION","LOCK_RECORD_FIELDS","ERROR_FIELDS","ForceUnlockGatewayImpl","client","params","response","data","error","Error","ForceUnlockGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAiBA,MAAMA,wBAAsC,CAAC;;;;;oBAKzB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAED,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA0B,EAAE;QACtC,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB;YAC5D,OAAON;YACP,WAAW;gBAAE,IAAIK,OAAO,EAAE;gBAAE,MAAMA,OAAO,IAAI;gBAAE,OAAO;YAAK;QAC/D;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,aAAa,CAAC,WAAW;QAE1D,IAAI,CAACC,MACD,MAAM,IAAIE,MAAMD,OAAO,WAAW;QAGtC,OAAOD;IACX;AACJ;AAEO,MAAMG,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { ForceUnlockUseCase as UseCaseAbstraction, ForceUnlockGateway, type IForceUnlockParams } from "./abstractions.js";
2
+ declare class ForceUnlockUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private gateway;
4
+ constructor(gateway: ForceUnlockGateway.Interface);
5
+ execute(params: IForceUnlockParams): Promise<import("../../types.js").IRecordLockingLockRecord>;
6
+ }
7
+ export declare const ForceUnlockUseCase: typeof ForceUnlockUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IForceUnlockUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ForceUnlockGateway, ForceUnlockUseCase } from "./abstractions.js";
2
+ class ForceUnlockUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ return this.gateway.execute(params);
8
+ }
9
+ }
10
+ const ForceUnlockUseCase_ForceUnlockUseCase = ForceUnlockUseCase.createImplementation({
11
+ implementation: ForceUnlockUseCaseImpl,
12
+ dependencies: [
13
+ ForceUnlockGateway
14
+ ]
15
+ });
16
+ export { ForceUnlockUseCase_ForceUnlockUseCase as ForceUnlockUseCase };
17
+
18
+ //# sourceMappingURL=ForceUnlockUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/forceUnlock/ForceUnlockUseCase.js","sources":["../../../src/features/forceUnlock/ForceUnlockUseCase.ts"],"sourcesContent":["import {\n ForceUnlockUseCase as UseCaseAbstraction,\n ForceUnlockGateway,\n type IForceUnlockParams\n} from \"./abstractions.js\";\n\nclass ForceUnlockUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: ForceUnlockGateway.Interface) {}\n\n async execute(params: IForceUnlockParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const ForceUnlockUseCase = UseCaseAbstraction.createImplementation({\n implementation: ForceUnlockUseCaseImpl,\n dependencies: [ForceUnlockGateway]\n});\n"],"names":["ForceUnlockUseCaseImpl","gateway","params","ForceUnlockUseCase","UseCaseAbstraction","ForceUnlockGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAqC,CAAE;aAAvCA,OAAO,GAAPA;IAAwC;IAE5D,MAAM,QAAQC,MAA0B,EAAE;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
@@ -0,0 +1,19 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface IForceUnlockParams {
3
+ id: string;
4
+ type: string;
5
+ }
6
+ export interface IForceUnlockGateway {
7
+ execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const ForceUnlockGateway: import("@webiny/di").Abstraction<IForceUnlockGateway>;
10
+ export declare namespace ForceUnlockGateway {
11
+ type Interface = IForceUnlockGateway;
12
+ }
13
+ export interface IForceUnlockUseCase {
14
+ execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;
15
+ }
16
+ export declare const ForceUnlockUseCase: import("@webiny/di").Abstraction<IForceUnlockUseCase>;
17
+ export declare namespace ForceUnlockUseCase {
18
+ type Interface = IForceUnlockUseCase;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ForceUnlockGateway = createAbstraction("ForceUnlockGateway");
3
+ const ForceUnlockUseCase = createAbstraction("ForceUnlockUseCase");
4
+ export { ForceUnlockGateway, ForceUnlockUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map