@webiny/app-headless-cms-scheduler 6.5.0-beta.3 → 6.5.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms-scheduler",
3
- "version": "6.5.0-beta.3",
3
+ "version": "6.5.0-beta.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -13,14 +13,14 @@
13
13
  "author": "Webiny Ltd",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@webiny/admin-ui": "6.5.0-beta.3",
17
- "@webiny/app": "6.5.0-beta.3",
18
- "@webiny/app-admin": "6.5.0-beta.3",
19
- "@webiny/app-headless-cms": "6.5.0-beta.3",
20
- "@webiny/app-headless-cms-common": "6.5.0-beta.3",
21
- "@webiny/app-scheduler": "6.5.0-beta.3",
22
- "@webiny/feature": "6.5.0-beta.3",
23
- "@webiny/icons": "6.5.0-beta.3",
16
+ "@webiny/admin-ui": "6.5.0-beta.4",
17
+ "@webiny/app": "6.5.0-beta.4",
18
+ "@webiny/app-admin": "6.5.0-beta.4",
19
+ "@webiny/app-headless-cms": "6.5.0-beta.4",
20
+ "@webiny/app-headless-cms-common": "6.5.0-beta.4",
21
+ "@webiny/app-scheduler": "6.5.0-beta.4",
22
+ "@webiny/feature": "6.5.0-beta.4",
23
+ "@webiny/icons": "6.5.0-beta.4",
24
24
  "mobx": "6.16.1",
25
25
  "mobx-react-lite": "4.1.1",
26
26
  "react": "18.3.1",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/react": "18.3.31",
31
- "@webiny/build-tools": "6.5.0-beta.3",
31
+ "@webiny/build-tools": "6.5.0-beta.4",
32
32
  "rimraf": "6.1.3",
33
33
  "typescript": "7.0.2"
34
34
  },
@@ -23,6 +23,7 @@ declare class ContentEntriesPresenterWithScheduling implements IContentEntriesPr
23
23
  publishEntry(id: string): Promise<boolean>;
24
24
  unpublishEntry(id: string): Promise<boolean>;
25
25
  moveEntry(id: string, folderId: string): Promise<boolean>;
26
+ duplicateEntry(entry: Parameters<IContentEntriesPresenter["duplicateEntry"]>[0]): Promise<false | import("@webiny/app-headless-cms/presentation/contentEntries/list/abstractions.js").IDuplicateEntryResult>;
26
27
  }
