@eide/foir-cli 0.1.35 → 0.1.37

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 (228) hide show
  1. package/dist/cli.js +7467 -42
  2. package/dist/config/types.d.ts +7 -6
  3. package/dist/config/types.js +6 -14
  4. package/dist/generated-CPsQ9jfu.d.ts +195 -0
  5. package/dist/lib/extension-helpers.d.ts +10 -7
  6. package/dist/lib/extension-helpers.js +15 -85
  7. package/dist/lib/hook-helpers.d.ts +9 -6
  8. package/dist/lib/hook-helpers.js +12 -105
  9. package/dist/lib/seed-helpers.d.ts +10 -8
  10. package/dist/lib/seed-helpers.js +18 -124
  11. package/dist/schema.graphql +6062 -0
  12. package/package.json +9 -8
  13. package/dist/auth/credentials.d.ts +0 -31
  14. package/dist/auth/credentials.d.ts.map +0 -1
  15. package/dist/auth/credentials.js +0 -139
  16. package/dist/cli.d.ts +0 -3
  17. package/dist/cli.d.ts.map +0 -1
  18. package/dist/codegen/fetch-customer-profile-schema.d.ts +0 -12
  19. package/dist/codegen/fetch-customer-profile-schema.d.ts.map +0 -1
  20. package/dist/codegen/fetch-customer-profile-schema.js +0 -21
  21. package/dist/codegen/fetch-models.d.ts +0 -58
  22. package/dist/codegen/fetch-models.d.ts.map +0 -1
  23. package/dist/codegen/fetch-models.js +0 -96
  24. package/dist/codegen/field-mapping.d.ts +0 -34
  25. package/dist/codegen/field-mapping.d.ts.map +0 -1
  26. package/dist/codegen/field-mapping.js +0 -250
  27. package/dist/codegen/generators/config.d.ts +0 -5
  28. package/dist/codegen/generators/config.d.ts.map +0 -1
  29. package/dist/codegen/generators/config.js +0 -82
  30. package/dist/codegen/generators/customer-profile-documents.d.ts +0 -5
  31. package/dist/codegen/generators/customer-profile-documents.d.ts.map +0 -1
  32. package/dist/codegen/generators/customer-profile-documents.js +0 -42
  33. package/dist/codegen/generators/customer-profile-hooks.d.ts +0 -5
  34. package/dist/codegen/generators/customer-profile-hooks.d.ts.map +0 -1
  35. package/dist/codegen/generators/customer-profile-hooks.js +0 -78
  36. package/dist/codegen/generators/customer-profile-loaders.d.ts +0 -5
  37. package/dist/codegen/generators/customer-profile-loaders.d.ts.map +0 -1
  38. package/dist/codegen/generators/customer-profile-loaders.js +0 -67
  39. package/dist/codegen/generators/customer-profile-operations.d.ts +0 -5
  40. package/dist/codegen/generators/customer-profile-operations.d.ts.map +0 -1
  41. package/dist/codegen/generators/customer-profile-operations.js +0 -126
  42. package/dist/codegen/generators/customer-profile-types.d.ts +0 -6
  43. package/dist/codegen/generators/customer-profile-types.d.ts.map +0 -1
  44. package/dist/codegen/generators/customer-profile-types.js +0 -45
  45. package/dist/codegen/generators/documents.d.ts +0 -12
  46. package/dist/codegen/generators/documents.d.ts.map +0 -1
  47. package/dist/codegen/generators/documents.js +0 -178
  48. package/dist/codegen/generators/field-types.d.ts +0 -5
  49. package/dist/codegen/generators/field-types.d.ts.map +0 -1
  50. package/dist/codegen/generators/field-types.js +0 -346
  51. package/dist/codegen/generators/model-index.d.ts +0 -6
  52. package/dist/codegen/generators/model-index.d.ts.map +0 -1
  53. package/dist/codegen/generators/model-index.js +0 -26
  54. package/dist/codegen/generators/model-types.d.ts +0 -12
  55. package/dist/codegen/generators/model-types.d.ts.map +0 -1
  56. package/dist/codegen/generators/model-types.js +0 -177
  57. package/dist/codegen/generators/public-schema-content.d.ts +0 -14
  58. package/dist/codegen/generators/public-schema-content.d.ts.map +0 -1
  59. package/dist/codegen/generators/public-schema-content.js +0 -22
  60. package/dist/codegen/generators/react-hooks-index.d.ts +0 -6
  61. package/dist/codegen/generators/react-hooks-index.d.ts.map +0 -1
  62. package/dist/codegen/generators/react-hooks-index.js +0 -20
  63. package/dist/codegen/generators/react-hooks.d.ts +0 -7
  64. package/dist/codegen/generators/react-hooks.d.ts.map +0 -1
  65. package/dist/codegen/generators/react-hooks.js +0 -139
  66. package/dist/codegen/generators/remix-loaders-index.d.ts +0 -6
  67. package/dist/codegen/generators/remix-loaders-index.d.ts.map +0 -1
  68. package/dist/codegen/generators/remix-loaders-index.js +0 -20
  69. package/dist/codegen/generators/remix-loaders.d.ts +0 -7
  70. package/dist/codegen/generators/remix-loaders.d.ts.map +0 -1
  71. package/dist/codegen/generators/remix-loaders.js +0 -107
  72. package/dist/codegen/generators/static-documents.d.ts +0 -14
  73. package/dist/codegen/generators/static-documents.d.ts.map +0 -1
  74. package/dist/codegen/generators/static-documents.js +0 -771
  75. package/dist/codegen/generators/swift-customer-profile.d.ts +0 -9
  76. package/dist/codegen/generators/swift-customer-profile.d.ts.map +0 -1
  77. package/dist/codegen/generators/swift-customer-profile.js +0 -152
  78. package/dist/codegen/generators/swift-field-types.d.ts +0 -5
  79. package/dist/codegen/generators/swift-field-types.d.ts.map +0 -1
  80. package/dist/codegen/generators/swift-field-types.js +0 -151
  81. package/dist/codegen/generators/swift-model-keys.d.ts +0 -6
  82. package/dist/codegen/generators/swift-model-keys.d.ts.map +0 -1
  83. package/dist/codegen/generators/swift-model-keys.js +0 -25
  84. package/dist/codegen/generators/swift-types.d.ts +0 -13
  85. package/dist/codegen/generators/swift-types.d.ts.map +0 -1
  86. package/dist/codegen/generators/swift-types.js +0 -188
  87. package/dist/codegen/generators/typed-operations-common.d.ts +0 -6
  88. package/dist/codegen/generators/typed-operations-common.d.ts.map +0 -1
  89. package/dist/codegen/generators/typed-operations-common.js +0 -84
  90. package/dist/codegen/generators/typed-operations-index.d.ts +0 -6
  91. package/dist/codegen/generators/typed-operations-index.d.ts.map +0 -1
  92. package/dist/codegen/generators/typed-operations-index.js +0 -22
  93. package/dist/codegen/generators/typed-operations.d.ts +0 -11
  94. package/dist/codegen/generators/typed-operations.d.ts.map +0 -1
  95. package/dist/codegen/generators/typed-operations.js +0 -263
  96. package/dist/codegen/swift-field-mapping.d.ts +0 -30
  97. package/dist/codegen/swift-field-mapping.d.ts.map +0 -1
  98. package/dist/codegen/swift-field-mapping.js +0 -150
  99. package/dist/codegen/write-files.d.ts +0 -15
  100. package/dist/codegen/write-files.d.ts.map +0 -1
  101. package/dist/codegen/write-files.js +0 -36
  102. package/dist/commands/api-keys.d.ts +0 -4
  103. package/dist/commands/api-keys.d.ts.map +0 -1
  104. package/dist/commands/api-keys.js +0 -129
  105. package/dist/commands/auth-config.d.ts +0 -4
  106. package/dist/commands/auth-config.d.ts.map +0 -1
  107. package/dist/commands/auth-config.js +0 -38
  108. package/dist/commands/auth-providers.d.ts +0 -4
  109. package/dist/commands/auth-providers.d.ts.map +0 -1
  110. package/dist/commands/auth-providers.js +0 -207
  111. package/dist/commands/context.d.ts +0 -4
  112. package/dist/commands/context.d.ts.map +0 -1
  113. package/dist/commands/context.js +0 -91
  114. package/dist/commands/create-extension.d.ts +0 -4
  115. package/dist/commands/create-extension.d.ts.map +0 -1
  116. package/dist/commands/create-extension.js +0 -60
  117. package/dist/commands/customer-profiles.d.ts +0 -4
  118. package/dist/commands/customer-profiles.d.ts.map +0 -1
  119. package/dist/commands/customer-profiles.js +0 -99
  120. package/dist/commands/customers.d.ts +0 -4
  121. package/dist/commands/customers.d.ts.map +0 -1
  122. package/dist/commands/customers.js +0 -126
  123. package/dist/commands/embeddings.d.ts +0 -4
  124. package/dist/commands/embeddings.d.ts.map +0 -1
  125. package/dist/commands/embeddings.js +0 -145
  126. package/dist/commands/experiments.d.ts +0 -4
  127. package/dist/commands/experiments.d.ts.map +0 -1
  128. package/dist/commands/experiments.js +0 -196
  129. package/dist/commands/extensions.d.ts +0 -4
  130. package/dist/commands/extensions.d.ts.map +0 -1
  131. package/dist/commands/extensions.js +0 -210
  132. package/dist/commands/files.d.ts +0 -4
  133. package/dist/commands/files.d.ts.map +0 -1
  134. package/dist/commands/files.js +0 -143
  135. package/dist/commands/hooks.d.ts +0 -4
  136. package/dist/commands/hooks.d.ts.map +0 -1
  137. package/dist/commands/hooks.js +0 -228
  138. package/dist/commands/locales.d.ts +0 -4
  139. package/dist/commands/locales.d.ts.map +0 -1
  140. package/dist/commands/locales.js +0 -140
  141. package/dist/commands/login.d.ts +0 -4
  142. package/dist/commands/login.d.ts.map +0 -1
  143. package/dist/commands/login.js +0 -124
  144. package/dist/commands/logout.d.ts +0 -4
  145. package/dist/commands/logout.d.ts.map +0 -1
  146. package/dist/commands/logout.js +0 -16
  147. package/dist/commands/media.d.ts +0 -4
  148. package/dist/commands/media.d.ts.map +0 -1
  149. package/dist/commands/media.js +0 -44
  150. package/dist/commands/models.d.ts +0 -4
  151. package/dist/commands/models.d.ts.map +0 -1
  152. package/dist/commands/models.js +0 -153
  153. package/dist/commands/notes.d.ts +0 -4
  154. package/dist/commands/notes.d.ts.map +0 -1
  155. package/dist/commands/notes.js +0 -132
  156. package/dist/commands/notifications.d.ts +0 -4
  157. package/dist/commands/notifications.d.ts.map +0 -1
  158. package/dist/commands/notifications.js +0 -73
  159. package/dist/commands/operations.d.ts +0 -4
  160. package/dist/commands/operations.d.ts.map +0 -1
  161. package/dist/commands/operations.js +0 -341
  162. package/dist/commands/playground.d.ts +0 -4
  163. package/dist/commands/playground.d.ts.map +0 -1
  164. package/dist/commands/playground.js +0 -270
  165. package/dist/commands/pull.d.ts +0 -4
  166. package/dist/commands/pull.d.ts.map +0 -1
  167. package/dist/commands/pull.js +0 -300
  168. package/dist/commands/records.d.ts +0 -4
  169. package/dist/commands/records.d.ts.map +0 -1
  170. package/dist/commands/records.js +0 -314
  171. package/dist/commands/register-commands.d.ts +0 -7
  172. package/dist/commands/register-commands.d.ts.map +0 -1
  173. package/dist/commands/register-commands.js +0 -259
  174. package/dist/commands/schedules.d.ts +0 -4
  175. package/dist/commands/schedules.d.ts.map +0 -1
  176. package/dist/commands/schedules.js +0 -155
  177. package/dist/commands/search.d.ts +0 -4
  178. package/dist/commands/search.d.ts.map +0 -1
  179. package/dist/commands/search.js +0 -60
  180. package/dist/commands/segments.d.ts +0 -4
  181. package/dist/commands/segments.d.ts.map +0 -1
  182. package/dist/commands/segments.js +0 -155
  183. package/dist/commands/select-project.d.ts +0 -4
  184. package/dist/commands/select-project.d.ts.map +0 -1
  185. package/dist/commands/select-project.js +0 -144
  186. package/dist/commands/settings.d.ts +0 -4
  187. package/dist/commands/settings.d.ts.map +0 -1
  188. package/dist/commands/settings.js +0 -115
  189. package/dist/commands/variant-catalog.d.ts +0 -4
  190. package/dist/commands/variant-catalog.d.ts.map +0 -1
  191. package/dist/commands/variant-catalog.js +0 -118
  192. package/dist/commands/whoami.d.ts +0 -4
  193. package/dist/commands/whoami.d.ts.map +0 -1
  194. package/dist/commands/whoami.js +0 -51
  195. package/dist/config/pull-config.d.ts +0 -33
  196. package/dist/config/pull-config.d.ts.map +0 -1
  197. package/dist/config/pull-config.js +0 -119
  198. package/dist/config/types.d.ts.map +0 -1
  199. package/dist/graphql/generated.d.ts +0 -6074
  200. package/dist/graphql/generated.d.ts.map +0 -1
  201. package/dist/graphql/generated.js +0 -355
  202. package/dist/lib/client.d.ts +0 -18
  203. package/dist/lib/client.d.ts.map +0 -1
  204. package/dist/lib/client.js +0 -64
  205. package/dist/lib/config-loader.d.ts +0 -28
  206. package/dist/lib/config-loader.d.ts.map +0 -1
  207. package/dist/lib/config-loader.js +0 -49
  208. package/dist/lib/config.d.ts +0 -12
  209. package/dist/lib/config.d.ts.map +0 -1
  210. package/dist/lib/config.js +0 -8
  211. package/dist/lib/errors.d.ts +0 -6
  212. package/dist/lib/errors.d.ts.map +0 -1
  213. package/dist/lib/errors.js +0 -76
  214. package/dist/lib/extension-helpers.d.ts.map +0 -1
  215. package/dist/lib/hook-helpers.d.ts.map +0 -1
  216. package/dist/lib/input.d.ts +0 -38
  217. package/dist/lib/input.d.ts.map +0 -1
  218. package/dist/lib/input.js +0 -108
  219. package/dist/lib/output.d.ts +0 -31
  220. package/dist/lib/output.d.ts.map +0 -1
  221. package/dist/lib/output.js +0 -107
  222. package/dist/lib/seed-helpers.d.ts.map +0 -1
  223. package/dist/scaffold/package-manager.d.ts +0 -12
  224. package/dist/scaffold/package-manager.d.ts.map +0 -1
  225. package/dist/scaffold/package-manager.js +0 -51
  226. package/dist/scaffold/scaffold.d.ts +0 -4
  227. package/dist/scaffold/scaffold.d.ts.map +0 -1
  228. package/dist/scaffold/scaffold.js +0 -462
