From 5b735e1f42788e6cd2d938acf1b51d19831d7af9 Mon Sep 17 00:00:00 2001 From: Amitkanswal Date: Thu, 30 Oct 2025 01:14:16 +0530 Subject: [PATCH 1/6] feat:field setData support in create entry page --- __test__/entry.test.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/entry.ts | 8 -------- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/__test__/entry.test.ts b/__test__/entry.test.ts index 2548935..dfd3bc2 100644 --- a/__test__/entry.test.ts +++ b/__test__/entry.test.ts @@ -223,7 +223,7 @@ describe("Entry", () => { dataWithoutEntry.entry = {}; entry = new Entry(dataWithoutEntry, connection as any, emitter); expect(() => entry.getField("invaliduid")).toThrowError( - "The data is unsaved. Save the data before requesting the field." + "Invalid uid, Field not found" ); }); diff --git a/package-lock.json b/package-lock.json index 6506f14..dcd22e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/app-sdk", - "version": "2.3.3", + "version": "2.3.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@contentstack/app-sdk", - "version": "2.3.3", + "version": "2.3.4", "license": "MIT", "dependencies": { "axios": "^1.7.9", diff --git a/package.json b/package.json index 3af26da..c1d6806 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/app-sdk", - "version": "2.3.3", + "version": "2.3.4", "types": "dist/src/index.d.ts", "description": "The Contentstack App SDK allows you to customize your Contentstack applications.", "main": "dist/index.js", diff --git a/src/entry.ts b/src/entry.ts index 14ecd76..d56c45b 100755 --- a/src/entry.ts +++ b/src/entry.ts @@ -154,14 +154,6 @@ class Entry { : this._data; let schema: Schema[0] = this.content_type.schema; - const isDataEmpty = Object.keys(value).length === 0; - - if (isDataEmpty) { - throw new Error( - "The data is unsaved. Save the data before requesting the field." - ); - } - try { let skipNext = false; let skipNextTwo = false; From facc13907f5741518b93241427810a1651f0308b Mon Sep 17 00:00:00 2001 From: Rushikesh Argade Date: Tue, 4 Nov 2025 18:47:33 +0530 Subject: [PATCH 2/6] feat: add config support to search method for branch-specific searches - Add optional config parameter to search method with safe default - Support branch-specific searches via config.branch - Update JSDoc documentation for new parameter - Maintain backward compatibility with existing API - Follow consistent pattern with other stack methods --- src/stack/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/stack/index.ts b/src/stack/index.ts index 6535d21..a66d2ec 100755 --- a/src/stack/index.ts +++ b/src/stack/index.ts @@ -113,10 +113,15 @@ class Stack { * Gets the results of the search based on user query * @param queries Array of key value pair of query parameters * @param apiKey API key of the stack + * @param config Optional configuration. Only pass this if you need to query a specific branch using `{ branch: 'branch-name' }. If not provided, queries the default branch.` * @returns Result of the query */ - search(queries: StackSearchQuery, apiKey: string | null = this._data.api_key) { - const options = { params: queries, api_key: apiKey, action: "search" }; + search(queries: StackSearchQuery, apiKey: string | null = this._data.api_key, config: { [key: string]: any } = {}) { + const { branch } = config; + const options: any = { params: queries, api_key: apiKey, action: "search" }; + if (branch) { + options.headers = { branch }; + } return this._connection .sendToParent("stackQuery", options) .then(onData) From 54b5a11b99621530bdb95ddd3be01018fbd3df09 Mon Sep 17 00:00:00 2001 From: Aravind Kumar Date: Fri, 24 Oct 2025 12:51:39 +0530 Subject: [PATCH 3/6] Updated codeowners --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6db65bf..92f01b3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,4 @@ +* @contentstack/marketplace-pr-reviewers * @contentstack/ghost-pr-reviewers .github/workflows/sca-scan.yml @contentstack/security-admin From 9aceb19bb583547a7bb6bc2f524298c5e2a85056 Mon Sep 17 00:00:00 2001 From: Aravind Kumar Date: Fri, 24 Oct 2025 13:36:06 +0530 Subject: [PATCH 4/6] Update CODEOWNERS --- .github/CODEOWNERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 92f01b3..ede8288 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,4 @@ * @contentstack/marketplace-pr-reviewers -* @contentstack/ghost-pr-reviewers - .github/workflows/sca-scan.yml @contentstack/security-admin **/.snyk @contentstack/security-admin From bd0dcea8820e1d41134d0b5e5a170008a1a61cf4 Mon Sep 17 00:00:00 2001 From: Pradyumna Garg Date: Thu, 6 Nov 2025 17:23:53 +0530 Subject: [PATCH 5/6] fix: MKT-14048 revert apdater changes --- src/utils/adapter.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/utils/adapter.ts b/src/utils/adapter.ts index 82637c7..9c19fc4 100644 --- a/src/utils/adapter.ts +++ b/src/utils/adapter.ts @@ -16,15 +16,11 @@ import { axiosToFetchResponse, fetchToAxiosConfig } from "./utils"; export const dispatchAdapter = (postRobot: typeof PostRobot) => ( - config: AxiosRequestConfig, - context?: { installationUID: string; extensionUID: string } + config: AxiosRequestConfig ) => { return new Promise((resolve, reject) => { postRobot - .sendToParent("apiAdapter", { - data: config, - extension: context, - }) + .sendToParent("apiAdapter", config) .then((event: unknown) => { const { data: response } = event as { data: AxiosResponse }; @@ -63,14 +59,12 @@ export const dispatchAdapter = */ export const dispatchApiRequest = async ( url: string, - options?: RequestInit, - context?: { installationUID: string; extensionUID: string } + options?: RequestInit ): Promise => { try { const config = fetchToAxiosConfig(url, options); const axiosResponse = (await dispatchAdapter(PostRobot)( - config, - context + config )) as AxiosResponse; return axiosToFetchResponse(axiosResponse); From 57a2fc4ef9e14d64ff30398591e0edd2d6aa53cf Mon Sep 17 00:00:00 2001 From: Pradyumna Garg Date: Thu, 6 Nov 2025 18:16:11 +0530 Subject: [PATCH 6/6] fix: revert codeowner changes --- .github/CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ede8288..6db65bf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,5 @@ -* @contentstack/marketplace-pr-reviewers +* @contentstack/ghost-pr-reviewers + .github/workflows/sca-scan.yml @contentstack/security-admin **/.snyk @contentstack/security-admin