@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental 1.116.2 → 1.116.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.116.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.3...v1.116.4) (2026-03-26)
7
+
8
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.116.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.2...v1.116.3) (2026-03-26)
15
+
16
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.116.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.116.1...v1.116.2) (2026-03-25)
7
23
 
8
24
 
@@ -15,8 +15,8 @@
15
15
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@salesforce/sdk-data": "^1.116.2",
19
- "@salesforce/webapp-experimental": "^1.116.2",
18
+ "@salesforce/sdk-data": "^1.116.4",
19
+ "@salesforce/webapp-experimental": "^1.116.4",
20
20
  "@tailwindcss/vite": "^4.1.17",
21
21
  "class-variance-authority": "^0.7.1",
22
22
  "clsx": "^2.1.1",
@@ -42,7 +42,7 @@
42
42
  "@graphql-eslint/eslint-plugin": "^4.1.0",
43
43
  "@graphql-tools/utils": "^11.0.0",
44
44
  "@playwright/test": "^1.49.0",
45
- "@salesforce/vite-plugin-webapp-experimental": "^1.116.2",
45
+ "@salesforce/vite-plugin-webapp-experimental": "^1.116.4",
46
46
  "@testing-library/jest-dom": "^6.6.3",
47
47
  "@testing-library/react": "^16.1.0",
48
48
  "@testing-library/user-event": "^14.5.2",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.116.2",
3
+ "version": "1.116.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
9
- "version": "1.116.2",
9
+ "version": "1.116.4",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "devDependencies": {
12
12
  "@lwc/eslint-plugin-lwc": "^3.3.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.116.2",
3
+ "version": "1.116.4",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental",
3
- "version": "1.116.2",
3
+ "version": "1.116.4",
4
4
  "description": "Embedded Agentforce conversation client feature for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -26,7 +26,7 @@
26
26
  "clean": "rm -rf dist"
27
27
  },
