@salesforce/platform-sdk 3.0.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/LICENSE.txt +82 -0
- package/README.md +62 -0
- package/dist/analytics/analytics.d.ts +21 -0
- package/dist/analytics/analytics.d.ts.map +1 -0
- package/dist/analytics/error-listener.d.ts +9 -0
- package/dist/analytics/error-listener.d.ts.map +1 -0
- package/dist/analytics/index.d.ts +8 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/method-configs.d.ts +11 -0
- package/dist/analytics/method-configs.d.ts.map +1 -0
- package/dist/analytics/proxy.d.ts +14 -0
- package/dist/analytics/proxy.d.ts.map +1 -0
- package/dist/analytics/schemas.d.ts +7 -0
- package/dist/analytics/schemas.d.ts.map +1 -0
- package/dist/analytics/subscribe-wrapper.d.ts +7 -0
- package/dist/analytics/subscribe-wrapper.d.ts.map +1 -0
- package/dist/analytics/types.d.ts +90 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/chat/index.d.ts +22 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/mcpapps.d.ts +61 -0
- package/dist/chat/mcpapps.d.ts.map +1 -0
- package/dist/chat/openai.d.ts +25 -0
- package/dist/chat/openai.d.ts.map +1 -0
- package/dist/chat/salesforce-acc.d.ts +13 -0
- package/dist/chat/salesforce-acc.d.ts.map +1 -0
- package/dist/chat/singleton.d.ts +32 -0
- package/dist/chat/singleton.d.ts.map +1 -0
- package/dist/core/acc-types.d.ts +49 -0
- package/dist/core/acc-types.d.ts.map +1 -0
- package/dist/core/capabilities.d.ts +40 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/chat.d.ts +203 -0
- package/dist/core/chat.d.ts.map +1 -0
- package/dist/core/data.d.ts +38 -0
- package/dist/core/data.d.ts.map +1 -0
- package/dist/core/index.d.ts +24 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/jsonrpc-client.d.ts +167 -0
- package/dist/core/jsonrpc-client.d.ts.map +1 -0
- package/dist/core/jsonrpc.d.ts +123 -0
- package/dist/core/jsonrpc.d.ts.map +1 -0
- package/dist/core/lightning.d.ts +42 -0
- package/dist/core/lightning.d.ts.map +1 -0
- package/dist/core/mcpapps-session.d.ts +107 -0
- package/dist/core/mcpapps-session.d.ts.map +1 -0
- package/dist/core/mfe-protocol/message-channel-transport.d.ts +79 -0
- package/dist/core/mfe-protocol/message-channel-transport.d.ts.map +1 -0
- package/dist/core/options.d.ts +16 -0
- package/dist/core/options.d.ts.map +1 -0
- package/dist/core/platforms.d.ts +229 -0
- package/dist/core/platforms.d.ts.map +1 -0
- package/dist/core/sdk-promise.d.ts +14 -0
- package/dist/core/sdk-promise.d.ts.map +1 -0
- package/dist/core/surface.d.ts +24 -0
- package/dist/core/surface.d.ts.map +1 -0
- package/dist/core/view.d.ts +308 -0
- package/dist/core/view.d.ts.map +1 -0
- package/dist/data/gql.d.ts +7 -0
- package/dist/data/gql.d.ts.map +1 -0
- package/dist/data/index.d.ts +34 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/mosaic/fetch.d.ts +21 -0
- package/dist/data/mosaic/fetch.d.ts.map +1 -0
- package/dist/data/mosaic/index.d.ts +22 -0
- package/dist/data/mosaic/index.d.ts.map +1 -0
- package/dist/data/openai/index.d.ts +9 -0
- package/dist/data/openai/index.d.ts.map +1 -0
- package/dist/data/shared/graphql/cache/command.d.ts +93 -0
- package/dist/data/shared/graphql/cache/command.d.ts.map +1 -0
- package/dist/data/shared/graphql/cache/index.d.ts +7 -0
- package/dist/data/shared/graphql/cache/index.d.ts.map +1 -0
- package/dist/data/shared/graphql/headers.d.ts +13 -0
- package/dist/data/shared/graphql/headers.d.ts.map +1 -0
- package/dist/data/shared/url-utils.d.ts +9 -0
- package/dist/data/shared/url-utils.d.ts.map +1 -0
- package/dist/data/webapp/client-headers.interceptor.d.ts +12 -0
- package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -0
- package/dist/data/webapp/csrf/header.interceptor.d.ts +19 -0
- package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -0
- package/dist/data/webapp/csrf/retry.interceptor.d.ts +8 -0
- package/dist/data/webapp/csrf/retry.interceptor.d.ts.map +1 -0
- package/dist/data/webapp/csrf/retry.policy.d.ts +31 -0
- package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -0
- package/dist/data/webapp/csrf/token-manager.d.ts +42 -0
- package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -0
- package/dist/data/webapp/fetch.d.ts +27 -0
- package/dist/data/webapp/fetch.d.ts.map +1 -0
- package/dist/data/webapp/index.d.ts +19 -0
- package/dist/data/webapp/index.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1506 -0
- package/dist/lightning/index.d.ts +15 -0
- package/dist/lightning/index.d.ts.map +1 -0
- package/dist/telemetry/action-piggyback.d.ts +7 -0
- package/dist/telemetry/action-piggyback.d.ts.map +1 -0
- package/dist/telemetry/buffer.d.ts +22 -0
- package/dist/telemetry/buffer.d.ts.map +1 -0
- package/dist/telemetry/index.d.ts +10 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/transport.d.ts +3 -0
- package/dist/telemetry/transport.d.ts.map +1 -0
- package/dist/telemetry/types.d.ts +32 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/uploader/TelemetryUploader.d.ts +43 -0
- package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -0
- package/dist/telemetry/uploader/interfaces.d.ts +61 -0
- package/dist/telemetry/uploader/interfaces.d.ts.map +1 -0
- package/dist/telemetry/widget-state-flush.d.ts +14 -0
- package/dist/telemetry/widget-state-flush.d.ts.map +1 -0
- package/dist/view/index.d.ts +22 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/mcpapps.d.ts +24 -0
- package/dist/view/mcpapps.d.ts.map +1 -0
- package/dist/view/openai.d.ts +11 -0
- package/dist/view/openai.d.ts.map +1 -0
- package/dist/view/singleton.d.ts +32 -0
- package/dist/view/singleton.d.ts.map +1 -0
- package/dist/view/utils.d.ts +59 -0
- package/dist/view/utils.d.ts.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Theme mode
|
|
8
|
+
*/
|
|
9
|
+
export type ThemeMode = "light" | "dark";
|
|
10
|
+
/**
|
|
11
|
+
* Theme object
|
|
12
|
+
*/
|
|
13
|
+
export interface Theme {
|
|
14
|
+
mode: ThemeMode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Message severity level for alerts and toasts
|
|
18
|
+
*
|
|
19
|
+
* Determines the visual styling and importance of notifications:
|
|
20
|
+
* - `info` - Informational messages (blue/neutral)
|
|
21
|
+
* - `success` - Successful operations (green)
|
|
22
|
+
* - `warning` - Warning messages requiring attention (yellow/orange)
|
|
23
|
+
* - `error` - Error messages for failed operations (red)
|
|
24
|
+
*/
|
|
25
|
+
export type MessageLevel = "info" | "success" | "warning" | "error";
|
|
26
|
+
/**
|
|
27
|
+
* Configuration options for displaying alerts
|
|
28
|
+
*
|
|
29
|
+
* Alerts are modal notifications that typically require user acknowledgment.
|
|
30
|
+
* They block interaction until dismissed and are used for important messages.
|
|
31
|
+
*/
|
|
32
|
+
export interface AlertOptions {
|
|
33
|
+
/**
|
|
34
|
+
* The message content to display in the alert
|
|
35
|
+
*/
|
|
36
|
+
message: string;
|
|
37
|
+
/**
|
|
38
|
+
* The severity level of the alert
|
|
39
|
+
*
|
|
40
|
+
* Determines the visual styling and icon. Defaults to "info" if not specified.
|
|
41
|
+
*/
|
|
42
|
+
level?: MessageLevel;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configuration options for displaying toast notifications
|
|
46
|
+
*
|
|
47
|
+
* Toasts are non-blocking, temporary notifications that automatically dismiss
|
|
48
|
+
* after a short duration. They're ideal for status updates and confirmations.
|
|
49
|
+
*/
|
|
50
|
+
export interface ToastOptions {
|
|
51
|
+
/**
|
|
52
|
+
* The message content to display in the toast
|
|
53
|
+
*/
|
|
54
|
+
message: string;
|
|
55
|
+
/**
|
|
56
|
+
* The severity level of the toast
|
|
57
|
+
*
|
|
58
|
+
* Determines the visual styling and icon. Defaults to "info" if not specified.
|
|
59
|
+
*/
|
|
60
|
+
level?: MessageLevel;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Configuration options for displaying modal dialogs
|
|
64
|
+
*
|
|
65
|
+
* Modals allow custom HTML content to be displayed in an overlay dialog.
|
|
66
|
+
* The template is loaded from a UI resource and can receive parameters.
|
|
67
|
+
*/
|
|
68
|
+
export interface ModalOptions {
|
|
69
|
+
/**
|
|
70
|
+
* URI of the HTML template to load in the modal
|
|
71
|
+
*
|
|
72
|
+
* Format: "ui://widget/[name].html"
|
|
73
|
+
* The template file should be included in your application's UI resources.
|
|
74
|
+
*
|
|
75
|
+
* @example "ui://widget/confirmation.html"
|
|
76
|
+
* @example "ui://widget/settings.html"
|
|
77
|
+
*/
|
|
78
|
+
componentReference: string;
|
|
79
|
+
/**
|
|
80
|
+
* Parameters to pass to the modal template
|
|
81
|
+
*
|
|
82
|
+
* These parameters are accessible within the modal via the host's API.
|
|
83
|
+
* For example, in OpenAI surface: `window.openai.view.params`
|
|
84
|
+
*
|
|
85
|
+
* @example { userId: "123", mode: "edit" }
|
|
86
|
+
*/
|
|
87
|
+
params?: Record<string, unknown>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* ViewSDK API - Provides methods for displaying UI elements and managing view state
|
|
91
|
+
*
|
|
92
|
+
* This SDK enables UI Bundles to interact with the host's UI layer by displaying
|
|
93
|
+
* alerts, toast notifications, modal dialogs, and managing application state. All methods
|
|
94
|
+
* are optional and may not be available depending on the runtime surface.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const viewSDK = await createViewSDK();
|
|
99
|
+
*
|
|
100
|
+
* // Display a success toast
|
|
101
|
+
* await viewSDK.displayToast?.({
|
|
102
|
+
* message: 'Operation completed successfully',
|
|
103
|
+
* level: 'success'
|
|
104
|
+
* });
|
|
105
|
+
*
|
|
106
|
+
* // Mark application as having unsaved changes
|
|
107
|
+
* await viewSDK.markDirtyState?.();
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export interface ViewSDK {
|
|
111
|
+
/**
|
|
112
|
+
* Display an alert message in the host environment
|
|
113
|
+
*
|
|
114
|
+
* Alerts are typically modal and require user acknowledgment before dismissing.
|
|
115
|
+
* Use alerts for important messages that require immediate attention.
|
|
116
|
+
*
|
|
117
|
+
* @param options - Alert configuration options
|
|
118
|
+
* @returns Promise that resolves when the alert is displayed
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* await viewSDK.displayAlert?.({
|
|
123
|
+
* message: 'Please save your work before continuing',
|
|
124
|
+
* level: 'warning'
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
displayAlert?(options: AlertOptions): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Display a toast notification in the host environment
|
|
131
|
+
*
|
|
132
|
+
* Toasts are non-blocking, temporary notifications that auto-dismiss.
|
|
133
|
+
* Use toasts for success confirmations, status updates, or informational messages
|
|
134
|
+
* that don't require user interaction.
|
|
135
|
+
*
|
|
136
|
+
* @param options - Toast configuration options
|
|
137
|
+
* @returns Promise that resolves when the toast is displayed
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* await viewSDK.displayToast?.({
|
|
142
|
+
* message: 'File uploaded successfully',
|
|
143
|
+
* level: 'success'
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
displayToast?(options: ToastOptions): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Display a modal dialog with custom UI in the host environment
|
|
150
|
+
*
|
|
151
|
+
* Modals allow you to display custom HTML content in a dialog overlay.
|
|
152
|
+
* The template is loaded from a UI resource URI, and parameters can be
|
|
153
|
+
* passed to the modal for dynamic content.
|
|
154
|
+
*
|
|
155
|
+
* @param options - Modal configuration options
|
|
156
|
+
* @returns Promise that resolves when the modal is displayed
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* await viewSDK.displayModal?.({
|
|
161
|
+
* template: 'ui://widget/settings.html',
|
|
162
|
+
* params: {
|
|
163
|
+
* theme: 'dark',
|
|
164
|
+
* apiKey: 'abc123'
|
|
165
|
+
* }
|
|
166
|
+
* });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
displayModal?(options: ModalOptions): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Navigate to a different URL within the application
|
|
172
|
+
*
|
|
173
|
+
* This method triggers navigation in the host environment. The behavior may vary
|
|
174
|
+
* depending on the surface (e.g., full page navigation, iframe navigation, etc.).
|
|
175
|
+
*
|
|
176
|
+
* @param url - The URL to navigate to (can be relative or absolute)
|
|
177
|
+
* @returns Promise that resolves when navigation is initiated
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* await viewSDK.navigateTo?.('/dashboard');
|
|
182
|
+
* await viewSDK.navigateTo?.('https://example.com/page');
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
navigateTo?(url: string): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Mark the application state as "dirty" (having unsaved changes)
|
|
188
|
+
*
|
|
189
|
+
* This notifies the host that the application has unsaved changes. The host may
|
|
190
|
+
* display a visual indicator (e.g., asterisk in title) and prompt the user before
|
|
191
|
+
* navigating away or closing the application.
|
|
192
|
+
*
|
|
193
|
+
* @returns Promise that resolves when the dirty state is marked
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* // User made changes to a form
|
|
198
|
+
* formInput.addEventListener('input', async () => {
|
|
199
|
+
* await viewSDK.markDirtyState?.();
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
markDirtyState?(): Promise<void>;
|
|
204
|
+
/**
|
|
205
|
+
* Clear the application's "dirty" state (no unsaved changes)
|
|
206
|
+
*
|
|
207
|
+
* This notifies the host that all changes have been saved. Should be called
|
|
208
|
+
* after successfully persisting data to remove unsaved change indicators.
|
|
209
|
+
*
|
|
210
|
+
* @returns Promise that resolves when the dirty state is cleared
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* // After successfully saving data
|
|
215
|
+
* async function saveForm(data) {
|
|
216
|
+
* await api.save(data);
|
|
217
|
+
* await viewSDK.clearDirtyState?.();
|
|
218
|
+
* }
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
clearDirtyState?(): Promise<void>;
|
|
222
|
+
/**
|
|
223
|
+
* Dispatch a custom event to the host environment
|
|
224
|
+
*
|
|
225
|
+
* This allows the application to send custom events with associated data to the
|
|
226
|
+
* host. The host can listen for these events and respond accordingly.
|
|
227
|
+
*
|
|
228
|
+
* @param event - The event name/type to dispatch
|
|
229
|
+
* @param data - Associated event data as key-value pairs
|
|
230
|
+
* @returns Promise that resolves when the event is dispatched
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* await viewSDK.dispatchEvent?.('user-action', {
|
|
235
|
+
* action: 'click',
|
|
236
|
+
* buttonId: 'submit',
|
|
237
|
+
* timestamp: Date.now()
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
dispatchEvent?(event: string, data: Record<string, unknown>): Promise<void>;
|
|
242
|
+
/**
|
|
243
|
+
* Get UI properties from the host and subscribe to changes
|
|
244
|
+
*
|
|
245
|
+
* Returns an object containing a promise for the initial props and a subscribe
|
|
246
|
+
* function to listen for prop updates. UI props allow the host to configure
|
|
247
|
+
* the application's appearance or behavior dynamically.
|
|
248
|
+
*
|
|
249
|
+
* @returns Object with props promise and subscribe function
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```typescript
|
|
253
|
+
* const uiProps = viewSDK.getUiProps?.();
|
|
254
|
+
*
|
|
255
|
+
* // Get initial props
|
|
256
|
+
* const initialProps = await uiProps.props;
|
|
257
|
+
* console.log('Theme:', initialProps.theme);
|
|
258
|
+
*
|
|
259
|
+
* // Subscribe to prop changes
|
|
260
|
+
* uiProps.subscribe((newProps) => {
|
|
261
|
+
* console.log('Props updated:', newProps);
|
|
262
|
+
* // Update UI based on new props
|
|
263
|
+
* });
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
getUiProps?(): {
|
|
267
|
+
props: Promise<Record<string, unknown>>;
|
|
268
|
+
subscribe: (callback: (props: Record<string, unknown>) => void) => void;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Resize the application viewport
|
|
272
|
+
*
|
|
273
|
+
* Requests the host to resize the application container to the specified dimensions.
|
|
274
|
+
* Useful for adaptive layouts or when content size changes dynamically.
|
|
275
|
+
*
|
|
276
|
+
* @param width - The desired width (e.g., "500px", "100%", "auto")
|
|
277
|
+
* @param height - The desired height (e.g., "300px", "100%", "auto")
|
|
278
|
+
* @returns Promise that resolves when resize is complete
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* // Resize to specific pixel dimensions
|
|
283
|
+
* await viewSDK.resize?.('800px', '600px');
|
|
284
|
+
*
|
|
285
|
+
* // Auto-resize based on content
|
|
286
|
+
* await viewSDK.resize?.('auto', 'auto');
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
resize?(width: string, height: string): Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* Get the current theme from the host environment
|
|
292
|
+
*
|
|
293
|
+
* Returns the current theme (light/dark mode) as reported by the host.
|
|
294
|
+
* Returns null if the host has not provided theme information.
|
|
295
|
+
*
|
|
296
|
+
* @returns The current theme or null if not available
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```typescript
|
|
300
|
+
* const theme = viewSDK.getTheme?.();
|
|
301
|
+
* if (theme) {
|
|
302
|
+
* document.body.classList.toggle('dark', theme.mode === 'dark');
|
|
303
|
+
* }
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
getTheme?(): Theme | null;
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,SAAS,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;OAQG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,OAAO;IACvB;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,UAAU,CAAC,IAAI;QACd,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACxC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,CAAC;KACxE,CAAC;IAEF;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../src/data/gql.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAS/E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DataSDK, SDKOptions } from '../core';
|
|
2
|
+
import { MosaicDataSDKOptions } from './mosaic';
|
|
3
|
+
export type StatusCallback = () => Promise<unknown> | void;
|
|
4
|
+
/**
|
|
5
|
+
* Options for creating a WebAppDataSDK
|
|
6
|
+
*/
|
|
7
|
+
export interface WebAppDataSDKOptions {
|
|
8
|
+
basePath?: string;
|
|
9
|
+
onStatus?: Partial<Record<number, StatusCallback>>;
|
|
10
|
+
}
|
|
11
|
+
export type { MosaicDataSDKOptions };
|
|
12
|
+
/**
|
|
13
|
+
* Options for creating a DataSDK instance.
|
|
14
|
+
*/
|
|
15
|
+
export interface DataSDKOptions extends SDKOptions {
|
|
16
|
+
webapp?: WebAppDataSDKOptions;
|
|
17
|
+
mosaic?: MosaicDataSDKOptions;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create and initialize a DataSDK instance based on the detected surface.
|
|
21
|
+
* Each call creates a new instance; options are applied to every call.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Optional configuration including surface override and web app options
|
|
24
|
+
* @returns Promise resolving to an initialized DataSDK instance
|
|
25
|
+
*/
|
|
26
|
+
export declare function createDataSDK(options?: DataSDKOptions): Promise<DataSDK>;
|
|
27
|
+
export { gql } from './gql';
|
|
28
|
+
export type { DataSDK, GraphQLRequest, GraphQLResponse, SDKOptions } from '../core';
|
|
29
|
+
export type NodeOfConnection<T> = T extends {
|
|
30
|
+
edges?: (infer E)[] | null;
|
|
31
|
+
} | null ? E extends {
|
|
32
|
+
node?: infer N;
|
|
33
|
+
} | null ? N : never : never;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIpE,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;CACnD;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IACjD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBxE;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEpF,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC3C,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC;CAC3B,GAAG,IAAI,GACL,CAAC,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,GAClC,CAAC,GACD,KAAK,GACN,KAAK,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FetchService, RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a request interceptor that prepends a base URL to relative string URLs.
|
|
4
|
+
*
|
|
5
|
+
* @param baseUrl - The base URL to prepend (e.g. "https://myorg.salesforce.com")
|
|
6
|
+
*/
|
|
7
|
+
export declare function createBaseUrlInterceptor(baseUrl: string): RequestInterceptor;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a request interceptor that adds an Authorization Bearer header.
|
|
10
|
+
*
|
|
11
|
+
* @param accessToken - The access token to use for authentication
|
|
12
|
+
*/
|
|
13
|
+
export declare function createAuthInterceptor(accessToken: string): RequestInterceptor;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a fetch service configured with optional base URL and auth interceptors.
|
|
16
|
+
*
|
|
17
|
+
* @param baseUrl - Optional base URL for resolving relative paths
|
|
18
|
+
* @param accessToken - Optional access token for Bearer authentication
|
|
19
|
+
*/
|
|
20
|
+
export declare function createMosaicFetchService(baseUrl?: string, accessToken?: string): FetchService;
|
|
21
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAS5E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAI7E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAY7F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataSDK, GraphQLRequest, GraphQLResponse } from '../../core';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a MosaicDataSDK
|
|
4
|
+
*/
|
|
5
|
+
export interface MosaicDataSDKOptions {
|
|
6
|
+
instanceUrl?: string;
|
|
7
|
+
accessToken?: string;
|
|
8
|
+
apiVersion?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Data SDK implementation for the Mosaic surface (Node.js / server-side).
|
|
12
|
+
*
|
|
13
|
+
* Uses the conduit-client fetch service without CSRF protection or session handling.
|
|
14
|
+
* Authentication is handled via an access token provided through options or MOSAIC_ENV.
|
|
15
|
+
*/
|
|
16
|
+
export declare class MosaicDataSDK implements DataSDK {
|
|
17
|
+
private readonly clientFetch;
|
|
18
|
+
private readonly pathData;
|
|
19
|
+
constructor(options?: MosaicDataSDKOptions);
|
|
20
|
+
graphql<T, V>({ query, variables, operationName, }: GraphQLRequest<V>): Promise<GraphQLResponse<T>>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/mosaic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG3E;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,OAAO,CAAC,EAAE,oBAAoB;IAWpC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EACnB,KAAK,EACL,SAAS,EACT,aAAa,GACb,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CAYlD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataSDK, GraphQLRequest, GraphQLResponse } from '../../core';
|
|
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 declare class OpenAIDataSDK implements DataSDK {
|
|
7
|
+
graphql<T, V>({ query, variables, operationName, }: GraphQLRequest<V>): Promise<GraphQLResponse<T>>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/openai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI3E;;;GAGG;AACH,qBAAa,aAAc,YAAW,OAAO;IACtC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EACnB,KAAK,EACL,SAAS,EACT,aAAa,GACb,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;CASlD"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { HttpCacheControlCommand } from '@conduit-client/command-http-cache-control/v1';
|
|
2
|
+
import { GraphQLResponse } from '@conduit-client/onestore-graphql-parser/v1';
|
|
3
|
+
import { Cache, ReadonlyCache } from '@conduit-client/service-cache/v1';
|
|
4
|
+
import { CacheControlStrategyConfig, NamedCacheControllerService } from '@conduit-client/service-cache-control/v1';
|
|
5
|
+
import { FetchService, NamedFetchService } from '@conduit-client/service-fetch-network/v1';
|
|
6
|
+
import { NamedPubSubService } from '@conduit-client/service-pubsub/v1';
|
|
7
|
+
import { Result, SyncOrAsync } from '@conduit-client/utils';
|
|
8
|
+
export interface GraphQLResourceRequestParams {
|
|
9
|
+
query: string;
|
|
10
|
+
variables?: Record<string, unknown>;
|
|
11
|
+
operationName?: string;
|
|
12
|
+
}
|
|
13
|
+
type Services = NamedCacheControllerService & Partial<NamedPubSubService> & NamedFetchService;
|
|
14
|
+
/**
|
|
15
|
+
* Per-resource HTTP GraphQL cache-control command.
|
|
16
|
+
*
|
|
17
|
+
* Caches the `data` portion of a GraphQL response keyed by `{query, variables,
|
|
18
|
+
* operationName}` for {@link DEFAULT_MAX_AGE_SECONDS} seconds. The query is keyed by
|
|
19
|
+
* its raw string; semantically identical queries with different formatting produce
|
|
20
|
+
* different cache entries. Callers that want whitespace-equivalent deduplication
|
|
21
|
+
* should normalize at the call site. Mirrors OneStore's
|
|
22
|
+
* `HttpCacheControlCommand` lifecycle (read → fetch → write → re-read) and is intended as
|
|
23
|
+
* a building block for higher-level cache integrations rather than a standalone end-user
|
|
24
|
+
* API.
|
|
25
|
+
*
|
|
26
|
+
* ## Caching policy
|
|
27
|
+
*
|
|
28
|
+
* - Successful responses with a non-empty `data` object are cached.
|
|
29
|
+
* - Responses where `data` is `null`, missing, or `{}` are NOT cached. An empty `data`
|
|
30
|
+
* object usually indicates a transient server condition; caching it would poison the
|
|
31
|
+
* cache for the full TTL.
|
|
32
|
+
* - Responses with a non-empty `errors` array are surfaced as a `UserVisibleError` and
|
|
33
|
+
* are NOT cached. Partial-data preservation (responses carrying both `data` and
|
|
34
|
+
* `errors`) is not implemented at this layer; callers requiring it should use a
|
|
35
|
+
* higher-level command that overrides `handleCacheControllerResult` (see OneStore's
|
|
36
|
+
* `HttpGraphQLNormalizedCacheControlCommand`).
|
|
37
|
+
* - Mutations and subscriptions ARE cached at this layer because operation kind is not
|
|
38
|
+
* inspected. Higher-level integrations that route mutations through this command MUST
|
|
39
|
+
* bypass it for non-query operations to avoid silent re-issue of cached mutation
|
|
40
|
+
* responses.
|
|
41
|
+
*
|
|
42
|
+
* ## Stale-while-revalidate
|
|
43
|
+
*
|
|
44
|
+
* After the `max-age` window elapses, the next call to `execute()` will:
|
|
45
|
+
*
|
|
46
|
+
* 1. Return the previously-cached (stale) value as the immediate result.
|
|
47
|
+
* 2. Fire a network request in the background.
|
|
48
|
+
* 3. Publish the fresh value to PubSub subscribers via `cacheUpdate`.
|
|
49
|
+
*
|
|
50
|
+
* Non-subscribed callers therefore observe one cycle of stale data after expiry and
|
|
51
|
+
* will only receive the refreshed value on a subsequent `execute()` or `refresh()` call.
|
|
52
|
+
* Callers that need synchronous freshness should subscribe via the returned
|
|
53
|
+
* `SubscribableResult` or call `refresh()` explicitly.
|
|
54
|
+
*
|
|
55
|
+
* ## Variable handling
|
|
56
|
+
*
|
|
57
|
+
* Variables are deep-cloned via `JSON.parse(JSON.stringify(...))` at construction time
|
|
58
|
+
* so that subsequent mutation of the caller's object does not desync the cache key from
|
|
59
|
+
* the request body. Values that throw inside `JSON.stringify` (circular references,
|
|
60
|
+
* BigInt) are rejected at construction with a typed error carrying the operation name.
|
|
61
|
+
* Values that silently lose information through the round-trip (`Map`, `Symbol`,
|
|
62
|
+
* `function`) are not detected — those would also produce an invalid GraphQL request
|
|
63
|
+
* body on the wire path independent of the cache.
|
|
64
|
+
*/
|
|
65
|
+
export declare class HttpGraphQLResourceCacheControlCommand<TData extends Record<string, unknown> = Record<string, unknown>> extends HttpCacheControlCommand<TData, object, GraphQLResponse<TData>> {
|
|
66
|
+
private readonly url;
|
|
67
|
+
private readonly query;
|
|
68
|
+
private readonly normalizedVariables;
|
|
69
|
+
private readonly normalizedOperationName;
|
|
70
|
+
constructor(config: GraphQLResourceRequestParams, services: Services, url: string);
|
|
71
|
+
protected get fetchParams(): Parameters<FetchService>;
|
|
72
|
+
buildKey(): string;
|
|
73
|
+
/**
|
|
74
|
+
* Reads from the cache and returns the cache result or error
|
|
75
|
+
*
|
|
76
|
+
* In case of a missing or partial result, this should return either a DataNotFoundError or
|
|
77
|
+
* DataIncompleteError, respectively, in the Error response
|
|
78
|
+
*
|
|
79
|
+
* Note that any subclass should JUST try to read the data from the cache here; it should
|
|
80
|
+
* NOT try to take metadata (eg cache control semantics) into account while reading the
|
|
81
|
+
* data. The CacheController is responsible for enforcing those semantics.
|
|
82
|
+
*
|
|
83
|
+
* @param cache source of cached data
|
|
84
|
+
* @returns result or error from the cache
|
|
85
|
+
*/
|
|
86
|
+
readFromCache(cache: ReadonlyCache): SyncOrAsync<Result<TData, Error>>;
|
|
87
|
+
writeToCache(cache: Cache, networkResult: Result<GraphQLResponse<TData>, Error>): SyncOrAsync<void>;
|
|
88
|
+
protected get cacheControlStrategyConfig(): CacheControlStrategyConfig;
|
|
89
|
+
protected responseHasErrors(data: GraphQLResponse<TData>): boolean | undefined;
|
|
90
|
+
protected processFetchReturnValue(json: GraphQLResponse<TData>): Result<GraphQLResponse<TData>, Error>;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../src/data/shared/graphql/cache/command.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EACX,0BAA0B,EAC1B,2BAA2B,EAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAON,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,MAAM,uBAAuB,CAAC;AAsB/B,MAAM,WAAW,4BAA4B;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,QAAQ,GAAG,2BAA2B,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,iBAAiB,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBAAa,sCAAsC,CAClD,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC9D,SAAQ,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAQtE,OAAO,CAAC,QAAQ,CAAC,GAAG;IAPrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA0B;IAC9D,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAS;gBAGhD,MAAM,EAAE,4BAA4B,EACpC,QAAQ,EAAE,QAAQ,EACD,GAAG,EAAE,MAAM;IAW7B,SAAS,KAAK,WAAW,IAAI,UAAU,CAAC,YAAY,CAAC,CAapD;IAED,QAAQ,IAAI,MAAM;IAQlB;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAStE,YAAY,CACX,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAClD,WAAW,CAAC,IAAI,CAAC;IAqBpB,SAAS,KAAK,0BAA0B,IAAI,0BAA0B,CAMrE;IAED,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC;cAIrC,uBAAuB,CACzC,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,GAC1B,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;CAMxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/data/shared/graphql/cache/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Builds the canonical request header set for Salesforce GraphQL calls.
|
|
8
|
+
* Used by both the WebApp DataSDK transport path and the cache control
|
|
9
|
+
* command, so the wire format stays identical regardless of which path
|
|
10
|
+
* a consumer's request takes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildGraphQLRequestHeaders(): Record<string, string>;
|
|
13
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/data/shared/graphql/headers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMnE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
export declare const API_VERSION: string;
|
|
7
|
+
/** Builds the Salesforce data API path for the given version (defaults to {@link API_VERSION}). */
|
|
8
|
+
export declare function buildPathData(version?: string): string;
|
|
9
|
+
//# sourceMappingURL=url-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../../src/data/shared/url-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,QAA0E,CAAC;AAEnG,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAoB,GAAG,MAAM,CAEnE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
|
|
2
|
+
export declare const CLIENT_NAME_HEADER = "X-SFDC-Client-Name";
|
|
3
|
+
export declare const CLIENT_VERSION_HEADER = "X-SFDC-Client-Version";
|
|
4
|
+
/**
|
|
5
|
+
* A request interceptor that stamps every outgoing request with SDK identity headers.
|
|
6
|
+
*
|
|
7
|
+
* Added headers:
|
|
8
|
+
* X-SFDC-Client-Name: the SDK package name
|
|
9
|
+
* X-SFDC-Client-Version: the SDK version
|
|
10
|
+
*/
|
|
11
|
+
export declare const clientHeadersInterceptor: RequestInterceptor;
|
|
12
|
+
//# sourceMappingURL=client-headers.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-headers.interceptor.d.ts","sourceRoot":"","sources":["../../../src/data/webapp/client-headers.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAK7D;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAItC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RequestInterceptor } from '@conduit-client/service-fetch-network/v1';
|
|
2
|
+
import { CsrfTokenManager } from './token-manager';
|
|
3
|
+
export interface HeaderInterceptorConfig {
|
|
4
|
+
/** URLs that require CSRF tokens on mutating methods (POST, PUT, PATCH, DELETE). */
|
|
5
|
+
protectedUrls?: string[];
|
|
6
|
+
/**
|
|
7
|
+
* URLs that require CSRF tokens on all methods including GET.
|
|
8
|
+
* Use for endpoints that are sensitive regardless of HTTP method (e.g. Apex REST).
|
|
9
|
+
*/
|
|
10
|
+
alwaysProtectedUrls?: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Builds a configured interceptor for applying CSRF header to requests
|
|
14
|
+
*
|
|
15
|
+
* @param csrfTokenManager
|
|
16
|
+
* @param config
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildInterceptor(csrfTokenManager: CsrfTokenManager, config?: HeaderInterceptorConfig): RequestInterceptor;
|
|
19
|
+
//# sourceMappingURL=header.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/header.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGN,KAAK,kBAAkB,EACvB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIxD,MAAM,WAAW,uBAAuB;IACvC,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,GAAE,uBAA4B,GAClC,kBAAkB,CAkBpB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FetchParameters } from '@conduit-client/service-fetch-network/v1';
|
|
2
|
+
import { RetryService } from '@conduit-client/service-retry/v1';
|
|
3
|
+
import { HeaderInterceptorConfig } from './header.interceptor';
|
|
4
|
+
import { CsrfTokenManager } from './token-manager';
|
|
5
|
+
export interface RetryInterceptorConfig extends HeaderInterceptorConfig {
|
|
6
|
+
}
|
|
7
|
+
export declare function buildInterceptor(csrfTokenManager: CsrfTokenManager, config?: RetryInterceptorConfig): (fetchArgs: FetchParameters, retryService?: RetryService<Response>) => Promise<Response>;
|
|
8
|
+
//# sourceMappingURL=retry.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.interceptor.d.ts","sourceRoot":"","sources":["../../../../src/data/webapp/csrf/retry.interceptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;CAAG;AAE1E,wBAAgB,gBAAgB,CAC/B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,GAAE,sBAA2B,IAc3B,WAAW,eAAe,EAAE,eAAe,YAAY,CAAC,QAAQ,CAAC,uBAWzE"}
|