@webiny/api-record-locking 6.3.0 → 6.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/domain/LockRecord.js +63 -70
- package/domain/LockRecord.js.map +1 -1
- package/domain/RecordLockingModel.js +26 -23
- package/domain/RecordLockingModel.js.map +1 -1
- 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.js +27 -24
- 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.js +7 -6
- package/features/GetLockRecord/feature.js.map +1 -1
- package/features/GetLockRecord/index.js +0 -2
- package/features/GetLockedEntryLockRecord/GetLockedEntryLockRecordUseCase.js +19 -28
- 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.js +6 -5
- package/features/GetLockedEntryLockRecord/feature.js.map +1 -1
- package/features/GetLockedEntryLockRecord/index.js +0 -2
- package/features/IsEntryLocked/IsEntryLockedUseCase.js +22 -28
- 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.js +6 -5
- package/features/IsEntryLocked/feature.js.map +1 -1
- package/features/IsEntryLocked/index.js +0 -2
- package/features/KickOutCurrentUser/KickOutCurrentUserUseCase.js +32 -32
- 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.js +6 -5
- package/features/KickOutCurrentUser/feature.js.map +1 -1
- package/features/KickOutCurrentUser/index.js +0 -2
- package/features/ListAllLockRecords/ListAllLockRecordsRepository.js +31 -31
- 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.js +7 -6
- package/features/ListAllLockRecords/feature.js.map +1 -1
- package/features/ListAllLockRecords/index.js +0 -2
- package/features/ListLockRecords/ListLockRecordsRepository.js +31 -31
- package/features/ListLockRecords/ListLockRecordsRepository.js.map +1 -1
- package/features/ListLockRecords/ListLockRecordsUseCase.js +26 -23
- 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.js +7 -6
- package/features/ListLockRecords/feature.js.map +1 -1
- package/features/ListLockRecords/index.js +0 -2
- package/features/LockEntry/LockEntryEventsDecorator.js +31 -31
- package/features/LockEntry/LockEntryEventsDecorator.js.map +1 -1
- package/features/LockEntry/LockEntryRepository.js +33 -30
- 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.js +25 -33
- package/features/LockEntry/events.js.map +1 -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.js +19 -21
- package/features/RecordLockingFeature.js.map +1 -1
- package/features/UnlockEntry/UnlockEntryEventsDecorator.js +32 -32
- package/features/UnlockEntry/UnlockEntryEventsDecorator.js.map +1 -1
- package/features/UnlockEntry/UnlockEntryRepository.js +29 -27
- package/features/UnlockEntry/UnlockEntryRepository.js.map +1 -1
- package/features/UnlockEntry/UnlockEntryUseCase.js +53 -69
- 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.js +25 -33
- package/features/UnlockEntry/events.js.map +1 -1
- package/features/UnlockEntry/feature.js +8 -7
- package/features/UnlockEntry/feature.js.map +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.js +31 -31
- package/features/UnlockEntryRequest/UnlockEntryRequestEventsDecorator.js.map +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js +31 -30
- package/features/UnlockEntryRequest/UnlockEntryRequestRepository.js.map +1 -1
- package/features/UnlockEntryRequest/UnlockEntryRequestUseCase.js +62 -79
- 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.js +25 -33
- package/features/UnlockEntryRequest/events.js.map +1 -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.js +45 -48
- package/features/UpdateEntryLock/UpdateEntryLockRepository.js.map +1 -1
- package/features/UpdateEntryLock/UpdateEntryLockUseCase.js +40 -51
- 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.js +7 -6
- package/features/UpdateEntryLock/feature.js.map +1 -1
- package/features/UpdateEntryLock/index.js +0 -2
- package/graphql/checkPermissions.js +5 -9
- package/graphql/checkPermissions.js.map +1 -1
- package/graphql/resolve.js +15 -17
- package/graphql/resolve.js.map +1 -1
- package/graphql/schema.js +147 -165
- package/graphql/schema.js.map +1 -1
- package/index.js +40 -49
- package/index.js.map +1 -1
- package/package.json +17 -17
- 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/domain/LockRecord.js
CHANGED
|
@@ -1,80 +1,73 @@
|
|
|
1
1
|
import { RecordLockingLockRecordActionType } from "./types.js";
|
|
2
2
|
import { removeLockRecordDatabasePrefix } from "../utils/lockRecordDatabaseId.js";
|
|
3
3
|
import { calculateExpiresOn } from "./calculateExpiresOn.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
get targetId() {
|
|
9
|
-
return this._targetId;
|
|
10
|
-
}
|
|
11
|
-
get type() {
|
|
12
|
-
return this._type;
|
|
13
|
-
}
|
|
14
|
-
get lockedBy() {
|
|
15
|
-
return this._lockedBy;
|
|
16
|
-
}
|
|
17
|
-
get lockedOn() {
|
|
18
|
-
return this._lockedOn;
|
|
19
|
-
}
|
|
20
|
-
get updatedOn() {
|
|
21
|
-
return this._updatedOn;
|
|
22
|
-
}
|
|
23
|
-
get expiresOn() {
|
|
24
|
-
return this._expiresOn;
|
|
25
|
-
}
|
|
26
|
-
get actions() {
|
|
27
|
-
return this._actions;
|
|
28
|
-
}
|
|
29
|
-
constructor(input, timeout) {
|
|
30
|
-
this._id = removeLockRecordDatabasePrefix(input.entryId);
|
|
31
|
-
this._targetId = input.values.targetId;
|
|
32
|
-
this._type = input.values.type;
|
|
33
|
-
this._lockedBy = input.createdBy;
|
|
34
|
-
this._lockedOn = new Date(input.createdOn);
|
|
35
|
-
this._updatedOn = new Date(input.savedOn);
|
|
36
|
-
this._expiresOn = calculateExpiresOn(input.savedOn, timeout);
|
|
37
|
-
this._actions = input.values.actions;
|
|
38
|
-
}
|
|
39
|
-
toObject() {
|
|
40
|
-
return {
|
|
41
|
-
id: this._id,
|
|
42
|
-
targetId: this._targetId,
|
|
43
|
-
type: this._type,
|
|
44
|
-
lockedBy: this._lockedBy,
|
|
45
|
-
lockedOn: this._lockedOn,
|
|
46
|
-
updatedOn: this._updatedOn,
|
|
47
|
-
expiresOn: this._expiresOn,
|
|
48
|
-
actions: this._actions
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
addAction(action) {
|
|
52
|
-
if (!this._actions) {
|
|
53
|
-
this._actions = [];
|
|
4
|
+
class LockRecord {
|
|
5
|
+
get id() {
|
|
6
|
+
return this._id;
|
|
54
7
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
getUnlockRequested() {
|
|
58
|
-
if (!this._actions?.length) {
|
|
59
|
-
return undefined;
|
|
8
|
+
get targetId() {
|
|
9
|
+
return this._targetId;
|
|
60
10
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
getUnlockApproved() {
|
|
64
|
-
if (!this._actions?.length) {
|
|
65
|
-
return undefined;
|
|
11
|
+
get type() {
|
|
12
|
+
return this._type;
|
|
66
13
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
14
|
+
get lockedBy() {
|
|
15
|
+
return this._lockedBy;
|
|
16
|
+
}
|
|
17
|
+
get lockedOn() {
|
|
18
|
+
return this._lockedOn;
|
|
19
|
+
}
|
|
20
|
+
get updatedOn() {
|
|
21
|
+
return this._updatedOn;
|
|
22
|
+
}
|
|
23
|
+
get expiresOn() {
|
|
24
|
+
return this._expiresOn;
|
|
25
|
+
}
|
|
26
|
+
get actions() {
|
|
27
|
+
return this._actions;
|
|
28
|
+
}
|
|
29
|
+
constructor(input, timeout){
|
|
30
|
+
this._id = removeLockRecordDatabasePrefix(input.entryId);
|
|
31
|
+
this._targetId = input.values.targetId;
|
|
32
|
+
this._type = input.values.type;
|
|
33
|
+
this._lockedBy = input.createdBy;
|
|
34
|
+
this._lockedOn = new Date(input.createdOn);
|
|
35
|
+
this._updatedOn = new Date(input.savedOn);
|
|
36
|
+
this._expiresOn = calculateExpiresOn(input.savedOn, timeout);
|
|
37
|
+
this._actions = input.values.actions;
|
|
38
|
+
}
|
|
39
|
+
toObject() {
|
|
40
|
+
return {
|
|
41
|
+
id: this._id,
|
|
42
|
+
targetId: this._targetId,
|
|
43
|
+
type: this._type,
|
|
44
|
+
lockedBy: this._lockedBy,
|
|
45
|
+
lockedOn: this._lockedOn,
|
|
46
|
+
updatedOn: this._updatedOn,
|
|
47
|
+
expiresOn: this._expiresOn,
|
|
48
|
+
actions: this._actions
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
addAction(action) {
|
|
52
|
+
if (!this._actions) this._actions = [];
|
|
53
|
+
this._actions.push(action);
|
|
54
|
+
}
|
|
55
|
+
getUnlockRequested() {
|
|
56
|
+
if (!this._actions?.length) return;
|
|
57
|
+
return this._actions.find((action)=>action.type === RecordLockingLockRecordActionType.requested);
|
|
58
|
+
}
|
|
59
|
+
getUnlockApproved() {
|
|
60
|
+
if (!this._actions?.length) return;
|
|
61
|
+
return this._actions.find((action)=>action.type === RecordLockingLockRecordActionType.approved);
|
|
62
|
+
}
|
|
63
|
+
getUnlockDenied() {
|
|
64
|
+
if (!this._actions?.length) return;
|
|
65
|
+
return this._actions.find((action)=>action.type === RecordLockingLockRecordActionType.denied);
|
|
66
|
+
}
|
|
67
|
+
isExpired() {
|
|
68
|
+
return this._expiresOn.getTime() < new Date().getTime();
|
|
72
69
|
}
|
|
73
|
-
return this._actions.find(action => action.type === RecordLockingLockRecordActionType.denied);
|
|
74
|
-
}
|
|
75
|
-
isExpired() {
|
|
76
|
-
return this._expiresOn.getTime() < new Date().getTime();
|
|
77
|
-
}
|
|
78
70
|
}
|
|
71
|
+
export { LockRecord };
|
|
79
72
|
|
|
80
73
|
//# sourceMappingURL=LockRecord.js.map
|
package/domain/LockRecord.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/LockRecord.js","sources":["../../src/domain/LockRecord.ts"],"sourcesContent":["import type { CmsEntry } from \"@webiny/api-headless-cms/types\";\nimport type { CmsIdentity } from \"@webiny/api-headless-cms/types\";\nimport { RecordLockingLockRecordActionType } from \"./types.js\";\nimport type {\n LockRecordAction,\n LockRecordApprovedAction,\n LockRecordDeniedAction,\n LockRecordEntryType,\n LockRecordObject,\n LockRecordRequestedAction,\n LockRecordValues\n} from \"./types.js\";\nimport { removeLockRecordDatabasePrefix } from \"~/utils/lockRecordDatabaseId.js\";\nimport { calculateExpiresOn } from \"./calculateExpiresOn.js\";\n\nexport interface ILockRecord {\n readonly id: string;\n readonly targetId: string;\n readonly type: LockRecordEntryType;\n readonly lockedBy: CmsIdentity;\n readonly lockedOn: Date;\n readonly updatedOn: Date;\n readonly expiresOn: Date;\n readonly actions?: LockRecordAction[];\n\n toObject(): LockRecordObject;\n addAction(action: LockRecordAction): void;\n getUnlockRequested(): LockRecordRequestedAction | undefined;\n getUnlockApproved(): LockRecordApprovedAction | undefined;\n getUnlockDenied(): LockRecordDeniedAction | undefined;\n isExpired(): boolean;\n}\n\nexport type LockRecordParams = Pick<\n CmsEntry<LockRecordValues>,\n \"entryId\" | \"values\" | \"createdBy\" | \"createdOn\" | \"savedOn\"\n>;\n\nexport class LockRecord implements ILockRecord {\n private readonly _id: string;\n private readonly _targetId: string;\n private readonly _type: LockRecordEntryType;\n private readonly _lockedBy: CmsIdentity;\n private readonly _lockedOn: Date;\n private readonly _updatedOn: Date;\n private readonly _expiresOn: Date;\n private _actions?: LockRecordAction[];\n\n public get id(): string {\n return this._id;\n }\n\n public get targetId(): string {\n return this._targetId;\n }\n\n public get type(): LockRecordEntryType {\n return this._type;\n }\n\n public get lockedBy(): CmsIdentity {\n return this._lockedBy;\n }\n\n public get lockedOn(): Date {\n return this._lockedOn;\n }\n\n public get updatedOn(): Date {\n return this._updatedOn;\n }\n\n public get expiresOn(): Date {\n return this._expiresOn;\n }\n\n public get actions(): LockRecordAction[] | undefined {\n return this._actions;\n }\n\n public constructor(input: LockRecordParams, timeout: number) {\n this._id = removeLockRecordDatabasePrefix(input.entryId);\n this._targetId = input.values.targetId;\n this._type = input.values.type;\n this._lockedBy = input.createdBy;\n this._lockedOn = new Date(input.createdOn);\n this._updatedOn = new Date(input.savedOn);\n this._expiresOn = calculateExpiresOn(input.savedOn, timeout);\n this._actions = input.values.actions;\n }\n\n public toObject(): LockRecordObject {\n return {\n id: this._id,\n targetId: this._targetId,\n type: this._type,\n lockedBy: this._lockedBy,\n lockedOn: this._lockedOn,\n updatedOn: this._updatedOn,\n expiresOn: this._expiresOn,\n actions: this._actions\n };\n }\n\n public addAction(action: LockRecordAction): void {\n if (!this._actions) {\n this._actions = [];\n }\n this._actions.push(action);\n }\n\n public getUnlockRequested(): LockRecordRequestedAction | undefined {\n if (!this._actions?.length) {\n return undefined;\n }\n return this._actions.find(\n (action): action is LockRecordRequestedAction =>\n action.type === RecordLockingLockRecordActionType.requested\n );\n }\n\n public getUnlockApproved(): LockRecordApprovedAction | undefined {\n if (!this._actions?.length) {\n return undefined;\n }\n return this._actions.find(\n (action): action is LockRecordApprovedAction =>\n action.type === RecordLockingLockRecordActionType.approved\n );\n }\n\n public getUnlockDenied(): LockRecordDeniedAction | undefined {\n if (!this._actions?.length) {\n return undefined;\n }\n return this._actions.find(\n (action): action is LockRecordDeniedAction =>\n action.type === RecordLockingLockRecordActionType.denied\n );\n }\n\n public isExpired(): boolean {\n return this._expiresOn.getTime() < new Date().getTime();\n }\n}\n"],"names":["LockRecord","input","timeout","removeLockRecordDatabasePrefix","Date","calculateExpiresOn","action","RecordLockingLockRecordActionType"],"mappings":";;;AAsCO,MAAMA;IAUT,IAAW,KAAa;QACpB,OAAO,IAAI,CAAC,GAAG;IACnB;IAEA,IAAW,WAAmB;QAC1B,OAAO,IAAI,CAAC,SAAS;IACzB;IAEA,IAAW,OAA4B;QACnC,OAAO,IAAI,CAAC,KAAK;IACrB;IAEA,IAAW,WAAwB;QAC/B,OAAO,IAAI,CAAC,SAAS;IACzB;IAEA,IAAW,WAAiB;QACxB,OAAO,IAAI,CAAC,SAAS;IACzB;IAEA,IAAW,YAAkB;QACzB,OAAO,IAAI,CAAC,UAAU;IAC1B;IAEA,IAAW,YAAkB;QACzB,OAAO,IAAI,CAAC,UAAU;IAC1B;IAEA,IAAW,UAA0C;QACjD,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,YAAmBC,KAAuB,EAAEC,OAAe,CAAE;QACzD,IAAI,CAAC,GAAG,GAAGC,+BAA+BF,MAAM,OAAO;QACvD,IAAI,CAAC,SAAS,GAAGA,MAAM,MAAM,CAAC,QAAQ;QACtC,IAAI,CAAC,KAAK,GAAGA,MAAM,MAAM,CAAC,IAAI;QAC9B,IAAI,CAAC,SAAS,GAAGA,MAAM,SAAS;QAChC,IAAI,CAAC,SAAS,GAAG,IAAIG,KAAKH,MAAM,SAAS;QACzC,IAAI,CAAC,UAAU,GAAG,IAAIG,KAAKH,MAAM,OAAO;QACxC,IAAI,CAAC,UAAU,GAAGI,mBAAmBJ,MAAM,OAAO,EAAEC;QACpD,IAAI,CAAC,QAAQ,GAAGD,MAAM,MAAM,CAAC,OAAO;IACxC;IAEO,WAA6B;QAChC,OAAO;YACH,IAAI,IAAI,CAAC,GAAG;YACZ,UAAU,IAAI,CAAC,SAAS;YACxB,MAAM,IAAI,CAAC,KAAK;YAChB,UAAU,IAAI,CAAC,SAAS;YACxB,UAAU,IAAI,CAAC,SAAS;YACxB,WAAW,IAAI,CAAC,UAAU;YAC1B,WAAW,IAAI,CAAC,UAAU;YAC1B,SAAS,IAAI,CAAC,QAAQ;QAC1B;IACJ;IAEO,UAAUK,MAAwB,EAAQ;QAC7C,IAAI,CAAC,IAAI,CAAC,QAAQ,EACd,IAAI,CAAC,QAAQ,GAAG,EAAE;QAEtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAACA;IACvB;IAEO,qBAA4D;QAC/D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAChB;QAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CACrB,CAACA,SACGA,OAAO,IAAI,KAAKC,kCAAkC,SAAS;IAEvE;IAEO,oBAA0D;QAC7D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAChB;QAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CACrB,CAACD,SACGA,OAAO,IAAI,KAAKC,kCAAkC,QAAQ;IAEtE;IAEO,kBAAsD;QACzD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAChB;QAEJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CACrB,CAACD,SACGA,OAAO,IAAI,KAAKC,kCAAkC,MAAM;IAEpE;IAEO,YAAqB;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,IAAIH,OAAO,OAAO;IACzD;AACJ"}
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import { ModelFactory } from "@webiny/api-headless-cms/features/modelBuilder/index.js";
|
|
2
|
-
|
|
2
|
+
const RECORD_LOCKING_MODEL_ID = "wbyRecordLock";
|
|
3
3
|
class RecordLockingPrivateModelImpl {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
async execute(builder) {
|
|
5
|
+
return [
|
|
6
|
+
builder.private({
|
|
7
|
+
modelId: RECORD_LOCKING_MODEL_ID,
|
|
8
|
+
name: "Record Lock Tracking"
|
|
9
|
+
}).fields((fields)=>({
|
|
10
|
+
targetId: fields.text().label("Target ID").required("Target ID is required."),
|
|
11
|
+
type: fields.text().label("Record Type").required("Record type is required."),
|
|
12
|
+
actions: fields.object().label("Actions").list().fields((fields)=>({
|
|
13
|
+
type: fields.text().label("Action Type").required("Action type is required."),
|
|
14
|
+
message: fields.text().label("Message"),
|
|
15
|
+
createdBy: fields.object().label("Created By").required("Created by is required.").fields((fields)=>({
|
|
16
|
+
id: fields.text().label("ID").required("ID is required."),
|
|
17
|
+
displayName: fields.text().label("Display Name").required("Display name is required."),
|
|
18
|
+
type: fields.text().label("Type").required("Type is required.")
|
|
19
|
+
})),
|
|
20
|
+
createdOn: fields.datetime().label("Created On").required("Created on is required.").withoutTimezone()
|
|
21
|
+
}))
|
|
22
|
+
}))
|
|
23
|
+
];
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
const RecordLockingModel = ModelFactory.createImplementation({
|
|
27
|
+
implementation: RecordLockingPrivateModelImpl,
|
|
28
|
+
dependencies: []
|
|
27
29
|
});
|
|
30
|
+
export { RECORD_LOCKING_MODEL_ID, RecordLockingModel };
|
|
28
31
|
|
|
29
32
|
//# sourceMappingURL=RecordLockingModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/RecordLockingModel.js","sources":["../../src/domain/RecordLockingModel.ts"],"sourcesContent":["import { ModelFactory } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nexport const RECORD_LOCKING_MODEL_ID = \"wbyRecordLock\";\n\nclass RecordLockingPrivateModelImpl implements ModelFactory.Interface {\n public async execute(builder: ModelFactory.Builder) {\n return [\n builder\n .private({\n modelId: RECORD_LOCKING_MODEL_ID,\n name: \"Record Lock Tracking\"\n })\n .fields(fields => ({\n targetId: fields.text().label(\"Target ID\").required(\"Target ID is required.\"),\n type: fields.text().label(\"Record Type\").required(\"Record type is required.\"),\n actions: fields\n .object()\n .label(\"Actions\")\n .list()\n .fields(fields => ({\n type: fields\n .text()\n .label(\"Action Type\")\n .required(\"Action type is required.\"),\n message: fields.text().label(\"Message\"),\n createdBy: fields\n .object()\n .label(\"Created By\")\n .required(\"Created by is required.\")\n .fields(fields => ({\n id: fields.text().label(\"ID\").required(\"ID is required.\"),\n displayName: fields\n .text()\n .label(\"Display Name\")\n .required(\"Display name is required.\"),\n type: fields.text().label(\"Type\").required(\"Type is required.\")\n })),\n createdOn: fields\n .datetime()\n .label(\"Created On\")\n .required(\"Created on is required.\")\n .withoutTimezone()\n }))\n }))\n ];\n }\n}\n\nexport const RecordLockingModel = ModelFactory.createImplementation({\n implementation: RecordLockingPrivateModelImpl,\n dependencies: []\n});\n"],"names":["RECORD_LOCKING_MODEL_ID","RecordLockingPrivateModelImpl","builder","fields","RecordLockingModel","ModelFactory"],"mappings":";AAEO,MAAMA,0BAA0B;AAEvC,MAAMC;IACF,MAAa,QAAQC,OAA6B,EAAE;QAChD,OAAO;YACHA,QACK,OAAO,CAAC;gBACL,SAASF;gBACT,MAAM;YACV,GACC,MAAM,CAACG,CAAAA,SAAW;oBACf,UAAUA,OAAO,IAAI,GAAG,KAAK,CAAC,aAAa,QAAQ,CAAC;oBACpD,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,eAAe,QAAQ,CAAC;oBAClD,SAASA,OACJ,MAAM,GACN,KAAK,CAAC,WACN,IAAI,GACJ,MAAM,CAACA,CAAAA,SAAW;4BACf,MAAMA,OACD,IAAI,GACJ,KAAK,CAAC,eACN,QAAQ,CAAC;4BACd,SAASA,OAAO,IAAI,GAAG,KAAK,CAAC;4BAC7B,WAAWA,OACN,MAAM,GACN,KAAK,CAAC,cACN,QAAQ,CAAC,2BACT,MAAM,CAACA,CAAAA,SAAW;oCACf,IAAIA,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC;oCACvC,aAAaA,OACR,IAAI,GACJ,KAAK,CAAC,gBACN,QAAQ,CAAC;oCACd,MAAMA,OAAO,IAAI,GAAG,KAAK,CAAC,QAAQ,QAAQ,CAAC;gCAC/C;4BACJ,WAAWA,OACN,QAAQ,GACR,KAAK,CAAC,cACN,QAAQ,CAAC,2BACT,eAAe;wBACxB;gBACR;SACP;IACL;AACJ;AAEO,MAAMC,qBAAqBC,aAAa,oBAAoB,CAAC;IAChE,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
package/domain/abstractions.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const RecordLockingConfig = createAbstraction("RecordLockingConfig");
|
|
8
|
-
export const RecordLockingModel = createAbstraction("RecordLockingModel");
|
|
2
|
+
const RecordLockingConfig = createAbstraction("RecordLockingConfig");
|
|
3
|
+
const RecordLockingModel = createAbstraction("RecordLockingModel");
|
|
4
|
+
export { RecordLockingConfig, RecordLockingModel };
|
|
9
5
|
|
|
10
6
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/abstractions.js","sources":["../../src/domain/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\n/**\n * RecordLockingConfig - Configuration for record locking timeout\n */\nexport interface IRecordLockingConfig {\n /**\n * Timeout in milliseconds after which a lock expires\n */\n timeout: number;\n}\n\nexport const RecordLockingConfig = createAbstraction<IRecordLockingConfig>(\"RecordLockingConfig\");\n\nexport namespace RecordLockingConfig {\n export type Interface = IRecordLockingConfig;\n}\n\nexport const RecordLockingModel = createAbstraction<CmsModel>(\"RecordLockingModel\");\n\nexport namespace RecordLockingModel {\n export type Interface = CmsModel;\n}\n"],"names":["RecordLockingConfig","createAbstraction","RecordLockingModel"],"mappings":";AAaO,MAAMA,sBAAsBC,kBAAwC;AAMpE,MAAMC,qBAAqBD,kBAA4B"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const savedOnDate = new Date(savedOn);
|
|
6
|
-
return new Date(savedOnDate.getTime() + timeout);
|
|
1
|
+
const calculateExpiresOn = (savedOn, timeout)=>{
|
|
2
|
+
if (!savedOn) throw new Error("Missing savedOn property.");
|
|
3
|
+
const savedOnDate = new Date(savedOn);
|
|
4
|
+
return new Date(savedOnDate.getTime() + timeout);
|
|
7
5
|
};
|
|
6
|
+
export { calculateExpiresOn };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=calculateExpiresOn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/calculateExpiresOn.js","sources":["../../src/domain/calculateExpiresOn.ts"],"sourcesContent":["export const calculateExpiresOn = (savedOn: string | undefined, timeout: number): Date => {\n if (!savedOn) {\n throw new Error(\"Missing savedOn property.\");\n }\n const savedOnDate = new Date(savedOn);\n\n return new Date(savedOnDate.getTime() + timeout);\n};\n"],"names":["calculateExpiresOn","savedOn","timeout","Error","savedOnDate","Date"],"mappings":"AAAO,MAAMA,qBAAqB,CAACC,SAA6BC;IAC5D,IAAI,CAACD,SACD,MAAM,IAAIE,MAAM;IAEpB,MAAMC,cAAc,IAAIC,KAAKJ;IAE7B,OAAO,IAAII,KAAKD,YAAY,OAAO,KAAKF;AAC5C"}
|
package/domain/errors.js
CHANGED
|
@@ -1,95 +1,85 @@
|
|
|
1
1
|
import { BaseError } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
}
|
|
2
|
+
class EntryAlreadyLockedError extends BaseError {
|
|
3
|
+
constructor(data){
|
|
4
|
+
super({
|
|
5
|
+
message: "Entry is already locked for editing.",
|
|
6
|
+
data
|
|
7
|
+
}), this.code = "RecordLocking/Entry/AlreadyLockedError";
|
|
8
|
+
}
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
10
|
+
class LockRecordNotFoundError extends BaseError {
|
|
11
|
+
constructor(){
|
|
12
|
+
super({
|
|
13
|
+
message: "Lock record not found."
|
|
14
|
+
}), this.code = "RecordLocking/LockRecord/NotFoundError";
|
|
15
|
+
}
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
17
|
+
class LockRecordPersistenceError extends BaseError {
|
|
18
|
+
constructor(error){
|
|
19
|
+
super({
|
|
20
|
+
message: error.message
|
|
21
|
+
}), this.code = "RecordLocking/LockRecord/PersistenceError";
|
|
22
|
+
}
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}
|
|
24
|
+
class IdentityMismatchError extends BaseError {
|
|
25
|
+
constructor(data){
|
|
26
|
+
super({
|
|
27
|
+
message: "Identity mismatch - cannot perform action.",
|
|
28
|
+
data
|
|
29
|
+
}), this.code = "RecordLocking/Identity/MismatchError";
|
|
30
|
+
}
|
|
35
31
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
32
|
+
class UnlockEntryError extends BaseError {
|
|
33
|
+
constructor(error){
|
|
34
|
+
super({
|
|
35
|
+
message: `Could not unlock entry: ${error.message}`
|
|
36
|
+
}), this.code = "RecordLocking/Entry/UnlockError";
|
|
37
|
+
}
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
}
|
|
39
|
+
class LockEntryError extends BaseError {
|
|
40
|
+
constructor(error){
|
|
41
|
+
super({
|
|
42
|
+
message: `Could not lock entry: ${error.message}`
|
|
43
|
+
}), this.code = "RecordLocking/Entry/LockError";
|
|
44
|
+
}
|
|
51
45
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
46
|
+
class UpdateEntryLockError extends BaseError {
|
|
47
|
+
constructor(error){
|
|
48
|
+
super({
|
|
49
|
+
message: `Could not update entry lock: ${error.message}`
|
|
50
|
+
}), this.code = "RecordLocking/Entry/UpdateLockError";
|
|
51
|
+
}
|
|
59
52
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
53
|
+
class IdentityMissingError extends BaseError {
|
|
54
|
+
constructor(){
|
|
55
|
+
super({
|
|
56
|
+
message: "Identity is missing."
|
|
57
|
+
}), this.code = "RecordLocking/Identity/MissingError";
|
|
58
|
+
}
|
|
67
59
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
60
|
+
class EntryNotLockedError extends BaseError {
|
|
61
|
+
constructor(data){
|
|
62
|
+
super({
|
|
63
|
+
message: "Entry is not locked.",
|
|
64
|
+
data
|
|
65
|
+
}), this.code = "RecordLocking/Entry/NotLockedError";
|
|
66
|
+
}
|
|
76
67
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
}
|
|
68
|
+
class UnlockRequestAlreadySentError extends BaseError {
|
|
69
|
+
constructor(data){
|
|
70
|
+
super({
|
|
71
|
+
message: "Unlock request already sent.",
|
|
72
|
+
data
|
|
73
|
+
}), this.code = "RecordLocking/Entry/UnlockRequestAlreadySentError";
|
|
74
|
+
}
|
|
85
75
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
}
|
|
76
|
+
class UnlockEntryRequestError extends BaseError {
|
|
77
|
+
constructor(error){
|
|
78
|
+
super({
|
|
79
|
+
message: `Could not request unlock: ${error.message}`
|
|
80
|
+
}), this.code = "RecordLocking/Entry/UnlockRequestError";
|
|
81
|
+
}
|
|
93
82
|
}
|
|
83
|
+
export { EntryAlreadyLockedError, EntryNotLockedError, IdentityMismatchError, IdentityMissingError, LockEntryError, LockRecordNotFoundError, LockRecordPersistenceError, UnlockEntryError, UnlockEntryRequestError, UnlockRequestAlreadySentError, UpdateEntryLockError };
|
|
94
84
|
|
|
95
85
|
//# sourceMappingURL=errors.js.map
|
package/domain/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/errors.js","sources":["../../src/domain/errors.ts"],"sourcesContent":["import { BaseError } from \"@webiny/feature/api\";\n\nexport class EntryAlreadyLockedError extends BaseError<{ id: string; type: string }> {\n override readonly code = \"RecordLocking/Entry/AlreadyLockedError\" as const;\n\n constructor(data: { id: string; type: string }) {\n super({\n message: \"Entry is already locked for editing.\",\n data\n });\n }\n}\n\nexport class LockRecordNotFoundError extends BaseError {\n override readonly code = \"RecordLocking/LockRecord/NotFoundError\" as const;\n\n constructor() {\n super({\n message: \"Lock record not found.\"\n });\n }\n}\n\nexport class LockRecordPersistenceError extends BaseError {\n override readonly code = \"RecordLocking/LockRecord/PersistenceError\" as const;\n\n constructor(error: Error) {\n super({\n message: error.message\n });\n }\n}\n\nexport class IdentityMismatchError extends BaseError<{ currentId: string; targetId: string }> {\n override readonly code = \"RecordLocking/Identity/MismatchError\" as const;\n\n constructor(data: { currentId: string; targetId: string }) {\n super({\n message: \"Identity mismatch - cannot perform action.\",\n data\n });\n }\n}\n\nexport class UnlockEntryError extends BaseError {\n override readonly code = \"RecordLocking/Entry/UnlockError\" as const;\n\n constructor(error: Error) {\n super({\n message: `Could not unlock entry: ${error.message}`\n });\n }\n}\n\nexport class LockEntryError extends BaseError {\n override readonly code = \"RecordLocking/Entry/LockError\" as const;\n\n constructor(error: Error) {\n super({\n message: `Could not lock entry: ${error.message}`\n });\n }\n}\n\nexport class UpdateEntryLockError extends BaseError {\n override readonly code = \"RecordLocking/Entry/UpdateLockError\" as const;\n\n constructor(error: Error) {\n super({\n message: `Could not update entry lock: ${error.message}`\n });\n }\n}\n\nexport class IdentityMissingError extends BaseError {\n override readonly code = \"RecordLocking/Identity/MissingError\" as const;\n\n constructor() {\n super({\n message: \"Identity is missing.\"\n });\n }\n}\n\nexport class EntryNotLockedError extends BaseError<{ id: string; type: string }> {\n override readonly code = \"RecordLocking/Entry/NotLockedError\" as const;\n\n constructor(data: { id: string; type: string }) {\n super({\n message: \"Entry is not locked.\",\n data\n });\n }\n}\n\nexport class UnlockRequestAlreadySentError extends BaseError<{\n id: string;\n type: string;\n identityId: string;\n}> {\n override readonly code = \"RecordLocking/Entry/UnlockRequestAlreadySentError\" as const;\n\n constructor(data: { id: string; type: string; identityId: string }) {\n super({\n message: \"Unlock request already sent.\",\n data\n });\n }\n}\n\nexport class UnlockEntryRequestError extends BaseError {\n override readonly code = \"RecordLocking/Entry/UnlockRequestError\" as const;\n\n constructor(error: Error) {\n super({\n message: `Could not request unlock: ${error.message}`\n });\n }\n}\n"],"names":["EntryAlreadyLockedError","BaseError","data","LockRecordNotFoundError","LockRecordPersistenceError","error","IdentityMismatchError","UnlockEntryError","LockEntryError","UpdateEntryLockError","IdentityMissingError","EntryNotLockedError","UnlockRequestAlreadySentError","UnlockEntryRequestError"],"mappings":";AAEO,MAAMA,gCAAgCC;IAGzC,YAAYC,IAAkC,CAAE;QAC5C,KAAK,CAAC;YACF,SAAS;YACTA;QACJ,SANc,IAAI,GAAG;IAOzB;AACJ;AAEO,MAAMC,gCAAgCF;IAGzC,aAAc;QACV,KAAK,CAAC;YACF,SAAS;QACb,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMG,mCAAmCH;IAG5C,YAAYI,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAASA,MAAM,OAAO;QAC1B,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMC,8BAA8BL;IAGvC,YAAYC,IAA6C,CAAE;QACvD,KAAK,CAAC;YACF,SAAS;YACTA;QACJ,SANc,IAAI,GAAG;IAOzB;AACJ;AAEO,MAAMK,yBAAyBN;IAGlC,YAAYI,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,wBAAwB,EAAEA,MAAM,OAAO,EAAE;QACvD,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMG,uBAAuBP;IAGhC,YAAYI,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,sBAAsB,EAAEA,MAAM,OAAO,EAAE;QACrD,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMI,6BAA6BR;IAGtC,YAAYI,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,6BAA6B,EAAEA,MAAM,OAAO,EAAE;QAC5D,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMK,6BAA6BT;IAGtC,aAAc;QACV,KAAK,CAAC;YACF,SAAS;QACb,SALc,IAAI,GAAG;IAMzB;AACJ;AAEO,MAAMU,4BAA4BV;IAGrC,YAAYC,IAAkC,CAAE;QAC5C,KAAK,CAAC;YACF,SAAS;YACTA;QACJ,SANc,IAAI,GAAG;IAOzB;AACJ;AAEO,MAAMU,sCAAsCX;IAO/C,YAAYC,IAAsD,CAAE;QAChE,KAAK,CAAC;YACF,SAAS;YACTA;QACJ,SANc,IAAI,GAAG;IAOzB;AACJ;AAEO,MAAMW,gCAAgCZ;IAGzC,YAAYI,KAAY,CAAE;QACtB,KAAK,CAAC;YACF,SAAS,CAAC,0BAA0B,EAAEA,MAAM,OAAO,EAAE;QACzD,SALc,IAAI,GAAG;IAMzB;AACJ"}
|
package/domain/index.js
CHANGED
package/domain/types.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RecordLockingLockRecordActionType["requested"] = "requested";
|
|
7
|
-
RecordLockingLockRecordActionType["approved"] = "approved";
|
|
8
|
-
RecordLockingLockRecordActionType["denied"] = "denied";
|
|
9
|
-
return RecordLockingLockRecordActionType;
|
|
1
|
+
var types_RecordLockingLockRecordActionType = /*#__PURE__*/ function(RecordLockingLockRecordActionType) {
|
|
2
|
+
RecordLockingLockRecordActionType["requested"] = "requested";
|
|
3
|
+
RecordLockingLockRecordActionType["approved"] = "approved";
|
|
4
|
+
RecordLockingLockRecordActionType["denied"] = "denied";
|
|
5
|
+
return RecordLockingLockRecordActionType;
|
|
10
6
|
}({});
|
|
7
|
+
export { types_RecordLockingLockRecordActionType as RecordLockingLockRecordActionType };
|
|
11
8
|
|
|
12
9
|
//# sourceMappingURL=types.js.map
|
package/domain/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"domain/types.js","sources":["../../src/domain/types.ts"],"sourcesContent":["import type { CmsIdentity } from \"@webiny/api-headless-cms/types\";\n\n/**\n * Do not use any special chars other than #, as we use this to create lock record IDs.\n */\nexport type LockRecordEntryType = string;\n\nexport enum RecordLockingLockRecordActionType {\n requested = \"requested\",\n approved = \"approved\",\n denied = \"denied\"\n}\n\nexport interface LockRecordRequestedAction {\n type: RecordLockingLockRecordActionType.requested;\n message?: string;\n createdOn: Date;\n createdBy: CmsIdentity;\n}\n\nexport interface LockRecordApprovedAction {\n type: RecordLockingLockRecordActionType.approved;\n message?: string;\n createdOn: Date;\n createdBy: CmsIdentity;\n}\n\nexport interface LockRecordDeniedAction {\n type: RecordLockingLockRecordActionType.denied;\n message?: string;\n createdOn: Date;\n createdBy: CmsIdentity;\n}\n\nexport type LockRecordAction =\n | LockRecordRequestedAction\n | LockRecordApprovedAction\n | LockRecordDeniedAction;\n\nexport interface LockRecordValues {\n targetId: string;\n type: LockRecordEntryType;\n actions?: LockRecordAction[];\n}\n\nexport interface LockRecordObject {\n id: string;\n targetId: string;\n type: LockRecordEntryType;\n lockedBy: CmsIdentity;\n lockedOn: Date;\n updatedOn: Date;\n expiresOn: Date;\n actions?: LockRecordAction[];\n}\n"],"names":["RecordLockingLockRecordActionType"],"mappings":"AAOO,IAAKA,0CAAiCA,WAAAA,GAAAA,SAAjCA,iCAAiC;;;;WAAjCA"}
|