@webiny/app-record-locking 6.4.12-beta.4 → 6.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/RecordLockingModule.d.ts +2 -0
  2. package/RecordLockingModule.js +74 -0
  3. package/RecordLockingModule.js.map +1 -0
  4. package/{components/SecurityPermissions.js → SecurityPermissions.js} +1 -1
  5. package/SecurityPermissions.js.map +1 -0
  6. package/features/acquireLock/AcquireLockGateway.d.ts +12 -0
  7. package/features/acquireLock/AcquireLockGateway.js +43 -0
  8. package/features/acquireLock/AcquireLockGateway.js.map +1 -0
  9. package/features/acquireLock/AcquireLockUseCase.d.ts +10 -0
  10. package/features/acquireLock/AcquireLockUseCase.js +18 -0
  11. package/features/acquireLock/AcquireLockUseCase.js.map +1 -0
  12. package/features/acquireLock/abstractions.d.ts +19 -0
  13. package/features/acquireLock/abstractions.js +6 -0
  14. package/features/acquireLock/abstractions.js.map +1 -0
  15. package/features/acquireLock/feature.d.ts +3 -0
  16. package/features/acquireLock/feature.js +19 -0
  17. package/features/acquireLock/feature.js.map +1 -0
  18. package/features/checkLockStatus/CheckLockStatusGateway.d.ts +12 -0
  19. package/features/checkLockStatus/CheckLockStatusGateway.js +43 -0
  20. package/features/checkLockStatus/CheckLockStatusGateway.js.map +1 -0
  21. package/features/checkLockStatus/CheckLockStatusUseCase.d.ts +10 -0
  22. package/features/checkLockStatus/CheckLockStatusUseCase.js +18 -0
  23. package/features/checkLockStatus/CheckLockStatusUseCase.js.map +1 -0
  24. package/features/checkLockStatus/abstractions.d.ts +19 -0
  25. package/features/checkLockStatus/abstractions.js +6 -0
  26. package/features/checkLockStatus/abstractions.js.map +1 -0
  27. package/features/checkLockStatus/feature.d.ts +3 -0
  28. package/features/checkLockStatus/feature.js +19 -0
  29. package/features/checkLockStatus/feature.js.map +1 -0
  30. package/features/feature.d.ts +1 -0
  31. package/features/feature.js +19 -0
  32. package/features/feature.js.map +1 -0
  33. package/features/forceUnlock/ForceUnlockGateway.d.ts +12 -0
  34. package/features/forceUnlock/ForceUnlockGateway.js +44 -0
  35. package/features/forceUnlock/ForceUnlockGateway.js.map +1 -0
  36. package/features/forceUnlock/ForceUnlockUseCase.d.ts +10 -0
  37. package/features/forceUnlock/ForceUnlockUseCase.js +18 -0
  38. package/features/forceUnlock/ForceUnlockUseCase.js.map +1 -0
  39. package/features/forceUnlock/abstractions.d.ts +19 -0
  40. package/features/forceUnlock/abstractions.js +6 -0
  41. package/features/forceUnlock/abstractions.js.map +1 -0
  42. package/features/forceUnlock/feature.d.ts +3 -0
  43. package/features/forceUnlock/feature.js +19 -0
  44. package/features/forceUnlock/feature.js.map +1 -0
  45. package/{domain/graphql/fields.js → features/graphqlFields.js} +1 -1
  46. package/features/graphqlFields.js.map +1 -0
  47. package/features/listLockRecords/ListLockRecordsGateway.d.ts +12 -0
  48. package/features/listLockRecords/ListLockRecordsGateway.js +48 -0
  49. package/features/listLockRecords/ListLockRecordsGateway.js.map +1 -0
  50. package/features/listLockRecords/ListLockRecordsUseCase.d.ts +10 -0
  51. package/features/listLockRecords/ListLockRecordsUseCase.js +18 -0
  52. package/features/listLockRecords/ListLockRecordsUseCase.js.map +1 -0
  53. package/features/listLockRecords/abstractions.d.ts +22 -0
  54. package/features/listLockRecords/abstractions.js +6 -0
  55. package/features/listLockRecords/abstractions.js.map +1 -0
  56. package/features/listLockRecords/feature.d.ts +3 -0
  57. package/features/listLockRecords/feature.js +19 -0
  58. package/features/listLockRecords/feature.js.map +1 -0
  59. package/features/permissions/abstractions.d.ts +1 -1
  60. package/features/permissions/abstractions.js +1 -1
  61. package/features/permissions/abstractions.js.map +1 -1
  62. package/features/permissions/feature.d.ts +1 -1
  63. package/features/permissions/feature.js +1 -1
  64. package/features/permissions/feature.js.map +1 -1
  65. package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
  66. package/features/releaseLock/ReleaseLockGateway.js +44 -0
  67. package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
  68. package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
  69. package/features/releaseLock/ReleaseLockUseCase.js +18 -0
  70. package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
  71. package/features/releaseLock/abstractions.d.ts +19 -0
  72. package/features/releaseLock/abstractions.js +6 -0
  73. package/features/releaseLock/abstractions.js.map +1 -0
  74. package/features/releaseLock/feature.d.ts +3 -0
  75. package/features/releaseLock/feature.js +19 -0
  76. package/features/releaseLock/feature.js.map +1 -0
  77. package/index.d.ts +0 -5
  78. package/index.js +12 -13
  79. package/index.js.map +1 -1
  80. package/package.json +13 -17
  81. package/permissions/permissionsSchema.js.map +1 -0
  82. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.d.ts +23 -0
  83. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js +64 -0
  84. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js.map +1 -0
  85. package/presentation/entryLocking/RecordLockingPresenter.d.ts +32 -0
  86. package/presentation/entryLocking/RecordLockingPresenter.js +164 -0
  87. package/presentation/entryLocking/RecordLockingPresenter.js.map +1 -0
  88. package/presentation/entryLocking/SingleEntryContentDecorator.d.ts +2 -0
  89. package/presentation/entryLocking/SingleEntryContentDecorator.js +72 -0
  90. package/presentation/entryLocking/SingleEntryContentDecorator.js.map +1 -0
  91. package/presentation/entryLocking/SingleEntryPresenterDecorator.d.ts +15 -0
  92. package/presentation/entryLocking/SingleEntryPresenterDecorator.js +40 -0
  93. package/presentation/entryLocking/SingleEntryPresenterDecorator.js.map +1 -0
  94. package/presentation/entryLocking/abstractions.d.ts +26 -0
  95. package/presentation/entryLocking/abstractions.js +5 -0
  96. package/presentation/entryLocking/abstractions.js.map +1 -0
  97. package/presentation/entryLocking/components/ForceUnlockButton.d.ts +11 -0
  98. package/presentation/entryLocking/components/ForceUnlockButton.js +37 -0
  99. package/presentation/entryLocking/components/ForceUnlockButton.js.map +1 -0
  100. package/presentation/entryLocking/components/LockedEntryOverlay.d.ts +10 -0
  101. package/presentation/entryLocking/components/LockedEntryOverlay.js +52 -0
  102. package/presentation/entryLocking/components/LockedEntryOverlay.js.map +1 -0
  103. package/presentation/entryLocking/components/RecordLockingGuard.d.ts +12 -0
  104. package/presentation/entryLocking/components/RecordLockingGuard.js +74 -0
  105. package/presentation/entryLocking/components/RecordLockingGuard.js.map +1 -0
  106. package/presentation/entryLocking/feature.d.ts +3 -0
  107. package/presentation/entryLocking/feature.js +21 -0
  108. package/presentation/entryLocking/feature.js.map +1 -0
  109. package/presentation/listLocking/ContentEntriesPresenterDecorator.d.ts +24 -0
  110. package/presentation/listLocking/ContentEntriesPresenterDecorator.js +67 -0
  111. package/presentation/listLocking/ContentEntriesPresenterDecorator.js.map +1 -0
  112. package/presentation/listLocking/ListLockRecordsPresenter.d.ts +17 -0
  113. package/presentation/listLocking/ListLockRecordsPresenter.js +52 -0
  114. package/presentation/listLocking/ListLockRecordsPresenter.js.map +1 -0
  115. package/presentation/listLocking/abstractions.d.ts +16 -0
  116. package/presentation/listLocking/abstractions.js +5 -0
  117. package/presentation/listLocking/abstractions.js.map +1 -0
  118. package/presentation/listLocking/components/ListLockRecordsSync.d.ts +3 -0
  119. package/presentation/listLocking/components/ListLockRecordsSync.js +26 -0
  120. package/presentation/listLocking/components/ListLockRecordsSync.js.map +1 -0
  121. package/presentation/listLocking/components/LockIndicatorCell.d.ts +2 -0
  122. package/presentation/listLocking/components/LockIndicatorCell.js +39 -0
  123. package/presentation/listLocking/components/LockIndicatorCell.js.map +1 -0
  124. package/presentation/listLocking/feature.d.ts +3 -0
  125. package/presentation/listLocking/feature.js +19 -0
  126. package/presentation/listLocking/feature.js.map +1 -0
  127. package/types.d.ts +1 -62
  128. package/components/HeadlessCmsActionsAcoCell.d.ts +0 -2
  129. package/components/HeadlessCmsActionsAcoCell.js +0 -38
  130. package/components/HeadlessCmsActionsAcoCell.js.map +0 -1
  131. package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +0 -9
  132. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +0 -34
  133. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +0 -1
  134. package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +0 -18
  135. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +0 -80
  136. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +0 -1
  137. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.d.ts +0 -2
  138. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +0 -44
  139. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +0 -1
  140. package/components/HeadlessCmsContentEntry/index.d.ts +0 -1
  141. package/components/HeadlessCmsContentEntry/index.js +0 -1
  142. package/components/LockedRecord/LockedRecord.d.ts +0 -6
  143. package/components/LockedRecord/LockedRecord.js +0 -54
  144. package/components/LockedRecord/LockedRecord.js.map +0 -1
  145. package/components/LockedRecord/LockedRecordForceUnlock.d.ts +0 -9
  146. package/components/LockedRecord/LockedRecordForceUnlock.js +0 -57
  147. package/components/LockedRecord/LockedRecordForceUnlock.js.map +0 -1
  148. package/components/LockedRecord/index.d.ts +0 -1
  149. package/components/LockedRecord/index.js +0 -1
  150. package/components/RecordLockingProvider.d.ts +0 -7
  151. package/components/RecordLockingProvider.js +0 -111
  152. package/components/RecordLockingProvider.js.map +0 -1
  153. package/components/SecurityPermissions.js.map +0 -1
  154. package/components/decorators/UseContentEntriesListHookDecorator.d.ts +0 -1
  155. package/components/decorators/UseContentEntriesListHookDecorator.js +0 -23
  156. package/components/decorators/UseContentEntriesListHookDecorator.js.map +0 -1
  157. package/components/decorators/UseRecordsDecorator.d.ts +0 -8
  158. package/components/decorators/UseRecordsDecorator.js +0 -16
  159. package/components/decorators/UseRecordsDecorator.js.map +0 -1
  160. package/components/decorators/UseSaveEntryDecorator.d.ts +0 -1
  161. package/components/decorators/UseSaveEntryDecorator.js +0 -41
  162. package/components/decorators/UseSaveEntryDecorator.js.map +0 -1
  163. package/domain/RecordLocking.d.ts +0 -28
  164. package/domain/RecordLocking.js +0 -259
  165. package/domain/RecordLocking.js.map +0 -1
  166. package/domain/RecordLockingClient.d.ts +0 -12
  167. package/domain/RecordLockingClient.js +0 -20
  168. package/domain/RecordLockingClient.js.map +0 -1
  169. package/domain/RecordLockingGetLockRecord.d.ts +0 -11
  170. package/domain/RecordLockingGetLockRecord.js +0 -19
  171. package/domain/RecordLockingGetLockRecord.js.map +0 -1
  172. package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +0 -11
  173. package/domain/RecordLockingGetLockedEntryLockRecord.js +0 -18
  174. package/domain/RecordLockingGetLockedEntryLockRecord.js.map +0 -1
  175. package/domain/RecordLockingIsEntryLocked.d.ts +0 -11
  176. package/domain/RecordLockingIsEntryLocked.js +0 -20
  177. package/domain/RecordLockingIsEntryLocked.js.map +0 -1
  178. package/domain/RecordLockingListLockRecords.d.ts +0 -12
  179. package/domain/RecordLockingListLockRecords.js +0 -25
  180. package/domain/RecordLockingListLockRecords.js.map +0 -1
  181. package/domain/RecordLockingLockEntry.d.ts +0 -11
  182. package/domain/RecordLockingLockEntry.js +0 -12
  183. package/domain/RecordLockingLockEntry.js.map +0 -1
  184. package/domain/RecordLockingUnlockEntry.d.ts +0 -11
  185. package/domain/RecordLockingUnlockEntry.js +0 -18
  186. package/domain/RecordLockingUnlockEntry.js.map +0 -1
  187. package/domain/RecordLockingUpdateEntryLock.d.ts +0 -11
  188. package/domain/RecordLockingUpdateEntryLock.js +0 -18
  189. package/domain/RecordLockingUpdateEntryLock.js.map +0 -1
  190. package/domain/abstractions/IRecordLocking.d.ts +0 -25
  191. package/domain/abstractions/IRecordLocking.js +0 -0
  192. package/domain/abstractions/IRecordLockingClient.d.ts +0 -6
  193. package/domain/abstractions/IRecordLockingClient.js +0 -0
  194. package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +0 -12
  195. package/domain/abstractions/IRecordLockingGetLockRecord.js +0 -0
  196. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +0 -12
  197. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +0 -0
  198. package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +0 -8
  199. package/domain/abstractions/IRecordLockingIsEntryLocked.js +0 -0
  200. package/domain/abstractions/IRecordLockingListLockRecords.d.ts +0 -19
  201. package/domain/abstractions/IRecordLockingListLockRecords.js +0 -0
  202. package/domain/abstractions/IRecordLockingLockEntry.d.ts +0 -12
  203. package/domain/abstractions/IRecordLockingLockEntry.js +0 -0
  204. package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +0 -13
  205. package/domain/abstractions/IRecordLockingUnlockEntry.js +0 -0
  206. package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +0 -12
  207. package/domain/abstractions/IRecordLockingUpdateEntryLock.js +0 -0
  208. package/domain/graphql/fields.js.map +0 -1
  209. package/domain/graphql/getLockRecord.d.ts +0 -12
  210. package/domain/graphql/getLockRecord.js +0 -19
  211. package/domain/graphql/getLockRecord.js.map +0 -1
  212. package/domain/graphql/getLockedEntryLockRecord.d.ts +0 -12
  213. package/domain/graphql/getLockedEntryLockRecord.js +0 -19
  214. package/domain/graphql/getLockedEntryLockRecord.js.map +0 -1
  215. package/domain/graphql/isEntryLocked.d.ts +0 -12
  216. package/domain/graphql/isEntryLocked.js +0 -17
  217. package/domain/graphql/isEntryLocked.js.map +0 -1
  218. package/domain/graphql/listLockRecords.d.ts +0 -17
  219. package/domain/graphql/listLockRecords.js +0 -25
  220. package/domain/graphql/listLockRecords.js.map +0 -1
  221. package/domain/graphql/lockEntry.d.ts +0 -12
  222. package/domain/graphql/lockEntry.js +0 -19
  223. package/domain/graphql/lockEntry.js.map +0 -1
  224. package/domain/graphql/unlockEntry.d.ts +0 -12
  225. package/domain/graphql/unlockEntry.js +0 -19
  226. package/domain/graphql/unlockEntry.js.map +0 -1
  227. package/domain/graphql/updateEntryLock.d.ts +0 -12
  228. package/domain/graphql/updateEntryLock.js +0 -19
  229. package/domain/graphql/updateEntryLock.js.map +0 -1
  230. package/domain/permissionsSchema.js.map +0 -1
  231. package/domain/utils/createRecordLockingClient.d.ts +0 -3
  232. package/domain/utils/createRecordLockingClient.js +0 -11
  233. package/domain/utils/createRecordLockingClient.js.map +0 -1
  234. package/domain/utils/createRecordLockingError.d.ts +0 -6
  235. package/domain/utils/createRecordLockingError.js +0 -15
  236. package/domain/utils/createRecordLockingError.js.map +0 -1
  237. package/hooks/index.d.ts +0 -2
  238. package/hooks/index.js +0 -2
  239. package/hooks/usePermission.d.ts +0 -3
  240. package/hooks/usePermission.js +0 -19
  241. package/hooks/usePermission.js.map +0 -1
  242. package/hooks/useRecordLocking.d.ts +0 -2
  243. package/hooks/useRecordLocking.js +0 -11
  244. package/hooks/useRecordLocking.js.map +0 -1
  245. package/utils/createCacheKey.d.ts +0 -3
  246. package/utils/createCacheKey.js +0 -14
  247. package/utils/createCacheKey.js.map +0 -1
  248. /package/{components/SecurityPermissions.d.ts → SecurityPermissions.d.ts} +0 -0
  249. /package/{domain/graphql/fields.d.ts → features/graphqlFields.d.ts} +0 -0
  250. /package/{domain → permissions}/permissionsSchema.d.ts +0 -0
  251. /package/{domain → permissions}/permissionsSchema.js +0 -0
