@webiny/api-headless-cms-ddb-es 5.43.3 → 6.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) 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/dynamoDb/storage/richText.js +1 -8
  18. package/dynamoDb/storage/richText.js.map +1 -1
  19. package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
  20. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  21. package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
  22. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  23. package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
  24. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  25. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
  26. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  27. package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
  28. package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
  29. package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
  30. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  31. package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
  32. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  33. package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
  34. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  35. package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
  36. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  37. package/elasticsearch/search/index.d.ts +1 -1
  38. package/elasticsearch/search/index.js +2 -1
  39. package/elasticsearch/search/index.js.map +1 -1
  40. package/elasticsearch/search/refSearch.js.map +1 -1
  41. package/elasticsearch/search/searchableJson.d.ts +2 -0
  42. package/elasticsearch/search/searchableJson.js +60 -0
  43. package/elasticsearch/search/searchableJson.js.map +1 -0
  44. package/elasticsearch/search/timeSearch.js.map +1 -1
  45. package/helpers/entryIndexHelpers.d.ts +3 -3
  46. package/helpers/entryIndexHelpers.js.map +1 -1
  47. package/helpers/fieldIdentifier.d.ts +1 -1
  48. package/helpers/fieldIdentifier.js.map +1 -1
  49. package/index.d.ts +1 -1
  50. package/index.js.map +1 -1
  51. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -1
  52. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  53. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +2 -2
  54. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  55. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +2 -2
  56. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  57. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +2 -2
  58. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  59. package/operations/entry/dataLoader/getRevisionById.d.ts +2 -2
  60. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  61. package/operations/entry/dataLoader/index.d.ts +2 -2
  62. package/operations/entry/dataLoader/index.js.map +1 -1
  63. package/operations/entry/dataLoader/types.d.ts +1 -1
  64. package/operations/entry/dataLoader/types.js.map +1 -1
  65. package/operations/entry/dataLoaders.d.ts +3 -3
  66. package/operations/entry/dataLoaders.js.map +1 -1
  67. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
  68. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  69. package/operations/entry/elasticsearch/body.d.ts +4 -4
  70. package/operations/entry/elasticsearch/body.js +11 -2
  71. package/operations/entry/elasticsearch/body.js.map +1 -1
  72. package/operations/entry/elasticsearch/fields.d.ts +2 -2
  73. package/operations/entry/elasticsearch/fields.js.map +1 -1
  74. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
  75. package/operations/entry/elasticsearch/filtering/applyFiltering.js +1 -0
  76. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  77. package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -4
  78. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  79. package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
  80. package/operations/entry/elasticsearch/filtering/path.js +4 -2
  81. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  82. package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
  83. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  84. package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
  85. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  86. package/operations/entry/elasticsearch/fullTextSearch.d.ts +4 -4
  87. package/operations/entry/elasticsearch/fullTextSearch.js +4 -4
  88. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  89. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
  90. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  91. package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
  92. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  93. package/operations/entry/elasticsearch/keyword.d.ts +1 -1
  94. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  95. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +2 -2
  96. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +1 -1
  97. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +2 -2
  98. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
  99. package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
  100. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  101. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +2 -2
  102. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
  103. package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
  104. package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
  105. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +2 -2
  106. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
  107. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +1 -1
  108. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  109. package/operations/entry/elasticsearch/sort.d.ts +4 -4
  110. package/operations/entry/elasticsearch/sort.js +4 -2
  111. package/operations/entry/elasticsearch/sort.js.map +1 -1
  112. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
  113. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  114. package/operations/entry/elasticsearch/types.d.ts +3 -3
  115. package/operations/entry/elasticsearch/types.js.map +1 -1
  116. package/operations/entry/transformations/convertEntryKeys.d.ts +1 -1
  117. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  118. package/operations/entry/transformations/index.d.ts +3 -3
  119. package/operations/entry/transformations/index.js.map +1 -1
  120. package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
  121. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  122. package/operations/entry/transformations/transformEntryKeys.d.ts +1 -1
  123. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  124. package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
  125. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  126. package/operations/group/index.d.ts +3 -3
  127. package/operations/group/index.js.map +1 -1
  128. package/operations/model/index.d.ts +3 -3
  129. package/operations/model/index.js.map +1 -1
  130. package/operations/system/index.d.ts +2 -2
  131. package/operations/system/index.js.map +1 -1
  132. package/operations/system/indexes.d.ts +3 -3
  133. package/operations/system/indexes.js.map +1 -1
  134. package/package.json +23 -23
  135. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
  136. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
  137. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
  138. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  139. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +4 -3
  140. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
  141. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +2 -1
  142. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  143. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
  144. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  145. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
  146. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  147. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +1 -1
  148. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
  149. package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
  150. package/plugins/CmsEntryFilterPlugin.js.map +1 -1
  151. package/tasks/createIndexTaskPlugin.d.ts +1 -1
  152. package/tasks/createIndexTaskPlugin.js.map +1 -1
  153. package/types.d.ts +6 -6
  154. package/types.js.map +1 -1
  155. package/values/NoValueContainer.d.ts +5 -0
  156. package/values/NoValueContainer.js +20 -0
  157. package/values/NoValueContainer.js.map +1 -0