27
28
  export declare const ContentEntriesPresenterSchedulingDecorator: typeof ContentEntriesPresenterWithScheduling & {
28
29
  __abstraction: import("@webiny/di").Abstraction<IContentEntriesPresenter>;
@@ -55,6 +55,9 @@ class ContentEntriesPresenterWithScheduling {
55
55
  moveEntry(id, folderId) {
56
56
  return this.original.moveEntry(id, folderId);
57
57
  }
58
+ duplicateEntry(entry) {
59
+ return this.original.duplicateEntry(entry);
60
+ }
58
61
  }
59
62
  const ContentEntriesPresenterSchedulingDecorator = ContentEntriesPresenter.createDecorator({
60
63
  decorator: ContentEntriesPresenterWithScheduling,
@@ -1 +1 @@
1
- {"version":3,"file":"presentation/scheduledActions/ContentEntriesPresenterSchedulingDecorator.js","sources":["../../../src/presentation/scheduledActions/ContentEntriesPresenterSchedulingDecorator.ts"],"sourcesContent":["import { comparer, reaction } from \"mobx\";\nimport type { IReactionDisposer } from \"mobx\";\nimport {\n ContentEntriesPresenter,\n type IContentEntriesPresenter,\n type IContentEntriesInitConfig\n} from \"@webiny/app-headless-cms/presentation/contentEntries/list/abstractions.js\";\nimport { ScheduledActionsPresenter } from \"./abstractions.js\";\n\n/**\n * Decorates the content-entries list presenter so the scheduled actions for the current model are\n * (re)loaded whenever the visible rows change. The reaction key includes each row's status/live,\n * so a direct publish/unpublish (which changes those, and lets the API cancel a schedule) triggers\n * a refresh without any extra signalling.\n */\nclass ContentEntriesPresenterWithScheduling implements IContentEntriesPresenter {\n private _disposeReaction: IReactionDisposer | null = null;\n\n constructor(\n private scheduledActions: ScheduledActionsPresenter.Interface,\n private original: IContentEntriesPresenter\n ) {}\n\n get vm() {\n return this.original.vm;\n }\n\n get list() {\n return this.original.list;\n }\n\n get folders() {\n return this.original.folders;\n }\n\n init(config?: IContentEntriesInitConfig): void {\n this.original.init(config);\n\n this._disposeReaction = reaction(\n () =>\n this.original.list.vm.rows.map(\n row => `${row.id}:${row.meta?.status ?? \"\"}:${row.live?.version ?? \"\"}`\n ),\n keys => {\n if (keys.length === 0) {\n return;\n }\n this.scheduledActions.loadForModel(this.original.vm.model.modelId);\n },\n { fireImmediately: true, equals: comparer.structural }\n );\n }\n\n dispose(): void {\n if (this._disposeReaction) {\n this._disposeReaction();\n this._disposeReaction = null;\n }\n this.scheduledActions.dispose();\n this.original.dispose();\n }\n\n selectEntry(id: string) {\n this.original.selectEntry(id);\n }\n\n deselectEntry() {\n this.original.deselectEntry();\n }\n\n createEntry() {\n this.original.createEntry();\n }\n\n deleteEntry(id: string) {\n return this.original.deleteEntry(id);\n }\n\n publishEntry(id: string) {\n return this.original.publishEntry(id);\n }\n\n unpublishEntry(id: string) {\n return this.original.unpublishEntry(id);\n }\n\n moveEntry(id: string, folderId: string) {\n return this.original.moveEntry(id, folderId);\n }\n}\n\nexport const ContentEntriesPresenterSchedulingDecorator = ContentEntriesPresenter.createDecorator({\n decorator: ContentEntriesPresenterWithScheduling,\n dependencies: [ScheduledActionsPresenter]\n});\n"],"names":["ContentEntriesPresenterWithScheduling","scheduledActions","original","config","reaction","row","keys","comparer","id","folderId","ContentEntriesPresenterSchedulingDecorator","ContentEntriesPresenter","ScheduledActionsPresenter"],"mappings":";;;AAeA,MAAMA;IAGF,YACYC,gBAAqD,EACrDC,QAAkC,CAC5C;aAFUD,gBAAgB,GAAhBA;aACAC,QAAQ,GAARA;aAJJ,gBAAgB,GAA6B;IAKlD;IAEH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;IAC3B;IAEA,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI;IAC7B;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ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E;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAACD,IAAIC;IACvC;AACJ;AAEO,MAAMC,6CAA6CC,wBAAwB,eAAe,CAAC;IAC9F,WAAWX;IACX,cAAc;QAACY;KAA0B;AAC7C"}
1
+ {"version":3,"file":"presentation/scheduledActions/ContentEntriesPresenterSchedulingDecorator.js","sources":["../../../src/presentation/scheduledActions/ContentEntriesPresenterSchedulingDecorator.ts"],"sourcesContent":["import { comparer, reaction } from \"mobx\";\nimport type { IReactionDisposer } from \"mobx\";\nimport {\n ContentEntriesPresenter,\n type IContentEntriesPresenter,\n type IContentEntriesInitConfig\n} from \"@webiny/app-headless-cms/presentation/contentEntries/list/abstractions.js\";\nimport { ScheduledActionsPresenter } from \"./abstractions.js\";\n\n/**\n * Decorates the content-entries list presenter so the scheduled actions for the current model are\n * (re)loaded whenever the visible rows change. The reaction key includes each row's status/live,\n * so a direct publish/unpublish (which changes those, and lets the API cancel a schedule) triggers\n * a refresh without any extra signalling.\n */\nclass ContentEntriesPresenterWithScheduling implements IContentEntriesPresenter {\n private _disposeReaction: IReactionDisposer | null = null;\n\n constructor(\n private scheduledActions: ScheduledActionsPresenter.Interface,\n private original: IContentEntriesPresenter\n ) {}\n\n get vm() {\n return this.original.vm;\n }\n\n get list() {\n return this.original.list;\n }\n\n get folders() {\n return this.original.folders;\n }\n\n init(config?: IContentEntriesInitConfig): void {\n this.original.init(config);\n\n this._disposeReaction = reaction(\n () =>\n this.original.list.vm.rows.map(\n row => `${row.id}:${row.meta?.status ?? \"\"}:${row.live?.version ?? \"\"}`\n ),\n keys => {\n if (keys.length === 0) {\n return;\n }\n this.scheduledActions.loadForModel(this.original.vm.model.modelId);\n },\n { fireImmediately: true, equals: comparer.structural }\n );\n }\n\n dispose(): void {\n if (this._disposeReaction) {\n this._disposeReaction();\n this._disposeReaction = null;\n }\n this.scheduledActions.dispose();\n this.original.dispose();\n }\n\n selectEntry(id: string) {\n this.original.selectEntry(id);\n }\n\n deselectEntry() {\n this.original.deselectEntry();\n }\n\n createEntry() {\n this.original.createEntry();\n }\n\n deleteEntry(id: string) {\n return this.original.deleteEntry(id);\n }\n\n publishEntry(id: string) {\n return this.original.publishEntry(id);\n }\n\n unpublishEntry(id: string) {\n return this.original.unpublishEntry(id);\n }\n\n moveEntry(id: string, folderId: string) {\n return this.original.moveEntry(id, folderId);\n }\n\n duplicateEntry(entry: Parameters<IContentEntriesPresenter[\"duplicateEntry\"]>[0]) {\n return this.original.duplicateEntry(entry);\n }\n}\n\nexport const ContentEntriesPresenterSchedulingDecorator = ContentEntriesPresenter.createDecorator({\n decorator: ContentEntriesPresenterWithScheduling,\n dependencies: [ScheduledActionsPresenter]\n});\n"],"names":["ContentEntriesPresenterWithScheduling","scheduledActions","original","config","reaction","row","keys","comparer","id","folderId","entry","ContentEntriesPresenterSchedulingDecorator","ContentEntriesPresenter","ScheduledActionsPresenter"],"mappings":";;;AAeA,MAAMA;IAGF,YACYC,gBAAqD,EACrDC,QAAkC,CAC5C;aAFUD,gBAAgB,GAAhBA;aACAC,QAAQ,GAARA;aAJJ,gBAAgB,GAA6B;IAKlD;IAEH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;IAC3B;IAEA,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI;IAC7B;IAEA,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;IAChC;IAEA,KAAKC,MAAkC,EAAQ;QAC3C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAACA;QAEnB,IAAI,CAAC,gBAAgB,GAAGC,SACpB,IACI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAC1BC,CAAAA,MAAO,GAAGA,IAAI,EAAE,CAAC,CAAC,EAAEA,IAAI,IAAI,EAAE,UAAU,GAAG,CAAC,EAAEA,IAAI,IAAI,EAAE,WAAW,IAAI,GAE/EC,CAA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