@@ -1,18 +0,0 @@
1
- import { WebinyError } from "@webiny/error";
2
- import { UNLOCK_ENTRY_MUTATION } from "./graphql/unlockEntry.js";
3
- class RecordLockingUnlockEntry {
4
- constructor(params){
5
- this.client = params.client;
6
- }
7
- async execute(params) {
8
- const result = await this.client.mutation({
9
- mutation: UNLOCK_ENTRY_MUTATION,
10
- variables: params
11
- });
12
- if (!result.data?.recordLocking?.unlockEntry) throw new WebinyError("No data returned from server.");
13
- return result.data.recordLocking.unlockEntry;
14
- }
15
- }
16
- export { RecordLockingUnlockEntry };
17
-
18
- //# sourceMappingURL=RecordLockingUnlockEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/RecordLockingUnlockEntry.js","sources":["../../src/domain/RecordLockingUnlockEntry.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport type {\n IRecordLockingUnlockEntry,\n IRecordLockingUnlockEntryParams,\n IRecordLockingUnlockEntryResult\n} from \"~/domain/abstractions/IRecordLockingUnlockEntry.js\";\nimport type { IRecordLockingClient } from \"./abstractions/IRecordLockingClient.js\";\nimport type {\n RecordLockingUnlockEntryResponse,\n IRecordLockingUnlockEntryVariables\n} from \"~/domain/graphql/unlockEntry.js\";\nimport { UNLOCK_ENTRY_MUTATION } from \"~/domain/graphql/unlockEntry.js\";\n\ninterface Params {\n client: IRecordLockingClient;\n}\n\nexport class RecordLockingUnlockEntry implements IRecordLockingUnlockEntry {\n private readonly client: IRecordLockingClient;\n\n public constructor(params: Params) {\n this.client = params.client;\n }\n public async execute(\n params: IRecordLockingUnlockEntryParams\n ): Promise<IRecordLockingUnlockEntryResult> {\n const result = await this.client.mutation<\n RecordLockingUnlockEntryResponse,\n IRecordLockingUnlockEntryVariables\n >({\n mutation: UNLOCK_ENTRY_MUTATION,\n variables: params\n });\n if (!result.data?.recordLocking?.unlockEntry) {\n throw new WebinyError(\"No data returned from server.\");\n }\n return result.data.recordLocking.unlockEntry;\n }\n}\n"],"names":["RecordLockingUnlockEntry","params","result","UNLOCK_ENTRY_MUTATION","WebinyError"],"mappings":";;AAiBO,MAAMA;IAGT,YAAmBC,MAAc,CAAE;QAC/B,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IACA,MAAa,QACTA,MAAuC,EACC;QACxC,MAAMC,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAGvC;YACE,UAAUC;YACV,WAAWF;QACf;QACA,IAAI,CAACC,OAAO,IAAI,EAAE,eAAe,aAC7B,MAAM,IAAIE,YAAY;QAE1B,OAAOF,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW;IAChD;AACJ"}
@@ -1,11 +0,0 @@
1
- import type { IRecordLockingUpdateEntryLock, IRecordLockingUpdateEntryLockExecuteParams, IRecordLockingUpdateEntryLockExecuteResult } from "../domain/abstractions/IRecordLockingUpdateEntryLock.js";
2
- import type { IRecordLockingClient } from "../domain/abstractions/IRecordLockingClient.js";
3
- interface Params {
4
- client: IRecordLockingClient;
5
- }
6
- export declare class RecordLockingUpdateEntryLock implements IRecordLockingUpdateEntryLock {
7
- private readonly client;
8
- constructor(params: Params);
9
- execute(params: IRecordLockingUpdateEntryLockExecuteParams): Promise<IRecordLockingUpdateEntryLockExecuteResult>;
10
- }
11
- export {};
@@ -1,18 +0,0 @@
1
- import { WebinyError } from "@webiny/error";
2
- import { UPDATE_ENTRY_LOCK } from "./graphql/updateEntryLock.js";
3
- class RecordLockingUpdateEntryLock {
4
- constructor(params){
5
- this.client = params.client;
6
- }
7
- async execute(params) {
8
- const result = await this.client.mutation({
9
- mutation: UPDATE_ENTRY_LOCK,
10
- variables: params
11
- });
12
- if (!result.data?.recordLocking?.updateEntryLock) throw new WebinyError("No data returned from server.");
13
- return result.data.recordLocking.updateEntryLock;
14
- }
15
- }
16
- export { RecordLockingUpdateEntryLock };
17
-
18
- //# sourceMappingURL=RecordLockingUpdateEntryLock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/RecordLockingUpdateEntryLock.js","sources":["../../src/domain/RecordLockingUpdateEntryLock.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport type {\n IRecordLockingUpdateEntryLock,\n IRecordLockingUpdateEntryLockExecuteParams,\n IRecordLockingUpdateEntryLockExecuteResult\n} from \"~/domain/abstractions/IRecordLockingUpdateEntryLock.js\";\nimport type { IRecordLockingClient } from \"~/domain/abstractions/IRecordLockingClient.js\";\nimport type {\n IRecordLockingUpdateEntryLockResponse,\n IRecordLockingUpdateEntryLockVariables\n} from \"~/domain/graphql/updateEntryLock.js\";\nimport { UPDATE_ENTRY_LOCK } from \"~/domain/graphql/updateEntryLock.js\";\n\ninterface Params {\n client: IRecordLockingClient;\n}\n\nexport class RecordLockingUpdateEntryLock implements IRecordLockingUpdateEntryLock {\n private readonly client: IRecordLockingClient;\n\n public constructor(params: Params) {\n this.client = params.client;\n }\n\n public async execute(\n params: IRecordLockingUpdateEntryLockExecuteParams\n ): Promise<IRecordLockingUpdateEntryLockExecuteResult> {\n const result = await this.client.mutation<\n IRecordLockingUpdateEntryLockResponse,\n IRecordLockingUpdateEntryLockVariables\n >({\n mutation: UPDATE_ENTRY_LOCK,\n variables: params\n });\n if (!result.data?.recordLocking?.updateEntryLock) {\n throw new WebinyError(\"No data returned from server.\");\n }\n return result.data.recordLocking.updateEntryLock;\n }\n}\n"],"names":["RecordLockingUpdateEntryLock","params","result","UPDATE_ENTRY_LOCK","WebinyError"],"mappings":";;AAiBO,MAAMA;IAGT,YAAmBC,MAAc,CAAE;QAC/B,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IAEA,MAAa,QACTA,MAAkD,EACC;QACnD,MAAMC,SAAS,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAGvC;YACE,UAAUC;YACV,WAAWF;QACf;QACA,IAAI,CAACC,OAAO,IAAI,EAAE,eAAe,iBAC7B,MAAM,IAAIE,YAAY;QAE1B,OAAOF,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe;IACpD;AACJ"}
@@ -1,25 +0,0 @@
1
- import type { IFetchLockedEntryLockRecordParams, IFetchLockRecordParams, IFetchLockRecordResult, IIsRecordLockedParams, IPossiblyRecordLockingRecord, IRecordLockingError, IRecordLockingLockRecord, IRecordLockingRecord, IUnlockEntryParams, IUpdateEntryLockParams } from "../../types.js";
2
- import type { IRecordLockingUnlockEntryResult } from "./IRecordLockingUnlockEntry.js";
3
- export interface IRecordLockingUpdateEntryLockResult {
4
- data: IRecordLockingLockRecord | null;
5
- error: IRecordLockingError | null;
6
- }
7
- export interface IRecordLocking<T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord> {
8
- loading: boolean;
9
- records: IRecordLockingRecord[];
10
- setRecords(folderId: string, type: string, records: T[]): Promise<IRecordLockingRecord[] | undefined>;
11
- isLockExpired(input: Date | string): boolean;
12
- isRecordLocked(record: IIsRecordLockedParams): boolean;
13
- getLockRecordEntry(id: string): IRecordLockingRecord | undefined;
14
- fetchLockRecord(params: IFetchLockRecordParams): Promise<IFetchLockRecordResult>;
15
- fetchLockedEntryLockRecord(params: IFetchLockedEntryLockRecordParams): Promise<IRecordLockingLockRecord | null>;
16
- updateEntryLock(params: IUpdateEntryLockParams): Promise<IRecordLockingUpdateEntryLockResult>;
17
- /**
18
- * Removes entry lock from the state - this is not an API call.
19
- */
20
- removeEntryLock(params: IUnlockEntryParams): void;
21
- /**
22
- * Unlocks entry via an API call.
23
- */
24
- unlockEntry(params: IUnlockEntryParams, force?: boolean): Promise<IRecordLockingUnlockEntryResult>;
25
- }
File without changes
@@ -1,6 +0,0 @@
1
- import type { ApolloQueryResult, QueryOptions, MutationOptions } from "apollo-client";
2
- import type { FetchResult } from "apollo-link";
3
- export interface IRecordLockingClient {
4
- query<T, R>(params: QueryOptions<R>): Promise<ApolloQueryResult<T>>;
5
- mutation<T, R>(options: MutationOptions<T, R>): Promise<FetchResult<T>>;
6
- }
File without changes
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- export interface IRecordLockingGetLockRecordExecuteParams {
3
- id: string;
4
- type: string;
5
- }
6
- export interface IRecordLockingGetLockRecordExecuteResult {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- }
10
- export interface IRecordLockingGetLockRecord {
11
- execute(params: IRecordLockingGetLockRecordExecuteParams): Promise<IRecordLockingGetLockRecordExecuteResult>;
12
- }
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- export interface IRecordLockingGetLockedEntryLockRecordExecuteParams {
3
- id: string;
4
- type: string;
5
- }
6
- export interface IRecordLockingGetLockedEntryLockRecordExecuteResult {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- }
10
- export interface IRecordLockingGetLockedEntryLockRecord {
11
- execute(params: IRecordLockingGetLockedEntryLockRecordExecuteParams): Promise<IRecordLockingGetLockedEntryLockRecordExecuteResult>;
12
- }
@@ -1,8 +0,0 @@
1
- export interface IRecordLockingIsEntryLockedParams {
2
- id: string;
3
- type: string;
4
- }
5
- export type IRecordLockingIsEntryLockedResult = boolean;
6
- export interface IRecordLockingIsEntryLocked {
7
- execute(params: IRecordLockingIsEntryLockedParams): Promise<IRecordLockingIsEntryLockedResult>;
8
- }
@@ -1,19 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord, IRecordLockingMeta } from "../../types.js";
2
- export interface IRecordLockingListLockRecordsParamsWhere {
3
- id_in?: string[];
4
- type?: string;
5
- }
6
- export interface IRecordLockingListLockRecordsParams {
7
- where?: IRecordLockingListLockRecordsParamsWhere;
8
- sort?: string[];
9
- limit?: number;
10
- after?: string;
11
- }
12
- export interface IRecordLockingListLockRecordsResult {
13
- data: IRecordLockingLockRecord[] | null;
14
- error: IRecordLockingError | null;
15
- meta: IRecordLockingMeta | null;
16
- }
17
- export interface IRecordLockingListLockRecords {
18
- execute(params: IRecordLockingListLockRecordsParams): Promise<IRecordLockingListLockRecordsResult>;
19
- }
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- export interface IRecordLockingLockEntryParams {
3
- id: string;
4
- type: string;
5
- }
6
- export interface IRecordLockingLockEntryResult {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- }
10
- export interface IRecordLockingLockEntry {
11
- execute(params: IRecordLockingLockEntryParams): Promise<IRecordLockingLockEntryResult>;
12
- }
File without changes
@@ -1,13 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- export interface IRecordLockingUnlockEntryParams {
3
- id: string;
4
- type: string;
5
- force?: boolean;
6
- }
7
- export interface IRecordLockingUnlockEntryResult {
8
- data: IRecordLockingLockRecord | null;
9
- error: IRecordLockingError | null;
10
- }
11
- export interface IRecordLockingUnlockEntry {
12
- execute(params: IRecordLockingUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;
13
- }
File without changes
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- export interface IRecordLockingUpdateEntryLockExecuteParams {
3
- id: string;
4
- type: string;
5
- }
6
- export interface IRecordLockingUpdateEntryLockExecuteResult {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- }
10
- export interface IRecordLockingUpdateEntryLock {
11
- execute(params: IRecordLockingUpdateEntryLockExecuteParams): Promise<IRecordLockingUpdateEntryLockExecuteResult>;
12
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/fields.js","sources":["../../../src/domain/graphql/fields.ts"],"sourcesContent":["export const LOCK_RECORD_FIELDS = /* GraphQL */ `\n id\n lockedBy {\n id\n displayName\n type\n }\n lockedOn\n updatedOn\n expiresOn\n targetId\n type\n actions {\n type\n message\n createdBy {\n id\n displayName\n type\n }\n createdOn\n }\n`;\n\nexport const ERROR_FIELDS = /* GraphQL */ `\n message\n code\n data\n`;\n"],"names":["LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":"AAAO,MAAMA,qBAAmC,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBjD,CAAC;AAEM,MAAMC,eAA6B,CAAC;;;;AAI3C,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- import type { IRecordLockingGetLockRecordExecuteParams } from "../../domain/abstractions/IRecordLockingGetLockRecord.js";
3
- export type IRecordLockingGetLockRecordVariables = IRecordLockingGetLockRecordExecuteParams;
4
- export interface IRecordLockingGetLockRecordResponse {
5
- recordLocking: {
6
- getLockRecord: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const GET_LOCK_RECORD_QUERY: import("graphql").DocumentNode;
@@ -1,19 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const GET_LOCK_RECORD_QUERY = graphql_tag`
4
- query RecordLockingGetLockRecord($id: ID!) {
5
- recordLocking {
6
- getLockRecord(id: $id) {
7
- data {
8
- ${LOCK_RECORD_FIELDS}
9
- }
10
- error {
11
- ${ERROR_FIELDS}
12
- }
13
- }
14
- }
15
- }
16
- `;
17
- export { GET_LOCK_RECORD_QUERY };
18
-
19
- //# sourceMappingURL=getLockRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/getLockRecord.js","sources":["../../../src/domain/graphql/getLockRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\nimport type { IRecordLockingGetLockRecordExecuteParams } from \"~/domain/abstractions/IRecordLockingGetLockRecord.js\";\n\nexport type IRecordLockingGetLockRecordVariables = IRecordLockingGetLockRecordExecuteParams;\n\nexport interface IRecordLockingGetLockRecordResponse {\n recordLocking: {\n getLockRecord: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const GET_LOCK_RECORD_QUERY = gql`\n query RecordLockingGetLockRecord($id: ID!) {\n recordLocking {\n getLockRecord(id: $id) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n"],"names":["GET_LOCK_RECORD_QUERY","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":";;AAgBO,MAAMA,wBAAwBC,WAAG,CAAC;;;;;oBAKrB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- import type { IRecordLockingGetLockedEntryLockRecordExecuteParams } from "../../domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js";
3
- export type IRecordLockingGetLockedEntryLockRecordVariables = IRecordLockingGetLockedEntryLockRecordExecuteParams;
4
- export interface IRecordLockingGetLockedEntryLockRecordResponse {
5
- recordLocking: {
6
- getLockedEntryLockRecord: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const GET_LOCKED_ENTRY_LOCK_RECORD_QUERY: import("graphql").DocumentNode;
@@ -1,19 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const GET_LOCKED_ENTRY_LOCK_RECORD_QUERY = graphql_tag`
4
- query RecordLockingGetLockedEntryLockRecord($id: ID!, $type: String!) {
5
- recordLocking {
6
- getLockedEntryLockRecord(id: $id, type: $type) {
7
- data {
8
- ${LOCK_RECORD_FIELDS}
9
- }
10
- error {
11
- ${ERROR_FIELDS}
12
- }
13
- }
14
- }
15
- }
16
- `;
17
- export { GET_LOCKED_ENTRY_LOCK_RECORD_QUERY };
18
-
19
- //# sourceMappingURL=getLockedEntryLockRecord.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/getLockedEntryLockRecord.js","sources":["../../../src/domain/graphql/getLockedEntryLockRecord.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\nimport type { IRecordLockingGetLockedEntryLockRecordExecuteParams } from \"~/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js\";\n\nexport type IRecordLockingGetLockedEntryLockRecordVariables =\n IRecordLockingGetLockedEntryLockRecordExecuteParams;\n\nexport interface IRecordLockingGetLockedEntryLockRecordResponse {\n recordLocking: {\n getLockedEntryLockRecord: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const GET_LOCKED_ENTRY_LOCK_RECORD_QUERY = gql`\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"],"names":["GET_LOCKED_ENTRY_LOCK_RECORD_QUERY","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":";;AAiBO,MAAMA,qCAAqCC,WAAG,CAAC;;;;;oBAKlC,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError } from "../../types.js";
2
- import type { IRecordLockingIsEntryLockedParams } from "../abstractions/IRecordLockingIsEntryLocked.js";
3
- export type IRecordLockingIsEntryLockedVariables = IRecordLockingIsEntryLockedParams;
4
- export interface IRecordLockingIsEntryLockedResponse {
5
- recordLocking: {
6
- isEntryLocked: {
7
- data: boolean | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const IS_ENTRY_LOCKED_QUERY: import("graphql").DocumentNode;
@@ -1,17 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS } from "./fields.js";
3
- const IS_ENTRY_LOCKED_QUERY = graphql_tag`
4
- query RecordLockingIsEntryLocked($id: ID!, $type: String!) {
5
- recordLocking {
6
- isEntryLocked(id: $id, type: $type) {
7
- data
8
- error {
9
- ${ERROR_FIELDS}
10
- }
11
- }
12
- }
13
- }
14
- `;
15
- export { IS_ENTRY_LOCKED_QUERY };
16
-
17
- //# sourceMappingURL=isEntryLocked.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/isEntryLocked.js","sources":["../../../src/domain/graphql/isEntryLocked.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS } from \"~/domain/graphql/fields.js\";\nimport type { IRecordLockingError } from \"~/types.js\";\nimport type { IRecordLockingIsEntryLockedParams } from \"../abstractions/IRecordLockingIsEntryLocked.js\";\n\nexport type IRecordLockingIsEntryLockedVariables = IRecordLockingIsEntryLockedParams;\n\nexport interface IRecordLockingIsEntryLockedResponse {\n recordLocking: {\n isEntryLocked: {\n data: boolean | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const IS_ENTRY_LOCKED_QUERY = gql`\n query RecordLockingIsEntryLocked($id: ID!, $type: String!) {\n recordLocking {\n isEntryLocked(id: $id, type: $type) {\n data\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n"],"names":["IS_ENTRY_LOCKED_QUERY","gql","ERROR_FIELDS"],"mappings":";;AAgBO,MAAMA,wBAAwBC,WAAG,CAAC;;;;;;oBAMrB,EAAEC,aAAa;;;;;AAKnC,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord, IRecordLockingMeta } from "../../types.js";
2
- import type { IRecordLockingListLockRecordsParams } from "../../domain/abstractions/IRecordLockingListLockRecords.js";
3
- export interface IRecordLockingListLockedRecordsVariablesWhere {
4
- id_in?: string[];
5
- }
6
- export type IRecordLockingListLockedRecordsVariables = IRecordLockingListLockRecordsParams;
7
- export interface IRecordLockingListLockedRecordsResponse {
8
- recordLocking: {
9
- listLockRecords: {
10
- data: IRecordLockingLockRecord[] | null;
11
- error: IRecordLockingError | null;
12
- meta: IRecordLockingMeta | null;
13
- };
14
- };
15
- }
16
- export declare const createListLockRecords: () => import("graphql").DocumentNode;
17
- export declare const LIST_LOCK_RECORDS: import("graphql").DocumentNode;
@@ -1,25 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const createListLockRecords = ()=>graphql_tag`
4
- query RecordLockingListLockedRecords(
5
- $where: RecordLockingListWhereInput
6
- $sort: [RecordLockingListSorter!]
7
- $limit: Int
8
- $after: String
9
- ) {
10
- recordLocking {
11
- listLockRecords(where: $where, sort: $sort, limit: $limit, after: $after) {
12
- data {
13
- ${LOCK_RECORD_FIELDS}
14
- }
15
- error {
16
- ${ERROR_FIELDS}
17
- }
18
- }
19
- }
20
- }
21
- `;
22
- const LIST_LOCK_RECORDS = createListLockRecords();
23
- export { LIST_LOCK_RECORDS, createListLockRecords };
24
-
25
- //# sourceMappingURL=listLockRecords.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/listLockRecords.js","sources":["../../../src/domain/graphql/listLockRecords.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"~/domain/graphql/fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord, IRecordLockingMeta } from \"~/types.js\";\nimport type { IRecordLockingListLockRecordsParams } from \"~/domain/abstractions/IRecordLockingListLockRecords.js\";\n\nexport interface IRecordLockingListLockedRecordsVariablesWhere {\n id_in?: string[];\n}\n\nexport type IRecordLockingListLockedRecordsVariables = IRecordLockingListLockRecordsParams;\n\nexport interface IRecordLockingListLockedRecordsResponse {\n recordLocking: {\n listLockRecords: {\n data: IRecordLockingLockRecord[] | null;\n error: IRecordLockingError | null;\n meta: IRecordLockingMeta | null;\n };\n };\n}\n\nexport const createListLockRecords = () => {\n return gql`\n query RecordLockingListLockedRecords(\n $where: RecordLockingListWhereInput\n $sort: [RecordLockingListSorter!]\n $limit: Int\n $after: String\n ) {\n recordLocking {\n listLockRecords(where: $where, sort: $sort, limit: $limit, after: $after) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n `;\n};\n\nexport const LIST_LOCK_RECORDS = createListLockRecords();\n"],"names":["createListLockRecords","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS","LIST_LOCK_RECORDS"],"mappings":";;AAqBO,MAAMA,wBAAwB,IAC1BC,WAAG,CAAC;;;;;;;;;;wBAUS,EAAEC,mBAAmB;;;wBAGrB,EAAEC,aAAa;;;;;IAKnC,CAAC;AAGE,MAAMC,oBAAoBJ"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- import type { IRecordLockingLockEntryParams } from "../../domain/abstractions/IRecordLockingLockEntry.js";
3
- export type IRecordLockingLockEntryVariables = IRecordLockingLockEntryParams;
4
- export interface IRecordLockingLockEntryResponse {
5
- recordLocking: {
6
- lockEntry: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const createLockGraphQL: () => import("graphql").DocumentNode;
@@ -1,19 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const createLockGraphQL = ()=>graphql_tag`
4
- mutation RecordLockingLockEntry($id: ID!, $type: String!) {
5
- recordLocking {
6
- lockEntry(id: $id, type: $type) {
7
- data {
8
- ${LOCK_RECORD_FIELDS}
9
- }
10
- error {
11
- ${ERROR_FIELDS}
12
- }
13
- }
14
- }
15
- }
16
- `;
17
- export { createLockGraphQL };
18
-
19
- //# sourceMappingURL=lockEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/lockEntry.js","sources":["../../../src/domain/graphql/lockEntry.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\nimport type { IRecordLockingLockEntryParams } from \"~/domain/abstractions/IRecordLockingLockEntry.js\";\n\nexport type IRecordLockingLockEntryVariables = IRecordLockingLockEntryParams;\n\nexport interface IRecordLockingLockEntryResponse {\n recordLocking: {\n lockEntry: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const createLockGraphQL = () => {\n return gql`\n mutation RecordLockingLockEntry($id: ID!, $type: String!) {\n recordLocking {\n lockEntry(id: $id, type: $type) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n `;\n};\n"],"names":["createLockGraphQL","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":";;AAgBO,MAAMA,oBAAoB,IACtBC,WAAG,CAAC;;;;;wBAKS,EAAEC,mBAAmB;;;wBAGrB,EAAEC,aAAa;;;;;IAKnC,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- import type { IRecordLockingUnlockEntryParams } from "../abstractions/IRecordLockingUnlockEntry.js";
3
- export type IRecordLockingUnlockEntryVariables = IRecordLockingUnlockEntryParams;
4
- export interface RecordLockingUnlockEntryResponse {
5
- recordLocking: {
6
- unlockEntry: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const UNLOCK_ENTRY_MUTATION: import("graphql").DocumentNode;
@@ -1,19 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const UNLOCK_ENTRY_MUTATION = graphql_tag`
4
- mutation RecordLockingUnlockEntry($id: ID!, $type: String!, $force: Boolean) {
5
- recordLocking {
6
- unlockEntry(id: $id, type: $type, force: $force) {
7
- data {
8
- ${LOCK_RECORD_FIELDS}
9
- }
10
- error {
11
- ${ERROR_FIELDS}
12
- }
13
- }
14
- }
15
- }
16
- `;
17
- export { UNLOCK_ENTRY_MUTATION };
18
-
19
- //# sourceMappingURL=unlockEntry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/unlockEntry.js","sources":["../../../src/domain/graphql/unlockEntry.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\nimport type { IRecordLockingUnlockEntryParams } from \"../abstractions/IRecordLockingUnlockEntry.js\";\n\nexport type IRecordLockingUnlockEntryVariables = IRecordLockingUnlockEntryParams;\n\nexport interface RecordLockingUnlockEntryResponse {\n recordLocking: {\n unlockEntry: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const UNLOCK_ENTRY_MUTATION = gql`\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"],"names":["UNLOCK_ENTRY_MUTATION","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":";;AAgBO,MAAMA,wBAAwBC,WAAG,CAAC;;;;;oBAKrB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { IRecordLockingError, IRecordLockingLockRecord } from "../../types.js";
2
- import type { IRecordLockingUpdateEntryLockExecuteParams } from "../../domain/abstractions/IRecordLockingUpdateEntryLock.js";
3
- export type IRecordLockingUpdateEntryLockVariables = IRecordLockingUpdateEntryLockExecuteParams;
4
- export interface IRecordLockingUpdateEntryLockResponse {
5
- recordLocking: {
6
- updateEntryLock: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const UPDATE_ENTRY_LOCK: import("graphql").DocumentNode;
@@ -1,19 +0,0 @@
1
- import graphql_tag from "graphql-tag";
2
- import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "./fields.js";
3
- const UPDATE_ENTRY_LOCK = graphql_tag`
4
- mutation RecordLockingUpdateEntryLock($id: ID!, $type: String!) {
5
- recordLocking {
6
- updateEntryLock(id: $id, type: $type) {
7
- data {
8
- ${LOCK_RECORD_FIELDS}
9
- }
10
- error {
11
- ${ERROR_FIELDS}
12
- }
13
- }
14
- }
15
- }
16
- `;
17
- export { UPDATE_ENTRY_LOCK };
18
-
19
- //# sourceMappingURL=updateEntryLock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/graphql/updateEntryLock.js","sources":["../../../src/domain/graphql/updateEntryLock.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\nimport type { IRecordLockingUpdateEntryLockExecuteParams } from \"~/domain/abstractions/IRecordLockingUpdateEntryLock.js\";\n\nexport type IRecordLockingUpdateEntryLockVariables = IRecordLockingUpdateEntryLockExecuteParams;\n\nexport interface IRecordLockingUpdateEntryLockResponse {\n recordLocking: {\n updateEntryLock: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const UPDATE_ENTRY_LOCK = gql`\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"],"names":["UPDATE_ENTRY_LOCK","gql","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"mappings":";;AAgBO,MAAMA,oBAAoBC,WAAG,CAAC;;;;;oBAKjB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/permissionsSchema.js","sources":["../../src/domain/permissionsSchema.ts"],"sourcesContent":["import { createPermissionSchema } from \"@webiny/app-admin\";\n\nexport const RECORD_LOCKING_PERMISSIONS_SCHEMA = createPermissionSchema({\n prefix: \"recordLocking\",\n fullAccess: { canForceUnlock: true }\n});\n"],"names":["RECORD_LOCKING_PERMISSIONS_SCHEMA","createPermissionSchema"],"mappings":";AAEO,MAAMA,oCAAoCC,uBAAuB;IACpE,QAAQ;IACR,YAAY;QAAE,gBAAgB;IAAK;AACvC"}
@@ -1,3 +0,0 @@
1
- import type { IRecordLockingClient } from "../../domain/abstractions/IRecordLockingClient.js";
2
- import { ApolloClient } from "apollo-client";
3
- export declare const createRecordLockingClient: (client: IRecordLockingClient | ApolloClient<any>) => IRecordLockingClient;
@@ -1,11 +0,0 @@
1
- import { RecordLockingClient } from "../RecordLockingClient.js";
2
- import { ApolloClient } from "apollo-client";
3
- const createRecordLockingClient = (client)=>{
4
- if (client instanceof ApolloClient) return new RecordLockingClient({
5
- client
6
- });
7
- return client;
8
- };
9
- export { createRecordLockingClient };
10
-
11
- //# sourceMappingURL=createRecordLockingClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/utils/createRecordLockingClient.js","sources":["../../../src/domain/utils/createRecordLockingClient.ts"],"sourcesContent":["import type { IRecordLockingClient } from \"~/domain/abstractions/IRecordLockingClient.js\";\nimport { RecordLockingClient } from \"~/domain/RecordLockingClient.js\";\nimport { ApolloClient } from \"apollo-client\";\n\nexport const createRecordLockingClient = (client: IRecordLockingClient | ApolloClient<any>) => {\n if (client instanceof ApolloClient) {\n return new RecordLockingClient({ client });\n }\n return client;\n};\n"],"names":["createRecordLockingClient","client","ApolloClient","RecordLockingClient"],"mappings":";;AAIO,MAAMA,4BAA4B,CAACC;IACtC,IAAIA,kBAAkBC,cAClB,OAAO,IAAIC,oBAAoB;QAAEF;IAAO;IAE5C,OAAOA;AACX"}
@@ -1,6 +0,0 @@
1
- import type { IRecordLockingError } from "../../types.js";
2
- export interface IError extends Error {
3
- code?: string;
4
- data?: any;
5
- }
6
- export declare const createRecordLockingError: (error: IError | IRecordLockingError) => IRecordLockingError;
@@ -1,15 +0,0 @@
1
- const createRecordLockingError = (error)=>{
2
- if (error instanceof Error) return {
3
- message: error.message,
4
- code: error.code || "UNKNOWN_ERROR",
5
- data: error.data
6
- };
7
- return {
8
- message: error.message,
9
- code: error.code,
10
- data: error.data
11
- };
12
- };
13
- export { createRecordLockingError };
14
-
15
- //# sourceMappingURL=createRecordLockingError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain/utils/createRecordLockingError.js","sources":["../../../src/domain/utils/createRecordLockingError.ts"],"sourcesContent":["import type { IRecordLockingError } from \"~/types.js\";\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"],"names":["createRecordLockingError","error","Error"],"mappings":"AAOO,MAAMA,2BAA2B,CACpCC;IAEA,IAAIA,iBAAiBC,OACjB,OAAO;QACH,SAASD,MAAM,OAAO;QACtB,MAAMA,MAAM,IAAI,IAAI;QACpB,MAAMA,MAAM,IAAI;IACpB;IAEJ,OAAO;QACH,SAASA,MAAM,OAAO;QACtB,MAAMA,MAAM,IAAI;QAChB,MAAMA,MAAM,IAAI;IACpB;AACJ"}
package/hooks/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./useRecordLocking.js";
2
- export * from "./usePermission.js";
package/hooks/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./useRecordLocking.js";
2
- export * from "./usePermission.js";
@@ -1,3 +0,0 @@
1
- export declare const usePermission: () => {
2
- canForceUnlock: boolean;
3
- };
@@ -1,19 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useIdentity } from "@webiny/app-admin";
3
- const usePermission = ()=>{
4
- const { identity } = useIdentity();
5
- const canForceUnlock = useMemo(()=>{
6
- const hasFullAccess = !!identity.getPermission("recordLocking.*");
7
- if (hasFullAccess) return true;
8
- const permission = identity.getPermission("recordLocking");
9
- return permission?.canForceUnlock === true;
10
- }, [
11
- identity
12
- ]);
13
- return {
14
- canForceUnlock
15
- };
16
- };
17
- export { usePermission };
18
-
19
- //# sourceMappingURL=usePermission.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks/usePermission.js","sources":["../../src/hooks/usePermission.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useIdentity } from \"@webiny/app-admin\";\n\nexport const usePermission = () => {\n const { identity } = useIdentity();\n\n const canForceUnlock = useMemo(() => {\n const hasFullAccess = !!identity.getPermission(\"recordLocking.*\");\n if (hasFullAccess) {\n return true;\n }\n const permission = identity.getPermission(\"recordLocking\");\n return permission?.canForceUnlock === true;\n }, [identity]);\n\n return {\n canForceUnlock\n };\n};\n"],"names":["usePermission","identity","useIdentity","canForceUnlock","useMemo","hasFullAccess","permission"],"mappings":";;AAGO,MAAMA,gBAAgB;IACzB,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IAErB,MAAMC,iBAAiBC,QAAQ;QAC3B,MAAMC,gBAAgB,CAAC,CAACJ,SAAS,aAAa,CAAC;QAC/C,IAAII,eACA,OAAO;QAEX,MAAMC,aAAaL,SAAS,aAAa,CAAC;QAC1C,OAAOK,YAAY,mBAAmB;IAC1C,GAAG;QAACL;KAAS;IAEb,OAAO;QACHE;IACJ;AACJ"}
@@ -1,2 +0,0 @@
1
- import type { IRecordLockingContext, IPossiblyRecordLockingRecord } from "../types.js";
2
- export declare const useRecordLocking: <T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord>() => IRecordLockingContext<T>;