@schandlergarcia/sf-web-components 1.9.88 → 2.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.
Files changed (41) hide show
  1. package/.a4drules/features/command-center-dashboard-rule.md +1 -1
  2. package/.a4drules/skills/command-center-builder/SKILL.md +33 -36
  3. package/.a4drules/skills/command-center-builder/getting-started.md +64 -104
  4. package/.a4drules/skills/command-center-builder/improved-build-process.md +28 -34
  5. package/.a4drules/skills/command-center-guide/SKILL.md +9 -9
  6. package/.a4drules/skills/command-center-project/SKILL.md +4 -5
  7. package/.a4drules/skills/component-library/SKILL.md +8 -10
  8. package/.a4drules/skills/component-library/card-components.md +3 -3
  9. package/.a4drules/skills/component-library/chat-data.md +4 -6
  10. package/.a4drules/troubleshooting/codegen-overwrites-types.md +21 -162
  11. package/.a4drules/troubleshooting/graphql-introspection-failure.md +13 -264
  12. package/.a4drules/validation-requirements.md +3 -5
  13. package/.a4drules/webapp-data.md +1 -1
  14. package/CHANGELOG.md +23 -0
  15. package/CLAUDE.md +19 -39
  16. package/dist/components/library/cards/ActivityCard.js +9 -9
  17. package/dist/components/library/cards/ActivityCard.js.map +1 -1
  18. package/dist/styles/base.css +112 -27
  19. package/dist/styles/global.css +15 -30
  20. package/package.json +2 -3
  21. package/scripts/postinstall.mjs +12 -203
  22. package/scripts/reset-command-center.sh +37 -416
  23. package/scripts/validate-dashboard.sh +4 -4
  24. package/src/components/library/cards/ActivityCard.jsx +2 -2
  25. package/src/styles/base.css +223 -0
  26. package/src/styles/global.css +223 -0
  27. package/src/templates/config/vite.config.ts.template +0 -18
  28. package/.a4drules/features/engine-dashboard-rule.md +0 -63
  29. package/.a4drules/features/phase2-data-pattern.md +0 -15
  30. package/assets/images/engine_logo.png +0 -0
  31. package/data/README.md +0 -202
  32. package/data/USAGE.md +0 -81
  33. package/data/agentApiConfig.ts +0 -36
  34. package/data/copy-to-webapp.sh +0 -61
  35. package/data/engine-command-center-prd.md +0 -575
  36. package/data/engine-live-data.js +0 -135
  37. package/data/engine-sample-data.js +0 -378
  38. package/data/schema.graphql +0 -292
  39. package/data/useEngineLiveData.ts +0 -49
  40. package/data/useEvaAgent.ts +0 -288
  41. package/scripts/generate-schema-from-sample.mjs +0 -370
