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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) 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.js +15 -0
  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} +4 -3
  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 +3 -2
  61. package/features/permissions/abstractions.js.map +1 -1
  62. package/features/permissions/feature.js +3 -2
  63. package/features/permissions/feature.js.map +1 -1
  64. package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
  65. package/features/releaseLock/ReleaseLockGateway.js +44 -0
  66. package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
  67. package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
  68. package/features/releaseLock/ReleaseLockUseCase.js +18 -0
  69. package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
  70. package/features/releaseLock/abstractions.d.ts +19 -0
  71. package/features/releaseLock/abstractions.js +6 -0
  72. package/features/releaseLock/abstractions.js.map +1 -0
  73. package/features/releaseLock/feature.d.ts +3 -0
  74. package/features/releaseLock/feature.js +19 -0
  75. package/features/releaseLock/feature.js.map +1 -0
  76. package/index.d.ts +0 -5
  77. package/index.js +20 -27
  78. package/index.js.map +1 -1
  79. package/package.json +18 -20
  80. package/permissions/permissionsSchema.js +10 -0
  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 +25 -0
  110. package/presentation/listLocking/ContentEntriesPresenterDecorator.js +70 -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 +4 -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/types.js +0 -3
  129. package/components/HeadlessCmsActionsAcoCell.d.ts +0 -2
  130. package/components/HeadlessCmsActionsAcoCell.js +0 -60
  131. package/components/HeadlessCmsActionsAcoCell.js.map +0 -1
  132. package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +0 -9
  133. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +0 -42
  134. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +0 -1
  135. package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +0 -18
  136. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +0 -99
  137. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +0 -1
  138. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.d.ts +0 -2
  139. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +0 -68
  140. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +0 -1
  141. package/components/HeadlessCmsContentEntry/index.d.ts +0 -1
  142. package/components/HeadlessCmsContentEntry/index.js +0 -3
  143. package/components/HeadlessCmsContentEntry/index.js.map +0 -1
  144. package/components/LockedRecord/LockedRecord.d.ts +0 -6
  145. package/components/LockedRecord/LockedRecord.js +0 -66
  146. package/components/LockedRecord/LockedRecord.js.map +0 -1
  147. package/components/LockedRecord/LockedRecordForceUnlock.d.ts +0 -9
  148. package/components/LockedRecord/LockedRecordForceUnlock.js +0 -71
  149. package/components/LockedRecord/LockedRecordForceUnlock.js.map +0 -1
  150. package/components/LockedRecord/index.d.ts +0 -1
  151. package/components/LockedRecord/index.js +0 -3
  152. package/components/LockedRecord/index.js.map +0 -1
  153. package/components/RecordLockingProvider.d.ts +0 -7
  154. package/components/RecordLockingProvider.js +0 -125
  155. package/components/RecordLockingProvider.js.map +0 -1
  156. package/components/SecurityPermissions.js +0 -18
  157. package/components/SecurityPermissions.js.map +0 -1
  158. package/components/decorators/UseContentEntriesListHookDecorator.d.ts +0 -1
  159. package/components/decorators/UseContentEntriesListHookDecorator.js +0 -23
  160. package/components/decorators/UseContentEntriesListHookDecorator.js.map +0 -1
  161. package/components/decorators/UseRecordsDecorator.d.ts +0 -8
  162. package/components/decorators/UseRecordsDecorator.js +0 -25
  163. package/components/decorators/UseRecordsDecorator.js.map +0 -1
  164. package/components/decorators/UseSaveEntryDecorator.d.ts +0 -1
  165. package/components/decorators/UseSaveEntryDecorator.js +0 -55
  166. package/components/decorators/UseSaveEntryDecorator.js.map +0 -1
  167. package/domain/RecordLocking.d.ts +0 -28
  168. package/domain/RecordLocking.js +0 -321
  169. package/domain/RecordLocking.js.map +0 -1
  170. package/domain/RecordLockingClient.d.ts +0 -12
  171. package/domain/RecordLockingClient.js +0 -19
  172. package/domain/RecordLockingClient.js.map +0 -1
  173. package/domain/RecordLockingGetLockRecord.d.ts +0 -11
  174. package/domain/RecordLockingGetLockRecord.js +0 -21
  175. package/domain/RecordLockingGetLockRecord.js.map +0 -1
  176. package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +0 -11
  177. package/domain/RecordLockingGetLockedEntryLockRecord.js +0 -19
  178. package/domain/RecordLockingGetLockedEntryLockRecord.js.map +0 -1
  179. package/domain/RecordLockingIsEntryLocked.d.ts +0 -11
  180. package/domain/RecordLockingIsEntryLocked.js +0 -19
  181. package/domain/RecordLockingIsEntryLocked.js.map +0 -1
  182. package/domain/RecordLockingListLockRecords.d.ts +0 -12
  183. package/domain/RecordLockingListLockRecords.js +0 -31
  184. package/domain/RecordLockingListLockRecords.js.map +0 -1
  185. package/domain/RecordLockingLockEntry.d.ts +0 -11
  186. package/domain/RecordLockingLockEntry.js +0 -13
  187. package/domain/RecordLockingLockEntry.js.map +0 -1
  188. package/domain/RecordLockingUnlockEntry.d.ts +0 -11
  189. package/domain/RecordLockingUnlockEntry.js +0 -19
  190. package/domain/RecordLockingUnlockEntry.js.map +0 -1
  191. package/domain/RecordLockingUpdateEntryLock.d.ts +0 -11
  192. package/domain/RecordLockingUpdateEntryLock.js +0 -19
  193. package/domain/RecordLockingUpdateEntryLock.js.map +0 -1
  194. package/domain/abstractions/IRecordLocking.d.ts +0 -25
  195. package/domain/abstractions/IRecordLocking.js +0 -3
  196. package/domain/abstractions/IRecordLocking.js.map +0 -1
  197. package/domain/abstractions/IRecordLockingClient.d.ts +0 -6
  198. package/domain/abstractions/IRecordLockingClient.js +0 -3
  199. package/domain/abstractions/IRecordLockingClient.js.map +0 -1
  200. package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +0 -12
  201. package/domain/abstractions/IRecordLockingGetLockRecord.js +0 -3
  202. package/domain/abstractions/IRecordLockingGetLockRecord.js.map +0 -1
  203. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +0 -12
  204. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +0 -3
  205. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js.map +0 -1
  206. package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +0 -8
  207. package/domain/abstractions/IRecordLockingIsEntryLocked.js +0 -3
  208. package/domain/abstractions/IRecordLockingIsEntryLocked.js.map +0 -1
  209. package/domain/abstractions/IRecordLockingListLockRecords.d.ts +0 -19
  210. package/domain/abstractions/IRecordLockingListLockRecords.js +0 -3
  211. package/domain/abstractions/IRecordLockingListLockRecords.js.map +0 -1
  212. package/domain/abstractions/IRecordLockingLockEntry.d.ts +0 -12
  213. package/domain/abstractions/IRecordLockingLockEntry.js +0 -3
  214. package/domain/abstractions/IRecordLockingLockEntry.js.map +0 -1
  215. package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +0 -13
  216. package/domain/abstractions/IRecordLockingUnlockEntry.js +0 -3
  217. package/domain/abstractions/IRecordLockingUnlockEntry.js.map +0 -1
  218. package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +0 -12
  219. package/domain/abstractions/IRecordLockingUpdateEntryLock.js +0 -3
  220. package/domain/abstractions/IRecordLockingUpdateEntryLock.js.map +0 -1
  221. package/domain/graphql/fields.js.map +0 -1
  222. package/domain/graphql/getLockRecord.d.ts +0 -12
  223. package/domain/graphql/getLockRecord.js +0 -18
  224. package/domain/graphql/getLockRecord.js.map +0 -1
  225. package/domain/graphql/getLockedEntryLockRecord.d.ts +0 -12
  226. package/domain/graphql/getLockedEntryLockRecord.js +0 -18
  227. package/domain/graphql/getLockedEntryLockRecord.js.map +0 -1
  228. package/domain/graphql/isEntryLocked.d.ts +0 -12
  229. package/domain/graphql/isEntryLocked.js +0 -16
  230. package/domain/graphql/isEntryLocked.js.map +0 -1
  231. package/domain/graphql/listLockRecords.d.ts +0 -17
  232. package/domain/graphql/listLockRecords.js +0 -26
  233. package/domain/graphql/listLockRecords.js.map +0 -1
  234. package/domain/graphql/lockEntry.d.ts +0 -12
  235. package/domain/graphql/lockEntry.js +0 -20
  236. package/domain/graphql/lockEntry.js.map +0 -1
  237. package/domain/graphql/unlockEntry.d.ts +0 -12
  238. package/domain/graphql/unlockEntry.js +0 -18
  239. package/domain/graphql/unlockEntry.js.map +0 -1
  240. package/domain/graphql/updateEntryLock.d.ts +0 -12
  241. package/domain/graphql/updateEntryLock.js +0 -18
  242. package/domain/graphql/updateEntryLock.js.map +0 -1
  243. package/domain/permissionsSchema.js +0 -9
  244. package/domain/permissionsSchema.js.map +0 -1
  245. package/domain/utils/createRecordLockingClient.d.ts +0 -3
  246. package/domain/utils/createRecordLockingClient.js +0 -12
  247. package/domain/utils/createRecordLockingClient.js.map +0 -1
  248. package/domain/utils/createRecordLockingError.d.ts +0 -6
  249. package/domain/utils/createRecordLockingError.js +0 -16
  250. package/domain/utils/createRecordLockingError.js.map +0 -1
  251. package/hooks/index.d.ts +0 -2
  252. package/hooks/index.js +0 -4
  253. package/hooks/index.js.map +0 -1
  254. package/hooks/usePermission.d.ts +0 -3
  255. package/hooks/usePermission.js +0 -20
  256. package/hooks/usePermission.js.map +0 -1
  257. package/hooks/useRecordLocking.d.ts +0 -2
  258. package/hooks/useRecordLocking.js +0 -12
  259. package/hooks/useRecordLocking.js.map +0 -1
  260. package/types.js.map +0 -1
  261. package/utils/createCacheKey.d.ts +0 -3
  262. package/utils/createCacheKey.js +0 -15
  263. package/utils/createCacheKey.js.map +0 -1
  264. /package/{components/SecurityPermissions.d.ts → SecurityPermissions.d.ts} +0 -0
  265. /package/{domain/graphql/fields.d.ts → features/graphqlFields.d.ts} +0 -0
  266. /package/{domain → permissions}/permissionsSchema.d.ts +0 -0
