@webiny/api-record-locking 6.0.0-beta.0 → 6.0.0-rc.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 (296) hide show
  1. package/README.md +10 -9
  2. package/domain/LockRecord.d.ts +45 -0
  3. package/{utils/convertEntryToLockRecord.js → domain/LockRecord.js} +14 -22
  4. package/domain/LockRecord.js.map +1 -0
  5. package/domain/RecordLockingModel.d.ts +9 -0
  6. package/domain/RecordLockingModel.js +29 -0
  7. package/domain/RecordLockingModel.js.map +1 -0
  8. package/domain/abstractions.d.ts +18 -0
  9. package/domain/abstractions.js +10 -0
  10. package/domain/abstractions.js.map +1 -0
  11. package/domain/calculateExpiresOn.d.ts +1 -0
  12. package/domain/calculateExpiresOn.js +9 -0
  13. package/domain/calculateExpiresOn.js.map +1 -0
  14. package/domain/errors.d.ts +71 -0
  15. package/domain/errors.js +95 -0
  16. package/domain/errors.js.map +1 -0
  17. package/domain/index.d.ts +4 -0
  18. package/domain/index.js +6 -0
  19. package/domain/index.js.map +1 -0
  20. package/domain/types.d.ts +44 -0
  21. package/domain/types.js +12 -0
  22. package/domain/types.js.map +1 -0
  23. package/features/GetLockRecord/GetLockRecordRepository.d.ts +16 -0
  24. package/features/GetLockRecord/GetLockRecordRepository.js +37 -0
  25. package/features/GetLockRecord/GetLockRecordRepository.js.map +1 -0
  26. package/features/GetLockRecord/GetLockRecordUseCase.d.ts +12 -0
  27. package/features/GetLockRecord/GetLockRecordUseCase.js +15 -0
  28. package/features/GetLockRecord/GetLockRecordUseCase.js.map +1 -0
  29. package/features/GetLockRecord/abstractions.d.ts +41 -0
  30. package/features/GetLockRecord/abstractions.js +17 -0
  31. package/features/GetLockRecord/abstractions.js.map +1 -0
  32. package/features/GetLockRecord/feature.d.ts +1 -0
  33. package/features/GetLockRecord/feature.js +12 -0
  34. package/features/GetLockRecord/feature.js.map +1 -0
  35. package/features/GetLockRecord/index.d.ts +2 -0
  36. package/features/GetLockRecord/index.js +4 -0
  37. package/features/GetLockRecord/index.js.map +1 -0
  38. package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.d.ts +15 -0
  39. package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js +39 -0
  40. package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js.map +1 -0
  41. package/features/GetLockedEntryLockRecord/abstractions.d.ts +26 -0
  42. package/features/GetLockedEntryLockRecord/abstractions.js +13 -0
  43. package/features/GetLockedEntryLockRecord/abstractions.js.map +1 -0
  44. package/features/GetLockedEntryLockRecord/feature.d.ts +1 -0
  45. package/features/GetLockedEntryLockRecord/feature.js +10 -0
  46. package/features/GetLockedEntryLockRecord/feature.js.map +1 -0
  47. package/features/GetLockedEntryLockRecord/index.d.ts +2 -0
  48. package/features/GetLockedEntryLockRecord/index.js +4 -0
  49. package/features/GetLockedEntryLockRecord/index.js.map +1 -0
  50. package/features/IsEntryLocked/IsEntryLockedUseCase.d.ts +14 -0
  51. package/features/IsEntryLocked/IsEntryLockedUseCase.js +39 -0
  52. package/features/IsEntryLocked/IsEntryLockedUseCase.js.map +1 -0
  53. package/features/IsEntryLocked/abstractions.d.ts +24 -0
  54. package/features/IsEntryLocked/abstractions.js +12 -0
  55. package/features/IsEntryLocked/abstractions.js.map +1 -0
  56. package/features/IsEntryLocked/feature.d.ts +1 -0
  57. package/features/IsEntryLocked/feature.js +10 -0
  58. package/features/IsEntryLocked/feature.js.map +1 -0
  59. package/features/IsEntryLocked/index.d.ts +1 -0
  60. package/features/IsEntryLocked/index.js +3 -0
  61. package/features/IsEntryLocked/index.js.map +1 -0
  62. package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.d.ts +15 -0
  63. package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.js +42 -0
  64. package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.js.map +1 -0
  65. package/features/KickOutCurrentUser/abstractions.d.ts +17 -0
  66. package/features/KickOutCurrentUser/abstractions.js +9 -0
  67. package/features/KickOutCurrentUser/abstractions.js.map +1 -0
  68. package/features/KickOutCurrentUser/feature.d.ts +1 -0
  69. package/features/KickOutCurrentUser/feature.js +10 -0
  70. package/features/KickOutCurrentUser/feature.js.map +1 -0
  71. package/features/KickOutCurrentUser/index.d.ts +1 -0
  72. package/features/KickOutCurrentUser/index.js +3 -0
  73. package/features/KickOutCurrentUser/index.js.map +1 -0
  74. package/features/ListAllLockRecords/ListAllLockRecordsRepository.d.ts +16 -0
  75. package/features/ListAllLockRecords/ListAllLockRecordsRepository.js +43 -0
  76. package/features/ListAllLockRecords/ListAllLockRecordsRepository.js.map +1 -0
  77. package/features/ListAllLockRecords/ListAllLockRecordsUseCase.d.ts +11 -0
  78. package/features/ListAllLockRecords/ListAllLockRecordsUseCase.js +15 -0
  79. package/features/ListAllLockRecords/ListAllLockRecordsUseCase.js.map +1 -0
  80. package/features/ListAllLockRecords/abstractions.d.ts +40 -0
  81. package/features/ListAllLockRecords/abstractions.js +17 -0
  82. package/features/ListAllLockRecords/abstractions.js.map +1 -0
  83. package/features/ListAllLockRecords/feature.d.ts +1 -0
  84. package/features/ListAllLockRecords/feature.js +12 -0
  85. package/features/ListAllLockRecords/feature.js.map +1 -0
  86. package/features/ListAllLockRecords/index.d.ts +2 -0
  87. package/features/ListAllLockRecords/index.js +4 -0
  88. package/features/ListAllLockRecords/index.js.map +1 -0
  89. package/features/ListLockRecords/ListLockRecordsRepository.d.ts +15 -0
  90. package/features/ListLockRecords/ListLockRecordsRepository.js +43 -0
  91. package/features/ListLockRecords/ListLockRecordsRepository.js.map +1 -0
  92. package/features/ListLockRecords/ListLockRecordsUseCase.d.ts +15 -0
  93. package/features/ListLockRecords/ListLockRecordsUseCase.js +30 -0
  94. package/features/ListLockRecords/ListLockRecordsUseCase.js.map +1 -0
  95. package/features/ListLockRecords/abstractions.d.ts +45 -0
  96. package/features/ListLockRecords/abstractions.js +17 -0
  97. package/features/ListLockRecords/abstractions.js.map +1 -0
  98. package/features/ListLockRecords/feature.d.ts +1 -0
  99. package/features/ListLockRecords/feature.js +12 -0
  100. package/features/ListLockRecords/feature.js.map +1 -0
  101. package/features/ListLockRecords/index.d.ts +1 -0
  102. package/features/ListLockRecords/index.js +3 -0
  103. package/features/ListLockRecords/index.js.map +1 -0
  104. package/features/LockEntry/LockEntryEventsDecorator.d.ts +14 -0
  105. package/features/LockEntry/LockEntryEventsDecorator.js +40 -0
  106. package/features/LockEntry/LockEntryEventsDecorator.js.map +1 -0
  107. package/features/LockEntry/LockEntryRepository.d.ts +16 -0
  108. package/features/LockEntry/LockEntryRepository.js +42 -0
  109. package/features/LockEntry/LockEntryRepository.js.map +1 -0
  110. package/features/LockEntry/LockEntryUseCase.d.ts +14 -0
  111. package/features/LockEntry/LockEntryUseCase.js +36 -0
  112. package/features/LockEntry/LockEntryUseCase.js.map +1 -0
  113. package/features/LockEntry/abstractions.d.ts +41 -0
  114. package/features/LockEntry/abstractions.js +17 -0
  115. package/features/LockEntry/abstractions.js.map +1 -0
  116. package/features/LockEntry/events.d.ts +45 -0
  117. package/features/LockEntry/events.js +40 -0
  118. package/features/LockEntry/events.js.map +1 -0
  119. package/features/LockEntry/feature.d.ts +1 -0
  120. package/features/LockEntry/feature.js +14 -0
  121. package/features/LockEntry/feature.js.map +1 -0
  122. package/features/LockEntry/index.d.ts +1 -0
  123. package/features/LockEntry/index.js +3 -0
  124. package/features/LockEntry/index.js.map +1 -0
  125. package/features/RecordLockingFeature.d.ts +12 -0
  126. package/features/RecordLockingFeature.js +36 -0
  127. package/features/RecordLockingFeature.js.map +1 -0
  128. package/features/UnlockEntry/UnlockEntryEventsDecorator.d.ts +14 -0
  129. package/features/UnlockEntry/UnlockEntryEventsDecorator.js +41 -0
  130. package/features/UnlockEntry/UnlockEntryEventsDecorator.js.map +1 -0
  131. package/features/UnlockEntry/UnlockEntryRepository.d.ts +14 -0
  132. package/features/UnlockEntry/UnlockEntryRepository.js +40 -0
  133. package/features/UnlockEntry/UnlockEntryRepository.js.map +1 -0
  134. package/features/UnlockEntry/UnlockEntryUseCase.d.ts +18 -0
  135. package/features/UnlockEntry/UnlockEntryUseCase.js +81 -0
  136. package/features/UnlockEntry/UnlockEntryUseCase.js.map +1 -0
  137. package/features/UnlockEntry/abstractions.d.ts +44 -0
  138. package/features/UnlockEntry/abstractions.js +17 -0
  139. package/features/UnlockEntry/abstractions.js.map +1 -0
  140. package/features/UnlockEntry/events.d.ts +46 -0
  141. package/features/UnlockEntry/events.js +40 -0
  142. package/features/UnlockEntry/events.js.map +1 -0
  143. package/features/UnlockEntry/feature.d.ts +1 -0
  144. package/features/UnlockEntry/feature.js +14 -0
  145. package/features/UnlockEntry/feature.js.map +1 -0
  146. package/features/UnlockEntry/hasFullAccessPermission.d.ts +2 -0
  147. package/features/UnlockEntry/hasFullAccessPermission.js +10 -0
  148. package/features/UnlockEntry/hasFullAccessPermission.js.map +1 -0
  149. package/features/UnlockEntry/index.d.ts +1 -0
  150. package/features/UnlockEntry/index.js +3 -0
  151. package/features/UnlockEntry/index.js.map +1 -0
  152. package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.d.ts +14 -0
  153. package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.js +40 -0
  154. package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.js.map +1 -0
  155. package/features/UnlockEntryRequest/UnlockEntryRequestRepository.d.ts +17 -0
  156. package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js +43 -0
  157. package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js.map +1 -0
  158. package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.d.ts +16 -0
  159. package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.js +92 -0
  160. package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.js.map +1 -0
  161. package/features/UnlockEntryRequest/abstractions.d.ts +42 -0
  162. package/features/UnlockEntryRequest/abstractions.js +17 -0
  163. package/features/UnlockEntryRequest/abstractions.js.map +1 -0
  164. package/features/UnlockEntryRequest/events.d.ts +45 -0
  165. package/features/UnlockEntryRequest/events.js +40 -0
  166. package/features/UnlockEntryRequest/events.js.map +1 -0
  167. package/features/UnlockEntryRequest/feature.d.ts +1 -0
  168. package/features/UnlockEntryRequest/feature.js +14 -0
  169. package/features/UnlockEntryRequest/feature.js.map +1 -0
  170. package/features/UnlockEntryRequest/index.d.ts +3 -0
  171. package/features/UnlockEntryRequest/index.js +5 -0
  172. package/features/UnlockEntryRequest/index.js.map +1 -0
  173. package/features/UpdateEntryLock/UpdateEntryLockRepository.d.ts +20 -0
  174. package/features/UpdateEntryLock/UpdateEntryLockRepository.js +63 -0
  175. package/features/UpdateEntryLock/UpdateEntryLockRepository.js.map +1 -0
  176. package/features/UpdateEntryLock/UpdateEntryLockUseCase.d.ts +18 -0
  177. package/features/UpdateEntryLock/UpdateEntryLockUseCase.js +62 -0
  178. package/features/UpdateEntryLock/UpdateEntryLockUseCase.js.map +1 -0
  179. package/features/UpdateEntryLock/abstractions.d.ts +42 -0
  180. package/features/UpdateEntryLock/abstractions.js +17 -0
  181. package/features/UpdateEntryLock/abstractions.js.map +1 -0
  182. package/features/UpdateEntryLock/feature.d.ts +1 -0
  183. package/features/UpdateEntryLock/feature.js +12 -0
  184. package/features/UpdateEntryLock/feature.js.map +1 -0
  185. package/features/UpdateEntryLock/index.d.ts +1 -0
  186. package/features/UpdateEntryLock/index.js +3 -0
  187. package/features/UpdateEntryLock/index.js.map +1 -0
  188. package/graphql/checkPermissions.d.ts +5 -0
  189. package/graphql/checkPermissions.js +14 -0
  190. package/graphql/checkPermissions.js.map +1 -0
  191. package/{utils → graphql}/resolve.d.ts +2 -2
  192. package/graphql/resolve.js +22 -0
  193. package/graphql/resolve.js.map +1 -0
  194. package/graphql/schema.d.ts +8 -4
  195. package/graphql/schema.js +99 -61
  196. package/graphql/schema.js.map +1 -1
  197. package/index.d.ts +8 -2
  198. package/index.js +50 -26
  199. package/index.js.map +1 -1
  200. package/package.json +21 -43
  201. package/types.d.ts +14 -133
  202. package/types.js +6 -24
  203. package/types.js.map +1 -1
  204. package/utils/convertWhereCondition.d.ts +2 -2
  205. package/utils/convertWhereCondition.js +11 -14
  206. package/utils/convertWhereCondition.js.map +1 -1
  207. package/utils/getTimeout.d.ts +3 -2
  208. package/utils/getTimeout.js +11 -10
  209. package/utils/getTimeout.js.map +1 -1
  210. package/utils/lockRecordDatabaseId.js +4 -12
  211. package/utils/lockRecordDatabaseId.js.map +1 -1
  212. package/abstractions/IGetLockRecordUseCase.d.ts +0 -8
  213. package/abstractions/IGetLockRecordUseCase.js +0 -7
  214. package/abstractions/IGetLockRecordUseCase.js.map +0 -1
  215. package/abstractions/IGetLockedEntryLockRecordUseCase.d.ts +0 -8
  216. package/abstractions/IGetLockedEntryLockRecordUseCase.js +0 -7
  217. package/abstractions/IGetLockedEntryLockRecordUseCase.js.map +0 -1
  218. package/abstractions/IIsEntryLocked.d.ts +0 -8
  219. package/abstractions/IIsEntryLocked.js +0 -7
  220. package/abstractions/IIsEntryLocked.js.map +0 -1
  221. package/abstractions/IKickOutCurrentUserUseCase.d.ts +0 -5
  222. package/abstractions/IKickOutCurrentUserUseCase.js +0 -7
  223. package/abstractions/IKickOutCurrentUserUseCase.js.map +0 -1
  224. package/abstractions/IListAllLockRecordsUseCase.d.ts +0 -9
  225. package/abstractions/IListAllLockRecordsUseCase.js +0 -7
  226. package/abstractions/IListAllLockRecordsUseCase.js.map +0 -1
  227. package/abstractions/IListLockRecordsUseCase.d.ts +0 -10
  228. package/abstractions/IListLockRecordsUseCase.js +0 -7
  229. package/abstractions/IListLockRecordsUseCase.js.map +0 -1
  230. package/abstractions/ILockEntryUseCase.d.ts +0 -11
  231. package/abstractions/ILockEntryUseCase.js +0 -7
  232. package/abstractions/ILockEntryUseCase.js.map +0 -1
  233. package/abstractions/IUnlockEntryRequestUseCase.d.ts +0 -11
  234. package/abstractions/IUnlockEntryRequestUseCase.js +0 -7
  235. package/abstractions/IUnlockEntryRequestUseCase.js.map +0 -1
  236. package/abstractions/IUnlockEntryUseCase.d.ts +0 -12
  237. package/abstractions/IUnlockEntryUseCase.js +0 -7
  238. package/abstractions/IUnlockEntryUseCase.js.map +0 -1
  239. package/abstractions/IUpdateEntryLockUseCase.d.ts +0 -11
  240. package/abstractions/IUpdateEntryLockUseCase.js +0 -7
  241. package/abstractions/IUpdateEntryLockUseCase.js.map +0 -1
  242. package/crud/crud.d.ts +0 -6
  243. package/crud/crud.js +0 -188
  244. package/crud/crud.js.map +0 -1
  245. package/crud/model.d.ts +0 -2
  246. package/crud/model.js +0 -127
  247. package/crud/model.js.map +0 -1
  248. package/useCases/GetLockRecord/GetLockRecordUseCase.d.ts +0 -10
  249. package/useCases/GetLockRecord/GetLockRecordUseCase.js +0 -35
  250. package/useCases/GetLockRecord/GetLockRecordUseCase.js.map +0 -1
  251. package/useCases/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.d.ts +0 -16
  252. package/useCases/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js +0 -27
  253. package/useCases/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js.map +0 -1
  254. package/useCases/IsEntryLocked/IsEntryLockedUseCase.d.ts +0 -16
  255. package/useCases/IsEntryLocked/IsEntryLockedUseCase.js +0 -35
  256. package/useCases/IsEntryLocked/IsEntryLockedUseCase.js.map +0 -1
  257. package/useCases/KickOutCurrentUser/KickOutCurrentUserUseCase.d.ts +0 -12
  258. package/useCases/KickOutCurrentUser/KickOutCurrentUserUseCase.js +0 -46
  259. package/useCases/KickOutCurrentUser/KickOutCurrentUserUseCase.js.map +0 -1
  260. package/useCases/ListAllLockRecordsUseCase/ListAllLockRecordsUseCase.d.ts +0 -10
  261. package/useCases/ListAllLockRecordsUseCase/ListAllLockRecordsUseCase.js +0 -32
  262. package/useCases/ListAllLockRecordsUseCase/ListAllLockRecordsUseCase.js.map +0 -1
  263. package/useCases/ListLockRecordsUseCase/ListLockRecordsUseCase.d.ts +0 -14
  264. package/useCases/ListLockRecordsUseCase/ListLockRecordsUseCase.js +0 -27
  265. package/useCases/ListLockRecordsUseCase/ListLockRecordsUseCase.js.map +0 -1
  266. package/useCases/LockEntryUseCase/LockEntryUseCase.d.ts +0 -13
  267. package/useCases/LockEntryUseCase/LockEntryUseCase.js +0 -51
  268. package/useCases/LockEntryUseCase/LockEntryUseCase.js.map +0 -1
  269. package/useCases/UnlockEntryUseCase/UnlockEntryUseCase.d.ts +0 -20
  270. package/useCases/UnlockEntryUseCase/UnlockEntryUseCase.js +0 -67
  271. package/useCases/UnlockEntryUseCase/UnlockEntryUseCase.js.map +0 -1
  272. package/useCases/UnlockRequestUseCase/UnlockEntryRequestUseCase.d.ts +0 -15
  273. package/useCases/UnlockRequestUseCase/UnlockEntryRequestUseCase.js +0 -78
  274. package/useCases/UnlockRequestUseCase/UnlockEntryRequestUseCase.js.map +0 -1
  275. package/useCases/UpdateEntryLock/UpdateEntryLockUseCase.d.ts +0 -18
  276. package/useCases/UpdateEntryLock/UpdateEntryLockUseCase.js +0 -48
  277. package/useCases/UpdateEntryLock/UpdateEntryLockUseCase.js.map +0 -1
  278. package/useCases/index.d.ts +0 -28
  279. package/useCases/index.js +0 -83
  280. package/useCases/index.js.map +0 -1
  281. package/utils/calculateExpiresOn.d.ts +0 -2
  282. package/utils/calculateExpiresOn.js +0 -15
  283. package/utils/calculateExpiresOn.js.map +0 -1
  284. package/utils/checkPermissions.d.ts +0 -7
  285. package/utils/checkPermissions.js +0 -21
  286. package/utils/checkPermissions.js.map +0 -1
  287. package/utils/convertEntryToLockRecord.d.ts +0 -28
  288. package/utils/convertEntryToLockRecord.js.map +0 -1
  289. package/utils/isLockedFactory.d.ts +0 -5
  290. package/utils/isLockedFactory.js +0 -20
  291. package/utils/isLockedFactory.js.map +0 -1
  292. package/utils/resolve.js +0 -30
  293. package/utils/resolve.js.map +0 -1
  294. package/utils/validateSameIdentity.d.ts +0 -6
  295. package/utils/validateSameIdentity.js +0 -24
  296. package/utils/validateSameIdentity.js.map +0 -1
