@webiny/app-record-locking 6.0.0-beta.0 → 6.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +8 -9
  2. package/components/HeadlessCmsActionsAcoCell.js +46 -57
  3. package/components/HeadlessCmsActionsAcoCell.js.map +1 -1
  4. package/components/HeadlessCmsContentEntry/ContentEntryGuard.d.ts +4 -0
  5. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js +24 -70
  6. package/components/HeadlessCmsContentEntry/ContentEntryGuard.js.map +1 -1
  7. package/components/HeadlessCmsContentEntry/ContentEntryLocker.d.ts +7 -3
  8. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js +82 -84
  9. package/components/HeadlessCmsContentEntry/ContentEntryLocker.js.map +1 -1
  10. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js +66 -40
  11. package/components/HeadlessCmsContentEntry/HeadlessCmsContentEntry.js.map +1 -1
  12. package/components/HeadlessCmsContentEntry/index.d.ts +1 -1
  13. package/components/HeadlessCmsContentEntry/index.js +1 -16
  14. package/components/HeadlessCmsContentEntry/index.js.map +1 -1
  15. package/components/LockedRecord/LockedRecord.d.ts +1 -1
  16. package/components/LockedRecord/LockedRecord.js +51 -146
  17. package/components/LockedRecord/LockedRecord.js.map +1 -1
  18. package/components/LockedRecord/LockedRecordForceUnlock.d.ts +1 -1
  19. package/components/LockedRecord/LockedRecordForceUnlock.js +49 -95
  20. package/components/LockedRecord/LockedRecordForceUnlock.js.map +1 -1
  21. package/components/LockedRecord/index.d.ts +1 -1
  22. package/components/LockedRecord/index.js +1 -16
  23. package/components/LockedRecord/index.js.map +1 -1
  24. package/components/RecordLockingProvider.d.ts +1 -1
  25. package/components/RecordLockingProvider.js +63 -68
  26. package/components/RecordLockingProvider.js.map +1 -1
  27. package/components/SecurityPermissions.d.ts +2 -0
  28. package/components/SecurityPermissions.js +23 -0
  29. package/components/SecurityPermissions.js.map +1 -0
  30. package/components/decorators/UseContentEntriesListHookDecorator.d.ts +1 -2
  31. package/components/decorators/UseContentEntriesListHookDecorator.js +13 -18
  32. package/components/decorators/UseContentEntriesListHookDecorator.js.map +1 -1
  33. package/components/decorators/UseRecordsDecorator.d.ts +1 -2
  34. package/components/decorators/UseRecordsDecorator.js +11 -16
  35. package/components/decorators/UseRecordsDecorator.js.map +1 -1
  36. package/components/decorators/UseSaveEntryDecorator.d.ts +1 -2
  37. package/components/decorators/UseSaveEntryDecorator.js +34 -34
  38. package/components/decorators/UseSaveEntryDecorator.js.map +1 -1
  39. package/domain/RecordLocking.d.ts +10 -14
  40. package/domain/RecordLocking.js +272 -330
  41. package/domain/RecordLocking.js.map +1 -1
  42. package/domain/RecordLockingClient.d.ts +3 -3
  43. package/domain/RecordLockingClient.js +15 -29
  44. package/domain/RecordLockingClient.js.map +1 -1
  45. package/domain/RecordLockingGetLockRecord.d.ts +2 -2
  46. package/domain/RecordLockingGetLockRecord.js +16 -29
  47. package/domain/RecordLockingGetLockRecord.js.map +1 -1
  48. package/domain/RecordLockingGetLockedEntryLockRecord.d.ts +2 -2
  49. package/domain/RecordLockingGetLockedEntryLockRecord.js +14 -27
  50. package/domain/RecordLockingGetLockedEntryLockRecord.js.map +1 -1
  51. package/domain/RecordLockingIsEntryLocked.d.ts +2 -2
  52. package/domain/RecordLockingIsEntryLocked.js +14 -27
  53. package/domain/RecordLockingIsEntryLocked.js.map +1 -1
  54. package/domain/RecordLockingListLockRecords.d.ts +3 -3
  55. package/domain/RecordLockingListLockRecords.js +26 -37
  56. package/domain/RecordLockingListLockRecords.js.map +1 -1
  57. package/domain/RecordLockingLockEntry.d.ts +2 -2
  58. package/domain/RecordLockingLockEntry.js +9 -24
  59. package/domain/RecordLockingLockEntry.js.map +1 -1
  60. package/domain/RecordLockingUnlockEntry.d.ts +2 -2
  61. package/domain/RecordLockingUnlockEntry.js +14 -27
  62. package/domain/RecordLockingUnlockEntry.js.map +1 -1
  63. package/domain/RecordLockingUpdateEntryLock.d.ts +2 -2
  64. package/domain/RecordLockingUpdateEntryLock.js +14 -27
  65. package/domain/RecordLockingUpdateEntryLock.js.map +1 -1
  66. package/domain/abstractions/IRecordLocking.d.ts +8 -2
  67. package/domain/abstractions/IRecordLocking.js +1 -5
  68. package/domain/abstractions/IRecordLocking.js.map +1 -1
  69. package/domain/abstractions/IRecordLockingClient.d.ts +2 -2
  70. package/domain/abstractions/IRecordLockingClient.js +1 -5
  71. package/domain/abstractions/IRecordLockingClient.js.map +1 -1
  72. package/domain/abstractions/IRecordLockingGetLockRecord.d.ts +1 -1
  73. package/domain/abstractions/IRecordLockingGetLockRecord.js +1 -5
  74. package/domain/abstractions/IRecordLockingGetLockRecord.js.map +1 -1
  75. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.d.ts +1 -1
  76. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js +1 -5
  77. package/domain/abstractions/IRecordLockingGetLockedEntryLockRecord.js.map +1 -1
  78. package/domain/abstractions/IRecordLockingIsEntryLocked.d.ts +1 -1
  79. package/domain/abstractions/IRecordLockingIsEntryLocked.js +1 -5
  80. package/domain/abstractions/IRecordLockingListLockRecords.d.ts +1 -1
  81. package/domain/abstractions/IRecordLockingListLockRecords.js +1 -5
  82. package/domain/abstractions/IRecordLockingListLockRecords.js.map +1 -1
  83. package/domain/abstractions/IRecordLockingLockEntry.d.ts +1 -1
  84. package/domain/abstractions/IRecordLockingLockEntry.js +1 -5
  85. package/domain/abstractions/IRecordLockingLockEntry.js.map +1 -1
  86. package/domain/abstractions/IRecordLockingUnlockEntry.d.ts +1 -1
  87. package/domain/abstractions/IRecordLockingUnlockEntry.js +1 -5
  88. package/domain/abstractions/IRecordLockingUnlockEntry.js.map +1 -1
  89. package/domain/abstractions/IRecordLockingUpdateEntryLock.d.ts +1 -1
  90. package/domain/abstractions/IRecordLockingUpdateEntryLock.js +1 -5
  91. package/domain/abstractions/IRecordLockingUpdateEntryLock.js.map +1 -1
  92. package/domain/graphql/fields.js +28 -8
  93. package/domain/graphql/fields.js.map +1 -1
  94. package/domain/graphql/getLockRecord.d.ts +3 -3
  95. package/domain/graphql/getLockRecord.js +16 -12
  96. package/domain/graphql/getLockRecord.js.map +1 -1
  97. package/domain/graphql/getLockedEntryLockRecord.d.ts +3 -3
  98. package/domain/graphql/getLockedEntryLockRecord.js +16 -12
  99. package/domain/graphql/getLockedEntryLockRecord.js.map +1 -1
  100. package/domain/graphql/isEntryLocked.d.ts +3 -3
  101. package/domain/graphql/isEntryLocked.js +14 -12
  102. package/domain/graphql/isEntryLocked.js.map +1 -1
  103. package/domain/graphql/listLockRecords.d.ts +3 -3
  104. package/domain/graphql/listLockRecords.js +23 -14
  105. package/domain/graphql/listLockRecords.js.map +1 -1
  106. package/domain/graphql/lockEntry.d.ts +3 -3
  107. package/domain/graphql/lockEntry.js +17 -13
  108. package/domain/graphql/lockEntry.js.map +1 -1
  109. package/domain/graphql/unlockEntry.d.ts +3 -3
  110. package/domain/graphql/unlockEntry.js +16 -12
  111. package/domain/graphql/unlockEntry.js.map +1 -1
  112. package/domain/graphql/updateEntryLock.d.ts +3 -3
  113. package/domain/graphql/updateEntryLock.js +16 -12
  114. package/domain/graphql/updateEntryLock.js.map +1 -1
  115. package/domain/utils/createRecordLockingClient.d.ts +1 -1
  116. package/domain/utils/createRecordLockingClient.js +6 -12
  117. package/domain/utils/createRecordLockingClient.js.map +1 -1
  118. package/domain/utils/createRecordLockingError.d.ts +1 -1
  119. package/domain/utils/createRecordLockingError.js +1 -7
  120. package/domain/utils/createRecordLockingError.js.map +1 -1
  121. package/hooks/index.d.ts +2 -2
  122. package/hooks/index.js +2 -27
  123. package/hooks/index.js.map +1 -1
  124. package/hooks/usePermission.d.ts +1 -1
  125. package/hooks/usePermission.js +14 -15
  126. package/hooks/usePermission.js.map +1 -1
  127. package/hooks/useRecordLocking.d.ts +1 -1
  128. package/hooks/useRecordLocking.js +6 -12
  129. package/hooks/useRecordLocking.js.map +1 -1
  130. package/index.d.ts +2 -2
  131. package/index.js +19 -49
  132. package/index.js.map +1 -1
  133. package/package.json +16 -31
  134. package/types.d.ts +32 -12
  135. package/types.js +1 -5
  136. package/types.js.map +1 -1
  137. package/utils/createCacheKey.d.ts +2 -2
  138. package/utils/createCacheKey.js +5 -11
  139. package/utils/createCacheKey.js.map +1 -1
  140. package/components/assets/lock.svg +0 -13
  141. package/domain/RecordLockingUnlockEntryRequest.d.ts +0 -11
  142. package/domain/RecordLockingUnlockEntryRequest.js +0 -28
  143. package/domain/RecordLockingUnlockEntryRequest.js.map +0 -1
  144. package/domain/abstractions/IRecordLockingUnlockEntryRequest.d.ts +0 -12
  145. package/domain/abstractions/IRecordLockingUnlockEntryRequest.js +0 -7
  146. package/domain/abstractions/IRecordLockingUnlockEntryRequest.js.map +0 -1
  147. package/domain/graphql/unlockEntryRequest.d.ts +0 -12
  148. package/domain/graphql/unlockEntryRequest.js +0 -16
  149. package/domain/graphql/unlockEntryRequest.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@webiny/app-record-locking",
