@contentstack/delivery-sdk 5.1.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/legacy/assets/asset.cjs +2 -2
  2. package/dist/legacy/assets/asset.cjs.map +1 -1
  3. package/dist/legacy/assets/asset.js +2 -2
  4. package/dist/legacy/assets/asset.js.map +1 -1
  5. package/dist/legacy/common/types.cjs.map +1 -1
  6. package/dist/legacy/common/types.js.map +1 -1
  7. package/dist/legacy/entries/entries.cjs +2 -2
  8. package/dist/legacy/entries/entries.cjs.map +1 -1
  9. package/dist/legacy/entries/entries.js +2 -2
  10. package/dist/legacy/entries/entries.js.map +1 -1
  11. package/dist/legacy/entries/entry.cjs +2 -2
  12. package/dist/legacy/entries/entry.cjs.map +1 -1
  13. package/dist/legacy/entries/entry.js +2 -2
  14. package/dist/legacy/entries/entry.js.map +1 -1
  15. package/dist/legacy/query/asset-query.cjs +2 -2
  16. package/dist/legacy/query/asset-query.cjs.map +1 -1
  17. package/dist/legacy/query/asset-query.js +2 -2
  18. package/dist/legacy/query/asset-query.js.map +1 -1
  19. package/dist/legacy/query/query.cjs +1 -1
  20. package/dist/legacy/query/query.cjs.map +1 -1
  21. package/dist/legacy/query/query.js +1 -1
  22. package/dist/legacy/query/query.js.map +1 -1
  23. package/dist/modern/assets/asset.cjs +2 -2
  24. package/dist/modern/assets/asset.cjs.map +1 -1
  25. package/dist/modern/assets/asset.d.ts +2 -2
  26. package/dist/modern/assets/asset.js +2 -2
  27. package/dist/modern/assets/asset.js.map +1 -1
  28. package/dist/modern/common/types.cjs.map +1 -1
  29. package/dist/modern/common/types.d.ts +3 -2
  30. package/dist/modern/common/types.d.ts.map +1 -1
  31. package/dist/modern/common/types.js.map +1 -1
  32. package/dist/modern/entries/entries.cjs +2 -2
  33. package/dist/modern/entries/entries.cjs.map +1 -1
  34. package/dist/modern/entries/entries.d.ts +2 -2
  35. package/dist/modern/entries/entries.js +2 -2
  36. package/dist/modern/entries/entries.js.map +1 -1
  37. package/dist/modern/entries/entry.cjs +2 -2
  38. package/dist/modern/entries/entry.cjs.map +1 -1
  39. package/dist/modern/entries/entry.d.ts +2 -2
  40. package/dist/modern/entries/entry.js +2 -2
  41. package/dist/modern/entries/entry.js.map +1 -1
  42. package/dist/modern/query/asset-query.cjs +2 -2
  43. package/dist/modern/query/asset-query.cjs.map +1 -1
  44. package/dist/modern/query/asset-query.d.ts +2 -2
  45. package/dist/modern/query/asset-query.js +2 -2
  46. package/dist/modern/query/asset-query.js.map +1 -1
  47. package/dist/modern/query/query.cjs +1 -1
  48. package/dist/modern/query/query.cjs.map +1 -1
  49. package/dist/modern/query/query.js +1 -1
  50. package/dist/modern/query/query.js.map +1 -1
  51. package/package.json +11 -11
@@ -253,14 +253,14 @@ class Entry {
253
253
  * @method assetFields
254
254
  * @memberof Entry
255
255
  * @description Include specific asset fields in the response (CDA getEntry).
256
- * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.
256
+ * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.
257
257
  * @example
258
258
  * import contentstack from '@contentstack/delivery-sdk'
259
259
  *
260
260
  * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
261
261
  * const result = await stack.contentType("contentTypeUid").entry("entryUid").assetFields("user_defined_fields", "embedded_metadata").fetch();
262
262
  *
263
- * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)
263
+ * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)
264
264
  * @returns {Entry} - Returns the Entry instance for chaining.
265
265
  */
