@salesforce/sdk-data 1.46.2 → 1.48.0
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/openai/index.d.ts +14 -0
- package/dist/openai/index.d.ts.map +1 -0
- package/dist/openai/index.js +14 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export interface DataSDKOptions extends SDKOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function createDataSDK(options?: DataSDKOptions): Promise<DataSDK>;
|
|
17
17
|
export { gql } from "./gql.js";
|
|
18
|
-
export type { DataSDK,
|
|
18
|
+
export type { DataSDK, SDKOptions } from "@salesforce/sdk-core";
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIhE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD,MAAM,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACF;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAe9E;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
import { getSurface, Surface } from "@salesforce/sdk-core";
|
|
7
|
+
import { OpenAIDataSDK } from "./openai/index.js";
|
|
7
8
|
import { WebAppDataSDK } from "./webapp/index.js";
|
|
8
9
|
/**
|
|
9
10
|
* Create and initialize a DataSDK instance based on the detected surface
|
|
@@ -15,7 +16,7 @@ export async function createDataSDK(options) {
|
|
|
15
16
|
const surface = getSurface(options?.surface);
|
|
16
17
|
switch (surface) {
|
|
17
18
|
case Surface.OpenAI:
|
|
18
|
-
return
|
|
19
|
+
return new OpenAIDataSDK();
|
|
19
20
|
case Surface.WebApp:
|
|
20
21
|
case Surface.MicroFrontend:
|
|
21
22
|
return new WebAppDataSDK(options?.webapp?.basePath);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import type { DataSDK, GraphQLResponse } from "@salesforce/sdk-core";
|
|
7
|
+
/**
|
|
8
|
+
* Data SDK implementation for the OpenAI surface, which delegates GraphQL
|
|
9
|
+
* queries to the Salesforce MCP server via the ChatGPT bridge.
|
|
10
|
+
*/
|
|
11
|
+
export declare class OpenAIDataSDK implements DataSDK {
|
|
12
|
+
graphql<T, V>(query: string, variables?: V): Promise<GraphQLResponse<T>>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIrE;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IACtC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAQ9E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const TOOL_NAME = "salesforce_graphql";
|
|
2
|
+
/**
|
|
3
|
+
* Data SDK implementation for the OpenAI surface, which delegates GraphQL
|
|
4
|
+
* queries to the Salesforce MCP server via the ChatGPT bridge.
|
|
5
|
+
*/
|
|
6
|
+
export class OpenAIDataSDK {
|
|
7
|
+
async graphql(query, variables) {
|
|
8
|
+
const result = (await window.openai.callTool(TOOL_NAME, {
|
|
9
|
+
query,
|
|
10
|
+
...(variables != null ? { variables } : {}),
|
|
11
|
+
}));
|
|
12
|
+
return result.structuredContent;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sdk-data",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@conduit-client/salesforce-lightning-service-worker": "^3.7.0",
|
|
30
|
-
"@salesforce/sdk-core": "^1.
|
|
30
|
+
"@salesforce/sdk-core": "^1.48.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"vitest": "^4.0.6"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "5ccfffec66505f70bdf4e6679e886c7bdabfe0ff"
|
|
39
39
|
}
|