3
- "version": "6.0.0-beta.0",
3
+ "version": "6.0.0-rc.1",
4
+ "type": "module",
4
5
  "main": "index.js",
5
6
  "repository": {
6
7
  "type": "git",
@@ -14,46 +15,30 @@
14
15
  "license": "MIT",
15
16
  "dependencies": {
16
17
  "@apollo/react-hooks": "3.1.5",
17
- "@emotion/styled": "11.10.6",
18
- "@material-design-icons/svg": "0.14.13",
19
- "@webiny/app": "6.0.0-beta.0",
20
- "@webiny/app-aco": "6.0.0-beta.0",
21
- "@webiny/app-admin": "6.0.0-beta.0",
22
- "@webiny/app-headless-cms": "6.0.0-beta.0",
23
- "@webiny/app-security": "6.0.0-beta.0",
24
- "@webiny/app-wcp": "6.0.0-beta.0",
25
- "@webiny/app-websockets": "6.0.0-beta.0",
26
- "@webiny/error": "6.0.0-beta.0",
27
- "@webiny/react-router": "6.0.0-beta.0",
28
- "@webiny/ui": "6.0.0-beta.0",
29
- "@webiny/utils": "6.0.0-beta.0",
18
+ "@webiny/admin-ui": "6.0.0-rc.1",
19
+ "@webiny/app": "6.0.0-rc.1",
20
+ "@webiny/app-aco": "6.0.0-rc.1",
21
+ "@webiny/app-admin": "6.0.0-rc.1",
22
+ "@webiny/app-headless-cms": "6.0.0-rc.1",
23
+ "@webiny/app-websockets": "6.0.0-rc.1",
24
+ "@webiny/error": "6.0.0-rc.1",
25
+ "@webiny/icons": "6.0.0-rc.1",
26
+ "@webiny/utils": "6.0.0-rc.1",
30
27
  "apollo-client": "2.6.10",
31
28
  "apollo-link": "1.2.14",
32
- "crypto-hash": "3.0.0",
33
- "emotion": "10.0.27",
29
+ "crypto-hash": "3.1.0",
34
30
  "graphql-tag": "2.12.6",
35
31
  "react": "18.2.0",
36
32
  "react-dom": "18.2.0"
37
33
  },
38
34
  "devDependencies": {
39
- "@babel/cli": "7.24.1",
40
- "@babel/core": "7.24.3",
41
- "@babel/preset-env": "7.24.3",
42
- "@babel/preset-react": "7.24.1",
43
- "@babel/preset-typescript": "7.24.1",
44
- "@webiny/cli": "6.0.0-beta.0",
45
- "@webiny/project-utils": "6.0.0-beta.0",
46
- "rimraf": "5.0.5",
47
- "ttypescript": "1.5.15",
48
- "typescript": "4.7.4"
35
+ "@webiny/build-tools": "6.0.0-rc.1",
36
+ "rimraf": "6.1.3",
37
+ "typescript": "5.9.3"
49
38
  },
50
39
  "publishConfig": {
51
40
  "access": "public",
52
41
  "directory": "dist"
53
42
  },
54
- "scripts": {
55
- "build": "yarn webiny run build",
56
- "watch": "yarn webiny run watch"
57
- },
58
- "gitHead": "aa8dbfbbd5ad13ec271adba6f2431e02991a300f"
43
+ "gitHead": "36d702721ff9ed39fb21d6f5fe7922a2a8716e63"
59
44
  }
