@eide/foir-cli 0.1.16 → 0.1.17

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 (47) hide show
  1. package/dist/codegen/field-mapping.d.ts +1 -0
  2. package/dist/codegen/field-mapping.d.ts.map +1 -1
  3. package/dist/codegen/field-mapping.js +8 -0
  4. package/dist/codegen/generators/customer-profile-hooks.d.ts +5 -0
  5. package/dist/codegen/generators/customer-profile-hooks.d.ts.map +1 -0
  6. package/dist/codegen/generators/customer-profile-hooks.js +78 -0
  7. package/dist/codegen/generators/customer-profile-loaders.d.ts +5 -0
  8. package/dist/codegen/generators/customer-profile-loaders.d.ts.map +1 -0
  9. package/dist/codegen/generators/customer-profile-loaders.js +67 -0
  10. package/dist/codegen/generators/customer-profile-operations.d.ts +5 -0
  11. package/dist/codegen/generators/customer-profile-operations.d.ts.map +1 -0
  12. package/dist/codegen/generators/customer-profile-operations.js +126 -0
  13. package/dist/codegen/generators/public-schema-content.d.ts +14 -0
  14. package/dist/codegen/generators/public-schema-content.d.ts.map +1 -0
  15. package/dist/codegen/generators/public-schema-content.js +22 -0
  16. package/dist/codegen/generators/react-hooks-index.d.ts +6 -0
  17. package/dist/codegen/generators/react-hooks-index.d.ts.map +1 -0
  18. package/dist/codegen/generators/react-hooks-index.js +20 -0
  19. package/dist/codegen/generators/react-hooks.d.ts +7 -0
  20. package/dist/codegen/generators/react-hooks.d.ts.map +1 -0
  21. package/dist/codegen/generators/react-hooks.js +139 -0
  22. package/dist/codegen/generators/remix-loaders-index.d.ts +6 -0
  23. package/dist/codegen/generators/remix-loaders-index.d.ts.map +1 -0
  24. package/dist/codegen/generators/remix-loaders-index.js +20 -0
  25. package/dist/codegen/generators/remix-loaders.d.ts +7 -0
  26. package/dist/codegen/generators/remix-loaders.d.ts.map +1 -0
  27. package/dist/codegen/generators/remix-loaders.js +107 -0
  28. package/dist/codegen/generators/static-documents.d.ts +14 -0
  29. package/dist/codegen/generators/static-documents.d.ts.map +1 -0
  30. package/dist/codegen/generators/static-documents.js +728 -0
  31. package/dist/codegen/generators/typed-operations-common.d.ts +6 -0
  32. package/dist/codegen/generators/typed-operations-common.d.ts.map +1 -0
  33. package/dist/codegen/generators/typed-operations-common.js +74 -0
  34. package/dist/codegen/generators/typed-operations-index.d.ts +6 -0
  35. package/dist/codegen/generators/typed-operations-index.d.ts.map +1 -0
  36. package/dist/codegen/generators/typed-operations-index.js +22 -0
  37. package/dist/codegen/generators/typed-operations.d.ts +11 -0
  38. package/dist/codegen/generators/typed-operations.d.ts.map +1 -0
  39. package/dist/codegen/generators/typed-operations.js +251 -0
  40. package/dist/commands/pull.d.ts.map +1 -1
  41. package/dist/commands/pull.js +135 -25
  42. package/dist/config/pull-config.d.ts +6 -0
  43. package/dist/config/pull-config.d.ts.map +1 -1
  44. package/dist/config/pull-config.js +50 -1
  45. package/dist/config/types.d.ts +23 -0
  46. package/dist/config/types.d.ts.map +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,728 @@