@@ -1,20 +1,21 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTimeout = void 0;
7
- const defaultTimeoutInSeconds = 1800;
1
+ const minTimeoutInSeconds = 30;
2
+ const defaultTimeoutInSeconds = 60;
8
3
  /**
9
- * In milliseconds.
4
+ * Input is in seconds.
5
+ * Output is milliseconds.
10
6
  */
11
- const getTimeout = () => {
7
+ export const getTimeout = input => {
8
+ if (input && input > 0) {
9
+ if (input < minTimeoutInSeconds) {
10
+ return minTimeoutInSeconds * 1000;
11
+ }
12
+ return input * 1000;
13
+ }
12
14
  const userDefined = process.env.WEBINY_RECORD_LOCK_TIMEOUT ? parseInt(process.env.WEBINY_RECORD_LOCK_TIMEOUT) : undefined;
13
15
  if (!userDefined || isNaN(userDefined) || userDefined <= 0) {
14
16
  return defaultTimeoutInSeconds * 1000;
15
17
  }
16
18
  return userDefined * 1000;
17
19
  };
18
- exports.getTimeout = getTimeout;
19
20
 
20
21
  //# sourceMappingURL=getTimeout.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["defaultTimeoutInSeconds","getTimeout","userDefined","process","env","WEBINY_RECORD_LOCK_TIMEOUT","parseInt","undefined","isNaN","exports"],"sources":["getTimeout.ts"],"sourcesContent":["const defaultTimeoutInSeconds = 1800;\n/**\n * In milliseconds.\n */\nexport const getTimeout = () => {\n const userDefined = process.env.WEBINY_RECORD_LOCK_TIMEOUT\n ? parseInt(process.env.WEBINY_RECORD_LOCK_TIMEOUT)\n : undefined;\n if (!userDefined || isNaN(userDefined) || userDefined <= 0) {\n return defaultTimeoutInSeconds * 1000;\n }\n return userDefined * 1000;\n};\n"],"mappings":";;;;;;AAAA,MAAMA,uBAAuB,GAAG,IAAI;AACpC;AACA;AACA;AACO,MAAMC,UAAU,GAAGA,CAAA,KAAM;EAC5B,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,0BAA0B,GACpDC,QAAQ,CAACH,OAAO,CAACC,GAAG,CAACC,0BAA0B,CAAC,GAChDE,SAAS;EACf,IAAI,CAACL,WAAW,IAAIM,KAAK,CAACN,WAAW,CAAC,IAAIA,WAAW,IAAI,CAAC,EAAE;IACxD,OAAOF,uBAAuB,GAAG,IAAI;EACzC;EACA,OAAOE,WAAW,GAAG,IAAI;AAC7B,CAAC;AAACO,OAAA,CAAAR,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["minTimeoutInSeconds","defaultTimeoutInSeconds","getTimeout","input","userDefined","process","env","WEBINY_RECORD_LOCK_TIMEOUT","parseInt","undefined","isNaN"],"sources":["getTimeout.ts"],"sourcesContent":["const minTimeoutInSeconds = 30;\nconst defaultTimeoutInSeconds = 60;\n/**\n * Input is in seconds.\n * Output is milliseconds.\n */\nexport const getTimeout = (input: number | undefined) => {\n if (input && input > 0) {\n if (input < minTimeoutInSeconds) {\n return minTimeoutInSeconds * 1000;\n }\n return input * 1000;\n }\n const userDefined = process.env.WEBINY_RECORD_LOCK_TIMEOUT\n ? parseInt(process.env.WEBINY_RECORD_LOCK_TIMEOUT)\n : undefined;\n if (!userDefined || isNaN(userDefined) || userDefined <= 0) {\n return defaultTimeoutInSeconds * 1000;\n }\n return userDefined * 1000;\n};\n"],"mappings":"AAAA,MAAMA,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,uBAAuB,GAAG,EAAE;AAClC;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,KAAyB,IAAK;EACrD,IAAIA,KAAK,IAAIA,KAAK,GAAG,CAAC,EAAE;IACpB,IAAIA,KAAK,GAAGH,mBAAmB,EAAE;MAC7B,OAAOA,mBAAmB,GAAG,IAAI;IACrC;IACA,OAAOG,KAAK,GAAG,IAAI;EACvB;EACA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,0BAA0B,GACpDC,QAAQ,CAACH,OAAO,CAACC,GAAG,CAACC,0BAA0B,CAAC,GAChDE,SAAS;EACf,IAAI,CAACL,WAAW,IAAIM,KAAK,CAACN,WAAW,CAAC,IAAIA,WAAW,IAAI,CAAC,EAAE;IACxD,OAAOH,uBAAuB,GAAG,IAAI;EACzC;EACA,OAAOG,WAAW,GAAG,IAAI;AAC7B,CAAC","ignoreList":[]}
@@ -1,24 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.removeLockRecordDatabasePrefix = exports.createLockRecordDatabaseId = void 0;
7
- var _utils = require("@webiny/utils");
1
+ import { parseIdentifier } from "@webiny/utils";
8
2
  const WBY_LM_PREFIX = "wby-lm-";
9
- const createLockRecordDatabaseId = input => {
3
+ export const createLockRecordDatabaseId = input => {
10
4
  const {
11
5
  id
12
- } = (0, _utils.parseIdentifier)(input);
6
+ } = parseIdentifier(input);
13
7
  if (id.startsWith(WBY_LM_PREFIX)) {
14
8
  return id;
15
9
  }
16
10
  return `${WBY_LM_PREFIX}${id}`;
17
11
  };
18
- exports.createLockRecordDatabaseId = createLockRecordDatabaseId;
19
- const removeLockRecordDatabasePrefix = id => {
12
+ export const removeLockRecordDatabasePrefix = id => {
20
13
  return id.replace(WBY_LM_PREFIX, "");
21
14
  };
22
- exports.removeLockRecordDatabasePrefix = removeLockRecordDatabasePrefix;
23
15
 
24
16
  //# sourceMappingURL=lockRecordDatabaseId.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","WBY_LM_PREFIX","createLockRecordDatabaseId","input","id","parseIdentifier","startsWith","exports","removeLockRecordDatabasePrefix","replace"],"sources":["lockRecordDatabaseId.ts"],"sourcesContent":["import { parseIdentifier } from \"@webiny/utils\";\n\nconst WBY_LM_PREFIX = \"wby-lm-\";\n\nexport const createLockRecordDatabaseId = (input: string): string => {\n const { id } = parseIdentifier(input);\n if (id.startsWith(WBY_LM_PREFIX)) {\n return id;\n }\n return `${WBY_LM_PREFIX}${id}`;\n};\n\nexport const removeLockRecordDatabasePrefix = (id: string) => {\n return id.replace(WBY_LM_PREFIX, \"\");\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAAG,SAAS;AAExB,MAAMC,0BAA0B,GAAIC,KAAa,IAAa;EACjE,MAAM;IAAEC;EAAG,CAAC,GAAG,IAAAC,sBAAe,EAACF,KAAK,CAAC;EACrC,IAAIC,EAAE,CAACE,UAAU,CAACL,aAAa,CAAC,EAAE;IAC9B,OAAOG,EAAE;EACb;EACA,OAAQ,GAAEH,aAAc,GAAEG,EAAG,EAAC;AAClC,CAAC;AAACG,OAAA,CAAAL,0BAAA,GAAAA,0BAAA;AAEK,MAAMM,8BAA8B,GAAIJ,EAAU,IAAK;EAC1D,OAAOA,EAAE,CAACK,OAAO,CAACR,aAAa,EAAE,EAAE,CAAC;AACxC,CAAC;AAACM,OAAA,CAAAC,8BAAA,GAAAA,8BAAA","ignoreList":[]}
1
+ {"version":3,"names":["parseIdentifier","WBY_LM_PREFIX","createLockRecordDatabaseId","input","id","startsWith","removeLockRecordDatabasePrefix","replace"],"sources":["lockRecordDatabaseId.ts"],"sourcesContent":["import { parseIdentifier } from \"@webiny/utils\";\n\nconst WBY_LM_PREFIX = \"wby-lm-\";\n\nexport const createLockRecordDatabaseId = (input: string): string => {\n const { id } = parseIdentifier(input);\n if (id.startsWith(WBY_LM_PREFIX)) {\n return id;\n }\n return `${WBY_LM_PREFIX}${id}`;\n};\n\nexport const removeLockRecordDatabasePrefix = (id: string) => {\n return id.replace(WBY_LM_PREFIX, \"\");\n};\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,eAAe;AAE/C,MAAMC,aAAa,GAAG,SAAS;AAE/B,OAAO,MAAMC,0BAA0B,GAAIC,KAAa,IAAa;EACjE,MAAM;IAAEC;EAAG,CAAC,GAAGJ,eAAe,CAACG,KAAK,CAAC;EACrC,IAAIC,EAAE,CAACC,UAAU,CAACJ,aAAa,CAAC,EAAE;IAC9B,OAAOG,EAAE;EACb;EACA,OAAO,GAAGH,aAAa,GAAGG,EAAE,EAAE;AAClC,CAAC;AAED,OAAO,MAAME,8BAA8B,GAAIF,EAAU,IAAK;EAC1D,OAAOA,EAAE,CAACG,OAAO,CAACN,aAAa,EAAE,EAAE,CAAC;AACxC,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import { IRecordLockingGetLockRecordParams, IRecordLockingLockRecord } from "../types";
2
- export declare type IGetLockRecordUseCaseExecuteParams = IRecordLockingGetLockRecordParams;
3
- export interface IGetLockRecordUseCaseExecute {
4
- (params: IGetLockRecordUseCaseExecuteParams): Promise<IRecordLockingLockRecord | null>;
5
- }
6
- export interface IGetLockRecordUseCase {
7
- execute: IGetLockRecordUseCaseExecute;
8
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IGetLockRecordUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IGetLockRecordUseCase.ts"],"sourcesContent":["import { IRecordLockingGetLockRecordParams, IRecordLockingLockRecord } from \"~/types\";\n\nexport type IGetLockRecordUseCaseExecuteParams = IRecordLockingGetLockRecordParams;\n\nexport interface IGetLockRecordUseCaseExecute {\n (params: IGetLockRecordUseCaseExecuteParams): Promise<IRecordLockingLockRecord | null>;\n}\n\nexport interface IGetLockRecordUseCase {\n execute: IGetLockRecordUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import { IRecordLockingIsLockedParams, IRecordLockingLockRecord } from "../types";
2
- export declare type IGetLockedEntryLockRecordUseCaseExecuteParams = IRecordLockingIsLockedParams;
3
- export interface IGetLockedEntryLockRecordUseCaseExecute {
4
- (params: IGetLockedEntryLockRecordUseCaseExecuteParams): Promise<IRecordLockingLockRecord | null>;
5
- }
6
- export interface IGetLockedEntryLockRecordUseCase {
7
- execute: IGetLockedEntryLockRecordUseCaseExecute;
8
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IGetLockedEntryLockRecordUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IGetLockedEntryLockRecordUseCase.ts"],"sourcesContent":["import { IRecordLockingIsLockedParams, IRecordLockingLockRecord } from \"~/types\";\n\nexport type IGetLockedEntryLockRecordUseCaseExecuteParams = IRecordLockingIsLockedParams;\n\nexport interface IGetLockedEntryLockRecordUseCaseExecute {\n (\n params: IGetLockedEntryLockRecordUseCaseExecuteParams\n ): Promise<IRecordLockingLockRecord | null>;\n}\n\nexport interface IGetLockedEntryLockRecordUseCase {\n execute: IGetLockedEntryLockRecordUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import { IRecordLockingIsLockedParams } from "../types";
2
- export declare type IIsEntryLockedUseCaseExecuteParams = IRecordLockingIsLockedParams;
3
- export interface IIsEntryLockedUseCaseExecute {
4
- (params: IIsEntryLockedUseCaseExecuteParams): Promise<boolean>;
5
- }
6
- export interface IIsEntryLockedUseCase {
7
- execute: IIsEntryLockedUseCaseExecute;
8
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IIsEntryLocked.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IIsEntryLocked.ts"],"sourcesContent":["import { IRecordLockingIsLockedParams } from \"~/types\";\n\nexport type IIsEntryLockedUseCaseExecuteParams = IRecordLockingIsLockedParams;\n\nexport interface IIsEntryLockedUseCaseExecute {\n (params: IIsEntryLockedUseCaseExecuteParams): Promise<boolean>;\n}\n\nexport interface IIsEntryLockedUseCase {\n execute: IIsEntryLockedUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- import { IRecordLockingLockRecord } from "../types";
2
- export declare type IKickOutCurrentUserUseCaseExecuteParams = IRecordLockingLockRecord;
3
- export interface IKickOutCurrentUserUseCase {
4
- execute(params: IKickOutCurrentUserUseCaseExecuteParams): Promise<void>;
5
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IKickOutCurrentUserUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IKickOutCurrentUserUseCase.ts"],"sourcesContent":["import { IRecordLockingLockRecord } from \"~/types\";\n\nexport type IKickOutCurrentUserUseCaseExecuteParams = IRecordLockingLockRecord;\n\nexport interface IKickOutCurrentUserUseCase {\n execute(params: IKickOutCurrentUserUseCaseExecuteParams): Promise<void>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import { IRecordLockingListAllLockRecordsParams, IRecordLockingListAllLockRecordsResponse } from "../types";
2
- export declare type IListAllLockRecordsUseCaseExecuteParams = IRecordLockingListAllLockRecordsParams;
3
- export declare type IListAllLockRecordsUseCaseExecuteResponse = IRecordLockingListAllLockRecordsResponse;
4
- export interface IListAllLockRecordsUseCaseExecute {
5
- (params: IListAllLockRecordsUseCaseExecuteParams): Promise<IListAllLockRecordsUseCaseExecuteResponse>;
6
- }
7
- export interface IListAllLockRecordsUseCase {
8
- execute: IListAllLockRecordsUseCaseExecute;
9
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IListAllLockRecordsUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IListAllLockRecordsUseCase.ts"],"sourcesContent":["import {\n IRecordLockingListAllLockRecordsParams,\n IRecordLockingListAllLockRecordsResponse\n} from \"~/types\";\n\nexport type IListAllLockRecordsUseCaseExecuteParams = IRecordLockingListAllLockRecordsParams;\n\nexport type IListAllLockRecordsUseCaseExecuteResponse = IRecordLockingListAllLockRecordsResponse;\n\nexport interface IListAllLockRecordsUseCaseExecute {\n (\n params: IListAllLockRecordsUseCaseExecuteParams\n ): Promise<IListAllLockRecordsUseCaseExecuteResponse>;\n}\n\nexport interface IListAllLockRecordsUseCase {\n execute: IListAllLockRecordsUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import { IListAllLockRecordsUseCaseExecuteParams } from "./IListAllLockRecordsUseCase";
2
- import { IRecordLockingListAllLockRecordsResponse } from "../types";
3
- export declare type IListLockRecordsUseCaseExecuteParams = IListAllLockRecordsUseCaseExecuteParams;
4
- export declare type IListLockRecordsUseCaseExecuteResponse = IRecordLockingListAllLockRecordsResponse;
5
- export interface IListLockRecordsUseCaseExecute {
6
- (params: IListLockRecordsUseCaseExecuteParams): Promise<IListLockRecordsUseCaseExecuteResponse>;
7
- }
8
- export interface IListLockRecordsUseCase {
9
- execute: IListLockRecordsUseCaseExecute;
10
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IListLockRecordsUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IListLockRecordsUseCase.ts"],"sourcesContent":["import { IListAllLockRecordsUseCaseExecuteParams } from \"./IListAllLockRecordsUseCase\";\nimport { IRecordLockingListAllLockRecordsResponse } from \"~/types\";\n\nexport type IListLockRecordsUseCaseExecuteParams = IListAllLockRecordsUseCaseExecuteParams;\n\nexport type IListLockRecordsUseCaseExecuteResponse = IRecordLockingListAllLockRecordsResponse;\n\nexport interface IListLockRecordsUseCaseExecute {\n (params: IListLockRecordsUseCaseExecuteParams): Promise<IListLockRecordsUseCaseExecuteResponse>;\n}\n\nexport interface IListLockRecordsUseCase {\n execute: IListLockRecordsUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from "../types";
2
- export interface ILockEntryUseCaseExecuteParams {
3
- id: string;
4
- type: IRecordLockingLockRecordEntryType;
5
- }
6
- export interface ILockEntryUseCaseExecute {
7
- (params: ILockEntryUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;
8
- }
9
- export interface ILockEntryUseCase {
10
- execute: ILockEntryUseCaseExecute;
11
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=ILockEntryUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["ILockEntryUseCase.ts"],"sourcesContent":["import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from \"~/types\";\n\nexport interface ILockEntryUseCaseExecuteParams {\n id: string;\n type: IRecordLockingLockRecordEntryType;\n}\n\nexport interface ILockEntryUseCaseExecute {\n (params: ILockEntryUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport interface ILockEntryUseCase {\n execute: ILockEntryUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from "../types";
2
- export interface IUnlockEntryRequestUseCaseExecuteParams {
3
- id: string;
4
- type: IRecordLockingLockRecordEntryType;
5
- }
6
- export interface IUnlockEntryRequestUseCaseExecute {
7
- (params: IUnlockEntryRequestUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;
8
- }
9
- export interface IUnlockEntryRequestUseCase {
10
- execute: IUnlockEntryRequestUseCaseExecute;
11
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IUnlockEntryRequestUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IUnlockEntryRequestUseCase.ts"],"sourcesContent":["import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from \"~/types\";\n\nexport interface IUnlockEntryRequestUseCaseExecuteParams {\n id: string;\n type: IRecordLockingLockRecordEntryType;\n}\n\nexport interface IUnlockEntryRequestUseCaseExecute {\n (params: IUnlockEntryRequestUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport interface IUnlockEntryRequestUseCase {\n execute: IUnlockEntryRequestUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from "../types";
2
- export interface IUnlockEntryUseCaseExecuteParams {
3
- id: string;
4
- type: IRecordLockingLockRecordEntryType;
5
- force?: boolean;
6
- }
7
- export interface IUnlockEntryUseCaseExecute {
8
- (params: IUnlockEntryUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;
9
- }
10
- export interface IUnlockEntryUseCase {
11
- execute: IUnlockEntryUseCaseExecute;
12
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IUnlockEntryUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IUnlockEntryUseCase.ts"],"sourcesContent":["import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from \"~/types\";\n\nexport interface IUnlockEntryUseCaseExecuteParams {\n id: string;\n type: IRecordLockingLockRecordEntryType;\n force?: boolean;\n}\n\nexport interface IUnlockEntryUseCaseExecute {\n (params: IUnlockEntryUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport interface IUnlockEntryUseCase {\n execute: IUnlockEntryUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from "../types";
2
- export interface IUpdateEntryLockUseCaseExecuteParams {
3
- id: string;
4
- type: IRecordLockingLockRecordEntryType;
5
- }
6
- export interface IUpdateEntryLockUseCaseExecute {
7
- (params: IUpdateEntryLockUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;
8
- }
9
- export interface IUpdateEntryLockUseCase {
10
- execute: IUpdateEntryLockUseCaseExecute;
11
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IUpdateEntryLockUseCase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IUpdateEntryLockUseCase.ts"],"sourcesContent":["import { IRecordLockingLockRecord, IRecordLockingLockRecordEntryType } from \"~/types\";\n\nexport interface IUpdateEntryLockUseCaseExecuteParams {\n id: string;\n type: IRecordLockingLockRecordEntryType;\n}\n\nexport interface IUpdateEntryLockUseCaseExecute {\n (params: IUpdateEntryLockUseCaseExecuteParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport interface IUpdateEntryLockUseCase {\n execute: IUpdateEntryLockUseCaseExecute;\n}\n"],"mappings":"","ignoreList":[]}
package/crud/crud.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Context, IRecordLocking } from "../types";
2
- interface Params {
3
- context: Pick<Context, "plugins" | "cms" | "benchmark" | "security" | "websockets">;
4
- }
5
- export declare const createRecordLockingCrud: ({ context }: Params) => Promise<IRecordLocking>;
6
- export {};
package/crud/crud.js DELETED
@@ -1,188 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createRecordLockingCrud = void 0;
7
- var _error = require("@webiny/error");
8
- var _model = require("./model");
9
- var _useCases = require("../useCases");
10
- var _pubsub = require("@webiny/pubsub");
11
- const createRecordLockingCrud = async ({
12
- context
13
- }) => {
14
- const getModel = async () => {
15
- const model = await context.cms.getModel(_model.RECORD_LOCKING_MODEL_ID);
16
- if (model) {
17
- return model;
18
- }
19
- throw new _error.WebinyError("Record Locking model not found.", "MODEL_NOT_FOUND", {
20
- modelId: _model.RECORD_LOCKING_MODEL_ID
21
- });
22
- };
23
- const getManager = async () => {
24
- return await context.cms.getEntryManager(_model.RECORD_LOCKING_MODEL_ID);
25
- };
26
- const getIdentity = () => {
27
- const identity = context.security.getIdentity();
28
- if (!identity) {
29
- throw new _error.WebinyError("Identity missing.");
30
- }
31
- return {
32
- id: identity.id,
33
- displayName: identity.displayName,
34
- type: identity.type
35
- };
36
- };
37
- const hasFullAccess = async () => {
38
- return await context.security.hasFullAccess();
39
- };
40
- const onEntryBeforeLock = (0, _pubsub.createTopic)("cms.recordLocking.onEntryBeforeLock");
41
- const onEntryAfterLock = (0, _pubsub.createTopic)("cms.recordLocking.onEntryAfterLock");
42
- const onEntryLockError = (0, _pubsub.createTopic)("cms.recordLocking.onEntryLockError");
43
- const onEntryBeforeUnlock = (0, _pubsub.createTopic)("cms.recordLocking.onEntryBeforeUnlock");
44
- const onEntryAfterUnlock = (0, _pubsub.createTopic)("cms.recordLocking.onEntryAfterUnlock");
45
- const onEntryUnlockError = (0, _pubsub.createTopic)("cms.recordLocking.onEntryUnlockError");
46
- const onEntryBeforeUnlockRequest = (0, _pubsub.createTopic)("cms.recordLocking.onEntryBeforeUnlockRequest");
47
- const onEntryAfterUnlockRequest = (0, _pubsub.createTopic)("cms.recordLocking.onEntryAfterUnlockRequest");
48
- const onEntryUnlockRequestError = (0, _pubsub.createTopic)("cms.recordLocking.onEntryUnlockRequestError");
49
- const getWebsockets = () => {
50
- return context.websockets;
51
- };
52
- const {
53
- listLockRecordsUseCase,
54
- listAllLockRecordsUseCase,
55
- getLockRecordUseCase,
56
- isEntryLockedUseCase,
57
- getLockedEntryLockRecordUseCase,
58
- lockEntryUseCase,
59
- updateEntryLockUseCase,
60
- unlockEntryUseCase,
61
- unlockEntryRequestUseCase
62
- } = (0, _useCases.createUseCases)({
63
- getIdentity,
64
- getManager,
65
- hasFullAccess,
66
- getWebsockets
67
- });
68
- const listAllLockRecords = async params => {
69
- return context.benchmark.measure("recordLocking.listAllLockRecords", async () => {
70
- return listAllLockRecordsUseCase.execute(params);
71
- });
72
- };
73
- const listLockRecords = async params => {
74
- return context.benchmark.measure("recordLocking.listLockRecords", async () => {
75
- return listLockRecordsUseCase.execute(params);
76
- });
77
- };
78
- const getLockRecord = async params => {
79
- return context.benchmark.measure("recordLocking.getLockRecord", async () => {
80
- return getLockRecordUseCase.execute(params);
81
- });
82
- };
83
- const isEntryLocked = async params => {
84
- return context.benchmark.measure("recordLocking.isEntryLocked", async () => {
85
- return isEntryLockedUseCase.execute(params);
86
- });
87
- };
88
- const getLockedEntryLockRecord = async params => {
89
- return context.benchmark.measure("recordLocking.getLockedEntryLockRecord", async () => {
90
- return getLockedEntryLockRecordUseCase.execute(params);
91
- });
92
- };
93
- const lockEntry = async params => {
94
- return context.benchmark.measure("recordLocking.lockEntry", async () => {
95
- try {
96
- await onEntryBeforeLock.publish(params);
97
- const record = await lockEntryUseCase.execute(params);
98
- await onEntryAfterLock.publish({
99
- ...params,
100
- record
101
- });
102
- return record;
103
- } catch (ex) {
104
- await onEntryLockError.publish({
105
- ...params,
106
- error: ex
107
- });
108
- throw ex;
109
- }
110
- });
111
- };
112
- const updateEntryLock = async params => {
113
- return context.benchmark.measure("recordLocking.updateEntryLock", async () => {
114
- return updateEntryLockUseCase.execute(params);
115
- });
116
- };
117
- const unlockEntry = async params => {
118
- return context.benchmark.measure("recordLocking.unlockEntry", async () => {
119
- try {
120
- await onEntryBeforeUnlock.publish({
121
- ...params,
122
- getIdentity
123
- });
124
- const record = await unlockEntryUseCase.execute(params);
125
- await onEntryAfterUnlock.publish({
126
- ...params,
127
- record
128
- });
129
- return record;
130
- } catch (ex) {
131
- await onEntryUnlockError.publish({
132
- ...params,
133
- error: ex
134
- });
135
- throw ex;
136
- }
137
- });
138
- };
139
- const unlockEntryRequest = async params => {
140
- return context.benchmark.measure("recordLocking.unlockEntryRequest", async () => {
141
- try {
142
- await onEntryBeforeUnlockRequest.publish(params);
143
- const record = await unlockEntryRequestUseCase.execute(params);
144
- await onEntryAfterUnlockRequest.publish({
145
- ...params,
146
- record
147
- });
148
- return record;
149
- } catch (ex) {
150
- await onEntryUnlockRequestError.publish({
151
- ...params,
152
- error: ex
153
- });
154
- throw ex;
155
- }
156
- });
157
- };
158
- return {
159
- /**
160
- * Lifecycle events
161
- */
162
- onEntryBeforeLock,
163
- onEntryAfterLock,
164
- onEntryLockError,
165
- onEntryBeforeUnlock,
166
- onEntryAfterUnlock,
167
- onEntryUnlockError,
168
- onEntryBeforeUnlockRequest,
169
- onEntryAfterUnlockRequest,
170
- onEntryUnlockRequestError,
171
- /**
172
- * Methods
173
- */
174
- getModel,
175
- listLockRecords,
176
- listAllLockRecords,
177
- getLockRecord,
178
- isEntryLocked,
179
- getLockedEntryLockRecord,
180
- lockEntry,
181
- updateEntryLock,
182
- unlockEntry,
183
- unlockEntryRequest
184
- };
185
- };
186
- exports.createRecordLockingCrud = createRecordLockingCrud;
187
-
188
- //# sourceMappingURL=crud.js.map
package/crud/crud.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","require","_model","_useCases","_pubsub","createRecordLockingCrud","context","getModel","model","cms","RECORD_LOCKING_MODEL_ID","WebinyError","modelId","getManager","getEntryManager","getIdentity","identity","security","id","displayName","type","hasFullAccess","onEntryBeforeLock","createTopic","onEntryAfterLock","onEntryLockError","onEntryBeforeUnlock","onEntryAfterUnlock","onEntryUnlockError","onEntryBeforeUnlockRequest","onEntryAfterUnlockRequest","onEntryUnlockRequestError","getWebsockets","websockets","listLockRecordsUseCase","listAllLockRecordsUseCase","getLockRecordUseCase","isEntryLockedUseCase","getLockedEntryLockRecordUseCase","lockEntryUseCase","updateEntryLockUseCase","unlockEntryUseCase","unlockEntryRequestUseCase","createUseCases","listAllLockRecords","params","benchmark","measure","execute","listLockRecords","getLockRecord","isEntryLocked","getLockedEntryLockRecord","lockEntry","publish","record","ex","error","updateEntryLock","unlockEntry","unlockEntryRequest","exports"],"sources":["crud.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport {\n Context,\n IGetIdentity,\n IGetWebsocketsContextCallable,\n IHasFullAccessCallable,\n IRecordLocking,\n IRecordLockingLockRecordValues,\n IRecordLockingModelManager,\n OnEntryAfterLockTopicParams,\n OnEntryAfterUnlockRequestTopicParams,\n OnEntryAfterUnlockTopicParams,\n OnEntryBeforeLockTopicParams,\n OnEntryBeforeUnlockRequestTopicParams,\n OnEntryBeforeUnlockTopicParams,\n OnEntryLockErrorTopicParams,\n OnEntryUnlockErrorTopicParams,\n OnEntryUnlockRequestErrorTopicParams\n} from \"~/types\";\nimport { RECORD_LOCKING_MODEL_ID } from \"./model\";\nimport { IGetLockRecordUseCaseExecute } from \"~/abstractions/IGetLockRecordUseCase\";\nimport { IIsEntryLockedUseCaseExecute } from \"~/abstractions/IIsEntryLocked\";\nimport { ILockEntryUseCaseExecute } from \"~/abstractions/ILockEntryUseCase\";\nimport { IUnlockEntryUseCaseExecute } from \"~/abstractions/IUnlockEntryUseCase\";\nimport { createUseCases } from \"~/useCases\";\nimport { IUnlockEntryRequestUseCaseExecute } from \"~/abstractions/IUnlockEntryRequestUseCase\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport { IListAllLockRecordsUseCaseExecute } from \"~/abstractions/IListAllLockRecordsUseCase\";\nimport { IListLockRecordsUseCaseExecute } from \"~/abstractions/IListLockRecordsUseCase\";\nimport { IUpdateEntryLockUseCaseExecute } from \"~/abstractions/IUpdateEntryLockUseCase\";\nimport { IGetLockedEntryLockRecordUseCaseExecute } from \"~/abstractions/IGetLockedEntryLockRecordUseCase\";\n\ninterface Params {\n context: Pick<Context, \"plugins\" | \"cms\" | \"benchmark\" | \"security\" | \"websockets\">;\n}\n\nexport const createRecordLockingCrud = async ({ context }: Params): Promise<IRecordLocking> => {\n const getModel = async () => {\n const model = await context.cms.getModel(RECORD_LOCKING_MODEL_ID);\n if (model) {\n return model;\n }\n throw new WebinyError(\"Record Locking model not found.\", \"MODEL_NOT_FOUND\", {\n modelId: RECORD_LOCKING_MODEL_ID\n });\n };\n\n const getManager = async (): Promise<IRecordLockingModelManager> => {\n return await context.cms.getEntryManager<IRecordLockingLockRecordValues>(\n RECORD_LOCKING_MODEL_ID\n );\n };\n\n const getIdentity: IGetIdentity = () => {\n const identity = context.security.getIdentity();\n if (!identity) {\n throw new WebinyError(\"Identity missing.\");\n }\n return {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n };\n };\n\n const hasFullAccess: IHasFullAccessCallable = async () => {\n return await context.security.hasFullAccess();\n };\n\n const onEntryBeforeLock = createTopic<OnEntryBeforeLockTopicParams>(\n \"cms.recordLocking.onEntryBeforeLock\"\n );\n const onEntryAfterLock = createTopic<OnEntryAfterLockTopicParams>(\n \"cms.recordLocking.onEntryAfterLock\"\n );\n const onEntryLockError = createTopic<OnEntryLockErrorTopicParams>(\n \"cms.recordLocking.onEntryLockError\"\n );\n\n const onEntryBeforeUnlock = createTopic<OnEntryBeforeUnlockTopicParams>(\n \"cms.recordLocking.onEntryBeforeUnlock\"\n );\n const onEntryAfterUnlock = createTopic<OnEntryAfterUnlockTopicParams>(\n \"cms.recordLocking.onEntryAfterUnlock\"\n );\n const onEntryUnlockError = createTopic<OnEntryUnlockErrorTopicParams>(\n \"cms.recordLocking.onEntryUnlockError\"\n );\n\n const onEntryBeforeUnlockRequest = createTopic<OnEntryBeforeUnlockRequestTopicParams>(\n \"cms.recordLocking.onEntryBeforeUnlockRequest\"\n );\n const onEntryAfterUnlockRequest = createTopic<OnEntryAfterUnlockRequestTopicParams>(\n \"cms.recordLocking.onEntryAfterUnlockRequest\"\n );\n const onEntryUnlockRequestError = createTopic<OnEntryUnlockRequestErrorTopicParams>(\n \"cms.recordLocking.onEntryUnlockRequestError\"\n );\n\n const getWebsockets: IGetWebsocketsContextCallable = () => {\n return context.websockets;\n };\n\n const {\n listLockRecordsUseCase,\n listAllLockRecordsUseCase,\n getLockRecordUseCase,\n isEntryLockedUseCase,\n getLockedEntryLockRecordUseCase,\n lockEntryUseCase,\n updateEntryLockUseCase,\n unlockEntryUseCase,\n unlockEntryRequestUseCase\n } = createUseCases({\n getIdentity,\n getManager,\n hasFullAccess,\n getWebsockets\n });\n\n const listAllLockRecords: IListAllLockRecordsUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.listAllLockRecords\", async () => {\n return listAllLockRecordsUseCase.execute(params);\n });\n };\n\n const listLockRecords: IListLockRecordsUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.listLockRecords\", async () => {\n return listLockRecordsUseCase.execute(params);\n });\n };\n\n const getLockRecord: IGetLockRecordUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.getLockRecord\", async () => {\n return getLockRecordUseCase.execute(params);\n });\n };\n\n const isEntryLocked: IIsEntryLockedUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.isEntryLocked\", async () => {\n return isEntryLockedUseCase.execute(params);\n });\n };\n\n const getLockedEntryLockRecord: IGetLockedEntryLockRecordUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.getLockedEntryLockRecord\", async () => {\n return getLockedEntryLockRecordUseCase.execute(params);\n });\n };\n\n const lockEntry: ILockEntryUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.lockEntry\", async () => {\n try {\n await onEntryBeforeLock.publish(params);\n const record = await lockEntryUseCase.execute(params);\n await onEntryAfterLock.publish({\n ...params,\n record\n });\n return record;\n } catch (ex) {\n await onEntryLockError.publish({\n ...params,\n error: ex\n });\n throw ex;\n }\n });\n };\n\n const updateEntryLock: IUpdateEntryLockUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.updateEntryLock\", async () => {\n return updateEntryLockUseCase.execute(params);\n });\n };\n\n const unlockEntry: IUnlockEntryUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.unlockEntry\", async () => {\n try {\n await onEntryBeforeUnlock.publish({\n ...params,\n getIdentity\n });\n const record = await unlockEntryUseCase.execute(params);\n await onEntryAfterUnlock.publish({\n ...params,\n record\n });\n return record;\n } catch (ex) {\n await onEntryUnlockError.publish({\n ...params,\n error: ex\n });\n throw ex;\n }\n });\n };\n\n const unlockEntryRequest: IUnlockEntryRequestUseCaseExecute = async params => {\n return context.benchmark.measure(\"recordLocking.unlockEntryRequest\", async () => {\n try {\n await onEntryBeforeUnlockRequest.publish(params);\n const record = await unlockEntryRequestUseCase.execute(params);\n await onEntryAfterUnlockRequest.publish({\n ...params,\n record\n });\n return record;\n } catch (ex) {\n await onEntryUnlockRequestError.publish({\n ...params,\n error: ex\n });\n throw ex;\n }\n });\n };\n\n return {\n /**\n * Lifecycle events\n */\n onEntryBeforeLock,\n onEntryAfterLock,\n onEntryLockError,\n onEntryBeforeUnlock,\n onEntryAfterUnlock,\n onEntryUnlockError,\n onEntryBeforeUnlockRequest,\n onEntryAfterUnlockRequest,\n onEntryUnlockRequestError,\n /**\n * Methods\n */\n getModel,\n listLockRecords,\n listAllLockRecords,\n getLockRecord,\n isEntryLocked,\n getLockedEntryLockRecord,\n lockEntry,\n updateEntryLock,\n unlockEntry,\n unlockEntryRequest\n };\n};\n"],"mappings":"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","ignoreList":[]}
package/crud/model.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const RECORD_LOCKING_MODEL_ID = "wby_recordLocking";
2
- export declare const createLockingModel: () => import("@webiny/api-headless-cms").CmsModelPlugin;