@webiny/app-record-locking 0.0.0-unstable.0156a4c312

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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/RecordLockingModule.d.ts +2 -0
  4. package/RecordLockingModule.js +74 -0
  5. package/RecordLockingModule.js.map +1 -0
  6. package/SecurityPermissions.d.ts +2 -0
  7. package/SecurityPermissions.js +15 -0
  8. package/SecurityPermissions.js.map +1 -0
  9. package/features/acquireLock/AcquireLockGateway.d.ts +12 -0
  10. package/features/acquireLock/AcquireLockGateway.js +43 -0
  11. package/features/acquireLock/AcquireLockGateway.js.map +1 -0
  12. package/features/acquireLock/AcquireLockUseCase.d.ts +10 -0
  13. package/features/acquireLock/AcquireLockUseCase.js +18 -0
  14. package/features/acquireLock/AcquireLockUseCase.js.map +1 -0
  15. package/features/acquireLock/abstractions.d.ts +19 -0
  16. package/features/acquireLock/abstractions.js +6 -0
  17. package/features/acquireLock/abstractions.js.map +1 -0
  18. package/features/acquireLock/feature.d.ts +3 -0
  19. package/features/acquireLock/feature.js +19 -0
  20. package/features/acquireLock/feature.js.map +1 -0
  21. package/features/checkLockStatus/CheckLockStatusGateway.d.ts +12 -0
  22. package/features/checkLockStatus/CheckLockStatusGateway.js +43 -0
  23. package/features/checkLockStatus/CheckLockStatusGateway.js.map +1 -0
  24. package/features/checkLockStatus/CheckLockStatusUseCase.d.ts +10 -0
  25. package/features/checkLockStatus/CheckLockStatusUseCase.js +18 -0
  26. package/features/checkLockStatus/CheckLockStatusUseCase.js.map +1 -0
  27. package/features/checkLockStatus/abstractions.d.ts +19 -0
  28. package/features/checkLockStatus/abstractions.js +6 -0
  29. package/features/checkLockStatus/abstractions.js.map +1 -0
  30. package/features/checkLockStatus/feature.d.ts +3 -0
  31. package/features/checkLockStatus/feature.js +19 -0
  32. package/features/checkLockStatus/feature.js.map +1 -0
  33. package/features/feature.d.ts +1 -0
  34. package/features/feature.js +19 -0
  35. package/features/feature.js.map +1 -0
  36. package/features/forceUnlock/ForceUnlockGateway.d.ts +12 -0
  37. package/features/forceUnlock/ForceUnlockGateway.js +44 -0
  38. package/features/forceUnlock/ForceUnlockGateway.js.map +1 -0
  39. package/features/forceUnlock/ForceUnlockUseCase.d.ts +10 -0
  40. package/features/forceUnlock/ForceUnlockUseCase.js +18 -0
  41. package/features/forceUnlock/ForceUnlockUseCase.js.map +1 -0
  42. package/features/forceUnlock/abstractions.d.ts +19 -0
  43. package/features/forceUnlock/abstractions.js +6 -0
  44. package/features/forceUnlock/abstractions.js.map +1 -0
  45. package/features/forceUnlock/feature.d.ts +3 -0
  46. package/features/forceUnlock/feature.js +19 -0
  47. package/features/forceUnlock/feature.js.map +1 -0
  48. package/features/graphqlFields.d.ts +2 -0
  49. package/features/graphqlFields.js +31 -0
  50. package/features/graphqlFields.js.map +1 -0
  51. package/features/listLockRecords/ListLockRecordsGateway.d.ts +12 -0
  52. package/features/listLockRecords/ListLockRecordsGateway.js +48 -0
  53. package/features/listLockRecords/ListLockRecordsGateway.js.map +1 -0
  54. package/features/listLockRecords/ListLockRecordsUseCase.d.ts +10 -0
  55. package/features/listLockRecords/ListLockRecordsUseCase.js +18 -0
  56. package/features/listLockRecords/ListLockRecordsUseCase.js.map +1 -0
  57. package/features/listLockRecords/abstractions.d.ts +22 -0
  58. package/features/listLockRecords/abstractions.js +6 -0
  59. package/features/listLockRecords/abstractions.js.map +1 -0
  60. package/features/listLockRecords/feature.d.ts +3 -0
  61. package/features/listLockRecords/feature.js +19 -0
  62. package/features/listLockRecords/feature.js.map +1 -0
  63. package/features/permissions/abstractions.d.ts +17 -0
  64. package/features/permissions/abstractions.js +6 -0
  65. package/features/permissions/abstractions.js.map +1 -0
  66. package/features/permissions/feature.d.ts +14 -0
  67. package/features/permissions/feature.js +7 -0
  68. package/features/permissions/feature.js.map +1 -0
  69. package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
  70. package/features/releaseLock/ReleaseLockGateway.js +44 -0
  71. package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
  72. package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
  73. package/features/releaseLock/ReleaseLockUseCase.js +18 -0
  74. package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
  75. package/features/releaseLock/abstractions.d.ts +19 -0
  76. package/features/releaseLock/abstractions.js +6 -0
  77. package/features/releaseLock/abstractions.js.map +1 -0
  78. package/features/releaseLock/feature.d.ts +3 -0
  79. package/features/releaseLock/feature.js +19 -0
  80. package/features/releaseLock/feature.js.map +1 -0
  81. package/index.d.ts +2 -0
  82. package/index.js +24 -0
  83. package/index.js.map +1 -0
  84. package/package.json +45 -0
  85. package/permissions/permissionsSchema.d.ts +6 -0
  86. package/permissions/permissionsSchema.js +10 -0
  87. package/permissions/permissionsSchema.js.map +1 -0
  88. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.d.ts +23 -0
  89. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js +64 -0
  90. package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js.map +1 -0
  91. package/presentation/entryLocking/RecordLockingPresenter.d.ts +32 -0
  92. package/presentation/entryLocking/RecordLockingPresenter.js +164 -0
  93. package/presentation/entryLocking/RecordLockingPresenter.js.map +1 -0
  94. package/presentation/entryLocking/SingleEntryContentDecorator.d.ts +2 -0
  95. package/presentation/entryLocking/SingleEntryContentDecorator.js +72 -0
  96. package/presentation/entryLocking/SingleEntryContentDecorator.js.map +1 -0
  97. package/presentation/entryLocking/SingleEntryPresenterDecorator.d.ts +15 -0
  98. package/presentation/entryLocking/SingleEntryPresenterDecorator.js +40 -0
  99. package/presentation/entryLocking/SingleEntryPresenterDecorator.js.map +1 -0
  100. package/presentation/entryLocking/abstractions.d.ts +26 -0
  101. package/presentation/entryLocking/abstractions.js +5 -0
  102. package/presentation/entryLocking/abstractions.js.map +1 -0
  103. package/presentation/entryLocking/components/ForceUnlockButton.d.ts +11 -0
  104. package/presentation/entryLocking/components/ForceUnlockButton.js +37 -0
  105. package/presentation/entryLocking/components/ForceUnlockButton.js.map +1 -0
  106. package/presentation/entryLocking/components/LockedEntryOverlay.d.ts +10 -0
  107. package/presentation/entryLocking/components/LockedEntryOverlay.js +52 -0
  108. package/presentation/entryLocking/components/LockedEntryOverlay.js.map +1 -0
  109. package/presentation/entryLocking/components/RecordLockingGuard.d.ts +12 -0
  110. package/presentation/entryLocking/components/RecordLockingGuard.js +74 -0
  111. package/presentation/entryLocking/components/RecordLockingGuard.js.map +1 -0
  112. package/presentation/entryLocking/feature.d.ts +3 -0
  113. package/presentation/entryLocking/feature.js +21 -0
  114. package/presentation/entryLocking/feature.js.map +1 -0
  115. package/presentation/listLocking/ContentEntriesPresenterDecorator.d.ts +25 -0
  116. package/presentation/listLocking/ContentEntriesPresenterDecorator.js +70 -0
  117. package/presentation/listLocking/ContentEntriesPresenterDecorator.js.map +1 -0
  118. package/presentation/listLocking/ListLockRecordsPresenter.d.ts +17 -0
  119. package/presentation/listLocking/ListLockRecordsPresenter.js +52 -0
  120. package/presentation/listLocking/ListLockRecordsPresenter.js.map +1 -0
  121. package/presentation/listLocking/abstractions.d.ts +16 -0
  122. package/presentation/listLocking/abstractions.js +5 -0
  123. package/presentation/listLocking/abstractions.js.map +1 -0
  124. package/presentation/listLocking/components/ListLockRecordsSync.d.ts +4 -0
  125. package/presentation/listLocking/components/ListLockRecordsSync.js +26 -0
  126. package/presentation/listLocking/components/ListLockRecordsSync.js.map +1 -0
  127. package/presentation/listLocking/components/LockIndicatorCell.d.ts +2 -0
  128. package/presentation/listLocking/components/LockIndicatorCell.js +39 -0
  129. package/presentation/listLocking/components/LockIndicatorCell.js.map +1 -0
  130. package/presentation/listLocking/feature.d.ts +3 -0
  131. package/presentation/listLocking/feature.js +19 -0
  132. package/presentation/listLocking/feature.js.map +1 -0
  133. package/types.d.ts +31 -0
  134. package/types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/forceUnlock/ForceUnlockUseCase.js","sources":["../../../src/features/forceUnlock/ForceUnlockUseCase.ts"],"sourcesContent":["import {\n ForceUnlockUseCase as UseCaseAbstraction,\n ForceUnlockGateway,\n type IForceUnlockParams\n} from \"./abstractions.js\";\n\nclass ForceUnlockUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: ForceUnlockGateway.Interface) {}\n\n async execute(params: IForceUnlockParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const ForceUnlockUseCase = UseCaseAbstraction.createImplementation({\n implementation: ForceUnlockUseCaseImpl,\n dependencies: [ForceUnlockGateway]\n});\n"],"names":["ForceUnlockUseCaseImpl","gateway","params","ForceUnlockUseCase","UseCaseAbstraction","ForceUnlockGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAqC,CAAE;aAAvCA,OAAO,GAAPA;IAAwC;IAE5D,MAAM,QAAQC,MAA0B,EAAE;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
@@ -0,0 +1,19 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface IForceUnlockParams {
3
+ id: string;
4
+ type: string;
5
+ }
6
+ export interface IForceUnlockGateway {
7
+ execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const ForceUnlockGateway: import("@webiny/di").Abstraction<IForceUnlockGateway>;
10
+ export declare namespace ForceUnlockGateway {
11
+ type Interface = IForceUnlockGateway;
12
+ }
13
+ export interface IForceUnlockUseCase {
14
+ execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;
15
+ }
16
+ export declare const ForceUnlockUseCase: import("@webiny/di").Abstraction<IForceUnlockUseCase>;
17
+ export declare namespace ForceUnlockUseCase {
18
+ type Interface = IForceUnlockUseCase;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ForceUnlockGateway = createAbstraction("ForceUnlockGateway");
3
+ const ForceUnlockUseCase = createAbstraction("ForceUnlockUseCase");
4
+ export { ForceUnlockGateway, ForceUnlockUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/forceUnlock/abstractions.js","sources":["../../../src/features/forceUnlock/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IRecordLockingLockRecord } from \"~/types.js\";\n\nexport interface IForceUnlockParams {\n id: string;\n type: string;\n}\n\nexport interface IForceUnlockGateway {\n execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const ForceUnlockGateway = createAbstraction<IForceUnlockGateway>(\"ForceUnlockGateway\");\n\nexport namespace ForceUnlockGateway {\n export type Interface = IForceUnlockGateway;\n}\n\nexport interface IForceUnlockUseCase {\n execute(params: IForceUnlockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const ForceUnlockUseCase = createAbstraction<IForceUnlockUseCase>(\"ForceUnlockUseCase\");\n\nexport namespace ForceUnlockUseCase {\n export type Interface = IForceUnlockUseCase;\n}\n"],"names":["ForceUnlockGateway","createAbstraction","ForceUnlockUseCase"],"mappings":";AAYO,MAAMA,qBAAqBC,kBAAuC;AAUlE,MAAMC,qBAAqBD,kBAAuC"}
@@ -0,0 +1,3 @@
1
+ export declare const ForceUnlockFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").IForceUnlockUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ForceUnlockUseCase } from "./abstractions.js";
3
+ import { ForceUnlockUseCase as external_ForceUnlockUseCase_js_ForceUnlockUseCase } from "./ForceUnlockUseCase.js";
4
+ import { ForceUnlockGateway } from "./ForceUnlockGateway.js";
5
+ const ForceUnlockFeature = createFeature({
6
+ name: "RecordLocking/ForceUnlock",
7
+ register (container) {
8
+ container.register(external_ForceUnlockUseCase_js_ForceUnlockUseCase);
9
+ container.register(ForceUnlockGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(ForceUnlockUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { ForceUnlockFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/forceUnlock/feature.js","sources":["../../../src/features/forceUnlock/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ForceUnlockUseCase as UseCase } from \"./abstractions.js\";\nimport { ForceUnlockUseCase } from \"./ForceUnlockUseCase.js\";\nimport { ForceUnlockGateway } from \"./ForceUnlockGateway.js\";\n\nexport const ForceUnlockFeature = createFeature({\n name: \"RecordLocking/ForceUnlock\",\n register(container) {\n container.register(ForceUnlockUseCase);\n container.register(ForceUnlockGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCase)\n };\n }\n});\n"],"names":["ForceUnlockFeature","createFeature","container","ForceUnlockUseCase","ForceUnlockGateway","UseCase"],"mappings":";;;;AAKO,MAAMA,qBAAqBC,cAAc;IAC5C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,oBAAoB,gBAAgB;IAC3D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1,2 @@
1
+ export declare const LOCK_RECORD_FIELDS = "\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";
2
+ export declare const ERROR_FIELDS = "\n message\n code\n data\n";
@@ -0,0 +1,31 @@
1
+ const LOCK_RECORD_FIELDS = `
2
+ id
3
+ lockedBy {
4
+ id
5
+ displayName
6
+ type
7
+ }
8
+ lockedOn
9
+ updatedOn
10
+ expiresOn
11
+ targetId
12
+ type
13
+ actions {
14
+ type
15
+ message
16
+ createdBy {
17
+ id
18
+ displayName
19
+ type
20
+ }
21
+ createdOn
22
+ }
23
+ `;
24
+ const ERROR_FIELDS = `
25
+ message
26
+ code
27
+ data
28
+ `;
29
+ export { ERROR_FIELDS, LOCK_RECORD_FIELDS };
30
+
31
+ //# sourceMappingURL=graphqlFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/graphqlFields.js","sources":["../../src/features/graphqlFields.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"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ListLockRecordsGateway as GatewayAbstraction, type IListLockRecordsParams } from "./abstractions.js";
3
+ import type { IRecordLockingLockRecord } from "../../types.js";
4
+ declare class ListLockRecordsGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(params: IListLockRecordsParams): Promise<IRecordLockingLockRecord[]>;
8
+ }
9
+ export declare const ListLockRecordsGateway: typeof ListLockRecordsGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListLockRecordsGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,48 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "../graphqlFields.js";
3
+ import { ListLockRecordsGateway } from "./abstractions.js";
4
+ const LIST_LOCK_RECORDS_QUERY = `
5
+ query RecordLockingListLockedRecords(
6
+ $where: RecordLockingListWhereInput
7
+ $sort: [RecordLockingListSorter!]
8
+ $limit: Int
9
+ $after: String
10
+ ) {
11
+ recordLocking {
12
+ listLockRecords(where: $where, sort: $sort, limit: $limit, after: $after) {
13
+ data {
14
+ ${LOCK_RECORD_FIELDS}
15
+ }
16
+ error {
17
+ ${ERROR_FIELDS}
18
+ }
19
+ }
20
+ }
21
+ }
22
+ `;
23
+ class ListLockRecordsGatewayImpl {
24
+ constructor(client){
25
+ this.client = client;
26
+ }
27
+ async execute(params) {
28
+ const response = await this.client.execute({
29
+ query: LIST_LOCK_RECORDS_QUERY,
30
+ variables: {
31
+ where: params.where,
32
+ limit: params.limit ?? 100
33
+ }
34
+ });
35
+ const { data, error } = response.recordLocking.listLockRecords;
36
+ if (error) throw new Error(error.message);
37
+ return data || [];
38
+ }
39
+ }
40
+ const ListLockRecordsGateway_ListLockRecordsGateway = ListLockRecordsGateway.createImplementation({
41
+ implementation: ListLockRecordsGatewayImpl,
42
+ dependencies: [
43
+ MainGraphQLClient
44
+ ]
45
+ });
46
+ export { ListLockRecordsGateway_ListLockRecordsGateway as ListLockRecordsGateway };
47
+
48
+ //# sourceMappingURL=ListLockRecordsGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listLockRecords/ListLockRecordsGateway.js","sources":["../../../src/features/listLockRecords/ListLockRecordsGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { LOCK_RECORD_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n ListLockRecordsGateway as GatewayAbstraction,\n type IListLockRecordsParams\n} from \"./abstractions.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\n\ninterface ListLockRecordsResponse {\n recordLocking: {\n listLockRecords: {\n data: IRecordLockingLockRecord[] | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nconst LIST_LOCK_RECORDS_QUERY = /* GraphQL */ `\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\nclass ListLockRecordsGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: IListLockRecordsParams) {\n const response = await this.client.execute<ListLockRecordsResponse>({\n query: LIST_LOCK_RECORDS_QUERY,\n variables: {\n where: params.where,\n limit: params.limit ?? 100\n }\n });\n\n const { data, error } = response.recordLocking.listLockRecords;\n\n if (error) {\n throw new Error(error.message);\n }\n\n return data || [];\n }\n}\n\nexport const ListLockRecordsGateway = GatewayAbstraction.createImplementation({\n implementation: ListLockRecordsGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["LIST_LOCK_RECORDS_QUERY","LOCK_RECORD_FIELDS","ERROR_FIELDS","ListLockRecordsGatewayImpl","client","params","response","data","error","Error","ListLockRecordsGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAiBA,MAAMA,0BAAwC,CAAC;;;;;;;;;;oBAU3B,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAED,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA8B,EAAE;QAC1C,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA0B;YAChE,OAAON;YACP,WAAW;gBACP,OAAOK,OAAO,KAAK;gBACnB,OAAOA,OAAO,KAAK,IAAI;YAC3B;QACJ;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,aAAa,CAAC,eAAe;QAE9D,IAAIE,OACA,MAAM,IAAIC,MAAMD,MAAM,OAAO;QAGjC,OAAOD,QAAQ,EAAE;IACrB;AACJ;AAEO,MAAMG,gDAAyBC,uBAAAA,oBAAuC,CAAC;IAC1E,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { ListLockRecordsUseCase as UseCaseAbstraction, ListLockRecordsGateway, type IListLockRecordsParams } from "./abstractions.js";
2
+ declare class ListLockRecordsUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private gateway;
4
+ constructor(gateway: ListLockRecordsGateway.Interface);
5
+ execute(params: IListLockRecordsParams): Promise<import("../../types.js").IRecordLockingLockRecord[]>;
6
+ }
7
+ export declare const ListLockRecordsUseCase: typeof ListLockRecordsUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListLockRecordsUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ListLockRecordsGateway, ListLockRecordsUseCase } from "./abstractions.js";
2
+ class ListLockRecordsUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ return this.gateway.execute(params);
8
+ }
9
+ }
10
+ const ListLockRecordsUseCase_ListLockRecordsUseCase = ListLockRecordsUseCase.createImplementation({
11
+ implementation: ListLockRecordsUseCaseImpl,
12
+ dependencies: [
13
+ ListLockRecordsGateway
14
+ ]
15
+ });
16
+ export { ListLockRecordsUseCase_ListLockRecordsUseCase as ListLockRecordsUseCase };
17
+
18
+ //# sourceMappingURL=ListLockRecordsUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listLockRecords/ListLockRecordsUseCase.js","sources":["../../../src/features/listLockRecords/ListLockRecordsUseCase.ts"],"sourcesContent":["import {\n ListLockRecordsUseCase as UseCaseAbstraction,\n ListLockRecordsGateway,\n type IListLockRecordsParams\n} from \"./abstractions.js\";\n\nclass ListLockRecordsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: ListLockRecordsGateway.Interface) {}\n\n async execute(params: IListLockRecordsParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const ListLockRecordsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListLockRecordsUseCaseImpl,\n dependencies: [ListLockRecordsGateway]\n});\n"],"names":["ListLockRecordsUseCaseImpl","gateway","params","ListLockRecordsUseCase","UseCaseAbstraction","ListLockRecordsGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAyC,CAAE;aAA3CA,OAAO,GAAPA;IAA4C;IAEhE,MAAM,QAAQC,MAA8B,EAAE;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,gDAAyBC,uBAAAA,oBAAuC,CAAC;IAC1E,gBAAgBJ;IAChB,cAAc;QAACK;KAAuB;AAC1C"}
@@ -0,0 +1,22 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface IListLockRecordsParams {
3
+ where?: {
4
+ id_in?: string[];
5
+ type?: string;
6
+ };
7
+ limit?: number;
8
+ }
9
+ export interface IListLockRecordsGateway {
10
+ execute(params: IListLockRecordsParams): Promise<IRecordLockingLockRecord[]>;
11
+ }
12
+ export declare const ListLockRecordsGateway: import("@webiny/di").Abstraction<IListLockRecordsGateway>;
13
+ export declare namespace ListLockRecordsGateway {
14
+ type Interface = IListLockRecordsGateway;
15
+ }
16
+ export interface IListLockRecordsUseCase {
17
+ execute(params: IListLockRecordsParams): Promise<IRecordLockingLockRecord[]>;
18
+ }
19
+ export declare const ListLockRecordsUseCase: import("@webiny/di").Abstraction<IListLockRecordsUseCase>;
20
+ export declare namespace ListLockRecordsUseCase {
21
+ type Interface = IListLockRecordsUseCase;
22
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ListLockRecordsGateway = createAbstraction("ListLockRecordsGateway");
3
+ const ListLockRecordsUseCase = createAbstraction("ListLockRecordsUseCase");
4
+ export { ListLockRecordsGateway, ListLockRecordsUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listLockRecords/abstractions.js","sources":["../../../src/features/listLockRecords/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IRecordLockingLockRecord } from \"~/types.js\";\n\nexport interface IListLockRecordsParams {\n where?: {\n id_in?: string[];\n type?: string;\n };\n limit?: number;\n}\n\nexport interface IListLockRecordsGateway {\n execute(params: IListLockRecordsParams): Promise<IRecordLockingLockRecord[]>;\n}\n\nexport const ListLockRecordsGateway =\n createAbstraction<IListLockRecordsGateway>(\"ListLockRecordsGateway\");\n\nexport namespace ListLockRecordsGateway {\n export type Interface = IListLockRecordsGateway;\n}\n\nexport interface IListLockRecordsUseCase {\n execute(params: IListLockRecordsParams): Promise<IRecordLockingLockRecord[]>;\n}\n\nexport const ListLockRecordsUseCase =\n createAbstraction<IListLockRecordsUseCase>(\"ListLockRecordsUseCase\");\n\nexport namespace ListLockRecordsUseCase {\n export type Interface = IListLockRecordsUseCase;\n}\n"],"names":["ListLockRecordsGateway","createAbstraction","ListLockRecordsUseCase"],"mappings":";AAeO,MAAMA,yBACTC,kBAA2C;AAUxC,MAAMC,yBACTD,kBAA2C"}
@@ -0,0 +1,3 @@
1
+ export declare const ListLockRecordsFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").IListLockRecordsUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ListLockRecordsUseCase } from "./abstractions.js";
3
+ import { ListLockRecordsUseCase as external_ListLockRecordsUseCase_js_ListLockRecordsUseCase } from "./ListLockRecordsUseCase.js";
4
+ import { ListLockRecordsGateway } from "./ListLockRecordsGateway.js";
5
+ const ListLockRecordsFeature = createFeature({
6
+ name: "RecordLocking/ListLockRecords",
7
+ register (container) {
8
+ container.register(external_ListLockRecordsUseCase_js_ListLockRecordsUseCase);
9
+ container.register(ListLockRecordsGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(ListLockRecordsUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { ListLockRecordsFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/listLockRecords/feature.js","sources":["../../../src/features/listLockRecords/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListLockRecordsUseCase as UseCase } from \"./abstractions.js\";\nimport { ListLockRecordsUseCase } from \"./ListLockRecordsUseCase.js\";\nimport { ListLockRecordsGateway } from \"./ListLockRecordsGateway.js\";\n\nexport const ListLockRecordsFeature = createFeature({\n name: \"RecordLocking/ListLockRecords\",\n register(container) {\n container.register(ListLockRecordsUseCase);\n container.register(ListLockRecordsGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCase)\n };\n }\n});\n"],"names":["ListLockRecordsFeature","createFeature","container","ListLockRecordsUseCase","ListLockRecordsGateway","UseCase"],"mappings":";;;;AAKO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,wBAAwB,gBAAgB;IAC/D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
@@ -0,0 +1,17 @@
1
+ import type { Permissions } from "@webiny/app-admin/exports/admin/security.js";
2
+ import { RECORD_LOCKING_PERMISSIONS_SCHEMA } from "../../permissions/permissionsSchema.js";
3
+ export declare const RecordLockingPermissions: import("@webiny/di").Abstraction<{
4
+ canAccess: (entityId: never) => boolean;
5
+ canAction: (action: string, entityId: never) => boolean;
6
+ } & {
7
+ canRead: (entityId: string) => boolean;
8
+ canCreate: (entityId: string) => boolean;
9
+ canEdit: (entityId: string, item?: import("@webiny/app-admin/permissions").OwnableItem) => boolean;
10
+ canDelete: (entityId: string, item?: import("@webiny/app-admin/permissions").OwnableItem) => boolean;
11
+ } & {
12
+ canPublish: (entityId: string) => boolean;
13
+ canUnpublish: (entityId: string) => boolean;
14
+ }>;
15
+ export declare namespace RecordLockingPermissions {
16
+ type Interface = Permissions<typeof RECORD_LOCKING_PERMISSIONS_SCHEMA>;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { createPermissionsAbstraction } from "@webiny/app-admin/exports/admin/security.js";
2
+ import { RECORD_LOCKING_PERMISSIONS_SCHEMA } from "../../permissions/permissionsSchema.js";
3
+ const RecordLockingPermissions = createPermissionsAbstraction(RECORD_LOCKING_PERMISSIONS_SCHEMA);
4
+ export { RecordLockingPermissions };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/permissions/abstractions.js","sources":["../../../src/features/permissions/abstractions.ts"],"sourcesContent":["import { createPermissionsAbstraction } from \"@webiny/app-admin/exports/admin/security.js\";\nimport type { Permissions } from \"@webiny/app-admin/exports/admin/security.js\";\nimport { RECORD_LOCKING_PERMISSIONS_SCHEMA } from \"~/permissions/permissionsSchema.js\";\n\nexport const RecordLockingPermissions = createPermissionsAbstraction(\n RECORD_LOCKING_PERMISSIONS_SCHEMA\n);\n\nexport namespace RecordLockingPermissions {\n export type Interface = Permissions<typeof RECORD_LOCKING_PERMISSIONS_SCHEMA>;\n}\n"],"names":["RecordLockingPermissions","createPermissionsAbstraction","RECORD_LOCKING_PERMISSIONS_SCHEMA"],"mappings":";;AAIO,MAAMA,2BAA2BC,6BACpCC"}
@@ -0,0 +1,14 @@
1
+ export declare const RecordLockingPermissionsFeature: import("@webiny/feature/admin/createFeature.js").FeatureDefinition<{
2
+ permissions: {
3
+ canAccess: (entityId: never) => boolean;
4
+ canAction: (action: string, entityId: never) => boolean;
5
+ } & {
6
+ canRead: (entityId: string) => boolean;
7
+ canCreate: (entityId: string) => boolean;
8
+ canEdit: (entityId: string, item?: import("@webiny/app-admin/index.js").OwnableItem) => boolean;
9
+ canDelete: (entityId: string, item?: import("@webiny/app-admin/index.js").OwnableItem) => boolean;
10
+ } & {
11
+ canPublish: (entityId: string) => boolean;
12
+ canUnpublish: (entityId: string) => boolean;
13
+ };
14
+ }, []>;
@@ -0,0 +1,7 @@
1
+ import { createPermissionsFeature } from "@webiny/app-admin/exports/admin/security.js";
2
+ import { RECORD_LOCKING_PERMISSIONS_SCHEMA } from "../../permissions/permissionsSchema.js";
3
+ import { RecordLockingPermissions } from "./abstractions.js";
4
+ const RecordLockingPermissionsFeature = createPermissionsFeature(RECORD_LOCKING_PERMISSIONS_SCHEMA, RecordLockingPermissions);
5
+ export { RecordLockingPermissionsFeature };
6
+
7
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/permissions/feature.js","sources":["../../../src/features/permissions/feature.ts"],"sourcesContent":["import { createPermissionsFeature } from \"@webiny/app-admin/exports/admin/security.js\";\nimport { RECORD_LOCKING_PERMISSIONS_SCHEMA } from \"~/permissions/permissionsSchema.js\";\nimport { RecordLockingPermissions } from \"./abstractions.js\";\n\nexport const RecordLockingPermissionsFeature = createPermissionsFeature(\n RECORD_LOCKING_PERMISSIONS_SCHEMA,\n RecordLockingPermissions\n);\n"],"names":["RecordLockingPermissionsFeature","createPermissionsFeature","RECORD_LOCKING_PERMISSIONS_SCHEMA","RecordLockingPermissions"],"mappings":";;;AAIO,MAAMA,kCAAkCC,yBAC3CC,mCACAC"}
@@ -0,0 +1,12 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ReleaseLockGateway as GatewayAbstraction, type IReleaseLockParams } from "./abstractions.js";
3
+ import type { IRecordLockingLockRecord } from "../../types.js";
4
+ declare class ReleaseLockGatewayImpl implements GatewayAbstraction.Interface {
5
+ private client;
6
+ constructor(client: MainGraphQLClient.Interface);
7
+ execute(params: IReleaseLockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const ReleaseLockGateway: typeof ReleaseLockGatewayImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IReleaseLockGateway>;
11
+ };
12
+ export {};
@@ -0,0 +1,44 @@
1
+ import { MainGraphQLClient } from "@webiny/app/features/mainGraphQLClient/abstractions.js";
2
+ import { ERROR_FIELDS, LOCK_RECORD_FIELDS } from "../graphqlFields.js";
3
+ import { ReleaseLockGateway } from "./abstractions.js";
4
+ const RELEASE_LOCK_MUTATION = `
5
+ mutation RecordLockingUnlockEntry($id: ID!, $type: String!, $force: Boolean) {
6
+ recordLocking {
7
+ unlockEntry(id: $id, type: $type, force: $force) {
8
+ data {
9
+ ${LOCK_RECORD_FIELDS}
10
+ }
11
+ error {
12
+ ${ERROR_FIELDS}
13
+ }
14
+ }
15
+ }
16
+ }
17
+ `;
18
+ class ReleaseLockGatewayImpl {
19
+ constructor(client){
20
+ this.client = client;
21
+ }
22
+ async execute(params) {
23
+ const response = await this.client.execute({
24
+ query: RELEASE_LOCK_MUTATION,
25
+ variables: {
26
+ id: params.id,
27
+ type: params.type,
28
+ force: false
29
+ }
30
+ });
31
+ const { data, error } = response.recordLocking.unlockEntry;
32
+ if (!data) throw new Error(error?.message || "Failed to release lock");
33
+ return data;
34
+ }
35
+ }
36
+ const ReleaseLockGateway_ReleaseLockGateway = ReleaseLockGateway.createImplementation({
37
+ implementation: ReleaseLockGatewayImpl,
38
+ dependencies: [
39
+ MainGraphQLClient
40
+ ]
41
+ });
42
+ export { ReleaseLockGateway_ReleaseLockGateway as ReleaseLockGateway };
43
+
44
+ //# sourceMappingURL=ReleaseLockGateway.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/releaseLock/ReleaseLockGateway.js","sources":["../../../src/features/releaseLock/ReleaseLockGateway.ts"],"sourcesContent":["import { MainGraphQLClient } from \"@webiny/app/features/mainGraphQLClient/abstractions.js\";\nimport { LOCK_RECORD_FIELDS, ERROR_FIELDS } from \"~/features/graphqlFields.js\";\nimport {\n ReleaseLockGateway as GatewayAbstraction,\n type IReleaseLockParams\n} from \"./abstractions.js\";\nimport type { IRecordLockingError, IRecordLockingLockRecord } from \"~/types.js\";\n\ninterface ReleaseLockResponse {\n recordLocking: {\n unlockEntry: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nconst RELEASE_LOCK_MUTATION = /* GraphQL */ `\n mutation RecordLockingUnlockEntry($id: ID!, $type: String!, $force: Boolean) {\n recordLocking {\n unlockEntry(id: $id, type: $type, force: $force) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n\nclass ReleaseLockGatewayImpl implements GatewayAbstraction.Interface {\n constructor(private client: MainGraphQLClient.Interface) {}\n\n async execute(params: IReleaseLockParams) {\n const response = await this.client.execute<ReleaseLockResponse>({\n query: RELEASE_LOCK_MUTATION,\n variables: { id: params.id, type: params.type, force: false }\n });\n\n const { data, error } = response.recordLocking.unlockEntry;\n\n if (!data) {\n throw new Error(error?.message || \"Failed to release lock\");\n }\n\n return data;\n }\n}\n\nexport const ReleaseLockGateway = GatewayAbstraction.createImplementation({\n implementation: ReleaseLockGatewayImpl,\n dependencies: [MainGraphQLClient]\n});\n"],"names":["RELEASE_LOCK_MUTATION","LOCK_RECORD_FIELDS","ERROR_FIELDS","ReleaseLockGatewayImpl","client","params","response","data","error","Error","ReleaseLockGateway","GatewayAbstraction","MainGraphQLClient"],"mappings":";;;AAiBA,MAAMA,wBAAsC,CAAC;;;;;oBAKzB,EAAEC,mBAAmB;;;oBAGrB,EAAEC,aAAa;;;;;AAKnC,CAAC;AAED,MAAMC;IACF,YAAoBC,MAAmC,CAAE;aAArCA,MAAM,GAANA;IAAsC;IAE1D,MAAM,QAAQC,MAA0B,EAAE;QACtC,MAAMC,WAAW,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB;YAC5D,OAAON;YACP,WAAW;gBAAE,IAAIK,OAAO,EAAE;gBAAE,MAAMA,OAAO,IAAI;gBAAE,OAAO;YAAM;QAChE;QAEA,MAAM,EAAEE,IAAI,EAAEC,KAAK,EAAE,GAAGF,SAAS,aAAa,CAAC,WAAW;QAE1D,IAAI,CAACC,MACD,MAAM,IAAIE,MAAMD,OAAO,WAAW;QAGtC,OAAOD;IACX;AACJ;AAEO,MAAMG,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBR;IAChB,cAAc;QAACS;KAAkB;AACrC"}
@@ -0,0 +1,10 @@
1
+ import { ReleaseLockUseCase as UseCaseAbstraction, ReleaseLockGateway, type IReleaseLockParams } from "./abstractions.js";
2
+ declare class ReleaseLockUseCaseImpl implements UseCaseAbstraction.Interface {
3
+ private gateway;
4
+ constructor(gateway: ReleaseLockGateway.Interface);
5
+ execute(params: IReleaseLockParams): Promise<import("../../types.js").IRecordLockingLockRecord>;
6
+ }
7
+ export declare const ReleaseLockUseCase: typeof ReleaseLockUseCaseImpl & {
8
+ __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IReleaseLockUseCase>;
9
+ };
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ReleaseLockGateway, ReleaseLockUseCase } from "./abstractions.js";
2
+ class ReleaseLockUseCaseImpl {
3
+ constructor(gateway){
4
+ this.gateway = gateway;
5
+ }
6
+ async execute(params) {
7
+ return this.gateway.execute(params);
8
+ }
9
+ }
10
+ const ReleaseLockUseCase_ReleaseLockUseCase = ReleaseLockUseCase.createImplementation({
11
+ implementation: ReleaseLockUseCaseImpl,
12
+ dependencies: [
13
+ ReleaseLockGateway
14
+ ]
15
+ });
16
+ export { ReleaseLockUseCase_ReleaseLockUseCase as ReleaseLockUseCase };
17
+
18
+ //# sourceMappingURL=ReleaseLockUseCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/releaseLock/ReleaseLockUseCase.js","sources":["../../../src/features/releaseLock/ReleaseLockUseCase.ts"],"sourcesContent":["import {\n ReleaseLockUseCase as UseCaseAbstraction,\n ReleaseLockGateway,\n type IReleaseLockParams\n} from \"./abstractions.js\";\n\nclass ReleaseLockUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private gateway: ReleaseLockGateway.Interface) {}\n\n async execute(params: IReleaseLockParams) {\n return this.gateway.execute(params);\n }\n}\n\nexport const ReleaseLockUseCase = UseCaseAbstraction.createImplementation({\n implementation: ReleaseLockUseCaseImpl,\n dependencies: [ReleaseLockGateway]\n});\n"],"names":["ReleaseLockUseCaseImpl","gateway","params","ReleaseLockUseCase","UseCaseAbstraction","ReleaseLockGateway"],"mappings":";AAMA,MAAMA;IACF,YAAoBC,OAAqC,CAAE;aAAvCA,OAAO,GAAPA;IAAwC;IAE5D,MAAM,QAAQC,MAA0B,EAAE;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAACA;IAChC;AACJ;AAEO,MAAMC,wCAAqBC,mBAAAA,oBAAuC,CAAC;IACtE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
@@ -0,0 +1,19 @@
1
+ import type { IRecordLockingLockRecord } from "../../types.js";
2
+ export interface IReleaseLockParams {
3
+ id: string;
4
+ type: string;
5
+ }
6
+ export interface IReleaseLockGateway {
7
+ execute(params: IReleaseLockParams): Promise<IRecordLockingLockRecord>;
8
+ }
9
+ export declare const ReleaseLockGateway: import("@webiny/di").Abstraction<IReleaseLockGateway>;
10
+ export declare namespace ReleaseLockGateway {
11
+ type Interface = IReleaseLockGateway;
12
+ }
13
+ export interface IReleaseLockUseCase {
14
+ execute(params: IReleaseLockParams): Promise<IRecordLockingLockRecord>;
15
+ }
16
+ export declare const ReleaseLockUseCase: import("@webiny/di").Abstraction<IReleaseLockUseCase>;
17
+ export declare namespace ReleaseLockUseCase {
18
+ type Interface = IReleaseLockUseCase;
19
+ }
@@ -0,0 +1,6 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const ReleaseLockGateway = createAbstraction("ReleaseLockGateway");
3
+ const ReleaseLockUseCase = createAbstraction("ReleaseLockUseCase");
4
+ export { ReleaseLockGateway, ReleaseLockUseCase };
5
+
6
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/releaseLock/abstractions.js","sources":["../../../src/features/releaseLock/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IRecordLockingLockRecord } from \"~/types.js\";\n\nexport interface IReleaseLockParams {\n id: string;\n type: string;\n}\n\nexport interface IReleaseLockGateway {\n execute(params: IReleaseLockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const ReleaseLockGateway = createAbstraction<IReleaseLockGateway>(\"ReleaseLockGateway\");\n\nexport namespace ReleaseLockGateway {\n export type Interface = IReleaseLockGateway;\n}\n\nexport interface IReleaseLockUseCase {\n execute(params: IReleaseLockParams): Promise<IRecordLockingLockRecord>;\n}\n\nexport const ReleaseLockUseCase = createAbstraction<IReleaseLockUseCase>(\"ReleaseLockUseCase\");\n\nexport namespace ReleaseLockUseCase {\n export type Interface = IReleaseLockUseCase;\n}\n"],"names":["ReleaseLockGateway","createAbstraction","ReleaseLockUseCase"],"mappings":";AAYO,MAAMA,qBAAqBC,kBAAuC;AAUlE,MAAMC,qBAAqBD,kBAAuC"}
@@ -0,0 +1,3 @@
1
+ export declare const ReleaseLockFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ useCase: import("./abstractions.js").IReleaseLockUseCase;
3
+ }, []>;
@@ -0,0 +1,19 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { ReleaseLockUseCase } from "./abstractions.js";
3
+ import { ReleaseLockUseCase as external_ReleaseLockUseCase_js_ReleaseLockUseCase } from "./ReleaseLockUseCase.js";
4
+ import { ReleaseLockGateway } from "./ReleaseLockGateway.js";
5
+ const ReleaseLockFeature = createFeature({
6
+ name: "RecordLocking/ReleaseLock",
7
+ register (container) {
8
+ container.register(external_ReleaseLockUseCase_js_ReleaseLockUseCase);
9
+ container.register(ReleaseLockGateway).inSingletonScope();
10
+ },
11
+ resolve (container) {
12
+ return {
13
+ useCase: container.resolve(ReleaseLockUseCase)
14
+ };
15
+ }
16
+ });
17
+ export { ReleaseLockFeature };
18
+
19
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/releaseLock/feature.js","sources":["../../../src/features/releaseLock/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ReleaseLockUseCase as UseCase } from \"./abstractions.js\";\nimport { ReleaseLockUseCase } from \"./ReleaseLockUseCase.js\";\nimport { ReleaseLockGateway } from \"./ReleaseLockGateway.js\";\n\nexport const ReleaseLockFeature = createFeature({\n name: \"RecordLocking/ReleaseLock\",\n register(container) {\n container.register(ReleaseLockUseCase);\n container.register(ReleaseLockGateway).inSingletonScope();\n },\n resolve(container) {\n return {\n useCase: container.resolve(UseCase)\n };\n }\n});\n"],"names":["ReleaseLockFeature","createFeature","container","ReleaseLockUseCase","ReleaseLockGateway","UseCase"],"mappings":";;;;AAKO,MAAMA,qBAAqBC,cAAc;IAC5C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,oBAAoB,gBAAgB;IAC3D;IACA,SAAQF,SAAS;QACb,OAAO;YACH,SAASA,UAAU,OAAO,CAACG;QAC/B;IACJ;AACJ"}
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const RecordLocking: () => React.JSX.Element | null;
package/index.js ADDED
@@ -0,0 +1,24 @@
1
+ import react from "react";
2
+ import { RegisterFeature, useFeatureFlags } from "@webiny/app-admin";
3
+ import { RecordLockingFeature } from "./features/feature.js";
4
+ import { RecordLockingPermissionsFeature } from "./features/permissions/feature.js";
5
+ import { RecordLockingPresenterFeature } from "./presentation/entryLocking/feature.js";
6
+ import { ListLockRecordsPresenterFeature } from "./presentation/listLocking/feature.js";
7
+ import { SecurityPermissions } from "./SecurityPermissions.js";
8
+ import { RecordLockingModule } from "./RecordLockingModule.js";
9
+ const RecordLocking = ()=>{
10
+ const featureFlags = useFeatureFlags();
11
+ if (!featureFlags.isEnabled("recordLocking")) return null;
12
+ return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
13
+ feature: RecordLockingPermissionsFeature
14
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
15
+ feature: RecordLockingFeature
16
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
17
+ feature: RecordLockingPresenterFeature
18
+ }), /*#__PURE__*/ react.createElement(RegisterFeature, {
19
+ feature: ListLockRecordsPresenterFeature
20
+ }), /*#__PURE__*/ react.createElement(SecurityPermissions, null), /*#__PURE__*/ react.createElement(RecordLockingModule, null));
21
+ };
22
+ export { RecordLocking };
23
+
24
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { RegisterFeature } from \"@webiny/app-admin\";\nimport { useFeatureFlags } from \"@webiny/app-admin\";\nimport { RecordLockingFeature } from \"~/features/feature.js\";\nimport { RecordLockingPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { RecordLockingPresenterFeature } from \"~/presentation/entryLocking/feature.js\";\nimport { ListLockRecordsPresenterFeature } from \"~/presentation/listLocking/feature.js\";\nimport { SecurityPermissions } from \"~/SecurityPermissions.js\";\nimport { RecordLockingModule } from \"~/RecordLockingModule.js\";\n\nexport const RecordLocking = () => {\n const featureFlags = useFeatureFlags();\n\n if (!featureFlags.isEnabled(\"recordLocking\")) {\n return null;\n }\n\n return (\n <>\n <RegisterFeature feature={RecordLockingPermissionsFeature} />\n <RegisterFeature feature={RecordLockingFeature} />\n <RegisterFeature feature={RecordLockingPresenterFeature} />\n <RegisterFeature feature={ListLockRecordsPresenterFeature} />\n <SecurityPermissions />\n <RecordLockingModule />\n </>\n );\n};\n"],"names":["RecordLocking","featureFlags","useFeatureFlags","RegisterFeature","RecordLockingPermissionsFeature","RecordLockingFeature","RecordLockingPresenterFeature","ListLockRecordsPresenterFeature","SecurityPermissions","RecordLockingModule"],"mappings":";;;;;;;;AAUO,MAAMA,gBAAgB;IACzB,MAAMC,eAAeC;IAErB,IAAI,CAACD,aAAa,SAAS,CAAC,kBACxB,OAAO;IAGX,OAAO,WAAP,GACI,wDACI,oBAACE,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACH,iBAAeA;QAAC,SAASI;sBAC1B,oBAACC,qBAAmBA,OAAAA,WAAAA,GACpB,oBAACC,qBAAmBA;AAGhC"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@webiny/app-record-locking",
3
+ "version": "0.0.0-unstable.0156a4c312",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/webiny/webiny-js.git"
12
+ },
13
+ "contributors": [
14
+ "Pavel Denisjuk <pavel@webiny.com>",
15
+ "Sven Al Hamad <sven@webiny.com>",
16
+ "Adrian Smijulj <adrian@webiny.com>"
17
+ ],
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@webiny/admin-ui": "0.0.0-unstable.0156a4c312",
21
+ "@webiny/app": "0.0.0-unstable.0156a4c312",
22
+ "@webiny/app-admin": "0.0.0-unstable.0156a4c312",
23
+ "@webiny/app-headless-cms": "0.0.0-unstable.0156a4c312",
24
+ "@webiny/app-websockets": "0.0.0-unstable.0156a4c312",
25
+ "@webiny/feature": "0.0.0-unstable.0156a4c312",
26
+ "@webiny/icons": "0.0.0-unstable.0156a4c312",
27
+ "@webiny/utils": "0.0.0-unstable.0156a4c312",
28
+ "mobx": "7.1.4",
29
+ "mobx-react-lite": "5.1.2",
30
+ "react": "19.3.1",
31
+ "react-dom": "19.3.1"
32
+ },
33
+ "devDependencies": {
34
+ "@webiny/build-tools": "0.0.0-unstable.0156a4c312",
35
+ "rimraf": "6.1.3",
36
+ "typescript": "7.0.2"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "gitHead": "8476da73b653c89cc1474d968baf55c1b0ae0e5f",
42
+ "webiny": {
43
+ "publishFrom": "dist"
44
+ }
45
+ }
@@ -0,0 +1,6 @@
1
+ export declare const RECORD_LOCKING_PERMISSIONS_SCHEMA: {
2
+ readonly prefix: "recordLocking";
3
+ readonly fullAccess: {
4
+ readonly canForceUnlock: true;
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ import { createPermissionSchema } from "@webiny/app-admin";
2
+ const RECORD_LOCKING_PERMISSIONS_SCHEMA = createPermissionSchema({
3
+ prefix: "recordLocking",
4
+ fullAccess: {
5
+ canForceUnlock: true
6
+ }
7
+ });
8
+ export { RECORD_LOCKING_PERMISSIONS_SCHEMA };
9
+
10
+ //# sourceMappingURL=permissionsSchema.js.map