28
28
  "dependencies": {
29
- "@salesforce/agentforce-conversation-client": "^1.116.2"
29
+ "@salesforce/agentforce-conversation-client": "^1.116.4"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "^19.2.7",
@@ -1,353 +0,0 @@
1
- # Salesforce Data Access
2
-
3
- - **Fetch or display Salesforce data** — Query records (Account, Contact, Opportunity, custom objects) to show in a component
4
- - **Create, update, or delete records** — Perform mutations on Salesforce data
5
- - **Add data fetching to a component** — Wire up a React component to Salesforce data
6
- - **Call REST APIs** — Use Connect REST, Apex REST, or UI API endpoints
7
- - **Explore the org schema** — Discover available objects, fields, or relationships
8
-
9
- ## Data SDK Requirement
10
-
11
- > **All Salesforce data access MUST use the Data SDK** (`@salesforce/sdk-data`). The SDK handles authentication, CSRF, and base URL resolution. Never use `fetch()` or `axios` directly.
12
-
13
- ```typescript
14
- import { createDataSDK, gql } from "@salesforce/sdk-data";
15
-
16
- const sdk = await createDataSDK();
17
-
18
- // GraphQL for record queries/mutations (PREFERRED)
19
- const response = await sdk.graphql?.<ResponseType>(query, variables);
20
-
21
- // REST for Connect REST, Apex REST, UI API (when GraphQL insufficient)
22
- const res = await sdk.fetch?.("/services/apexrest/my-resource");
23
- ```
24
-
25
- **Always use optional chaining** (`sdk.graphql?.()`, `sdk.fetch?.()`) — these methods may be undefined in some surfaces.
26
-
27
- ## Supported APIs
28
-
29
- **Only the following APIs are permitted.** Any endpoint not listed here must not be used.
30
-
31
- | API | Method | Endpoints / Use Case |
32
- |-----|--------|----------------------|
33
- | GraphQL | `sdk.graphql` | All record queries and mutations via `uiapi { }` namespace |
34
- | UI API REST | `sdk.fetch` | `/services/data/v{ver}/ui-api/records/{id}` — record metadata when GraphQL is insufficient |
35
- | Apex REST | `sdk.fetch` | `/services/apexrest/{resource}` — custom server-side logic, aggregates, multi-step transactions |
36
- | Connect REST | `sdk.fetch` | `/services/data/v{ver}/connect/file/upload/config` — file upload config |
37
- | Einstein LLM | `sdk.fetch` | `/services/data/v{ver}/einstein/llm/prompt/generations` — AI text generation |
38
-
39
- **Not supported:**
40
-
41
- - **Enterprise REST query endpoint** (`/services/data/v*/query` with SOQL) — blocked at the proxy level. Use GraphQL for record reads; use Apex REST if server-side SOQL aggregates are required.
42
- - **Aura-enabled Apex** (`@AuraEnabled`) — an LWC/Aura pattern with no invocation path from React webapps.
43
- - **Chatter API** (`/chatter/users/me`) — use `uiapi { currentUser { ... } }` in a GraphQL query instead.
44
- - **Any other Salesforce REST endpoint** not listed in the supported table above.
45
-
46
- ## Decision: GraphQL vs REST
47
-
48
- | Need | Method | Example |
49
- |------|--------|---------|
50
- | Query/mutate records | `sdk.graphql` | Account, Contact, custom objects |
51
- | Current user info | `sdk.graphql` | `uiapi { currentUser { Id Name { value } } }` |
52
- | UI API record metadata | `sdk.fetch` | `/ui-api/records/{id}` |
53
- | Connect REST | `sdk.fetch` | `/connect/file/upload/config` |
54
- | Apex REST | `sdk.fetch` | `/services/apexrest/auth/login` |
55
- | Einstein LLM | `sdk.fetch` | `/einstein/llm/prompt/generations` |
56
-
57
- **GraphQL is preferred** for record operations. Use REST only when GraphQL doesn't cover the use case.
58
-
59
- ---
60
-
61
- ## GraphQL Workflow
62
-
63
- ### Step 1: Acquire Schema
64
-
65
- The `schema.graphql` file (265K+ lines) is the source of truth. **Never open or parse it directly.**
66
-
67
- 1. Check if `schema.graphql` exists at the SFDX project root
68
- 2. If missing, run from the **webapp dir**: `npm run graphql:schema`
69
- 3. Custom objects appear only after metadata is deployed
70
-
71
- ### Step 2: Look Up Entity Schema
72
-
73
- Map user intent to PascalCase names ("accounts" → `Account`), then **run the search script from the project root**:
74
-
75
- ```bash
76
- # From project root — look up all relevant schema info for one or more entities
77
- bash scripts/graphql-search.sh Account
78
-
79
- # Multiple entities at once
80
- bash scripts/graphql-search.sh Account Contact Opportunity
81
- ```
82
-
83
- The script outputs five sections per entity:
84
- 1. **Type definition** — all queryable fields and relationships
85
- 2. **Filter options** — available fields for `where:` conditions
86
- 3. **Sort options** — available fields for `orderBy:`
87
- 4. **Create input** — fields accepted by create mutations
88
- 5. **Update input** — fields accepted by update mutations
89
-
90
- Use this output to determine exact field names before writing any query or mutation. **Maximum 2 script runs.** If the entity still can't be found, ask the user — the object may not be deployed.
91
-
92
- ### Step 3: Generate Query
93
-
94
- Use the templates below. Every field name **must** be verified from the script output in Step 2.
95
-
96
- #### Read Query Template
97
-
98
- ```graphql
99
- query GetAccounts {
100
- uiapi {
101
- query {
102
- Account(where: { Industry: { eq: "Technology" } }, first: 10) {
103
- edges {
104
- node {
105
- Id
106
- Name @optional { value }
107
- Industry @optional { value }
108
- # Parent relationship
109
- Owner @optional { Name { value } }
110
- # Child relationship
111
- Contacts @optional {
112
- edges { node { Name @optional { value } } }
113
- }
114
- }
115
- }
116
- }
117
- }
118
- }
119
- }
120
- ```
121
-
122
- **FLS Resilience**: Apply `@optional` to all record fields. The server omits inaccessible fields instead of failing. Consuming code must use optional chaining:
123
-
124
- ```typescript
125
- const name = node.Name?.value ?? "";
126
- ```
127
-
128
- #### Mutation Template
129
-
130
- ```graphql
131
- mutation CreateAccount($input: AccountCreateInput!) {
132
- uiapi {
133
- AccountCreate(input: $input) {
134
- Record { Id Name { value } }
135
- }
136
- }
137
- }
138
- ```
139
-
140
- **Mutation constraints:**
141
- - Create: Include required fields, only `createable` fields, no child relationships
142
- - Update: Include `Id`, only `updateable` fields
143
- - Delete: Include `Id` only
144
-
145
- #### Object Metadata & Picklist Values
146
-
147
- Use `uiapi { objectInfos(...) }` to fetch field metadata or picklist values. Pass **either** `apiNames` or `objectInfoInputs` — never both in the same query.
148
-
149
- **Object metadata** (field labels, data types, CRUD flags):
150
-
151
- ```typescript
152
- const GET_OBJECT_INFO = gql`
153
- query GetObjectInfo($apiNames: [String!]!) {
154
- uiapi {
155
- objectInfos(apiNames: $apiNames) {
156
- ApiName
157
- label
158
- labelPlural
159
- fields {
160
- ApiName
161
- label
162
- dataType
163
- updateable
164
- createable
165
- }
166
- }
167
- }
168
- }
169
- `;
170
-
171
- const sdk = await createDataSDK();
172
- const response = await sdk.graphql?.(GET_OBJECT_INFO, { apiNames: ["Account"] });
173
- const objectInfos = response?.data?.uiapi?.objectInfos ?? [];
174
- ```
175
-
176
- **Picklist values** (use `objectInfoInputs` + `... on PicklistField` inline fragment):
177
-
178
- ```typescript
179
- const GET_PICKLIST_VALUES = gql`
180
- query GetPicklistValues($objectInfoInputs: [ObjectInfoInput!]!) {
181
- uiapi {
182
- objectInfos(objectInfoInputs: $objectInfoInputs) {
183
- ApiName
184
- fields {
185
- ApiName
186
- ... on PicklistField {
187
- picklistValuesByRecordTypeIDs {
188
- recordTypeID
189
- picklistValues {
190
- label
191
- value
192
- }
193
- }
194
- }
195
- }
196
- }
197
- }
198
- }
199
- `;
200
-
201
- const response = await sdk.graphql?.(GET_PICKLIST_VALUES, {
202
- objectInfoInputs: [{ objectApiName: "Account" }],
203
- });
204
- const fields = response?.data?.uiapi?.objectInfos?.[0]?.fields ?? [];
205
- ```
206
-
207
- ### Step 4: Validate & Test
208
-
209
- 1. **Lint**: `npx eslint <file>` from webapp dir
210
- 2. **Test**: Ask user before testing. For mutations, request input values — never fabricate data.
211
-
212
- **If ESLint reports a GraphQL error** (e.g. `Cannot query field`, `Unknown type`, `Unknown argument`), the field or type name is wrong. Re-run the schema search script to find the correct name — do not guess:
213
-
214
- ```bash
215
- # From project root — re-check the entity that caused the error
216
- bash scripts/graphql-search.sh <EntityName>
217
- ```
218
-
219
- Then fix the query using the exact names from the script output.
220
-
221
- ---
222
-
223
- ## Webapp Integration (React)
224
-
225
- ```typescript
226
- import { createDataSDK, gql } from "@salesforce/sdk-data";
227
-
228
- const GET_ACCOUNTS = gql`
229
- query GetAccounts {
230
- uiapi {
231
- query {
232
- Account(first: 10) {
233
- edges {
234
- node {
235
- Id
236
- Name @optional { value }
237
- Industry @optional { value }
238
- }
239
- }
240
- }
241
- }
242
- }
243
- }
244
- `;
245
-
246
- const sdk = await createDataSDK();
247
- const response = await sdk.graphql?.(GET_ACCOUNTS);
248
-
249
- if (response?.errors?.length) {
250
- throw new Error(response.errors.map(e => e.message).join("; "));
251
- }
252
-
253
- const accounts = response?.data?.uiapi?.query?.Account?.edges?.map(e => e.node) ?? [];
254
-
255
- ---
256
-
257
- ## REST API Patterns
258
-
259
- Use `sdk.fetch` when GraphQL is insufficient. See the [Supported APIs](#supported-apis) table for the full allowlist.
260
-
261
- ```typescript
262
- declare const __SF_API_VERSION__: string;
263
- const API_VERSION = typeof __SF_API_VERSION__ !== "undefined" ? __SF_API_VERSION__ : "65.0";
264
-
265
- // Connect — file upload config
266
- const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/connect/file/upload/config`);
267
-
268
- // Apex REST (no version in path)
269
- const res = await sdk.fetch?.("/services/apexrest/auth/login", {
270
- method: "POST",
271
- body: JSON.stringify({ email, password }),
272
- headers: { "Content-Type": "application/json" },
273
- });
274
-
275
- // UI API — record with metadata (prefer GraphQL for simple reads)
276
- const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/ui-api/records/${recordId}`);
277
-
278
- // Einstein LLM
279
- const res = await sdk.fetch?.(`/services/data/v${API_VERSION}/einstein/llm/prompt/generations`, {
280
- method: "POST",
281
- body: JSON.stringify({ promptTextorId: prompt }),
282
- });
283
- ```
284
-
285
- **Current user**: Do not use Chatter (`/chatter/users/me`). Use GraphQL instead:
286
-
287
- ```typescript
288
- const GET_CURRENT_USER = gql`
289
- query CurrentUser {
290
- uiapi { currentUser { Id Name { value } } }
291
- }
292
- `;
293
- const response = await sdk.graphql?.(GET_CURRENT_USER);
294
- ```
295
-
296
- ---
297
-
298
- ## Directory Structure
299
-
300
- ```
301
- <project-root>/ ← SFDX project root
302
- ├── schema.graphql ← grep target (lives here)
303
- ├── sfdx-project.json
304
- └── force-app/main/default/webapplications/<app-name>/ ← webapp dir
305
- ├── package.json ← npm scripts
306
- └── src/
307
- ```
308
-
309
- | Command | Run From | Why |
310
- |---------|----------|-----|
311
- | `npm run graphql:schema` | webapp dir | Script in webapp's package.json |
312
- | `npx eslint <file>` | webapp dir | Reads eslint.config.js |
313
- | `bash scripts/graphql-search.sh <Entity>` | project root | Schema lookup |
314
- | `sf api request rest` | project root | Needs sfdx-project.json |
315
-
316
- ---
317
-
318
- ## Quick Reference
319
-
320
- ### Schema Lookup (from project root)
321
-
322
- Run the search script to get all relevant schema info in one step:
323
-
324
- ```bash
325
- bash scripts/graphql-search.sh <EntityName>
326
- ```
327
-
328
- | Script Output Section | Used For |
329
- |-----------------------|----------|
330
- | Type definition | Field names, parent/child relationships |
331
- | Filter options | `where:` conditions |
332
- | Sort options | `orderBy:` |
333
- | CreateRepresentation | Create mutation field list |
334
- | UpdateRepresentation | Update mutation field list |
335
-
336
- ### Error Categories
337
-
338
- | Error Contains | Resolution |
339
- |----------------|------------|
340
- | `Cannot query field` | Field name is wrong — run `graphql-search.sh <Entity>` and use the exact name from the Type definition section |
341
- | `Unknown type` | Type name is wrong — run `graphql-search.sh <Entity>` to confirm the correct PascalCase entity name |
342
- | `Unknown argument` | Argument name is wrong — run `graphql-search.sh <Entity>` and check Filter or OrderBy sections |
343
- | `invalid syntax` | Fix syntax per error message |
344
- | `validation error` | Field name is wrong — run `graphql-search.sh <Entity>` to verify |
345
- | `VariableTypeMismatch` | Correct argument type from schema |
346
- | `invalid cross reference id` | Entity deleted — ask for valid Id |
347
-
348
- ### Checklist
349
-
350
- - [ ] All field names verified via search script (Step 2)
351
- - [ ] `@optional` applied to record fields (reads)
352
- - [ ] Optional chaining in consuming code
353
- - [ ] Lint passes: `npx eslint <file>`
@@ -1,16 +0,0 @@
1
- # UI Platform Rule
2
-
3
- **All new UI must be built as a Salesforce Web Application.**
4
-
5
- When any task involves creating a new UI, frontend, page, dashboard, form, or user-facing feature:
6
-
7
- 1. Use `sf webapp generate` to scaffold the web app inside the SFDX project — do not use `create-react-app`, standalone Vite, or any other scaffold.
8
- 2. The app must live under `<sfdx-source>/webapplications/<AppName>/` as a WebApplication bundle.
9
- 3. Do not build new UIs as LWC components, Aura components, or Visualforce pages.
10
-
11
- For setup from the project root, use `node scripts/setup-cli.mjs --help` and the options documented there.
12
-
13
- ## Data Access (MUST FOLLOW)
14
-
15
- - **Never hardcode data in the app.** All data displayed in the UI must come from live Salesforce data fetching — no static arrays, mock objects, or placeholder values in production code.
16
- - **Follow `.a4drules/webapp-data.md`** before writing any data access code. All implementation must match those rules (Data SDK, supported APIs, GraphQL workflow).