@@ -1,12 +0,0 @@
1
- import { RecordLockingClient } from "../RecordLockingClient.js";
2
- import { ApolloClient } from "apollo-client";
3
- export const createRecordLockingClient = client => {
4
- if (client instanceof ApolloClient) {
5
- return new RecordLockingClient({
6
- client
7
- });
8
- }
9
- return client;
10
- };
11
-
12
- //# sourceMappingURL=createRecordLockingClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["RecordLockingClient","ApolloClient","createRecordLockingClient","client"],"sources":["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"],"mappings":"AACA,SAASA,mBAAmB;AAC5B,SAASC,YAAY,QAAQ,eAAe;AAE5C,OAAO,MAAMC,yBAAyB,GAAIC,MAAgD,IAAK;EAC3F,IAAIA,MAAM,YAAYF,YAAY,EAAE;IAChC,OAAO,IAAID,mBAAmB,CAAC;MAAEG;IAAO,CAAC,CAAC;EAC9C;EACA,OAAOA,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -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,16 +0,0 @@
1
- export const createRecordLockingError = error => {
2
- if (error instanceof Error) {
3
- return {
4
- message: error.message,
5
- code: error.code || "UNKNOWN_ERROR",
6
- data: error.data
7
- };
8
- }
9
- return {
10
- message: error.message,
11
- code: error.code,
12
- data: error.data
13
- };
14
- };
15
-
16
- //# sourceMappingURL=createRecordLockingError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createRecordLockingError","error","Error","message","code","data"],"sources":["createRecordLockingError.ts"],"sourcesContent":["import type { IRecordLockingError } from \"~/types.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"],"mappings":"AAOA,OAAO,MAAMA,wBAAwB,GACjCC,KAAmC,IACb;EACtB,IAAIA,KAAK,YAAYC,KAAK,EAAE;IACxB,OAAO;MACHC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI,IAAI,eAAe;MACnCC,IAAI,EAAEJ,KAAK,CAACI;IAChB,CAAC;EACL;EACA,OAAO;IACHF,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,IAAI,EAAEJ,KAAK,CAACI;EAChB,CAAC;AACL,CAAC","ignoreList":[]}
package/hooks/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./useRecordLocking.js";
2
- export * from "./usePermission.js";
package/hooks/index.js DELETED
@@ -1,4 +0,0 @@
1
- export * from "./useRecordLocking.js";
2
- export * from "./usePermission.js";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useRecordLocking.js\";\nexport * from \"./usePermission.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export declare const usePermission: () => {
2
- canForceUnlock: boolean;
3
- };
@@ -1,20 +0,0 @@
1
- import { useMemo } from "react";
2
- import { useIdentity } from "@webiny/app-admin";
3
- export const usePermission = () => {
4
- const {
5
- identity
6
- } = useIdentity();
7
- const canForceUnlock = useMemo(() => {
8
- const hasFullAccess = !!identity.getPermission("recordLocking.*");
9
- if (hasFullAccess) {
10
- return true;
11
- }
12
- const permission = identity.getPermission("recordLocking");
13
- return permission?.canForceUnlock === true;
14
- }, [identity]);
15
- return {
16
- canForceUnlock
17
- };
18
- };
19
-
20
- //# sourceMappingURL=usePermission.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useMemo","useIdentity","usePermission","identity","canForceUnlock","hasFullAccess","getPermission","permission"],"sources":["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"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,WAAW,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC;EAAS,CAAC,GAAGF,WAAW,CAAC,CAAC;EAElC,MAAMG,cAAc,GAAGJ,OAAO,CAAC,MAAM;IACjC,MAAMK,aAAa,GAAG,CAAC,CAACF,QAAQ,CAACG,aAAa,CAAC,iBAAiB,CAAC;IACjE,IAAID,aAAa,EAAE;MACf,OAAO,IAAI;IACf;IACA,MAAME,UAAU,GAAGJ,QAAQ,CAACG,aAAa,CAAC,eAAe,CAAC;IAC1D,OAAOC,UAAU,EAAEH,cAAc,KAAK,IAAI;EAC9C,CAAC,EAAE,CAACD,QAAQ,CAAC,CAAC;EAEd,OAAO;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { IRecordLockingContext, IPossiblyRecordLockingRecord } from "../types.js";
2
- export declare const useRecordLocking: <T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord>() => IRecordLockingContext<T>;
@@ -1,12 +0,0 @@
1
- import { WebinyError } from "@webiny/error";
2
- import { useContext } from "react";
3
- import { RecordLockingContext } from "../components/RecordLockingProvider.js";
4
- export const useRecordLocking = () => {
5
- const context = useContext(RecordLockingContext);
6
- if (!context) {
7
- throw new WebinyError("useRecordLocking must be used within a RecordLockingProvider.");
8
- }
9
- return context;
10
- };
11
-
12
- //# sourceMappingURL=useRecordLocking.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","useContext","RecordLockingContext","useRecordLocking","context"],"sources":["useRecordLocking.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { useContext } from \"react\";\nimport { RecordLockingContext } from \"~/components/RecordLockingProvider.js\";\nimport type { IRecordLockingContext, IPossiblyRecordLockingRecord } from \"~/types.js\";\n\nexport const useRecordLocking = <\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n>() => {\n const context = useContext(RecordLockingContext);\n if (!context) {\n throw new WebinyError(\"useRecordLocking must be used within a RecordLockingProvider.\");\n }\n return context as IRecordLockingContext<T>;\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,OAAO;AAClC,SAASC,oBAAoB;AAG7B,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAEzB;EACH,MAAMC,OAAO,GAAGH,UAAU,CAACC,oBAAoB,CAAC;EAChD,IAAI,CAACE,OAAO,EAAE;IACV,MAAM,IAAIJ,WAAW,CAAC,+DAA+D,CAAC;EAC1F;EACA,OAAOI,OAAO;AAClB,CAAC","ignoreList":[]}
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsContentEntry } from \"@webiny/app-headless-cms/types.js\";\nimport type { GenericRecord } from \"@webiny/app/types.js\";\nimport type { IRecordLockingUnlockEntryResult } from \"~/domain/abstractions/IRecordLockingUnlockEntry.js\";\nimport type { IRecordLockingUpdateEntryLockResult } from \"~/domain/abstractions/IRecordLocking.js\";\nimport { Identity } from \"@webiny/app-admin/domain/Identity.js\";\n\nexport interface IRecordLockingIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IRecordLockingRecordLocked {\n lockedBy: IRecordLockingIdentity;\n lockedOn: string;\n expiresOn: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IRecordLockingCmsEntryValuesAction {\n type: string;\n message: string;\n createdBy: Identity;\n createdOn: string;\n}\n\nexport interface IRecordLockingCmsEntryValues {\n lockedBy: Identity;\n lockedOn: string;\n updatedOn: string;\n expiresOn: string;\n targetId: string;\n type: string;\n actions: IRecordLockingCmsEntryValuesAction;\n}\n\nexport interface IPossiblyRecordLockingRecord extends CmsContentEntry<IRecordLockingCmsEntryValues> {\n $selectable?: boolean;\n $type?: \"RECORD\";\n $lockingType?: string;\n $locked?: IRecordLockingRecordLocked | null;\n}\n\nexport interface IRecordLockingRecord extends IPossiblyRecordLockingRecord {\n $lockingType: string;\n}\n\nexport type IIsRecordLockedParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUpdateEntryLockParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUnlockEntryParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockedEntryLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport interface IFetchLockRecordResult {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n}\n\nexport interface IRecordLockingContext<\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n> {\n readonly loading: boolean;\n readonly records: IPossiblyRecordLockingRecord[];\n readonly error?: IRecordLockingError | null;\n setRecords(folderId: string, type: string, records: T[]): Promise<void>;\n updateEntryLock(params: IUpdateEntryLockParams): Promise<IRecordLockingUpdateEntryLockResult>;\n isRecordLocked(params?: IIsRecordLockedParams): boolean;\n getLockRecordEntry(id: string): IRecordLockingRecord | undefined;\n fetchLockRecord(params: IFetchLockRecordParams): Promise<IFetchLockRecordResult>;\n fetchLockedEntryLockRecord(\n params: IFetchLockedEntryLockRecordParams\n ): Promise<IRecordLockingLockRecord | null>;\n unlockEntry(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n removeEntryLock(params: IUnlockEntryParams): void;\n unlockEntryForce(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n isLockExpired(input: Date | string): boolean;\n}\n\nexport interface IRecordLockingLockRecordAction {\n type: string;\n message: string;\n createdBy: IRecordLockingIdentity;\n createdOn: string;\n}\n\nexport interface IRecordLockingLockRecord {\n id: string;\n lockedOn: string;\n expiresOn: string;\n lockedBy: IRecordLockingIdentity;\n targetId: string;\n type: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IRecordLockingMeta {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\nexport interface IRecordLockingError<T = GenericRecord> {\n message: string;\n code: string;\n data?: T;\n}\n\nexport interface RecordLockingSecurityPermission extends Identity.Permission {\n canForceUnlock?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { GenericRecord } from "@webiny/app/types.js";
2
- export type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];
3
- export declare const createCacheKey: (input: ICreateCacheKeyInput) => Promise<string>;
@@ -1,15 +0,0 @@
1
- import { sha1 } from "crypto-hash";
2
- const createKey = input => {
3
- if (typeof input === "string") {
4
- return input;
5
- }
6
- return JSON.stringify(input);
7
- };
8
- export const createCacheKey = input => {
9
- const key = createKey(input);
10
- return sha1(key, {
11
- outputFormat: "hex"
12
- });
13
- };
14
-
15
- //# sourceMappingURL=createCacheKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["sha1","createKey","input","JSON","stringify","createCacheKey","key","outputFormat"],"sources":["createCacheKey.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/app/types.js\";\nimport { sha1 } from \"crypto-hash\";\n\nexport type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];\n\nconst createKey = (input: ICreateCacheKeyInput): string => {\n if (typeof input === \"string\") {\n return input;\n }\n return JSON.stringify(input);\n};\n\nexport const createCacheKey = (input: ICreateCacheKeyInput): Promise<string> => {\n const key = createKey(input);\n\n return sha1(key, {\n outputFormat: \"hex\"\n });\n};\n"],"mappings":"AACA,SAASA,IAAI,QAAQ,aAAa;AAIlC,MAAMC,SAAS,GAAIC,KAA2B,IAAa;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAED,OAAO,MAAMG,cAAc,GAAIH,KAA2B,IAAsB;EAC5E,MAAMI,GAAG,GAAGL,SAAS,CAACC,KAAK,CAAC;EAE5B,OAAOF,IAAI,CAACM,GAAG,EAAE;IACbC,YAAY,EAAE;EAClB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
File without changes