@webiny/api-record-locking 0.0.0-unstable.b9b64acb6d → 0.0.0-unstable.d0f34a8194
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.
- package/RecordLockingAppFeature.d.ts +11 -0
- package/RecordLockingAppFeature.js +20 -0
- package/RecordLockingAppFeature.js.map +1 -0
- package/domain/LockRecord.js +63 -70
- package/domain/LockRecord.js.map +1 -1
- package/domain/RecordLockingModel.js +27 -23
- package/domain/RecordLockingModel.js.map +1 -1
- package/domain/abstractions.d.ts +9 -3
- package/domain/abstractions.js +3 -7
- package/domain/abstractions.js.map +1 -1
- package/domain/calculateExpiresOn.js +5 -6
- package/domain/calculateExpiresOn.js.map +1 -1
- package/domain/errors.js +71 -81
- package/domain/errors.js.map +1 -1
- package/domain/index.js +0 -2
- package/domain/types.js +6 -9
- package/domain/types.js.map +1 -1
- package/features/GetLockRecord/GetLockRecordRepository.d.ts +4 -3
- package/features/GetLockRecord/GetLockRecordRepository.js +33 -25
- package/features/GetLockRecord/GetLockRecordRepository.js.map +1 -1
- package/features/GetLockRecord/GetLockRecordUseCase.js +13 -10
- package/features/GetLockRecord/GetLockRecordUseCase.js.map +1 -1
- package/features/GetLockRecord/abstractions.js +3 -14
- package/features/GetLockRecord/abstractions.js.map +1 -1
- package/features/GetLockRecord/feature.d.ts +4 -1
- package/features/GetLockRecord/feature.js +7 -6
- package/features/GetLockRecord/feature.js.map +1 -1
- package/features/GetLockRecord/index.js +0 -2
- package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.d.ts +1 -1
- package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js +20 -29
- package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js.map +1 -1
- package/features/GetLockedEntryLockRecord/abstractions.js +2 -10
- package/features/GetLockedEntryLockRecord/abstractions.js.map +1 -1
- package/features/GetLockedEntryLockRecord/feature.d.ts +4 -1
- package/features/GetLockedEntryLockRecord/feature.js +6 -5
- package/features/GetLockedEntryLockRecord/feature.js.map +1 -1
- package/features/GetLockedEntryLockRecord/index.js +0 -2
- package/features/IsEntryLocked/IsEntryLockedUseCase.d.ts +1 -1
- package/features/IsEntryLocked/IsEntryLockedUseCase.js +23 -29
- package/features/IsEntryLocked/IsEntryLockedUseCase.js.map +1 -1
- package/features/IsEntryLocked/abstractions.js +2 -9
- package/features/IsEntryLocked/abstractions.js.map +1 -1
- package/features/IsEntryLocked/feature.d.ts +4 -1
- package/features/IsEntryLocked/feature.js +6 -5
- package/features/IsEntryLocked/feature.js.map +1 -1
- package/features/IsEntryLocked/index.js +0 -2
- package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.d.ts +4 -4
- package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.js +28 -34
- package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.js.map +1 -1
- package/features/KickOutCurrentUser/abstractions.js +2 -6
- package/features/KickOutCurrentUser/abstractions.js.map +1 -1
- package/features/KickOutCurrentUser/feature.d.ts +4 -1
- package/features/KickOutCurrentUser/feature.js +6 -5
- package/features/KickOutCurrentUser/feature.js.map +1 -1
- package/features/KickOutCurrentUser/index.js +0 -2
- package/features/ListAllLockRecords/ListAllLockRecordsRepository.d.ts +5 -3
- package/features/ListAllLockRecords/ListAllLockRecordsRepository.js +39 -32
- package/features/ListAllLockRecords/ListAllLockRecordsRepository.js.map +1 -1
- package/features/ListAllLockRecords/ListAllLockRecordsUseCase.js +13 -10
- package/features/ListAllLockRecords/ListAllLockRecordsUseCase.js.map +1 -1
- package/features/ListAllLockRecords/abstractions.js +3 -14
- package/features/ListAllLockRecords/abstractions.js.map +1 -1
- package/features/ListAllLockRecords/feature.d.ts +4 -1
- package/features/ListAllLockRecords/feature.js +7 -6
- package/features/ListAllLockRecords/feature.js.map +1 -1
- package/features/ListAllLockRecords/index.js +0 -2
- package/features/ListLockRecords/ListLockRecordsRepository.d.ts +6 -3
- package/features/ListLockRecords/ListLockRecordsRepository.js +39 -32
- package/features/ListLockRecords/ListLockRecordsRepository.js.map +1 -1
- package/features/ListLockRecords/ListLockRecordsUseCase.d.ts +1 -1
- package/features/ListLockRecords/ListLockRecordsUseCase.js +27 -24
- package/features/ListLockRecords/ListLockRecordsUseCase.js.map +1 -1
- package/features/ListLockRecords/abstractions.js +3 -14
- package/features/ListLockRecords/abstractions.js.map +1 -1
- package/features/ListLockRecords/feature.d.ts +4 -1
- package/features/ListLockRecords/feature.js +7 -6
- package/features/ListLockRecords/feature.js.map +1 -1
- package/features/ListLockRecords/index.js +0 -2
- package/features/LockEntry/LockEntryEventsDecorator.d.ts +1 -1
- package/features/LockEntry/LockEntryEventsDecorator.js +32 -32
- package/features/LockEntry/LockEntryEventsDecorator.js.map +1 -1
- package/features/LockEntry/LockEntryRepository.d.ts +4 -3
- package/features/LockEntry/LockEntryRepository.js +35 -31
- package/features/LockEntry/LockEntryRepository.js.map +1 -1
- package/features/LockEntry/LockEntryUseCase.js +21 -26
- package/features/LockEntry/LockEntryUseCase.js.map +1 -1
- package/features/LockEntry/abstractions.js +3 -14
- package/features/LockEntry/abstractions.js.map +1 -1
- package/features/LockEntry/events.d.ts +8 -8
- package/features/LockEntry/events.js +26 -34
- package/features/LockEntry/events.js.map +1 -1
- package/features/LockEntry/feature.d.ts +4 -1
- package/features/LockEntry/feature.js +8 -7
- package/features/LockEntry/feature.js.map +1 -1
- package/features/LockEntry/index.js +0 -2
- package/features/RecordLockingFeature.d.ts +4 -6
- package/features/RecordLockingFeature.js +21 -22
- package/features/RecordLockingFeature.js.map +1 -1
- package/features/RecordLockingModelProvider.d.ts +18 -0
- package/features/RecordLockingModelProvider.js +22 -0
- package/features/RecordLockingModelProvider.js.map +1 -0
- package/features/UnlockEntry/UnlockEntryEventsDecorator.d.ts +1 -1
- package/features/UnlockEntry/UnlockEntryEventsDecorator.js +33 -33
- package/features/UnlockEntry/UnlockEntryEventsDecorator.js.map +1 -1
- package/features/UnlockEntry/UnlockEntryRepository.d.ts +3 -3
- package/features/UnlockEntry/UnlockEntryRepository.js +31 -28
- package/features/UnlockEntry/UnlockEntryRepository.js.map +1 -1
- package/features/UnlockEntry/UnlockEntryUseCase.d.ts +1 -1
- package/features/UnlockEntry/UnlockEntryUseCase.js +54 -70
- package/features/UnlockEntry/UnlockEntryUseCase.js.map +1 -1
- package/features/UnlockEntry/abstractions.js +3 -14
- package/features/UnlockEntry/abstractions.js.map +1 -1
- package/features/UnlockEntry/events.d.ts +8 -8
- package/features/UnlockEntry/events.js +26 -34
- package/features/UnlockEntry/events.js.map +1 -1
- package/features/UnlockEntry/feature.d.ts +4 -1
- package/features/UnlockEntry/feature.js +8 -7
- package/features/UnlockEntry/feature.js.map +1 -1
- package/features/UnlockEntry/hasFullAccessPermission.d.ts +1 -1
- package/features/UnlockEntry/hasFullAccessPermission.js +6 -7
- package/features/UnlockEntry/hasFullAccessPermission.js.map +1 -1
- package/features/UnlockEntry/index.js +0 -2
- package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.d.ts +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.js +32 -32
- package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.js.map +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestRepository.d.ts +4 -4
- package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js +34 -32
- package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js.map +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.d.ts +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.js +63 -80
- package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.js.map +1 -1
- package/features/UnlockEntryRequest/abstractions.js +3 -14
- package/features/UnlockEntryRequest/abstractions.js.map +1 -1
- package/features/UnlockEntryRequest/events.d.ts +8 -8
- package/features/UnlockEntryRequest/events.js +26 -34
- package/features/UnlockEntryRequest/events.js.map +1 -1
- package/features/UnlockEntryRequest/feature.d.ts +4 -1
- package/features/UnlockEntryRequest/feature.js +8 -7
- package/features/UnlockEntryRequest/feature.js.map +1 -1
- package/features/UnlockEntryRequest/index.js +0 -2
- package/features/UpdateEntryLock/UpdateEntryLockRepository.d.ts +5 -4
- package/features/UpdateEntryLock/UpdateEntryLockRepository.js +48 -50
- package/features/UpdateEntryLock/UpdateEntryLockRepository.js.map +1 -1
- package/features/UpdateEntryLock/UpdateEntryLockUseCase.d.ts +1 -1
- package/features/UpdateEntryLock/UpdateEntryLockUseCase.js +41 -52
- package/features/UpdateEntryLock/UpdateEntryLockUseCase.js.map +1 -1
- package/features/UpdateEntryLock/abstractions.js +3 -14
- package/features/UpdateEntryLock/abstractions.js.map +1 -1
- package/features/UpdateEntryLock/feature.d.ts +4 -1
- package/features/UpdateEntryLock/feature.js +7 -6
- package/features/UpdateEntryLock/feature.js.map +1 -1
- package/features/UpdateEntryLock/index.js +0 -2
- package/graphql/RecordLockingGraphQLSchema.d.ts +25 -0
- package/graphql/RecordLockingGraphQLSchema.js +390 -0
- package/graphql/RecordLockingGraphQLSchema.js.map +1 -0
- package/graphql/checkPermissions.d.ts +3 -3
- package/graphql/checkPermissions.js +4 -10
- package/graphql/checkPermissions.js.map +1 -1
- package/graphql/resolve.d.ts +1 -1
- package/graphql/resolve.js +16 -18
- package/graphql/resolve.js.map +1 -1
- package/index.d.ts +2 -9
- package/index.js +1 -62
- package/package.json +27 -22
- package/types.js +6 -9
- package/types.js.map +1 -1
- package/utils/convertWhereCondition.js +20 -32
- package/utils/convertWhereCondition.js.map +1 -1
- package/utils/getTimeout.js +8 -15
- package/utils/getTimeout.js.map +1 -1
- package/utils/lockRecordDatabaseId.js +6 -11
- package/utils/lockRecordDatabaseId.js.map +1 -1
- package/domain/index.js.map +0 -1
- package/features/GetLockRecord/index.js.map +0 -1
- package/features/GetLockedEntryLockRecord/index.js.map +0 -1
- package/features/IsEntryLocked/index.js.map +0 -1
- package/features/KickOutCurrentUser/index.js.map +0 -1
- package/features/ListAllLockRecords/index.js.map +0 -1
- package/features/ListLockRecords/index.js.map +0 -1
- package/features/LockEntry/index.js.map +0 -1
- package/features/UnlockEntry/index.js.map +0 -1
- package/features/UnlockEntryRequest/index.js.map +0 -1
- package/features/UpdateEntryLock/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -11
- package/graphql/schema.js +0 -318
- package/graphql/schema.js.map +0 -1
- package/index.js.map +0 -1
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
import { DomainEvent } from "@webiny/api-core/features/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getHandlerAbstraction() {
|
|
11
|
-
return EntryBeforeLockHandler;
|
|
12
|
-
}
|
|
2
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
|
+
class EntryBeforeLockEvent extends DomainEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return EntryBeforeLockEventHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "RecordLocking/Entry/BeforeLock";
|
|
9
|
+
}
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
getHandlerAbstraction() {
|
|
23
|
-
return EntryAfterLockHandler;
|
|
24
|
-
}
|
|
11
|
+
const EntryBeforeLockEventHandler = createAbstraction("EntryBeforeLockEventHandler");
|
|
12
|
+
class EntryAfterLockEvent extends DomainEvent {
|
|
13
|
+
getHandlerAbstraction() {
|
|
14
|
+
return EntryAfterLockEventHandler;
|
|
15
|
+
}
|
|
16
|
+
constructor(...args){
|
|
17
|
+
super(...args), this.eventType = "RecordLocking/Entry/AfterLock";
|
|
18
|
+
}
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
getHandlerAbstraction() {
|
|
35
|
-
return EntryLockErrorHandler;
|
|
36
|
-
}
|
|
20
|
+
const EntryAfterLockEventHandler = createAbstraction("EntryAfterLockEventHandler");
|
|
21
|
+
class EntryLockErrorEvent extends DomainEvent {
|
|
22
|
+
getHandlerAbstraction() {
|
|
23
|
+
return EntryLockErrorEventHandler;
|
|
24
|
+
}
|
|
25
|
+
constructor(...args){
|
|
26
|
+
super(...args), this.eventType = "RecordLocking/Entry/LockError";
|
|
27
|
+
}
|
|
37
28
|
}
|
|
38
|
-
|
|
29
|
+
const EntryLockErrorEventHandler = createAbstraction("EntryLockErrorEventHandler");
|
|
30
|
+
export { EntryAfterLockEvent, EntryAfterLockEventHandler, EntryBeforeLockEvent, EntryBeforeLockEventHandler, EntryLockErrorEvent, EntryLockErrorEventHandler };
|
|
39
31
|
|
|
40
32
|
//# sourceMappingURL=events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/LockEntry/events.js","sources":["../../../src/features/LockEntry/events.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { IEventHandler } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { ILockRecord } from \"~/domain/LockRecord.js\";\nimport type { LockRecordEntryType } from \"~/domain/types.js\";\n\n// ============================================================================\n// EntryBeforeLock Event\n// ============================================================================\n\nexport interface EntryBeforeLockPayload {\n id: string;\n type: LockRecordEntryType;\n}\n\nexport class EntryBeforeLockEvent extends DomainEvent<EntryBeforeLockPayload> {\n eventType = \"RecordLocking/Entry/BeforeLock\" as const;\n\n getHandlerAbstraction() {\n return EntryBeforeLockEventHandler;\n }\n}\n\nexport const EntryBeforeLockEventHandler = createAbstraction<IEventHandler<EntryBeforeLockEvent>>(\n \"EntryBeforeLockEventHandler\"\n);\n\nexport namespace EntryBeforeLockEventHandler {\n export type Interface = IEventHandler<EntryBeforeLockEvent>;\n export type Event = EntryBeforeLockEvent;\n}\n\n// ============================================================================\n// EntryAfterLock Event\n// ============================================================================\n\nexport interface EntryAfterLockPayload {\n id: string;\n type: LockRecordEntryType;\n record: ILockRecord;\n}\n\nexport class EntryAfterLockEvent extends DomainEvent<EntryAfterLockPayload> {\n eventType = \"RecordLocking/Entry/AfterLock\" as const;\n\n getHandlerAbstraction() {\n return EntryAfterLockEventHandler;\n }\n}\n\nexport const EntryAfterLockEventHandler = createAbstraction<IEventHandler<EntryAfterLockEvent>>(\n \"EntryAfterLockEventHandler\"\n);\n\nexport namespace EntryAfterLockEventHandler {\n export type Interface = IEventHandler<EntryAfterLockEvent>;\n export type Event = EntryAfterLockEvent;\n}\n\n// ============================================================================\n// EntryLockError Event\n// ============================================================================\n\nexport interface EntryLockErrorPayload {\n id: string;\n type: LockRecordEntryType;\n error: Error;\n}\n\nexport class EntryLockErrorEvent extends DomainEvent<EntryLockErrorPayload> {\n eventType = \"RecordLocking/Entry/LockError\" as const;\n\n getHandlerAbstraction() {\n return EntryLockErrorEventHandler;\n }\n}\n\nexport const EntryLockErrorEventHandler = createAbstraction<IEventHandler<EntryLockErrorEvent>>(\n \"EntryLockErrorEventHandler\"\n);\n\nexport namespace EntryLockErrorEventHandler {\n export type Interface = IEventHandler<EntryLockErrorEvent>;\n export type Event = EntryLockErrorEvent;\n}\n"],"names":["EntryBeforeLockEvent","DomainEvent","EntryBeforeLockEventHandler","createAbstraction","EntryAfterLockEvent","EntryAfterLockEventHandler","EntryLockErrorEvent","EntryLockErrorEventHandler"],"mappings":";;AAeO,MAAMA,6BAA6BC;IAGtC,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,8BAA8BC,kBACvC;AAkBG,MAAMC,4BAA4BH;IAGrC,wBAAwB;QACpB,OAAOI;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,6BAA6BF,kBACtC;AAkBG,MAAMG,4BAA4BL;IAGrC,wBAAwB;QACpB,OAAOM;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,6BAA6BJ,kBACtC"}
|
|
@@ -2,13 +2,14 @@ import { createFeature } from "@webiny/feature/api";
|
|
|
2
2
|
import { LockEntryUseCase } from "./LockEntryUseCase.js";
|
|
3
3
|
import { LockEntryRepository } from "./LockEntryRepository.js";
|
|
4
4
|
import { LockEntryEventsDecorator } from "./LockEntryEventsDecorator.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const LockEntryFeature = createFeature({
|
|
6
|
+
name: "LockEntry",
|
|
7
|
+
register (container) {
|
|
8
|
+
container.register(LockEntryUseCase);
|
|
9
|
+
container.register(LockEntryRepository).inSingletonScope();
|
|
10
|
+
container.registerDecorator(LockEntryEventsDecorator);
|
|
11
|
+
}
|
|
12
12
|
});
|
|
13
|
+
export { LockEntryFeature };
|
|
13
14
|
|
|
14
15
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/LockEntry/feature.js","sources":["../../../src/features/LockEntry/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { LockEntryUseCase } from \"./LockEntryUseCase.js\";\nimport { LockEntryRepository } from \"./LockEntryRepository.js\";\nimport { LockEntryEventsDecorator } from \"./LockEntryEventsDecorator.js\";\n\nexport const LockEntryFeature = createFeature({\n name: \"LockEntry\",\n register(container) {\n container.register(LockEntryUseCase);\n container.register(LockEntryRepository).inSingletonScope();\n container.registerDecorator(LockEntryEventsDecorator);\n }\n});\n"],"names":["LockEntryFeature","createFeature","container","LockEntryUseCase","LockEntryRepository","LockEntryEventsDecorator"],"mappings":";;;;AAKO,MAAMA,mBAAmBC,cAAc;IAC1C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE,qBAAqB,gBAAgB;QACxDF,UAAU,iBAAiB,CAACG;IAChC;AACJ"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
1
|
export interface RecordLockingParams {
|
|
3
2
|
/**
|
|
4
3
|
* Timeout in milliseconds after which a lock expires
|
|
5
4
|
*/
|
|
6
5
|
timeout: number;
|
|
7
|
-
/**
|
|
8
|
-
* The CMS model for storing lock records
|
|
9
|
-
*/
|
|
10
|
-
model: CmsModel;
|
|
11
6
|
}
|
|
12
|
-
export declare const RecordLockingFeature:
|
|
7
|
+
export declare const RecordLockingFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container, context: RecordLockingParams): void;
|
|
10
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
|
-
import { RecordLockingConfig
|
|
2
|
+
import { RecordLockingConfig } from "../domain/abstractions.js";
|
|
3
|
+
import { RecordLockingModelProvider } from "./RecordLockingModelProvider.js";
|
|
3
4
|
import { GetLockRecordFeature } from "./GetLockRecord/feature.js";
|
|
4
5
|
import { GetLockedEntryLockRecordFeature } from "./GetLockedEntryLockRecord/feature.js";
|
|
5
6
|
import { KickOutCurrentUserFeature } from "./KickOutCurrentUser/feature.js";
|
|
@@ -10,27 +11,25 @@ import { LockEntryFeature } from "./LockEntry/feature.js";
|
|
|
10
11
|
import { UpdateEntryLockFeature } from "./UpdateEntryLock/feature.js";
|
|
11
12
|
import { UnlockEntryFeature } from "./UnlockEntry/feature.js";
|
|
12
13
|
import { UnlockEntryRequestFeature } from "./UnlockEntryRequest/feature.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
UnlockEntryFeature.register(container);
|
|
32
|
-
UnlockEntryRequestFeature.register(container);
|
|
33
|
-
}
|
|
14
|
+
const RecordLockingFeature = createFeature({
|
|
15
|
+
name: "RecordLockingManagement",
|
|
16
|
+
register (container, params) {
|
|
17
|
+
container.registerInstance(RecordLockingConfig, {
|
|
18
|
+
timeout: params.timeout
|
|
19
|
+
});
|
|
20
|
+
container.register(RecordLockingModelProvider);
|
|
21
|
+
GetLockRecordFeature.register(container);
|
|
22
|
+
GetLockedEntryLockRecordFeature.register(container);
|
|
23
|
+
KickOutCurrentUserFeature.register(container);
|
|
24
|
+
ListLockRecordsFeature.register(container);
|
|
25
|
+
ListAllLockRecordsFeature.register(container);
|
|
26
|
+
IsEntryLockedFeature.register(container);
|
|
27
|
+
LockEntryFeature.register(container);
|
|
28
|
+
UpdateEntryLockFeature.register(container);
|
|
29
|
+
UnlockEntryFeature.register(container);
|
|
30
|
+
UnlockEntryRequestFeature.register(container);
|
|
31
|
+
}
|
|
34
32
|
});
|
|
33
|
+
export { RecordLockingFeature };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=RecordLockingFeature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/RecordLockingFeature.js","sources":["../../src/features/RecordLockingFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { RecordLockingConfig } from \"~/domain/abstractions.js\";\nimport { RecordLockingModelProvider } from \"./RecordLockingModelProvider.js\";\nimport { GetLockRecordFeature } from \"./GetLockRecord/feature.js\";\nimport { GetLockedEntryLockRecordFeature } from \"./GetLockedEntryLockRecord/feature.js\";\nimport { KickOutCurrentUserFeature } from \"./KickOutCurrentUser/feature.js\";\nimport { ListLockRecordsFeature } from \"./ListLockRecords/feature.js\";\nimport { ListAllLockRecordsFeature } from \"./ListAllLockRecords/feature.js\";\nimport { IsEntryLockedFeature } from \"./IsEntryLocked/feature.js\";\nimport { LockEntryFeature } from \"./LockEntry/feature.js\";\nimport { UpdateEntryLockFeature } from \"./UpdateEntryLock/feature.js\";\nimport { UnlockEntryFeature } from \"./UnlockEntry/feature.js\";\nimport { UnlockEntryRequestFeature } from \"./UnlockEntryRequest/feature.js\";\n\nexport interface RecordLockingParams {\n /**\n * Timeout in milliseconds after which a lock expires\n */\n timeout: number;\n}\n\nexport const RecordLockingFeature = createFeature<RecordLockingParams>({\n name: \"RecordLockingManagement\",\n register(container, params) {\n // Register domain abstractions\n container.registerInstance(RecordLockingConfig, { timeout: params.timeout });\n container.register(RecordLockingModelProvider);\n\n // Register all sub-features\n GetLockRecordFeature.register(container);\n GetLockedEntryLockRecordFeature.register(container);\n KickOutCurrentUserFeature.register(container);\n ListLockRecordsFeature.register(container);\n ListAllLockRecordsFeature.register(container);\n IsEntryLockedFeature.register(container);\n LockEntryFeature.register(container);\n UpdateEntryLockFeature.register(container);\n UnlockEntryFeature.register(container);\n UnlockEntryRequestFeature.register(container);\n }\n});\n"],"names":["RecordLockingFeature","createFeature","container","params","RecordLockingConfig","RecordLockingModelProvider","GetLockRecordFeature","GetLockedEntryLockRecordFeature","KickOutCurrentUserFeature","ListLockRecordsFeature","ListAllLockRecordsFeature","IsEntryLockedFeature","LockEntryFeature","UpdateEntryLockFeature","UnlockEntryFeature","UnlockEntryRequestFeature"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,uBAAuBC,cAAmC;IACnE,MAAM;IACN,UAASC,SAAS,EAAEC,MAAM;QAEtBD,UAAU,gBAAgB,CAACE,qBAAqB;YAAE,SAASD,OAAO,OAAO;QAAC;QAC1ED,UAAU,QAAQ,CAACG;QAGnBC,qBAAqB,QAAQ,CAACJ;QAC9BK,gCAAgC,QAAQ,CAACL;QACzCM,0BAA0B,QAAQ,CAACN;QACnCO,uBAAuB,QAAQ,CAACP;QAChCQ,0BAA0B,QAAQ,CAACR;QACnCS,qBAAqB,QAAQ,CAACT;QAC9BU,iBAAiB,QAAQ,CAACV;QAC1BW,uBAAuB,QAAQ,CAACX;QAChCY,mBAAmB,QAAQ,CAACZ;QAC5Ba,0BAA0B,QAAQ,CAACb;IACvC;AACJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
3
|
+
import { RecordLockingModelProvider as Abstraction } from "../domain/abstractions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the lock record model on demand.
|
|
6
|
+
*
|
|
7
|
+
* No memoization: `ModelsFetcher` already caches the model list per request. No
|
|
8
|
+
* `withoutAuthorization` either: the model is private, so access control lets every identity read it.
|
|
9
|
+
*/
|
|
10
|
+
declare class RecordLockingModelProviderImpl implements Abstraction.Interface {
|
|
11
|
+
private getModel;
|
|
12
|
+
constructor(getModel: GetModelUseCase.Interface);
|
|
13
|
+
get(): Promise<CmsModel>;
|
|
14
|
+
}
|
|
15
|
+
export declare const RecordLockingModelProvider: typeof RecordLockingModelProviderImpl & {
|
|
16
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/domain/abstractions.js").IRecordLockingModelProvider>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GetModelUseCase } from "@webiny/api-headless-cms/features/contentModel/GetModel/index.js";
|
|
2
|
+
import { RecordLockingModelProvider } from "../domain/abstractions.js";
|
|
3
|
+
import { RECORD_LOCKING_MODEL_ID } from "../domain/RecordLockingModel.js";
|
|
4
|
+
class RecordLockingModelProviderImpl {
|
|
5
|
+
constructor(getModel){
|
|
6
|
+
this.getModel = getModel;
|
|
7
|
+
}
|
|
8
|
+
async get() {
|
|
9
|
+
const result = await this.getModel.execute(RECORD_LOCKING_MODEL_ID);
|
|
10
|
+
if (result.isFail()) throw result.error;
|
|
11
|
+
return result.value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const RecordLockingModelProvider_RecordLockingModelProvider = RecordLockingModelProvider.createImplementation({
|
|
15
|
+
implementation: RecordLockingModelProviderImpl,
|
|
16
|
+
dependencies: [
|
|
17
|
+
GetModelUseCase
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
export { RecordLockingModelProvider_RecordLockingModelProvider as RecordLockingModelProvider };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=RecordLockingModelProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/RecordLockingModelProvider.js","sources":["../../src/features/RecordLockingModelProvider.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { RecordLockingModelProvider as Abstraction } from \"~/domain/abstractions.js\";\nimport { RECORD_LOCKING_MODEL_ID } from \"~/domain/RecordLockingModel.js\";\n\n/**\n * Resolves the lock record model on demand.\n *\n * No memoization: `ModelsFetcher` already caches the model list per request. No\n * `withoutAuthorization` either: the model is private, so access control lets every identity read it.\n */\nclass RecordLockingModelProviderImpl implements Abstraction.Interface {\n constructor(private getModel: GetModelUseCase.Interface) {}\n\n async get(): Promise<CmsModel> {\n const result = await this.getModel.execute(RECORD_LOCKING_MODEL_ID);\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n }\n}\n\nexport const RecordLockingModelProvider = Abstraction.createImplementation({\n implementation: RecordLockingModelProviderImpl,\n dependencies: [GetModelUseCase]\n});\n"],"names":["RecordLockingModelProviderImpl","getModel","result","RECORD_LOCKING_MODEL_ID","RecordLockingModelProvider","Abstraction","GetModelUseCase"],"mappings":";;;AAWA,MAAMA;IACF,YAAoBC,QAAmC,CAAE;aAArCA,QAAQ,GAARA;IAAsC;IAE1D,MAAM,MAAyB;QAC3B,MAAMC,SAAS,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACC;QAC3C,IAAID,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;QAEtB,OAAOA,OAAO,KAAK;IACvB;AACJ;AAEO,MAAME,wDAA6BC,2BAAAA,oBAAgC,CAAC;IACvE,gBAAgBL;IAChB,cAAc;QAACM;KAAgB;AACnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UnlockEntryInput, UnlockEntryUseCase as UseCaseAbstraction, UnlockEntryUseCase } from "./abstractions.js";
|
|
2
|
-
import { EventPublisher } from "@webiny/api-core/features/
|
|
2
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
3
|
import type { ILockRecord } from "../../domain/index.js";
|
|
4
4
|
import { Result } from "@webiny/feature/api/index.js";
|
|
5
5
|
declare class UnlockEntryEventsDecoratorImpl implements UnlockEntryUseCase.Interface {
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { UnlockEntryUseCase } from "./abstractions.js";
|
|
2
|
-
import { EventPublisher } from "@webiny/api-core/features/
|
|
2
|
+
import { EventPublisher } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
3
3
|
import { EntryAfterUnlockEvent, EntryBeforeUnlockEvent, EntryUnlockErrorEvent } from "./events.js";
|
|
4
4
|
class UnlockEntryEventsDecoratorImpl {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
constructor(eventPublisher, decoratee){
|
|
6
|
+
this.eventPublisher = eventPublisher;
|
|
7
|
+
this.decoratee = decoratee;
|
|
8
|
+
}
|
|
9
|
+
async execute(input) {
|
|
10
|
+
await this.eventPublisher.publish(new EntryBeforeUnlockEvent({
|
|
11
|
+
id: input.id,
|
|
12
|
+
type: input.type,
|
|
13
|
+
force: input.force
|
|
14
|
+
}));
|
|
15
|
+
const result = await this.decoratee.execute(input);
|
|
16
|
+
if (result.isFail()) {
|
|
17
|
+
const error = result.error;
|
|
18
|
+
await this.eventPublisher.publish(new EntryUnlockErrorEvent({
|
|
19
|
+
id: input.id,
|
|
20
|
+
type: input.type,
|
|
21
|
+
error
|
|
22
|
+
}));
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
await this.eventPublisher.publish(new EntryAfterUnlockEvent({
|
|
26
|
+
id: input.id,
|
|
27
|
+
type: input.type,
|
|
28
|
+
record: result.value
|
|
29
|
+
}));
|
|
30
|
+
return result;
|
|
25
31
|
}
|
|
26
|
-
|
|
27
|
-
// Publish after event
|
|
28
|
-
await this.eventPublisher.publish(new EntryAfterUnlockEvent({
|
|
29
|
-
id: input.id,
|
|
30
|
-
type: input.type,
|
|
31
|
-
record: result.value
|
|
32
|
-
}));
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const UnlockEntryEventsDecorator = UnlockEntryUseCase.createDecorator({
|
|
34
|
+
decorator: UnlockEntryEventsDecoratorImpl,
|
|
35
|
+
dependencies: [
|
|
36
|
+
EventPublisher
|
|
37
|
+
]
|
|
39
38
|
});
|
|
39
|
+
export { UnlockEntryEventsDecorator };
|
|
40
40
|
|
|
41
41
|
//# sourceMappingURL=UnlockEntryEventsDecorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/UnlockEntry/UnlockEntryEventsDecorator.js","sources":["../../../src/features/UnlockEntry/UnlockEntryEventsDecorator.ts"],"sourcesContent":["import {\n type UnlockEntryInput,\n UnlockEntryUseCase as UseCaseAbstraction,\n UnlockEntryUseCase\n} from \"./abstractions.js\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { ILockRecord } from \"~/domain/index.js\";\nimport { Result } from \"@webiny/feature/api/index.js\";\nimport { EntryAfterUnlockEvent, EntryBeforeUnlockEvent, EntryUnlockErrorEvent } from \"./events.js\";\n\nclass UnlockEntryEventsDecoratorImpl implements UnlockEntryUseCase.Interface {\n constructor(\n private readonly eventPublisher: EventPublisher.Interface,\n private readonly decoratee: UnlockEntryUseCase.Interface\n ) {}\n\n async execute(input: UnlockEntryInput): Promise<Result<ILockRecord, UseCaseAbstraction.Error>> {\n // Publish before event\n await this.eventPublisher.publish(\n new EntryBeforeUnlockEvent({\n id: input.id,\n type: input.type,\n force: input.force\n })\n );\n\n const result = await this.decoratee.execute(input);\n\n if (result.isFail()) {\n const error = result.error;\n\n await this.eventPublisher.publish(\n new EntryUnlockErrorEvent({\n id: input.id,\n type: input.type,\n error\n })\n );\n\n return result;\n }\n\n // Publish after event\n await this.eventPublisher.publish(\n new EntryAfterUnlockEvent({\n id: input.id,\n type: input.type,\n record: result.value\n })\n );\n\n return result;\n }\n}\n\nexport const UnlockEntryEventsDecorator = UnlockEntryUseCase.createDecorator({\n decorator: UnlockEntryEventsDecoratorImpl,\n dependencies: [EventPublisher]\n});\n"],"names":["UnlockEntryEventsDecoratorImpl","eventPublisher","decoratee","input","EntryBeforeUnlockEvent","result","error","EntryUnlockErrorEvent","EntryAfterUnlockEvent","UnlockEntryEventsDecorator","UnlockEntryUseCase","EventPublisher"],"mappings":";;;AAUA,MAAMA;IACF,YACqBC,cAAwC,EACxCC,SAAuC,CAC1D;aAFmBD,cAAc,GAAdA;aACAC,SAAS,GAATA;IAClB;IAEH,MAAM,QAAQC,KAAuB,EAA0D;QAE3F,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIC,uBAAuB;YACvB,IAAID,MAAM,EAAE;YACZ,MAAMA,MAAM,IAAI;YAChB,OAAOA,MAAM,KAAK;QACtB;QAGJ,MAAME,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACF;QAE5C,IAAIE,OAAO,MAAM,IAAI;YACjB,MAAMC,QAAQD,OAAO,KAAK;YAE1B,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIE,sBAAsB;gBACtB,IAAIJ,MAAM,EAAE;gBACZ,MAAMA,MAAM,IAAI;gBAChBG;YACJ;YAGJ,OAAOD;QACX;QAGA,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAC7B,IAAIG,sBAAsB;YACtB,IAAIL,MAAM,EAAE;YACZ,MAAMA,MAAM,IAAI;YAChB,QAAQE,OAAO,KAAK;QACxB;QAGJ,OAAOA;IACX;AACJ;AAEO,MAAMI,6BAA6BC,mBAAmB,eAAe,CAAC;IACzE,WAAWV;IACX,cAAc;QAACW;KAAe;AAClC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry";
|
|
3
3
|
import { UnlockEntryRepository as RepositoryAbstraction } from "./abstractions.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RecordLockingModelProvider } from "../../domain/abstractions.js";
|
|
5
5
|
declare class UnlockEntryRepositoryImpl implements RepositoryAbstraction.Interface {
|
|
6
|
-
private
|
|
6
|
+
private modelProvider;
|
|
7
7
|
private deleteEntry;
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(modelProvider: RecordLockingModelProvider.Interface, deleteEntry: DeleteEntryUseCase.Interface);
|
|
9
9
|
delete(lockRecordId: string): Promise<Result<void, RepositoryAbstraction.Error>>;
|
|
10
10
|
}
|
|
11
11
|
export declare const UnlockEntryRepository: typeof UnlockEntryRepositoryImpl & {
|
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
2
|
import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry";
|
|
3
3
|
import { createIdentifier } from "@webiny/utils";
|
|
4
|
-
import { UnlockEntryRepository
|
|
5
|
-
import {
|
|
4
|
+
import { UnlockEntryRepository } from "./abstractions.js";
|
|
5
|
+
import { RecordLockingModelProvider } from "../../domain/abstractions.js";
|
|
6
6
|
import { LockRecordNotFoundError, UnlockEntryError } from "../../domain/errors.js";
|
|
7
7
|
import { createLockRecordDatabaseId } from "../../utils/lockRecordDatabaseId.js";
|
|
8
8
|
class UnlockEntryRepositoryImpl {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
constructor(modelProvider, deleteEntry){
|
|
10
|
+
this.modelProvider = modelProvider;
|
|
11
|
+
this.deleteEntry = deleteEntry;
|
|
12
|
+
}
|
|
13
|
+
async delete(lockRecordId) {
|
|
14
|
+
try {
|
|
15
|
+
const model = await this.modelProvider.get();
|
|
16
|
+
const entryId = createLockRecordDatabaseId(lockRecordId);
|
|
17
|
+
const id = createIdentifier({
|
|
18
|
+
id: entryId,
|
|
19
|
+
version: 1
|
|
20
|
+
});
|
|
21
|
+
const result = await this.deleteEntry.execute(model, id, {
|
|
22
|
+
permanently: true
|
|
23
|
+
});
|
|
24
|
+
if (result.isFail()) {
|
|
25
|
+
if ("Cms/Entry/NotFound" === result.error.code) return Result.fail(new LockRecordNotFoundError());
|
|
26
|
+
return Result.fail(new UnlockEntryError(result.error));
|
|
27
|
+
}
|
|
28
|
+
return Result.ok();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
return Result.fail(new UnlockEntryError(error));
|
|
26
31
|
}
|
|
27
|
-
return Result.fail(new UnlockEntryError(result.error));
|
|
28
|
-
}
|
|
29
|
-
return Result.ok();
|
|
30
|
-
} catch (error) {
|
|
31
|
-
return Result.fail(new UnlockEntryError(error));
|
|
32
32
|
}
|
|
33
|
-
}
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
const UnlockEntryRepository_UnlockEntryRepository = UnlockEntryRepository.createImplementation({
|
|
35
|
+
implementation: UnlockEntryRepositoryImpl,
|
|
36
|
+
dependencies: [
|
|
37
|
+
RecordLockingModelProvider,
|
|
38
|
+
DeleteEntryUseCase
|
|
39
|
+
]
|
|
38
40
|
});
|
|
41
|
+
export { UnlockEntryRepository_UnlockEntryRepository as UnlockEntryRepository };
|
|
39
42
|
|
|
40
43
|
//# sourceMappingURL=UnlockEntryRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/UnlockEntry/UnlockEntryRepository.js","sources":["../../../src/features/UnlockEntry/UnlockEntryRepository.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { DeleteEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntry\";\nimport { createIdentifier } from \"@webiny/utils\";\nimport { UnlockEntryRepository as RepositoryAbstraction } from \"./abstractions.js\";\nimport { RecordLockingModelProvider } from \"~/domain/abstractions.js\";\nimport { LockRecordNotFoundError, UnlockEntryError } from \"~/domain/errors.js\";\nimport { createLockRecordDatabaseId } from \"~/utils/lockRecordDatabaseId.js\";\n\nclass UnlockEntryRepositoryImpl implements RepositoryAbstraction.Interface {\n constructor(\n private modelProvider: RecordLockingModelProvider.Interface,\n private deleteEntry: DeleteEntryUseCase.Interface\n ) {}\n\n async delete(lockRecordId: string): Promise<Result<void, RepositoryAbstraction.Error>> {\n try {\n const model = await this.modelProvider.get();\n\n const entryId = createLockRecordDatabaseId(lockRecordId);\n const id = createIdentifier({\n id: entryId,\n version: 1\n });\n\n const result = await this.deleteEntry.execute(model, id, {\n permanently: true\n });\n\n if (result.isFail()) {\n if (result.error.code === \"Cms/Entry/NotFound\") {\n return Result.fail(new LockRecordNotFoundError());\n }\n return Result.fail(new UnlockEntryError(result.error));\n }\n\n return Result.ok();\n } catch (error) {\n return Result.fail(new UnlockEntryError(error as Error));\n }\n }\n}\n\nexport const UnlockEntryRepository = RepositoryAbstraction.createImplementation({\n implementation: UnlockEntryRepositoryImpl,\n dependencies: [RecordLockingModelProvider, DeleteEntryUseCase]\n});\n"],"names":["UnlockEntryRepositoryImpl","modelProvider","deleteEntry","lockRecordId","model","entryId","createLockRecordDatabaseId","id","createIdentifier","result","Result","LockRecordNotFoundError","UnlockEntryError","error","UnlockEntryRepository","RepositoryAbstraction","RecordLockingModelProvider","DeleteEntryUseCase"],"mappings":";;;;;;;AAQA,MAAMA;IACF,YACYC,aAAmD,EACnDC,WAAyC,CACnD;aAFUD,aAAa,GAAbA;aACAC,WAAW,GAAXA;IACT;IAEH,MAAM,OAAOC,YAAoB,EAAsD;QACnF,IAAI;YACA,MAAMC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG;YAE1C,MAAMC,UAAUC,2BAA2BH;YAC3C,MAAMI,KAAKC,iBAAiB;gBACxB,IAAIH;gBACJ,SAAS;YACb;YAEA,MAAMI,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAACL,OAAOG,IAAI;gBACrD,aAAa;YACjB;YAEA,IAAIE,OAAO,MAAM,IAAI;gBACjB,IAAIA,AAAsB,yBAAtBA,OAAO,KAAK,CAAC,IAAI,EACjB,OAAOC,OAAO,IAAI,CAAC,IAAIC;gBAE3B,OAAOD,OAAO,IAAI,CAAC,IAAIE,iBAAiBH,OAAO,KAAK;YACxD;YAEA,OAAOC,OAAO,EAAE;QACpB,EAAE,OAAOG,OAAO;YACZ,OAAOH,OAAO,IAAI,CAAC,IAAIE,iBAAiBC;QAC5C;IACJ;AACJ;AAEO,MAAMC,8CAAwBC,sBAAAA,oBAA0C,CAAC;IAC5E,gBAAgBf;IAChB,cAAc;QAACgB;QAA4BC;KAAmB;AAClE"}
|
|
@@ -2,7 +2,7 @@ import { Result } from "@webiny/feature/api";
|
|
|
2
2
|
import { UnlockEntryUseCase as UseCaseAbstraction, UnlockEntryRepository, UnlockEntryInput } from "./abstractions.js";
|
|
3
3
|
import { GetLockRecordUseCase } from "../GetLockRecord/abstractions.js";
|
|
4
4
|
import { KickOutCurrentUserUseCase } from "../KickOutCurrentUser/abstractions.js";
|
|
5
|
-
import { IdentityContext } from "@webiny/api-core/features/IdentityContext";
|
|
5
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
6
6
|
import type { ILockRecord } from "../../domain/LockRecord.js";
|
|
7
7
|
declare class UnlockEntryUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
8
8
|
private getLockRecord;
|