diff --git a/sdks/sdk-qbo/src/index.ts b/sdks/sdk-qbo/src/index.ts index 6a91923..a935ae2 100644 --- a/sdks/sdk-qbo/src/index.ts +++ b/sdks/sdk-qbo/src/index.ts @@ -80,7 +80,8 @@ export const qboSdkDef = { } }, } - return {...client, ...extension} as typeof client & typeof extension + Object.assign(client, extension) + return client as typeof client & typeof extension }, } satisfies SdkDefinition diff --git a/sdks/sdk-salesforce/src/index.ts b/sdks/sdk-salesforce/src/index.ts index 7dbd048..ee1fb4b 100644 --- a/sdks/sdk-salesforce/src/index.ts +++ b/sdks/sdk-salesforce/src/index.ts @@ -27,23 +27,24 @@ export type QueryResponse = { // TODO: Add handling for instanceUrl, apiVersion and auth tokens into this export const salesforceSdkDef = { types: {} as SalesforceSDKTypes, - defaultOptions: {}, // needed due to instance-specific server url in oasMeta + defaultOptions: {}, // needed due to instance-specific server url in oasMeta // Cannot use the oasMeta because the serverUrl is going to be instance dependent createClient: (ctx, options) => { const client = ctx.createClient(options) - // TODO: Add typesafe handling of response from query just like supablue postgREST.js client - // @see https://github.com/supabase/postgrest-js?tab=readme-ov-file - /** NOTE: `SELECT *` is now allowed by Salesforce. Exact columns need to be specified */ - function query(query: string) { - return client - .request('GET', '/query', {params: {query: {q: query}}}) - .then((r) => r.data as QueryResponse) - } - return { - ...client, - query, + + const extension = { + // TODO: Add typesafe handling of response from query just like supablue postgREST.js client + // @see https://github.com/supabase/postgrest-js?tab=readme-ov-file + /** NOTE: `SELECT *` is now allowed by Salesforce. Exact columns need to be specified */ + query(query: string) { + return client + .request('GET', '/query', {params: {query: {q: query}}}) + .then((r) => r.data as QueryResponse) + }, // TODO: Add other api such as tooling / bulk etc. } + Object.assign(client, extension) + return client as typeof client & typeof extension }, } satisfies SdkDefinition