@schandlergarcia/sf-web-components 1.9.48 → 1.9.52

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.
@@ -0,0 +1,292 @@
1
+ """
2
+ Generated schema for Engine Travel Command Center
3
+ Source: src/data/engine-sample-data.js field names
4
+ Note: This is a minimal schema for GraphQL tooling when introspection is broken
5
+ """
6
+
7
+ schema {
8
+ query: Query
9
+ }
10
+
11
+ type Query {
12
+ uiapi: UIAPI!
13
+ }
14
+
15
+ type UIAPI {
16
+ query: UIAPIQuery!
17
+ }
18
+
19
+ type UIAPIQuery {
20
+ Contact(first: Int, after: String, where: ContactFilter): ContactConnection
21
+ Trip__c(first: Int, after: String, where: Trip__cFilter): Trip__cConnection
22
+ Flight__c(first: Int, after: String, where: Flight__cFilter): Flight__cConnection
23
+ Booking__c(first: Int, after: String, where: Booking__cFilter): Booking__cConnection
24
+ Disruption__c(first: Int, after: String, where: Disruption__cFilter): Disruption__cConnection
25
+ Rebooking_Action__c(first: Int, after: String, where: Rebooking_Action__cFilter): Rebooking_Action__cConnection
26
+ Travel_Policy__c(first: Int, after: String, where: Travel_Policy__cFilter): Travel_Policy__cConnection
27
+ }
28
+
29
+ # Field value wrappers for FLS
30
+ type FieldValueString {
31
+ value: String
32
+ displayValue: String
33
+ }
34
+
35
+ type FieldValueFloat {
36
+ value: Float
37
+ displayValue: String
38
+ }
39
+
40
+ type FieldValueBoolean {
41
+ value: Boolean
42
+ displayValue: String
43
+ }
44
+
45
+ type FieldValueID {
46
+ value: ID
47
+ displayValue: String
48
+ }
49
+
50
+ # Contact (Travelers)
51
+ type Contact {
52
+ Id: ID!
53
+ FirstName: FieldValueString
54
+ LastName: FieldValueString
55
+ Department: FieldValueString
56
+ Home_Airport__c: FieldValueString
57
+ Travel_Policy_Tier__c: FieldValueString
58
+ Is_Active_Traveler__c: FieldValueBoolean
59
+ Role__c: FieldValueString
60
+ }
61
+
62
+ type ContactEdge {
63
+ node: Contact!
64
+ cursor: String!
65
+ }
66
+
67
+ type ContactConnection {
68
+ edges: [ContactEdge!]!
69
+ pageInfo: PageInfo!
70
+ totalCount: Int
71
+ }
72
+
73
+ input ContactFilter {
74
+ Id: IDFilter
75
+ FirstName: StringFilter
76
+ LastName: StringFilter
77
+ Department: StringFilter
78
+ }
79
+
80
+ # Trip__c
81
+ type Trip__c {
82
+ Id: ID!
83
+ Trip_Name__c: FieldValueString
84
+ Contact__c: FieldValueString
85
+ Origin_City__c: FieldValueString
86
+ Origin_Airport__c: FieldValueString
87
+ Destination_City__c: FieldValueString
88
+ Destination_Airport__c: FieldValueString
89
+ Start_Date__c: FieldValueString
90
+ End_Date__c: FieldValueString
91
+ Status__c: FieldValueString
92
+ Total_Cost__c: FieldValueFloat
93
+ In_Policy__c: FieldValueBoolean
94
+ Has_Disruption__c: FieldValueBoolean
95
+ }
96
+
97
+ type Trip__cEdge {
98
+ node: Trip__c!
99
+ cursor: String!
100
+ }
101
+
102
+ type Trip__cConnection {
103
+ edges: [Trip__cEdge!]!
104
+ pageInfo: PageInfo!
105
+ totalCount: Int
106
+ }
107
+
108
+ input Trip__cFilter {
109
+ Id: IDFilter
110
+ Trip_Name__c: StringFilter
111
+ Status__c: StringFilter
112
+ }
113
+
114
+ # Flight__c
115
+ type Flight__c {
116
+ Id: ID!
117
+ Flight_Number__c: FieldValueString
118
+ Airline__c: FieldValueString
119
+ Departure_Airport__c: FieldValueString
120
+ Departure_City__c: FieldValueString
121
+ Departure_Longitude__c: FieldValueFloat
122
+ Departure_Latitude__c: FieldValueFloat
123
+ Arrival_Airport__c: FieldValueString
124
+ Arrival_City__c: FieldValueString
125
+ Arrival_Longitude__c: FieldValueFloat
126
+ Arrival_Latitude__c: FieldValueFloat
127
+ Departure_DateTime__c: FieldValueString
128
+ Flight_Status__c: FieldValueString
129
+ Delay_Minutes__c: FieldValueFloat
130
+ Cabin_Class__c: FieldValueString
131
+ Contact__c: FieldValueString
132
+ }
133
+
134
+ type Flight__cEdge {
135
+ node: Flight__c!
136
+ cursor: String!
137
+ }
138
+
139
+ type Flight__cConnection {
140
+ edges: [Flight__cEdge!]!
141
+ pageInfo: PageInfo!
142
+ totalCount: Int
143
+ }
144
+
145
+ input Flight__cFilter {
146
+ Id: IDFilter
147
+ Flight_Number__c: StringFilter
148
+ Flight_Status__c: StringFilter
149
+ }
150
+
151
+ # Booking__c
152
+ type Booking__c {
153
+ Id: ID!
154
+ Contact__c: FieldValueString
155
+ Booking_Type__c: FieldValueString
156
+ Status__c: FieldValueString
157
+ Cost__c: FieldValueFloat
158
+ In_Policy__c: FieldValueBoolean
159
+ }
160
+
161
+ type Booking__cEdge {
162
+ node: Booking__c!
163
+ cursor: String!
164
+ }
165
+
166
+ type Booking__cConnection {
167
+ edges: [Booking__cEdge!]!
168
+ pageInfo: PageInfo!
169
+ totalCount: Int
170
+ }
171
+
172
+ input Booking__cFilter {
173
+ Id: IDFilter
174
+ Status__c: StringFilter
175
+ }
176
+
177
+ # Disruption__c
178
+ type Disruption__c {
179
+ Id: ID!
180
+ Flight_Number__c: FieldValueString
181
+ Disruption_Type__c: FieldValueString
182
+ Severity__c: FieldValueString
183
+ Status__c: FieldValueString
184
+ Impacted_Flight__c: FieldValueString
185
+ Trip__c: FieldValueString
186
+ City__c: FieldValueString
187
+ Affected_Traveler_Count__c: FieldValueFloat
188
+ Auto_Rebook_Eligible__c: FieldValueBoolean
189
+ Recommended_Action__c: FieldValueString
190
+ Description__c: FieldValueString
191
+ }
192
+
193
+ type Disruption__cEdge {
194
+ node: Disruption__c!
195
+ cursor: String!
196
+ }
197
+
198
+ type Disruption__cConnection {
199
+ edges: [Disruption__cEdge!]!
200
+ pageInfo: PageInfo!
201
+ totalCount: Int
202
+ }
203
+
204
+ input Disruption__cFilter {
205
+ Id: IDFilter
206
+ Severity__c: StringFilter
207
+ Status__c: StringFilter
208
+ }
209
+
210
+ # Rebooking_Action__c
211
+ type Rebooking_Action__c {
212
+ Id: ID!
213
+ Action_Type__c: FieldValueString
214
+ Status__c: FieldValueString
215
+ Handled_By__c: FieldValueString
216
+ Contact__c: FieldValueString
217
+ Original_Flight__c: FieldValueString
218
+ New_Flight__c: FieldValueString
219
+ Cost_Difference__c: FieldValueFloat
220
+ Notes__c: FieldValueString
221
+ Created_DateTime__c: FieldValueString
222
+ }
223
+
224
+ type Rebooking_Action__cEdge {
225
+ node: Rebooking_Action__c!
226
+ cursor: String!
227
+ }
228
+
229
+ type Rebooking_Action__cConnection {
230
+ edges: [Rebooking_Action__cEdge!]!
231
+ pageInfo: PageInfo!
232
+ totalCount: Int
233
+ }
234
+
235
+ input Rebooking_Action__cFilter {
236
+ Id: IDFilter
237
+ Status__c: StringFilter
238
+ }
239
+
240
+ # Travel_Policy__c
241
+ type Travel_Policy__c {
242
+ Id: ID!
243
+ Name: FieldValueString
244
+ Description__c: FieldValueString
245
+ Active__c: FieldValueBoolean
246
+ Policy_Tier__c: FieldValueString
247
+ Max_Flight_Cost__c: FieldValueFloat
248
+ Max_Hotel_Rate__c: FieldValueFloat
249
+ Advance_Booking_Days__c: FieldValueFloat
250
+ Preferred_Airlines__c: FieldValueString
251
+ Preferred_Hotel_Chains__c: FieldValueString
252
+ }
253
+
254
+ type Travel_Policy__cEdge {
255
+ node: Travel_Policy__c!
256
+ cursor: String!
257
+ }
258
+
259
+ type Travel_Policy__cConnection {
260
+ edges: [Travel_Policy__cEdge!]!
261
+ pageInfo: PageInfo!
262
+ totalCount: Int
263
+ }
264
+
265
+ input Travel_Policy__cFilter {
266
+ Id: IDFilter
267
+ Policy_Tier__c: StringFilter
268
+ }
269
+
270
+ # Pagination
271
+ type PageInfo {
272
+ hasNextPage: Boolean!
273
+ hasPreviousPage: Boolean!
274
+ startCursor: String
275
+ endCursor: String
276
+ }
277
+
278
+ # Filter input types
279
+ input IDFilter {
280
+ eq: ID
281
+ ne: ID
282
+ in: [ID!]
283
+ nin: [ID!]
284
+ }
285
+
286
+ input StringFilter {
287
+ eq: String
288
+ ne: String
289
+ like: String
290
+ in: [String!]
291
+ nin: [String!]
292
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.48",
3
+ "version": "1.9.52",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,370 @@
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
+ }