@@ -1,6 +1,6 @@
1
- import { CmsModel } from "@webiny/api-headless-cms/types";
2
- import { CmsContext } from "./types";
3
- import { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
1
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
2
+ import type { CmsContext } from "./types";
3
+ import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
4
4
  interface ConfigurationsElasticsearch {
5
5
  index: string;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","model","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","index","modelId","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","CmsEntryElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\nimport { CmsContext } from \"~/types\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n model: Pick<CmsModel, \"locale\">;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context, model }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type,\n locale: model.locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAsBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAChD,MAAMC,KAAK,GAAG,CAACF,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACO,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAE5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDM,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEb;EAAM,CAAC,KAAK;IACnC,MAAMc,MAAM,GAAG,IAAAC,yCAAuB,EAAmC;MACrEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,yCAAgC,CAACD,IAAI;MAC3ChB,MAAM,EAAEF,KAAK,CAACE;IAClB,CAAC,CAAC;IAEF,OAAOY,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","model","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","index","modelId","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","CmsEntryElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n model: Pick<CmsModel, \"locale\">;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context, model }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type,\n locale: model.locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAsBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAChD,MAAMC,KAAK,GAAG,CAACF,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACO,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAE5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDM,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEb;EAAM,CAAC,KAAK;IACnC,MAAMc,MAAM,GAAG,IAAAC,yCAAuB,EAAmC;MACrEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,yCAAgC,CAACD,IAAI;MAC3ChB,MAAM,EAAEF,KAAK,CAACE;IAClB,CAAC,CAAC;IAEF,OAAOY,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateEntryEntityParams {
4
5
  table: Table<string, string, string>;
5
6
  entityName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionDeletedOn","revisionRestoredOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionDeletedBy","revisionRestoredBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","deletedOn","restoredOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","deletedBy","restoredBy","firstPublishedBy","lastPublishedBy","ownedBy","publishedOn","modelId","locale","version","locked","status","location","wbyDeleted","binOriginalFolderId","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionDeletedOn: { type: \"string\" },\n revisionRestoredOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionDeletedBy: { type: \"map\" },\n revisionRestoredBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n deletedOn: { type: \"string\" },\n restoredOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n deletedBy: { type: \"map\" },\n restoredBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n /**\n * Deprecated fields. 👇\n */\n ownedBy: {\n type: \"map\"\n },\n publishedOn: {\n type: \"string\"\n },\n\n /**\n * The rest. 👇\n */\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n location: {\n type: \"map\"\n },\n wbyDeleted: {\n type: \"boolean\"\n },\n binOriginalFolderId: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,MAAM,EAAE;QACJL,IAAI,EAAE;MACV,CAAC;MACDM,aAAa,EAAE;QACXN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,EAAE,EAAE;QACAT,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYU,iBAAiB,EAAE;QAAEV,IAAI,EAAE;MAAS,CAAC;MACrCW,eAAe,EAAE;QAAEX,IAAI,EAAE;MAAS,CAAC;MACnCY,kBAAkB,EAAE;QAAEZ,IAAI,EAAE;MAAS,CAAC;MACtCa,iBAAiB,EAAE;QAAEb,IAAI,EAAE;MAA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,EAAE;QAAEpC,IAAI,EAAE;MAAM,CAAC;MACjCqC,eAAe,EAAE;QAAErC,IAAI,EAAE;MAAM,CAAC;MAEhC;AACZ;AACA;MACYsC,OAAO,EAAE;QACLtC,IAAI,EAAE;MACV,CAAC;MACDuC,WAAW,EAAE;QACTvC,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYwC,OAAO,EAAE;QACLxC,IAAI,EAAE;MACV,CAAC;MACDyC,MAAM,EAAE;QACJzC,IAAI,EAAE;MACV,CAAC;MACD0C,OAAO,EAAE;QACL1C,IAAI,EAAE;MACV,CAAC;MACD2C,MAAM,EAAE;QACJ3C,IAAI,EAAE;MACV,CAAC;MACD4C,MAAM,EAAE;QACJ5C,IAAI,EAAE;MACV,CAAC;MACD6C,QAAQ,EAAE;QACN7C,IAAI,EAAE;MACV,CAAC;MACD8C,UAAU,EAAE;QACR9C,IAAI,EAAE;MACV,CAAC;MACD+C,mBAAmB,EAAE;QACjB/C,IAAI,EAAE;MACV,CAAC;MACDgD,MAAM,EAAE;QACJhD,IAAI,EAAE;MACV,CAAC;MACDiD,IAAI,EAAE;QACFjD,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACsD,OAAA,CAAA1D,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionDeletedOn","revisionRestoredOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionDeletedBy","revisionRestoredBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","deletedOn","restoredOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","deletedBy","restoredBy","firstPublishedBy","lastPublishedBy","ownedBy","publishedOn","modelId","locale","version","locked","status","location","wbyDeleted","binOriginalFolderId","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionDeletedOn: { type: \"string\" },\n revisionRestoredOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionDeletedBy: { type: \"map\" },\n revisionRestoredBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n deletedOn: { type: \"string\" },\n restoredOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n deletedBy: { type: \"map\" },\n restoredBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n /**\n * Deprecated fields. 👇\n */\n ownedBy: {\n type: \"map\"\n },\n publishedOn: {\n type: \"string\"\n },\n\n /**\n * The rest. 👇\n */\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n location: {\n type: \"map\"\n },\n wbyDeleted: {\n type: \"boolean\"\n },\n binOriginalFolderId: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,MAAM,EAAE;QACJL,IAAI,EAAE;MACV,CAAC;MACDM,aAAa,EAAE;QACXN,IAAI,EAAE;MACV,CAAC;MACDO,MAAM,EAAE;QACJP,IAAI,EAAE;MACV,CAAC;MACDQ,OAAO,EAAE;QACLR,IAAI,EAAE;MACV,CAAC;MACDS,EAAE,EAAE;QACAT,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYU,iBAAiB,EAAE;QAAEV,IAAI,EAAE;MAAS,CAAC;MACrCW,eAAe,EAAE;QAAEX,IAAI,EAAE;MAAS,CAAC;MACnCY,kBAAk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E;MAAM,CAAC;MAC1BmC,UAAU,EAAE;QAAEnC,IAAI,EAAE;MAAM,CAAC;MAC3BoC,gBAAgB,EAAE;QAAEpC,IAAI,EAAE;MAAM,CAAC;MACjCqC,eAAe,EAAE;QAAErC,IAAI,EAAE;MAAM,CAAC;MAEhC;AACZ;AACA;MACYsC,OAAO,EAAE;QACLtC,IAAI,EAAE;MACV,CAAC;MACDuC,WAAW,EAAE;QACTvC,IAAI,EAAE;MACV,CAAC;MAED;AACZ;AACA;MACYwC,OAAO,EAAE;QACLxC,IAAI,EAAE;MACV,CAAC;MACDyC,MAAM,EAAE;QACJzC,IAAI,EAAE;MACV,CAAC;MACD0C,OAAO,EAAE;QACL1C,IAAI,EAAE;MACV,CAAC;MACD2C,MAAM,EAAE;QACJ3C,IAAI,EAAE;MACV,CAAC;MACD4C,MAAM,EAAE;QACJ5C,IAAI,EAAE;MACV,CAAC;MACD6C,QAAQ,EAAE;QACN7C,IAAI,EAAE;MACV,CAAC;MACD8C,UAAU,EAAE;QACR9C,IAAI,EAAE;MACV,CAAC;MACD+C,mBAAmB,EAAE;QACjB/C,IAAI,EAAE;MACV,CAAC;MACDgD,MAAM,EAAE;QACJhD,IAAI,EAAE;MACV,CAAC;MACDiD,IAAI,EAAE;QACFjD,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACsD,OAAA,CAAA1D,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateEntryElasticsearchEntityParams {
4
5
  table: Table<string, string, string>;
5
6
  entityName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","TYPE","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n TYPE: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,8BAAA,GAAAA,8BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data","TYPE","exports"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n TYPE: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU,EAAE;MACRG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MACD,IAAIJ,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAf,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateGroupEntityParams {
4
5
  table: Table<string, string, string>;
5
6
  entityName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant","exports"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant","exports"],"sources":["group.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateModelEntityParams {
4
5
  table: Table<string, string, string>;
5
6
  entityName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant","exports"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n singularApiName: {\n type: \"string\",\n required: true\n },\n pluralApiName: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n icon: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n descriptionFieldId: {\n type: \"string\"\n },\n imageFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,aAAa,EAAE;QACXF,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDP,IAAI,EAAE;QACFM,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDE,OAAO,EAAE;QACLH,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDG,eAAe,EAAE;QACbJ,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDI,aAAa,EAAE;QACXL,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDK,MAAM,EAAE;QACJN,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDM,KAAK,EAAE;QACHP,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDO,IAAI,EAAE;QACFR,IAAI,EAAE;MACV,CAAC;MACDS,WAAW,EAAE;QACTT,IAAI,EAAE;MACV,CAAC;MACDU,SAAS,EAAE;QACPV,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDU,OAAO,EAAE;QACLX,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDW,SAAS,EAAE;QACPZ,IAAI,EAAE,KAAK;QACXC,QAAQ,EAAE;MACd,CAAC;MACDY,MAAM,EAAE;QACJb,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDa,MAAM,EAAE;QACJd,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDc,IAAI,EAAE;QACFf,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE,KAAK;QACfe,OAAO,EAAE;MACb,CAAC;MACDC,YAAY,EAAE;QACVjB,IAAI,EAAE,MAAM;QACZC,QAAQ,EAAE;MACd,CAAC;MACDiB,YAAY,EAAE;QACVlB,IAAI,EAAE;MACV,CAAC;MACDmB,kBAAkB,EAAE;QAChBnB,IAAI,EAAE;MACV,CAAC;MACDoB,YAAY,EAAE;QACVpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACD,IAAIV,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC+B,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","singularApiName","pluralApiName","locale","group","icon","description","createdOn","savedOn","createdBy","fields","layout","tags","default","lockedFields","titleFieldId","descriptionFieldId","imageFieldId","tenant","exports"],"sources":["model.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateModelEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: CreateModelEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n singularApiName: {\n type: \"string\",\n required: true\n },\n pluralApiName: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n icon: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n tags: {\n type: \"list\",\n required: false,\n default: []\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n descriptionFieldId: {\n type: \"string\"\n },\n imageFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACDC,aAAa,EAAE;QACXF,I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EAAE;QACVpB,IAAI,EAAE;MACV,CAAC;MACDqB,MAAM,EAAE;QACJrB,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd,CAAC;MACD,IAAIV,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAAC+B,OAAA,CAAAlC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
- import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Attributes } from "../types";
1
+ import type { Table } from "@webiny/db-dynamodb/toolbox";
2
+ import { Entity } from "@webiny/db-dynamodb/toolbox";
3
+ import type { Attributes } from "../types";
3
4
  export interface CreateSystemEntityParams {
4
5
  table: Table<string, string, string>;
5
6
  entityName: string;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import { Entity, Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createSystemEntity","params","entityName","attributes","table","Entity","name","PK","partitionKey","SK","sortKey","version","type","locale","tenant","readAPIKey","exports"],"sources":["system.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateSystemEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createSystemEntity = (params: CreateSystemEntityParams): Entity<any> => {\n const { entityName, attributes, table } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n readAPIKey: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,kBAAkB,GAAIC,MAAgC,IAAkB;EACjF,MAAM;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBE,KAAK;IACLD,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV,CAAC;MACDE,MAAM,EAAE;QACJF,IAAI,EAAE;MACV,CAAC;MACDG,UAAU,EAAE;QACRH,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACa,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { TableModifier } from "../types";
2
- import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
1
+ import type { TableModifier } from "../types";
2
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
3
  import { Table } from "@webiny/db-dynamodb/toolbox";
4
4
  export interface CreateTableParams {
5
5
  table?: TableModifier;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table, TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createTable = ({\n table,\n documentClient\n}: CreateTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAMO,MAAMC,WAAW,GAAGA,CAAC;EACxBC,KAAK;EACLC;AACe,CAAC,KAAoC;EACpD,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAhB,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["table.ts"],"sourcesContent":["import type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createTable = ({\n table,\n documentClient\n}: CreateTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMO,MAAMC,WAAW,GAAGA,CAAC;EACxBC,KAAK;EACLC;AACe,CAAC,KAAoC;EACpD,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC3EC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOb,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIY,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAhB,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { TableModifier } from "../types";
2
- import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
1
+ import type { TableModifier } from "../types";
2
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
3
3
  import { Table } from "@webiny/db-dynamodb/toolbox";
4
4
  export interface CreateElasticsearchTableParams {
5
5
  table?: TableModifier;
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAGA,CAAC;EACrCC,KAAK;EACLC;AAC4B,CAAC,KAAoC;EACjE,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIW,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAf,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_toolbox","require","createElasticsearchTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_ELASTICSEARCH","partitionKey","sortKey","DocumentClient","autoExecute","autoParse","config","Table","exports"],"sources":["tableElasticsearch.ts"],"sourcesContent":["import type { TableModifier } from \"~/types\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\n\nexport interface CreateElasticsearchTableParams {\n table?: TableModifier;\n documentClient: DynamoDBDocument;\n}\nexport const createElasticsearchTable = ({\n table,\n documentClient\n}: CreateElasticsearchTableParams): Table<string, string, string> => {\n const tableConfig: TableConstructor<string, string, string> = {\n name: process.env.DB_TABLE_ELASTICSEARCH as string,\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n autoExecute: true,\n autoParse: true\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAGA,CAAC;EACrCC,KAAK;EACLC;AAC4B,CAAC,KAAoC;EACjE,MAAMC,WAAqD,GAAG;IAC1DC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,sBAAgC;IAClDC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAER,cAAc;IAC9BS,WAAW,EAAE,IAAI;IACjBC,SAAS,EAAE;EACf,CAAC;EAED,MAAMC,MAAM,GAAG,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACE,WAAW,CAAC,GAAGA,WAAW;EAE7E,OAAO,IAAIW,cAAK,CAACD,MAAM,CAAC;AAC5B,CAAC;AAACE,OAAA,CAAAf,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -29,14 +29,7 @@ const createRichTextStorageTransformPlugin = () => {
29
29
  return storageValue;
30
30
  }
31
31
  try {
32
- const uncompressed = await compressor.getCompressor().decompress(storageValue);
33
-
34
- // We must make sure the rich text value is an object.
35
- // It is possible that it is a string if developers call the API with an already stringified value.
36
- if (typeof uncompressed === "string") {
37
- return JSON.parse(uncompressed);
38
- }
39
- return uncompressed;
32
+ return await compressor.getCompressor().decompress(storageValue);
40
33
  } catch {
41
34
  return storageValue;
42
35
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_apiHeadlessCms","_api","createRichTextStorageTransformPlugin","plugin","StorageTransformPlugin","name","fieldType","fromStorage","field","value","storageValue","plugins","WebinyError","storageId","fieldId","compressor","oneByType","CompressorPlugin","type","ex","uncompressed","getCompressor","decompress","JSON","parse","toStorage","compress","exports"],"sources":["richText.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\nexport const createRichTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.rich-text.default\",\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue, plugins }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return storageValue;\n }\n\n try {\n const uncompressed = await compressor.getCompressor().decompress(storageValue);\n\n // We must make sure the rich text value is an object.\n // It is possible that it is a string if developers call the API with an already stringified value.\n if (typeof uncompressed === \"string\") {\n return JSON.parse(uncompressed);\n }\n return uncompressed;\n } catch {\n return storageValue;\n }\n },\n toStorage: async ({ value, plugins }) => {\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return value;\n }\n try {\n return await compressor.getCompressor().compress(value);\n } catch {\n return value;\n }\n }\n });\n plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEO,MAAMG,oCAAoC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAG,IAAIC,sCAAsB,CAAC;IACtCC,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAEC,KAAK,EAAEC,YAAY;MAAEC;IAAQ,CAAC,KAAK;MAC5D,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require","_apiHeadlessCms","_api","createRichTextStorageTransformPlugin","plugin","StorageTransformPlugin","name","fieldType","fromStorage","field","value","storageValue","plugins","WebinyError","storageId","fieldId","compressor","oneByType","CompressorPlugin","type","ex","getCompressor","decompress","toStorage","compress","exports"],"sources":["richText.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\nexport const createRichTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.rich-text.default\",\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue, plugins }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return storageValue;\n }\n\n try {\n return await compressor.getCompressor().decompress(storageValue);\n } catch {\n return storageValue;\n }\n },\n toStorage: async ({ value, plugins }) => {\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return value;\n }\n try {\n return await compressor.getCompressor().compress(value);\n } catch {\n return value;\n }\n }\n });\n plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AAEO,MAAMG,oCAAoC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAG,IAAIC,sCAAsB,CAAC;IACtCC,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAEC,KAAK,EAAEC,YAAY;MAAEC;IAAQ,CAAC,KAAK;MAC5D,IAAI,CAACD,YAAY,EAAE;QACf,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;QACzC,MAAM,IAAIE,cAAW,CACjB,gFAAgFJ,KAAK,CAACK,SAAS,OAAOL,KAAK,CAACM,OAAO,GACvH,CAAC;MACL;MAEA,IAAIC,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGJ,OAAO,CAACK,SAAS,CAAmBC,qBAAgB,CAACC,IAAI,CAAC;MAC3E,CAAC,CAAC,OAAOC,EAAE,EAAE;QACT,OAAOT,YAAY;MACvB;MAEA,IAAI;QACA,OAAO,MAAMK,UAAU,CAACK,aAAa,CAAC,CAAC,CAACC,UAAU,CAACX,YAAY,CAAC;MACpE,CAAC,CAAC,MAAM;QACJ,OAAOA,YAAY;MACvB;IACJ,CAAC;IACDY,SAAS,EAAE,MAAAA,CAAO;MAAEb,KAAK;MAAEE;IAAQ,CAAC,KAAK;MACrC,IAAII,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGJ,OAAO,CAACK,SAAS,CAAmBC,qBAAgB,CAACC,IAAI,CAAC;MAC3E,CAAC,CAAC,OAAOC,EAAE,EAAE;QACT,OAAOV,KAAK;MAChB;MACA,IAAI;QACA,OAAO,MAAMM,UAAU,CAACK,aAAa,CAAC,CAAC,CAACG,QAAQ,CAACd,KAAK,CAAC;MAC3D,CAAC,CAAC,MAAM;QACJ,OAAOA,KAAK;MAChB;IACJ;EACJ,CAAC,CAAC;EACFN,MAAM,CAACE,IAAI,GAAG,kDAAkD;EAEhE,OAAOF,MAAM;AACjB,CAAC;AAACqB,OAAA,CAAAtB,oCAAA,GAAAA,oCAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { Client } from "@elastic/elasticsearch";
2
- import { PluginsContainer } from "@webiny/plugins";
3
- import { CmsModel } from "@webiny/api-headless-cms/types";
1
+ import type { Client } from "@elastic/elasticsearch";
2
+ import type { PluginsContainer } from "@webiny/plugins";
3
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
4
4
  export interface CreateElasticsearchIndexParams {
5
5
  client: Client;
6
6
  plugins: PluginsContainer;
@@ -1 +1 @@
1
- {"version":3,"names":["_CmsEntryElasticsearchIndexPlugin","require","_apiElasticsearch","_configurations","createElasticsearchIndex","params","client","plugins","model","index","configurations","es","createIndex","type","CmsEntryElasticsearchIndexPlugin","tenant","locale","onExists","console","log","name","onError","ex","error","exports"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { createIndex } from \"@webiny/api-elasticsearch\";\nimport { configurations } from \"~/configurations\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreateElasticsearchIndexParams {\n client: Client;\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { client, plugins, model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n await createIndex({\n client,\n index,\n type: CmsEntryElasticsearchIndexPlugin.type,\n tenant: model.tenant,\n locale: model.locale,\n plugins,\n onExists: () => {\n console.log(\n `Elasticsearch index \"${index}\" for the CMS model \"${model.name}\" already exists.`\n );\n },\n onError: ex => {\n console.error(\n `Could not create Elasticsearch index \"${index}\" for the CMS model \"${model.name}\".`\n );\n console.error(ex);\n return ex;\n }\n });\n};\n"],"mappings":";;;;;;AAEA,IAAAA,iCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AASO,MAAMG,wBAAwB,GAAG,MAAOC,MAAsC,IAAK;EACtF,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAEzC,MAAM;IAAEI;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCH;EACJ,CAAC,CAAC;EAEF,MAAM,IAAAI,6BAAW,EAAC;IACdN,MAAM;IACNG,KAAK;IACLI,IAAI,EAAEC,kEAAgC,CAACD,IAAI;IAC3CE,MAAM,EAAEP,KAAK,CAACO,MAAM;IACpBC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpBT,OAAO;IACPU,QAAQ,EAAEA,CAAA,KAAM;MACZC,OAAO,CAACC,GAAG,CACP,wBAAwBV,KAAK,wBAAwBD,KAAK,CAACY,IAAI,mBACnE,CAAC;IACL,CAAC;IACDC,OAAO,EAAEC,EAAE,IAAI;MACXJ,OAAO,CAACK,KAAK,CACT,yCAAyCd,KAAK,wBAAwBD,KAAK,CAACY,IAAI,IACpF,CAAC;MACDF,OAAO,CAACK,KAAK,CAACD,EAAE,CAAC;MACjB,OAAOA,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAApB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_CmsEntryElasticsearchIndexPlugin","require","_apiElasticsearch","_configurations","createElasticsearchIndex","params","client","plugins","model","index","configurations","es","createIndex","type","CmsEntryElasticsearchIndexPlugin","tenant","locale","onExists","console","log","name","onError","ex","error","exports"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { createIndex } from \"@webiny/api-elasticsearch\";\nimport { configurations } from \"~/configurations\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreateElasticsearchIndexParams {\n client: Client;\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { client, plugins, model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n await createIndex({\n client,\n index,\n type: CmsEntryElasticsearchIndexPlugin.type,\n tenant: model.tenant,\n locale: model.locale,\n plugins,\n onExists: () => {\n console.log(\n `Elasticsearch index \"${index}\" for the CMS model \"${model.name}\" already exists.`\n );\n },\n onError: ex => {\n console.error(\n `Could not create Elasticsearch index \"${index}\" for the CMS model \"${model.name}\".`\n );\n console.error(ex);\n return ex;\n }\n });\n};\n"],"mappings":";;;;;;AAEA,IAAAA,iCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AASO,MAAMG,wBAAwB,GAAG,MAAOC,MAAsC,IAAK;EACtF,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAEzC,MAAM;IAAEI;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCH;EACJ,CAAC,CAAC;EAEF,MAAM,IAAAI,6BAAW,EAAC;IACdN,MAAM;IACNG,KAAK;IACLI,IAAI,EAAEC,kEAAgC,CAACD,IAAI;IAC3CE,MAAM,EAAEP,KAAK,CAACO,MAAM;IACpBC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpBT,OAAO;IACPU,QAAQ,EAAEA,CAAA,KAAM;MACZC,OAAO,CAACC,GAAG,CACP,wBAAwBV,KAAK,wBAAwBD,KAAK,CAACY,IAAI,mBACnE,CAAC;IACL,CAAC;IACDC,OAAO,EAAEC,EAAE,IAAI;MACXJ,OAAO,CAACK,KAAK,CACT,yCAAyCd,KAAK,wBAAwBD,KAAK,CAACY,IAAI,IACpF,CAAC;MACDF,OAAO,CAACK,KAAK,CAACD,EAAE,CAAC;MACjB,OAAOA,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC;AAACE,OAAA,CAAApB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { Client } from "@elastic/elasticsearch";
2
- import { CmsModel } from "@webiny/api-headless-cms/types";
1
+ import type { Client } from "@elastic/elasticsearch";
2
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
3
3
  interface DeleteElasticsearchIndexParams {
4
4
  client: Client;
5
5
  model: CmsModel;
@@ -1 +1 @@
1
- {"version":3,"names":["_configurations","require","deleteElasticsearchIndex","params","client","model","index","configurations","es","body","exists","indices","delete","ignore_unavailable","ex","console","log","message","exports"],"sources":["deleteElasticsearchIndex.ts"],"sourcesContent":["import { Client } from \"@elastic/elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { configurations } from \"~/configurations\";\n\ninterface DeleteElasticsearchIndexParams {\n client: Client;\n model: CmsModel;\n}\n\nexport const deleteElasticsearchIndex = async (\n params: DeleteElasticsearchIndexParams\n): Promise<void> => {\n const { client, model } = params;\n\n const { index } = configurations.es({\n model\n });\n const { body: exists } = await client.indices.exists({\n index\n });\n if (!exists) {\n return;\n }\n\n try {\n await client.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n console.log(`Could not delete Elasticsearch index \"${index}\". Please do it manually.`);\n console.log(ex.message);\n }\n};\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAG,MACpCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEhC,MAAM;IAAEG;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCH;EACJ,CAAC,CAAC;EACF,MAAM;IAAEI,IAAI,EAAEC;EAAO,CAAC,GAAG,MAAMN,MAAM,CAACO,OAAO,CAACD,MAAM,CAAC;IACjDJ;EACJ,CAAC,CAAC;EACF,IAAI,CAACI,MAAM,EAAE;IACT;EACJ;EAEA,IAAI;IACA,MAAMN,MAAM,CAACO,OAAO,CAACC,MAAM,CAAC;MACxBN,KAAK;MACLO,kBAAkB,EAAE;IACxB,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,yCAAyCV,KAAK,2BAA2B,CAAC;IACtFS,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;EAC3B;AACJ,CAAC;AAACC,OAAA,CAAAhB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_configurations","require","deleteElasticsearchIndex","params","client","model","index","configurations","es","body","exists","indices","delete","ignore_unavailable","ex","console","log","message","exports"],"sources":["deleteElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@elastic/elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { configurations } from \"~/configurations\";\n\ninterface DeleteElasticsearchIndexParams {\n client: Client;\n model: CmsModel;\n}\n\nexport const deleteElasticsearchIndex = async (\n params: DeleteElasticsearchIndexParams\n): Promise<void> => {\n const { client, model } = params;\n\n const { index } = configurations.es({\n model\n });\n const { body: exists } = await client.indices.exists({\n index\n });\n if (!exists) {\n return;\n }\n\n try {\n await client.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n console.log(`Could not delete Elasticsearch index \"${index}\". Please do it manually.`);\n console.log(ex.message);\n }\n};\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAOO,MAAMC,wBAAwB,GAAG,MACpCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEhC,MAAM;IAAEG;EAAM,CAAC,GAAGC,8BAAc,CAACC,EAAE,CAAC;IAChCH;EACJ,CAAC,CAAC;EACF,MAAM;IAAEI,IAAI,EAAEC;EAAO,CAAC,GAAG,MAAMN,MAAM,CAACO,OAAO,CAACD,MAAM,CAAC;IACjDJ;EACJ,CAAC,CAAC;EACF,IAAI,CAACI,MAAM,EAAE;IACT;EACJ;EAEA,IAAI;IACA,MAAMN,MAAM,CAACO,OAAO,CAACC,MAAM,CAAC;MACxBN,KAAK;MACLO,kBAAkB,EAAE;IACxB,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,yCAAyCV,KAAK,2BAA2B,CAAC;IACtFS,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;EAC3B;AACJ,CAAC;AAACC,OAAA,CAAAhB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
3
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"names":["convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","String","match","Math","floor","v","padStart","join","convertValueFromIndex","field","type","settings","dateValue","Date","toISOString","slice","convertValueToIndex","_default","name","fieldType","unmappedType","toIndex","Array","isArray","fromIndex","exports","default"],"sources":["dateTimeIndexing.ts"],"sourcesContent":["import { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types\";\nimport { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n // TODO remove when v5 goes out\n // this is a fix for pre beta.5\n if (String(value).match(/^([0-9]{2}):([0-9]{2})/) !== null) {\n return String(value);\n }\n //\n const hours = Math.floor(value / 60 / 60);\n\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-datetime\",\n fieldType: \"datetime\",\n unmappedType: () => {\n return \"date\";\n },\n toIndex({ field, value }) {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n const dateValue = convertValueToIndex(value, field as CmsModelDateTimeField);\n return {\n value: dateValue\n };\n },\n fromIndex({ field, value }) {\n if (Array.isArray(value)) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n});\n"],"mappings":";;;;;;AAGA,MAAMA,mBAAmB,GAAIC,IAAa,IAAoB;EAC1D,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EACA,MAAM,CAACC,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EACjE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,MAAMI,mBAAmB,GAAIC,KAAc,IAAoB;EAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;IACvC,OAAO,IAAI;EACf;EACA;EACA;EACA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AAT,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","String","match","Math","floor","v","padStart","join","convertValueFromIndex","field","type","settings","dateValue","Date","toISOString","slice","convertValueToIndex","_default","name","fieldType","unmappedType","toIndex","Array","isArray","fromIndex","exports","default"],"sources":["dateTimeIndexing.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types\";\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n // TODO remove when v5 goes out\n // this is a fix for pre beta.5\n if (String(value).match(/^([0-9]{2}):([0-9]{2})/) !== null) {\n return String(value);\n }\n //\n const hours = Math.floor(value / 60 / 60);\n\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-datetime\",\n fieldType: \"datetime\",\n unmappedType: () => {\n return \"date\";\n },\n toIndex({ field, value }) {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n const dateValue = convertValueToIndex(value, field as CmsModelDateTimeField);\n return {\n value: dateValue\n };\n },\n fromIndex({ field, value }) {\n if (Array.isArray(value)) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n});\n"],"mappings":";;;;;;AAGA,MAAMA,mBAAmB,GAAIC,IAAa,IAAoB;EAC1D,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EACA,MAAM,CAACC,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EACjE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,MAAMI,mBAAmB,GAAIC,KAAc,IAAoB;EAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;IACvC,OAAO,IAAI;EACf;EACA;EACA;EACA,IAAIE,MAAM,CAACF,KAAK,CAAC,CAACG,KAAK,CAAC,wBAAwB,CAAC,KAAK,IAAI,EAAE;IACxD,OAAOD,MAAM,CAACF,KAAK,CAAC;EACxB;EACA;EACA,MAAMP,KAAK,GAAGW,IAAI,CAACC,KAAK,CAACL,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC;EAEzC,MAAMN,OAAO,GAAGU,IAAI,CAACC,KAAK,CAAC,CAACL,KAAK,GAAGP,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;EAE1D,MAAME,OAAO,GAAGS,IAAI,CAACC,KAAK,CAACL,KAAK,GAAGP,KAAK,GA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AAE,UAAU;EACrBC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAO,MAAM;EACjB,CAAC;EACDC,OAAOA,CAAC;IAAEZ,KAAK;IAAEV;EAAM,CAAC,EAAE;IACtB,IAAIuB,KAAK,CAACC,OAAO,CAACxB,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAO;QACHA,KAAK,EAAEA,KAAK,CAACH,GAAG,CAAES,CAAS,IAAK;UAC5B,OAAOW,mBAAmB,CAACX,CAAC,EAAEI,KAA8B,CAAC;QACjE,CAAC;MACL,CAAC;IACL;IACA,MAAMG,SAAS,GAAGI,mBAAmB,CAACjB,KAAK,EAAEU,KAA8B,CAAC;IAC5E,OAAO;MACHV,KAAK,EAAEa;IACX,CAAC;EACL,CAAC;EACDY,SAASA,CAAC;IAAEf,KAAK;IAAEV;EAAM,CAAC,EAAE;IACxB,IAAIuB,KAAK,CAACC,OAAO,CAACxB,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK,CAACH,GAAG,CAAES,CAAS,IAAK;QAC5B,OAAOG,qBAAqB,CAACH,CAAC,EAAEI,KAA8B,CAAC;MACnE,CAAC,CAAC;IACN;IACA,OAAOD,qBAAqB,CAACT,KAAK,EAAEU,KAA8B,CAAC;EACvE;AACJ,CAAC,CAAC;AAAAgB,OAAA,CAAAC,OAAA,GAAAT,QAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
3
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_default","type","name","fieldType","toIndex","field","getFieldTypePlugin","value","fieldTypePlugin","isSearchable","rawValue","fromIndex","undefined","exports","default"],"sources":["defaultFieldIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-default\",\n fieldType: \"*\",\n toIndex({ field, getFieldTypePlugin, value }) {\n const fieldTypePlugin = getFieldTypePlugin(field.type);\n\n // when field is searchable, assign it to `values`\n if (fieldTypePlugin.isSearchable === true) {\n return { value };\n }\n\n // when field is not searchable, move its value to `rawValues`.\n // `rawValues` is a field in ES index that's not being indexed.\n return { rawValue: value };\n },\n fromIndex({ field, getFieldTypePlugin, value, rawValue }) {\n const { isSearchable } = getFieldTypePlugin(field.type);\n /**\n * We will return the rawValue in case if not searchable and value in case of not searchable field.\n * This is to make sure that changed isSearchable parameter does not make the data to be null / undefined.\n *\n * Users can change isSearchable parameter at any time on the GraphQL field - and that could create a problem for them.\n */\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n});\n"],"mappings":";;;;;;eAEeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,2CAA2C;EACjDC,SAAS,EAAE,GAAG;EACdC,OAAOA,CAAC;IAAEC,KAAK;IAAEC,kBAAkB;IAAEC;EAAM,CAAC,EAAE;IAC1C,MAAMC,eAAe,GAAGF,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;;IAEtD;IACA,IAAIO,eAAe,CAACC,YAAY,KAAK,IAAI,EAAE;MACvC,OAAO;QAAEF;MAAM,CAAC;IACpB;;IAEA;IACA;IACA,OAAO;MAAEG,QAAQ,EAAEH;IAAM,CAAC;EAC9B,CAAC;EACDI,SAASA,CAAC;IAAEN,KAAK;IAAEC,kBAAkB;IAAEC,KAAK;IAAEG;EAAS,CAAC,EAAE;IACtD,MAAM;MAAED;IAAa,CAAC,GAAGH,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;IACvD;AACR;AACA;AACA;AACA;AACA;IACQ,IAAIQ,YAAY,EAAE;MACd,OAAOF,KAAK,KAAKK,SAAS,GAAGF,QAAQ,GAAGH,KAAK;IACjD;IACA,OAAOG,QAAQ,KAAKE,SAAS,GAAGL,KAAK,GAAGG,QAAQ;EACpD;AACJ,CAAC,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAd,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_default","type","name","fieldType","toIndex","field","getFieldTypePlugin","value","fieldTypePlugin","isSearchable","rawValue","fromIndex","undefined","exports","default"],"sources":["defaultFieldIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-default\",\n fieldType: \"*\",\n toIndex({ field, getFieldTypePlugin, value }) {\n const fieldTypePlugin = getFieldTypePlugin(field.type);\n\n // when field is searchable, assign it to `values`\n if (fieldTypePlugin.isSearchable === true) {\n return { value };\n }\n\n // when field is not searchable, move its value to `rawValues`.\n // `rawValues` is a field in ES index that's not being indexed.\n return { rawValue: value };\n },\n fromIndex({ field, getFieldTypePlugin, value, rawValue }) {\n const { isSearchable } = getFieldTypePlugin(field.type);\n /**\n * We will return the rawValue in case if not searchable and value in case of not searchable field.\n * This is to make sure that changed isSearchable parameter does not make the data to be null / undefined.\n *\n * Users can change isSearchable parameter at any time on the GraphQL field - and that could create a problem for them.\n */\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n});\n"],"mappings":";;;;;;eAEeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,2CAA2C;EACjDC,SAAS,EAAE,GAAG;EACdC,OAAOA,CAAC;IAAEC,KAAK;IAAEC,kBAAkB;IAAEC;EAAM,CAAC,EAAE;IAC1C,MAAMC,eAAe,GAAGF,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;;IAEtD;IACA,IAAIO,eAAe,CAACC,YAAY,KAAK,IAAI,EAAE;MACvC,OAAO;QAAEF;MAAM,CAAC;IACpB;;IAEA;IACA;IACA,OAAO;MAAEG,QAAQ,EAAEH;IAAM,CAAC;EAC9B,CAAC;EACDI,SAASA,CAAC;IAAEN,KAAK;IAAEC,kBAAkB;IAAEC,KAAK;IAAEG;EAAS,CAAC,EAAE;IACtD,MAAM;MAAED;IAAa,CAAC,GAAGH,kBAAkB,CAACD,KAAK,CAACJ,IAAI,CAAC;IACvD;AACR;AACA;AACA;AACA;AACA;IACQ,IAAIQ,YAAY,EAAE;MACd,OAAOF,KAAK,KAAKK,SAAS,GAAGF,QAAQ,GAAGH,KAAK;IACjD;IACA,OAAOG,QAAQ,KAAKE,SAAS,GAAGL,KAAK,GAAGG,QAAQ;EACpD;AACJ,CAAC,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAd,QAAA","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  export declare const createJsonIndexing: () => CmsModelFieldToElasticsearchPlugin;
@@ -1 +1 @@
1
- {"version":3,"names":["createJsonIndexing","type","name","fieldType","toIndex","value","rawValue","fromIndex","exports"],"sources":["jsonIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport const createJsonIndexing = (): CmsModelFieldToElasticsearchPlugin => {\n return {\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-json\",\n fieldType: \"json\",\n toIndex({ value }) {\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,kBAAkB,GAAGA,CAAA,KAA0C;EACxE,OAAO;IACHC,IAAI,EAAE,mCAAmC;IACzCC,IAAI,EAAE,wCAAwC;IAC9CC,SAAS,EAAE,MAAM;IACjBC,OAAOA,CAAC;MAAEC;IAAM,CAAC,EAAE;MACf,OAAO;QACHC,QAAQ,EAAED;MACd,CAAC;IACL,CAAC;IACDE,SAASA,CAAC;MAAED;IAAS,CAAC,EAAE;MACpB,OAAOA,QAAQ;IACnB;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAR,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["createJsonIndexing","type","name","fieldType","toIndex","value","rawValue","fromIndex","exports"],"sources":["jsonIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport const createJsonIndexing = (): CmsModelFieldToElasticsearchPlugin => {\n return {\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-json\",\n fieldType: \"json\",\n toIndex({ value }) {\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n };\n};\n"],"mappings":";;;;;;AAEO,MAAMA,kBAAkB,GAAGA,CAAA,KAA0C;EACxE,OAAO;IACHC,IAAI,EAAE,mCAAmC;IACzCC,IAAI,EAAE,wCAAwC;IAC9CC,SAAS,EAAE,MAAM;IACjBC,OAAOA,CAAC;MAAEC;IAAM,CAAC,EAAE;MACf,OAAO;QACHC,QAAQ,EAAED;MACd,CAAC;IACL,CAAC;IACDE,SAASA,CAAC;MAAED;IAAS,CAAC,EAAE;MACpB,OAAOA,QAAQ;IACnB;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAR,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  /**
3
3
  * The long-text indexing plugin must take in consideration that users might have list of long-text fields.
4
4
  * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.
@@ -1 +1 @@
1
- {"version":3,"names":["_default","type","name","fieldType","toIndex","rawValue","value","Array","isArray","fromIndex","exports","default"],"sources":["longTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\n/**\n * The long-text indexing plugin must take in consideration that users might have list of long-text fields.\n * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.\n */\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-long-text\",\n fieldType: \"long-text\",\n toIndex({ rawValue }) {\n /**\n * We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.\n */\n return {\n value: Array.isArray(rawValue) ? rawValue : rawValue || \"\"\n };\n },\n /**\n * When taking value from the index, we can return the original value.\n * At that point the `transformFromStorage` does not need to do anything.\n *\n * We need to decode to support older systems.\n */\n fromIndex({ value }) {\n if (Array.isArray(value)) {\n return value;\n }\n return value || \"\";\n }\n});\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AAHA,IAAAA,QAAA,GAIeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAS,CAAC,EAAE;IAClB;AACR;AACA;IACQ,OAAO;MACHC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAGA,QAAQ,IAAI;IAC5D,CAAC;EACL,CAAC;EACD;AACJ;AACA;AACA;AACA;AACA;EACII,SAASA,CAAC;IAAEH;EAAM,CAAC,EAAE;IACjB,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK;IAChB;IACA,OAAOA,KAAK,IAAI,EAAE;EACtB;AACJ,CAAC,CAAC;AAAAI,OAAA,CAAAC,OAAA,GAAAX,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_default","type","name","fieldType","toIndex","rawValue","value","Array","isArray","fromIndex","exports","default"],"sources":["longTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\n/**\n * The long-text indexing plugin must take in consideration that users might have list of long-text fields.\n * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.\n */\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-long-text\",\n fieldType: \"long-text\",\n toIndex({ rawValue }) {\n /**\n * We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.\n */\n return {\n value: Array.isArray(rawValue) ? rawValue : rawValue || \"\"\n };\n },\n /**\n * When taking value from the index, we can return the original value.\n * At that point the `transformFromStorage` does not need to do anything.\n *\n * We need to decode to support older systems.\n */\n fromIndex({ value }) {\n if (Array.isArray(value)) {\n return value;\n }\n return value || \"\";\n }\n});\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AAHA,IAAAA,QAAA,GAIeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAS,CAAC,EAAE;IAClB;AACR;AACA;IACQ,OAAO;MACHC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAGA,QAAQ,IAAI;IAC5D,CAAC;EACL,CAAC;EACD;AACJ;AACA;AACA;AACA;AACA;EACII,SAASA,CAAC;IAAEH;EAAM,CAAC,EAAE;IACjB,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK;IAChB;IACA,OAAOA,KAAK,IAAI,EAAE;EACtB;AACJ,CAAC,CAAC;AAAAI,OAAA,CAAAC,OAAA,GAAAX,QAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
3
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"names":["convertToString","value","Array","isArray","map","String","convertToFloat","parseFloat","v","_default","type","name","fieldType","unmappedType","toIndex","fromIndex","exports","default"],"sources":["numberIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nconst convertToString = (value: number[] | number) => {\n if (Array.isArray(value) === false) {\n return value;\n }\n return (value as number[]).map(String);\n};\n\nconst convertToFloat = (value: string[] | number) => {\n if (Array.isArray(value) === false) {\n return typeof value === \"string\" ? parseFloat(value) : value;\n }\n return (value as string[]).map(v => parseFloat(v));\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-number\",\n fieldType: \"number\",\n unmappedType: () => {\n return \"float\";\n },\n toIndex({ value }) {\n return {\n value: convertToString(value)\n };\n },\n fromIndex({ value }) {\n return convertToFloat(value);\n }\n});\n"],"mappings":";;;;;;AAEA,MAAMA,eAAe,GAAIC,KAAwB,IAAK;EAClD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAOA,KAAK;EAChB;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACC,MAAM,CAAC;AAC1C,CAAC;AAED,MAAMC,cAAc,GAAIL,KAAwB,IAAK;EACjD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGM,UAAU,CAACN,KAAK,CAAC,GAAGA,KAAK;EAChE;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACI,CAAC,IAAID,UAAU,CAACC,CAAC,CAAC,CAAC;AACtD,CAAC;AAAC,IAAAC,QAAA,GAEaA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,0CAA0C;EAChDC,SAAS,EAAE,QAAQ;EACnBC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAO,OAAO;EAClB,CAAC;EACDC,OAAOA,CAAC;IAAEb;EAAM,CAAC,EAAE;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAK;IAChC,CAAC;EACL,CAAC;EACDc,SAASA,CAAC;IAAEd;EAAM,CAAC,EAAE;IACjB,OAAOK,cAAc,CAACL,KAAK,CAAC;EAChC;AACJ,CAAC,CAAC;AAAAe,OAAA,CAAAC,OAAA,GAAAR,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["convertToString","value","Array","isArray","map","String","convertToFloat","parseFloat","v","_default","type","name","fieldType","unmappedType","toIndex","fromIndex","exports","default"],"sources":["numberIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nconst convertToString = (value: number[] | number) => {\n if (Array.isArray(value) === false) {\n return value;\n }\n return (value as number[]).map(String);\n};\n\nconst convertToFloat = (value: string[] | number) => {\n if (Array.isArray(value) === false) {\n return typeof value === \"string\" ? parseFloat(value) : value;\n }\n return (value as string[]).map(v => parseFloat(v));\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-number\",\n fieldType: \"number\",\n unmappedType: () => {\n return \"float\";\n },\n toIndex({ value }) {\n return {\n value: convertToString(value)\n };\n },\n fromIndex({ value }) {\n return convertToFloat(value);\n }\n});\n"],"mappings":";;;;;;AAEA,MAAMA,eAAe,GAAIC,KAAwB,IAAK;EAClD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAOA,KAAK;EAChB;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACC,MAAM,CAAC;AAC1C,CAAC;AAED,MAAMC,cAAc,GAAIL,KAAwB,IAAK;EACjD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGM,UAAU,CAACN,KAAK,CAAC,GAAGA,KAAK;EAChE;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACI,CAAC,IAAID,UAAU,CAACC,CAAC,CAAC,CAAC;AACtD,CAAC;AAAC,IAAAC,QAAA,GAEaA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,0CAA0C;EAChDC,SAAS,EAAE,QAAQ;EACnBC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAO,OAAO;EAClB,CAAC;EACDC,OAAOA,CAAC;IAAEb;EAAM,CAAC,EAAE;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAK;IAChC,CAAC;EACL,CAAC;EACDc,SAASA,CAAC;IAAEd;EAAM,CAAC,EAAE;IACjB,OAAOK,cAAc,CAACL,KAAK,CAAC;EAChC;AACJ,CAAC,CAAC;AAAAe,OAAA,CAAAC,OAAA,GAAAR,QAAA","ignoreList":[]}
@@ -7,6 +7,6 @@
7
7
  * This change will be incompatible with the current systems so we will need to release a major version.
8
8
  *
9
9
  */
10
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
10
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
11
11
  declare const _default: () => CmsModelFieldToElasticsearchPlugin;
12
12
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_helpers","require","processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","identifiers","getFieldIdentifiers","valueIdentifier","rawValueIdentifier","undefined","reduce","processFromIndex","fromIndex","_default","name","fieldType","initialValue","initialRawValue","settings","multipleValues","result","key","push","length","source","map","_","index","exports","default"],"sources":["objectIndexing.ts"],"sourcesContent":["/**\n * TODO remove rawValue when field aliases and field types targeting will be active.\n *\n * Currently we use rawValue for the values that we do not want to be indexed.\n * When field aliases and types in the value path will be active, we can target the keys directly.\n *\n * This change will be incompatible with the current systems so we will need to release a major version.\n *\n */\n\nimport { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { getFieldIdentifiers } from \"~/helpers\";\n\ninterface ProcessToIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<\"value\" | \"rawValue\", Record<string, any>>;\n}\n\ninterface ProcessFromIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<string, any>;\n}\n\ninterface ReducerValue {\n value: {\n [key: string]: string;\n };\n rawValue: {\n [key: string]: string;\n };\n}\n\nconst processToIndex: ProcessToIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: ReducerValue, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.toIndex) {\n return values;\n }\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, { value: {}, rawValue: {} });\n};\nconst processFromIndex: ProcessFromIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: Record<string, string>, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.fromIndex) {\n return values;\n }\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, {});\n};\n\ninterface ToIndexMultipleFieldValue {\n value: Record<string, string>[];\n rawValue: Record<string, string>[];\n}\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-object\",\n fieldType: \"object\",\n toIndex({\n plugins,\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin\n }) {\n if (!initialValue) {\n return {\n value: null\n };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n const result: ToIndexMultipleFieldValue = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n },\n fromIndex({ field, value, rawValue, model, plugins, getFieldIndexPlugin, getFieldTypePlugin }) {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n /**\n * Why this `value || rawValue || []`?\n * It's possible that an object contains all non-indexable fields, or vice-versa, and so\n * we can never be sure which array we can reliably use as a source of values.\n */\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) =>\n processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n })\n );\n }\n\n return processFromIndex({\n value,\n rawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n }\n});\n"],"mappings":";;;;;;AAiBA,IAAAA,QAAA,GAAAC,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA,MAAMC,cAA8B,GAAGA,CAAC;EACpCC,MAAM;EACNC,KAAK,EAAEC,WAAW;EAClBC,QAAQ,EAAEC,cAAc;EACxBC,mBAAmB;EACnBC,kBAAkB;EAClBC,OAAO;EACPC;AACJ,CAAC,KAAK;EACF,MAAMC,OAAO,GAAGA,CAACC,MAAoB,EAAEC,KAAoB,KAAK;IAC5D,MAAMC,MAAM,GAAGP,mBAAmB,CAACM,KAAK,CAACE,IAAI,CAAC;IAC9C,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,EAAE;MAC5B,OAAOJ,MAAM;IACjB;IA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;AACA;IACQ,IAAIW,KAAK,CAACkB,cAAc,EAAE;MACtB;AACZ;AACA;AACA;AACA;MACY,MAAMK,MAAM,GAAGjC,KAAK,IAAIE,QAAQ,IAAI,EAAE;MAEtC,OAAO+B,MAAM,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,KAAa,KACpChB,gBAAgB,CAAC;QACbpB,KAAK,EAAEA,KAAK,GAAGA,KAAK,CAACoC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACtClC,QAAQ,EAAEA,QAAQ,GAAGA,QAAQ,CAACkC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/ChC,mBAAmB;QACnBC,kBAAkB;QAClBE,KAAK;QACLD,OAAO;QACPP;MACJ,CAAC,CACL,CAAC;IACL;IAEA,OAAOqB,gBAAgB,CAAC;MACpBpB,KAAK;MACLE,QAAQ;MACRE,mBAAmB;MACnBC,kBAAkB;MAClBE,KAAK;MACLD,OAAO;MACPP;IACJ,CAAC,CAAC;EACN;AACJ,CAAC,CAAC;AAAAsC,OAAA,CAAAC,OAAA,GAAAhB,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_helpers","require","processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","identifiers","getFieldIdentifiers","valueIdentifier","rawValueIdentifier","undefined","reduce","processFromIndex","fromIndex","_default","name","fieldType","initialValue","initialRawValue","settings","multipleValues","result","key","push","length","source","map","_","index","exports","default"],"sources":["objectIndexing.ts"],"sourcesContent":["/**\n * TODO remove rawValue when field aliases and field types targeting will be active.\n *\n * Currently we use rawValue for the values that we do not want to be indexed.\n * When field aliases and types in the value path will be active, we can target the keys directly.\n *\n * This change will be incompatible with the current systems so we will need to release a major version.\n *\n */\n\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport type {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { getFieldIdentifiers } from \"~/helpers\";\n\ninterface ProcessToIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<\"value\" | \"rawValue\", Record<string, any>>;\n}\n\ninterface ProcessFromIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<string, any>;\n}\n\ninterface ReducerValue {\n value: {\n [key: string]: string;\n };\n rawValue: {\n [key: string]: string;\n };\n}\n\nconst processToIndex: ProcessToIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: ReducerValue, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.toIndex) {\n return values;\n }\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, { value: {}, rawValue: {} });\n};\nconst processFromIndex: ProcessFromIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: Record<string, string>, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.fromIndex) {\n return values;\n }\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, {});\n};\n\ninterface ToIndexMultipleFieldValue {\n value: Record<string, string>[];\n rawValue: Record<string, string>[];\n}\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-object\",\n fieldType: \"object\",\n toIndex({\n plugins,\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin\n }) {\n if (!initialValue) {\n return {\n value: null\n };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n const result: ToIndexMultipleFieldValue = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n },\n fromIndex({ field, value, rawValue, model, plugins, getFieldIndexPlugin, getFieldTypePlugin }) {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n /**\n * Why this `value || rawValue || []`?\n * It's possible that an object contains all non-indexable fields, or vice-versa, and so\n * we can never be sure which array we can reliably use as a source of values.\n */\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) =>\n processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n })\n );\n }\n\n return processFromIndex({\n value,\n rawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n }\n});\n"],"mappings":";;;;;;AAiBA,IAAAA,QAAA,GAAAC,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA,MAAMC,cAA8B,GAAGA,CAAC;EACpCC,MAAM;EACNC,KAAK,EAAEC,WAAW;EAClBC,QAAQ,EAAEC,cAAc;EACxBC,mBAAmB;EACnBC,kBAAkB;EAClBC,OAAO;EACPC;AACJ,CAAC,KAAK;EACF,MAAMC,OAAO,GAAGA,CAACC,MAAoB,EAAEC,KAAoB,KAAK;IAC5D,MAAMC,MAAM,GAAGP,mBAAmB,CAACM,KAAK,CAACE,IAAI,CAAC;IAC9C,IAAI,CAACD,MAAM,IAAI,CAACA,MAAM,CAACE,OAAO,EAAE;MAC5B,OAAOJ,MAAM;IACjB;IAEA,MAAMK,WAAW,GAAG,IAAAC,4BAAmB,EAACd,WAAW,EAAEE,cAAc,EAAEO,KAAK,CAAC;IAC3E,IAAI,CAACI,WA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AAIE,QAAQ,IAAI,EAAE;MAEtC,OAAO+B,MAAM,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,KAAa,KACpChB,gBAAgB,CAAC;QACbpB,KAAK,EAAEA,KAAK,GAAGA,KAAK,CAACoC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACtClC,QAAQ,EAAEA,QAAQ,GAAGA,QAAQ,CAACkC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/ChC,mBAAmB;QACnBC,kBAAkB;QAClBE,KAAK;QACLD,OAAO;QACPP;MACJ,CAAC,CACL,CAAC;IACL;IAEA,OAAOqB,gBAAgB,CAAC;MACpBpB,KAAK;MACLE,QAAQ;MACRE,mBAAmB;MACnBC,kBAAkB;MAClBE,KAAK;MACLD,OAAO;MACPP;IACJ,CAAC,CAAC;EACN;AACJ,CAAC,CAAC;AAAAsC,OAAA,CAAAC,OAAA,GAAAhB,QAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { CmsModelFieldToElasticsearchPlugin } from "../../types";
1
+ import type { CmsModelFieldToElasticsearchPlugin } from "../../types";
2
2
  declare const _default: () => CmsModelFieldToElasticsearchPlugin;
3
3
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"names":["_default","type","name","fieldType","toIndex","value","rawValue","fromIndex","exports","default"],"sources":["richTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-rich-text\",\n fieldType: \"rich-text\",\n toIndex({ value }) {\n // TODO: convert rich-text object to a searchable string to offer full-text search at some point\n\n /**\n * We want to store rich-text value as a \"rawValue\", meaning it wont' be indexed by ES.\n */\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n});\n"],"mappings":";;;;;;eAEeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL,CAAC;EACDE,SAASA,CAAC;IAAED;EAAS,CAAC,EAAE;IACpB,OAAOA,QAAQ;EACnB;AACJ,CAAC,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAT,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_default","type","name","fieldType","toIndex","value","rawValue","fromIndex","exports","default"],"sources":["richTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-rich-text\",\n fieldType: \"rich-text\",\n toIndex({ value }) {\n // TODO: convert rich-text object to a searchable string to offer full-text search at some point\n\n /**\n * We want to store rich-text value as a \"rawValue\", meaning it wont' be indexed by ES.\n */\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n});\n"],"mappings":";;;;;;eAEeA,CAAA,MAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL,CAAC;EACDE,SAASA,CAAC;IAAED;EAAS,CAAC,EAAE;IACpB,OAAOA,QAAQ;EACnB;AACJ,CAAC,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAT,QAAA","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
1
+ import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
2
2
  declare const _default: () => CmsEntryElasticsearchQueryBuilderValueSearchPlugin[];
3
3
  export default _default;
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _timeSearch = require("./timeSearch");
8
8
  var _refSearch = require("./refSearch");
9
- var _default = () => [(0, _timeSearch.createTimeSearchPlugin)(), (0, _refSearch.createRefSearchPlugin)()];
9
+ var _searchableJson = require("./searchableJson.js");
10
+ var _default = () => [(0, _timeSearch.createTimeSearchPlugin)(), (0, _refSearch.createRefSearchPlugin)(), (0, _searchableJson.createSearchableJsonSearchPlugin)()];
10
11
  exports.default = _default;
11
12
 
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_timeSearch","require","_refSearch","_default","createTimeSearchPlugin","createRefSearchPlugin","exports","default"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch\";\nimport { createRefSearchPlugin } from \"./refSearch\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin()\n];\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAoD,IAAAE,QAAA,GAGrCA,CAAA,KAA4D,CACvE,IAAAC,kCAAsB,EAAC,CAAC,EACxB,IAAAC,gCAAqB,EAAC,CAAC,CAC1B;AAAAC,OAAA,CAAAC,OAAA,GAAAJ,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["_timeSearch","require","_refSearch","_searchableJson","_default","createTimeSearchPlugin","createRefSearchPlugin","createSearchableJsonSearchPlugin","exports","default"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch\";\nimport { createRefSearchPlugin } from \"./refSearch\";\nimport { createSearchableJsonSearchPlugin } from \"./searchableJson.js\";\nimport type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin(),\n createSearchableJsonSearchPlugin()\n];\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAuE,IAAAG,QAAA,GAGxDA,CAAA,KAA4D,CACvE,IAAAC,kCAAsB,EAAC,CAAC,EACxB,IAAAC,gCAAqB,EAAC,CAAC,EACvB,IAAAC,gDAAgC,EAAC,CAAC,CACrC;AAAAC,OAAA,CAAAC,OAAA,GAAAL,QAAA","ignoreList":[]}