@@ -1,370 +0,0 @@
1
- /**
2
- * Generate a minimal GraphQL schema from sample data when introspection is broken.
3
- *
4
- * This is a workaround for orgs where schema introspection fails due to fields
5
- * with null data types. It creates a schema.graphql file by analyzing the sample
6
- * data structure instead of querying the org.
7
- *
8
- * Usage:
9
- * node scripts/generate-schema-from-sample.mjs
10
- */
11
- import { writeFileSync } from 'node:fs';
12
- import { resolve, dirname } from 'node:path';
13
- import { fileURLToPath } from 'node:url';
14
-
15
- const __filename = fileURLToPath(import.meta.url);
16
- const __dirname = dirname(__filename);
17
-
18
- // Import sample data to extract field names
19
- const TRAVELERS_FIELDS = [
20
- 'Id',
21
- 'FirstName',
22
- 'LastName',
23
- 'Department',
24
- 'Home_Airport__c',
25
- 'Travel_Policy_Tier__c',
26
- 'Is_Active_Traveler__c',
27
- 'Role__c',
28
- ];
29
-
30
- const TRIPS_FIELDS = [
31
- 'Id',
32
- 'Trip_Name__c',
33
- 'Contact__c',
34
- 'Origin_City__c',
35
- 'Origin_Airport__c',
36
- 'Destination_City__c',
37
- 'Destination_Airport__c',
38
- 'Start_Date__c',
39
- 'End_Date__c',
40
- 'Status__c',
41
- 'Total_Cost__c',
42
- 'In_Policy__c',
43
- 'Has_Disruption__c',
44
- ];
45
-
46
- const FLIGHTS_FIELDS = [
47
- 'Id',
48
- 'Flight_Number__c',
49
- 'Airline__c',
50
- 'Departure_Airport__c',
51
- 'Departure_City__c',
52
- 'Departure_Longitude__c',
53
- 'Departure_Latitude__c',
54
- 'Arrival_Airport__c',
55
- 'Arrival_City__c',
56
- 'Arrival_Longitude__c',
57
- 'Arrival_Latitude__c',
58
- 'Departure_DateTime__c',
59
- 'Flight_Status__c',
60
- 'Delay_Minutes__c',
61
- 'Cabin_Class__c',
62
- 'Contact__c',
63
- ];
64
-
65
- const BOOKINGS_FIELDS = [
66
- 'Id',
67
- 'Contact__c',
68
- 'Booking_Type__c',
69
- 'Status__c',
70
- 'Cost__c',
71
- 'In_Policy__c',
72
- ];
73
-
74
- const DISRUPTIONS_FIELDS = [
75
- 'Id',
76
- 'Flight_Number__c',
77
- 'Disruption_Type__c',
78
- 'Severity__c',
79
- 'Status__c',
80
- 'Impacted_Flight__c',
81
- 'Trip__c',
82
- 'City__c',
83
- 'Affected_Traveler_Count__c',
84
- 'Auto_Rebook_Eligible__c',
85
- 'Recommended_Action__c',
86
- 'Description__c',
87
- ];
88
-
89
- const REBOOKING_ACTIONS_FIELDS = [
90
- 'Id',
91
- 'Action_Type__c',
92
- 'Status__c',
93
- 'Handled_By__c',
94
- 'Contact__c',
95
- 'Original_Flight__c',
96
- 'New_Flight__c',
97
- 'Cost_Difference__c',
98
- 'Notes__c',
99
- 'Created_DateTime__c',
100
- ];
101
-
102
- const TRAVEL_POLICIES_FIELDS = [
103
- 'Id',
104
- 'Name',
105
- 'Description__c',
106
- 'Active__c',
107
- 'Policy_Tier__c',
108
- 'Max_Flight_Cost__c',
109
- 'Max_Hotel_Rate__c',
110
- 'Advance_Booking_Days__c',
111
- 'Preferred_Airlines__c',
112
- 'Preferred_Hotel_Chains__c',
113
- ];
114
-
115
- function inferType(fieldName) {
116
- if (fieldName === 'Id') return 'ID';
117
- if (fieldName.includes('Count') || fieldName.includes('Cost') || fieldName.includes('Rate') || fieldName.includes('Days')) {
118
- return 'Float';
119
- }
120
- if (fieldName.includes('Date') || fieldName.includes('DateTime')) {
121
- return 'String'; // Dates come as ISO strings
122
- }
123
- if (fieldName.includes('Is_') || fieldName.includes('Has_') || fieldName.includes('Active') || fieldName.includes('In_Policy') || fieldName.includes('Eligible')) {
124
- return 'Boolean';
125
- }
126
- if (fieldName.includes('Longitude') || fieldName.includes('Latitude') || fieldName.includes('Delay_Minutes')) {
127
- return 'Float';
128
- }
129
- return 'String';
130
- }
131
-
132
- function generateFieldType(fieldName, indent = ' ') {
133
- const type = inferType(fieldName);
134
- if (fieldName === 'Id') {
135
- return `${indent}${fieldName}: ${type}!`;
136
- }
137
- // All non-ID fields are wrapped in value object for FLS
138
- return `${indent}${fieldName}: FieldValue${type}`;
139
- }
140
-
141
- function generateObjectType(objectName, fields) {
142
- const fieldDefs = fields.map(f => generateFieldType(f, ' ')).join('\n');
143
- return `type ${objectName} {\n${fieldDefs}\n}`;
144
- }
145
-
146
- const schema = `"""
147
- Generated schema for Engine Travel Command Center
148
- Source: src/data/engine-sample-data.js field names
149
- Note: This is a minimal schema for GraphQL tooling when introspection is broken
150
- """
151
-
152
- schema {
153
- query: Query
154
- }
155
-
156
- type Query {
157
- uiapi: UIAPI!
158
- }
159
-
160
- type UIAPI {
161
- query: UIAPIQuery!
162
- }
163
-
164
- type UIAPIQuery {
165
- Contact(first: Int, after: String, where: ContactFilter): ContactConnection
166
- Trip__c(first: Int, after: String, where: Trip__cFilter): Trip__cConnection
167
- Flight__c(first: Int, after: String, where: Flight__cFilter): Flight__cConnection
168
- Booking__c(first: Int, after: String, where: Booking__cFilter): Booking__cConnection
169
- Disruption__c(first: Int, after: String, where: Disruption__cFilter): Disruption__cConnection
170
- Rebooking_Action__c(first: Int, after: String, where: Rebooking_Action__cFilter): Rebooking_Action__cConnection
171
- Travel_Policy__c(first: Int, after: String, where: Travel_Policy__cFilter): Travel_Policy__cConnection
172
- }
173
-
174
- # Field value wrappers for FLS
175
- type FieldValueString {
176
- value: String
177
- displayValue: String
178
- }
179
-
180
- type FieldValueFloat {
181
- value: Float
182
- displayValue: String
183
- }
184
-
185
- type FieldValueBoolean {
186
- value: Boolean
187
- displayValue: String
188
- }
189
-
190
- type FieldValueID {
191
- value: ID
192
- displayValue: String
193
- }
194
-
195
- # Contact (Travelers)
196
- ${generateObjectType('Contact', TRAVELERS_FIELDS)}
197
-
198
- type ContactEdge {
199
- node: Contact!
200
- cursor: String!
201
- }
202
-
203
- type ContactConnection {
204
- edges: [ContactEdge!]!
205
- pageInfo: PageInfo!
206
- totalCount: Int
207
- }
208
-
209
- input ContactFilter {
210
- Id: IDFilter
211
- FirstName: StringFilter
212
- LastName: StringFilter
213
- Department: StringFilter
214
- }
215
-
216
- # Trip__c
217
- ${generateObjectType('Trip__c', TRIPS_FIELDS)}
218
-
219
- type Trip__cEdge {
220
- node: Trip__c!
221
- cursor: String!
222
- }
223
-
224
- type Trip__cConnection {
225
- edges: [Trip__cEdge!]!
226
- pageInfo: PageInfo!
227
- totalCount: Int
228
- }
229
-
230
- input Trip__cFilter {
231
- Id: IDFilter
232
- Trip_Name__c: StringFilter
233
- Status__c: StringFilter
234
- }
235
-
236
- # Flight__c
237
- ${generateObjectType('Flight__c', FLIGHTS_FIELDS)}
238
-
239
- type Flight__cEdge {
240
- node: Flight__c!
241
- cursor: String!
242
- }
243
-
244
- type Flight__cConnection {
245
- edges: [Flight__cEdge!]!
246
- pageInfo: PageInfo!
247
- totalCount: Int
248
- }
249
-
250
- input Flight__cFilter {
251
- Id: IDFilter
252
- Flight_Number__c: StringFilter
253
- Flight_Status__c: StringFilter
254
- }
255
-
256
- # Booking__c
257
- ${generateObjectType('Booking__c', BOOKINGS_FIELDS)}
258
-
259
- type Booking__cEdge {
260
- node: Booking__c!
261
- cursor: String!
262
- }
263
-
264
- type Booking__cConnection {
265
- edges: [Booking__cEdge!]!
266
- pageInfo: PageInfo!
267
- totalCount: Int
268
- }
269
-
270
- input Booking__cFilter {
271
- Id: IDFilter
272
- Status__c: StringFilter
273
- }
274
-
275
- # Disruption__c
276
- ${generateObjectType('Disruption__c', DISRUPTIONS_FIELDS)}
277
-
278
- type Disruption__cEdge {
279
- node: Disruption__c!
280
- cursor: String!
281
- }
282
-
283
- type Disruption__cConnection {
284
- edges: [Disruption__cEdge!]!
285
- pageInfo: PageInfo!
286
- totalCount: Int
287
- }
288
-
289
- input Disruption__cFilter {
290
- Id: IDFilter
291
- Severity__c: StringFilter
292
- Status__c: StringFilter
293
- }
294
-
295
- # Rebooking_Action__c
296
- ${generateObjectType('Rebooking_Action__c', REBOOKING_ACTIONS_FIELDS)}
297
-
298
- type Rebooking_Action__cEdge {
299
- node: Rebooking_Action__c!
300
- cursor: String!
301
- }
302
-
303
- type Rebooking_Action__cConnection {
304
- edges: [Rebooking_Action__cEdge!]!
305
- pageInfo: PageInfo!
306
- totalCount: Int
307
- }
308
-
309
- input Rebooking_Action__cFilter {
310
- Id: IDFilter
311
- Status__c: StringFilter
312
- }
313
-
314
- # Travel_Policy__c
315
- ${generateObjectType('Travel_Policy__c', TRAVEL_POLICIES_FIELDS)}
316
-
317
- type Travel_Policy__cEdge {
318
- node: Travel_Policy__c!
319
- cursor: String!
320
- }
321
-
322
- type Travel_Policy__cConnection {
323
- edges: [Travel_Policy__cEdge!]!
324
- pageInfo: PageInfo!
325
- totalCount: Int
326
- }
327
-
328
- input Travel_Policy__cFilter {
329
- Id: IDFilter
330
- Policy_Tier__c: StringFilter
331
- }
332
-
333
- # Pagination
334
- type PageInfo {
335
- hasNextPage: Boolean!
336
- hasPreviousPage: Boolean!
337
- startCursor: String
338
- endCursor: String
339
- }
340
-
341
- # Filter input types
342
- input IDFilter {
343
- eq: ID
344
- ne: ID
345
- in: [ID!]
346
- nin: [ID!]
347
- }
348
-
349
- input StringFilter {
350
- eq: String
351
- ne: String
352
- like: String
353
- in: [String!]
354
- nin: [String!]
355
- }
356
- `;
357
-
358
- // Determine output path - write to current working directory (where the script was called from)
359
- const outputPath = resolve(process.cwd(), 'schema.graphql');
360
-
361
- try {
362
- writeFileSync(outputPath, schema);
363
- console.log(`✅ Schema generated successfully at ${outputPath}`);
364
- console.log(` Source: Sample data field names`);
365
- console.log(` Objects: Contact, Trip__c, Flight__c, Booking__c, Disruption__c, Rebooking_Action__c, Travel_Policy__c`);
366
- console.log(`\nNote: This is a minimal schema for tooling. It may not include all fields or types from the actual org.`);
367
- } catch (error) {
368
- console.error('❌ Failed to write schema:', error.message);
369
- process.exit(1);
370
- }