@webiny/app-record-locking 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RecordLockingModule.d.ts +2 -0
- package/RecordLockingModule.js +74 -0
- package/RecordLockingModule.js.map +1 -0
- package/SecurityPermissions.js +15 -0
- package/SecurityPermissions.js.map +1 -0
- package/features/acquireLock/AcquireLockGateway.d.ts +12 -0
- package/features/acquireLock/AcquireLockGateway.js +43 -0
- package/features/acquireLock/AcquireLockGateway.js.map +1 -0
- package/features/acquireLock/AcquireLockUseCase.d.ts +10 -0
- package/features/acquireLock/AcquireLockUseCase.js +18 -0
- package/features/acquireLock/AcquireLockUseCase.js.map +1 -0
- package/features/acquireLock/abstractions.d.ts +19 -0
- package/features/acquireLock/abstractions.js +6 -0
- package/features/acquireLock/abstractions.js.map +1 -0
- package/features/acquireLock/feature.d.ts +3 -0
- package/features/acquireLock/feature.js +19 -0
- package/features/acquireLock/feature.js.map +1 -0
- package/features/checkLockStatus/CheckLockStatusGateway.d.ts +12 -0
- package/features/checkLockStatus/CheckLockStatusGateway.js +43 -0
- package/features/checkLockStatus/CheckLockStatusGateway.js.map +1 -0
- package/features/checkLockStatus/CheckLockStatusUseCase.d.ts +10 -0
- package/features/checkLockStatus/CheckLockStatusUseCase.js +18 -0
- package/features/checkLockStatus/CheckLockStatusUseCase.js.map +1 -0
- package/features/checkLockStatus/abstractions.d.ts +19 -0
- package/features/checkLockStatus/abstractions.js +6 -0
- package/features/checkLockStatus/abstractions.js.map +1 -0
- package/features/checkLockStatus/feature.d.ts +3 -0
- package/features/checkLockStatus/feature.js +19 -0
- package/features/checkLockStatus/feature.js.map +1 -0
- package/features/feature.d.ts +1 -0
- package/features/feature.js +19 -0
- package/features/feature.js.map +1 -0
- package/features/forceUnlock/ForceUnlockGateway.d.ts +12 -0
- package/features/forceUnlock/ForceUnlockGateway.js +44 -0
- package/features/forceUnlock/ForceUnlockGateway.js.map +1 -0
- package/features/forceUnlock/ForceUnlockUseCase.d.ts +10 -0
- package/features/forceUnlock/ForceUnlockUseCase.js +18 -0
- package/features/forceUnlock/ForceUnlockUseCase.js.map +1 -0
- package/features/forceUnlock/abstractions.d.ts +19 -0
- package/features/forceUnlock/abstractions.js +6 -0
- package/features/forceUnlock/abstractions.js.map +1 -0
- package/features/forceUnlock/feature.d.ts +3 -0
- package/features/forceUnlock/feature.js +19 -0
- package/features/forceUnlock/feature.js.map +1 -0
- package/{domain/graphql/fields.js → features/graphqlFields.js} +4 -3
- package/features/graphqlFields.js.map +1 -0
- package/features/listLockRecords/ListLockRecordsGateway.d.ts +12 -0
- package/features/listLockRecords/ListLockRecordsGateway.js +48 -0
- package/features/listLockRecords/ListLockRecordsGateway.js.map +1 -0
- package/features/listLockRecords/ListLockRecordsUseCase.d.ts +10 -0
- package/features/listLockRecords/ListLockRecordsUseCase.js +18 -0
- package/features/listLockRecords/ListLockRecordsUseCase.js.map +1 -0
- package/features/listLockRecords/abstractions.d.ts +22 -0
- package/features/listLockRecords/abstractions.js +6 -0
- package/features/listLockRecords/abstractions.js.map +1 -0
- package/features/listLockRecords/feature.d.ts +3 -0
- package/features/listLockRecords/feature.js +19 -0
- package/features/listLockRecords/feature.js.map +1 -0
- package/features/permissions/abstractions.d.ts +1 -1
- package/features/permissions/abstractions.js +3 -2
- package/features/permissions/abstractions.js.map +1 -1
- package/features/permissions/feature.js +3 -2
- package/features/permissions/feature.js.map +1 -1
- package/features/releaseLock/ReleaseLockGateway.d.ts +12 -0
- package/features/releaseLock/ReleaseLockGateway.js +44 -0
- package/features/releaseLock/ReleaseLockGateway.js.map +1 -0
- package/features/releaseLock/ReleaseLockUseCase.d.ts +10 -0
- package/features/releaseLock/ReleaseLockUseCase.js +18 -0
- package/features/releaseLock/ReleaseLockUseCase.js.map +1 -0
- package/features/releaseLock/abstractions.d.ts +19 -0
- package/features/releaseLock/abstractions.js +6 -0
- package/features/releaseLock/abstractions.js.map +1 -0
- package/features/releaseLock/feature.d.ts +3 -0
- package/features/releaseLock/feature.js +19 -0
- package/features/releaseLock/feature.js.map +1 -0
- package/index.d.ts +0 -5
- package/index.js +20 -27
- package/index.js.map +1 -1
- package/package.json +18 -20
- package/permissions/permissionsSchema.js +10 -0
- package/permissions/permissionsSchema.js.map +1 -0
- package/presentation/entryLocking/ContentEntryFormPresenterDecorator.d.ts +23 -0
- package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js +64 -0
- package/presentation/entryLocking/ContentEntryFormPresenterDecorator.js.map +1 -0
- package/presentation/entryLocking/RecordLockingPresenter.d.ts +32 -0
- package/presentation/entryLocking/RecordLockingPresenter.js +164 -0
- package/presentation/entryLocking/RecordLockingPresenter.js.map +1 -0
- package/presentation/entryLocking/SingleEntryContentDecorator.d.ts +2 -0
- package/presentation/entryLocking/SingleEntryContentDecorator.js +72 -0
- package/presentation/entryLocking/SingleEntryContentDecorator.js.map +1 -0
- package/presentation/entryLocking/SingleEntryPresenterDecorator.d.ts +15 -0
- package/presentation/entryLocking/SingleEntryPresenterDecorator.js +40 -0
- package/presentation/entryLocking/SingleEntryPresenterDecorator.js.map +1 -0
- package/presentation/entryLocking/abstractions.d.ts +26 -0
- package/presentation/entryLocking/abstractions.js +5 -0
- package/presentation/entryLocking/abstractions.js.map +1 -0
- package/presentation/entryLocking/components/ForceUnlockButton.d.ts +11 -0
- package/presentation/entryLocking/components/ForceUnlockButton.js +37 -0
- package/presentation/entryLocking/components/ForceUnlockButton.js.map +1 -0
- package/presentation/entryLocking/components/LockedEntryOverlay.d.ts +10 -0
- package/presentation/entryLocking/components/LockedEntryOverlay.js +52 -0
- package/presentation/entryLocking/components/LockedEntryOverlay.js.map +1 -0
- package/presentation/entryLocking/components/RecordLockingGuard.d.ts +12 -0
- package/presentation/entryLocking/components/RecordLockingGuard.js +74 -0
- package/presentation/entryLocking/components/RecordLockingGuard.js.map +1 -0
- package/presentation/entryLocking/feature.d.ts +3 -0
- package/presentation/entryLocking/feature.js +21 -0
- package/presentation/entryLocking/feature.js.map +1 -0
- package/presentation/listLocking/ContentEntriesPresenterDecorator.d.ts +25 -0
- package/presentation/listLocking/ContentEntriesPresenterDecorator.js +70 -0
- package/presentation/listLocking/ContentEntriesPresenterDecorator.js.map +1 -0
- package/presentation/listLocking/ListLockRecordsPresenter.d.ts +17 -0
- package/presentation/listLocking/ListLockRecordsPresenter.js +52 -0
- package/presentation/listLocking/ListLockRecordsPresenter.js.map +1 -0
- package/presentation/listLocking/abstractions.d.ts +16 -0
- package/presentation/listLocking/abstractions.js +5 -0
- package/presentation/listLocking/abstractions.js.map +1 -0
- package/presentation/listLocking/components/ListLockRecordsSync.d.ts +4 -0
- package/presentation/listLocking/components/ListLockRecordsSync.js +26 -0
- package/presentation/listLocking/components/ListLockRecordsSync.js.map +1 -0
- package/presentation/listLocking/components/LockIndicatorCell.d.ts +2 -0
- package/presentation/listLocking/components/LockIndicatorCell.js +39 -0
- package/presentation/listLocking/components/LockIndicatorCell.js.map +1 -0
- package/presentation/listLocking/feature.d.ts +3 -0
- package/presentation/listLocking/feature.js +19 -0
- package/presentation/listLocking/feature.js.map +1 -0
- package/types.d.ts +1 -62
- package/types.js +0 -3
- package/components/HeadlessCmsActionsAcoCell.d.ts +0 -2
- package/components/HeadlessCmsActionsAcoCell.js +0 -60
- package/components/HeadlessCmsActionsAcoCell.js.map +0 -1
- package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +0 -9
- package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +0 -42
- package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +0 -1
- package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +0 -18
- package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +0 -99
- package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +0 -1
- package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.d.ts +0 -2
- package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +0 -68
- package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +0 -1
- package/components/HeadlessCmsContentEntry/index.d.ts +0 -1
- package/components/HeadlessCmsContentEntry/index.js +0 -3
- package/components/HeadlessCmsContentEntry/index.js.map +0 -1
- package/components/LockedRecord/LockedRecord.d.ts +0 -6
- package/components/LockedRecord/LockedRecord.js +0 -66
- package/components/LockedRecord/LockedRecord.js.map +0 -1
- package/components/LockedRecord/LockedRecordForceUnlock.d.ts +0 -9
- package/components/LockedRecord/LockedRecordForceUnlock.js +0 -71
- package/components/LockedRecord/LockedRecordForceUnlock.js.map +0 -1
- package/components/LockedRecord/index.d.ts +0 -1
- package/components/LockedRecord/index.js +0 -3
- package/components/LockedRecord/index.js.map +0 -1
- package/components/RecordLockingProvider.d.ts +0 -7
- package/components/RecordLockingProvider.js +0 -125
- package/components/RecordLockingProvider.js.map +0 -1
- package/components/SecurityPermissions.js +0 -18
- package/components/SecurityPermissions.js.map +0 -1
- package/components/decorators/UseContentEntriesListHookDecorator.d.ts +0 -1
- package/components/decorators/UseContentEntriesListHookDecorator.js +0 -23
- package/components/decorators/UseContentEntriesListHookDecorator.js.map +0 -1
- package/components/decorators/UseRecordsDecorator.d.ts +0 -8
- package/components/decorators/UseRecordsDecorator.js +0 -25
- package/components/decorators/UseRecordsDecorator.js.map +0 -1
- package/components/decorators/UseSaveEntryDecorator.d.ts +0 -1
- package/components/decorators/UseSaveEntryDecorator.js +0 -55
- package/components/decorators/UseSaveEntryDecorator.js.map +0 -1
- package/domain/RecordLocking.d.ts +0 -28
- package/domain/RecordLocking.js +0 -321
- package/domain/RecordLocking.js.map +0 -1
- package/domain/RecordLockingClient.d.ts +0 -12
- package/domain/RecordLockingClient.js +0 -19
- package/domain/RecordLockingClient.js.map +0 -1
- package/domain/RecordLockingGetLockRecord.d.ts +0 -11
- package/domain/RecordLockingGetLockRecord.js +0 -21
- package/domain/RecordLockingGetLockRecord.js.map +0 -1
- package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +0 -11
- package/domain/RecordLockingGetLockedEntryLockRecord.js +0 -19
- package/domain/RecordLockingGetLockedEntryLockRecord.js.map +0 -1
- package/domain/RecordLockingIsEntryLocked.d.ts +0 -11
- package/domain/RecordLockingIsEntryLocked.js +0 -19
- package/domain/RecordLockingIsEntryLocked.js.map +0 -1
- package/domain/RecordLockingListLockRecords.d.ts +0 -12
- package/domain/RecordLockingListLockRecords.js +0 -31
- package/domain/RecordLockingListLockRecords.js.map +0 -1
- package/domain/RecordLockingLockEntry.d.ts +0 -11
- package/domain/RecordLockingLockEntry.js +0 -13
- package/domain/RecordLockingLockEntry.js.map +0 -1
- package/domain/RecordLockingUnlockEntry.d.ts +0 -11
- package/domain/RecordLockingUnlockEntry.js +0 -19
- package/domain/RecordLockingUnlockEntry.js.map +0 -1
- package/domain/RecordLockingUpdateEntryLock.d.ts +0 -11
- package/domain/RecordLockingUpdateEntryLock.js +0 -19
- package/domain/RecordLockingUpdateEntryLock.js.map +0 -1
- package/domain/abstractions/IRecordLocking.d.ts +0 -25
- package/domain/abstractions/IRecordLocking.js +0 -3
- package/domain/abstractions/IRecordLocking.js.map +0 -1
- package/domain/abstractions/IRecordLockingClient.d.ts +0 -6
- package/domain/abstractions/IRecordLockingClient.js +0 -3
- package/domain/abstractions/IRecordLockingClient.js.map +0 -1
- package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +0 -12
- package/domain/abstractions/IRecordLockingGetLockRecord.js +0 -3
- package/domain/abstractions/IRecordLockingGetLockRecord.js.map +0 -1
- package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +0 -12
- package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +0 -3
- package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js.map +0 -1
- package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +0 -8
- package/domain/abstractions/IRecordLockingIsEntryLocked.js +0 -3
- package/domain/abstractions/IRecordLockingIsEntryLocked.js.map +0 -1
- package/domain/abstractions/IRecordLockingListLockRecords.d.ts +0 -19
- package/domain/abstractions/IRecordLockingListLockRecords.js +0 -3
- package/domain/abstractions/IRecordLockingListLockRecords.js.map +0 -1
- package/domain/abstractions/IRecordLockingLockEntry.d.ts +0 -12
- package/domain/abstractions/IRecordLockingLockEntry.js +0 -3
- package/domain/abstractions/IRecordLockingLockEntry.js.map +0 -1
- package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +0 -13
- package/domain/abstractions/IRecordLockingUnlockEntry.js +0 -3
- package/domain/abstractions/IRecordLockingUnlockEntry.js.map +0 -1
- package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +0 -12
- package/domain/abstractions/IRecordLockingUpdateEntryLock.js +0 -3
- package/domain/abstractions/IRecordLockingUpdateEntryLock.js.map +0 -1
- package/domain/graphql/fields.js.map +0 -1
- package/domain/graphql/getLockRecord.d.ts +0 -12
- package/domain/graphql/getLockRecord.js +0 -18
- package/domain/graphql/getLockRecord.js.map +0 -1
- package/domain/graphql/getLockedEntryLockRecord.d.ts +0 -12
- package/domain/graphql/getLockedEntryLockRecord.js +0 -18
- package/domain/graphql/getLockedEntryLockRecord.js.map +0 -1
- package/domain/graphql/isEntryLocked.d.ts +0 -12
- package/domain/graphql/isEntryLocked.js +0 -16
- package/domain/graphql/isEntryLocked.js.map +0 -1
- package/domain/graphql/listLockRecords.d.ts +0 -17
- package/domain/graphql/listLockRecords.js +0 -26
- package/domain/graphql/listLockRecords.js.map +0 -1
- package/domain/graphql/lockEntry.d.ts +0 -12
- package/domain/graphql/lockEntry.js +0 -20
- package/domain/graphql/lockEntry.js.map +0 -1
- package/domain/graphql/unlockEntry.d.ts +0 -12
- package/domain/graphql/unlockEntry.js +0 -18
- package/domain/graphql/unlockEntry.js.map +0 -1
- package/domain/graphql/updateEntryLock.d.ts +0 -12
- package/domain/graphql/updateEntryLock.js +0 -18
- package/domain/graphql/updateEntryLock.js.map +0 -1
- package/domain/permissionsSchema.js +0 -9
- package/domain/permissionsSchema.js.map +0 -1
- package/domain/utils/createRecordLockingClient.d.ts +0 -3
- package/domain/utils/createRecordLockingClient.js +0 -12
- package/domain/utils/createRecordLockingClient.js.map +0 -1
- package/domain/utils/createRecordLockingError.d.ts +0 -6
- package/domain/utils/createRecordLockingError.js +0 -16
- package/domain/utils/createRecordLockingError.js.map +0 -1
- package/hooks/index.d.ts +0 -2
- package/hooks/index.js +0 -4
- package/hooks/index.js.map +0 -1
- package/hooks/usePermission.d.ts +0 -3
- package/hooks/usePermission.js +0 -20
- package/hooks/usePermission.js.map +0 -1
- package/hooks/useRecordLocking.d.ts +0 -2
- package/hooks/useRecordLocking.js +0 -12
- package/hooks/useRecordLocking.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/createCacheKey.d.ts +0 -3
- package/utils/createCacheKey.js +0 -15
- package/utils/createCacheKey.js.map +0 -1
- /package/{components/SecurityPermissions.d.ts → SecurityPermissions.d.ts} +0 -0
- /package/{domain/graphql/fields.d.ts → features/graphqlFields.d.ts} +0 -0
- /package/{domain → permissions}/permissionsSchema.d.ts +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RecordLockingClient } from "../RecordLockingClient.js";
|
|
2
|
-
import { ApolloClient } from "apollo-client";
|
|
3
|
-
export const createRecordLockingClient = client => {
|
|
4
|
-
if (client instanceof ApolloClient) {
|
|
5
|
-
return new RecordLockingClient({
|
|
6
|
-
client
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return client;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=createRecordLockingClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["RecordLockingClient","ApolloClient","createRecordLockingClient","client"],"sources":["createRecordLockingClient.ts"],"sourcesContent":["import type { IRecordLockingClient } from \"~/domain/abstractions/IRecordLockingClient.js\";\nimport { RecordLockingClient } from \"~/domain/RecordLockingClient.js\";\nimport { ApolloClient } from \"apollo-client\";\n\nexport const createRecordLockingClient = (client: IRecordLockingClient | ApolloClient<any>) => {\n if (client instanceof ApolloClient) {\n return new RecordLockingClient({ client });\n }\n return client;\n};\n"],"mappings":"AACA,SAASA,mBAAmB;AAC5B,SAASC,YAAY,QAAQ,eAAe;AAE5C,OAAO,MAAMC,yBAAyB,GAAIC,MAAgD,IAAK;EAC3F,IAAIA,MAAM,YAAYF,YAAY,EAAE;IAChC,OAAO,IAAID,mBAAmB,CAAC;MAAEG;IAAO,CAAC,CAAC;EAC9C;EACA,OAAOA,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export const createRecordLockingError = error => {
|
|
2
|
-
if (error instanceof Error) {
|
|
3
|
-
return {
|
|
4
|
-
message: error.message,
|
|
5
|
-
code: error.code || "UNKNOWN_ERROR",
|
|
6
|
-
data: error.data
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
message: error.message,
|
|
11
|
-
code: error.code,
|
|
12
|
-
data: error.data
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=createRecordLockingError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createRecordLockingError","error","Error","message","code","data"],"sources":["createRecordLockingError.ts"],"sourcesContent":["import type { IRecordLockingError } from \"~/types.js\";\n\nexport interface IError extends Error {\n code?: string;\n data?: any;\n}\n\nexport const createRecordLockingError = (\n error: IError | IRecordLockingError\n): IRecordLockingError => {\n if (error instanceof Error) {\n return {\n message: error.message,\n code: error.code || \"UNKNOWN_ERROR\",\n data: error.data\n };\n }\n return {\n message: error.message,\n code: error.code,\n data: error.data\n };\n};\n"],"mappings":"AAOA,OAAO,MAAMA,wBAAwB,GACjCC,KAAmC,IACb;EACtB,IAAIA,KAAK,YAAYC,KAAK,EAAE;IACxB,OAAO;MACHC,OAAO,EAAEF,KAAK,CAACE,OAAO;MACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI,IAAI,eAAe;MACnCC,IAAI,EAAEJ,KAAK,CAACI;IAChB,CAAC;EACL;EACA,OAAO;IACHF,OAAO,EAAEF,KAAK,CAACE,OAAO;IACtBC,IAAI,EAAEH,KAAK,CAACG,IAAI;IAChBC,IAAI,EAAEJ,KAAK,CAACI;EAChB,CAAC;AACL,CAAC","ignoreList":[]}
|
package/hooks/index.d.ts
DELETED
package/hooks/index.js
DELETED
package/hooks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useRecordLocking.js\";\nexport * from \"./usePermission.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
package/hooks/usePermission.d.ts
DELETED
package/hooks/usePermission.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { useIdentity } from "@webiny/app-admin";
|
|
3
|
-
export const usePermission = () => {
|
|
4
|
-
const {
|
|
5
|
-
identity
|
|
6
|
-
} = useIdentity();
|
|
7
|
-
const canForceUnlock = useMemo(() => {
|
|
8
|
-
const hasFullAccess = !!identity.getPermission("recordLocking.*");
|
|
9
|
-
if (hasFullAccess) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
const permission = identity.getPermission("recordLocking");
|
|
13
|
-
return permission?.canForceUnlock === true;
|
|
14
|
-
}, [identity]);
|
|
15
|
-
return {
|
|
16
|
-
canForceUnlock
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=usePermission.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useIdentity","usePermission","identity","canForceUnlock","hasFullAccess","getPermission","permission"],"sources":["usePermission.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useIdentity } from \"@webiny/app-admin\";\n\nexport const usePermission = () => {\n const { identity } = useIdentity();\n\n const canForceUnlock = useMemo(() => {\n const hasFullAccess = !!identity.getPermission(\"recordLocking.*\");\n if (hasFullAccess) {\n return true;\n }\n const permission = identity.getPermission(\"recordLocking\");\n return permission?.canForceUnlock === true;\n }, [identity]);\n\n return {\n canForceUnlock\n };\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,WAAW,QAAQ,mBAAmB;AAE/C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC;EAAS,CAAC,GAAGF,WAAW,CAAC,CAAC;EAElC,MAAMG,cAAc,GAAGJ,OAAO,CAAC,MAAM;IACjC,MAAMK,aAAa,GAAG,CAAC,CAACF,QAAQ,CAACG,aAAa,CAAC,iBAAiB,CAAC;IACjE,IAAID,aAAa,EAAE;MACf,OAAO,IAAI;IACf;IACA,MAAME,UAAU,GAAGJ,QAAQ,CAACG,aAAa,CAAC,eAAe,CAAC;IAC1D,OAAOC,UAAU,EAAEH,cAAc,KAAK,IAAI;EAC9C,CAAC,EAAE,CAACD,QAAQ,CAAC,CAAC;EAEd,OAAO;IACHC;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { RecordLockingContext } from "../components/RecordLockingProvider.js";
|
|
4
|
-
export const useRecordLocking = () => {
|
|
5
|
-
const context = useContext(RecordLockingContext);
|
|
6
|
-
if (!context) {
|
|
7
|
-
throw new WebinyError("useRecordLocking must be used within a RecordLockingProvider.");
|
|
8
|
-
}
|
|
9
|
-
return context;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=useRecordLocking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","useContext","RecordLockingContext","useRecordLocking","context"],"sources":["useRecordLocking.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { useContext } from \"react\";\nimport { RecordLockingContext } from \"~/components/RecordLockingProvider.js\";\nimport type { IRecordLockingContext, IPossiblyRecordLockingRecord } from \"~/types.js\";\n\nexport const useRecordLocking = <\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n>() => {\n const context = useContext(RecordLockingContext);\n if (!context) {\n throw new WebinyError(\"useRecordLocking must be used within a RecordLockingProvider.\");\n }\n return context as IRecordLockingContext<T>;\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,UAAU,QAAQ,OAAO;AAClC,SAASC,oBAAoB;AAG7B,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAEzB;EACH,MAAMC,OAAO,GAAGH,UAAU,CAACC,oBAAoB,CAAC;EAChD,IAAI,CAACE,OAAO,EAAE;IACV,MAAM,IAAIJ,WAAW,CAAC,+DAA+D,CAAC;EAC1F;EACA,OAAOI,OAAO;AAClB,CAAC","ignoreList":[]}
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsContentEntry } from \"@webiny/app-headless-cms/types.js\";\nimport type { GenericRecord } from \"@webiny/app/types.js\";\nimport type { IRecordLockingUnlockEntryResult } from \"~/domain/abstractions/IRecordLockingUnlockEntry.js\";\nimport type { IRecordLockingUpdateEntryLockResult } from \"~/domain/abstractions/IRecordLocking.js\";\nimport { Identity } from \"@webiny/app-admin/domain/Identity.js\";\n\nexport interface IRecordLockingIdentity {\n id: string;\n displayName: string;\n type: string;\n}\n\nexport interface IRecordLockingRecordLocked {\n lockedBy: IRecordLockingIdentity;\n lockedOn: string;\n expiresOn: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IRecordLockingCmsEntryValuesAction {\n type: string;\n message: string;\n createdBy: Identity;\n createdOn: string;\n}\n\nexport interface IRecordLockingCmsEntryValues {\n lockedBy: Identity;\n lockedOn: string;\n updatedOn: string;\n expiresOn: string;\n targetId: string;\n type: string;\n actions: IRecordLockingCmsEntryValuesAction;\n}\n\nexport interface IPossiblyRecordLockingRecord extends CmsContentEntry<IRecordLockingCmsEntryValues> {\n $selectable?: boolean;\n $type?: \"RECORD\";\n $lockingType?: string;\n $locked?: IRecordLockingRecordLocked | null;\n}\n\nexport interface IRecordLockingRecord extends IPossiblyRecordLockingRecord {\n $lockingType: string;\n}\n\nexport type IIsRecordLockedParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUpdateEntryLockParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IUnlockEntryParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport type IFetchLockedEntryLockRecordParams = Pick<IRecordLockingRecord, \"id\" | \"$lockingType\">;\n\nexport interface IFetchLockRecordResult {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n}\n\nexport interface IRecordLockingContext<\n T extends IPossiblyRecordLockingRecord = IPossiblyRecordLockingRecord\n> {\n readonly loading: boolean;\n readonly records: IPossiblyRecordLockingRecord[];\n readonly error?: IRecordLockingError | null;\n setRecords(folderId: string, type: string, records: T[]): Promise<void>;\n updateEntryLock(params: IUpdateEntryLockParams): Promise<IRecordLockingUpdateEntryLockResult>;\n isRecordLocked(params?: IIsRecordLockedParams): boolean;\n getLockRecordEntry(id: string): IRecordLockingRecord | undefined;\n fetchLockRecord(params: IFetchLockRecordParams): Promise<IFetchLockRecordResult>;\n fetchLockedEntryLockRecord(\n params: IFetchLockedEntryLockRecordParams\n ): Promise<IRecordLockingLockRecord | null>;\n unlockEntry(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n removeEntryLock(params: IUnlockEntryParams): void;\n unlockEntryForce(params: IUnlockEntryParams): Promise<IRecordLockingUnlockEntryResult>;\n isLockExpired(input: Date | string): boolean;\n}\n\nexport interface IRecordLockingLockRecordAction {\n type: string;\n message: string;\n createdBy: IRecordLockingIdentity;\n createdOn: string;\n}\n\nexport interface IRecordLockingLockRecord {\n id: string;\n lockedOn: string;\n expiresOn: string;\n lockedBy: IRecordLockingIdentity;\n targetId: string;\n type: string;\n actions: IRecordLockingLockRecordAction[];\n}\n\nexport interface IRecordLockingMeta {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\nexport interface IRecordLockingError<T = GenericRecord> {\n message: string;\n code: string;\n data?: T;\n}\n\nexport interface RecordLockingSecurityPermission extends Identity.Permission {\n canForceUnlock?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
package/utils/createCacheKey.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { sha1 } from "crypto-hash";
|
|
2
|
-
const createKey = input => {
|
|
3
|
-
if (typeof input === "string") {
|
|
4
|
-
return input;
|
|
5
|
-
}
|
|
6
|
-
return JSON.stringify(input);
|
|
7
|
-
};
|
|
8
|
-
export const createCacheKey = input => {
|
|
9
|
-
const key = createKey(input);
|
|
10
|
-
return sha1(key, {
|
|
11
|
-
outputFormat: "hex"
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=createCacheKey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sha1","createKey","input","JSON","stringify","createCacheKey","key","outputFormat"],"sources":["createCacheKey.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/app/types.js\";\nimport { sha1 } from \"crypto-hash\";\n\nexport type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];\n\nconst createKey = (input: ICreateCacheKeyInput): string => {\n if (typeof input === \"string\") {\n return input;\n }\n return JSON.stringify(input);\n};\n\nexport const createCacheKey = (input: ICreateCacheKeyInput): Promise<string> => {\n const key = createKey(input);\n\n return sha1(key, {\n outputFormat: \"hex\"\n });\n};\n"],"mappings":"AACA,SAASA,IAAI,QAAQ,aAAa;AAIlC,MAAMC,SAAS,GAAIC,KAA2B,IAAa;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAED,OAAO,MAAMG,cAAc,GAAIH,KAA2B,IAAsB;EAC5E,MAAMI,GAAG,GAAGL,SAAS,CAACC,KAAK,CAAC;EAE5B,OAAOF,IAAI,CAACM,GAAG,EAAE;IACbC,YAAY,EAAE;EAClB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|