@webiny/api-headless-cms-ddb-es 6.0.0-alpha.0 → 6.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/configurations.d.ts +3 -3
  2. package/configurations.js.map +1 -1
  3. package/definitions/entry.d.ts +3 -2
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/entryElasticsearch.d.ts +3 -2
  6. package/definitions/entryElasticsearch.js.map +1 -1
  7. package/definitions/group.d.ts +3 -2
  8. package/definitions/group.js.map +1 -1
  9. package/definitions/model.d.ts +3 -2
  10. package/definitions/model.js.map +1 -1
  11. package/definitions/system.d.ts +3 -2
  12. package/definitions/system.js.map +1 -1
  13. package/definitions/table.d.ts +2 -2
  14. package/definitions/table.js.map +1 -1
  15. package/definitions/tableElasticsearch.d.ts +2 -2
  16. package/definitions/tableElasticsearch.js.map +1 -1
  17. package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
  18. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  19. package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
  20. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  21. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  22. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  23. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  24. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  25. package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
  26. package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
  27. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  28. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  29. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  30. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  31. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  32. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  33. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  34. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  35. package/elasticsearch/search/index.d.ts +1 -1
  36. package/elasticsearch/search/index.js +2 -1
  37. package/elasticsearch/search/index.js.map +1 -1
  38. package/elasticsearch/search/refSearch.js.map +1 -1
  39. package/elasticsearch/search/searchableJson.d.ts +2 -0
  40. package/elasticsearch/search/searchableJson.js +60 -0
  41. package/elasticsearch/search/searchableJson.js.map +1 -0
  42. package/elasticsearch/search/timeSearch.js.map +1 -1
  43. package/helpers/entryIndexHelpers.d.ts +3 -3
  44. package/helpers/entryIndexHelpers.js.map +1 -1
  45. package/helpers/fieldIdentifier.d.ts +1 -1
  46. package/helpers/fieldIdentifier.js.map +1 -1
  47. package/index.d.ts +1 -1
  48. package/index.js.map +1 -1
  49. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -1
  50. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  51. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +2 -2
  52. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  53. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +2 -2
  54. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  55. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +2 -2
  56. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  57. package/operations/entry/dataLoader/getRevisionById.d.ts +2 -2
  58. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  59. package/operations/entry/dataLoader/index.d.ts +2 -2
  60. package/operations/entry/dataLoader/index.js.map +1 -1
  61. package/operations/entry/dataLoader/types.d.ts +1 -1
  62. package/operations/entry/dataLoader/types.js.map +1 -1
  63. package/operations/entry/dataLoaders.d.ts +3 -3
  64. package/operations/entry/dataLoaders.js.map +1 -1
  65. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  66. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  67. package/operations/entry/elasticsearch/body.d.ts +3 -3
  68. package/operations/entry/elasticsearch/body.js.map +1 -1
  69. package/operations/entry/elasticsearch/fields.d.ts +2 -2
  70. package/operations/entry/elasticsearch/fields.js.map +1 -1
  71. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  72. package/operations/entry/elasticsearch/filtering/applyFiltering.js +1 -0
  73. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  74. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -4
  75. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  76. package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
  77. package/operations/entry/elasticsearch/filtering/path.js +4 -2
  78. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  79. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  80. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  81. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  82. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  83. package/operations/entry/elasticsearch/fullTextSearch.d.ts +3 -3
  84. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  85. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  86. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  87. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  88. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  89. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  90. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  91. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +2 -2
  92. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +1 -1
  93. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +2 -2
  94. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  95. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
  96. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  97. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +2 -2
  98. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  99. package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
  100. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  101. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +2 -2
  102. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  103. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +1 -1
  104. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  105. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  106. package/operations/entry/elasticsearch/sort.js +4 -2
  107. package/operations/entry/elasticsearch/sort.js.map +1 -1
  108. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  109. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  110. package/operations/entry/elasticsearch/types.d.ts +3 -3
  111. package/operations/entry/elasticsearch/types.js.map +1 -1
  112. package/operations/entry/transformations/convertEntryKeys.d.ts +1 -1
  113. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  114. package/operations/entry/transformations/index.d.ts +3 -3
  115. package/operations/entry/transformations/index.js.map +1 -1
  116. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  117. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  118. package/operations/entry/transformations/transformEntryKeys.d.ts +1 -1
  119. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  120. package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
  121. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  122. package/operations/group/index.d.ts +3 -3
  123. package/operations/group/index.js.map +1 -1
  124. package/operations/model/index.d.ts +3 -3
  125. package/operations/model/index.js.map +1 -1
  126. package/operations/system/index.d.ts +2 -2
  127. package/operations/system/index.js.map +1 -1
  128. package/operations/system/indexes.d.ts +3 -3
  129. package/operations/system/indexes.js.map +1 -1
  130. package/package.json +23 -23
  131. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
  132. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
  133. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
  134. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  135. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
  136. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
  137. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +2 -1
  138. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  139. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
  140. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  141. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
  142. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  143. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +1 -1
  144. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
  145. package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
  146. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  147. package/tasks/createIndexTaskPlugin.d.ts +1 -1
  148. package/tasks/createIndexTaskPlugin.js.map +1 -1
  149. package/types.d.ts +6 -6
  150. package/types.js.map +1 -1
  151. package/values/NoValueContainer.d.ts +5 -0
  152. package/values/NoValueContainer.js +20 -0
  153. package/values/NoValueContainer.js.map +1 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","CmsElasticsearchModelFieldPlugin","Plugin","type","fieldType","field","fieldId","path","unmappedType","searchable","sortable","keyword","constructor","canBeApplied","modelId","models","include","length","includes","exclude","exports"],"sources":["CmsElasticsearchModelFieldPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsModelFieldType } from \"@webiny/api-headless-cms/types\";\n\n/**\n * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.\n *\n * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.\n */\nexport interface CmsModelFieldPluginParams {\n /**\n * The type of the field.\n * Can be something custom, like \"my-field-type\".\n */\n fieldType: CmsModelFieldType;\n /**\n * The ID of the field on the GraphQL side\n */\n fieldId: string;\n /**\n * The path to the field in the Elasticsearch document.\n */\n path: string;\n /**\n * If the field should be applied only to specific models.\n * Or excluded from the specific models.\n *\n * The default is to apply to all models.\n */\n models?: {\n include?: string[];\n exclude?: string[];\n };\n /**\n * The unmapped type of the field.\n * In most cases, this will be undefined.\n * When does it need to be set?\n *\n * When you are using a custom field type, other than the ones that are defined in the CMS.\n * Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.\n * If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as \"date\".\n */\n unmappedType?: string;\n /**\n * Is this field searchable?\n * If set to false, an error will be thrown when trying to search/filter by this field.\n */\n searchable?: boolean;\n /**\n * Is this field sortable?\n * If set to false, an error will be thrown when trying to sort by this field.\n */\n sortable?: boolean;\n /**\n * If the .keyword should be applied when doing the filtering or sorting on the field.\n */\n keyword?: boolean;\n}\n\nexport class CmsElasticsearchModelFieldPlugin extends Plugin {\n public static override readonly type: string = \"headlessCms.elasticsearch.model.field\";\n\n private readonly field: CmsModelFieldPluginParams;\n\n public get fieldType() {\n return this.field.fieldType;\n }\n public get fieldId() {\n return this.field.fieldId;\n }\n public get path() {\n return this.field.path;\n }\n\n public get unmappedType() {\n return this.field.unmappedType;\n }\n\n public get searchable() {\n return this.field.searchable;\n }\n\n public get sortable() {\n return this.field.sortable;\n }\n\n public get keyword() {\n return this.field.keyword;\n }\n\n public constructor(field: CmsModelFieldPluginParams) {\n super();\n this.field = field;\n }\n\n public canBeApplied(modelId: string): boolean {\n if (this.field.models?.include?.length) {\n return this.field.models.include.includes(modelId);\n } else if (this.field.models?.exclude?.length) {\n return this.field.models.exclude.includes(modelId) === false;\n }\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;;AAmDO,MAAMC,gCAAgC,SAASC,eAAM,CAAC;EACzD,OAAgCC,IAAI,GAAW,uCAAuC;EAItF,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACC,KAAK,CAACD,SAAS;EAC/B;EACA,IAAWE,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACD,KAAK,CAACC,OAAO;EAC7B;EACA,IAAWC,IAAIA,CAAA,EAAG;IACd,OAAO,IAAI,CAACF,KAAK,CAACE,IAAI;EAC1B;EAEA,IAAWC,YAAYA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACH,KAAK,CAACG,YAAY;EAClC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACJ,KAAK,CAACI,UAAU;EAChC;EAEA,IAAWC,QAAQA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACL,KAAK,CAACK,QAAQ;EAC9B;EAEA,IAAWC,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACN,KAAK,CAACM,OAAO;EAC7B;EAEOC,WAAWA,CAACP,KAAgC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB;EAEOQ,YAAYA,CAACC,OAAe,EAAW;IAC1C,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE;MACpC,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACC,OAAO,CAACE,QAAQ,CAACJ,OAAO,CAAC;IACtD,CAAC,MAAM,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEI,OAAO,EAAEF,MAAM,EAAE;MAC3C,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACI,OAAO,CAACD,QAAQ,CAACJ,OAAO,CAAC,KAAK,KAAK;IAChE;IACA,OAAO,IAAI;EACf;AACJ;AAACM,OAAA,CAAAnB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","CmsElasticsearchModelFieldPlugin","Plugin","type","fieldType","field","fieldId","path","unmappedType","searchable","sortable","keyword","constructor","canBeApplied","modelId","models","include","length","includes","exclude","exports"],"sources":["CmsElasticsearchModelFieldPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsModelFieldType } from \"@webiny/api-headless-cms/types\";\n\n/**\n * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.\n *\n * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.\n */\nexport interface CmsModelFieldPluginParams {\n /**\n * The type of the field.\n * Can be something custom, like \"my-field-type\".\n */\n fieldType: CmsModelFieldType;\n /**\n * The ID of the field on the GraphQL side\n */\n fieldId: string;\n /**\n * The path to the field in the Elasticsearch document.\n */\n path: string;\n /**\n * If the field should be applied only to specific models.\n * Or excluded from the specific models.\n *\n * The default is to apply to all models.\n */\n models?: {\n include?: string[];\n exclude?: string[];\n };\n /**\n * The unmapped type of the field.\n * In most cases, this will be undefined.\n * When does it need to be set?\n *\n * When you are using a custom field type, other than the ones that are defined in the CMS.\n * Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.\n * If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as \"date\".\n */\n unmappedType?: string;\n /**\n * Is this field searchable?\n * If set to false, an error will be thrown when trying to search/filter by this field.\n */\n searchable?: boolean;\n /**\n * Is this field sortable?\n * If set to false, an error will be thrown when trying to sort by this field.\n */\n sortable?: boolean;\n /**\n * If the .keyword should be applied when doing the filtering or sorting on the field.\n */\n keyword?: boolean;\n}\n\nexport class CmsElasticsearchModelFieldPlugin extends Plugin {\n public static override readonly type: string = \"headlessCms.elasticsearch.model.field\";\n\n private readonly field: CmsModelFieldPluginParams;\n\n public get fieldType() {\n return this.field.fieldType;\n }\n public get fieldId() {\n return this.field.fieldId;\n }\n public get path() {\n return this.field.path;\n }\n\n public get unmappedType() {\n return this.field.unmappedType;\n }\n\n public get searchable() {\n return this.field.searchable;\n }\n\n public get sortable() {\n return this.field.sortable;\n }\n\n public get keyword() {\n return this.field.keyword;\n }\n\n public constructor(field: CmsModelFieldPluginParams) {\n super();\n this.field = field;\n }\n\n public canBeApplied(modelId: string): boolean {\n if (this.field.models?.include?.length) {\n return this.field.models.include.includes(modelId);\n } else if (this.field.models?.exclude?.length) {\n return this.field.models.exclude.includes(modelId) === false;\n }\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;;AAmDO,MAAMC,gCAAgC,SAASC,eAAM,CAAC;EACzD,OAAgCC,IAAI,GAAW,uCAAuC;EAItF,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACC,KAAK,CAACD,SAAS;EAC/B;EACA,IAAWE,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACD,KAAK,CAACC,OAAO;EAC7B;EACA,IAAWC,IAAIA,CAAA,EAAG;IACd,OAAO,IAAI,CAACF,KAAK,CAACE,IAAI;EAC1B;EAEA,IAAWC,YAAYA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACH,KAAK,CAACG,YAAY;EAClC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACJ,KAAK,CAACI,UAAU;EAChC;EAEA,IAAWC,QAAQA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACL,KAAK,CAACK,QAAQ;EAC9B;EAEA,IAAWC,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACN,KAAK,CAACM,OAAO;EAC7B;EAEOC,WAAWA,CAACP,KAAgC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB;EAEOQ,YAAYA,CAACC,OAAe,EAAW;IAC1C,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE;MACpC,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACC,OAAO,CAACE,QAAQ,CAACJ,OAAO,CAAC;IACtD,CAAC,MAAM,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEI,OAAO,EAAEF,MAAM,EAAE;MAC3C,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACI,OAAO,CAACD,QAAQ,CAACJ,OAAO,CAAC,KAAK,KAAK;IAChE;IACA,OAAO,IAAI;EACf;AACJ;AAACM,OAAA,CAAAnB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { ElasticsearchBodyModifierPlugin, ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch";
2
- import { CmsModel } from "@webiny/api-headless-cms/types";
1
+ import type { ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch";
2
+ import { ElasticsearchBodyModifierPlugin } from "@webiny/api-elasticsearch";
3
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
3
4
  export interface ModifyBodyParams extends BaseModifyBodyParams {
4
5
  model: CmsModel;
5
6
  where: {
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","type","constructor","config","modifyBody","modelId","exports","createCmsEntryElasticsearchBodyModifierPlugin"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchBodyModifierPlugin,\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchBodyModifierPlugin = (\n config: CmsEntryElasticsearchBodyModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchBodyModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAsBO,MAAMC,uCAAuC,SAASC,iDAA+B,CAAmB;EAC3G,OAAgCC,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAExB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,uCAAA,GAAAA,uCAAA;AAEM,MAAMQ,6CAA6C,GACtDJ,MAAqD,IACpD;EACD,OAAO,IAAIJ,uCAAuC,CAACI,MAAM,CAAC;AAC9D,CAAC;AAACG,OAAA,CAAAC,6CAAA,GAAAA,6CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","type","constructor","config","modifyBody","modelId","exports","createCmsEntryElasticsearchBodyModifierPlugin"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import type {\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { ElasticsearchBodyModifierPlugin } from \"@webiny/api-elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchBodyModifierPlugin = (\n config: CmsEntryElasticsearchBodyModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchBodyModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAIA,IAAAA,iBAAA,GAAAC,OAAA;AAkBO,MAAMC,uCAAuC,SAASC,iDAA+B,CAAmB;EAC3G,OAAgCC,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAExB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,uCAAA,GAAAA,uCAAA;AAEM,MAAMQ,6CAA6C,GACtDJ,MAAqD,IACpD;EACD,OAAO,IAAIJ,uCAAuC,CAACI,MAAM,CAAC;AAC9D,CAAC;AAACG,OAAA,CAAAC,6CAAA,GAAAA,6CAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
3
- import { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
2
+ import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
3
+ import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
4
4
  export interface CmsEntryElasticsearchFullTextSearchPluginCbParams {
5
5
  model: CmsModel;
6
6
  query: ElasticsearchBoolQueryConfig;
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","CmsEntryElasticsearchFullTextSearchPlugin","Plugin","type","models","params","constructor","apply","exports","createCmsEntryElasticsearchFullTextSearchPlugin"],"sources":["CmsEntryElasticsearchFullTextSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CmsEntryElasticsearchFullTextSearchPluginCbParams {\n model: CmsModel;\n query: ElasticsearchBoolQueryConfig;\n term: string;\n fields: CmsModelField[];\n createFieldPath: (field: CmsModelField) => string;\n prepareTerm: (term: string) => string;\n}\nexport interface CmsEntryElasticsearchFullTextSearchPluginParams {\n models?: string[];\n apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;\n}\nexport class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {\n public static override readonly type: string =\n \"headless-cms.elasticsearch.entry.fullTextSearch\";\n\n private readonly params: CmsEntryElasticsearchFullTextSearchPluginParams;\n\n public get models() {\n return this.params.models;\n }\n\n public constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams) {\n super();\n this.params = params;\n }\n\n public apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void {\n return this.params.apply(params);\n }\n}\n\nexport const createCmsEntryElasticsearchFullTextSearchPlugin = (\n params: CmsEntryElasticsearchFullTextSearchPluginParams\n) => {\n return new CmsEntryElasticsearchFullTextSearchPlugin(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAgBO,MAAMC,yCAAyC,SAASC,eAAM,CAAC;EAClE,OAAgCC,IAAI,GAChC,iDAAiD;EAIrD,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACC,MAAM,CAACD,MAAM;EAC7B;EAEOE,WAAWA,CAACD,MAAuD,EAAE;IACxE,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOE,KAAKA,CAACF,MAAyD,EAAQ;IAC1E,OAAO,IAAI,CAACA,MAAM,CAACE,KAAK,CAACF,MAAM,CAAC;EACpC;AACJ;AAACG,OAAA,CAAAP,yCAAA,GAAAA,yCAAA;AAEM,MAAMQ,+CAA+C,GACxDJ,MAAuD,IACtD;EACD,OAAO,IAAIJ,yCAAyC,CAACI,MAAM,CAAC;AAChE,CAAC;AAACG,OAAA,CAAAC,+CAAA,GAAAA,+CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","CmsEntryElasticsearchFullTextSearchPlugin","Plugin","type","models","params","constructor","apply","exports","createCmsEntryElasticsearchFullTextSearchPlugin"],"sources":["CmsEntryElasticsearchFullTextSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CmsEntryElasticsearchFullTextSearchPluginCbParams {\n model: CmsModel;\n query: ElasticsearchBoolQueryConfig;\n term: string;\n fields: CmsModelField[];\n createFieldPath: (field: CmsModelField) => string;\n prepareTerm: (term: string) => string;\n}\nexport interface CmsEntryElasticsearchFullTextSearchPluginParams {\n models?: string[];\n apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;\n}\nexport class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {\n public static override readonly type: string =\n \"headless-cms.elasticsearch.entry.fullTextSearch\";\n\n private readonly params: CmsEntryElasticsearchFullTextSearchPluginParams;\n\n public get models() {\n return this.params.models;\n }\n\n public constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams) {\n super();\n this.params = params;\n }\n\n public apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void {\n return this.params.apply(params);\n }\n}\n\nexport const createCmsEntryElasticsearchFullTextSearchPlugin = (\n params: CmsEntryElasticsearchFullTextSearchPluginParams\n) => {\n return new CmsEntryElasticsearchFullTextSearchPlugin(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAgBO,MAAMC,yCAAyC,SAASC,eAAM,CAAC;EAClE,OAAgCC,IAAI,GAChC,iDAAiD;EAIrD,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACC,MAAM,CAACD,MAAM;EAC7B;EAEOE,WAAWA,CAACD,MAAuD,EAAE;IACxE,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOE,KAAKA,CAACF,MAAyD,EAAQ;IAC1E,OAAO,IAAI,CAACA,MAAM,CAACE,KAAK,CAACF,MAAM,CAAC;EACpC;AACJ;AAACG,OAAA,CAAAP,yCAAA,GAAAA,yCAAA;AAEM,MAAMQ,+CAA+C,GACxDJ,MAAuD,IACtD;EACD,OAAO,IAAIJ,yCAAyC,CAACI,MAAM,CAAC;AAChE,CAAC;AAACG,OAAA,CAAAC,+CAAA,GAAAA,+CAAA","ignoreList":[]}
@@ -1,9 +1,10 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin";
2
- import { CmsModelField } from "@webiny/api-headless-cms/types";
2
+ import type { CmsModelField } from "@webiny/api-headless-cms/types";
3
3
  export interface CreatePathCallableParams<T = any> {
4
4
  field: CmsModelField;
5
5
  key: string;
6
6
  value: T;
7
+ originalValue: any;
7
8
  }
8
9
  export interface CreatePathCallable<T = any> {
9
10
  (params: CreatePathCallableParams<T>): string;
@@ -1 +1 @@
1
- {"version":3,"names":["_Plugin","require","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","Plugin","type","fieldType","config","constructor","params","name","transform","createPath","path","exports","createCmsEntryElasticsearchQueryBuilderValueSearchPlugin"],"sources":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams<T = any> {\n field: CmsModelField;\n key: string;\n value: T;\n}\n\nexport interface CreatePathCallable<T = any> {\n (params: CreatePathCallableParams<T>): string;\n}\n\nexport interface TransformCallableParams<T = any> {\n field: CmsModelField;\n value: T;\n}\nexport interface TransformCallable<T = any> {\n (params: TransformCallableParams<T>): string;\n}\n\nexport interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {\n fieldType: string;\n path?: string | CreatePathCallable;\n transform: TransformCallable;\n}\nexport class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {\n public static override readonly type: string = \"cms-elastic-search-query-builder-value-search\";\n\n private readonly config: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) {\n super();\n\n this.config = params;\n /**\n * There is a type on the constructor, TS just doesn't see it.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public transform(params: TransformCallableParams): any {\n return this.config.transform(params);\n }\n\n public createPath(params: CreatePathCallableParams): string | null {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n return null;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = (\n params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams\n) => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AA0BO,MAAMC,kDAAkD,SAASC,cAAM,CAAC;EAC3E,OAAgCC,IAAI,GAAW,+CAA+C;EAI9F,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACC,MAAgE,EAAE;IACjF,KAAK,CAAC,CAAC;IAEP,IAAI,CAACF,MAAM,GAAGE,MAAM;IACpB;AACR;AACA;IACQ;IACA,IAAI,CAACC,IAAI,GAAG,GAAG,IAAI,CAACF,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOK,SAASA,CAACF,MAA+B,EAAO;IACnD,OAAO,IAAI,CAACF,MAAM,CAACI,SAAS,CAACF,MAAM,CAAC;EACxC;EAEOG,UAAUA,CAACH,MAAgC,EAAiB;IAC/D,IAAI,OAAO,IAAI,CAACF,MAAM,CAACM,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACN,MAAM,CAACM,IAAI,CAACJ,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACF,MAAM,CAACM,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACN,MAAM,CAACM,IAAI;IAC3B;IACA,OAAO,IAAI;EACf;AACJ;AAACC,OAAA,CAAAX,kDAAA,GAAAA,kDAAA;AAEM,MAAMY,wDAAwD,GACjEN,MAAgE,IAC/D;EACD,OAAO,IAAIN,kDAAkD,CAACM,MAAM,CAAC;AACzE,CAAC;AAACK,OAAA,CAAAC,wDAAA,GAAAA,wDAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Plugin","require","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","Plugin","type","fieldType","config","constructor","params","name","transform","createPath","path","exports","createCmsEntryElasticsearchQueryBuilderValueSearchPlugin"],"sources":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams<T = any> {\n field: CmsModelField;\n key: string;\n value: T;\n originalValue: any;\n}\n\nexport interface CreatePathCallable<T = any> {\n (params: CreatePathCallableParams<T>): string;\n}\n\nexport interface TransformCallableParams<T = any> {\n field: CmsModelField;\n value: T;\n}\nexport interface TransformCallable<T = any> {\n (params: TransformCallableParams<T>): string;\n}\n\nexport interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {\n fieldType: string;\n path?: string | CreatePathCallable;\n transform: TransformCallable;\n}\nexport class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {\n public static override readonly type: string = \"cms-elastic-search-query-builder-value-search\";\n\n private readonly config: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) {\n super();\n\n this.config = params;\n /**\n * There is a type on the constructor, TS just doesn't see it.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public transform(params: TransformCallableParams): any {\n return this.config.transform(params);\n }\n\n public createPath(params: CreatePathCallableParams): string | null {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n return null;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = (\n params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams\n) => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AA2BO,MAAMC,kDAAkD,SAASC,cAAM,CAAC;EAC3E,OAAgCC,IAAI,GAAW,+CAA+C;EAI9F,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACC,MAAgE,EAAE;IACjF,KAAK,CAAC,CAAC;IAEP,IAAI,CAACF,MAAM,GAAGE,MAAM;IACpB;AACR;AACA;IACQ;IACA,IAAI,CAACC,IAAI,GAAG,GAAG,IAAI,CAACF,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOK,SAASA,CAACF,MAA+B,EAAO;IACnD,OAAO,IAAI,CAACF,MAAM,CAACI,SAAS,CAACF,MAAM,CAAC;EACxC;EAEOG,UAAUA,CAACH,MAAgC,EAAiB;IAC/D,IAAI,OAAO,IAAI,CAACF,MAAM,CAACM,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACN,MAAM,CAACM,IAAI,CAACJ,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACF,MAAM,CAACM,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACN,MAAM,CAACM,IAAI;IAC3B;IACA,OAAO,IAAI;EACf;AACJ;AAACC,OAAA,CAAAX,kDAAA,GAAAA,kDAAA;AAEM,MAAMY,wDAAwD,GACjEN,MAAgE,IAC/D;EACD,OAAO,IAAIN,kDAAkD,CAACM,MAAM,CAAC;AACzE,CAAC;AAACK,OAAA,CAAAC,wDAAA,GAAAA,wDAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { ElasticsearchQueryModifierPlugin, ModifyQueryCallable, ModifyQueryParams as BaseModifyQueryParams } from "@webiny/api-elasticsearch";
2
- import { CmsModel } from "@webiny/api-headless-cms/types";
1
+ import type { ModifyQueryCallable, ModifyQueryParams as BaseModifyQueryParams } from "@webiny/api-elasticsearch";
2
+ import { ElasticsearchQueryModifierPlugin } from "@webiny/api-elasticsearch";
3
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
3
4
  export interface ModifyQueryParams extends BaseModifyQueryParams {
4
5
  model: CmsModel;
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin","type","constructor","config","modifyQuery","modelId","exports","createCmsEntryElasticsearchQueryModifierPlugin"],"sources":["CmsEntryElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchQueryModifierPlugin,\n ModifyQueryCallable,\n ModifyQueryParams as BaseModifyQueryParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyQueryParams extends BaseModifyQueryParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchQueryModifierPluginConfig {\n modifyQuery: ModifyQueryCallable<ModifyQueryParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.query.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig) {\n super(config.modifyQuery);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryModifierPlugin = (\n config: CmsEntryElasticsearchQueryModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchQueryModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAmBO,MAAMC,wCAAwC,SAASC,kDAAgC,CAAoB;EAC9G,OAAgCC,IAAI,GAAW,wCAAwC;EAIhFC,WAAWA,CAACC,MAAsD,EAAE;IACvE,KAAK,CAACA,MAAM,CAACC,WAAW,CAAC;IAEzB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,wCAAA,GAAAA,wCAAA;AAEM,MAAMQ,8CAA8C,GACvDJ,MAAsD,IACrD;EACD,OAAO,IAAIJ,wCAAwC,CAACI,MAAM,CAAC;AAC/D,CAAC;AAACG,OAAA,CAAAC,8CAAA,GAAAA,8CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin","type","constructor","config","modifyQuery","modelId","exports","createCmsEntryElasticsearchQueryModifierPlugin"],"sources":["CmsEntryElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import type {\n ModifyQueryCallable,\n ModifyQueryParams as BaseModifyQueryParams\n} from \"@webiny/api-elasticsearch\";\nimport { ElasticsearchQueryModifierPlugin } from \"@webiny/api-elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyQueryParams extends BaseModifyQueryParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchQueryModifierPluginConfig {\n modifyQuery: ModifyQueryCallable<ModifyQueryParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.query.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig) {\n super(config.modifyQuery);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryModifierPlugin = (\n config: CmsEntryElasticsearchQueryModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchQueryModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAIA,IAAAA,iBAAA,GAAAC,OAAA;AAeO,MAAMC,wCAAwC,SAASC,kDAAgC,CAAoB;EAC9G,OAAgCC,IAAI,GAAW,wCAAwC;EAIhFC,WAAWA,CAACC,MAAsD,EAAE;IACvE,KAAK,CAACA,MAAM,CAACC,WAAW,CAAC;IAEzB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,wCAAA,GAAAA,wCAAA;AAEM,MAAMQ,8CAA8C,GACvDJ,MAAsD,IACrD;EACD,OAAO,IAAIJ,wCAAwC,CAACI,MAAM,CAAC;AAC/D,CAAC;AAACG,OAAA,CAAAC,8CAAA,GAAAA,8CAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { ElasticsearchSortModifierPlugin, ModifySortCallable, ModifySortParams as BaseModifySortParams } from "@webiny/api-elasticsearch";
2
- import { CmsModel } from "@webiny/api-headless-cms/types";
1
+ import type { ModifySortCallable, ModifySortParams as BaseModifySortParams } from "@webiny/api-elasticsearch";
2
+ import { ElasticsearchSortModifierPlugin } from "@webiny/api-elasticsearch";
3
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
3
4
  export interface ModifySortParams extends BaseModifySortParams {
4
5
  model: CmsModel;
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin","type","constructor","config","modifySort","modelId","exports","createCmsEntryElasticsearchSortModifierPlugin"],"sources":["CmsEntryElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchSortModifierPlugin,\n ModifySortCallable,\n ModifySortParams as BaseModifySortParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifySortParams extends BaseModifySortParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchSortModifierPluginConfig {\n modifySort: ModifySortCallable<ModifySortParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.sort.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchSortModifierPluginConfig) {\n super(config.modifySort);\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchSortModifierPlugin = (\n config: CmsEntryElasticsearchSortModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchSortModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAmBO,MAAMC,uCAAuC,SAASC,iDAA+B,CAAmB;EAC3G,OAAgCC,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IACxB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,uCAAA,GAAAA,uCAAA;AAEM,MAAMQ,6CAA6C,GACtDJ,MAAqD,IACpD;EACD,OAAO,IAAIJ,uCAAuC,CAACI,MAAM,CAAC;AAC9D,CAAC;AAACG,OAAA,CAAAC,6CAAA,GAAAA,6CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin","type","constructor","config","modifySort","modelId","exports","createCmsEntryElasticsearchSortModifierPlugin"],"sources":["CmsEntryElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import type {\n ModifySortCallable,\n ModifySortParams as BaseModifySortParams\n} from \"@webiny/api-elasticsearch\";\nimport { ElasticsearchSortModifierPlugin } from \"@webiny/api-elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifySortParams extends BaseModifySortParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchSortModifierPluginConfig {\n modifySort: ModifySortCallable<ModifySortParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.sort.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchSortModifierPluginConfig) {\n super(config.modifySort);\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchSortModifierPlugin = (\n config: CmsEntryElasticsearchSortModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchSortModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAIA,IAAAA,iBAAA,GAAAC,OAAA;AAeO,MAAMC,uCAAuC,SAASC,iDAA+B,CAAmB;EAC3G,OAAgCC,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IACxB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,uCAAA,GAAAA,uCAAA;AAEM,MAAMQ,6CAA6C,GACtDJ,MAAqD,IACpD;EACD,OAAO,IAAIJ,uCAAuC,CAACI,MAAM,CAAC;AAC9D,CAAC;AAACG,OAAA,CAAAC,6CAAA,GAAAA,6CAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { CmsEntry, CmsEntryValues, CmsModel } from "@webiny/api-headless-cms/types";
2
+ import type { CmsEntry, CmsEntryValues, CmsModel } from "@webiny/api-headless-cms/types";
3
3
  interface CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T = CmsEntryValues> {
4
4
  (prev: Partial<T>): Partial<T>;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","CmsEntryElasticsearchValuesModifier","Plugin","type","models","undefined","constructor","params","cb","modifier","length","canModify","modelId","includes","modify","model","entry","values","initialValues","setValues","exports","createCmsEntryElasticsearchValuesModifier"],"sources":["CmsEntryElasticsearchValuesModifier.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsEntry, CmsEntryValues, CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T = CmsEntryValues> {\n (prev: Partial<T>): Partial<T>;\n}\n\ninterface CmsEntryElasticsearchValuesModifierCbParams<T = CmsEntryValues> {\n model: CmsModel;\n entry: CmsEntry<T>;\n values: T;\n setValues: (cb: CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T>) => void;\n}\n\nexport interface CmsEntryElasticsearchValuesModifierCb<T = CmsEntryValues> {\n (params: CmsEntryElasticsearchValuesModifierCbParams<T>): void;\n}\n\nexport interface CmsEntryElasticsearchValuesModifierExecParams<T = CmsEntryValues> {\n model: CmsModel;\n entry: CmsEntry<T>;\n values: Partial<T>;\n}\n\nexport type CmsEntryElasticsearchValuesModifierParams<T> =\n | CmsEntryElasticsearchValuesModifierCb<T>\n | {\n models: string[];\n modifier: CmsEntryElasticsearchValuesModifierCb<T>;\n };\n\nexport class CmsEntryElasticsearchValuesModifier<T = CmsEntryValues> extends Plugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.values.modifier\";\n\n private readonly models?: string[] = undefined;\n private readonly cb: CmsEntryElasticsearchValuesModifierCb<T>;\n\n public constructor(params: CmsEntryElasticsearchValuesModifierParams<T>) {\n super();\n if (typeof params === \"function\") {\n this.cb = params;\n } else {\n this.cb = params.modifier;\n this.models = params.models.length > 0 ? params.models : undefined;\n }\n }\n\n public canModify(modelId: string): boolean {\n if (!this.models?.length) {\n return true;\n }\n return this.models.includes(modelId);\n }\n\n public modify(params: CmsEntryElasticsearchValuesModifierExecParams<T>): Partial<T> {\n const { model, entry, values: initialValues } = params;\n let values: any = initialValues;\n this.cb({\n model,\n entry,\n values,\n setValues: (cb: CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T>) => {\n values = cb(values);\n }\n });\n return values;\n }\n}\n\nexport const createCmsEntryElasticsearchValuesModifier = <T = CmsEntryValues>(\n params: CmsEntryElasticsearchValuesModifierParams<T>\n) => {\n return new CmsEntryElasticsearchValuesModifier<T>(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA+BO,MAAMC,mCAAmC,SAA6BC,eAAM,CAAC;EAChF,OAAgCC,IAAI,GAAW,yCAAyC;EAEvEC,MAAM,GAAcC,SAAS;EAGvCC,WAAWA,CAACC,MAAoD,EAAE;IACrE,KAAK,CAAC,CAAC;IACP,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;MAC9B,IAAI,CAACC,EAAE,GAAGD,MAAM;IACpB,CAAC,MAAM;MACH,IAAI,CAACC,EAAE,GAAGD,MAAM,CAACE,QAAQ;MACzB,IAAI,CAACL,MAAM,GAAGG,MAAM,CAACH,MAAM,CAACM,MAAM,GAAG,CAAC,GAAGH,MAAM,CAACH,MAAM,GAAGC,SAAS;IACtE;EACJ;EAEOM,SAASA,CAACC,OAAe,EAAW;IACvC,IAAI,CAAC,IAAI,CAACR,MAAM,EAAEM,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACN,MAAM,CAACS,QAAQ,CAACD,OAAO,CAAC;EACxC;EAEOE,MAAMA,CAACP,MAAwD,EAAc;IAChF,MAAM;MAAEQ,KAAK;MAAEC,KAAK;MAAEC,MAAM,EAAEC;IAAc,CAAC,GAAGX,MAAM;IACtD,IAAIU,MAAW,GAAGC,aAAa;IAC/B,IAAI,CAACV,EAAE,CAAC;MACJO,KAAK;MACLC,KAAK;MACLC,MAAM;MACNE,SAAS,EAAGX,EAA6D,IAAK;QAC1ES,MAAM,GAAGT,EAAE,CAACS,MAAM,CAAC;MACvB;IACJ,CAAC,CAAC;IACF,OAAOA,MAAM;EACjB;AACJ;AAACG,OAAA,CAAAnB,mCAAA,GAAAA,mCAAA;AAEM,MAAMoB,yCAAyC,GAClDd,MAAoD,IACnD;EACD,OAAO,IAAIN,mCAAmC,CAAIM,MAAM,CAAC;AAC7D,CAAC;AAACa,OAAA,CAAAC,yCAAA,GAAAA,yCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","CmsEntryElasticsearchValuesModifier","Plugin","type","models","undefined","constructor","params","cb","modifier","length","canModify","modelId","includes","modify","model","entry","values","initialValues","setValues","exports","createCmsEntryElasticsearchValuesModifier"],"sources":["CmsEntryElasticsearchValuesModifier.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsEntry, CmsEntryValues, CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T = CmsEntryValues> {\n (prev: Partial<T>): Partial<T>;\n}\n\ninterface CmsEntryElasticsearchValuesModifierCbParams<T = CmsEntryValues> {\n model: CmsModel;\n entry: CmsEntry<T>;\n values: T;\n setValues: (cb: CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T>) => void;\n}\n\nexport interface CmsEntryElasticsearchValuesModifierCb<T = CmsEntryValues> {\n (params: CmsEntryElasticsearchValuesModifierCbParams<T>): void;\n}\n\nexport interface CmsEntryElasticsearchValuesModifierExecParams<T = CmsEntryValues> {\n model: CmsModel;\n entry: CmsEntry<T>;\n values: Partial<T>;\n}\n\nexport type CmsEntryElasticsearchValuesModifierParams<T> =\n | CmsEntryElasticsearchValuesModifierCb<T>\n | {\n models: string[];\n modifier: CmsEntryElasticsearchValuesModifierCb<T>;\n };\n\nexport class CmsEntryElasticsearchValuesModifier<T = CmsEntryValues> extends Plugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.values.modifier\";\n\n private readonly models?: string[] = undefined;\n private readonly cb: CmsEntryElasticsearchValuesModifierCb<T>;\n\n public constructor(params: CmsEntryElasticsearchValuesModifierParams<T>) {\n super();\n if (typeof params === \"function\") {\n this.cb = params;\n } else {\n this.cb = params.modifier;\n this.models = params.models.length > 0 ? params.models : undefined;\n }\n }\n\n public canModify(modelId: string): boolean {\n if (!this.models?.length) {\n return true;\n }\n return this.models.includes(modelId);\n }\n\n public modify(params: CmsEntryElasticsearchValuesModifierExecParams<T>): Partial<T> {\n const { model, entry, values: initialValues } = params;\n let values: any = initialValues;\n this.cb({\n model,\n entry,\n values,\n setValues: (cb: CmsEntryElasticsearchValuesModifierCbParamsSetValuesCb<T>) => {\n values = cb(values);\n }\n });\n return values;\n }\n}\n\nexport const createCmsEntryElasticsearchValuesModifier = <T = CmsEntryValues>(\n params: CmsEntryElasticsearchValuesModifierParams<T>\n) => {\n return new CmsEntryElasticsearchValuesModifier<T>(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA+BO,MAAMC,mCAAmC,SAA6BC,eAAM,CAAC;EAChF,OAAgCC,IAAI,GAAW,yCAAyC;EAEvEC,MAAM,GAAcC,SAAS;EAGvCC,WAAWA,CAACC,MAAoD,EAAE;IACrE,KAAK,CAAC,CAAC;IACP,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;MAC9B,IAAI,CAACC,EAAE,GAAGD,MAAM;IACpB,CAAC,MAAM;MACH,IAAI,CAACC,EAAE,GAAGD,MAAM,CAACE,QAAQ;MACzB,IAAI,CAACL,MAAM,GAAGG,MAAM,CAACH,MAAM,CAACM,MAAM,GAAG,CAAC,GAAGH,MAAM,CAACH,MAAM,GAAGC,SAAS;IACtE;EACJ;EAEOM,SAASA,CAACC,OAAe,EAAW;IACvC,IAAI,CAAC,IAAI,CAACR,MAAM,EAAEM,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACN,MAAM,CAACS,QAAQ,CAACD,OAAO,CAAC;EACxC;EAEOE,MAAMA,CAACP,MAAwD,EAAc;IAChF,MAAM;MAAEQ,KAAK;MAAEC,KAAK;MAAEC,MAAM,EAAEC;IAAc,CAAC,GAAGX,MAAM;IACtD,IAAIU,MAAW,GAAGC,aAAa;IAC/B,IAAI,CAACV,EAAE,CAAC;MACJO,KAAK;MACLC,KAAK;MACLC,MAAM;MACNE,SAAS,EAAGX,EAA6D,IAAK;QAC1ES,MAAM,GAAGT,EAAE,CAACS,MAAM,CAAC;MACvB;IACJ,CAAC,CAAC;IACF,OAAOA,MAAM;EACjB;AACJ;AAACG,OAAA,CAAAnB,mCAAA,GAAAA,mCAAA;AAEM,MAAMoB,yCAAyC,GAClDd,MAAoD,IACnD;EACD,OAAO,IAAIN,mCAAmC,CAAIM,MAAM,CAAC;AAC7D,CAAC;AAACa,OAAA,CAAAC,yCAAA,GAAAA,yCAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
3
- import { ModelField, ModelFields } from "../operations/entry/elasticsearch/types";
4
- import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
2
+ import type { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
3
+ import type { ModelField, ModelFields } from "../operations/entry/elasticsearch/types";
4
+ import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
5
5
  interface CmsEntryFilterPluginConfig {
6
6
  fieldType: string;
7
7
  exec: (params: ExecParams) => void;
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","CmsEntryFilterPlugin","Plugin","type","ALL","constructor","config","fieldType","exec","params","exports"],"sources":["CmsEntryFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { ModelField, ModelFields } from \"~/operations/entry/elasticsearch/types\";\nimport { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\ninterface CmsEntryFilterPluginConfig {\n fieldType: string;\n exec: (params: ExecParams) => void;\n}\ninterface ApplyParams {\n key: string;\n value: any;\n query: ElasticsearchBoolQueryConfig;\n operator: string;\n field: ModelField;\n}\nexport interface ApplyFilteringCb {\n (params: ApplyParams): void;\n}\n\nexport interface GetFilterPluginCb {\n (type: string): CmsEntryFilterPlugin;\n}\n\ninterface ExecParams {\n applyFiltering: ApplyFilteringCb;\n getFilterPlugin: GetFilterPluginCb;\n key: string;\n value: any;\n operator: string;\n field: ModelField;\n fields: ModelFields;\n query: ElasticsearchBoolQueryConfig;\n}\n\nexport interface CmsEntryFilterPluginCreateResponse {\n field: ModelField;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.elasticsearch.entry.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFilterPluginConfig;\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFilterPluginConfig) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public exec(params: ExecParams) {\n return this.config.exec(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6CO,MAAMC,oBAAoB,SAASC,eAAM,CAAC;EAC7C,OAAgCC,IAAI,GAAW,gCAAgC;EAC/E,OAAuBC,GAAG,GAAW,GAAG;EAKjCC,WAAWA,CAACC,MAAkC,EAAE;IACnD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,IAAIA,CAACC,MAAkB,EAAE;IAC5B,OAAO,IAAI,CAACH,MAAM,CAACE,IAAI,CAACC,MAAM,CAAC;EACnC;AACJ;AAACC,OAAA,CAAAT,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","CmsEntryFilterPlugin","Plugin","type","ALL","constructor","config","fieldType","exec","params","exports"],"sources":["CmsEntryFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport type { ModelField, ModelFields } from \"~/operations/entry/elasticsearch/types\";\nimport type { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\ninterface CmsEntryFilterPluginConfig {\n fieldType: string;\n exec: (params: ExecParams) => void;\n}\ninterface ApplyParams {\n key: string;\n value: any;\n query: ElasticsearchBoolQueryConfig;\n operator: string;\n field: ModelField;\n}\nexport interface ApplyFilteringCb {\n (params: ApplyParams): void;\n}\n\nexport interface GetFilterPluginCb {\n (type: string): CmsEntryFilterPlugin;\n}\n\ninterface ExecParams {\n applyFiltering: ApplyFilteringCb;\n getFilterPlugin: GetFilterPluginCb;\n key: string;\n value: any;\n operator: string;\n field: ModelField;\n fields: ModelFields;\n query: ElasticsearchBoolQueryConfig;\n}\n\nexport interface CmsEntryFilterPluginCreateResponse {\n field: ModelField;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.elasticsearch.entry.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFilterPluginConfig;\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFilterPluginConfig) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public exec(params: ExecParams) {\n return this.config.exec(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6CO,MAAMC,oBAAoB,SAASC,eAAM,CAAC;EAC7C,OAAgCC,IAAI,GAAW,gCAAgC;EAC/E,OAAuBC,GAAG,GAAW,GAAG;EAKjCC,WAAWA,CAACC,MAAkC,EAAE;IACnD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,IAAIA,CAACC,MAAkB,EAAE;IAC5B,OAAO,IAAI,CAACH,MAAM,CAACE,IAAI,CAACC,MAAM,CAAC;EACnC;AACJ;AAACC,OAAA,CAAAT,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { CmsContext } from "../types";
1
+ import type { CmsContext } from "../types";
2
2
  export declare const createIndexTaskPluginTest: () => import("@webiny/api-elasticsearch-tasks").CreateElasticsearchIndexTaskPlugin<CmsContext>;
@@ -1 +1 @@
1
- {"version":3,"names":["_apiElasticsearchTasks","require","_configurations","createIndexTaskPluginTest","createElasticsearchIndexTaskPlugin","name","getIndexList","context","locale","tenant","originalTenant","tenancy","getCurrentTenant","originalLocale","i18n","getCurrentLocale","selectedTenant","getTenantById","selectedLocale","getLocale","models","cms","listModels","length","setCurrentTenant","setCurrentLocale","indexes","map","model","index","configurations","es","modelId","settings","indexSettings","exports"],"sources":["createIndexTaskPlugin.ts"],"sourcesContent":["import {\n createElasticsearchIndexTaskPlugin,\n CreateElasticsearchIndexTaskPluginIndex\n} from \"@webiny/api-elasticsearch-tasks\";\nimport { configurations } from \"~/configurations\";\nimport { CmsContext } from \"~/types\";\n\nexport const createIndexTaskPluginTest = () => {\n return createElasticsearchIndexTaskPlugin<CmsContext>({\n name: \"elasticsearch.cms.createIndexTaskPlugin\",\n getIndexList: async ({ context, locale, tenant }) => {\n const originalTenant = context.tenancy.getCurrentTenant();\n if (!originalTenant) {\n return [];\n }\n const originalLocale = context.i18n.getCurrentLocale(\"content\");\n if (!originalLocale) {\n return [];\n }\n\n const selectedTenant = await context.tenancy.getTenantById(tenant);\n if (!selectedTenant) {\n return [];\n }\n const selectedLocale = await context.i18n.getLocale(locale);\n if (!selectedLocale) {\n return [];\n }\n const models = await context.cms.listModels();\n if (models.length === 0) {\n return [];\n }\n\n context.tenancy.setCurrentTenant(selectedTenant);\n context.i18n.setCurrentLocale(\"content\", selectedLocale);\n\n const indexes = models.map<CreateElasticsearchIndexTaskPluginIndex>(model => {\n const { index } = configurations.es({\n model: {\n modelId: model.modelId,\n tenant,\n locale\n }\n });\n return {\n index,\n settings: configurations.indexSettings({\n context,\n model: {\n locale\n }\n })\n };\n });\n\n context.tenancy.setCurrentTenant(originalTenant);\n context.i18n.setCurrentLocale(\"content\", originalLocale);\n return indexes;\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AAGO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,IAAAC,yDAAkC,EAAa;IAClDC,IAAI,EAAE,yCAAyC;IAC/CC,YAAY,EAAE,MAAAA,CAAO;MAAEC,OAAO;MAAEC,MAAM;MAAEC;IAAO,CAAC,KAAK;MACjD,MAAMC,cAAc,GAAGH,OAAO,CAACI,OAAO,CAACC,gBAAgB,CAAC,CAAC;MACzD,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAMG,cAAc,GAAGN,OAAO,CAACO,IAAI,CAACC,gBAAgB,CAAC,SAAS,CAAC;MAC/D,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MAEA,MAAMG,cAAc,GAAG,MAAMT,OAAO,CAACI,OAAO,CAACM,aAAa,CAACR,MAAM,CAAC;MAClE,IAAI,CAACO,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,cAAc,GAAG,MAAMX,OAAO,CAACO,IAAI,CAACK,SAAS,CAACX,MAAM,CAAC;MAC3D,IAAI,CAACU,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,MAAM,GAAG,MAAMb,OAAO,CAACc,GAAG,CAACC,UAAU,CAAC,CAAC;MAC7C,IAAIF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,EAAE;MACb;MAEAhB,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACR,cAAc,CAAC;MAChDT,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEP,cAAc,CAAC;MAExD,MAAMQ,OAAO,GAAGN,MAAM,CAACO,GAAG,CAA0CC,KAAK,IAAI;QACzE,MAAM;UAAEC;QAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;UAChCH,KAAK,EAAE;YACHI,OAAO,EAAEJ,KAAK,CAACI,OAAO;YACtBvB,MAAM;YACND;UACJ;QACJ,CAAC,CAAC;QACF,OAAO;UACHqB,KAAK;UACLI,QAAQ,EAAEH,8BAAc,CAACI,aAAa,CAAC;YACnC3B,OAAO;YACPqB,KAAK,EAAE;cACHpB;YACJ;UACJ,CAAC;QACL,CAAC;MACL,CAAC,CAAC;MAEFD,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACd,cAAc,CAAC;MAChDH,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEZ,cAAc,CAAC;MACxD,OAAOa,OAAO;IAClB;EACJ,CAAC,CAAC;AACN,CAAC;AAACS,OAAA,CAAAhC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_apiElasticsearchTasks","require","_configurations","createIndexTaskPluginTest","createElasticsearchIndexTaskPlugin","name","getIndexList","context","locale","tenant","originalTenant","tenancy","getCurrentTenant","originalLocale","i18n","getCurrentLocale","selectedTenant","getTenantById","selectedLocale","getLocale","models","cms","listModels","length","setCurrentTenant","setCurrentLocale","indexes","map","model","index","configurations","es","modelId","settings","indexSettings","exports"],"sources":["createIndexTaskPlugin.ts"],"sourcesContent":["import type { CreateElasticsearchIndexTaskPluginIndex } from \"@webiny/api-elasticsearch-tasks\";\nimport { createElasticsearchIndexTaskPlugin } from \"@webiny/api-elasticsearch-tasks\";\nimport { configurations } from \"~/configurations\";\nimport type { CmsContext } from \"~/types\";\n\nexport const createIndexTaskPluginTest = () => {\n return createElasticsearchIndexTaskPlugin<CmsContext>({\n name: \"elasticsearch.cms.createIndexTaskPlugin\",\n getIndexList: async ({ context, locale, tenant }) => {\n const originalTenant = context.tenancy.getCurrentTenant();\n if (!originalTenant) {\n return [];\n }\n const originalLocale = context.i18n.getCurrentLocale(\"content\");\n if (!originalLocale) {\n return [];\n }\n\n const selectedTenant = await context.tenancy.getTenantById(tenant);\n if (!selectedTenant) {\n return [];\n }\n const selectedLocale = await context.i18n.getLocale(locale);\n if (!selectedLocale) {\n return [];\n }\n const models = await context.cms.listModels();\n if (models.length === 0) {\n return [];\n }\n\n context.tenancy.setCurrentTenant(selectedTenant);\n context.i18n.setCurrentLocale(\"content\", selectedLocale);\n\n const indexes = models.map<CreateElasticsearchIndexTaskPluginIndex>(model => {\n const { index } = configurations.es({\n model: {\n modelId: model.modelId,\n tenant,\n locale\n }\n });\n return {\n index,\n settings: configurations.indexSettings({\n context,\n model: {\n locale\n }\n })\n };\n });\n\n context.tenancy.setCurrentTenant(originalTenant);\n context.i18n.setCurrentLocale(\"content\", originalLocale);\n return indexes;\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAGO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,IAAAC,yDAAkC,EAAa;IAClDC,IAAI,EAAE,yCAAyC;IAC/CC,YAAY,EAAE,MAAAA,CAAO;MAAEC,OAAO;MAAEC,MAAM;MAAEC;IAAO,CAAC,KAAK;MACjD,MAAMC,cAAc,GAAGH,OAAO,CAACI,OAAO,CAACC,gBAAgB,CAAC,CAAC;MACzD,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAMG,cAAc,GAAGN,OAAO,CAACO,IAAI,CAACC,gBAAgB,CAAC,SAAS,CAAC;MAC/D,IAAI,CAACF,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MAEA,MAAMG,cAAc,GAAG,MAAMT,OAAO,CAACI,OAAO,CAACM,aAAa,CAACR,MAAM,CAAC;MAClE,IAAI,CAACO,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,cAAc,GAAG,MAAMX,OAAO,CAACO,IAAI,CAACK,SAAS,CAACX,MAAM,CAAC;MAC3D,IAAI,CAACU,cAAc,EAAE;QACjB,OAAO,EAAE;MACb;MACA,MAAME,MAAM,GAAG,MAAMb,OAAO,CAACc,GAAG,CAACC,UAAU,CAAC,CAAC;MAC7C,IAAIF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,EAAE;MACb;MAEAhB,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACR,cAAc,CAAC;MAChDT,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEP,cAAc,CAAC;MAExD,MAAMQ,OAAO,GAAGN,MAAM,CAACO,GAAG,CAA0CC,KAAK,IAAI;QACzE,MAAM;UAAEC;QAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;UAChCH,KAAK,EAAE;YACHI,OAAO,EAAEJ,KAAK,CAACI,OAAO;YACtBvB,MAAM;YACND;UACJ;QACJ,CAAC,CAAC;QACF,OAAO;UACHqB,KAAK;UACLI,QAAQ,EAAEH,8BAAc,CAACI,aAAa,CAAC;YACnC3B,OAAO;YACPqB,KAAK,EAAE;cACHpB;YACJ;UACJ,CAAC;QACL,CAAC;MACL,CAAC,CAAC;MAEFD,OAAO,CAACI,OAAO,CAACa,gBAAgB,CAACd,cAAc,CAAC;MAChDH,OAAO,CAACO,IAAI,CAACW,gBAAgB,CAAC,SAAS,EAAEZ,cAAc,CAAC;MACxD,OAAOa,OAAO;IAClB;EACJ,CAAC,CAAC;AACN,CAAC;AAACS,OAAA,CAAAhC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
package/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Plugin, PluginCollection } from "@webiny/plugins/types";
2
- import { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
3
- import { AttributeDefinition, Entity, Table, TableConstructor } from "@webiny/db-dynamodb/toolbox";
4
- import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
5
- import { Client } from "@elastic/elasticsearch";
6
- import { PluginsContainer } from "@webiny/plugins";
1
+ import type { Plugin, PluginCollection } from "@webiny/plugins/types";
2
+ import type { CmsContext as BaseCmsContext, CmsEntry, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, CmsModelFieldType, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
3
+ import type { AttributeDefinition, Entity, Table, TableConstructor } from "@webiny/db-dynamodb/toolbox";
4
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
5
+ import type { Client } from "@elastic/elasticsearch";
6
+ import type { PluginsContainer } from "@webiny/plugins";
7
7
  /**
8
8
  * A definition of the entry that is being prepared for the Elasticsearch.
9
9
  *
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin, PluginCollection } from \"@webiny/plugins/types\";\nimport {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { AttributeDefinition, Entity, Table, TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry extends CmsEntry {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Record<string, any>;\n /**\n * A first part of the ID, without the revision.\n * For example, we can search for all the revisions of the given entry.\n */\n primaryId: string;\n /**\n * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: TableModifier;\n esTable?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => Table<string, string, string>;\n getEsTable: () => Table<string, string, string>;\n getEntities: () => Record<\n \"system\" | \"groups\" | \"models\" | \"entries\" | \"entriesEs\",\n Entity<any>\n >;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;AAgBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IA2DYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import type { Plugin, PluginCollection } from \"@webiny/plugins/types\";\nimport type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n CmsModelFieldType,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport type {\n AttributeDefinition,\n Entity,\n Table,\n TableConstructor\n} from \"@webiny/db-dynamodb/toolbox\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry extends CmsEntry {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Record<string, any>;\n /**\n * A first part of the ID, without the revision.\n * For example, we can search for all the revisions of the given entry.\n */\n primaryId: string;\n /**\n * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: CmsModelFieldType;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: TableModifier;\n esTable?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => Table<string, string, string>;\n getEsTable: () => Table<string, string, string>;\n getEntities: () => Record<\n \"system\" | \"groups\" | \"models\" | \"entries\" | \"entriesEs\",\n Entity<any>\n >;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;AAqBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IA2DYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export declare class NoValueContainer {
2
+ private constructor();
3
+ static create(): NoValueContainer;
4
+ static is(value: unknown): boolean;
5
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NoValueContainer = void 0;
7
+ class NoValueContainer {
8
+ constructor() {
9
+ //
10
+ }
11
+ static create() {
12
+ return new NoValueContainer();
13
+ }
14
+ static is(value) {
15
+ return value instanceof NoValueContainer;
16
+ }
17
+ }
18
+ exports.NoValueContainer = NoValueContainer;
19
+
20
+ //# sourceMappingURL=NoValueContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NoValueContainer","constructor","create","is","value","exports"],"sources":["NoValueContainer.ts"],"sourcesContent":["export class NoValueContainer {\n private constructor() {\n //\n }\n\n public static create(): NoValueContainer {\n return new NoValueContainer();\n }\n\n public static is(value: unknown): boolean {\n return value instanceof NoValueContainer;\n }\n}\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,CAAC;EAClBC,WAAWA,CAAA,EAAG;IAClB;EAAA;EAGJ,OAAcC,MAAMA,CAAA,EAAqB;IACrC,OAAO,IAAIF,gBAAgB,CAAC,CAAC;EACjC;EAEA,OAAcG,EAAEA,CAACC,KAAc,EAAW;IACtC,OAAOA,KAAK,YAAYJ,gBAAgB;EAC5C;AACJ;AAACK,OAAA,CAAAL,gBAAA,GAAAA,gBAAA","ignoreList":[]}