266
266
  assetFields(...fields) {
@@ -1 +1 @@
1
- {"version":3,"file":"entry.js","sources":["../../../src/entries/entry.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { ErrorMessages } from '../common/error-messages';\n\ninterface EntryResponse<T> {\n entry: T;\n}\nexport class Entry {\n protected _client: AxiosInstance;\n private _contentTypeUid: string;\n private _entryUid: string;\n private _urlPath: string;\n protected _variants: string;\n _queryParams: { [key: string]: string | number | string[] } = {};\n constructor(client: AxiosInstance, contentTypeUid: string, entryUid: string) {\n this._client = client;\n this._contentTypeUid = contentTypeUid;\n this._entryUid = entryUid;\n this._urlPath = `/content_types/${this._contentTypeUid}/entries/${this._entryUid}`;\n this._variants = '';\n }\n\n /**\n * @method includeFallback\n * @memberof Entry\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeFallback().fetch();\n */\n includeFallback(): this {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method variants\n * @memberof Entry\n * @description The variant header will be added to axios client\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('abc').entry('entry_uid').variants('xyz').fetch();\n */\n variants(variants: string | string[]): this {\n if (Array.isArray(variants) && variants.length > 0) {\n this._variants = variants.join(',');\n } else if (typeof variants == 'string' && variants.length > 0) {\n this._variants = variants;\n }\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof Entry\n * @description Include the metadata for getting metadata content for the entry.\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeMetadata().fetch();\n */\n includeMetadata(): this {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method includeEmbeddedItems\n * @memberof Entry\n * @description Include Embedded Objects (Entry and Assets) along with entry/entries details.\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeEmbeddedItems().fetch();\n */\n includeEmbeddedItems(): this {\n this._queryParams['include_embedded_items[]'] = 'BASE';\n\n return this;\n }\n\n /**\n * @method includeReference\n * @memberof Entry\n * @description To include the content of the referred entry in your response,\n * you need to use the include[] parameter and specify the UID of the reference field as value.\n * This function sets the include parameter to a reference field UID in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(entry_uid).includeReference(\"brand\").fetch()\n *\n * @param {string} referenceFieldUid - UID of the reference field to include.\n * @returns {Entry} - Returns the Entry instance for chaining.\n */\n includeReference(...referenceFieldUid: (string | string[])[]): this {\n if (referenceFieldUid.length) {\n referenceFieldUid.forEach(value => {\n if (!Array.isArray(this._queryParams['include[]'])) {\n this._queryParams['include[]'] = [];\n }\n (this._queryParams['include[]'] as string[]).push(...(Array.isArray(value) ? value : [value]));\n });\n } else {\n console.error(ErrorMessages.INVALID_ARGUMENT_STRING_OR_ARRAY);\n }\n return this;\n }\n\n /**\n * @method includeContentType\n * @memberof Entry\n * @description Include the details of the content type along with the entries details\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeContentType().fetch();\n */\n includeContentType(): this {\n this._queryParams.include_content_type = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof Entry\n * @description Includes the branch in result\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeBranch().fetch();\n */\n includeBranch(): this {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof Entry\n * @description The entry published in the locale will be fetched\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contentTypeUid').entry('entryUid').locale('en-us').fetch();\n */\n locale(locale: string): this {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method fetch\n * @memberof Entry\n * @description Fetches the entry data on the basis of the entry uid\n * @returns {Promise<T>} Promise that resolves to the entry data\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).fetch();\n */\n async fetch<T>(): Promise<T> {\n const getRequestOptions: any = { \n params: this._queryParams,\n // Add contentTypeUid and entryUid to config for improved caching\n contentTypeUid: this._contentTypeUid,\n entryUid: this._entryUid\n };\n if (this._variants) {\n getRequestOptions.headers = {\n ...getRequestOptions.headers,\n 'x-cs-variant-uid': this._variants\n };\n }\n\n const response = await getData(this._client, this._urlPath, getRequestOptions);\n\n if (response.entry) return response.entry as T;\n\n return response;\n }\n\n /**\n * @method addParams\n * @memberof Entry\n * @description Adds a query parameter to the query.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").addParams({\"key\": \"value\"}).fetch()\n *\n * @returns {Entry}\n */\n addParams(paramObj: { [key: string]: string | number | string[] }): this {\n this._queryParams = { ...this._queryParams, ...paramObj };\n\n return this;\n }\n\n /**\n * @method except\n * @memberof Entry\n * @description Excludes specific field/fields of an entry\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").except(\"fieldUID\").fetch()\n *\n * @param {string} fieldUid - field uid to exclude\n * @returns {Entry} - returns Entry object for chaining method calls\n */\n except(fieldUid: string|string[]): this {\n if (Array.isArray(fieldUid)) {\n let i = 0;\n for (const uid of fieldUid) {\n this._queryParams[`except[BASE][${i}]`] = uid;\n i++;\n }\n } else {\n this._queryParams[\"except[BASE][]\"] = fieldUid;\n }\n\n return this;\n }\n\n /**\n * @method only\n * @memberof Entry\n * @description Selects specific field/fields of an entry\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").only(\"fieldUID\").fetch()\n *\n * @param {string} fieldUid - field uid to select\n * @returns {Entry} - returns Entry object for chaining method calls\n */\n only(fieldUid: string|string[]): this {\n if (Array.isArray(fieldUid)) {\n let i = 0;\n for (const uid of fieldUid) {\n this._queryParams[`only[BASE][${i}]`] = uid;\n i++;\n }\n } else {\n this._queryParams[\"only[BASE][]\"] = fieldUid;\n }\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof Entry\n * @description Include specific asset fields in the response (CDA getEntry).\n * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").assetFields(\"user_defined_fields\", \"embedded_metadata\").fetch();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)\n * @returns {Entry} - Returns the Entry instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n}\n"],"names":[],"mappings":";;;;;;AAMO,MAAM,KAAM,CAAA;AAAA,EAOjB,WAAA,CAAY,MAAuB,EAAA,cAAA,EAAwB,QAAkB,EAAA;AAN7E,IAAU,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACV,IAAQ,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AACR,IAAU,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AACV,IAAA,aAAA,CAAA,IAAA,EAAA,cAAA,EAA8D,EAAC,CAAA,CAAA;AAE7D,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,eAAkB,GAAA,cAAA,CAAA;AACvB,IAAA,IAAA,CAAK,SAAY,GAAA,QAAA,CAAA;AACjB,IAAA,IAAA,CAAK,WAAW,CAAkB,eAAA,EAAA,IAAA,CAAK,eAAe,CAAA,SAAA,EAAY,KAAK,SAAS,CAAA,CAAA,CAAA;AAChF,IAAA,IAAA,CAAK,SAAY,GAAA,EAAA,CAAA;AAAA,GACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,eAAwB,GAAA;AACtB,IAAA,IAAA,CAAK,aAAa,gBAAmB,GAAA,MAAA,CAAA;AAErC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,SAAS,QAAmC,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,OAAO,QAAU,EAAA;AAC1B,QAAA,IAAA,CAAK,YAAa,CAAA,CAAA,WAAA,EAAc,CAAC,CAAA,CAAA,CAAG,CAAI,GAAA,GAAA,CAAA;AACxC,QAAA,CAAA,EAAA,CAAA;AAAA,OACF;AAAA,KACK,MAAA;AACL,MAAK,IAAA,CAAA,YAAA,CAAa,cAAc,CAAI,GAAA,QAAA,CAAA;AAAA,KACtC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,eAAe,MAAwB,EAAA;AACrC,IAAI,IAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,YAAA,CAAa,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"entry.js","sources":["../../../src/entries/entry.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { ErrorMessages } from '../common/error-messages';\n\ninterface EntryResponse<T> {\n entry: T;\n}\nexport class Entry {\n protected _client: AxiosInstance;\n private _contentTypeUid: string;\n private _entryUid: string;\n private _urlPath: string;\n protected _variants: string;\n _queryParams: { [key: string]: string | number | string[] } = {};\n constructor(client: AxiosInstance, contentTypeUid: string, entryUid: string) {\n this._client = client;\n this._contentTypeUid = contentTypeUid;\n this._entryUid = entryUid;\n this._urlPath = `/content_types/${this._contentTypeUid}/entries/${this._entryUid}`;\n this._variants = '';\n }\n\n /**\n * @method includeFallback\n * @memberof Entry\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeFallback().fetch();\n */\n includeFallback(): this {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method variants\n * @memberof Entry\n * @description The variant header will be added to axios client\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('abc').entry('entry_uid').variants('xyz').fetch();\n */\n variants(variants: string | string[]): this {\n if (Array.isArray(variants) && variants.length > 0) {\n this._variants = variants.join(',');\n } else if (typeof variants == 'string' && variants.length > 0) {\n this._variants = variants;\n }\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof Entry\n * @description Include the metadata for getting metadata content for the entry.\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeMetadata().fetch();\n */\n includeMetadata(): this {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method includeEmbeddedItems\n * @memberof Entry\n * @description Include Embedded Objects (Entry and Assets) along with entry/entries details.\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeEmbeddedItems().fetch();\n */\n includeEmbeddedItems(): this {\n this._queryParams['include_embedded_items[]'] = 'BASE';\n\n return this;\n }\n\n /**\n * @method includeReference\n * @memberof Entry\n * @description To include the content of the referred entry in your response,\n * you need to use the include[] parameter and specify the UID of the reference field as value.\n * This function sets the include parameter to a reference field UID in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(entry_uid).includeReference(\"brand\").fetch()\n *\n * @param {string} referenceFieldUid - UID of the reference field to include.\n * @returns {Entry} - Returns the Entry instance for chaining.\n */\n includeReference(...referenceFieldUid: (string | string[])[]): this {\n if (referenceFieldUid.length) {\n referenceFieldUid.forEach(value => {\n if (!Array.isArray(this._queryParams['include[]'])) {\n this._queryParams['include[]'] = [];\n }\n (this._queryParams['include[]'] as string[]).push(...(Array.isArray(value) ? value : [value]));\n });\n } else {\n console.error(ErrorMessages.INVALID_ARGUMENT_STRING_OR_ARRAY);\n }\n return this;\n }\n\n /**\n * @method includeContentType\n * @memberof Entry\n * @description Include the details of the content type along with the entries details\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeContentType().fetch();\n */\n includeContentType(): this {\n this._queryParams.include_content_type = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof Entry\n * @description Includes the branch in result\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).includeBranch().fetch();\n */\n includeBranch(): this {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof Entry\n * @description The entry published in the locale will be fetched\n * @returns {Entry}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contentTypeUid').entry('entryUid').locale('en-us').fetch();\n */\n locale(locale: string): this {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method fetch\n * @memberof Entry\n * @description Fetches the entry data on the basis of the entry uid\n * @returns {Promise<T>} Promise that resolves to the entry data\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(contentType_uid).entry(entry_uid).fetch();\n */\n async fetch<T>(): Promise<T> {\n const getRequestOptions: any = { \n params: this._queryParams,\n // Add contentTypeUid and entryUid to config for improved caching\n contentTypeUid: this._contentTypeUid,\n entryUid: this._entryUid\n };\n if (this._variants) {\n getRequestOptions.headers = {\n ...getRequestOptions.headers,\n 'x-cs-variant-uid': this._variants\n };\n }\n\n const response = await getData(this._client, this._urlPath, getRequestOptions);\n\n if (response.entry) return response.entry as T;\n\n return response;\n }\n\n /**\n * @method addParams\n * @memberof Entry\n * @description Adds a query parameter to the query.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").addParams({\"key\": \"value\"}).fetch()\n *\n * @returns {Entry}\n */\n addParams(paramObj: { [key: string]: string | number | string[] }): this {\n this._queryParams = { ...this._queryParams, ...paramObj };\n\n return this;\n }\n\n /**\n * @method except\n * @memberof Entry\n * @description Excludes specific field/fields of an entry\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").except(\"fieldUID\").fetch()\n *\n * @param {string} fieldUid - field uid to exclude\n * @returns {Entry} - returns Entry object for chaining method calls\n */\n except(fieldUid: string|string[]): this {\n if (Array.isArray(fieldUid)) {\n let i = 0;\n for (const uid of fieldUid) {\n this._queryParams[`except[BASE][${i}]`] = uid;\n i++;\n }\n } else {\n this._queryParams[\"except[BASE][]\"] = fieldUid;\n }\n\n return this;\n }\n\n /**\n * @method only\n * @memberof Entry\n * @description Selects specific field/fields of an entry\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").only(\"fieldUID\").fetch()\n *\n * @param {string} fieldUid - field uid to select\n * @returns {Entry} - returns Entry object for chaining method calls\n */\n only(fieldUid: string|string[]): this {\n if (Array.isArray(fieldUid)) {\n let i = 0;\n for (const uid of fieldUid) {\n this._queryParams[`only[BASE][${i}]`] = uid;\n i++;\n }\n } else {\n this._queryParams[\"only[BASE][]\"] = fieldUid;\n }\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof Entry\n * @description Include specific asset fields in the response (CDA getEntry).\n * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType(\"contentTypeUid\").entry(\"entryUid\").assetFields(\"user_defined_fields\", \"embedded_metadata\").fetch();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)\n * @returns {Entry} - Returns the Entry instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n}\n"],"names":[],"mappings":";;;;;;AAMO,MAAM,KAAM,CAAA;AAAA,EAOjB,WAAA,CAAY,MAAuB,EAAA,cAAA,EAAwB,QAAkB,EAAA;AAN7E,IAAU,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACV,IAAQ,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA,CAAA;AACR,IAAQ,aAAA,CAAA,IAAA,EAAA,UA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a,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AACF;;;;"}
@@ -118,14 +118,14 @@ class AssetQuery extends baseQuery.BaseQuery {
118
118
  * @method assetFields
119
119
  * @memberof AssetQuery
120
120
  * @description Include specific asset fields in the response (CDA getAssets).
121
- * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.
121
+ * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.
122
122
  * @example
123
123
  * import contentstack from '@contentstack/delivery-sdk'
124
124
  *
125
125
  * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
126
126
  * const result = await stack.asset().assetFields("user_defined_fields", "embedded_metadata").find();
127
127
  *
128
- * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)
128
+ * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)
129
129
  * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.
130
130
  */
131
131
  assetFields(...fields) {
@@ -1 +1 @@
1
- {"version":3,"file":"asset-query.cjs","sources":["../../../src/query/asset-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\nimport { Query } from './query';\n\nexport class AssetQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/assets';\n }\n /**\n * @method version\n * @memberof AssetQuery\n * @description Retrieve a specific version of an asset in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().version(1).find();\n */\n version(version: number): AssetQuery {\n this._queryParams.version = String(version);\n\n return this;\n }\n\n /**\n * @method includeDimension\n * @memberof AssetQuery\n * @description Includes the dimensions (height and width) of the image in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeDimension().find();\n */\n includeDimension(): AssetQuery {\n this._queryParams.include_dimension = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof AssetQuery\n * @description Includes the branch in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeBranch().find();\n */\n includeBranch(): AssetQuery {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof AssetQuery\n * @description Include the metadata for getting metadata content for the asset.\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeMetadata().find();\n */\n includeMetadata(): AssetQuery {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method relativeUrls\n * @memberof AssetQuery\n * @description Includes the relative URLs of the assets in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().relativeUrls().find();\n */\n relativeUrls(): AssetQuery {\n this._queryParams.relative_url = 'true';\n\n return this;\n }\n\n /**\n * @method includeFallback\n * @memberof AssetQuery\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeFallback().find();\n */\n includeFallback(): AssetQuery {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof AssetQuery\n * @description The assets published in the locale will be fetched\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().locale('en-us').find();\n */\n locale(locale: string): AssetQuery {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof AssetQuery\n * @description Include specific asset fields in the response (CDA getAssets).\n * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().assetFields(\"user_defined_fields\", \"embedded_metadata\").find();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)\n * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n\n /**\n * @method query\n * @memberof AssetQuery\n * @description Fetches the asset data on the basis of the query\n * @returns {Query}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().query().where('fieldUid', QueryOperation.EQUALS, 'value').find();\n */\n query() {\n return new Query(this._client, this._parameters, this._queryParams);\n }\n}\n"],"names":["BaseQuery","Query"],"mappings":";;;;;AAIO,MAAM,mBAAmBA,mBAAU,CAAA;AAAA,EACxC,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,S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A;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,OAAO,MAA4B,EAAA;AACjC,IAAA,IAAA,CAAK,aAAa,MAAS,GAAA,MAAA,CAAA;AAE3B,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,eAAe,MAAwB,EAAA;AACrC,IAAI,IAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,YAAA,CAAa,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAQ,GAAA;AACN,IAAA,OAAO,IAAIC,WAAM,CAAA,IAAA,CAAK,SAAS,IAAK,CAAA,WAAA,EAAa,KAAK,YAAY,CAAA,CAAA;AAAA,GACpE;AACF;;;;"}
1
+ {"version":3,"file":"asset-query.cjs","sources":["../../../src/query/asset-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\nimport { Query } from './query';\n\nexport class AssetQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/assets';\n }\n /**\n * @method version\n * @memberof AssetQuery\n * @description Retrieve a specific version of an asset in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().version(1).find();\n */\n version(version: number): AssetQuery {\n this._queryParams.version = String(version);\n\n return this;\n }\n\n /**\n * @method includeDimension\n * @memberof AssetQuery\n * @description Includes the dimensions (height and width) of the image in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeDimension().find();\n */\n includeDimension(): AssetQuery {\n this._queryParams.include_dimension = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof AssetQuery\n * @description Includes the branch in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeBranch().find();\n */\n includeBranch(): AssetQuery {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof AssetQuery\n * @description Include the metadata for getting metadata content for the asset.\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeMetadata().find();\n */\n includeMetadata(): AssetQuery {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method relativeUrls\n * @memberof AssetQuery\n * @description Includes the relative URLs of the assets in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().relativeUrls().find();\n */\n relativeUrls(): AssetQuery {\n this._queryParams.relative_url = 'true';\n\n return this;\n }\n\n /**\n * @method includeFallback\n * @memberof AssetQuery\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeFallback().find();\n */\n includeFallback(): AssetQuery {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof AssetQuery\n * @description The assets published in the locale will be fetched\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().locale('en-us').find();\n */\n locale(locale: string): AssetQuery {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof AssetQuery\n * @description Include specific asset fields in the response (CDA getAssets).\n * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().assetFields(\"user_defined_fields\", \"embedded_metadata\").find();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)\n * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n\n /**\n * @method query\n * @memberof AssetQuery\n * @description Fetches the asset data on the basis of the query\n * @returns {Query}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().query().where('fieldUid', QueryOperation.EQUALS, 'value').find();\n */\n query() {\n return new Query(this._client, this._parameters, this._queryParams);\n }\n}\n"],"names":["BaseQuery","Query"],"mappings":";;;;;AAIO,MAAM,mBAAmBA,mBAAU,CAAA;AAAA,EACxC,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,SAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AA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,MAA4B,EAAA;AACjC,IAAA,IAAA,CAAK,aAAa,MAAS,GAAA,MAAA,CAAA;AAE3B,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,eAAe,MAAwB,EAAA;AACrC,IAAI,IAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,YAAA,CAAa,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAQ,GAAA;AACN,IAAA,OAAO,IAAIC,WAAM,CAAA,IAAA,CAAK,SAAS,IAAK,CAAA,WAAA,EAAa,KAAK,YAAY,CAAA,CAAA;AAAA,GACpE;AACF;;;;"}
@@ -116,14 +116,14 @@ class AssetQuery extends BaseQuery {
116
116
  * @method assetFields
117
117
  * @memberof AssetQuery
118
118
  * @description Include specific asset fields in the response (CDA getAssets).
119
- * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.
119
+ * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.
120
120
  * @example
121
121
  * import contentstack from '@contentstack/delivery-sdk'
122
122
  *
123
123
  * const stack = contentstack.stack({ apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" });
124
124
  * const result = await stack.asset().assetFields("user_defined_fields", "embedded_metadata").find();
125
125
  *
126
- * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)
126
+ * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)
127
127
  * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.
128
128
  */
129
129
  assetFields(...fields) {
@@ -1 +1 @@
1
- {"version":3,"file":"asset-query.js","sources":["../../../src/query/asset-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\nimport { Query } from './query';\n\nexport class AssetQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/assets';\n }\n /**\n * @method version\n * @memberof AssetQuery\n * @description Retrieve a specific version of an asset in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().version(1).find();\n */\n version(version: number): AssetQuery {\n this._queryParams.version = String(version);\n\n return this;\n }\n\n /**\n * @method includeDimension\n * @memberof AssetQuery\n * @description Includes the dimensions (height and width) of the image in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeDimension().find();\n */\n includeDimension(): AssetQuery {\n this._queryParams.include_dimension = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof AssetQuery\n * @description Includes the branch in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeBranch().find();\n */\n includeBranch(): AssetQuery {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof AssetQuery\n * @description Include the metadata for getting metadata content for the asset.\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeMetadata().find();\n */\n includeMetadata(): AssetQuery {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method relativeUrls\n * @memberof AssetQuery\n * @description Includes the relative URLs of the assets in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().relativeUrls().find();\n */\n relativeUrls(): AssetQuery {\n this._queryParams.relative_url = 'true';\n\n return this;\n }\n\n /**\n * @method includeFallback\n * @memberof AssetQuery\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeFallback().find();\n */\n includeFallback(): AssetQuery {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof AssetQuery\n * @description The assets published in the locale will be fetched\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().locale('en-us').find();\n */\n locale(locale: string): AssetQuery {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof AssetQuery\n * @description Include specific asset fields in the response (CDA getAssets).\n * Use with asset_fields[]: user_defined_fields, embedded, ai_suggested, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().assetFields(\"user_defined_fields\", \"embedded_metadata\").find();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded, ai_suggested, visual_markups)\n * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n\n /**\n * @method query\n * @memberof AssetQuery\n * @description Fetches the asset data on the basis of the query\n * @returns {Query}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().query().where('fieldUid', QueryOperation.EQUALS, 'value').find();\n */\n query() {\n return new Query(this._client, this._parameters, this._queryParams);\n }\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,SAAU,CAAA;AAAA,EACxC,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,SAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,QAAQ,OAA6B,EAAA;AACnC,IAAK,IAAA,CAAA,YAAA,CAAa,OAAU,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAE1C,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,gBAA+B,GAAA;AAC7B,IAAA,IAAA,CAAK,aAAa,iBAAoB,GAAA,MAAA,CAAA;AAEtC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,aAA4B,GAAA;AAC1B,IAAA,IAAA,CAAK,aAAa,cAAiB,GAAA,MAAA,CAAA;AAEnC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,eAA8B,GAAA;AAC5B,IAAA,IAAA,CAAK,aAAa,gBAAmB,GAAA,MAAA,CAAA;AAErC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,YAA2B,GAAA;AACzB,IAAA,IAAA,CAAK,aAAa,YAAe,GAAA,MAAA,CAAA;AAEjC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,eAA8B,GAAA;AAC5B,IAAA,IAAA,CAAK,aAAa,gBAAmB,GAAA,MAAA,CAAA;AAErC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,OAAO,MAA4B,EAAA;AACjC,IAAA,IAAA,CAAK,aAAa,MAAS,GAAA,MAAA,CAAA;AAE3B,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,eAAe,MAAwB,EAAA;AACrC,IAAI,IAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,YAAA,CAAa,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAQ,GAAA;AACN,IAAA,OAAO,IAAI,KAAM,CAAA,IAAA,CAAK,SAAS,IAAK,CAAA,WAAA,EAAa,KAAK,YAAY,CAAA,CAAA;AAAA,GACpE;AACF;;;;"}
1
+ {"version":3,"file":"asset-query.js","sources":["../../../src/query/asset-query.ts"],"sourcesContent":["import { BaseQuery } from './base-query';\nimport { AxiosInstance } from '@contentstack/core';\nimport { Query } from './query';\n\nexport class AssetQuery extends BaseQuery {\n constructor(client: AxiosInstance) {\n super();\n this._client = client;\n this._urlPath = '/assets';\n }\n /**\n * @method version\n * @memberof AssetQuery\n * @description Retrieve a specific version of an asset in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().version(1).find();\n */\n version(version: number): AssetQuery {\n this._queryParams.version = String(version);\n\n return this;\n }\n\n /**\n * @method includeDimension\n * @memberof AssetQuery\n * @description Includes the dimensions (height and width) of the image in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeDimension().find();\n */\n includeDimension(): AssetQuery {\n this._queryParams.include_dimension = 'true';\n\n return this;\n }\n\n /**\n * @method includeBranch\n * @memberof AssetQuery\n * @description Includes the branch in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeBranch().find();\n */\n includeBranch(): AssetQuery {\n this._queryParams.include_branch = 'true';\n\n return this;\n }\n\n /**\n * @method includeMetadata\n * @memberof AssetQuery\n * @description Include the metadata for getting metadata content for the asset.\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeMetadata().find();\n */\n includeMetadata(): AssetQuery {\n this._queryParams.include_metadata = 'true';\n\n return this;\n }\n\n /**\n * @method relativeUrls\n * @memberof AssetQuery\n * @description Includes the relative URLs of the assets in result\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().relativeUrls().find();\n */\n relativeUrls(): AssetQuery {\n this._queryParams.relative_url = 'true';\n\n return this;\n }\n\n /**\n * @method includeFallback\n * @memberof AssetQuery\n * @description When an entry is not published in a specific language, content can be fetched from its fallback language\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().includeFallback().find();\n */\n includeFallback(): AssetQuery {\n this._queryParams.include_fallback = 'true';\n\n return this;\n }\n\n /**\n * @method locale\n * @memberof AssetQuery\n * @description The assets published in the locale will be fetched\n * @returns {AssetQuery}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().locale('en-us').find();\n */\n locale(locale: string): AssetQuery {\n this._queryParams.locale = locale;\n\n return this;\n }\n\n /**\n * @method assetFields\n * @memberof AssetQuery\n * @description Include specific asset fields in the response (CDA getAssets).\n * Use with asset_fields[]: user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().assetFields(\"user_defined_fields\", \"embedded_metadata\").find();\n *\n * @param {...string} fields - Asset field names to include (e.g. user_defined_fields, embedded_metadata, ai_generated_metadata, visual_markups)\n * @returns {AssetQuery} - Returns the AssetQuery instance for chaining.\n */\n assetFields(...fields: string[]): this {\n if (fields.length > 0) {\n this._queryParams['asset_fields[]'] = fields;\n }\n return this;\n }\n\n /**\n * @method query\n * @memberof AssetQuery\n * @description Fetches the asset data on the basis of the query\n * @returns {Query}\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.asset().query().where('fieldUid', QueryOperation.EQUALS, 'value').find();\n */\n query() {\n return new Query(this._client, this._parameters, this._queryParams);\n }\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,SAAU,CAAA;AAAA,EACxC,YAAY,MAAuB,EAAA;AACjC,IAAM,KAAA,EAAA,CAAA;AACN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,QAAW,GAAA,SAAA,CAAA;AAAA,GAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,QAAQ,OAA6B,EAAA;AACnC,IAAK,IAAA,CAAA,YAAA,CAAa,OAAU,GAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAE1C,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,gBAA+B,GAAA;AAC7B,IAAA,IAAA,CAAK,aAAa,iBAAoB,GAAA,MAAA,CAAA;AAEtC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,aAA4B,GAAA;AAC1B,IAAA,IAAA,CAAK,aAAa,cAAiB,GAAA,MAAA,CAAA;AAEnC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,eAA8B,GAAA;AAC5B,IAAA,IAAA,CAAK,aAAa,gBAAmB,GAAA,MAAA,CAAA;AAErC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,YAA2B,GAAA;AACzB,IAAA,IAAA,CAAK,aAAa,YAAe,GAAA,MAAA,CAAA;AAEjC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,eAA8B,GAAA;AAC5B,IAAA,IAAA,CAAK,aAAa,gBAAmB,GAAA,MAAA,CAAA;AAErC,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,OAAO,MAA4B,EAAA;AACjC,IAAA,IAAA,CAAK,aAAa,MAAS,GAAA,MAAA,CAAA;AAE3B,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,eAAe,MAAwB,EAAA;AACrC,IAAI,IAAA,MAAA,CAAO,SAAS,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,YAAA,CAAa,gBAAgB,CAAI,GAAA,MAAA,CAAA;AAAA,KACxC;AACA,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,KAAQ,GAAA;AACN,IAAA,OAAO,IAAI,KAAM,CAAA,IAAA,CAAK,SAAS,IAAK,CAAA,WAAA,EAAa,KAAK,YAAY,CAAA,CAAA;AAAA,GACpE;AACF;;;;"}
@@ -33,7 +33,7 @@ class Query extends baseQuery.BaseQuery {
33
33
  }
34
34
  // Validate if input matches safe regex patterns
35
35
  isValidRegexPattern(input) {
36
- const validRegex = /^[a-zA-Z0-9|^$.*+?()[\]{}:,;&@#%=/!'"_~<> -]+$/;
36
+ const validRegex = /^[a-zA-Z0-9|^$.*+?()[\]{}\\:,;&@#%=/!'"_~<>` -]+$/;
37
37
  if (!validRegex.test(input)) {
38
38
  return false;
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"query.cjs","sources":["../../../src/query/query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { BaseQuery } from './base-query';\nimport { BaseQueryParameters, QueryOperation, QueryOperator, TaxonomyQueryOperation, params, queryParams, FindResponse } from '../common/types';\nimport { encodeQueryParams } from '../common/utils';\nimport { ErrorMessages } from '../common/error-messages';\n\nexport class Query extends BaseQuery {\n private _contentTypeUid?: string;\n\n constructor(client: AxiosInstance, params: params, queryParams: queryParams, variants?: string, uid?: string, queryObj?: { [key: string]: any }) {\n super();\n this._client = client;\n this._contentTypeUid = uid;\n this._urlPath = `/content_types/${this._contentTypeUid}/entries`;\n this._parameters = params || {};\n this._queryParams = queryParams || {};\n this._variants = variants || '';\n\n if (!uid) {\n this._urlPath = `/assets`;\n }\n if (queryObj) {\n this._parameters = { ...this._parameters, ...queryObj };\n }\n }\n // Validate if input is alphanumeric \n private isValidAlphanumeric(input: string): boolean {\n const alphanumericRegex = /^[a-zA-Z0-9_.-]+$/;\n return alphanumericRegex.test(input);\n }\n\n // Validate if input matches safe regex patterns\n private isValidRegexPattern(input: string): boolean {\n // Expanded whitelist: includes spaces and common safe special characters\n // Allows: alphanumeric, regex metacharacters, regular spaces, and common punctuation\n // Blocks: control characters (newlines, tabs, null bytes), backticks, and other dangerous chars\n const validRegex = /^[a-zA-Z0-9|^$.*+?()[\\]{}:,;&@#%=/!'\"_~<> -]+$/;\n if (!validRegex.test(input)) {\n return false;\n }\n try {\n new RegExp(input);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n private isValidValue(value: any[]): boolean {\n return Array.isArray(value) && value.every(item => typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean');\n }\n\n /**\n * @method where\n * @memberof Query\n * @description Filters the results based on the specified criteria.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.where(\"field_UID\", QueryOperation.IS_LESS_THAN, [\"field1\", \"field2\"]).find()\n * // OR\n * const asset = await stack.asset().query().where(\"field_UID\", QueryOperation.IS_LESS_THAN, [\"field1\", \"field2\"]).find()\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.where(\"field_UID\", QueryOperation.MATCHES, [\"field1\", \"field2\"]).find()\n * @returns {Query}\n */\n where(\n fieldUid: string,\n queryOperation: QueryOperation | TaxonomyQueryOperation,\n fields: string | string[] | number | number[] | object | boolean,\n additionalData?: object\n ): Query {\n if (!this.isValidAlphanumeric(fieldUid)) {\n console.error(ErrorMessages.INVALID_FIELD_UID);\n return this;\n }\n if (queryOperation == QueryOperation.EQUALS) {\n this._parameters[fieldUid] = fields;\n }\n else {\n const parameterValue: { [key in QueryOperation]?: string | string[] } = { [queryOperation]: fields, ...additionalData };\n this._parameters[fieldUid] = parameterValue;\n }\n return this;\n }\n\n /**\n * @method regex\n * @memberof Query\n * @description Retrieve entries that match the provided regular expressions\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.regex('title','^Demo').find()\n * // OR\n * const result = await query.regex('title','^Demo', 'i').find() // regex with options\n * @returns {Query}\n */\n regex(fieldUid: string, regexPattern: string, options?: string): Query {\n if (!this.isValidAlphanumeric(fieldUid)) {\n console.error(ErrorMessages.INVALID_FIELD_UID);\n return this;\n }\n if (!this.isValidRegexPattern(regexPattern)) {\n throw new Error(ErrorMessages.INVALID_REGEX_PATTERN);\n }\n else {\n this._parameters[fieldUid] = { $regex: regexPattern };\n if (options) this._parameters[fieldUid].$options = options;\n return this;\n }\n }\n\n /**\n * @method whereIn\n * @memberof Query\n * @description Get entries having values based on referenced fields.\n * The query retrieves all entries that satisfy the query conditions made on referenced fields\n * This method sets the '$in_query' parameter to a reference field UID and a query instance in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const subQuery = stack.contentType(\"referencedContentTypeUid\").entry().query().where(\"title\", QueryOperation.EQUALS, \"value\");\n * query.whereIn(\"brand\", subQuery)\n * const result = await query.find()\n *\n * @param {string} referenceUid - UID of the reference field to query.\n * @param {Query} queryInstance - The Query instance to include in the where clause.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n whereIn(referenceUid: string, queryInstance: Query): Query {\n // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier\n if (!this.isValidAlphanumeric(referenceUid)) {\n throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid));\n }\n this._parameters[referenceUid] = { '$in_query': queryInstance._parameters };\n return this;\n }\n\n /**\n * @method whereNotIn\n * @memberof Query\n * @description Get entries having values based on referenced fields.\n * This query works the opposite of $in_query and retrieves all entries that does not satisfy query conditions made on referenced fields.\n * This method sets the '$nin_query' parameter to a reference field UID and a query instance in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const subQuery = stack.contentType(\"referencedContentTypeUid\").entry().query().where(\"title\", QueryOperation.EQUALS, \"value\");\n * query.whereNotIn(\"brand\", subQuery)\n * const result = await query.find()\n *\n * @param {string} referenceUid - UID of the reference field to query.\n * @param {Query} queryInstance - The Query instance to include in the where clause.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n whereNotIn(referenceUid: string, queryInstance: Query): Query {\n // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier\n if (!this.isValidAlphanumeric(referenceUid)) {\n throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid));\n }\n this._parameters[referenceUid] = { '$nin_query': queryInstance._parameters };\n return this;\n }\n\n /**\n * @method queryOperator\n * @memberof Query\n * @description In case of '$and' get entries that satisfy all the conditions provided in the '$and' query and\n * in case of '$or' query get all entries that satisfy at least one of the given conditions provided in the '$or' query.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentType1Uid\").entry().query();\n * const subQuery1 = stack.contentType(\"contentType2Uid\").entry().query().where(\"price\", QueryOperation.IS_LESS_THAN, 90);\n * const subQuery2 = stack.contentType(\"contentType3Uid\").entry().query().where(\"discount\", QueryOperation.INCLUDES, [20, 45]);\n * query.queryOperator(QueryOperator.AND, subQuery1, subQuery2)\n * const result = await query.find()\n *\n * @param {QueryOperator} queryType - The type of query operator to apply.\n * @param {...Query[]} queryObjects - The Query instances to apply the query to.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n queryOperator(queryType: QueryOperator, ...queryObjects: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queryObjects) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters[queryType] = paramsList;\n\n return this;\n }\n\n /**\n * @method getQuery\n * @memberof Query\n * @description Returns the raw (JSON) query based on the filters applied on Query object.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = query.getQuery()\n * // OR\n * const assetQuery = stack.asset().query();\n * const assetResult = assetQuery.getQuery()\n *\n * @returns {{ [key: string]: any }} The raw query object\n */\n getQuery(): { [key: string]: any } {\n return this._parameters;\n }\n\n /**\n * @method containedIn\n * @memberof Query\n * @description Filters entries where the field value is contained in the provided array of values\n * @param {string} key - The field UID to filter on\n * @param {(string | number | boolean)[]} value - Array of values to match against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.containedIn('fieldUid', ['value1', 'value2']).find()\n * \n * @returns {Query}\n */\n containedIn(key: string, value: (string | number | boolean)[]): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (!this.isValidValue(value)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters[key] = { '$in': value };\n return this;\n }\n\n /**\n * @method notContainedIn\n * @memberof Query\n * @description Filters entries where the field value is not contained in the provided array of values\n * @param {string} key - The field UID to filter on\n * @param {(string | number | boolean)[]} value - Array of values to exclude\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.notContainedIn('fieldUid', ['value1', 'value2']).find()\n * \n * @returns {Query}\n */\n notContainedIn(key: string, value: (string | number | boolean)[]): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (!this.isValidValue(value)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters[key] = { '$nin': value };\n return this;\n }\n\n /**\n * @method exists\n * @memberof Query\n * @description Filters entries where the specified field exists\n * @param {string} key - The field UID to check for existence\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.exists('fieldUid').find()\n * \n * @returns {Query}\n */\n exists(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$exists': true };\n return this;\n }\n\n /**\n * @method notExists\n * @memberof Query\n * @description Filters entries where the specified field does not exist\n * @param {string} key - The field UID to check for non-existence\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.notExists('fieldUid').find()\n * \n * @returns {Query}\n */\n notExists(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$exists': false };\n return this;\n }\n\n /**\n * @method or\n * @memberof Query\n * @description Combines multiple queries with OR logic - returns entries that match at least one of the provided queries\n * @param {...Query} queries - Query instances to combine with OR logic\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);\n * const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');\n * const result = await stack.contentType('contenttype_uid').entry().query().or(query1, query2).find();\n * \n * @returns {Query}\n */\n or(...queries: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queries) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters.$or = paramsList;\n return this;\n }\n\n /**\n * @method and\n * @memberof Query\n * @description Combines multiple queries with AND logic - returns entries that match all of the provided queries\n * @param {...Query} queries - Query instances to combine with AND logic\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);\n * const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');\n * const result = await stack.contentType('contenttype_uid').entry().query().and(query1, query2).find();\n * \n * @returns {Query}\n */\n and(...queries: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queries) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters.$and = paramsList;\n return this;\n }\n\n /**\n * @method equalTo\n * @memberof Query\n * @description Filters entries where the field value equals the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number | boolean} value - The value to match\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().equalTo('fieldUid', 'value').find();\n * \n * @returns {Query}\n */\n equalTo(key: string, value: string | number | boolean): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = value;\n return this;\n }\n\n /**\n * @method notEqualTo\n * @memberof Query\n * @description Filters entries where the field value does not equal the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number | boolean} value - The value to exclude\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().notEqualTo('fieldUid', 'value').find();\n * \n * @returns {Query}\n */\n notEqualTo(key: string, value: string | number | boolean): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$ne': value };\n return this;\n }\n\n /**\n * @method referenceIn\n * @memberof Query\n * @description Filters entries where the reference field matches entries from the provided query\n * @param {string} key - The reference field UID to filter on\n * @param {Query} query - Query instance to match referenced entries against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');\n * const result = await stack.contentType('contenttype_uid').entry().query().referenceIn('reference_uid', subQuery).find();\n * \n * @returns {Query}\n */\n referenceIn(key: string, query: Query): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$in_query': query._parameters }\n return this;\n }\n\n /**\n * @method referenceNotIn\n * @memberof Query\n * @description Filters entries where the reference field does not match entries from the provided query\n * @param {string} key - The reference field UID to filter on\n * @param {Query} query - Query instance to exclude referenced entries against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');\n * const result = await stack.contentType('contenttype_uid').entry().query().referenceNotIn('reference_uid', subQuery).find();\n * \n * @returns {Query}\n */\n referenceNotIn(key: string, query: Query): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$nin_query': query._parameters }\n return this;\n }\n\n /**\n * @method tags\n * @memberof Query\n * @description Filters entries that have any of the specified tags\n * @param {(string | number | boolean)[]} values - Array of tag values to filter by\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().tags(['tag1']).find();\n * \n * @returns {Query}\n */\n tags(values: (string | number | boolean)[]): Query {\n if (!this.isValidValue(values)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters['tags'] = values;\n return this;\n }\n\n /**\n * @method search\n * @memberof Query\n * @description Enables typeahead search functionality for the query\n * @param {string} key - The search term to use for typeahead search\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().search('key').find();\n * \n * @returns {Query}\n */\n search(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._queryParams['typeahead'] = key\n return this\n }\n\n /**\n * @method lessThan\n * @memberof Query\n * @description Filters entries where the field value is less than the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().lessThan('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n lessThan(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n\n this._parameters[key] = { '$lt': value };\n return this;\n }\n\n /**\n * @method lessThanOrEqualTo\n * @memberof Query\n * @description Filters entries where the field value is less than or equal to the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().lessThanOrEqualTo('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n lessThanOrEqualTo(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$lte': value };\n return this;\n }\n\n /**\n * @method greaterThan\n * @memberof Query\n * @description Filters entries where the field value is greater than the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().greaterThan('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n greaterThan(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$gt': value };\n return this;\n }\n\n /**\n * @method greaterThanOrEqualTo\n * @memberof Query\n * @description Filters entries where the field value is greater than or equal to the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().greaterThanOrEqualTo('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n greaterThanOrEqualTo(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$gte': value };\n return this;\n }\n\n /**\n * Override find method to include content type UID directly for better caching\n */\n override async find<T>(encode: boolean = false): Promise<FindResponse<T>> {\n let requestParams: { [key: string]: any } = this._queryParams;\n\n if (Object.keys(this._parameters).length > 0) {\n let queryParams = { ...this._parameters };\n \n if (encode) {\n queryParams = encodeQueryParams(queryParams);\n }\n \n requestParams = { ...this._queryParams, query: queryParams };\n }\n\n const getRequestOptions: any = { \n params: requestParams,\n // Add contentTypeUid directly for improved caching\n contentTypeUid: this._contentTypeUid\n };\n\n if (this._variants) {\n getRequestOptions.headers = {\n ...getRequestOptions.headers,\n 'x-cs-variant-uid': this._variants\n };\n }\n const response = await getData(this._client, this._urlPath, getRequestOptions);\n\n return response as FindResponse<T>;\n }\n}\n"],"names":["BaseQuery","params","queryParams","ErrorMessages","QueryOperation","encodeQueryParams","getData"],"mappings":";;;;;;;;;;;AAMO,MAAM,cAAcA,mBAAU,CAAA;AAAA,EAGnC,YAAY,MAAuBC,EAAAA,OAAAA,EAAgBC,YAA0B,EAAA,QAAA,EAAmB,KAAc,QAAmC,EAAA;AAC/I,IAAM,KAAA,EAAA,CAAA;AAHR,IAAQ,aAAA,CAAA,IAAA,EAAA,iBAAA,CAAA,CAAA;AAIN,IAAA,IAAA,CAAK,OAAU,GAAA,MAAA,CAAA;AACf,IAAA,IAAA,CAAK,eAAkB,GAAA,GAAA,CAAA;AACvB,IAAK,IAAA,CAAA,QAAA,GAAW,CAAkB,eAAA,EAAA,IAAA,CAAK,eAAe,CAAA,QAAA,CAAA,CAAA;AACtD,IAAK,IAAA,CAAA,WAAA,GAAcD,WAAU,EAAC,CAAA;AAC9B,IAAK,IAAA,CAAA,YAAA,GAAeC,gBAAe,EAAC,CAAA;AACpC,IAAA,IAAA,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AAK,WAAY,EAAA,CAAA;AAExC,MAAA,IAAI,MAAQ,EAAA;AACV,QAAAA,YAAAA,GAAcG,wBAAkBH,YAAW,CAAA,CAAA;AAAA,OAC7C;AAEA,MAAA,aAAA,GAAgB,EAAE,GAAG,IAAK,CAAA,YAAA,EAAc,OAAOA,YAAY,EAAA,CAAA;AAAA,KAC7D;AAEA,IAAA,MAAM,iBAAyB,GAAA;AAAA,MAC7B,MAAQ,EAAA,aAAA;AAAA;AAAA,MAER,gBAAgB,IAAK,CAAA,eAAA;AAAA,KACvB,CAAA;AAEA,IAAA,IAAI,KAAK,SAAW,EAAA;AAClB,MAAA,iBAAA,CAAkB,OAAU,GAAA;AAAA,QAC1B,GAAG,iBAAkB,CAAA,OAAA;AAAA,QACrB,oBAAoB,IAAK,CAAA,SAAA;AAAA,OAC3B,CAAA;AAAA,KACF;AACA,IAAA,MAAM,WAAW,MAAMI,YAAA,CAAQ,KAAK,OAAS,EAAA,IAAA,CAAK,UAAU,iBAAiB,CAAA,CAAA;AAE7E,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"query.cjs","sources":["../../../src/query/query.ts"],"sourcesContent":["import { AxiosInstance, getData } from '@contentstack/core';\nimport { BaseQuery } from './base-query';\nimport { BaseQueryParameters, QueryOperation, QueryOperator, TaxonomyQueryOperation, params, queryParams, FindResponse } from '../common/types';\nimport { encodeQueryParams } from '../common/utils';\nimport { ErrorMessages } from '../common/error-messages';\n\nexport class Query extends BaseQuery {\n private _contentTypeUid?: string;\n\n constructor(client: AxiosInstance, params: params, queryParams: queryParams, variants?: string, uid?: string, queryObj?: { [key: string]: any }) {\n super();\n this._client = client;\n this._contentTypeUid = uid;\n this._urlPath = `/content_types/${this._contentTypeUid}/entries`;\n this._parameters = params || {};\n this._queryParams = queryParams || {};\n this._variants = variants || '';\n\n if (!uid) {\n this._urlPath = `/assets`;\n }\n if (queryObj) {\n this._parameters = { ...this._parameters, ...queryObj };\n }\n }\n // Validate if input is alphanumeric \n private isValidAlphanumeric(input: string): boolean {\n const alphanumericRegex = /^[a-zA-Z0-9_.-]+$/;\n return alphanumericRegex.test(input);\n }\n\n // Validate if input matches safe regex patterns\n private isValidRegexPattern(input: string): boolean {\n // Expanded whitelist: includes spaces and common safe special characters\n // Allows: alphanumeric, regex metacharacters, regular spaces, and common punctuation\n // Blocks: control characters (newlines, tabs, null bytes), backticks, and other dangerous chars\n const validRegex = /^[a-zA-Z0-9|^$.*+?()[\\]{}\\\\:,;&@#%=/!'\"_~<>` -]+$/;\n if (!validRegex.test(input)) {\n return false;\n }\n try {\n new RegExp(input);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n private isValidValue(value: any[]): boolean {\n return Array.isArray(value) && value.every(item => typeof item === 'string' || typeof item === 'number' || typeof item === 'boolean');\n }\n\n /**\n * @method where\n * @memberof Query\n * @description Filters the results based on the specified criteria.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.where(\"field_UID\", QueryOperation.IS_LESS_THAN, [\"field1\", \"field2\"]).find()\n * // OR\n * const asset = await stack.asset().query().where(\"field_UID\", QueryOperation.IS_LESS_THAN, [\"field1\", \"field2\"]).find()\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.where(\"field_UID\", QueryOperation.MATCHES, [\"field1\", \"field2\"]).find()\n * @returns {Query}\n */\n where(\n fieldUid: string,\n queryOperation: QueryOperation | TaxonomyQueryOperation,\n fields: string | string[] | number | number[] | object | boolean,\n additionalData?: object\n ): Query {\n if (!this.isValidAlphanumeric(fieldUid)) {\n console.error(ErrorMessages.INVALID_FIELD_UID);\n return this;\n }\n if (queryOperation == QueryOperation.EQUALS) {\n this._parameters[fieldUid] = fields;\n }\n else {\n const parameterValue: { [key in QueryOperation]?: string | string[] } = { [queryOperation]: fields, ...additionalData };\n this._parameters[fieldUid] = parameterValue;\n }\n return this;\n }\n\n /**\n * @method regex\n * @memberof Query\n * @description Retrieve entries that match the provided regular expressions\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.regex('title','^Demo').find()\n * // OR\n * const result = await query.regex('title','^Demo', 'i').find() // regex with options\n * @returns {Query}\n */\n regex(fieldUid: string, regexPattern: string, options?: string): Query {\n if (!this.isValidAlphanumeric(fieldUid)) {\n console.error(ErrorMessages.INVALID_FIELD_UID);\n return this;\n }\n if (!this.isValidRegexPattern(regexPattern)) {\n throw new Error(ErrorMessages.INVALID_REGEX_PATTERN);\n }\n else {\n this._parameters[fieldUid] = { $regex: regexPattern };\n if (options) this._parameters[fieldUid].$options = options;\n return this;\n }\n }\n\n /**\n * @method whereIn\n * @memberof Query\n * @description Get entries having values based on referenced fields.\n * The query retrieves all entries that satisfy the query conditions made on referenced fields\n * This method sets the '$in_query' parameter to a reference field UID and a query instance in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const subQuery = stack.contentType(\"referencedContentTypeUid\").entry().query().where(\"title\", QueryOperation.EQUALS, \"value\");\n * query.whereIn(\"brand\", subQuery)\n * const result = await query.find()\n *\n * @param {string} referenceUid - UID of the reference field to query.\n * @param {Query} queryInstance - The Query instance to include in the where clause.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n whereIn(referenceUid: string, queryInstance: Query): Query {\n // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier\n if (!this.isValidAlphanumeric(referenceUid)) {\n throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid));\n }\n this._parameters[referenceUid] = { '$in_query': queryInstance._parameters };\n return this;\n }\n\n /**\n * @method whereNotIn\n * @memberof Query\n * @description Get entries having values based on referenced fields.\n * This query works the opposite of $in_query and retrieves all entries that does not satisfy query conditions made on referenced fields.\n * This method sets the '$nin_query' parameter to a reference field UID and a query instance in the API request.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const subQuery = stack.contentType(\"referencedContentTypeUid\").entry().query().where(\"title\", QueryOperation.EQUALS, \"value\");\n * query.whereNotIn(\"brand\", subQuery)\n * const result = await query.find()\n *\n * @param {string} referenceUid - UID of the reference field to query.\n * @param {Query} queryInstance - The Query instance to include in the where clause.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n whereNotIn(referenceUid: string, queryInstance: Query): Query {\n // eslint-disable-next-line @typescript-eslint/naming-convention, prettier/prettier\n if (!this.isValidAlphanumeric(referenceUid)) {\n throw new Error(ErrorMessages.INVALID_REFERENCE_UID(referenceUid));\n }\n this._parameters[referenceUid] = { '$nin_query': queryInstance._parameters };\n return this;\n }\n\n /**\n * @method queryOperator\n * @memberof Query\n * @description In case of '$and' get entries that satisfy all the conditions provided in the '$and' query and\n * in case of '$or' query get all entries that satisfy at least one of the given conditions provided in the '$or' query.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentType1Uid\").entry().query();\n * const subQuery1 = stack.contentType(\"contentType2Uid\").entry().query().where(\"price\", QueryOperation.IS_LESS_THAN, 90);\n * const subQuery2 = stack.contentType(\"contentType3Uid\").entry().query().where(\"discount\", QueryOperation.INCLUDES, [20, 45]);\n * query.queryOperator(QueryOperator.AND, subQuery1, subQuery2)\n * const result = await query.find()\n *\n * @param {QueryOperator} queryType - The type of query operator to apply.\n * @param {...Query[]} queryObjects - The Query instances to apply the query to.\n * @returns {Query} - Returns the Query instance for chaining.\n */\n queryOperator(queryType: QueryOperator, ...queryObjects: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queryObjects) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters[queryType] = paramsList;\n\n return this;\n }\n\n /**\n * @method getQuery\n * @memberof Query\n * @description Returns the raw (JSON) query based on the filters applied on Query object.\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = query.getQuery()\n * // OR\n * const assetQuery = stack.asset().query();\n * const assetResult = assetQuery.getQuery()\n *\n * @returns {{ [key: string]: any }} The raw query object\n */\n getQuery(): { [key: string]: any } {\n return this._parameters;\n }\n\n /**\n * @method containedIn\n * @memberof Query\n * @description Filters entries where the field value is contained in the provided array of values\n * @param {string} key - The field UID to filter on\n * @param {(string | number | boolean)[]} value - Array of values to match against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.containedIn('fieldUid', ['value1', 'value2']).find()\n * \n * @returns {Query}\n */\n containedIn(key: string, value: (string | number | boolean)[]): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (!this.isValidValue(value)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters[key] = { '$in': value };\n return this;\n }\n\n /**\n * @method notContainedIn\n * @memberof Query\n * @description Filters entries where the field value is not contained in the provided array of values\n * @param {string} key - The field UID to filter on\n * @param {(string | number | boolean)[]} value - Array of values to exclude\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.notContainedIn('fieldUid', ['value1', 'value2']).find()\n * \n * @returns {Query}\n */\n notContainedIn(key: string, value: (string | number | boolean)[]): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (!this.isValidValue(value)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters[key] = { '$nin': value };\n return this;\n }\n\n /**\n * @method exists\n * @memberof Query\n * @description Filters entries where the specified field exists\n * @param {string} key - The field UID to check for existence\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.exists('fieldUid').find()\n * \n * @returns {Query}\n */\n exists(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$exists': true };\n return this;\n }\n\n /**\n * @method notExists\n * @memberof Query\n * @description Filters entries where the specified field does not exist\n * @param {string} key - The field UID to check for non-existence\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query = stack.contentType(\"contentTypeUid\").entry().query();\n * const result = await query.notExists('fieldUid').find()\n * \n * @returns {Query}\n */\n notExists(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$exists': false };\n return this;\n }\n\n /**\n * @method or\n * @memberof Query\n * @description Combines multiple queries with OR logic - returns entries that match at least one of the provided queries\n * @param {...Query} queries - Query instances to combine with OR logic\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);\n * const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');\n * const result = await stack.contentType('contenttype_uid').entry().query().or(query1, query2).find();\n * \n * @returns {Query}\n */\n or(...queries: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queries) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters.$or = paramsList;\n return this;\n }\n\n /**\n * @method and\n * @memberof Query\n * @description Combines multiple queries with AND logic - returns entries that match all of the provided queries\n * @param {...Query} queries - Query instances to combine with AND logic\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const query1 = stack.contentType('contenttype_uid').entry().query().containedIn('fieldUID', ['value']);\n * const query2 = stack.contentType('contenttype_uid').entry().query().where('fieldUID', QueryOperation.EQUALS, 'value2');\n * const result = await stack.contentType('contenttype_uid').entry().query().and(query1, query2).find();\n * \n * @returns {Query}\n */\n and(...queries: Query[]): Query {\n const paramsList: BaseQueryParameters[] = [];\n for (const queryItem of queries) {\n paramsList.push(queryItem._parameters);\n }\n this._parameters.$and = paramsList;\n return this;\n }\n\n /**\n * @method equalTo\n * @memberof Query\n * @description Filters entries where the field value equals the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number | boolean} value - The value to match\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().equalTo('fieldUid', 'value').find();\n * \n * @returns {Query}\n */\n equalTo(key: string, value: string | number | boolean): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = value;\n return this;\n }\n\n /**\n * @method notEqualTo\n * @memberof Query\n * @description Filters entries where the field value does not equal the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number | boolean} value - The value to exclude\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().notEqualTo('fieldUid', 'value').find();\n * \n * @returns {Query}\n */\n notEqualTo(key: string, value: string | number | boolean): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$ne': value };\n return this;\n }\n\n /**\n * @method referenceIn\n * @memberof Query\n * @description Filters entries where the reference field matches entries from the provided query\n * @param {string} key - The reference field UID to filter on\n * @param {Query} query - Query instance to match referenced entries against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');\n * const result = await stack.contentType('contenttype_uid').entry().query().referenceIn('reference_uid', subQuery).find();\n * \n * @returns {Query}\n */\n referenceIn(key: string, query: Query): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$in_query': query._parameters }\n return this;\n }\n\n /**\n * @method referenceNotIn\n * @memberof Query\n * @description Filters entries where the reference field does not match entries from the provided query\n * @param {string} key - The reference field UID to filter on\n * @param {Query} query - Query instance to exclude referenced entries against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const subQuery = stack.contentType('contenttype_uid').entry().query().where('title', QueryOperation.EQUALS, 'value');\n * const result = await stack.contentType('contenttype_uid').entry().query().referenceNotIn('reference_uid', subQuery).find();\n * \n * @returns {Query}\n */\n referenceNotIn(key: string, query: Query): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._parameters[key] = { '$nin_query': query._parameters }\n return this;\n }\n\n /**\n * @method tags\n * @memberof Query\n * @description Filters entries that have any of the specified tags\n * @param {(string | number | boolean)[]} values - Array of tag values to filter by\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().tags(['tag1']).find();\n * \n * @returns {Query}\n */\n tags(values: (string | number | boolean)[]): Query {\n if (!this.isValidValue(values)) {\n console.error(ErrorMessages.INVALID_VALUE_ARRAY);\n return this;\n }\n this._parameters['tags'] = values;\n return this;\n }\n\n /**\n * @method search\n * @memberof Query\n * @description Enables typeahead search functionality for the query\n * @param {string} key - The search term to use for typeahead search\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().search('key').find();\n * \n * @returns {Query}\n */\n search(key: string): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n this._queryParams['typeahead'] = key\n return this\n }\n\n /**\n * @method lessThan\n * @memberof Query\n * @description Filters entries where the field value is less than the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().lessThan('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n lessThan(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n\n this._parameters[key] = { '$lt': value };\n return this;\n }\n\n /**\n * @method lessThanOrEqualTo\n * @memberof Query\n * @description Filters entries where the field value is less than or equal to the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().lessThanOrEqualTo('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n lessThanOrEqualTo(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$lte': value };\n return this;\n }\n\n /**\n * @method greaterThan\n * @memberof Query\n * @description Filters entries where the field value is greater than the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().greaterThan('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n greaterThan(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$gt': value };\n return this;\n }\n\n /**\n * @method greaterThanOrEqualTo\n * @memberof Query\n * @description Filters entries where the field value is greater than or equal to the specified value\n * @param {string} key - The field UID to filter on\n * @param {string | number} value - The value to compare against\n * @example\n * import contentstack from '@contentstack/delivery-sdk'\n *\n * const stack = contentstack.stack({ apiKey: \"apiKey\", deliveryToken: \"deliveryToken\", environment: \"environment\" });\n * const result = await stack.contentType('contenttype_uid').entry().query().greaterThanOrEqualTo('fieldUid', 100).find();\n * \n * @returns {Query}\n */\n greaterThanOrEqualTo(key: string, value: (string | number)): Query {\n if (!this.isValidAlphanumeric(key)) {\n console.error(ErrorMessages.INVALID_KEY);\n return this;\n }\n if (typeof value !== 'string' && typeof value !== 'number') {\n console.error(ErrorMessages.INVALID_VALUE_STRING_OR_NUMBER);\n return this;\n }\n this._parameters[key] = { '$gte': value };\n return this;\n }\n\n /**\n * Override find method to include content type UID directly for better caching\n */\n override async find<T>(encode: boolean = false): Promise<FindResponse<T>> {\n let requestParams: { [key: string]: any } = this._queryParams;\n\n if (Object.keys(this._parameters).length > 0) {\n let queryParams = { ...this._parameters };\n \n if (encode) {\n queryParams = encodeQueryParams(queryParams);\n }\n \n requestParams = { ...this._queryParams, query: queryParams };\n }\n\n const getRequestOptions: any = { \n params: requestParams,\n // Add contentTypeUid directly for improved caching\n contentTypeUid: this._contentTypeUid\n };\n\n if (this._variants) {\n getRequestOptions.headers = {\n ...getRequestOptions.headers,\n 'x-cs-variant-uid': this._variants\n };\n }\n const response = await getData(this._client, this._urlPath, getRequestOptions);\n\n return response as FindResponse<T>;\n }\n}\n"],"names":["BaseQuery","params","queryParams","ErrorMessages","QueryOperation","encodeQueryParams","getData"],"mappings":";;;;;;;;;;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31,7 +31,7 @@ class Query extends BaseQuery {
31
31
  }
32
32
  // Validate if input matches safe regex patterns
33
33
  isValidRegexPattern(input) {
34
- const validRegex = /^[a-zA-Z0-9|^$.*+?()[\]{}:,;&@#%=/!'"_~<> -]+$/;
34
+ const validRegex = /^[a-zA-Z0-9|^$.*+?()[\]{}\\:,;&@#%=/!'"_~<>` -]+$/;
35
35
  if (!validRegex.test(input)) {
36
36
  return false;
37
37
  }