@@ -1,355 +0,0 @@
1
- export const GetCustomerProfileSchemaDocument = {
2
- kind: 'Document',
3
- definitions: [
4
- {
5
- kind: 'OperationDefinition',
6
- operation: 'query',
7
- name: { kind: 'Name', value: 'GetCustomerProfileSchema' },
8
- selectionSet: {
9
- kind: 'SelectionSet',
10
- selections: [
11
- {
12
- kind: 'Field',
13
- name: { kind: 'Name', value: 'customerProfileSchema' },
14
- selectionSet: {
15
- kind: 'SelectionSet',
16
- selections: [
17
- { kind: 'Field', name: { kind: 'Name', value: 'id' } },
18
- {
19
- kind: 'Field',
20
- name: { kind: 'Name', value: 'fields' },
21
- selectionSet: {
22
- kind: 'SelectionSet',
23
- selections: [
24
- { kind: 'Field', name: { kind: 'Name', value: 'key' } },
25
- { kind: 'Field', name: { kind: 'Name', value: 'type' } },
26
- { kind: 'Field', name: { kind: 'Name', value: 'label' } },
27
- {
28
- kind: 'Field',
29
- name: { kind: 'Name', value: 'required' },
30
- },
31
- {
32
- kind: 'Field',
33
- name: { kind: 'Name', value: 'helpText' },
34
- },
35
- {
36
- kind: 'Field',
37
- name: { kind: 'Name', value: 'defaultValue' },
38
- },
39
- {
40
- kind: 'Field',
41
- name: { kind: 'Name', value: 'config' },
42
- },
43
- {
44
- kind: 'Field',
45
- name: { kind: 'Name', value: 'validation' },
46
- selectionSet: {
47
- kind: 'SelectionSet',
48
- selections: [
49
- {
50
- kind: 'Field',
51
- name: { kind: 'Name', value: 'rule' },
52
- },
53
- {
54
- kind: 'Field',
55
- name: { kind: 'Name', value: 'value' },
56
- },
57
- {
58
- kind: 'Field',
59
- name: { kind: 'Name', value: 'message' },
60
- },
61
- ],
62
- },
63
- },
64
- ],
65
- },
66
- },
67
- {
68
- kind: 'Field',
69
- name: { kind: 'Name', value: 'publicFields' },
70
- },
71
- { kind: 'Field', name: { kind: 'Name', value: 'version' } },
72
- { kind: 'Field', name: { kind: 'Name', value: 'createdAt' } },
73
- { kind: 'Field', name: { kind: 'Name', value: 'updatedAt' } },
74
- ],
75
- },
76
- },
77
- ],
78
- },
79
- },
80
- ],
81
- };
82
- export const ModelsForCodegenDocument = {
83
- kind: 'Document',
84
- definitions: [
85
- {
86
- kind: 'OperationDefinition',
87
- operation: 'query',
88
- name: { kind: 'Name', value: 'ModelsForCodegen' },
89
- variableDefinitions: [
90
- {
91
- kind: 'VariableDefinition',
92
- variable: {
93
- kind: 'Variable',
94
- name: { kind: 'Name', value: 'search' },
95
- },
96
- type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } },
97
- },
98
- {
99
- kind: 'VariableDefinition',
100
- variable: {
101
- kind: 'Variable',
102
- name: { kind: 'Name', value: 'limit' },
103
- },
104
- type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
105
- },
106
- {
107
- kind: 'VariableDefinition',
108
- variable: {
109
- kind: 'Variable',
110
- name: { kind: 'Name', value: 'offset' },
111
- },
112
- type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
113
- },
114
- ],
115
- selectionSet: {
116
- kind: 'SelectionSet',
117
- selections: [
118
- {
119
- kind: 'Field',
120
- name: { kind: 'Name', value: 'models' },
121
- arguments: [
122
- {
123
- kind: 'Argument',
124
- name: { kind: 'Name', value: 'search' },
125
- value: {
126
- kind: 'Variable',
127
- name: { kind: 'Name', value: 'search' },
128
- },
129
- },
130
- {
131
- kind: 'Argument',
132
- name: { kind: 'Name', value: 'limit' },
133
- value: {
134
- kind: 'Variable',
135
- name: { kind: 'Name', value: 'limit' },
136
- },
137
- },
138
- {
139
- kind: 'Argument',
140
- name: { kind: 'Name', value: 'offset' },
141
- value: {
142
- kind: 'Variable',
143
- name: { kind: 'Name', value: 'offset' },
144
- },
145
- },
146
- ],
147
- selectionSet: {
148
- kind: 'SelectionSet',
149
- selections: [
150
- {
151
- kind: 'Field',
152
- name: { kind: 'Name', value: 'items' },
153
- selectionSet: {
154
- kind: 'SelectionSet',
155
- selections: [
156
- { kind: 'Field', name: { kind: 'Name', value: 'id' } },
157
- { kind: 'Field', name: { kind: 'Name', value: 'key' } },
158
- { kind: 'Field', name: { kind: 'Name', value: 'name' } },
159
- {
160
- kind: 'Field',
161
- name: { kind: 'Name', value: 'pluralName' },
162
- },
163
- {
164
- kind: 'Field',
165
- name: { kind: 'Name', value: 'description' },
166
- },
167
- {
168
- kind: 'Field',
169
- name: { kind: 'Name', value: 'category' },
170
- },
171
- {
172
- kind: 'Field',
173
- name: { kind: 'Name', value: 'fields' },
174
- },
175
- {
176
- kind: 'Field',
177
- name: { kind: 'Name', value: 'config' },
178
- },
179
- { kind: 'Field', name: { kind: 'Name', value: 'hooks' } },
180
- {
181
- kind: 'Field',
182
- name: { kind: 'Name', value: 'createdAt' },
183
- },
184
- {
185
- kind: 'Field',
186
- name: { kind: 'Name', value: 'updatedAt' },
187
- },
188
- ],
189
- },
190
- },
191
- { kind: 'Field', name: { kind: 'Name', value: 'total' } },
192
- ],
193
- },
194
- },
195
- ],
196
- },
197
- },
198
- ],
199
- };
200
- export const GlobalSearchDocument = {
201
- kind: 'Document',
202
- definitions: [
203
- {
204
- kind: 'OperationDefinition',
205
- operation: 'query',
206
- name: { kind: 'Name', value: 'GlobalSearch' },
207
- variableDefinitions: [
208
- {
209
- kind: 'VariableDefinition',
210
- variable: {
211
- kind: 'Variable',
212
- name: { kind: 'Name', value: 'query' },
213
- },
214
- type: {
215
- kind: 'NonNullType',
216
- type: {
217
- kind: 'NamedType',
218
- name: { kind: 'Name', value: 'String' },
219
- },
220
- },
221
- },
222
- {
223
- kind: 'VariableDefinition',
224
- variable: {
225
- kind: 'Variable',
226
- name: { kind: 'Name', value: 'limit' },
227
- },
228
- type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
229
- },
230
- {
231
- kind: 'VariableDefinition',
232
- variable: {
233
- kind: 'Variable',
234
- name: { kind: 'Name', value: 'modelKeys' },
235
- },
236
- type: {
237
- kind: 'ListType',
238
- type: {
239
- kind: 'NonNullType',
240
- type: {
241
- kind: 'NamedType',
242
- name: { kind: 'Name', value: 'String' },
243
- },
244
- },
245
- },
246
- },
247
- {
248
- kind: 'VariableDefinition',
249
- variable: {
250
- kind: 'Variable',
251
- name: { kind: 'Name', value: 'includeMedia' },
252
- },
253
- type: { kind: 'NamedType', name: { kind: 'Name', value: 'Boolean' } },
254
- },
255
- ],
256
- selectionSet: {
257
- kind: 'SelectionSet',
258
- selections: [
259
- {
260
- kind: 'Field',
261
- name: { kind: 'Name', value: 'globalSearch' },
262
- arguments: [
263
- {
264
- kind: 'Argument',
265
- name: { kind: 'Name', value: 'query' },
266
- value: {
267
- kind: 'Variable',
268
- name: { kind: 'Name', value: 'query' },
269
- },
270
- },
271
- {
272
- kind: 'Argument',
273
- name: { kind: 'Name', value: 'limit' },
274
- value: {
275
- kind: 'Variable',
276
- name: { kind: 'Name', value: 'limit' },
277
- },
278
- },
279
- {
280
- kind: 'Argument',
281
- name: { kind: 'Name', value: 'modelKeys' },
282
- value: {
283
- kind: 'Variable',
284
- name: { kind: 'Name', value: 'modelKeys' },
285
- },
286
- },
287
- {
288
- kind: 'Argument',
289
- name: { kind: 'Name', value: 'includeMedia' },
290
- value: {
291
- kind: 'Variable',
292
- name: { kind: 'Name', value: 'includeMedia' },
293
- },
294
- },
295
- ],
296
- selectionSet: {
297
- kind: 'SelectionSet',
298
- selections: [
299
- {
300
- kind: 'Field',
301
- name: { kind: 'Name', value: 'records' },
302
- selectionSet: {
303
- kind: 'SelectionSet',
304
- selections: [
305
- { kind: 'Field', name: { kind: 'Name', value: 'id' } },
306
- {
307
- kind: 'Field',
308
- name: { kind: 'Name', value: 'modelKey' },
309
- },
310
- { kind: 'Field', name: { kind: 'Name', value: 'title' } },
311
- {
312
- kind: 'Field',
313
- name: { kind: 'Name', value: 'naturalKey' },
314
- },
315
- {
316
- kind: 'Field',
317
- name: { kind: 'Name', value: 'subtitle' },
318
- },
319
- {
320
- kind: 'Field',
321
- name: { kind: 'Name', value: 'updatedAt' },
322
- },
323
- ],
324
- },
325
- },
326
- {
327
- kind: 'Field',
328
- name: { kind: 'Name', value: 'media' },
329
- selectionSet: {
330
- kind: 'SelectionSet',
331
- selections: [
332
- { kind: 'Field', name: { kind: 'Name', value: 'id' } },
333
- {
334
- kind: 'Field',
335
- name: { kind: 'Name', value: 'fileName' },
336
- },
337
- {
338
- kind: 'Field',
339
- name: { kind: 'Name', value: 'altText' },
340
- },
341
- {
342
- kind: 'Field',
343
- name: { kind: 'Name', value: 'fileUrl' },
344
- },
345
- ],
346
- },
347
- },
348
- ],
349
- },
350
- },
351
- ],
352
- },
353
- },
354
- ],
355
- };
@@ -1,18 +0,0 @@
1
- import { GraphQLClient } from 'graphql-request';
2
- import { type GlobalOptions } from './config.js';
3
- /**
4
- * Create an authenticated GraphQL client.
5
- * Auth priority:
6
- * 1. FOIR_API_KEY env var (CI / headless / LLM mode)
7
- * 2. Stored credentials from ~/.foir/credentials.json (interactive)
8
- * Project context is read from .foir/project.json in the current repo.
9
- */
10
- export declare function createClient(options?: GlobalOptions): Promise<GraphQLClient>;
11
- /**
12
- * Get the API URL + auth headers for REST calls (e.g., file upload).
13
- */
14
- export declare function getRestAuth(options?: GlobalOptions): Promise<{
15
- apiUrl: string;
16
- headers: Record<string, string>;
17
- }>;
18
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAiC,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhF;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,CAkCxB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,CA4B9D"}
@@ -1,64 +0,0 @@
1
- import { GraphQLClient } from 'graphql-request';
2
- import { getCredentials, getProjectContext, isTokenExpired, } from '../auth/credentials.js';
3
- import { getApiUrl, getGraphQLEndpoint } from './config.js';
4
- /**
5
- * Create an authenticated GraphQL client.
6
- * Auth priority:
7
- * 1. FOIR_API_KEY env var (CI / headless / LLM mode)
8
- * 2. Stored credentials from ~/.foir/credentials.json (interactive)
9
- * Project context is read from .foir/project.json in the current repo.
10
- */
11
- export async function createClient(options) {
12
- const apiUrl = getApiUrl(options);
13
- const endpoint = getGraphQLEndpoint(apiUrl);
14
- const headers = {
15
- 'Content-Type': 'application/json',
16
- };
17
- // Path 1: API key from environment
18
- const envApiKey = process.env.FOIR_API_KEY;
19
- if (envApiKey) {
20
- headers['x-api-key'] = envApiKey;
21
- return new GraphQLClient(endpoint, { headers });
22
- }
23
- // Path 2: Stored credentials
24
- const credentials = await getCredentials();
25
- if (!credentials) {
26
- throw new Error('Not authenticated. Run `foir login` or set FOIR_API_KEY.');
27
- }
28
- if (isTokenExpired(credentials)) {
29
- throw new Error('Session expired. Run `foir login` to re-authenticate.');
30
- }
31
- headers['Authorization'] = `Bearer ${credentials.accessToken}`;
32
- const project = await getProjectContext();
33
- if (project) {
34
- headers['x-tenant-id'] = project.tenantId;
35
- headers['x-project-id'] = project.id;
36
- }
37
- return new GraphQLClient(endpoint, { headers });
38
- }
39
- /**
40
- * Get the API URL + auth headers for REST calls (e.g., file upload).
41
- */
42
- export async function getRestAuth(options) {
43
- const apiUrl = getApiUrl(options);
44
- const headers = {};
45
- const envApiKey = process.env.FOIR_API_KEY;
46
- if (envApiKey) {
47
- headers['x-api-key'] = envApiKey;
48
- return { apiUrl, headers };
49
- }
50
- const credentials = await getCredentials();
51
- if (!credentials) {
52
- throw new Error('Not authenticated. Run `foir login` or set FOIR_API_KEY.');
53
- }
54
- if (isTokenExpired(credentials)) {
55
- throw new Error('Session expired. Run `foir login` to re-authenticate.');
56
- }
57
- headers['Authorization'] = `Bearer ${credentials.accessToken}`;
58
- const project = await getProjectContext();
59
- if (project) {
60
- headers['x-tenant-id'] = project.tenantId;
61
- headers['x-project-id'] = project.id;
62
- }
63
- return { apiUrl, headers };
64
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * Configuration file loader.
3
- *
4
- * Supports loading TypeScript (.ts), JavaScript (.js, .mjs), and JSON (.json) config files.
5
- * Uses dynamic imports for TypeScript/JavaScript and JSON.parse for JSON files.
6
- */
7
- /**
8
- * Load a configuration file from disk.
9
- *
10
- * Supports:
11
- * - TypeScript (.ts) - via dynamic import
12
- * - JavaScript (.js, .mjs) - via dynamic import
13
- * - JSON (.json) - via JSON.parse
14
- *
15
- * @param filePath - Path to the config file
16
- * @returns The default export from the config file
17
- *
18
- * @example
19
- * ```typescript
20
- * // Load TypeScript config
21
- * const config = await loadConfig('./install.config.ts');
22
- *
23
- * // Load JSON config (backward compatible)
24
- * const config = await loadConfig('./install.json');
25
- * ```
26
- */
27
- export declare function loadConfig<T = unknown>(filePath: string): Promise<T>;
28
- //# sourceMappingURL=config-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/lib/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAyB1E"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Configuration file loader.
3
- *
4
- * Supports loading TypeScript (.ts), JavaScript (.js, .mjs), and JSON (.json) config files.
5
- * Uses dynamic imports for TypeScript/JavaScript and JSON.parse for JSON files.
6
- */
7
- import { readFile } from 'fs/promises';
8
- import { pathToFileURL } from 'url';
9
- import { resolve } from 'path';
10
- /**
11
- * Load a configuration file from disk.
12
- *
13
- * Supports:
14
- * - TypeScript (.ts) - via dynamic import
15
- * - JavaScript (.js, .mjs) - via dynamic import
16
- * - JSON (.json) - via JSON.parse
17
- *
18
- * @param filePath - Path to the config file
19
- * @returns The default export from the config file
20
- *
21
- * @example
22
- * ```typescript
23
- * // Load TypeScript config
24
- * const config = await loadConfig('./install.config.ts');
25
- *
26
- * // Load JSON config (backward compatible)
27
- * const config = await loadConfig('./install.json');
28
- * ```
29
- */
30
- export async function loadConfig(filePath) {
31
- const absPath = resolve(filePath);
32
- // TypeScript files (requires tsx or ts-node in user's environment)
33
- if (filePath.endsWith('.ts')) {
34
- const configModule = await import(pathToFileURL(absPath).href);
35
- return configModule.default;
36
- }
37
- // JavaScript files
38
- if (filePath.endsWith('.js') || filePath.endsWith('.mjs')) {
39
- const configModule = await import(pathToFileURL(absPath).href);
40
- return configModule.default;
41
- }
42
- // JSON files (backward compatible)
43
- if (filePath.endsWith('.json')) {
44
- const content = await readFile(absPath, 'utf-8');
45
- return JSON.parse(content);
46
- }
47
- throw new Error(`Unsupported file extension for "${filePath}". ` +
48
- `Supported: .ts, .js, .mjs, .json`);
49
- }
@@ -1,12 +0,0 @@
1
- export interface GlobalOptions {
2
- apiUrl?: string;
3
- json?: boolean;
4
- jsonl?: boolean;
5
- quiet?: boolean;
6
- confirm?: boolean;
7
- }
8
- export declare function getApiUrl(options?: {
9
- apiUrl?: string;
10
- }): string;
11
- export declare function getGraphQLEndpoint(apiUrl: string): string;
12
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE/D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGzD"}
@@ -1,8 +0,0 @@
1
- const DEFAULT_API_URL = 'https://api.foir.dev';
2
- export function getApiUrl(options) {
3
- return process.env.FOIR_API_URL ?? options?.apiUrl ?? DEFAULT_API_URL;
4
- }
5
- export function getGraphQLEndpoint(apiUrl) {
6
- const base = apiUrl.replace(/\/$/, '').replace(/\/graphql$/, '');
7
- return `${base}/graphql`;
8
- }
@@ -1,6 +0,0 @@
1
- import type { GlobalOptions } from './config.js';
2
- /**
3
- * Wrap an async command action with standardized error handling.
4
- */
5
- export declare function withErrorHandler<T extends unknown[]>(optsFn: () => GlobalOptions | undefined, fn: (...args: T) => Promise<void>): (...args: T) => Promise<void>;
6
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkBjD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAAE,EAClD,MAAM,EAAE,MAAM,aAAa,GAAG,SAAS,EACvC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAChC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAoF/B"}
@@ -1,76 +0,0 @@
1
- import chalk from 'chalk';
2
- /**
3
- * Wrap an async command action with standardized error handling.
4
- */
5
- export function withErrorHandler(optsFn, fn) {
6
- return async (...args) => {
7
- try {
8
- await fn(...args);
9
- }
10
- catch (error) {
11
- const opts = optsFn();
12
- const gqlErr = error;
13
- // Extract GraphQL error details
14
- const gqlErrors = gqlErr?.response?.errors;
15
- if (gqlErrors && gqlErrors.length > 0) {
16
- const first = gqlErrors[0];
17
- const code = first.extensions?.code;
18
- const validationErrors = first.extensions?.validationErrors;
19
- if (opts?.json || opts?.jsonl) {
20
- console.error(JSON.stringify({
21
- error: {
22
- message: first.message,
23
- code: code ?? 'GRAPHQL_ERROR',
24
- ...(validationErrors ? { validationErrors } : {}),
25
- },
26
- }));
27
- }
28
- else {
29
- console.error(chalk.red('Error:'), first.message);
30
- if (validationErrors && Object.keys(validationErrors).length > 0) {
31
- console.error('');
32
- console.error(chalk.yellow('Field errors:'));
33
- for (const [field, messages] of Object.entries(validationErrors)) {
34
- for (const msg of messages) {
35
- console.error(chalk.gray(` • ${field}:`), msg);
36
- }
37
- }
38
- }
39
- if (code === 'UNAUTHENTICATED') {
40
- console.error(chalk.gray('Hint: Run `foir login` to authenticate.'));
41
- }
42
- else if (code === 'FORBIDDEN') {
43
- console.error(chalk.gray('Hint: You may not have permission. Check your API key scopes.'));
44
- }
45
- }
46
- // eslint-disable-next-line no-process-exit -- CLI error handler needs to exit process
47
- process.exit(1);
48
- }
49
- // HTTP-level errors
50
- const status = gqlErr?.response?.status;
51
- if (status === 401 || status === 403) {
52
- if (opts?.json || opts?.jsonl) {
53
- console.error(JSON.stringify({
54
- error: { message: 'Authentication failed', code: 'AUTH_ERROR' },
55
- }));
56
- }
57
- else {
58
- console.error(chalk.red('Error:'), 'Authentication failed.');
59
- console.error(chalk.gray('Hint: Run `foir login` or set FOIR_API_KEY.'));
60
- }
61
- // eslint-disable-next-line no-process-exit -- CLI error handler needs to exit process
62
- process.exit(1);
63
- }
64
- // Generic errors
65
- const message = error instanceof Error ? error.message : String(error);
66
- if (opts?.json || opts?.jsonl) {
67
- console.error(JSON.stringify({ error: { message } }));
68
- }
69
- else {
70
- console.error(chalk.red('Error:'), message);
71
- }
72
- // eslint-disable-next-line no-process-exit -- CLI error handler needs to exit process
73
- process.exit(1);
74
- }
75
- };
76
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/extension-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,qBAAqB,GAC5B,qBAAqB,CAEvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,CAE5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,CAE7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,8BAA8B,GACxC,8BAA8B,CAEhC;AAGD,YAAY,EACV,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,8BAA8B,EAC9B,iCAAiC,EACjC,8BAA8B,EAC9B,0CAA0C,GAC3C,MAAM,yBAAyB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/hook-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAEjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAEvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAEzE;AAGD,YAAY,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,SAAS,GACV,MAAM,yBAAyB,CAAC"}