@webiny/api-headless-cms-pg-os 0.0.0-unstable.0d717d18dd
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/LICENSE +21 -0
- package/README.md +11 -0
- package/features/HeadlessCmsPgOsFeature.d.ts +9 -0
- package/features/HeadlessCmsPgOsFeature.js +40 -0
- package/features/HeadlessCmsPgOsFeature.js.map +1 -0
- package/features/SyncWriter/BuildSyncRecord.d.ts +22 -0
- package/features/SyncWriter/BuildSyncRecord.js +56 -0
- package/features/SyncWriter/BuildSyncRecord.js.map +1 -0
- package/features/SyncWriter/RemoveEntry.d.ts +11 -0
- package/features/SyncWriter/RemoveEntry.js +23 -0
- package/features/SyncWriter/RemoveEntry.js.map +1 -0
- package/features/SyncWriter/RemoveLatest.d.ts +11 -0
- package/features/SyncWriter/RemoveLatest.js +19 -0
- package/features/SyncWriter/RemoveLatest.js.map +1 -0
- package/features/SyncWriter/RemovePublished.d.ts +11 -0
- package/features/SyncWriter/RemovePublished.js +19 -0
- package/features/SyncWriter/RemovePublished.js.map +1 -0
- package/features/SyncWriter/SyncHelpers.d.ts +26 -0
- package/features/SyncWriter/SyncHelpers.js +70 -0
- package/features/SyncWriter/SyncHelpers.js.map +1 -0
- package/features/SyncWriter/SyncRowQuery.d.ts +22 -0
- package/features/SyncWriter/SyncRowQuery.js +22 -0
- package/features/SyncWriter/SyncRowQuery.js.map +1 -0
- package/features/SyncWriter/WriteEntry.d.ts +14 -0
- package/features/SyncWriter/WriteEntry.js +32 -0
- package/features/SyncWriter/WriteEntry.js.map +1 -0
- package/features/SyncWriter/WriteLatest.d.ts +14 -0
- package/features/SyncWriter/WriteLatest.js +26 -0
- package/features/SyncWriter/WriteLatest.js.map +1 -0
- package/features/SyncWriter/WritePublished.d.ts +14 -0
- package/features/SyncWriter/WritePublished.js +26 -0
- package/features/SyncWriter/WritePublished.js.map +1 -0
- package/features/SyncWriter/abstractions/BuildSyncRecord.d.ts +18 -0
- package/features/SyncWriter/abstractions/BuildSyncRecord.js +5 -0
- package/features/SyncWriter/abstractions/BuildSyncRecord.js.map +1 -0
- package/features/SyncWriter/abstractions/RemoveEntry.d.ts +13 -0
- package/features/SyncWriter/abstractions/RemoveEntry.js +5 -0
- package/features/SyncWriter/abstractions/RemoveEntry.js.map +1 -0
- package/features/SyncWriter/abstractions/RemoveLatest.d.ts +13 -0
- package/features/SyncWriter/abstractions/RemoveLatest.js +5 -0
- package/features/SyncWriter/abstractions/RemoveLatest.js.map +1 -0
- package/features/SyncWriter/abstractions/RemovePublished.d.ts +13 -0
- package/features/SyncWriter/abstractions/RemovePublished.js +5 -0
- package/features/SyncWriter/abstractions/RemovePublished.js.map +1 -0
- package/features/SyncWriter/abstractions/SyncHelpers.d.ts +10 -0
- package/features/SyncWriter/abstractions/SyncHelpers.js +5 -0
- package/features/SyncWriter/abstractions/SyncHelpers.js.map +1 -0
- package/features/SyncWriter/abstractions/SyncRowQuery.d.ts +9 -0
- package/features/SyncWriter/abstractions/SyncRowQuery.js +5 -0
- package/features/SyncWriter/abstractions/SyncRowQuery.js.map +1 -0
- package/features/SyncWriter/abstractions/WriteEntry.d.ts +14 -0
- package/features/SyncWriter/abstractions/WriteEntry.js +5 -0
- package/features/SyncWriter/abstractions/WriteEntry.js.map +1 -0
- package/features/SyncWriter/abstractions/WriteLatest.d.ts +14 -0
- package/features/SyncWriter/abstractions/WriteLatest.js +5 -0
- package/features/SyncWriter/abstractions/WriteLatest.js.map +1 -0
- package/features/SyncWriter/abstractions/WritePublished.d.ts +14 -0
- package/features/SyncWriter/abstractions/WritePublished.js +5 -0
- package/features/SyncWriter/abstractions/WritePublished.js.map +1 -0
- package/features/SyncWriter/feature.d.ts +4 -0
- package/features/SyncWriter/feature.js +27 -0
- package/features/SyncWriter/feature.js.map +1 -0
- package/features/SyncWriter/index.d.ts +9 -0
- package/features/SyncWriter/index.js +9 -0
- package/features/syncEventHandler/SyncEventHandler.d.ts +15 -0
- package/features/syncEventHandler/SyncEventHandler.js +49 -0
- package/features/syncEventHandler/SyncEventHandler.js.map +1 -0
- package/features/syncEventHandler/abstractions.d.ts +12 -0
- package/features/syncEventHandler/abstractions.js +5 -0
- package/features/syncEventHandler/abstractions.js.map +1 -0
- package/features/syncEventHandler/feature.d.ts +4 -0
- package/features/syncEventHandler/feature.js +11 -0
- package/features/syncEventHandler/feature.js.map +1 -0
- package/features/syncTableManager/SyncTableManager.d.ts +19 -0
- package/features/syncTableManager/SyncTableManager.js +61 -0
- package/features/syncTableManager/SyncTableManager.js.map +1 -0
- package/features/syncTableManager/abstractions.d.ts +9 -0
- package/features/syncTableManager/abstractions.js +5 -0
- package/features/syncTableManager/abstractions.js.map +1 -0
- package/features/syncTableManager/feature.d.ts +4 -0
- package/features/syncTableManager/feature.js +11 -0
- package/features/syncTableManager/feature.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/operations/entry/EntrySearchOperations.d.ts +15 -0
- package/operations/entry/EntrySearchOperations.js +35 -0
- package/operations/entry/EntrySearchOperations.js.map +1 -0
- package/operations/entry/PgOsCreateEntry.d.ts +15 -0
- package/operations/entry/PgOsCreateEntry.js +27 -0
- package/operations/entry/PgOsCreateEntry.js.map +1 -0
- package/operations/entry/PgOsCreateEntryRevisionFrom.d.ts +15 -0
- package/operations/entry/PgOsCreateEntryRevisionFrom.js +27 -0
- package/operations/entry/PgOsCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/PgOsDeleteEntry.d.ts +17 -0
- package/operations/entry/PgOsDeleteEntry.js +33 -0
- package/operations/entry/PgOsDeleteEntry.js.map +1 -0
- package/operations/entry/PgOsDeleteEntryRevision.d.ts +21 -0
- package/operations/entry/PgOsDeleteEntryRevision.js +48 -0
- package/operations/entry/PgOsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/PgOsDeleteMultipleEntries.d.ts +17 -0
- package/operations/entry/PgOsDeleteMultipleEntries.js +36 -0
- package/operations/entry/PgOsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/PgOsGetEntry.d.ts +12 -0
- package/operations/entry/PgOsGetEntry.js +19 -0
- package/operations/entry/PgOsGetEntry.js.map +1 -0
- package/operations/entry/PgOsGetUniqueFieldValues.d.ts +12 -0
- package/operations/entry/PgOsGetUniqueFieldValues.js +19 -0
- package/operations/entry/PgOsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/PgOsListEntries.d.ts +12 -0
- package/operations/entry/PgOsListEntries.js +19 -0
- package/operations/entry/PgOsListEntries.js.map +1 -0
- package/operations/entry/PgOsMoveEntry.d.ts +15 -0
- package/operations/entry/PgOsMoveEntry.js +26 -0
- package/operations/entry/PgOsMoveEntry.js.map +1 -0
- package/operations/entry/PgOsMoveToBin.d.ts +15 -0
- package/operations/entry/PgOsMoveToBin.js +26 -0
- package/operations/entry/PgOsMoveToBin.js.map +1 -0
- package/operations/entry/PgOsPublishEntry.d.ts +17 -0
- package/operations/entry/PgOsPublishEntry.js +34 -0
- package/operations/entry/PgOsPublishEntry.js.map +1 -0
- package/operations/entry/PgOsRestoreFromBin.d.ts +15 -0
- package/operations/entry/PgOsRestoreFromBin.js +27 -0
- package/operations/entry/PgOsRestoreFromBin.js.map +1 -0
- package/operations/entry/PgOsUnpublishEntry.d.ts +19 -0
- package/operations/entry/PgOsUnpublishEntry.js +41 -0
- package/operations/entry/PgOsUnpublishEntry.js.map +1 -0
- package/operations/entry/PgOsUpdateEntry.d.ts +15 -0
- package/operations/entry/PgOsUpdateEntry.js +27 -0
- package/operations/entry/PgOsUpdateEntry.js.map +1 -0
- package/operations/entry/abstractions/EntrySearchOperations.d.ts +10 -0
- package/operations/entry/abstractions/EntrySearchOperations.js +5 -0
- package/operations/entry/abstractions/EntrySearchOperations.js.map +1 -0
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/search/get.d.ts +3 -0
- package/operations/entry/search/get.js +14 -0
- package/operations/entry/search/get.js.map +1 -0
- package/operations/entry/search/getUniqueFieldValues.d.ts +3 -0
- package/operations/entry/search/getUniqueFieldValues.js +55 -0
- package/operations/entry/search/getUniqueFieldValues.js.map +1 -0
- package/operations/entry/search/list.d.ts +3 -0
- package/operations/entry/search/list.js +59 -0
- package/operations/entry/search/list.js.map +1 -0
- package/operations/entry/search/types.d.ts +19 -0
- package/operations/entry/search/types.js +0 -0
- package/package.json +73 -0
- package/testing/createReindexEvents.d.ts +3 -0
- package/testing/createReindexEvents.js +14 -0
- package/testing/createReindexEvents.js.map +1 -0
- package/testing/index.d.ts +2 -0
- package/testing/index.js +2 -0
- package/testing/simulatePgStream.d.ts +19 -0
- package/testing/simulatePgStream.js +51 -0
- package/testing/simulatePgStream.js.map +1 -0
- package/types.d.ts +17 -0
- package/types.js +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
2
|
+
import { OpenSearchClient } from "@webiny/api-opensearch/exports/api/opensearch.js";
|
|
3
|
+
import { CmsEntryOpenSearchBodyBuilder, CmsEntryOpenSearchFieldIndexRegistry } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
4
|
+
import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
import { createListOperation } from "./search/list.js";
|
|
7
|
+
import { createGetOperation } from "./search/get.js";
|
|
8
|
+
import { createGetUniqueFieldValuesOperation } from "./search/getUniqueFieldValues.js";
|
|
9
|
+
class EntrySearchOperationsImpl {
|
|
10
|
+
constructor(openSearchClient, bodyBuilder, fieldRegistry, fieldIndexRegistry, storageModelProvider){
|
|
11
|
+
const deps = {
|
|
12
|
+
elasticsearch: openSearchClient.use(),
|
|
13
|
+
bodyBuilder,
|
|
14
|
+
fieldRegistry,
|
|
15
|
+
fieldIndexRegistry,
|
|
16
|
+
getStorageOperationsModel: (model)=>storageModelProvider.getModel(model)
|
|
17
|
+
};
|
|
18
|
+
this.list = createListOperation(deps);
|
|
19
|
+
this.get = createGetOperation(deps);
|
|
20
|
+
this.getUniqueFieldValues = createGetUniqueFieldValuesOperation(deps);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const EntrySearchOperations_EntrySearchOperations = EntrySearchOperations.createImplementation({
|
|
24
|
+
implementation: EntrySearchOperationsImpl,
|
|
25
|
+
dependencies: [
|
|
26
|
+
OpenSearchClient,
|
|
27
|
+
CmsEntryOpenSearchBodyBuilder,
|
|
28
|
+
CmsModelFieldToGraphQLRegistry,
|
|
29
|
+
CmsEntryOpenSearchFieldIndexRegistry,
|
|
30
|
+
CmsStorageModelProvider
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { EntrySearchOperations_EntrySearchOperations as EntrySearchOperations };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=EntrySearchOperations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/EntrySearchOperations.js","sources":["../../../src/operations/entry/EntrySearchOperations.ts"],"sourcesContent":["import { EntrySearchOperations as Abstraction } from \"./abstractions/EntrySearchOperations.js\";\nimport type { IEntrySearchOperations } from \"./abstractions/EntrySearchOperations.js\";\nimport { OpenSearchClient } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport {\n CmsEntryOpenSearchBodyBuilder,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport type { SearchOperationDeps } from \"./search/types.js\";\nimport { createListOperation } from \"./search/list.js\";\nimport { createGetOperation } from \"./search/get.js\";\nimport { createGetUniqueFieldValuesOperation } from \"./search/getUniqueFieldValues.js\";\n\nclass EntrySearchOperationsImpl implements IEntrySearchOperations {\n public readonly list: IEntrySearchOperations[\"list\"];\n public readonly get: IEntrySearchOperations[\"get\"];\n public readonly getUniqueFieldValues: IEntrySearchOperations[\"getUniqueFieldValues\"];\n\n public constructor(\n openSearchClient: OpenSearchClient.Interface,\n bodyBuilder: CmsEntryOpenSearchBodyBuilder.Interface,\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface,\n fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface,\n storageModelProvider: CmsStorageModelProvider.Interface\n ) {\n const deps: SearchOperationDeps = {\n elasticsearch: openSearchClient.use(),\n bodyBuilder,\n fieldRegistry,\n fieldIndexRegistry,\n getStorageOperationsModel: model => storageModelProvider.getModel(model)\n };\n\n this.list = createListOperation(deps);\n this.get = createGetOperation(deps);\n this.getUniqueFieldValues = createGetUniqueFieldValuesOperation(deps);\n }\n}\n\nexport const EntrySearchOperations = Abstraction.createImplementation({\n implementation: EntrySearchOperationsImpl,\n dependencies: [\n OpenSearchClient,\n CmsEntryOpenSearchBodyBuilder,\n CmsModelFieldToGraphQLRegistry,\n CmsEntryOpenSearchFieldIndexRegistry,\n CmsStorageModelProvider\n ]\n});\n"],"names":["EntrySearchOperationsImpl","openSearchClient","bodyBuilder","fieldRegistry","fieldIndexRegistry","storageModelProvider","deps","model","createListOperation","createGetOperation","createGetUniqueFieldValuesOperation","EntrySearchOperations","Abstraction","OpenSearchClient","CmsEntryOpenSearchBodyBuilder","CmsModelFieldToGraphQLRegistry","CmsEntryOpenSearchFieldIndexRegistry","CmsStorageModelProvider"],"mappings":";;;;;;;;AAcA,MAAMA;IAKF,YACIC,gBAA4C,EAC5CC,WAAoD,EACpDC,aAAuD,EACvDC,kBAAkE,EAClEC,oBAAuD,CACzD;QACE,MAAMC,OAA4B;YAC9B,eAAeL,iBAAiB,GAAG;YACnCC;YACAC;YACAC;YACA,2BAA2BG,CAAAA,QAASF,qBAAqB,QAAQ,CAACE;QACtE;QAEA,IAAI,CAAC,IAAI,GAAGC,oBAAoBF;QAChC,IAAI,CAAC,GAAG,GAAGG,mBAAmBH;QAC9B,IAAI,CAAC,oBAAoB,GAAGI,oCAAoCJ;IACpE;AACJ;AAEO,MAAMK,8CAAwBC,sBAAAA,oBAAgC,CAAC;IAClE,gBAAgBZ;IAChB,cAAc;QACVa;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
5
|
+
declare class PgOsCreateEntryImpl implements CreateEntryStorageOperation.Interface {
|
|
6
|
+
private syncHelpers;
|
|
7
|
+
private storageModelProvider;
|
|
8
|
+
private inner;
|
|
9
|
+
constructor(syncHelpers: SyncHelpers.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: CreateEntryStorageOperation.Interface);
|
|
10
|
+
execute<T extends CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>): Promise<import("@webiny/api-headless-cms/types/types").CmsEntry<T>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const PgOsCreateEntry: typeof PgOsCreateEntryImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js").ICreateEntryStorageOperation>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
4
|
+
class PgOsCreateEntryImpl {
|
|
5
|
+
constructor(syncHelpers, storageModelProvider, inner){
|
|
6
|
+
this.syncHelpers = syncHelpers;
|
|
7
|
+
this.storageModelProvider = storageModelProvider;
|
|
8
|
+
this.inner = inner;
|
|
9
|
+
}
|
|
10
|
+
async execute(model, params) {
|
|
11
|
+
await this.syncHelpers.ensureSyncTable();
|
|
12
|
+
const result = await this.inner.execute(model, params);
|
|
13
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
14
|
+
await this.syncHelpers.writeSyncForEntry(storageModel, params.entry, params.storageEntry);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const PgOsCreateEntry = CreateEntryStorageOperation.createDecorator({
|
|
19
|
+
decorator: PgOsCreateEntryImpl,
|
|
20
|
+
dependencies: [
|
|
21
|
+
SyncHelpers,
|
|
22
|
+
CmsStorageModelProvider
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
export { PgOsCreateEntry };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=PgOsCreateEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsCreateEntry.js","sources":["../../../src/operations/entry/PgOsCreateEntry.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsCreateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { CreateEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsCreateEntryImpl implements CreateEntryStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: CreateEntryStorageOperation.Interface\n ) {}\n\n async execute<T extends CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateParams<T>\n ) {\n await this.syncHelpers.ensureSyncTable();\n const result = await this.inner.execute(model, params);\n const storageModel = this.storageModelProvider.getModel<T>(model);\n await this.syncHelpers.writeSyncForEntry(storageModel, params.entry, params.storageEntry);\n return result;\n }\n}\n\nexport const PgOsCreateEntry = CreateEntryStorageOperation.createDecorator({\n decorator: PgOsCreateEntryImpl,\n dependencies: [SyncHelpers, CmsStorageModelProvider]\n});\n"],"names":["PgOsCreateEntryImpl","syncHelpers","storageModelProvider","inner","model","params","result","storageModel","PgOsCreateEntry","CreateEntryStorageOperation","SyncHelpers","CmsStorageModelProvider"],"mappings":";;;AASA,MAAMA;IACF,YACYC,WAAkC,EAClCC,oBAAuD,EACvDC,KAA4C,CACtD;aAHUF,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QACFC,KAAe,EACfC,MAAgD,EAClD;QACE,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAMC,SAAS,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACF,OAAOC;QAC/C,MAAME,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIH;QAC3D,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAACG,cAAcF,OAAO,KAAK,EAAEA,OAAO,YAAY;QACxF,OAAOC;IACX;AACJ;AAEO,MAAME,kBAAkBC,4BAA4B,eAAe,CAAC;IACvE,WAAWT;IACX,cAAc;QAACU;QAAaC;KAAwB;AACxD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateRevisionFromParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateEntryRevisionFromStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
5
|
+
declare class PgOsCreateEntryRevisionFromImpl implements CreateEntryRevisionFromStorageOperation.Interface {
|
|
6
|
+
private syncHelpers;
|
|
7
|
+
private storageModelProvider;
|
|
8
|
+
private inner;
|
|
9
|
+
constructor(syncHelpers: SyncHelpers.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: CreateEntryRevisionFromStorageOperation.Interface);
|
|
10
|
+
execute<T extends CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>): Promise<import("@webiny/api-headless-cms/types/types").CmsEntry<T>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const PgOsCreateEntryRevisionFrom: typeof PgOsCreateEntryRevisionFromImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js").ICreateEntryRevisionFromStorageOperation>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CreateEntryRevisionFromStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
4
|
+
class PgOsCreateEntryRevisionFromImpl {
|
|
5
|
+
constructor(syncHelpers, storageModelProvider, inner){
|
|
6
|
+
this.syncHelpers = syncHelpers;
|
|
7
|
+
this.storageModelProvider = storageModelProvider;
|
|
8
|
+
this.inner = inner;
|
|
9
|
+
}
|
|
10
|
+
async execute(model, params) {
|
|
11
|
+
await this.syncHelpers.ensureSyncTable();
|
|
12
|
+
const result = await this.inner.execute(model, params);
|
|
13
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
14
|
+
await this.syncHelpers.writeSyncForEntry(storageModel, params.entry, params.storageEntry);
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const PgOsCreateEntryRevisionFrom = CreateEntryRevisionFromStorageOperation.createDecorator({
|
|
19
|
+
decorator: PgOsCreateEntryRevisionFromImpl,
|
|
20
|
+
dependencies: [
|
|
21
|
+
SyncHelpers,
|
|
22
|
+
CmsStorageModelProvider
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
export { PgOsCreateEntryRevisionFrom };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=PgOsCreateEntryRevisionFrom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsCreateEntryRevisionFrom.js","sources":["../../../src/operations/entry/PgOsCreateEntryRevisionFrom.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsCreateRevisionFromParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { CreateEntryRevisionFromStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsCreateEntryRevisionFromImpl implements CreateEntryRevisionFromStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: CreateEntryRevisionFromStorageOperation.Interface\n ) {}\n\n async execute<T extends CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryStorageOperationsCreateRevisionFromParams<T>\n ) {\n await this.syncHelpers.ensureSyncTable();\n const result = await this.inner.execute(model, params);\n const storageModel = this.storageModelProvider.getModel<T>(model);\n await this.syncHelpers.writeSyncForEntry(storageModel, params.entry, params.storageEntry);\n return result;\n }\n}\n\nexport const PgOsCreateEntryRevisionFrom = CreateEntryRevisionFromStorageOperation.createDecorator({\n decorator: PgOsCreateEntryRevisionFromImpl,\n dependencies: [SyncHelpers, CmsStorageModelProvider]\n});\n"],"names":["PgOsCreateEntryRevisionFromImpl","syncHelpers","storageModelProvider","inner","model","params","result","storageModel","PgOsCreateEntryRevisionFrom","CreateEntryRevisionFromStorageOperation","SyncHelpers","CmsStorageModelProvider"],"mappings":";;;AASA,MAAMA;IACF,YACYC,WAAkC,EAClCC,oBAAuD,EACvDC,KAAwD,CAClE;aAHUF,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QACFC,KAAe,EACfC,MAA4D,EAC9D;QACE,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAMC,SAAS,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACF,OAAOC;QAC/C,MAAME,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIH;QAC3D,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAACG,cAAcF,OAAO,KAAK,EAAEA,OAAO,YAAY;QACxF,OAAOC;IACX;AACJ;AAEO,MAAME,8BAA8BC,wCAAwC,eAAe,CAAC;IAC/F,WAAWT;IACX,cAAc;QAACU;QAAaC;KAAwB;AACxD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryStorageOperationsDeleteParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { DeleteEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { RemoveEntry } from "../../features/SyncWriter/abstractions/RemoveEntry.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
declare class PgOsDeleteEntryImpl implements DeleteEntryStorageOperation.Interface {
|
|
7
|
+
private syncHelpers;
|
|
8
|
+
private removeEntry;
|
|
9
|
+
private storageModelProvider;
|
|
10
|
+
private inner;
|
|
11
|
+
constructor(syncHelpers: SyncHelpers.Interface, removeEntry: RemoveEntry.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: DeleteEntryStorageOperation.Interface);
|
|
12
|
+
execute(model: CmsModel, params: CmsEntryStorageOperationsDeleteParams): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const PgOsDeleteEntry: typeof PgOsDeleteEntryImpl & {
|
|
15
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js").IDeleteEntryStorageOperation>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DeleteEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { RemoveEntry } from "../../features/SyncWriter/abstractions/RemoveEntry.js";
|
|
4
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
5
|
+
class PgOsDeleteEntryImpl {
|
|
6
|
+
constructor(syncHelpers, removeEntry, storageModelProvider, inner){
|
|
7
|
+
this.syncHelpers = syncHelpers;
|
|
8
|
+
this.removeEntry = removeEntry;
|
|
9
|
+
this.storageModelProvider = storageModelProvider;
|
|
10
|
+
this.inner = inner;
|
|
11
|
+
}
|
|
12
|
+
async execute(model, params) {
|
|
13
|
+
await this.syncHelpers.ensureSyncTable();
|
|
14
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
15
|
+
const { entryId } = params.entry;
|
|
16
|
+
await this.inner.execute(model, params);
|
|
17
|
+
await this.removeEntry.execute({
|
|
18
|
+
model: storageModel,
|
|
19
|
+
entryId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const PgOsDeleteEntry = DeleteEntryStorageOperation.createDecorator({
|
|
24
|
+
decorator: PgOsDeleteEntryImpl,
|
|
25
|
+
dependencies: [
|
|
26
|
+
SyncHelpers,
|
|
27
|
+
RemoveEntry,
|
|
28
|
+
CmsStorageModelProvider
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
export { PgOsDeleteEntry };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=PgOsDeleteEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsDeleteEntry.js","sources":["../../../src/operations/entry/PgOsDeleteEntry.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryStorageOperationsDeleteParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { DeleteEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { RemoveEntry } from \"~/features/SyncWriter/abstractions/RemoveEntry.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsDeleteEntryImpl implements DeleteEntryStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private removeEntry: RemoveEntry.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: DeleteEntryStorageOperation.Interface\n ) {}\n\n async execute(model: CmsModel, params: CmsEntryStorageOperationsDeleteParams) {\n await this.syncHelpers.ensureSyncTable();\n const storageModel = this.storageModelProvider.getModel(model);\n const { entryId } = params.entry;\n await this.inner.execute(model, params);\n await this.removeEntry.execute({ model: storageModel, entryId });\n }\n}\n\nexport const PgOsDeleteEntry = DeleteEntryStorageOperation.createDecorator({\n decorator: PgOsDeleteEntryImpl,\n dependencies: [SyncHelpers, RemoveEntry, CmsStorageModelProvider]\n});\n"],"names":["PgOsDeleteEntryImpl","syncHelpers","removeEntry","storageModelProvider","inner","model","params","storageModel","entryId","PgOsDeleteEntry","DeleteEntryStorageOperation","SyncHelpers","RemoveEntry","CmsStorageModelProvider"],"mappings":";;;;AASA,MAAMA;IACF,YACYC,WAAkC,EAClCC,WAAkC,EAClCC,oBAAuD,EACvDC,KAA4C,CACtD;aAJUH,WAAW,GAAXA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAEC,MAA6C,EAAE;QAC1E,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAMC,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QACxD,MAAM,EAAEG,OAAO,EAAE,GAAGF,OAAO,KAAK;QAChC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACD,OAAOC;QAChC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAAE,OAAOC;YAAcC;QAAQ;IAClE;AACJ;AAEO,MAAMC,kBAAkBC,4BAA4B,eAAe,CAAC;IACvE,WAAWV;IACX,cAAc;QAACW;QAAaC;QAAaC;KAAwB;AACrE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsDeleteRevisionParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { DeleteEntryRevisionStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { WriteLatest } from "../../features/SyncWriter/abstractions/WriteLatest.js";
|
|
5
|
+
import { RemoveLatest } from "../../features/SyncWriter/abstractions/RemoveLatest.js";
|
|
6
|
+
import { RemovePublished } from "../../features/SyncWriter/abstractions/RemovePublished.js";
|
|
7
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
8
|
+
declare class PgOsDeleteEntryRevisionImpl implements DeleteEntryRevisionStorageOperation.Interface {
|
|
9
|
+
private syncHelpers;
|
|
10
|
+
private writeLatest;
|
|
11
|
+
private removeLatest;
|
|
12
|
+
private removePublished;
|
|
13
|
+
private storageModelProvider;
|
|
14
|
+
private inner;
|
|
15
|
+
constructor(syncHelpers: SyncHelpers.Interface, writeLatest: WriteLatest.Interface, removeLatest: RemoveLatest.Interface, removePublished: RemovePublished.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: DeleteEntryRevisionStorageOperation.Interface);
|
|
16
|
+
execute<T extends CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsDeleteRevisionParams<T>): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const PgOsDeleteEntryRevision: typeof PgOsDeleteEntryRevisionImpl & {
|
|
19
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js").IDeleteEntryRevisionStorageOperation>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DeleteEntryRevisionStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { WriteLatest } from "../../features/SyncWriter/abstractions/WriteLatest.js";
|
|
4
|
+
import { RemoveLatest } from "../../features/SyncWriter/abstractions/RemoveLatest.js";
|
|
5
|
+
import { RemovePublished } from "../../features/SyncWriter/abstractions/RemovePublished.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
class PgOsDeleteEntryRevisionImpl {
|
|
8
|
+
constructor(syncHelpers, writeLatest, removeLatest, removePublished, storageModelProvider, inner){
|
|
9
|
+
this.syncHelpers = syncHelpers;
|
|
10
|
+
this.writeLatest = writeLatest;
|
|
11
|
+
this.removeLatest = removeLatest;
|
|
12
|
+
this.removePublished = removePublished;
|
|
13
|
+
this.storageModelProvider = storageModelProvider;
|
|
14
|
+
this.inner = inner;
|
|
15
|
+
}
|
|
16
|
+
async execute(model, params) {
|
|
17
|
+
await this.syncHelpers.ensureSyncTable();
|
|
18
|
+
await this.inner.execute(model, params);
|
|
19
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
20
|
+
const { latestStorageEntry, storageEntry } = params;
|
|
21
|
+
if (latestStorageEntry) await this.writeLatest.execute({
|
|
22
|
+
model: storageModel,
|
|
23
|
+
entry: latestStorageEntry,
|
|
24
|
+
storageEntry: latestStorageEntry
|
|
25
|
+
});
|
|
26
|
+
else await this.removeLatest.execute({
|
|
27
|
+
model: storageModel,
|
|
28
|
+
entryId: storageEntry.entryId
|
|
29
|
+
});
|
|
30
|
+
if ("published" === storageEntry.status) await this.removePublished.execute({
|
|
31
|
+
model: storageModel,
|
|
32
|
+
entryId: storageEntry.entryId
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const PgOsDeleteEntryRevision = DeleteEntryRevisionStorageOperation.createDecorator({
|
|
37
|
+
decorator: PgOsDeleteEntryRevisionImpl,
|
|
38
|
+
dependencies: [
|
|
39
|
+
SyncHelpers,
|
|
40
|
+
WriteLatest,
|
|
41
|
+
RemoveLatest,
|
|
42
|
+
RemovePublished,
|
|
43
|
+
CmsStorageModelProvider
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
export { PgOsDeleteEntryRevision };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=PgOsDeleteEntryRevision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsDeleteEntryRevision.js","sources":["../../../src/operations/entry/PgOsDeleteEntryRevision.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsDeleteRevisionParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { DeleteEntryRevisionStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteEntryRevisionStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { WriteLatest } from \"~/features/SyncWriter/abstractions/WriteLatest.js\";\nimport { RemoveLatest } from \"~/features/SyncWriter/abstractions/RemoveLatest.js\";\nimport { RemovePublished } from \"~/features/SyncWriter/abstractions/RemovePublished.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsDeleteEntryRevisionImpl implements DeleteEntryRevisionStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private writeLatest: WriteLatest.Interface,\n private removeLatest: RemoveLatest.Interface,\n private removePublished: RemovePublished.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: DeleteEntryRevisionStorageOperation.Interface\n ) {}\n\n async execute<T extends CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryStorageOperationsDeleteRevisionParams<T>\n ) {\n await this.syncHelpers.ensureSyncTable();\n await this.inner.execute(model, params);\n const storageModel = this.storageModelProvider.getModel<T>(model);\n\n const { latestStorageEntry, storageEntry } = params;\n if (latestStorageEntry) {\n await this.writeLatest.execute({\n model: storageModel,\n entry: latestStorageEntry,\n storageEntry: latestStorageEntry\n });\n } else {\n await this.removeLatest.execute({\n model: storageModel,\n entryId: storageEntry.entryId\n });\n }\n\n if (storageEntry.status === \"published\") {\n await this.removePublished.execute({\n model: storageModel,\n entryId: storageEntry.entryId\n });\n }\n }\n}\n\nexport const PgOsDeleteEntryRevision = DeleteEntryRevisionStorageOperation.createDecorator({\n decorator: PgOsDeleteEntryRevisionImpl,\n dependencies: [SyncHelpers, WriteLatest, RemoveLatest, RemovePublished, CmsStorageModelProvider]\n});\n"],"names":["PgOsDeleteEntryRevisionImpl","syncHelpers","writeLatest","removeLatest","removePublished","storageModelProvider","inner","model","params","storageModel","latestStorageEntry","storageEntry","PgOsDeleteEntryRevision","DeleteEntryRevisionStorageOperation","SyncHelpers","WriteLatest","RemoveLatest","RemovePublished","CmsStorageModelProvider"],"mappings":";;;;;;AAYA,MAAMA;IACF,YACYC,WAAkC,EAClCC,WAAkC,EAClCC,YAAoC,EACpCC,eAA0C,EAC1CC,oBAAuD,EACvDC,KAAoD,CAC9D;aANUL,WAAW,GAAXA;aACAC,WAAW,GAAXA;aACAC,YAAY,GAAZA;aACAC,eAAe,GAAfA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QACFC,KAAe,EACfC,MAAwD,EAC1D;QACE,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACD,OAAOC;QAChC,MAAMC,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAE3D,MAAM,EAAEG,kBAAkB,EAAEC,YAAY,EAAE,GAAGH;QAC7C,IAAIE,oBACA,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC3B,OAAOD;YACP,OAAOC;YACP,cAAcA;QAClB;aAEA,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;YAC5B,OAAOD;YACP,SAASE,aAAa,OAAO;QACjC;QAGJ,IAAIA,AAAwB,gBAAxBA,aAAa,MAAM,EACnB,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;YAC/B,OAAOF;YACP,SAASE,aAAa,OAAO;QACjC;IAER;AACJ;AAEO,MAAMC,0BAA0BC,oCAAoC,eAAe,CAAC;IACvF,WAAWb;IACX,cAAc;QAACc;QAAaC;QAAaC;QAAcC;QAAiBC;KAAwB;AACpG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryStorageOperationsDeleteEntriesParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { DeleteMultipleEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { RemoveEntry } from "../../features/SyncWriter/abstractions/RemoveEntry.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
declare class PgOsDeleteMultipleEntriesImpl implements DeleteMultipleEntriesStorageOperation.Interface {
|
|
7
|
+
private syncHelpers;
|
|
8
|
+
private removeEntry;
|
|
9
|
+
private storageModelProvider;
|
|
10
|
+
private inner;
|
|
11
|
+
constructor(syncHelpers: SyncHelpers.Interface, removeEntry: RemoveEntry.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: DeleteMultipleEntriesStorageOperation.Interface);
|
|
12
|
+
execute(model: CmsModel, params: CmsEntryStorageOperationsDeleteEntriesParams): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const PgOsDeleteMultipleEntries: typeof PgOsDeleteMultipleEntriesImpl & {
|
|
15
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js").IDeleteMultipleEntriesStorageOperation>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DeleteMultipleEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js";
|
|
2
|
+
import { parseIdentifier } from "@webiny/utils";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { RemoveEntry } from "../../features/SyncWriter/abstractions/RemoveEntry.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
class PgOsDeleteMultipleEntriesImpl {
|
|
7
|
+
constructor(syncHelpers, removeEntry, storageModelProvider, inner){
|
|
8
|
+
this.syncHelpers = syncHelpers;
|
|
9
|
+
this.removeEntry = removeEntry;
|
|
10
|
+
this.storageModelProvider = storageModelProvider;
|
|
11
|
+
this.inner = inner;
|
|
12
|
+
}
|
|
13
|
+
async execute(model, params) {
|
|
14
|
+
await this.syncHelpers.ensureSyncTable();
|
|
15
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
16
|
+
await this.inner.execute(model, params);
|
|
17
|
+
for (const id of params.entries){
|
|
18
|
+
const { id: entryId } = parseIdentifier(id);
|
|
19
|
+
await this.removeEntry.execute({
|
|
20
|
+
model: storageModel,
|
|
21
|
+
entryId
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const PgOsDeleteMultipleEntries = DeleteMultipleEntriesStorageOperation.createDecorator({
|
|
27
|
+
decorator: PgOsDeleteMultipleEntriesImpl,
|
|
28
|
+
dependencies: [
|
|
29
|
+
SyncHelpers,
|
|
30
|
+
RemoveEntry,
|
|
31
|
+
CmsStorageModelProvider
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
export { PgOsDeleteMultipleEntries };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=PgOsDeleteMultipleEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsDeleteMultipleEntries.js","sources":["../../../src/operations/entry/PgOsDeleteMultipleEntries.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryStorageOperationsDeleteEntriesParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { DeleteMultipleEntriesStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/DeleteMultipleEntriesStorageOperation.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { RemoveEntry } from \"~/features/SyncWriter/abstractions/RemoveEntry.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsDeleteMultipleEntriesImpl implements DeleteMultipleEntriesStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private removeEntry: RemoveEntry.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: DeleteMultipleEntriesStorageOperation.Interface\n ) {}\n\n async execute(model: CmsModel, params: CmsEntryStorageOperationsDeleteEntriesParams) {\n await this.syncHelpers.ensureSyncTable();\n const storageModel = this.storageModelProvider.getModel(model);\n await this.inner.execute(model, params);\n\n for (const id of params.entries) {\n const { id: entryId } = parseIdentifier(id);\n await this.removeEntry.execute({ model: storageModel, entryId });\n }\n }\n}\n\nexport const PgOsDeleteMultipleEntries = DeleteMultipleEntriesStorageOperation.createDecorator({\n decorator: PgOsDeleteMultipleEntriesImpl,\n dependencies: [SyncHelpers, RemoveEntry, CmsStorageModelProvider]\n});\n"],"names":["PgOsDeleteMultipleEntriesImpl","syncHelpers","removeEntry","storageModelProvider","inner","model","params","storageModel","id","entryId","parseIdentifier","PgOsDeleteMultipleEntries","DeleteMultipleEntriesStorageOperation","SyncHelpers","RemoveEntry","CmsStorageModelProvider"],"mappings":";;;;;AAUA,MAAMA;IACF,YACYC,WAAkC,EAClCC,WAAkC,EAClCC,oBAAuD,EACvDC,KAAsD,CAChE;aAJUH,WAAW,GAAXA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAEC,MAAoD,EAAE;QACjF,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAMC,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QACxD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACA,OAAOC;QAEhC,KAAK,MAAME,MAAMF,OAAO,OAAO,CAAE;YAC7B,MAAM,EAAE,IAAIG,OAAO,EAAE,GAAGC,gBAAgBF;YACxC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;gBAAE,OAAOD;gBAAcE;YAAQ;QAClE;IACJ;AACJ;AAEO,MAAME,4BAA4BC,sCAAsC,eAAe,CAAC;IAC3F,WAAWZ;IACX,cAAc;QAACa;QAAaC;QAAaC;KAAwB;AACrE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsGetParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { GetEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js";
|
|
3
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
4
|
+
declare class PgOsGetEntryImpl implements GetEntryStorageOperation.Interface {
|
|
5
|
+
private ops;
|
|
6
|
+
constructor(ops: EntrySearchOperations.Interface);
|
|
7
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsGetParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsEntry<T> | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare const PgOsGetEntry: typeof PgOsGetEntryImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js").IGetEntryStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GetEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js";
|
|
2
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
3
|
+
class PgOsGetEntryImpl {
|
|
4
|
+
constructor(ops){
|
|
5
|
+
this.ops = ops;
|
|
6
|
+
}
|
|
7
|
+
async execute(model, params) {
|
|
8
|
+
return this.ops.get(model, params);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const PgOsGetEntry = GetEntryStorageOperation.createImplementation({
|
|
12
|
+
implementation: PgOsGetEntryImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
EntrySearchOperations
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { PgOsGetEntry };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=PgOsGetEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsGetEntry.js","sources":["../../../src/operations/entry/PgOsGetEntry.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsGetParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetEntryStorageOperation.js\";\nimport { EntrySearchOperations } from \"./abstractions/EntrySearchOperations.js\";\n\nclass PgOsGetEntryImpl implements GetEntryStorageOperation.Interface {\n constructor(private ops: EntrySearchOperations.Interface) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryStorageOperationsGetParams\n ) {\n return this.ops.get<T>(model, params);\n }\n}\n\nexport const PgOsGetEntry = GetEntryStorageOperation.createImplementation({\n implementation: PgOsGetEntryImpl,\n dependencies: [EntrySearchOperations]\n});\n"],"names":["PgOsGetEntryImpl","ops","model","params","PgOsGetEntry","GetEntryStorageOperation","EntrySearchOperations"],"mappings":";;AAQA,MAAMA;IACF,YAAoBC,GAAoC,CAAE;aAAtCA,GAAG,GAAHA;IAAuC;IAE3D,MAAM,QACFC,KAAe,EACfC,MAA0C,EAC5C;QACE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAID,OAAOC;IAClC;AACJ;AAEO,MAAMC,eAAeC,yBAAyB,oBAAoB,CAAC;IACtE,gBAAgBL;IAChB,cAAc;QAACM;KAAsB;AACzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryStorageOperationsGetUniqueFieldValuesParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { GetUniqueFieldValuesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js";
|
|
3
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
4
|
+
declare class PgOsGetUniqueFieldValuesImpl implements GetUniqueFieldValuesStorageOperation.Interface {
|
|
5
|
+
private ops;
|
|
6
|
+
constructor(ops: EntrySearchOperations.Interface);
|
|
7
|
+
execute(model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsEntryUniqueValue[]>;
|
|
8
|
+
}
|
|
9
|
+
export declare const PgOsGetUniqueFieldValues: typeof PgOsGetUniqueFieldValuesImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js").IGetUniqueFieldValuesStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GetUniqueFieldValuesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js";
|
|
2
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
3
|
+
class PgOsGetUniqueFieldValuesImpl {
|
|
4
|
+
constructor(ops){
|
|
5
|
+
this.ops = ops;
|
|
6
|
+
}
|
|
7
|
+
async execute(model, params) {
|
|
8
|
+
return this.ops.getUniqueFieldValues(model, params);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const PgOsGetUniqueFieldValues = GetUniqueFieldValuesStorageOperation.createImplementation({
|
|
12
|
+
implementation: PgOsGetUniqueFieldValuesImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
EntrySearchOperations
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { PgOsGetUniqueFieldValues };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=PgOsGetUniqueFieldValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsGetUniqueFieldValues.js","sources":["../../../src/operations/entry/PgOsGetUniqueFieldValues.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryStorageOperationsGetUniqueFieldValuesParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { GetUniqueFieldValuesStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/GetUniqueFieldValuesStorageOperation.js\";\nimport { EntrySearchOperations } from \"./abstractions/EntrySearchOperations.js\";\n\nclass PgOsGetUniqueFieldValuesImpl implements GetUniqueFieldValuesStorageOperation.Interface {\n constructor(private ops: EntrySearchOperations.Interface) {}\n\n async execute(model: CmsModel, params: CmsEntryStorageOperationsGetUniqueFieldValuesParams) {\n return this.ops.getUniqueFieldValues(model, params);\n }\n}\n\nexport const PgOsGetUniqueFieldValues = GetUniqueFieldValuesStorageOperation.createImplementation({\n implementation: PgOsGetUniqueFieldValuesImpl,\n dependencies: [EntrySearchOperations]\n});\n"],"names":["PgOsGetUniqueFieldValuesImpl","ops","model","params","PgOsGetUniqueFieldValues","GetUniqueFieldValuesStorageOperation","EntrySearchOperations"],"mappings":";;AAOA,MAAMA;IACF,YAAoBC,GAAoC,CAAE;aAAtCA,GAAG,GAAHA;IAAuC;IAE3D,MAAM,QAAQC,KAAe,EAAEC,MAA2D,EAAE;QACxF,OAAO,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAACD,OAAOC;IAChD;AACJ;AAEO,MAAMC,2BAA2BC,qCAAqC,oBAAoB,CAAC;IAC9F,gBAAgBL;IAChB,cAAc;QAACM;KAAsB;AACzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsListParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { ListEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js";
|
|
3
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
4
|
+
declare class PgOsListEntriesImpl implements ListEntriesStorageOperation.Interface {
|
|
5
|
+
private ops;
|
|
6
|
+
constructor(ops: EntrySearchOperations.Interface);
|
|
7
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsListParams): Promise<import("@webiny/api-headless-cms/types/types.js").CmsEntryStorageOperationsListResponse<import("@webiny/api-headless-cms/types/types.js").CmsEntry<T>>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const PgOsListEntries: typeof PgOsListEntriesImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js").IListEntriesStorageOperation>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ListEntriesStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js";
|
|
2
|
+
import { EntrySearchOperations } from "./abstractions/EntrySearchOperations.js";
|
|
3
|
+
class PgOsListEntriesImpl {
|
|
4
|
+
constructor(ops){
|
|
5
|
+
this.ops = ops;
|
|
6
|
+
}
|
|
7
|
+
async execute(model, params) {
|
|
8
|
+
return this.ops.list(model, params);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const PgOsListEntries = ListEntriesStorageOperation.createImplementation({
|
|
12
|
+
implementation: PgOsListEntriesImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
EntrySearchOperations
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { PgOsListEntries };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=PgOsListEntries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsListEntries.js","sources":["../../../src/operations/entry/PgOsListEntries.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsListParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { ListEntriesStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/ListEntriesStorageOperation.js\";\nimport { EntrySearchOperations } from \"./abstractions/EntrySearchOperations.js\";\n\nclass PgOsListEntriesImpl implements ListEntriesStorageOperation.Interface {\n constructor(private ops: EntrySearchOperations.Interface) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n model: CmsModel,\n params: CmsEntryStorageOperationsListParams\n ) {\n return this.ops.list<T>(model, params);\n }\n}\n\nexport const PgOsListEntries = ListEntriesStorageOperation.createImplementation({\n implementation: PgOsListEntriesImpl,\n dependencies: [EntrySearchOperations]\n});\n"],"names":["PgOsListEntriesImpl","ops","model","params","PgOsListEntries","ListEntriesStorageOperation","EntrySearchOperations"],"mappings":";;AAQA,MAAMA;IACF,YAAoBC,GAAoC,CAAE;aAAtCA,GAAG,GAAHA;IAAuC;IAE3D,MAAM,QACFC,KAAe,EACfC,MAA2C,EAC7C;QACE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAID,OAAOC;IACnC;AACJ;AAEO,MAAMC,kBAAkBC,4BAA4B,oBAAoB,CAAC;IAC5E,gBAAgBL;IAChB,cAAc;QAACM;KAAsB;AACzC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { MoveEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveEntryStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
5
|
+
declare class PgOsMoveEntryImpl implements MoveEntryStorageOperation.Interface {
|
|
6
|
+
private syncHelpers;
|
|
7
|
+
private storageModelProvider;
|
|
8
|
+
private inner;
|
|
9
|
+
constructor(syncHelpers: SyncHelpers.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: MoveEntryStorageOperation.Interface);
|
|
10
|
+
execute(model: CmsModel, id: string, folderId: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const PgOsMoveEntry: typeof PgOsMoveEntryImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveEntryStorageOperation.js").IMoveEntryStorageOperation>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MoveEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveEntryStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
4
|
+
class PgOsMoveEntryImpl {
|
|
5
|
+
constructor(syncHelpers, storageModelProvider, inner){
|
|
6
|
+
this.syncHelpers = syncHelpers;
|
|
7
|
+
this.storageModelProvider = storageModelProvider;
|
|
8
|
+
this.inner = inner;
|
|
9
|
+
}
|
|
10
|
+
async execute(model, id, folderId) {
|
|
11
|
+
await this.syncHelpers.ensureSyncTable();
|
|
12
|
+
await this.inner.execute(model, id, folderId);
|
|
13
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
14
|
+
await this.syncHelpers.resyncLatestAndPublishedFromPg(model, storageModel, id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const PgOsMoveEntry = MoveEntryStorageOperation.createDecorator({
|
|
18
|
+
decorator: PgOsMoveEntryImpl,
|
|
19
|
+
dependencies: [
|
|
20
|
+
SyncHelpers,
|
|
21
|
+
CmsStorageModelProvider
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export { PgOsMoveEntry };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=PgOsMoveEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsMoveEntry.js","sources":["../../../src/operations/entry/PgOsMoveEntry.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport { MoveEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveEntryStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsMoveEntryImpl implements MoveEntryStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: MoveEntryStorageOperation.Interface\n ) {}\n\n async execute(model: CmsModel, id: string, folderId: string) {\n await this.syncHelpers.ensureSyncTable();\n await this.inner.execute(model, id, folderId);\n const storageModel = this.storageModelProvider.getModel(model);\n await this.syncHelpers.resyncLatestAndPublishedFromPg(model, storageModel, id);\n }\n}\n\nexport const PgOsMoveEntry = MoveEntryStorageOperation.createDecorator({\n decorator: PgOsMoveEntryImpl,\n dependencies: [SyncHelpers, CmsStorageModelProvider]\n});\n"],"names":["PgOsMoveEntryImpl","syncHelpers","storageModelProvider","inner","model","id","folderId","storageModel","PgOsMoveEntry","MoveEntryStorageOperation","SyncHelpers","CmsStorageModelProvider"],"mappings":";;;AAKA,MAAMA;IACF,YACYC,WAAkC,EAClCC,oBAAuD,EACvDC,KAA0C,CACpD;aAHUF,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAEC,EAAU,EAAEC,QAAgB,EAAE;QACzD,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACF,OAAOC,IAAIC;QACpC,MAAMC,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACH;QACxD,MAAM,IAAI,CAAC,WAAW,CAAC,8BAA8B,CAACA,OAAOG,cAAcF;IAC/E;AACJ;AAEO,MAAMG,gBAAgBC,0BAA0B,eAAe,CAAC;IACnE,WAAWT;IACX,cAAc;QAACU;QAAaC;KAAwB;AACxD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryStorageOperationsMoveToBinParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { MoveToBinStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveToBinStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
5
|
+
declare class PgOsMoveToBinImpl implements MoveToBinStorageOperation.Interface {
|
|
6
|
+
private syncHelpers;
|
|
7
|
+
private storageModelProvider;
|
|
8
|
+
private inner;
|
|
9
|
+
constructor(syncHelpers: SyncHelpers.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: MoveToBinStorageOperation.Interface);
|
|
10
|
+
execute(model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const PgOsMoveToBin: typeof PgOsMoveToBinImpl & {
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveToBinStorageOperation.js").IMoveToBinStorageOperation>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MoveToBinStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveToBinStorageOperation.js";
|
|
2
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
3
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
4
|
+
class PgOsMoveToBinImpl {
|
|
5
|
+
constructor(syncHelpers, storageModelProvider, inner){
|
|
6
|
+
this.syncHelpers = syncHelpers;
|
|
7
|
+
this.storageModelProvider = storageModelProvider;
|
|
8
|
+
this.inner = inner;
|
|
9
|
+
}
|
|
10
|
+
async execute(model, params) {
|
|
11
|
+
await this.syncHelpers.ensureSyncTable();
|
|
12
|
+
await this.inner.execute(model, params);
|
|
13
|
+
const storageModel = this.storageModelProvider.getModel(model);
|
|
14
|
+
await this.syncHelpers.resyncLatestAndPublishedFromPg(model, storageModel, params.entry.id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const PgOsMoveToBin = MoveToBinStorageOperation.createDecorator({
|
|
18
|
+
decorator: PgOsMoveToBinImpl,
|
|
19
|
+
dependencies: [
|
|
20
|
+
SyncHelpers,
|
|
21
|
+
CmsStorageModelProvider
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export { PgOsMoveToBin };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=PgOsMoveToBin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/PgOsMoveToBin.js","sources":["../../../src/operations/entry/PgOsMoveToBin.ts"],"sourcesContent":["import type {\n CmsModel,\n CmsEntryStorageOperationsMoveToBinParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { MoveToBinStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/MoveToBinStorageOperation.js\";\nimport { SyncHelpers } from \"~/features/SyncWriter/abstractions/SyncHelpers.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\n\nclass PgOsMoveToBinImpl implements MoveToBinStorageOperation.Interface {\n constructor(\n private syncHelpers: SyncHelpers.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private inner: MoveToBinStorageOperation.Interface\n ) {}\n\n async execute(model: CmsModel, params: CmsEntryStorageOperationsMoveToBinParams) {\n await this.syncHelpers.ensureSyncTable();\n await this.inner.execute(model, params);\n const storageModel = this.storageModelProvider.getModel(model);\n await this.syncHelpers.resyncLatestAndPublishedFromPg(model, storageModel, params.entry.id);\n }\n}\n\nexport const PgOsMoveToBin = MoveToBinStorageOperation.createDecorator({\n decorator: PgOsMoveToBinImpl,\n dependencies: [SyncHelpers, CmsStorageModelProvider]\n});\n"],"names":["PgOsMoveToBinImpl","syncHelpers","storageModelProvider","inner","model","params","storageModel","PgOsMoveToBin","MoveToBinStorageOperation","SyncHelpers","CmsStorageModelProvider"],"mappings":";;;AAQA,MAAMA;IACF,YACYC,WAAkC,EAClCC,oBAAuD,EACvDC,KAA0C,CACpD;aAHUF,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,KAAK,GAALA;IACT;IAEH,MAAM,QAAQC,KAAe,EAAEC,MAAgD,EAAE;QAC7E,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe;QACtC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAACD,OAAOC;QAChC,MAAMC,eAAe,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QACxD,MAAM,IAAI,CAAC,WAAW,CAAC,8BAA8B,CAACA,OAAOE,cAAcD,OAAO,KAAK,CAAC,EAAE;IAC9F;AACJ;AAEO,MAAME,gBAAgBC,0BAA0B,eAAe,CAAC;IACnE,WAAWR;IACX,cAAc;QAACS;QAAaC;KAAwB;AACxD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsPublishParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { PublishEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/PublishEntryStorageOperation.js";
|
|
3
|
+
import { SyncHelpers } from "../../features/SyncWriter/abstractions/SyncHelpers.js";
|
|
4
|
+
import { WriteEntry } from "../../features/SyncWriter/abstractions/WriteEntry.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
declare class PgOsPublishEntryImpl implements PublishEntryStorageOperation.Interface {
|
|
7
|
+
private syncHelpers;
|
|
8
|
+
private writeEntry;
|
|
9
|
+
private storageModelProvider;
|
|
10
|
+
private inner;
|
|
11
|
+
constructor(syncHelpers: SyncHelpers.Interface, writeEntry: WriteEntry.Interface, storageModelProvider: CmsStorageModelProvider.Interface, inner: PublishEntryStorageOperation.Interface);
|
|
12
|
+
execute<T extends CmsEntryValues>(model: CmsModel, params: CmsEntryStorageOperationsPublishParams<T>): Promise<import("@webiny/api-headless-cms/types/types").CmsEntry<T>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const PgOsPublishEntry: typeof PgOsPublishEntryImpl & {
|
|
15
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/PublishEntryStorageOperation.js").IPublishEntryStorageOperation>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|