package/types.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { EntryTableItem } from "@webiny/app-headless-cms/types";
2
- import { GenericRecord } from "@webiny/app/types";
3
- import { IRecordLockingUnlockEntryResult } from "./domain/abstractions/IRecordLockingUnlockEntry";
1
+ import type { CmsContentEntry } from "@webiny/app-headless-cms/types.js";
2
+ import type { GenericRecord } from "@webiny/app/types.js";
3
+ import type { IRecordLockingUnlockEntryResult } from "./domain/abstractions/IRecordLockingUnlockEntry.js";
4
+ import type { IRecordLockingUpdateEntryLockResult } from "./domain/abstractions/IRecordLocking.js";
5
+ import { Identity } from "@webiny/app-admin/domain/Identity.js";
4
6
  export interface IRecordLockingIdentity {
5
7
  id: string;
6
8
  displayName: string;
@@ -12,20 +14,35 @@ export interface IRecordLockingRecordLocked {
12
14
  expiresOn: string;
13
15
  actions: IRecordLockingLockRecordAction[];
14
16
  }
15
- export interface IPossiblyRecordLockingRecord extends EntryTableItem {
17
+ export interface IRecordLockingCmsEntryValuesAction {
18
+ type: string;
19
+ message: string;
20
+ createdBy: Identity;
21
+ createdOn: string;
22
+ }
23
+ export interface IRecordLockingCmsEntryValues {
24
+ lockedBy: Identity;
25
+ lockedOn: string;
26
+ updatedOn: string;
27
+ expiresOn: string;
28
+ targetId: string;
29
+ type: string;
30
+ actions: IRecordLockingCmsEntryValuesAction;
31
+ }
32
+ export interface IPossiblyRecordLockingRecord extends CmsContentEntry<IRecordLockingCmsEntryValues> {
33
+ $selectable?: boolean;
34
+ $type?: "RECORD";
16
35
  $lockingType?: string;
17
- entryId: string;
18
36
  $locked?: IRecordLockingRecordLocked | null;
19
37
  }
20
38
  export interface IRecordLockingRecord extends IPossiblyRecordLockingRecord {
21
- entryId: string;
22
39
  $lockingType: string;
23
40
  }
24
- export declare type IIsRecordLockedParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
25
- export declare type IUpdateEntryLockParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
26
- export declare type IUnlockEntryParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
27
- export declare type IFetchLockRecordParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
28
- export declare type IFetchLockedEntryLockRecordParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
41
+ export type IIsRecordLockedParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
42
+ export type IUpdateEntryLockParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
43
+ export type IUnlockEntryParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
44
+ export type IFetchLockRecordParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
45
+ export type IFetchLockedEntryLockRecordParams = Pick<IRecordLockingRecord, "id" | "$lockingType">;
29
46
  export interface IFetchLockRecordResult {
30
47
  data: IRecordLockingLockRecord | null;
31
48
  error: IRecordLockingError | null;
@@ -35,7 +52,7 @@ export interface IRecordLockingContext<T extends IPossiblyRecordLockingRecord =
35
52
  readonly records: IPossiblyRecordLockingRecord[];
36
53
  readonly error?: IRecordLockingError | null;
37
54
  setRecords(folderId: string, type: string, records: T[]): Promise<void>;
38
- updateEntryLock(params: IUpdateEntryLockParams): Promise<void>;
55
+ updateEntryLock(params: IUpdateEntryLockParams): Promise<IRecordLockingUpdateEntryLockResult>;
39
56
  isRecordLocked(params?: IIsRecordLockedParams): boolean;
40
57
  getLockRecordEntry(id: string): IRecordLockingRecord | undefined;
41
58
  fetchLockRecord(params: IFetchLockRecordParams): Promise<IFetchLockRecordResult>;
@@ -70,3 +87,6 @@ export interface IRecordLockingError<T = GenericRecord> {
70
87
  code: string;
71
88
  data?: T;
72
89
  }
90
+ export interface RecordLockingSecurityPermission extends Identity.Permission {
91
+ canForceUnlock?: boolean;
92
+ }
package/types.js CHANGED
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=types.js.map
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { EntryTableItem } from \"@webiny/app-headless-cms/types\";\nimport { GenericRecord } from \"@webiny/app/types\";\nimport { IRecordLockingUnlockEntryResult } from \"~/domain/abstractions/IRecordLockingUnlockEntry\";\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 IPossiblyRecordLockingRecord extends EntryTableItem {\n $lockingType?: string;\n entryId: string;\n $locked?: IRecordLockingRecordLocked | null;\n}\n\nexport interface IRecordLockingRecord extends IPossiblyRecordLockingRecord {\n entryId: string;\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<void>;\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"],"mappings":"","ignoreList":[]}
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\n 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":[]}
@@ -1,3 +1,3 @@
1
- import { GenericRecord } from "@webiny/app/types";
2
- export declare type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];
1
+ import type { GenericRecord } from "@webiny/app/types.js";
2
+ export type ICreateCacheKeyInput = string | GenericRecord | ICreateCacheKeyInput[];
3
3
  export declare const createCacheKey: (input: ICreateCacheKeyInput) => Promise<string>;