1
+ /**
2
+ * Generates static .graphql files for non-model API domains.
3
+ * These cover ~80% of the public API that has no model-specific typing.
4
+ */
5
+ const HEADER = '# @generated by foir — DO NOT EDIT MANUALLY';
6
+ function authDocument() {
7
+ return `# Customer authentication operations
8
+ ${HEADER}
9
+
10
+ mutation CustomerLogin($email: String!, $password: String!) {
11
+ customerLogin(email: $email, password: $password) {
12
+ token
13
+ refreshToken
14
+ customer { id email status }
15
+ }
16
+ }
17
+
18
+ mutation CustomerRegister($email: String!, $password: String!) {
19
+ customerRegister(email: $email, password: $password) {
20
+ token
21
+ refreshToken
22
+ customer { id email status }
23
+ }
24
+ }
25
+
26
+ mutation CustomerRequestOTP($email: String!) {
27
+ customerRequestOTP(email: $email) {
28
+ success
29
+ message
30
+ expiresIn
31
+ }
32
+ }
33
+
34
+ mutation CustomerLoginOTP($email: String!, $otp: String!) {
35
+ customerLoginOTP(email: $email, otp: $otp) {
36
+ token
37
+ refreshToken
38
+ customer { id email status }
39
+ }
40
+ }
41
+
42
+ mutation CustomerRefreshToken($refreshToken: String!) {
43
+ customerRefreshToken(refreshToken: $refreshToken) {
44
+ token
45
+ refreshToken
46
+ }
47
+ }
48
+
49
+ mutation CustomerRequestPasswordReset($email: String!) {
50
+ customerRequestPasswordReset(email: $email) {
51
+ success
52
+ message
53
+ }
54
+ }
55
+
56
+ mutation CustomerResetPassword($token: String!, $newPassword: String!) {
57
+ customerResetPassword(token: $token, newPassword: $newPassword) {
58
+ success
59
+ message
60
+ }
61
+ }
62
+
63
+ mutation CustomerUpdatePassword($currentPassword: String!, $newPassword: String!) {
64
+ customerUpdatePassword(currentPassword: $currentPassword, newPassword: $newPassword) {
65
+ success
66
+ message
67
+ }
68
+ }
69
+
70
+ mutation CustomerVerifyEmail($token: String!) {
71
+ customerVerifyEmail(token: $token) {
72
+ success
73
+ alreadyVerified
74
+ }
75
+ }
76
+
77
+ mutation CustomerResendVerificationEmail {
78
+ customerResendVerificationEmail {
79
+ success
80
+ message
81
+ }
82
+ }
83
+
84
+ mutation CustomerLogout {
85
+ customerLogout {
86
+ success
87
+ message
88
+ }
89
+ }
90
+
91
+ query AuthConfig($tenantId: ID) {
92
+ authConfig(tenantId: $tenantId) {
93
+ enabledMethods
94
+ passwordPolicy {
95
+ minLength
96
+ requireUppercase
97
+ requireLowercase
98
+ requireNumbers
99
+ requireSpecialChars
100
+ }
101
+ registrationEnabled
102
+ }
103
+ }
104
+
105
+ query CurrentUser {
106
+ currentUser {
107
+ id
108
+ email
109
+ status
110
+ type
111
+ }
112
+ }
113
+ `;
114
+ }
115
+ function authProvidersDocument() {
116
+ return `# Auth provider operations
117
+ ${HEADER}
118
+
119
+ query AuthProviders {
120
+ authProviders {
121
+ id
122
+ key
123
+ name
124
+ type
125
+ isDefault
126
+ }
127
+ }
128
+
129
+ query DefaultAuthProvider {
130
+ defaultAuthProvider {
131
+ id
132
+ key
133
+ name
134
+ type
135
+ isDefault
136
+ }
137
+ }
138
+
139
+ mutation CustomerLoginWithProvider($input: ProviderLoginInput!) {
140
+ customerLoginWithProvider(input: $input) {
141
+ redirectUrl
142
+ message
143
+ requiresOTP
144
+ }
145
+ }
146
+
147
+ mutation CustomerProviderCallback($input: ProviderCallbackInput!) {
148
+ customerProviderCallback(input: $input) {
149
+ token
150
+ refreshToken
151
+ customer { id email status }
152
+ isNewCustomer
153
+ }
154
+ }
155
+
156
+ mutation CustomerProviderVerifyOTP($input: ProviderOTPVerifyInput!) {
157
+ customerProviderVerifyOTP(input: $input) {
158
+ token
159
+ refreshToken
160
+ customer { id email status }
161
+ isNewCustomer
162
+ }
163
+ }
164
+ `;
165
+ }
166
+ function filesDocument() {
167
+ return `# File management operations
168
+ ${HEADER}
169
+
170
+ query GetFile($id: ID!) {
171
+ file(id: $id) {
172
+ id
173
+ filename
174
+ mimeType
175
+ size
176
+ folder
177
+ fileUrl
178
+ storageKey
179
+ status
180
+ tags
181
+ metadata
182
+ altText
183
+ caption
184
+ description
185
+ createdAt
186
+ updatedAt
187
+ }
188
+ }
189
+
190
+ mutation CreateFileUpload(
191
+ $filename: String!
192
+ $mimeType: String!
193
+ $size: Int!
194
+ $folder: String
195
+ $metadata: JSON
196
+ ) {
197
+ createFileUpload(
198
+ filename: $filename
199
+ mimeType: $mimeType
200
+ size: $size
201
+ folder: $folder
202
+ metadata: $metadata
203
+ ) {
204
+ uploadId
205
+ uploadUrl
206
+ fileId
207
+ expiresAt
208
+ }
209
+ }
210
+
211
+ mutation ConfirmFileUpload($uploadId: ID!) {
212
+ confirmFileUpload(uploadId: $uploadId) {
213
+ id
214
+ filename
215
+ mimeType
216
+ size
217
+ fileUrl
218
+ status
219
+ createdAt
220
+ }
221
+ }
222
+ `;
223
+ }
224
+ function syncDocument() {
225
+ return `# Sync engine operations (Layer 1: delta sync protocol)
226
+ ${HEADER}
227
+
228
+ query SyncPull($modelKey: String!, $since: String!, $limit: Int) {
229
+ syncPull(modelKey: $modelKey, since: $since, limit: $limit) {
230
+ items {
231
+ id
232
+ modelKey
233
+ naturalKey
234
+ data
235
+ metadata
236
+ syncVersion
237
+ updatedAt
238
+ deleted
239
+ }
240
+ cursor
241
+ hasMore
242
+ }
243
+ }
244
+
245
+ mutation SyncPush($items: [SyncPushItemInput!]!) {
246
+ syncPush(items: $items) {
247
+ items {
248
+ clientId
249
+ serverId
250
+ syncVersion
251
+ status
252
+ serverData
253
+ serverSyncVersion
254
+ error
255
+ }
256
+ }
257
+ }
258
+
259
+ subscription RecordChanged($modelKey: String!) {
260
+ recordChanged(modelKey: $modelKey) {
261
+ type
262
+ recordId
263
+ modelKey
264
+ naturalKey
265
+ syncVersion
266
+ data
267
+ updatedBy
268
+ timestamp
269
+ }
270
+ }
271
+ `;
272
+ }
273
+ function notificationsDocument() {
274
+ return `# Customer notification operations
275
+ ${HEADER}
276
+
277
+ query CustomerNotifications(
278
+ $unreadOnly: Boolean
279
+ $category: String
280
+ $limit: Int
281
+ $offset: Int
282
+ ) {
283
+ customerNotifications(
284
+ unreadOnly: $unreadOnly
285
+ category: $category
286
+ limit: $limit
287
+ offset: $offset
288
+ ) {
289
+ items {
290
+ id
291
+ type
292
+ title
293
+ body
294
+ category
295
+ isRead
296
+ readAt
297
+ actionUrl
298
+ metadata
299
+ createdAt
300
+ }
301
+ total
302
+ unreadCount
303
+ hasMore
304
+ }
305
+ }
306
+
307
+ query CustomerUnreadCount($category: String) {
308
+ customerUnreadCount(category: $category)
309
+ }
310
+
311
+ query NotificationPreferences {
312
+ notificationPreferences {
313
+ category
314
+ channel
315
+ enabled
316
+ updatedAt
317
+ }
318
+ }
319
+
320
+ mutation SendNotification($input: SendNotificationInput!) {
321
+ sendNotification(input: $input) {
322
+ id
323
+ type
324
+ title
325
+ body
326
+ category
327
+ createdAt
328
+ }
329
+ }
330
+
331
+ mutation SendBulkNotifications($input: SendBulkNotificationsInput!) {
332
+ sendBulkNotifications(input: $input) {
333
+ sent
334
+ failed
335
+ jobId
336
+ }
337
+ }
338
+
339
+ mutation MarkCustomerNotificationRead($id: ID!) {
340
+ markCustomerNotificationRead(id: $id) {
341
+ id
342
+ isRead
343
+ readAt
344
+ }
345
+ }
346
+
347
+ mutation MarkAllCustomerNotificationsRead($category: String) {
348
+ markAllCustomerNotificationsRead(category: $category)
349
+ }
350
+
351
+ mutation RegisterDeviceToken($input: RegisterDeviceTokenInput!) {
352
+ registerDeviceToken(input: $input) {
353
+ id
354
+ token
355
+ platform
356
+ createdAt
357
+ }
358
+ }
359
+
360
+ mutation UnregisterDeviceToken($token: String!) {
361
+ unregisterDeviceToken(token: $token)
362
+ }
363
+
364
+ mutation UpdateNotificationPreference($input: UpdateNotificationPreferenceInput!) {
365
+ updateNotificationPreference(input: $input) {
366
+ category
367
+ channel
368
+ enabled
369
+ updatedAt
370
+ }
371
+ }
372
+ `;
373
+ }
374
+ function operationsDocument() {
375
+ return `# Operation execution operations
376
+ ${HEADER}
377
+
378
+ query GetOperationExecution($id: ID!) {
379
+ operationExecution(id: $id) {
380
+ id
381
+ operationKey
382
+ status
383
+ result
384
+ error {
385
+ code
386
+ message
387
+ }
388
+ executionId
389
+ durationMs
390
+ startedAt
391
+ completedAt
392
+ createdAt
393
+ }
394
+ }
395
+
396
+ query ListOperationExecutions(
397
+ $operationKey: String
398
+ $status: OperationExecutionStatus
399
+ $limit: Int
400
+ $offset: Int
401
+ ) {
402
+ operationExecutions(
403
+ operationKey: $operationKey
404
+ status: $status
405
+ limit: $limit
406
+ offset: $offset
407
+ ) {
408
+ items {
409
+ id
410
+ operationKey
411
+ status
412
+ durationMs
413
+ startedAt
414
+ completedAt
415
+ createdAt
416
+ }
417
+ total
418
+ }
419
+ }
420
+
421
+ mutation ExecuteOperation($input: ExecuteOperationInput!) {
422
+ executeOperation(input: $input) {
423
+ success
424
+ result
425
+ error {
426
+ code
427
+ message
428
+ }
429
+ executionId
430
+ durationMs
431
+ }
432
+ }
433
+
434
+ mutation CancelOperationExecution($id: ID!) {
435
+ cancelOperationExecution(id: $id) {
436
+ id
437
+ status
438
+ }
439
+ }
440
+ `;
441
+ }
442
+ function schedulesDocument() {
443
+ return `# Schedule management operations
444
+ ${HEADER}
445
+
446
+ query GetSchedule($key: String!) {
447
+ schedule(key: $key) {
448
+ id
449
+ key
450
+ name
451
+ description
452
+ cron
453
+ cronDescription
454
+ timezone
455
+ targetType
456
+ targetConfig
457
+ isActive
458
+ pausedAt
459
+ lastRunAt
460
+ lastRunStatus
461
+ lastRunError
462
+ nextRunAt
463
+ runCount
464
+ failureCount
465
+ consecutiveFailures
466
+ createdAt
467
+ updatedAt
468
+ }
469
+ }
470
+
471
+ query ListSchedules(
472
+ $targetType: ScheduleTargetType
473
+ $isActive: Boolean
474
+ $limit: Int
475
+ $offset: Int
476
+ ) {
477
+ schedules(
478
+ targetType: $targetType
479
+ isActive: $isActive
480
+ limit: $limit
481
+ offset: $offset
482
+ ) {
483
+ items {
484
+ id
485
+ key
486
+ name
487
+ cron
488
+ cronDescription
489
+ timezone
490
+ isActive
491
+ lastRunAt
492
+ lastRunStatus
493
+ nextRunAt
494
+ runCount
495
+ failureCount
496
+ createdAt
497
+ }
498
+ total
499
+ }
500
+ }
501
+
502
+ mutation CreateSchedule($input: CreateScheduleInput!) {
503
+ createSchedule(input: $input) {
504
+ id
505
+ key
506
+ name
507
+ cron
508
+ isActive
509
+ createdAt
510
+ }
511
+ }
512
+
513
+ mutation UpdateSchedule($key: String!, $input: UpdateScheduleInput!) {
514
+ updateSchedule(key: $key, input: $input) {
515
+ id
516
+ key
517
+ name
518
+ cron
519
+ isActive
520
+ updatedAt
521
+ }
522
+ }
523
+
524
+ mutation DeleteSchedule($key: String!) {
525
+ deleteSchedule(key: $key)
526
+ }
527
+
528
+ mutation PauseSchedule($key: String!) {
529
+ pauseSchedule(key: $key) {
530
+ id
531
+ key
532
+ isActive
533
+ pausedAt
534
+ }
535
+ }
536
+
537
+ mutation ResumeSchedule($key: String!) {
538
+ resumeSchedule(key: $key) {
539
+ id
540
+ key
541
+ isActive
542
+ }
543
+ }
544
+
545
+ mutation TriggerSchedule($key: String!) {
546
+ triggerSchedule(key: $key) {
547
+ success
548
+ jobId
549
+ error
550
+ }
551
+ }
552
+ `;
553
+ }
554
+ function sharingDocument() {
555
+ return `# Sharing operations
556
+ ${HEADER}
557
+
558
+ fragment ShareFields on Share {
559
+ id
560
+ resourceType
561
+ resourceId
562
+ permission
563
+ status
564
+ sharedWithCustomerId
565
+ acceptedAt
566
+ declinedAt
567
+ expiresAt
568
+ revokedAt
569
+ createdAt
570
+ }
571
+
572
+ query GetShares($resourceType: ShareResourceType!, $resourceId: ID!, $status: ShareStatus) {
573
+ shares(resourceType: $resourceType, resourceId: $resourceId, status: $status) {
574
+ ...ShareFields
575
+ }
576
+ }
577
+
578
+ query SharedWithMe(
579
+ $resourceType: ShareResourceType
580
+ $modelKey: String
581
+ $status: ShareStatus
582
+ $limit: Int
583
+ $offset: Int
584
+ ) {
585
+ sharedWithMe(
586
+ resourceType: $resourceType
587
+ modelKey: $modelKey
588
+ status: $status
589
+ limit: $limit
590
+ offset: $offset
591
+ ) {
592
+ ...ShareFields
593
+ }
594
+ }
595
+
596
+ mutation ShareRecord(
597
+ $recordId: ID!
598
+ $sharedWithCustomerId: ID!
599
+ $permission: SharePermission!
600
+ $expiresAt: DateTime
601
+ ) {
602
+ shareRecord(
603
+ recordId: $recordId
604
+ sharedWithCustomerId: $sharedWithCustomerId
605
+ permission: $permission
606
+ expiresAt: $expiresAt
607
+ ) {
608
+ ...ShareFields
609
+ }
610
+ }
611
+
612
+ mutation ShareFile(
613
+ $fileId: ID!
614
+ $sharedWithCustomerId: ID!
615
+ $permission: SharePermission!
616
+ $expiresAt: DateTime
617
+ ) {
618
+ shareFile(
619
+ fileId: $fileId
620
+ sharedWithCustomerId: $sharedWithCustomerId
621
+ permission: $permission
622
+ expiresAt: $expiresAt
623
+ ) {
624
+ ...ShareFields
625
+ }
626
+ }
627
+
628
+ mutation AcceptShare($shareId: ID!) {
629
+ acceptShare(shareId: $shareId) {
630
+ ...ShareFields
631
+ }
632
+ }
633
+
634
+ mutation DeclineShare($shareId: ID!) {
635
+ declineShare(shareId: $shareId) {
636
+ ...ShareFields
637
+ }
638
+ }
639
+
640
+ mutation RevokeShare($shareId: ID!) {
641
+ revokeShare(shareId: $shareId) {
642
+ ...ShareFields
643
+ }
644
+ }
645
+
646
+ mutation UpdateSharePermission($shareId: ID!, $permission: SharePermission!) {
647
+ updateSharePermission(shareId: $shareId, permission: $permission) {
648
+ ...ShareFields
649
+ }
650
+ }
651
+ `;
652
+ }
653
+ function searchDocument() {
654
+ return `# Semantic search & embedding operations
655
+ ${HEADER}
656
+
657
+ query SemanticSearch($input: SemanticSearchInput!) {
658
+ semanticSearch(input: $input) {
659
+ record {
660
+ id
661
+ modelKey
662
+ naturalKey
663
+ data
664
+ }
665
+ score
666
+ highlights
667
+ }
668
+ }
669
+
670
+ query EmbeddingStatus($recordIds: [ID!]!, $source: EmbeddingSource!) {
671
+ embeddingStatus(recordIds: $recordIds, source: $source) {
672
+ recordId
673
+ exists
674
+ dimensions
675
+ updatedAt
676
+ }
677
+ }
678
+
679
+ query IsAIEnabled {
680
+ isAIEnabled
681
+ }
682
+
683
+ mutation GenerateEmbedding($recordId: ID!, $modelKey: String!, $source: EmbeddingSource!) {
684
+ generateEmbedding(recordId: $recordId, modelKey: $modelKey, source: $source) {
685
+ success
686
+ dimensions
687
+ }
688
+ }
689
+ `;
690
+ }
691
+ function analyticsDocument() {
692
+ return `# Analytics & conversion tracking operations
693
+ ${HEADER}
694
+
695
+ mutation RecordConversion($input: RecordConversionInput!) {
696
+ recordConversion(input: $input) {
697
+ success
698
+ }
699
+ }
700
+ `;
701
+ }
702
+ /**
703
+ * Generate static domain .graphql files based on enabled domains.
704
+ */
705
+ export function generateStaticDocuments(domains) {
706
+ const files = [];
707
+ if (domains.auth)
708
+ files.push({ filename: 'auth.graphql', content: authDocument() });
709
+ if (domains.authProviders)
710
+ files.push({ filename: 'auth-providers.graphql', content: authProvidersDocument() });
711
+ if (domains.files)
712
+ files.push({ filename: 'files.graphql', content: filesDocument() });
713
+ if (domains.sync)
714
+ files.push({ filename: 'sync.graphql', content: syncDocument() });
715
+ if (domains.notifications)
716
+ files.push({ filename: 'notifications.graphql', content: notificationsDocument() });
717
+ if (domains.operations)
718
+ files.push({ filename: 'operations.graphql', content: operationsDocument() });
719
+ if (domains.schedules)
720
+ files.push({ filename: 'schedules.graphql', content: schedulesDocument() });
721
+ if (domains.sharing)
722
+ files.push({ filename: 'sharing.graphql', content: sharingDocument() });
723
+ if (domains.search)
724
+ files.push({ filename: 'search.graphql', content: searchDocument() });
725
+ if (domains.analytics)
726
+ files.push({ filename: 'analytics.graphql', content: analyticsDocument() });
727
+ return files;
728
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Generates the shared _common.ts file for typed operations.
3
+ * Contains generic wrapper types used by all per-model operation modules.
4
+ */
5
+ export declare function generateTypedOperationsCommon(): string;
6
+ //# sourceMappingURL=typed-operations-common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-operations-common.d.ts","sourceRoot":"","sources":["../../../src/codegen/generators/typed-operations-common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,6BAA6B,IAAI,MAAM,CAqEtD"}