@webiny/api-headless-cms-ddb 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.e9333b3f0b
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/abstractions/CmsDdbDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbDataLoaders.js +5 -0
- package/abstractions/CmsDdbDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEntryEntity.js +5 -0
- package/abstractions/CmsDdbEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbGroupEntity.js +5 -0
- package/abstractions/CmsDdbGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbModelEntity.js +5 -0
- package/abstractions/CmsDdbModelEntity.js.map +1 -0
- package/abstractions/CmsDdbTable.d.ts +5 -0
- package/abstractions/CmsDdbTable.js +5 -0
- package/abstractions/CmsDdbTable.js.map +1 -0
- package/definitions/entry.js +7 -9
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +7 -9
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +7 -9
- package/definitions/model.js.map +1 -1
- package/definitions/table.js +6 -7
- package/definitions/table.js.map +1 -1
- package/definitions/types.d.ts +4 -0
- package/definitions/types.js +0 -3
- package/index.d.ts +17 -2
- package/index.js +31 -88
- package/index.js.map +1 -1
- package/operations/entry/DdbCreateEntry.d.ts +16 -0
- package/operations/entry/DdbCreateEntry.js +77 -0
- package/operations/entry/DdbCreateEntry.js.map +1 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.d.ts +16 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.js +85 -0
- package/operations/entry/DdbCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbDeleteEntry.d.ts +16 -0
- package/operations/entry/DdbDeleteEntry.js +65 -0
- package/operations/entry/DdbDeleteEntry.js.map +1 -0
- package/operations/entry/DdbDeleteEntryRevision.d.ts +17 -0
- package/operations/entry/DdbDeleteEntryRevision.js +91 -0
- package/operations/entry/DdbDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbDeleteMultipleEntries.d.ts +16 -0
- package/operations/entry/DdbDeleteMultipleEntries.js +59 -0
- package/operations/entry/DdbDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetEntriesByIds.js +31 -0
- package/operations/entry/DdbGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetEntry.d.ts +14 -0
- package/operations/entry/DdbGetEntry.js +27 -0
- package/operations/entry/DdbGetEntry.js.map +1 -0
- package/operations/entry/DdbGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.js +35 -0
- package/operations/entry/DdbGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbGetPreviousRevision.js +53 -0
- package/operations/entry/DdbGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js +35 -0
- package/operations/entry/DdbGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbGetRevisionById.js +34 -0
- package/operations/entry/DdbGetRevisionById.js.map +1 -0
- package/operations/entry/DdbGetRevisions.d.ts +14 -0
- package/operations/entry/DdbGetRevisions.js +33 -0
- package/operations/entry/DdbGetRevisions.js.map +1 -0
- package/operations/entry/DdbGetUniqueFieldValues.d.ts +12 -0
- package/operations/entry/DdbGetUniqueFieldValues.js +31 -0
- package/operations/entry/DdbGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbListEntries.d.ts +28 -0
- package/operations/entry/DdbListEntries.js +124 -0
- package/operations/entry/DdbListEntries.js.map +1 -0
- package/operations/entry/DdbMoveEntry.d.ts +14 -0
- package/operations/entry/DdbMoveEntry.js +57 -0
- package/operations/entry/DdbMoveEntry.js.map +1 -0
- package/operations/entry/DdbMoveToBin.d.ts +16 -0
- package/operations/entry/DdbMoveToBin.js +77 -0
- package/operations/entry/DdbMoveToBin.js.map +1 -0
- package/operations/entry/DdbPublishEntry.d.ts +18 -0
- package/operations/entry/DdbPublishEntry.js +162 -0
- package/operations/entry/DdbPublishEntry.js.map +1 -0
- package/operations/entry/DdbRestoreFromBin.d.ts +16 -0
- package/operations/entry/DdbRestoreFromBin.js +78 -0
- package/operations/entry/DdbRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbUnpublishEntry.d.ts +17 -0
- package/operations/entry/DdbUnpublishEntry.js +112 -0
- package/operations/entry/DdbUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbUpdateEntry.d.ts +17 -0
- package/operations/entry/DdbUpdateEntry.js +105 -0
- package/operations/entry/DdbUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +22 -26
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -29
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +31 -41
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +31 -41
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js +33 -47
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js +8 -9
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.js +0 -3
- package/operations/entry/dataLoaders.d.ts +7 -6
- package/operations/entry/dataLoaders.js +89 -99
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +53 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +6 -0
- package/operations/entry/keys.js +57 -77
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/storageEntryUtils.d.ts +8 -0
- package/operations/entry/storageEntryUtils.js +25 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/group/DdbCreateGroup.d.ts +12 -0
- package/operations/group/DdbCreateGroup.js +35 -0
- package/operations/group/DdbCreateGroup.js.map +1 -0
- package/operations/group/DdbDeleteGroup.d.ts +12 -0
- package/operations/group/DdbDeleteGroup.js +31 -0
- package/operations/group/DdbDeleteGroup.js.map +1 -0
- package/operations/group/DdbGetGroup.d.ts +12 -0
- package/operations/group/DdbGetGroup.js +31 -0
- package/operations/group/DdbGetGroup.js.map +1 -0
- package/operations/group/DdbListGroups.d.ts +14 -0
- package/operations/group/DdbListGroups.js +52 -0
- package/operations/group/DdbListGroups.js.map +1 -0
- package/operations/group/DdbUpdateGroup.d.ts +12 -0
- package/operations/group/DdbUpdateGroup.js +35 -0
- package/operations/group/DdbUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbCreateModel.d.ts +12 -0
- package/operations/model/DdbCreateModel.js +37 -0
- package/operations/model/DdbCreateModel.js.map +1 -0
- package/operations/model/DdbDeleteModel.d.ts +12 -0
- package/operations/model/DdbDeleteModel.js +31 -0
- package/operations/model/DdbDeleteModel.js.map +1 -0
- package/operations/model/DdbGetModel.d.ts +12 -0
- package/operations/model/DdbGetModel.js +30 -0
- package/operations/model/DdbGetModel.js.map +1 -0
- package/operations/model/DdbListModels.d.ts +12 -0
- package/operations/model/DdbListModels.js +36 -0
- package/operations/model/DdbListModels.js.map +1 -0
- package/operations/model/DdbUpdateModel.d.ts +12 -0
- package/operations/model/DdbUpdateModel.js +36 -0
- package/operations/model/DdbUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +16 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +22 -24
- package/requestFeature.d.ts +17 -0
- package/requestFeature.js +19 -0
- package/requestFeature.js.map +1 -0
- package/types.d.ts +10 -50
- package/types.js +6 -5
- package/types.js.map +1 -1
- package/definitions/types.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -6
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/path/locationFolderId.d.ts +0 -2
- package/dynamoDb/path/locationFolderId.js +0 -34
- package/dynamoDb/path/locationFolderId.js.map +0 -1
- package/dynamoDb/path/plainObject.d.ts +0 -2
- package/dynamoDb/path/plainObject.js +0 -26
- package/dynamoDb/path/plainObject.js.map +0 -1
- package/dynamoDb/transformValue/datetime.d.ts +0 -5
- package/dynamoDb/transformValue/datetime.js +0 -40
- package/dynamoDb/transformValue/datetime.js.map +0 -1
- package/operations/entry/dataLoader/types.js.map +0 -1
- package/operations/entry/filtering/createExpressions.d.ts +0 -27
- package/operations/entry/filtering/createExpressions.js +0 -172
- package/operations/entry/filtering/createExpressions.js.map +0 -1
- package/operations/entry/filtering/createFields.d.ts +0 -16
- package/operations/entry/filtering/createFields.js +0 -106
- package/operations/entry/filtering/createFields.js.map +0 -1
- package/operations/entry/filtering/extractSort.d.ts +0 -17
- package/operations/entry/filtering/extractSort.js +0 -84
- package/operations/entry/filtering/extractSort.js.map +0 -1
- package/operations/entry/filtering/filter.d.ts +0 -16
- package/operations/entry/filtering/filter.js +0 -153
- package/operations/entry/filtering/filter.js.map +0 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +0 -14
- package/operations/entry/filtering/fullTextSearch.js +0 -42
- package/operations/entry/filtering/fullTextSearch.js.map +0 -1
- package/operations/entry/filtering/getValue.d.ts +0 -5
- package/operations/entry/filtering/getValue.js +0 -59
- package/operations/entry/filtering/getValue.js.map +0 -1
- package/operations/entry/filtering/index.d.ts +0 -2
- package/operations/entry/filtering/index.js +0 -4
- package/operations/entry/filtering/index.js.map +0 -1
- package/operations/entry/filtering/mapPlugins.d.ts +0 -8
- package/operations/entry/filtering/mapPlugins.js +0 -25
- package/operations/entry/filtering/mapPlugins.js.map +0 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -37
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +0 -1
- package/operations/entry/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/filtering/plugins/index.js +0 -9
- package/operations/entry/filtering/plugins/index.js.map +0 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -84
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +0 -1
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +0 -3
- package/operations/entry/filtering/plugins/refFilterCreate.js +0 -74
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +0 -1
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +0 -2
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +0 -62
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +0 -1
- package/operations/entry/filtering/sort.d.ts +0 -12
- package/operations/entry/filtering/sort.js +0 -67
- package/operations/entry/filtering/sort.js.map +0 -1
- package/operations/entry/filtering/systemFields.d.ts +0 -2
- package/operations/entry/filtering/systemFields.js +0 -131
- package/operations/entry/filtering/systemFields.js.map +0 -1
- package/operations/entry/filtering/transform.d.ts +0 -6
- package/operations/entry/filtering/transform.js +0 -11
- package/operations/entry/filtering/transform.js.map +0 -1
- package/operations/entry/filtering/types.d.ts +0 -40
- package/operations/entry/filtering/types.js +0 -3
- package/operations/entry/filtering/types.js.map +0 -1
- package/operations/entry/filtering/values.d.ts +0 -2
- package/operations/entry/filtering/values.js +0 -16
- package/operations/entry/filtering/values.js.map +0 -1
- package/operations/entry/filtering/where.d.ts +0 -5
- package/operations/entry/filtering/where.js +0 -28
- package/operations/entry/filtering/where.js.map +0 -1
- package/operations/entry/index.d.ts +0 -9
- package/operations/entry/index.js +0 -1197
- package/operations/entry/index.js.map +0 -1
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -142
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -7
- package/operations/model/index.js +0 -127
- package/operations/model/index.js.map +0 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +0 -23
- package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -40
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +0 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +0 -43
- package/plugins/CmsEntryFieldFilterPlugin.js +0 -21
- package/plugins/CmsEntryFieldFilterPlugin.js.map +0 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +0 -42
- package/plugins/CmsEntryFieldSortingPlugin.js +0 -19
- package/plugins/CmsEntryFieldSortingPlugin.js.map +0 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +0 -11
- package/plugins/CmsFieldFilterValueTransformPlugin.js +0 -16
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -4
- package/plugins/index.js +0 -6
- package/plugins/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/DdbUnpublishEntry.js","sources":["../../../src/operations/entry/DdbUnpublishEntry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsUnpublishParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { UnpublishEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/UnpublishEntryStorageOperation.js\";\nimport { CmsDdbEntryEntity } from \"~/abstractions/CmsDdbEntryEntity.js\";\nimport { CmsDdbDataLoaders } from \"~/abstractions/CmsDdbDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport {\n createEntryLatestKeys,\n createEntryRevisionKeys,\n createPartitionKey,\n createPublishedSortKey\n} from \"~/operations/entry/keys.js\";\nimport {\n isEntryLevelEntryMetaField,\n pickEntryMetaFields\n} from \"@webiny/api-headless-cms/constants.js\";\nimport { convertFromStorageEntry, convertToStorageEntry } from \"./storageEntryUtils.js\";\n\nclass DdbUnpublishEntryImpl implements UnpublishEntryStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEntryEntity.Interface,\n private dataLoaders: CmsDdbDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n private async getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: { id: string }\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const items = await this.dataLoaders.getLatestRevisionByEntryId<T>({\n model,\n ids: [params.id]\n });\n const item = items.shift() || null;\n if (!item) {\n return null;\n }\n return convertFromStorageEntry({\n storageEntry: item,\n model\n });\n }\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsUnpublishParams<T>\n ) {\n const { entry, storageEntry: initialStorageEntry } = params;\n const model = this.storageModelProvider.getModel(initialModel);\n\n const partitionKey = createPartitionKey({\n id: entry.id,\n tenant: model.tenant\n });\n\n const storageEntry = convertToStorageEntry({\n storageEntry: initialStorageEntry,\n model\n });\n /**\n * We need to:\n * - delete currently published entry\n * - update current entry revision with new data\n * - update the latest entry status - if entry being unpublished is latest\n */\n const entityBatch = this.entity.createEntityWriter({\n delete: [\n {\n PK: partitionKey,\n SK: createPublishedSortKey()\n }\n ],\n put: [\n {\n ...createEntryRevisionKeys(storageEntry),\n data: {\n ...storageEntry\n }\n }\n ]\n });\n\n /**\n * We need the latest entry to see if something needs to be updated alongside the unpublishing one.\n */\n const initialLatestStorageEntry = await this.getLatestRevisionByEntryId(model, entry);\n\n if (initialLatestStorageEntry) {\n const unpublishingLatestRevision = entry.id === initialLatestStorageEntry.id;\n if (unpublishingLatestRevision) {\n entityBatch.put({\n ...createEntryLatestKeys(storageEntry),\n data: {\n ...storageEntry\n }\n });\n } else {\n const latestStorageEntry = convertToStorageEntry({\n storageEntry: initialLatestStorageEntry,\n model\n });\n\n // If the unpublished revision is not the latest one, we still need to\n // update the latest record with the new values of entry-level meta fields.\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n // 1. Update actual revision record.\n entityBatch.put({\n ...createEntryRevisionKeys(latestStorageEntry),\n data: {\n ...latestStorageEntry,\n ...updatedEntryLevelMetaFields\n }\n });\n\n // 2. Update latest record.\n entityBatch.put({\n ...createEntryLatestKeys(latestStorageEntry),\n data: {\n ...latestStorageEntry,\n ...updatedEntryLevelMetaFields\n }\n });\n }\n }\n\n try {\n await entityBatch.execute();\n this.dataLoaders.clearAll({\n tenant: entry.tenant\n });\n return initialStorageEntry;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not execute unpublish batch.\",\n ex.code || \"UNPUBLISH_ERROR\",\n {\n entry,\n storageEntry\n }\n );\n }\n }\n}\n\nexport const DdbUnpublishEntry = UnpublishEntryStorageOperation.createImplementation({\n implementation: DdbUnpublishEntryImpl,\n dependencies: [CmsDdbEntryEntity, CmsDdbDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbUnpublishEntryImpl","entity","dataLoaders","storageModelProvider","initialModel","params","model","items","item","convertFromStorageEntry","entry","initialStorageEntry","partitionKey","createPartitionKey","storageEntry","convertToStorageEntry","entityBatch","createPublishedSortKey","createEntryRevisionKeys","initialLatestStorageEntry","unpublishingLatestRevision","createEntryLatestKeys","latestStorageEntry","updatedEntryLevelMetaFields","pickEntryMetaFields","isEntryLevelEntryMetaField","ex","WebinyError","DdbUnpublishEntry","UnpublishEntryStorageOperation","CmsDdbEntryEntity","CmsDdbDataLoaders","CmsStorageModelProvider"],"mappings":";;;;;;;;AAsBA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAwC,EACxCC,oBAAuD,CACjE;aAHUF,MAAM,GAANA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAc,2BACVC,YAAsB,EACtBC,MAAsB,EACxB;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAI;YAC/DD;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QACA,MAAMG,OAAOD,MAAM,KAAK,MAAM;QAC9B,IAAI,CAACC,MACD,OAAO;QAEX,OAAOC,wBAAwB;YAC3B,cAAcD;YACdF;QACJ;IACJ;IAEA,MAAM,QACFF,YAAsB,EACtBC,MAAmD,EACrD;QACE,MAAM,EAAEK,KAAK,EAAE,cAAcC,mBAAmB,EAAE,GAAGN;QACrD,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QAEjD,MAAMQ,eAAeC,mBAAmB;YACpC,IAAIH,MAAM,EAAE;YACZ,QAAQJ,MAAM,MAAM;QACxB;QAEA,MAAMQ,eAAeC,sBAAsB;YACvC,cAAcJ;YACdL;QACJ;QAOA,MAAMU,cAAc,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC/C,QAAQ;gBACJ;oBACI,IAAIJ;oBACJ,IAAIK;gBACR;aACH;YACD,KAAK;gBACD;oBACI,GAAGC,wBAAwBJ,aAAa;oBACxC,MAAM;wBACF,GAAGA,YAAY;oBACnB;gBACJ;aACH;QACL;QAKA,MAAMK,4BAA4B,MAAM,IAAI,CAAC,0BAA0B,CAACb,OAAOI;QAE/E,IAAIS,2BAA2B;YAC3B,MAAMC,6BAA6BV,MAAM,EAAE,KAAKS,0BAA0B,EAAE;YAC5E,IAAIC,4BACAJ,YAAY,GAAG,CAAC;gBACZ,GAAGK,sBAAsBP,aAAa;gBACtC,MAAM;oBACF,GAAGA,YAAY;gBACnB;YACJ;iBACG;gBACH,MAAMQ,qBAAqBP,sBAAsB;oBAC7C,cAAcI;oBACdb;gBACJ;gBAIA,MAAMiB,8BAA8BC,oBAChCd,OACAe;gBAIJT,YAAY,GAAG,CAAC;oBACZ,GAAGE,wBAAwBI,mBAAmB;oBAC9C,MAAM;wBACF,GAAGA,kBAAkB;wBACrB,GAAGC,2BAA2B;oBAClC;gBACJ;gBAGAP,YAAY,GAAG,CAAC;oBACZ,GAAGK,sBAAsBC,mBAAmB;oBAC5C,MAAM;wBACF,GAAGA,kBAAkB;wBACrB,GAAGC,2BAA2B;oBAClC;gBACJ;YACJ;QACJ;QAEA,IAAI;YACA,MAAMP,YAAY,OAAO;YACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACtB,QAAQN,MAAM,MAAM;YACxB;YACA,OAAOC;QACX,EAAE,OAAOe,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,sCACdA,GAAG,IAAI,IAAI,mBACX;gBACIhB;gBACAI;YACJ;QAER;IACJ;AACJ;AAEO,MAAMc,oBAAoBC,+BAA+B,oBAAoB,CAAC;IACjF,gBAAgB7B;IAChB,cAAc;QAAC8B;QAAmBC;QAAmBC;KAAwB;AACjF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsUpdateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { UpdateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEntryEntity } from "../../abstractions/CmsDdbEntryEntity.js";
|
|
4
|
+
import { CmsDdbDataLoaders } from "../../abstractions/CmsDdbDataLoaders.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
declare class DdbUpdateEntryImpl implements UpdateEntryStorageOperation.Interface {
|
|
7
|
+
private entity;
|
|
8
|
+
private dataLoaders;
|
|
9
|
+
private storageModelProvider;
|
|
10
|
+
constructor(entity: CmsDdbEntryEntity.Interface, dataLoaders: CmsDdbDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
|
|
11
|
+
private getLatestRevisionByEntryId;
|
|
12
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsUpdateParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const DdbUpdateEntry: typeof DdbUpdateEntryImpl & {
|
|
15
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js").IUpdateEntryStorageOperation>;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { UpdateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEntryEntity } from "../../abstractions/CmsDdbEntryEntity.js";
|
|
4
|
+
import { CmsDdbDataLoaders } from "../../abstractions/CmsDdbDataLoaders.js";
|
|
5
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
6
|
+
import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys } from "./keys.js";
|
|
7
|
+
import { isEntryLevelEntryMetaField, pickEntryMetaFields } from "@webiny/api-headless-cms/constants.js";
|
|
8
|
+
import { convertToStorageEntry } from "./storageEntryUtils.js";
|
|
9
|
+
class DdbUpdateEntryImpl {
|
|
10
|
+
constructor(entity, dataLoaders, storageModelProvider){
|
|
11
|
+
this.entity = entity;
|
|
12
|
+
this.dataLoaders = dataLoaders;
|
|
13
|
+
this.storageModelProvider = storageModelProvider;
|
|
14
|
+
}
|
|
15
|
+
async getLatestRevisionByEntryId(initialModel, params) {
|
|
16
|
+
const model = this.storageModelProvider.getModel(initialModel);
|
|
17
|
+
const items = await this.dataLoaders.getLatestRevisionByEntryId({
|
|
18
|
+
model,
|
|
19
|
+
ids: [
|
|
20
|
+
params.id
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
return items.shift() || null;
|
|
24
|
+
}
|
|
25
|
+
async execute(initialModel, params) {
|
|
26
|
+
const { entry, storageEntry: initialStorageEntry } = params;
|
|
27
|
+
const model = this.storageModelProvider.getModel(initialModel);
|
|
28
|
+
const isPublished = "published" === entry.status;
|
|
29
|
+
const locked = isPublished ? true : entry.locked;
|
|
30
|
+
const storageEntry = convertToStorageEntry({
|
|
31
|
+
model,
|
|
32
|
+
storageEntry: initialStorageEntry
|
|
33
|
+
});
|
|
34
|
+
const entityBatch = this.entity.createEntityWriter({
|
|
35
|
+
put: [
|
|
36
|
+
{
|
|
37
|
+
...createEntryRevisionKeys(storageEntry),
|
|
38
|
+
data: {
|
|
39
|
+
...storageEntry,
|
|
40
|
+
locked
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
if (isPublished) entityBatch.put({
|
|
46
|
+
...createEntryPublishedKeys(storageEntry),
|
|
47
|
+
data: {
|
|
48
|
+
...storageEntry,
|
|
49
|
+
locked
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const latestStorageEntry = await this.getLatestRevisionByEntryId(model, entry);
|
|
53
|
+
if (latestStorageEntry) {
|
|
54
|
+
const updatingLatestRevision = latestStorageEntry.id === entry.id;
|
|
55
|
+
if (updatingLatestRevision) entityBatch.put({
|
|
56
|
+
...createEntryLatestKeys(storageEntry),
|
|
57
|
+
data: {
|
|
58
|
+
...storageEntry,
|
|
59
|
+
locked
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
else {
|
|
63
|
+
const updatedEntryLevelMetaFields = pickEntryMetaFields(entry, isEntryLevelEntryMetaField);
|
|
64
|
+
entityBatch.put({
|
|
65
|
+
...createEntryRevisionKeys(latestStorageEntry),
|
|
66
|
+
data: {
|
|
67
|
+
...latestStorageEntry,
|
|
68
|
+
...updatedEntryLevelMetaFields
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
entityBatch.put({
|
|
72
|
+
...createEntryLatestKeys(latestStorageEntry),
|
|
73
|
+
data: {
|
|
74
|
+
...latestStorageEntry,
|
|
75
|
+
...updatedEntryLevelMetaFields
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
await entityBatch.execute();
|
|
82
|
+
this.dataLoaders.clearAll({
|
|
83
|
+
tenant: entry.tenant
|
|
84
|
+
});
|
|
85
|
+
return initialStorageEntry;
|
|
86
|
+
} catch (ex) {
|
|
87
|
+
throw new error(ex.message || "Could not update entry.", ex.code || "UPDATE_ERROR", {
|
|
88
|
+
error: ex,
|
|
89
|
+
entry,
|
|
90
|
+
latestStorageEntry
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const DdbUpdateEntry = UpdateEntryStorageOperation.createImplementation({
|
|
96
|
+
implementation: DdbUpdateEntryImpl,
|
|
97
|
+
dependencies: [
|
|
98
|
+
CmsDdbEntryEntity,
|
|
99
|
+
CmsDdbDataLoaders,
|
|
100
|
+
CmsStorageModelProvider
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
export { DdbUpdateEntry };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=DdbUpdateEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/DdbUpdateEntry.js","sources":["../../../src/operations/entry/DdbUpdateEntry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { UpdateEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/UpdateEntryStorageOperation.js\";\nimport { CmsDdbEntryEntity } from \"~/abstractions/CmsDdbEntryEntity.js\";\nimport { CmsDdbDataLoaders } from \"~/abstractions/CmsDdbDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport {\n createEntryLatestKeys,\n createEntryPublishedKeys,\n createEntryRevisionKeys\n} from \"~/operations/entry/keys.js\";\nimport {\n isEntryLevelEntryMetaField,\n pickEntryMetaFields\n} from \"@webiny/api-headless-cms/constants.js\";\nimport { convertToStorageEntry } from \"./storageEntryUtils.js\";\n\ninterface IGetLatestRevisionByEntryIdParams {\n id: string;\n}\n\nclass DdbUpdateEntryImpl implements UpdateEntryStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEntryEntity.Interface,\n private dataLoaders: CmsDdbDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n private async getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: IGetLatestRevisionByEntryIdParams\n ) {\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const items = await this.dataLoaders.getLatestRevisionByEntryId<T>({\n model,\n ids: [params.id]\n });\n return items.shift() || null;\n }\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsUpdateParams<T>\n ) {\n const { entry, storageEntry: initialStorageEntry } = params;\n const model = this.storageModelProvider.getModel(initialModel);\n\n const isPublished = entry.status === \"published\";\n const locked = isPublished ? true : entry.locked;\n\n const storageEntry = convertToStorageEntry({\n model,\n storageEntry: initialStorageEntry\n });\n /**\n * We need to:\n * - update the current entry\n * - update the latest entry if the current entry is the latest one\n */\n\n const entityBatch = this.entity.createEntityWriter({\n put: [\n {\n ...createEntryRevisionKeys(storageEntry),\n data: {\n ...storageEntry,\n locked\n }\n }\n ]\n });\n\n if (isPublished) {\n entityBatch.put({\n ...createEntryPublishedKeys(storageEntry),\n data: {\n ...storageEntry,\n locked\n }\n });\n }\n\n /**\n * We need the latest entry to update it as well if necessary.\n */\n const latestStorageEntry = await this.getLatestRevisionByEntryId(model, entry);\n\n if (latestStorageEntry) {\n const updatingLatestRevision = latestStorageEntry.id === entry.id;\n if (updatingLatestRevision) {\n entityBatch.put({\n ...createEntryLatestKeys(storageEntry),\n data: {\n ...storageEntry,\n locked\n }\n });\n } else {\n /**\n * If not updating latest revision, we still want to update the latest revision's\n * entry-level meta fields to match the current revision's entry-level meta fields.\n */\n const updatedEntryLevelMetaFields = pickEntryMetaFields(\n entry,\n isEntryLevelEntryMetaField\n );\n\n /**\n * First we update the regular DynamoDB table. Two updates are needed:\n * - one for the actual revision record\n * - one for the latest record\n */\n entityBatch.put({\n ...createEntryRevisionKeys(latestStorageEntry),\n data: {\n ...latestStorageEntry,\n ...updatedEntryLevelMetaFields\n }\n });\n\n entityBatch.put({\n ...createEntryLatestKeys(latestStorageEntry),\n data: {\n ...latestStorageEntry,\n ...updatedEntryLevelMetaFields\n }\n });\n }\n }\n\n try {\n await entityBatch.execute();\n this.dataLoaders.clearAll({\n tenant: entry.tenant\n });\n return initialStorageEntry;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update entry.\",\n ex.code || \"UPDATE_ERROR\",\n {\n error: ex,\n entry,\n latestStorageEntry\n }\n );\n }\n }\n}\n\nexport const DdbUpdateEntry = UpdateEntryStorageOperation.createImplementation({\n implementation: DdbUpdateEntryImpl,\n dependencies: [CmsDdbEntryEntity, CmsDdbDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbUpdateEntryImpl","entity","dataLoaders","storageModelProvider","initialModel","params","model","items","entry","initialStorageEntry","isPublished","locked","storageEntry","convertToStorageEntry","entityBatch","createEntryRevisionKeys","createEntryPublishedKeys","latestStorageEntry","updatingLatestRevision","createEntryLatestKeys","updatedEntryLevelMetaFields","pickEntryMetaFields","isEntryLevelEntryMetaField","ex","WebinyError","DdbUpdateEntry","UpdateEntryStorageOperation","CmsDdbEntryEntity","CmsDdbDataLoaders","CmsStorageModelProvider"],"mappings":";;;;;;;;AAyBA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAwC,EACxCC,oBAAuD,CACjE;aAHUF,MAAM,GAANA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAc,2BACVC,YAAsB,EACtBC,MAAyC,EAC3C;QACE,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIF;QAEpD,MAAMG,QAAQ,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAI;YAC/DD;YACA,KAAK;gBAACD,OAAO,EAAE;aAAC;QACpB;QACA,OAAOE,MAAM,KAAK,MAAM;IAC5B;IAEA,MAAM,QACFH,YAAsB,EACtBC,MAAgD,EAClD;QACE,MAAM,EAAEG,KAAK,EAAE,cAAcC,mBAAmB,EAAE,GAAGJ;QACrD,MAAMC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACF;QAEjD,MAAMM,cAAcF,AAAiB,gBAAjBA,MAAM,MAAM;QAChC,MAAMG,SAASD,cAAc,OAAOF,MAAM,MAAM;QAEhD,MAAMI,eAAeC,sBAAsB;YACvCP;YACA,cAAcG;QAClB;QAOA,MAAMK,cAAc,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC/C,KAAK;gBACD;oBACI,GAAGC,wBAAwBH,aAAa;oBACxC,MAAM;wBACF,GAAGA,YAAY;wBACfD;oBACJ;gBACJ;aACH;QACL;QAEA,IAAID,aACAI,YAAY,GAAG,CAAC;YACZ,GAAGE,yBAAyBJ,aAAa;YACzC,MAAM;gBACF,GAAGA,YAAY;gBACfD;YACJ;QACJ;QAMJ,MAAMM,qBAAqB,MAAM,IAAI,CAAC,0BAA0B,CAACX,OAAOE;QAExE,IAAIS,oBAAoB;YACpB,MAAMC,yBAAyBD,mBAAmB,EAAE,KAAKT,MAAM,EAAE;YACjE,IAAIU,wBACAJ,YAAY,GAAG,CAAC;gBACZ,GAAGK,sBAAsBP,aAAa;gBACtC,MAAM;oBACF,GAAGA,YAAY;oBACfD;gBACJ;YACJ;iBACG;gBAKH,MAAMS,8BAA8BC,oBAChCb,OACAc;gBAQJR,YAAY,GAAG,CAAC;oBACZ,GAAGC,wBAAwBE,mBAAmB;oBAC9C,MAAM;wBACF,GAAGA,kBAAkB;wBACrB,GAAGG,2BAA2B;oBAClC;gBACJ;gBAEAN,YAAY,GAAG,CAAC;oBACZ,GAAGK,sBAAsBF,mBAAmB;oBAC5C,MAAM;wBACF,GAAGA,kBAAkB;wBACrB,GAAGG,2BAA2B;oBAClC;gBACJ;YACJ;QACJ;QAEA,IAAI;YACA,MAAMN,YAAY,OAAO;YACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACtB,QAAQN,MAAM,MAAM;YACxB;YACA,OAAOC;QACX,EAAE,OAAOc,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,2BACdA,GAAG,IAAI,IAAI,gBACX;gBACI,OAAOA;gBACPf;gBACAS;YACJ;QAER;IACJ;AACJ;AAEO,MAAMQ,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgB1B;IAChB,cAAc;QAAC2B;QAAmBC;QAAmBC;KAAwB;AACjF"}
|
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return this.cache[key] || null;
|
|
6
|
-
}
|
|
7
|
-
setDataLoader(params, dataLoader) {
|
|
8
|
-
const key = this.createKey(params);
|
|
9
|
-
this.cache[key] = dataLoader;
|
|
10
|
-
}
|
|
11
|
-
clearAll(params) {
|
|
12
|
-
if (!params) {
|
|
13
|
-
for (const current in this.cache) {
|
|
14
|
-
this.cache[current].clearAll();
|
|
15
|
-
}
|
|
16
|
-
return;
|
|
1
|
+
class DataLoaderCache {
|
|
2
|
+
getDataLoader(params) {
|
|
3
|
+
const key = this.createKey(params);
|
|
4
|
+
return this.cache[key] || null;
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
setDataLoader(params, dataLoader) {
|
|
7
|
+
const key = this.createKey(params);
|
|
8
|
+
this.cache[key] = dataLoader;
|
|
9
|
+
}
|
|
10
|
+
clearAll(params) {
|
|
11
|
+
if (!params) {
|
|
12
|
+
for(const current in this.cache)this.cache[current].clearAll();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const key = `${params.tenant}_`;
|
|
16
|
+
for(const current in this.cache)if (false !== current.startsWith(key)) this.cache[current].clearAll();
|
|
17
|
+
}
|
|
18
|
+
createKey(params) {
|
|
19
|
+
return `${params.tenant}_${params.modelId}_${params.name}`;
|
|
20
|
+
}
|
|
21
|
+
constructor(){
|
|
22
|
+
this.cache = {};
|
|
24
23
|
}
|
|
25
|
-
}
|
|
26
|
-
createKey(params) {
|
|
27
|
-
return `${params.tenant}_${params.modelId}_${params.name}`;
|
|
28
|
-
}
|
|
29
24
|
}
|
|
25
|
+
export { DataLoaderCache };
|
|
30
26
|
|
|
31
27
|
//# sourceMappingURL=DataLoaderCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/DataLoaderCache.js","sources":["../../../../src/operations/entry/dataLoader/DataLoaderCache.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\n\nexport interface CacheKeyParams {\n name: string;\n tenant: string;\n modelId: string;\n}\n\nexport interface ClearAllParams {\n tenant: string;\n}\n\nexport class DataLoaderCache {\n private readonly cache: Record<string, DataLoader<any, any>> = {};\n\n public getDataLoader<I = any, R = any>(params: CacheKeyParams): DataLoader<I, R> | null {\n const key = this.createKey(params);\n\n return this.cache[key] || null;\n }\n\n public setDataLoader(params: CacheKeyParams, dataLoader: DataLoader<any, any>): void {\n const key = this.createKey(params);\n this.cache[key] = dataLoader;\n }\n\n public clearAll(params?: ClearAllParams): void {\n if (!params) {\n for (const current in this.cache) {\n this.cache[current].clearAll();\n }\n return;\n }\n const key = `${params.tenant}_`;\n for (const current in this.cache) {\n if (current.startsWith(key) === false) {\n continue;\n }\n this.cache[current].clearAll();\n }\n }\n\n private createKey(params: CacheKeyParams): string {\n return `${params.tenant}_${params.modelId}_${params.name}`;\n }\n}\n"],"names":["DataLoaderCache","params","key","dataLoader","current"],"mappings":"AAYO,MAAMA;IAGF,cAAgCC,MAAsB,EAA2B;QACpF,MAAMC,MAAM,IAAI,CAAC,SAAS,CAACD;QAE3B,OAAO,IAAI,CAAC,KAAK,CAACC,IAAI,IAAI;IAC9B;IAEO,cAAcD,MAAsB,EAAEE,UAAgC,EAAQ;QACjF,MAAMD,MAAM,IAAI,CAAC,SAAS,CAACD;QAC3B,IAAI,CAAC,KAAK,CAACC,IAAI,GAAGC;IACtB;IAEO,SAASF,MAAuB,EAAQ;QAC3C,IAAI,CAACA,QAAQ;YACT,IAAK,MAAMG,WAAW,IAAI,CAAC,KAAK,CAC5B,IAAI,CAAC,KAAK,CAACA,QAAQ,CAAC,QAAQ;YAEhC;QACJ;QACA,MAAMF,MAAM,GAAGD,OAAO,MAAM,CAAC,CAAC,CAAC;QAC/B,IAAK,MAAMG,WAAW,IAAI,CAAC,KAAK,CAC5B,IAAIA,AAA4B,UAA5BA,QAAQ,UAAU,CAACF,MAGvB,IAAI,CAAC,KAAK,CAACE,QAAQ,CAAC,QAAQ;IAEpC;IAEQ,UAAUH,MAAsB,EAAU;QAC9C,OAAO,GAAGA,OAAO,MAAM,CAAC,CAAC,EAAEA,OAAO,OAAO,CAAC,CAAC,EAAEA,OAAO,IAAI,EAAE;IAC9D;;aA/BiB,KAAK,GAAyC,CAAC;;AAgCpE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const batchScheduleWaitEnv = Number(process.env.WEBINY_API_CMS_ENTRY_BATCH_SCHEDULE_WAIT || "0");
|
|
2
|
-
|
|
2
|
+
const CMS_ENTRY_BATCH_SCHEDULE_WAIT = isNaN(batchScheduleWaitEnv) ? 0 : batchScheduleWaitEnv;
|
|
3
|
+
export { CMS_ENTRY_BATCH_SCHEDULE_WAIT };
|
|
3
4
|
|
|
4
5
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/constants.js","sources":["../../../../src/operations/entry/dataLoader/constants.ts"],"sourcesContent":["const batchScheduleWaitEnv = Number(process.env.WEBINY_API_CMS_ENTRY_BATCH_SCHEDULE_WAIT || \"0\");\nexport const CMS_ENTRY_BATCH_SCHEDULE_WAIT = isNaN(batchScheduleWaitEnv) ? 0 : batchScheduleWaitEnv;\n"],"names":["batchScheduleWaitEnv","Number","process","CMS_ENTRY_BATCH_SCHEDULE_WAIT","isNaN"],"mappings":"AAAA,MAAMA,uBAAuBC,OAAOC,QAAQ,GAAG,CAAC,wCAAwC,IAAI;AACrF,MAAMC,gCAAgCC,MAAMJ,wBAAwB,IAAIA"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import { CMS_ENTRY_BATCH_SCHEDULE_WAIT } from "./constants.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* https://github.com/graphql/dataloader#batch-scheduling
|
|
9
|
-
*/
|
|
10
|
-
export const createBatchScheduleFn = () => {
|
|
11
|
-
if (CMS_ENTRY_BATCH_SCHEDULE_WAIT <= 0) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return callback => {
|
|
15
|
-
setTimeout(callback, CMS_ENTRY_BATCH_SCHEDULE_WAIT);
|
|
16
|
-
};
|
|
2
|
+
const createBatchScheduleFn = ()=>{
|
|
3
|
+
if (CMS_ENTRY_BATCH_SCHEDULE_WAIT <= 0) return;
|
|
4
|
+
return (callback)=>{
|
|
5
|
+
setTimeout(callback, CMS_ENTRY_BATCH_SCHEDULE_WAIT);
|
|
6
|
+
};
|
|
17
7
|
};
|
|
8
|
+
export { createBatchScheduleFn };
|
|
18
9
|
|
|
19
10
|
//# sourceMappingURL=createBatchScheduleFn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/createBatchScheduleFn.js","sources":["../../../../src/operations/entry/dataLoader/createBatchScheduleFn.ts"],"sourcesContent":["import { CMS_ENTRY_BATCH_SCHEDULE_WAIT } from \"./constants.js\";\n\n/**\n * This is to be used when user wants to wait for a number of milliseconds before the batch is executed.\n * Intended to be used internally or for a specific user case.\n * Not to be documented and exposed to publish as it can slow the data loading a lot.\n *\n * https://github.com/graphql/dataloader#batch-scheduling\n */\nexport const createBatchScheduleFn = () => {\n if (CMS_ENTRY_BATCH_SCHEDULE_WAIT <= 0) {\n return undefined;\n }\n return (callback: () => void) => {\n setTimeout(callback, CMS_ENTRY_BATCH_SCHEDULE_WAIT);\n };\n};\n"],"names":["createBatchScheduleFn","CMS_ENTRY_BATCH_SCHEDULE_WAIT","callback","setTimeout"],"mappings":";AASO,MAAMA,wBAAwB;IACjC,IAAIC,iCAAiC,GACjC;IAEJ,OAAO,CAACC;QACJC,WAAWD,UAAUD;IACzB;AACJ"}
|
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dataloader from "dataloader";
|
|
2
2
|
import { createPartitionKey } from "../keys.js";
|
|
3
3
|
import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
})).map(result => {
|
|
22
|
-
return result.data;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return ids.map(id => {
|
|
26
|
-
return (results[id] || []).filter(item => {
|
|
27
|
-
return item.modelId === modelId;
|
|
28
|
-
});
|
|
4
|
+
const createGetAllEntryRevisions = (params)=>{
|
|
5
|
+
const { entity, tenant, modelId } = params;
|
|
6
|
+
return new dataloader(async (ids)=>{
|
|
7
|
+
const results = {};
|
|
8
|
+
for (const id of ids)results[id] = (await entity.queryAllClean({
|
|
9
|
+
partitionKey: createPartitionKey({
|
|
10
|
+
tenant,
|
|
11
|
+
id
|
|
12
|
+
}),
|
|
13
|
+
options: {
|
|
14
|
+
beginsWith: "REV#"
|
|
15
|
+
}
|
|
16
|
+
})).map((result)=>result.data);
|
|
17
|
+
return ids.map((id)=>(results[id] || []).filter((item)=>item.modelId === modelId));
|
|
18
|
+
}, {
|
|
19
|
+
batchScheduleFn: createBatchScheduleFn()
|
|
29
20
|
});
|
|
30
|
-
}, {
|
|
31
|
-
batchScheduleFn: createBatchScheduleFn()
|
|
32
|
-
});
|
|
33
21
|
};
|
|
22
|
+
export { createGetAllEntryRevisions };
|
|
34
23
|
|
|
35
24
|
//# sourceMappingURL=getAllEntryRevisions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/getAllEntryRevisions.js","sources":["../../../../src/operations/entry/dataLoader/getAllEntryRevisions.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetAllEntryRevisions = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const results: Record<string, CmsStorageEntry[]> = {};\n\n for (const id of ids) {\n results[id] = (\n await entity.queryAllClean({\n partitionKey: createPartitionKey({\n tenant,\n id\n }),\n options: {\n beginsWith: \"REV#\"\n }\n })\n ).map(result => {\n return result.data;\n });\n }\n\n return ids.map(id => {\n return (results[id] || []).filter(item => {\n return item.modelId === modelId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetAllEntryRevisions","params","entity","tenant","modelId","DataLoader","ids","results","id","createPartitionKey","result","item","createBatchScheduleFn"],"mappings":";;;AAMO,MAAMA,6BAA6B,CAACC;IACvC,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IACpC,OAAO,IAAII,WACP,OAAMC;QACF,MAAMC,UAA6C,CAAC;QAEpD,KAAK,MAAMC,MAAMF,IACbC,OAAO,CAACC,GAAG,GACP,OAAMN,OAAO,aAAa,CAAC;YACvB,cAAcO,mBAAmB;gBAC7BN;gBACAK;YACJ;YACA,SAAS;gBACL,YAAY;YAChB;QACJ,EAAC,EACH,GAAG,CAACE,CAAAA,SACKA,OAAO,IAAI;QAI1B,OAAOJ,IAAI,GAAG,CAACE,CAAAA,KACHD,AAAAA,CAAAA,OAAO,CAACC,GAAG,IAAI,EAAC,EAAG,MAAM,CAACG,CAAAA,OACvBA,KAAK,OAAO,KAAKP;IAGpC,GACA;QACI,iBAAiBQ;IACrB;AAER"}
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dataloader from "dataloader";
|
|
2
2
|
import { cleanupItems } from "@webiny/db-dynamodb/utils/cleanup.js";
|
|
3
3
|
import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
|
|
4
4
|
import { createLatestSortKey, createPartitionKey } from "../keys.js";
|
|
5
5
|
import { parseIdentifier } from "@webiny/utils";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
keys.add(partitionKey);
|
|
25
|
-
reader.get({
|
|
26
|
-
PK: partitionKey,
|
|
27
|
-
SK: latestKey
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const records = await reader.execute();
|
|
31
|
-
const items = cleanupItems(entity.entity, records).map(item => {
|
|
32
|
-
return item.data;
|
|
33
|
-
});
|
|
34
|
-
return ids.map(id => {
|
|
35
|
-
const {
|
|
36
|
-
id: entryId
|
|
37
|
-
} = parseIdentifier(id);
|
|
38
|
-
return items.filter(item => {
|
|
39
|
-
if (item.modelId !== modelId) {
|
|
40
|
-
return false;
|
|
6
|
+
const createGetLatestRevisionByEntryId = (params)=>{
|
|
7
|
+
const { entity, tenant, modelId } = params;
|
|
8
|
+
const latestKey = createLatestSortKey();
|
|
9
|
+
return new dataloader(async (ids)=>{
|
|
10
|
+
const reader = entity.createEntityReader();
|
|
11
|
+
const keys = new Set();
|
|
12
|
+
for (const id of ids){
|
|
13
|
+
const partitionKey = createPartitionKey({
|
|
14
|
+
tenant,
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
if (!keys.has(partitionKey)) {
|
|
18
|
+
keys.add(partitionKey);
|
|
19
|
+
reader.get({
|
|
20
|
+
PK: partitionKey,
|
|
21
|
+
SK: latestKey
|
|
22
|
+
});
|
|
23
|
+
}
|
|
41
24
|
}
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
const records = await reader.execute();
|
|
26
|
+
const items = cleanupItems(entity.entity, records).map((item)=>item.data);
|
|
27
|
+
return ids.map((id)=>{
|
|
28
|
+
const { id: entryId } = parseIdentifier(id);
|
|
29
|
+
return items.filter((item)=>{
|
|
30
|
+
if (item.modelId !== modelId) return false;
|
|
31
|
+
return entryId === item.entryId;
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}, {
|
|
35
|
+
batchScheduleFn: createBatchScheduleFn()
|
|
44
36
|
});
|
|
45
|
-
}, {
|
|
46
|
-
batchScheduleFn: createBatchScheduleFn()
|
|
47
|
-
});
|
|
48
37
|
};
|
|
38
|
+
export { createGetLatestRevisionByEntryId };
|
|
49
39
|
|
|
50
40
|
//# sourceMappingURL=getLatestRevisionByEntryId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/getLatestRevisionByEntryId.js","sources":["../../../../src/operations/entry/dataLoader/getLatestRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport { cleanupItems } from \"@webiny/db-dynamodb/utils/cleanup.js\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\nimport { createLatestSortKey, createPartitionKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport const createGetLatestRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n\n const latestKey = createLatestSortKey();\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n\n reader.get({\n PK: partitionKey,\n SK: latestKey\n });\n }\n\n const records = await reader.execute();\n const items = cleanupItems(entity.entity, records).map(item => {\n return item.data;\n });\n\n return ids.map(id => {\n const { id: entryId } = parseIdentifier(id);\n return items.filter(item => {\n if (item.modelId !== modelId) {\n return false;\n }\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetLatestRevisionByEntryId","params","entity","tenant","modelId","latestKey","createLatestSortKey","DataLoader","ids","reader","keys","Set","id","partitionKey","createPartitionKey","records","items","cleanupItems","item","entryId","parseIdentifier","createBatchScheduleFn"],"mappings":";;;;;AAQO,MAAMA,mCAAmC,CAACC;IAC7C,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IAEpC,MAAMI,YAAYC;IAElB,OAAO,IAAIC,WACP,OAAMC;QACF,MAAMC,SAASP,OAAO,kBAAkB;QAExC,MAAMQ,OAAO,IAAIC;QAEjB,KAAK,MAAMC,MAAMJ,IAAK;YAClB,MAAMK,eAAeC,mBAAmB;gBACpCX;gBACAS;YACJ;YACA,KAAIF,KAAK,GAAG,CAACG;gBAGbH,KAAK,GAAG,CAACG;gBAETJ,OAAO,GAAG,CAAC;oBACP,IAAII;oBACJ,IAAIR;gBACR;;QACJ;QAEA,MAAMU,UAAU,MAAMN,OAAO,OAAO;QACpC,MAAMO,QAAQC,aAAaf,OAAO,MAAM,EAAEa,SAAS,GAAG,CAACG,CAAAA,OAC5CA,KAAK,IAAI;QAGpB,OAAOV,IAAI,GAAG,CAACI,CAAAA;YACX,MAAM,EAAE,IAAIO,OAAO,EAAE,GAAGC,gBAAgBR;YACxC,OAAOI,MAAM,MAAM,CAACE,CAAAA;gBAChB,IAAIA,KAAK,OAAO,KAAKd,SACjB,OAAO;gBAEX,OAAOe,YAAYD,KAAK,OAAO;YACnC;QACJ;IACJ,GACA;QACI,iBAAiBG;IACrB;AAER"}
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dataloader from "dataloader";
|
|
2
2
|
import { cleanupItems } from "@webiny/db-dynamodb/utils/cleanup.js";
|
|
3
3
|
import { createPartitionKey, createPublishedSortKey } from "../keys.js";
|
|
4
4
|
import { parseIdentifier } from "@webiny/utils";
|
|
5
5
|
import { createBatchScheduleFn } from "./createBatchScheduleFn.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
keys.add(partitionKey);
|
|
25
|
-
reader.get({
|
|
26
|
-
PK: partitionKey,
|
|
27
|
-
SK: publishedKey
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const records = await reader.execute();
|
|
31
|
-
const items = cleanupItems(entity.entity, records).map(item => {
|
|
32
|
-
return item.data;
|
|
33
|
-
});
|
|
34
|
-
return ids.map(id => {
|
|
35
|
-
const {
|
|
36
|
-
id: entryId
|
|
37
|
-
} = parseIdentifier(id);
|
|
38
|
-
return items.filter(item => {
|
|
39
|
-
if (item.modelId !== modelId) {
|
|
40
|
-
return false;
|
|
6
|
+
const createGetPublishedRevisionByEntryId = (params)=>{
|
|
7
|
+
const { entity, tenant, modelId } = params;
|
|
8
|
+
const publishedKey = createPublishedSortKey();
|
|
9
|
+
return new dataloader(async (ids)=>{
|
|
10
|
+
const reader = entity.createEntityReader();
|
|
11
|
+
const keys = new Set();
|
|
12
|
+
for (const id of ids){
|
|
13
|
+
const partitionKey = createPartitionKey({
|
|
14
|
+
tenant,
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
if (!keys.has(partitionKey)) {
|
|
18
|
+
keys.add(partitionKey);
|
|
19
|
+
reader.get({
|
|
20
|
+
PK: partitionKey,
|
|
21
|
+
SK: publishedKey
|
|
22
|
+
});
|
|
23
|
+
}
|
|
41
24
|
}
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
const records = await reader.execute();
|
|
26
|
+
const items = cleanupItems(entity.entity, records).map((item)=>item.data);
|
|
27
|
+
return ids.map((id)=>{
|
|
28
|
+
const { id: entryId } = parseIdentifier(id);
|
|
29
|
+
return items.filter((item)=>{
|
|
30
|
+
if (item.modelId !== modelId) return false;
|
|
31
|
+
return entryId === item.entryId;
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}, {
|
|
35
|
+
batchScheduleFn: createBatchScheduleFn()
|
|
44
36
|
});
|
|
45
|
-
}, {
|
|
46
|
-
batchScheduleFn: createBatchScheduleFn()
|
|
47
|
-
});
|
|
48
37
|
};
|
|
38
|
+
export { createGetPublishedRevisionByEntryId };
|
|
49
39
|
|
|
50
40
|
//# sourceMappingURL=getPublishedRevisionByEntryId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"operations/entry/dataLoader/getPublishedRevisionByEntryId.js","sources":["../../../../src/operations/entry/dataLoader/getPublishedRevisionByEntryId.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport { cleanupItems } from \"@webiny/db-dynamodb/utils/cleanup.js\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createPublishedSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetPublishedRevisionByEntryId = (params: IDataLoaderParams) => {\n const { entity, tenant, modelId } = params;\n\n const publishedKey = createPublishedSortKey();\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n if (keys.has(partitionKey)) {\n continue;\n }\n keys.add(partitionKey);\n reader.get({\n PK: partitionKey,\n SK: publishedKey\n });\n }\n\n const records = await reader.execute();\n const items = cleanupItems(entity.entity, records).map(item => {\n return item.data;\n });\n\n return ids.map(id => {\n const { id: entryId } = parseIdentifier(id);\n return items.filter(item => {\n if (item.modelId !== modelId) {\n return false;\n }\n return entryId === item.entryId;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"names":["createGetPublishedRevisionByEntryId","params","entity","tenant","modelId","publishedKey","createPublishedSortKey","DataLoader","ids","reader","keys","Set","id","partitionKey","createPartitionKey","records","items","cleanupItems","item","entryId","parseIdentifier","createBatchScheduleFn"],"mappings":";;;;;AAQO,MAAMA,sCAAsC,CAACC;IAChD,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGH;IAEpC,MAAMI,eAAeC;IACrB,OAAO,IAAIC,WACP,OAAMC;QACF,MAAMC,SAASP,OAAO,kBAAkB;QAExC,MAAMQ,OAAO,IAAIC;QAEjB,KAAK,MAAMC,MAAMJ,IAAK;YAClB,MAAMK,eAAeC,mBAAmB;gBACpCX;gBACAS;YACJ;YACA,KAAIF,KAAK,GAAG,CAACG;gBAGbH,KAAK,GAAG,CAACG;gBACTJ,OAAO,GAAG,CAAC;oBACP,IAAII;oBACJ,IAAIR;gBACR;;QACJ;QAEA,MAAMU,UAAU,MAAMN,OAAO,OAAO;QACpC,MAAMO,QAAQC,aAAaf,OAAO,MAAM,EAAEa,SAAS,GAAG,CAACG,CAAAA,OAC5CA,KAAK,IAAI;QAGpB,OAAOV,IAAI,GAAG,CAACI,CAAAA;YACX,MAAM,EAAE,IAAIO,OAAO,EAAE,GAAGC,gBAAgBR;YACxC,OAAOI,MAAM,MAAM,CAACE,CAAAA;gBAChB,IAAIA,KAAK,OAAO,KAAKd,SACjB,OAAO;gBAEX,OAAOe,YAAYD,KAAK,OAAO;YACnC;QACJ;IACJ,GACA;QACI,iBAAiBG;IACrB;AAER"}
|