@@ -1,19 +1,13 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createCacheKey = void 0;
7
- var _cryptoHash = require("crypto-hash");
8
- var createKey = function createKey(input) {
1
+ import { sha1 } from "crypto-hash";
2
+ const createKey = input => {
9
3
  if (typeof input === "string") {
10
4
  return input;
11
5
  }
12
6
  return JSON.stringify(input);
13
7
  };
14
- var createCacheKey = exports.createCacheKey = function createCacheKey(input) {
15
- var key = createKey(input);
16
- return (0, _cryptoHash.sha1)(key, {
8
+ export const createCacheKey = input => {
9
+ const key = createKey(input);
10
+ return sha1(key, {
17
11
  outputFormat: "hex"
18
12
  });
19
13
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_cryptoHash","require","createKey","input","JSON","stringify","createCacheKey","exports","key","sha1","outputFormat"],"sources":["createCacheKey.ts"],"sourcesContent":["import { GenericRecord } from \"@webiny/app/types\";\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,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAIC,KAA2B,EAAa;EACvD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EACA,OAAOC,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;AAChC,CAAC;AAEM,IAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAIH,KAA2B,EAAsB;EAC5E,IAAMK,GAAG,GAAGN,SAAS,CAACC,KAAK,CAAC;EAE5B,OAAO,IAAAM,gBAAI,EAACD,GAAG,EAAE;IACbE,YAAY,EAAE;EAClB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
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":[]}
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="24px" height="24px" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
- <g stroke-width="1" fill="none" fill-rule="evenodd">
4
- <g>
5
- <g>
6
- <polygon points="0 0 24 0 24 24 0 24"/>
7
- <polygon opacity="0.87" points="0 0 24 0 24 24 0 24"/>
8
- </g>
9
- <path d="M18,8 L17,8 L17,6 C17,3.24 14.76,1 12,1 C9.24,1 7,3.24 7,6 L7,8 L6,8 C4.9,8 4,8.9 4,10 L4,20 C4,21.1 4.9,22 6,22 L18,22 C19.1,22 20,21.1 20,20 L20,10 C20,8.9 19.1,8 18,8 Z M12,17 C10.9,17 10,16.1 10,15 C10,13.9 10.9,13 12,13 C13.1,13 14,13.9 14,15 C14,16.1 13.1,17 12,17 Z M9,8 L9,6 C9,4.34 10.34,3 12,3 C13.66,3 15,4.34 15,6 L15,8 L9,8 Z"
10
- fill="#D8D8D8" fill-rule="nonzero"/>
11
- </g>
12
- </g>
13
- </svg>
@@ -1,11 +0,0 @@
1
- import { IRecordLockingUnlockEntryRequest, IRecordLockingUnlockEntryRequestParams, IRecordLockingUnlockEntryRequestResult } from "./abstractions/IRecordLockingUnlockEntryRequest";
2
- import { IRecordLockingClient } from "./abstractions/IRecordLockingClient";
3
- interface Params {
4
- client: IRecordLockingClient;
5
- }
6
- export declare class RecordLockingUnlockEntryRequest implements IRecordLockingUnlockEntryRequest {
7
- private readonly client;
8
- constructor(params: Params);
9
- execute(params: IRecordLockingUnlockEntryRequestParams): Promise<IRecordLockingUnlockEntryRequestResult>;
10
- }
11
- export {};
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.RecordLockingUnlockEntryRequest = void 0;
8
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _error = require("@webiny/error");
11
- var RecordLockingUnlockEntryRequest = exports.RecordLockingUnlockEntryRequest = /*#__PURE__*/function () {
12
- // @eslint-disable-next-line
13
-
14
- function RecordLockingUnlockEntryRequest(params) {
15
- (0, _classCallCheck2.default)(this, RecordLockingUnlockEntryRequest);
16
- this.client = params.client;
17
- }
18
- return (0, _createClass2.default)(RecordLockingUnlockEntryRequest, [{
19
- key: "execute",
20
- value: async function execute(
21
- // eslint-disable-next-line
22
- params) {
23
- throw new _error.WebinyError("Method not implemented.");
24
- }
25
- }]);
26
- }();
27
-
28
- //# sourceMappingURL=RecordLockingUnlockEntryRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","require","RecordLockingUnlockEntryRequest","exports","params","_classCallCheck2","default","client","_createClass2","key","value","execute","WebinyError"],"sources":["RecordLockingUnlockEntryRequest.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport {\n IRecordLockingUnlockEntryRequest,\n IRecordLockingUnlockEntryRequestParams,\n IRecordLockingUnlockEntryRequestResult\n} from \"~/domain/abstractions/IRecordLockingUnlockEntryRequest\";\nimport { IRecordLockingClient } from \"./abstractions/IRecordLockingClient\";\n\ninterface Params {\n client: IRecordLockingClient;\n}\n\nexport class RecordLockingUnlockEntryRequest implements IRecordLockingUnlockEntryRequest {\n // @eslint-disable-next-line\n private readonly client: IRecordLockingClient;\n\n public constructor(params: Params) {\n this.client = params.client;\n }\n public async execute(\n // eslint-disable-next-line\n params: IRecordLockingUnlockEntryRequestParams\n ): Promise<IRecordLockingUnlockEntryRequestResult> {\n throw new WebinyError(\"Method not implemented.\");\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAA4C,IAY/BC,+BAA+B,GAAAC,OAAA,CAAAD,+BAAA;EACxC;;EAGA,SAAAA,gCAAmBE,MAAc,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,+BAAA;IAC/B,IAAI,CAACK,MAAM,GAAGH,MAAM,CAACG,MAAM;EAC/B;EAAC,WAAAC,aAAA,CAAAF,OAAA,EAAAJ,+BAAA;IAAAO,GAAA;IAAAC,KAAA,EACD,eAAAC;IACI;IACAP,MAA8C,EACC;MAC/C,MAAM,IAAIQ,kBAAW,CAAC,yBAAyB,CAAC;IACpD;EAAC;AAAA","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import { IRecordLockingError, IRecordLockingLockRecord } from "../../types";
2
- export interface IRecordLockingUnlockEntryRequestParams {
3
- id: string;
4
- type: string;
5
- }
6
- export interface IRecordLockingUnlockEntryRequestResult {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- }
10
- export interface IRecordLockingUnlockEntryRequest {
11
- execute(params: IRecordLockingUnlockEntryRequestParams): Promise<IRecordLockingUnlockEntryRequestResult>;
12
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=IRecordLockingUnlockEntryRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["IRecordLockingUnlockEntryRequest.ts"],"sourcesContent":["import { IRecordLockingError, IRecordLockingLockRecord } from \"~/types\";\n\nexport interface IRecordLockingUnlockEntryRequestParams {\n id: string;\n type: string;\n}\n\nexport interface IRecordLockingUnlockEntryRequestResult {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n}\n\nexport interface IRecordLockingUnlockEntryRequest {\n execute(\n params: IRecordLockingUnlockEntryRequestParams\n ): Promise<IRecordLockingUnlockEntryRequestResult>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,12 +0,0 @@
1
- import { IRecordLockingError, IRecordLockingLockRecord } from "../../types";
2
- import { IRecordLockingUnlockEntryRequestParams } from "../abstractions/IRecordLockingUnlockEntryRequest";
3
- export declare type IRecordLockingUnlockEntryRequestVariables = IRecordLockingUnlockEntryRequestParams;
4
- export interface IRecordLockingUnlockEntryRequestResponse {
5
- recordLocking: {
6
- unlockEntryRequest: {
7
- data: IRecordLockingLockRecord | null;
8
- error: IRecordLockingError | null;
9
- };
10
- };
11
- }
12
- export declare const createUnlockEntryRequestGraphQL: () => import("graphql").DocumentNode;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createUnlockEntryRequestGraphQL = void 0;
8
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
- var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
10
- var _fields = require("./fields");
11
- var _templateObject;
12
- var createUnlockEntryRequestGraphQL = exports.createUnlockEntryRequestGraphQL = function createUnlockEntryRequestGraphQL() {
13
- return (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n mutation RecordLockingUnlockEntryRequest($id: ID!, $type: String!) {\n recordLocking {\n unlockEntryRequest(id: $id, type: $type) {\n data {\n ", "\n }\n error {\n ", "\n }\n }\n }\n }\n "])), _fields.LOCK_RECORD_FIELDS, _fields.ERROR_FIELDS);
14
- };
15
-
16
- //# sourceMappingURL=unlockEntryRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_fields","_templateObject","createUnlockEntryRequestGraphQL","exports","gql","_taggedTemplateLiteral2","default","LOCK_RECORD_FIELDS","ERROR_FIELDS"],"sources":["unlockEntryRequest.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { ERROR_FIELDS, LOCK_RECORD_FIELDS } from \"./fields\";\nimport { IRecordLockingError, IRecordLockingLockRecord } from \"~/types\";\nimport { IRecordLockingUnlockEntryRequestParams } from \"../abstractions/IRecordLockingUnlockEntryRequest\";\n\nexport type IRecordLockingUnlockEntryRequestVariables = IRecordLockingUnlockEntryRequestParams;\n\nexport interface IRecordLockingUnlockEntryRequestResponse {\n recordLocking: {\n unlockEntryRequest: {\n data: IRecordLockingLockRecord | null;\n error: IRecordLockingError | null;\n };\n };\n}\n\nexport const createUnlockEntryRequestGraphQL = () => {\n return gql`\n mutation RecordLockingUnlockEntryRequest($id: ID!, $type: String!) {\n recordLocking {\n unlockEntryRequest(id: $id, type: $type) {\n data {\n ${LOCK_RECORD_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n `;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAA4D,IAAAE,eAAA;AAerD,IAAMC,+BAA+B,GAAAC,OAAA,CAAAD,+BAAA,GAAG,SAAlCA,+BAA+BA,CAAA,EAAS;EACjD,WAAOE,mBAAG,EAAAH,eAAA,KAAAA,eAAA,OAAAI,uBAAA,CAAAC,OAAA,uYAKYC,0BAAkB,EAGlBC,oBAAY;AAMtC,CAAC","ignoreList":[]}