@eide/foir-cli 0.1.22 → 0.1.24

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 (82) hide show
  1. package/dist/auth/credentials.d.ts +10 -8
  2. package/dist/auth/credentials.d.ts.map +1 -1
  3. package/dist/auth/credentials.js +72 -12
  4. package/dist/cli.js +6 -0
  5. package/dist/codegen/fetch-customer-profile-schema.d.ts.map +1 -1
  6. package/dist/codegen/fetch-customer-profile-schema.js +4 -4
  7. package/dist/codegen/fetch-models.d.ts.map +1 -1
  8. package/dist/codegen/fetch-models.js +7 -7
  9. package/dist/codegen/field-mapping.d.ts.map +1 -1
  10. package/dist/codegen/field-mapping.js +1 -2
  11. package/dist/codegen/generators/static-documents.d.ts.map +1 -1
  12. package/dist/codegen/generators/static-documents.js +31 -29
  13. package/dist/codegen/generators/typed-operations.d.ts.map +1 -1
  14. package/dist/commands/api-keys.d.ts.map +1 -1
  15. package/dist/commands/api-keys.js +5 -5
  16. package/dist/commands/auth-config.d.ts +4 -0
  17. package/dist/commands/auth-config.d.ts.map +1 -0
  18. package/dist/commands/auth-config.js +37 -0
  19. package/dist/commands/auth-providers.d.ts.map +1 -1
  20. package/dist/commands/auth-providers.js +6 -6
  21. package/dist/commands/context.d.ts.map +1 -1
  22. package/dist/commands/context.js +7 -8
  23. package/dist/commands/customer-profiles.d.ts.map +1 -1
  24. package/dist/commands/customer-profiles.js +5 -5
  25. package/dist/commands/customers.d.ts.map +1 -1
  26. package/dist/commands/customers.js +6 -6
  27. package/dist/commands/embeddings.d.ts +4 -0
  28. package/dist/commands/embeddings.d.ts.map +1 -0
  29. package/dist/commands/embeddings.js +139 -0
  30. package/dist/commands/experiments.d.ts.map +1 -1
  31. package/dist/commands/experiments.js +12 -12
  32. package/dist/commands/extensions.d.ts.map +1 -1
  33. package/dist/commands/extensions.js +6 -6
  34. package/dist/commands/files.d.ts.map +1 -1
  35. package/dist/commands/files.js +8 -8
  36. package/dist/commands/hooks.d.ts +4 -0
  37. package/dist/commands/hooks.d.ts.map +1 -0
  38. package/dist/commands/hooks.js +182 -0
  39. package/dist/commands/locales.d.ts.map +1 -1
  40. package/dist/commands/locales.js +18 -13
  41. package/dist/commands/models.d.ts.map +1 -1
  42. package/dist/commands/models.js +11 -11
  43. package/dist/commands/notes.d.ts.map +1 -1
  44. package/dist/commands/notes.js +18 -8
  45. package/dist/commands/notifications.d.ts.map +1 -1
  46. package/dist/commands/notifications.js +4 -4
  47. package/dist/commands/operations.d.ts.map +1 -1
  48. package/dist/commands/operations.js +126 -12
  49. package/dist/commands/pull.d.ts.map +1 -1
  50. package/dist/commands/pull.js +2 -2
  51. package/dist/commands/records.d.ts.map +1 -1
  52. package/dist/commands/records.js +32 -20
  53. package/dist/commands/schedules.d.ts.map +1 -1
  54. package/dist/commands/schedules.js +9 -9
  55. package/dist/commands/search.d.ts.map +1 -1
  56. package/dist/commands/search.js +2 -2
  57. package/dist/commands/segments.d.ts.map +1 -1
  58. package/dist/commands/segments.js +9 -9
  59. package/dist/commands/select-project.d.ts.map +1 -1
  60. package/dist/commands/select-project.js +8 -9
  61. package/dist/commands/settings.d.ts.map +1 -1
  62. package/dist/commands/settings.js +8 -8
  63. package/dist/commands/variant-catalog.d.ts.map +1 -1
  64. package/dist/commands/variant-catalog.js +7 -7
  65. package/dist/commands/whoami.d.ts.map +1 -1
  66. package/dist/commands/whoami.js +9 -8
  67. package/dist/config/pull-config.js +2 -2
  68. package/dist/config/types.d.ts +1 -1
  69. package/dist/config/types.d.ts.map +1 -1
  70. package/dist/graphql/generated.d.ts +8134 -0
  71. package/dist/graphql/generated.d.ts.map +1 -0
  72. package/dist/graphql/generated.js +133 -0
  73. package/dist/lib/client.d.ts +1 -0
  74. package/dist/lib/client.d.ts.map +1 -1
  75. package/dist/lib/client.js +10 -7
  76. package/dist/lib/config.js +1 -1
  77. package/dist/lib/errors.d.ts.map +1 -1
  78. package/dist/lib/errors.js +11 -0
  79. package/package.json +32 -10
  80. package/dist/graphql/queries.d.ts +0 -115
  81. package/dist/graphql/queries.d.ts.map +0 -1
  82. package/dist/graphql/queries.js +0 -459
@@ -1,459 +0,0 @@
1
- // ============================================================
2
- // GraphQL Query & Mutation Strings
3
- // ============================================================
4
- // Raw template literals — no codegen needed.
5
- // --- Session / Auth ---
6
- export const GET_SESSION_CONTEXT = `
7
- query { sessionContext { tenantId projectId availableTenants { id name } availableProjects { id name tenantId } } }
8
- `;
9
- // --- API Keys ---
10
- export const LIST_API_KEYS = `
11
- query($includeInactive: Boolean, $search: String, $limit: Int, $offset: Int) {
12
- listApiKeys(includeInactive: $includeInactive, search: $search, limit: $limit, offset: $offset) {
13
- apiKeys { id name keyPrefix keyType isActive lastUsedAt usageCount expiresAt scopes createdAt revokedAt rotatedAt }
14
- total
15
- }
16
- }
17
- `;
18
- export const GET_API_KEY = `
19
- query($id: ID!) { getApiKey(id: $id) { id name keyPrefix keyType isActive lastUsedAt lastUsedIp usageCount expiresAt scopes allowedModels allowedFileTypes metadata createdBy createdAt updatedAt revokedAt rotatedAt } }
20
- `;
21
- export const CREATE_API_KEY = `
22
- mutation($input: CreateApiKeyInput!) { createApiKey(input: $input) { apiKey { id name keyPrefix isActive scopes createdAt } plainKey warning } }
23
- `;
24
- export const ROTATE_API_KEY = `
25
- mutation($id: ID!) { rotateApiKey(id: $id) { apiKey { id name keyPrefix rotatedAt } plainKey warning } }
26
- `;
27
- export const REVOKE_API_KEY = `
28
- mutation($id: ID!) { revokeApiKey(id: $id) { id name isActive revokedAt } }
29
- `;
30
- // --- Auth Providers ---
31
- export const LIST_AUTH_PROVIDERS = `
32
- query($enabledOnly: Boolean) {
33
- customerAuthProviders(enabledOnly: $enabledOnly) {
34
- id key name type enabled isDefault priority createdAt updatedAt
35
- }
36
- }
37
- `;
38
- export const GET_AUTH_PROVIDER = `
39
- query($id: ID!) {
40
- customerAuthProvider(id: $id) {
41
- id key name type configDisplay enabled isDefault priority
42
- verifyExternalCustomer captureMetadata createdAt updatedAt createdBy updatedBy
43
- }
44
- }
45
- `;
46
- export const CREATE_AUTH_PROVIDER = `
47
- mutation($input: CreateAuthProviderInput!) {
48
- createCustomerAuthProvider(input: $input) {
49
- id key name type enabled isDefault priority createdAt
50
- }
51
- }
52
- `;
53
- export const UPDATE_AUTH_PROVIDER = `
54
- mutation($id: ID!, $input: UpdateAuthProviderInput!) {
55
- updateCustomerAuthProvider(id: $id, input: $input) {
56
- id key name type enabled isDefault priority updatedAt
57
- }
58
- }
59
- `;
60
- export const DELETE_AUTH_PROVIDER = `
61
- mutation($id: ID!) { deleteCustomerAuthProvider(id: $id) }
62
- `;
63
- // --- Records ---
64
- export const RECORD = `
65
- query($id: ID!) { record(id: $id) { id modelKey naturalKey data metadata publishedVersionNumber publishedAt versionNumber changeDescription createdAt updatedAt } }
66
- `;
67
- export const RECORD_RESOLVED = `
68
- query($id: ID!, $locale: String, $preview: Boolean) {
69
- record(id: $id) {
70
- id modelKey naturalKey data metadata publishedVersionNumber publishedAt versionNumber changeDescription createdAt updatedAt
71
- resolved(locale: $locale, preview: $preview) {
72
- content
73
- record { id modelKey naturalKey }
74
- variant { id variantKey }
75
- version { id versionNumber }
76
- }
77
- }
78
- }
79
- `;
80
- export const RECORD_BY_KEY = `
81
- query($modelKey: String!, $naturalKey: String!) { recordByKey(modelKey: $modelKey, naturalKey: $naturalKey) { id modelKey naturalKey data metadata publishedVersionNumber publishedAt versionNumber changeDescription createdAt updatedAt } }
82
- `;
83
- export const RECORD_BY_KEY_RESOLVED = `
84
- query($modelKey: String!, $naturalKey: String!, $locale: String, $preview: Boolean) {
85
- recordByKey(modelKey: $modelKey, naturalKey: $naturalKey) {
86
- id modelKey naturalKey data metadata publishedVersionNumber publishedAt versionNumber changeDescription createdAt updatedAt
87
- resolved(locale: $locale, preview: $preview) {
88
- content
89
- record { id modelKey naturalKey }
90
- variant { id variantKey }
91
- version { id versionNumber }
92
- }
93
- }
94
- }
95
- `;
96
- export const RECORDS = `
97
- query($modelKey: String!, $limit: Int, $offset: Int, $filters: [FilterInput!], $sort: SortInput) {
98
- records(modelKey: $modelKey, limit: $limit, offset: $offset, filters: $filters, sort: $sort) {
99
- items { id modelKey naturalKey versionNumber createdAt updatedAt }
100
- total
101
- }
102
- }
103
- `;
104
- export const CREATE_RECORD = `
105
- mutation($input: CreateRecordInput!) { createRecord(input: $input) { record { id modelKey naturalKey data metadata createdAt } } }
106
- `;
107
- export const UPDATE_RECORD = `
108
- mutation($input: UpdateRecordInput!) { updateRecord(input: $input) { record { id modelKey naturalKey data metadata updatedAt } matched } }
109
- `;
110
- export const DELETE_RECORD = `
111
- mutation($id: ID!) { deleteRecord(id: $id) { id modelKey naturalKey } }
112
- `;
113
- export const PUBLISH_VERSION = `
114
- mutation($versionId: ID!) { publishVersion(versionId: $versionId) }
115
- `;
116
- export const UNPUBLISH_RECORD = `
117
- mutation($id: ID!) { unpublishRecord(id: $id) }
118
- `;
119
- export const DUPLICATE_RECORD = `
120
- mutation($input: DuplicateRecordInput!) { duplicateRecord(input: $input) { record { id modelKey naturalKey } variant { id variantKey } version { id versionNumber } } }
121
- `;
122
- export const CREATE_VERSION = `
123
- mutation($input: CreateVersionInput!) { createVersion(input: $input) { id modelKey recordType parentId data metadata versionNumber contentHash changeDescription publishStatus createdAt } }
124
- `;
125
- export const CREATE_VARIANT = `
126
- mutation($input: CreateVariantInput!) { createVariant(input: $input) { id modelKey recordType parentId variantKey variantName isDefault priority createdAt } }
127
- `;
128
- export const RECORD_VERSIONS = `
129
- query($parentId: ID!, $limit: Int, $offset: Int) { recordVersions(parentId: $parentId, limit: $limit, offset: $offset) { items { id versionNumber data changeDescription createdAt } } }
130
- `;
131
- export const RECORD_VARIANTS = `
132
- query($recordId: ID!, $limit: Int, $offset: Int) { recordVariants(recordId: $recordId, limit: $limit, offset: $offset) { items { id variantKey variantName isDefault priority createdAt } } }
133
- `;
134
- // --- Models ---
135
- export const MODELS_FOR_CODEGEN = `
136
- query($limit: Int) {
137
- models(limit: $limit) {
138
- items { id key name pluralName description category fields config hooks }
139
- total
140
- }
141
- }
142
- `;
143
- export const MODEL_BY_KEY = `
144
- query($key: String!) { modelByKey(key: $key) { id key name pluralName description category icon fields config hooks displayField extensionId systemEntity deletable editable currentVersionId publishedVersionNumber createdAt updatedAt } }
145
- `;
146
- export const MODELS = `
147
- query($search: String, $category: String, $limit: Int, $offset: Int) {
148
- models(search: $search, category: $category, limit: $limit, offset: $offset) {
149
- items { id key name category config systemEntity createdAt updatedAt }
150
- total
151
- }
152
- }
153
- `;
154
- export const CREATE_MODEL = `
155
- mutation($input: CreateModelInput!) { createModel(input: $input) { id key name fields config createdAt } }
156
- `;
157
- export const UPDATE_MODEL = `
158
- mutation($input: UpdateModelInput!) { updateModel(input: $input) { id key name fields config updatedAt } }
159
- `;
160
- export const DELETE_MODEL = `
161
- mutation($id: ID!) { deleteModel(id: $id) }
162
- `;
163
- export const MODEL_VERSIONS = `
164
- query($modelId: ID!, $limit: Int, $offset: Int) { modelVersions(modelId: $modelId, limit: $limit, offset: $offset) { items { id modelId versionNumber contentHash changeDescription createdAt createdBy } } }
165
- `;
166
- // --- Search ---
167
- export const GLOBAL_SEARCH = `
168
- query($query: String!, $limit: Int, $modelKeys: [String!], $includeMedia: Boolean) {
169
- globalSearch(query: $query, limit: $limit, modelKeys: $modelKeys, includeMedia: $includeMedia) {
170
- records { id modelKey title naturalKey subtitle modelName updatedAt }
171
- media { id fileName altText fileUrl }
172
- }
173
- }
174
- `;
175
- // --- Customer Profile Schema ---
176
- export const CUSTOMER_PROFILE_SCHEMA = `
177
- query { customerProfileSchema { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } publicFields version createdAt updatedAt updatedBy } }
178
- `;
179
- export const UPDATE_CUSTOMER_PROFILE_SCHEMA = `
180
- mutation($fields: [FieldDefinitionInput!]!, $publicFields: [String!]) { updateCustomerProfileSchema(fields: $fields, publicFields: $publicFields) { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } publicFields version createdAt updatedAt } }
181
- `;
182
- export const CUSTOMER_PROFILE = `
183
- query($customerId: ID!) { customerProfile(customerId: $customerId) { id customerId data schemaVersionNumber createdAt updatedAt createdBy updatedBy } }
184
- `;
185
- export const SET_CUSTOMER_PROFILE = `
186
- mutation($customerId: ID!, $data: JSON!) { setCustomerProfile(customerId: $customerId, data: $data) { id customerId data schemaVersionNumber createdAt updatedAt } }
187
- `;
188
- // --- Customers ---
189
- export const CUSTOMERS = `
190
- query($status: CustomerStatus, $search: String, $filters: [FilterInput!], $limit: Int, $offset: Int) {
191
- customers(status: $status, search: $search, filters: $filters, limit: $limit, offset: $offset) {
192
- customers { id email status lastLoginAt createdAt updatedAt }
193
- total
194
- }
195
- }
196
- `;
197
- export const CUSTOMER = `
198
- query($id: ID!) { customer(id: $id) { id email status lastLoginAt createdAt updatedAt } }
199
- `;
200
- export const CUSTOMER_BY_EMAIL = `
201
- query($email: String!) { customerByEmail(email: $email) { id email status lastLoginAt createdAt updatedAt } }
202
- `;
203
- export const CREATE_CUSTOMER = `
204
- mutation($input: CreateCustomerInput!) { createCustomer(input: $input) { id email status createdAt } }
205
- `;
206
- export const DELETE_CUSTOMER = `
207
- mutation($id: ID!) { deleteCustomer(id: $id) { success deletedAt } }
208
- `;
209
- // --- Segments ---
210
- export const SEGMENTS = `
211
- query($isActive: Boolean, $limit: Int, $offset: Int) { segments(isActive: $isActive, limit: $limit, offset: $offset) { id key name description evaluationMode memberCount isActive createdAt updatedAt } }
212
- `;
213
- export const SEGMENT = `
214
- query($id: ID!) { segment(id: $id) { id key name description rules evaluationMode manualMemberIds manualMemberMode memberCount memberCountUpdatedAt isActive createdAt updatedAt } }
215
- `;
216
- export const SEGMENT_BY_KEY = `
217
- query($key: String!) { segmentByKey(key: $key) { id key name description rules evaluationMode manualMemberIds manualMemberMode memberCount memberCountUpdatedAt isActive createdAt updatedAt } }
218
- `;
219
- export const CREATE_SEGMENT = `
220
- mutation($input: CreateSegmentInput!) { createSegment(input: $input) { id key name isActive createdAt } }
221
- `;
222
- export const UPDATE_SEGMENT = `
223
- mutation($id: ID!, $input: UpdateSegmentInput!) { updateSegment(id: $id, input: $input) { id key name isActive updatedAt } }
224
- `;
225
- export const DELETE_SEGMENT = `
226
- mutation($id: ID!) { deleteSegment(id: $id) }
227
- `;
228
- export const PREVIEW_SEGMENT_RULES = `
229
- query($rules: JSON!, $sampleSize: Int) { previewSegmentRules(rules: $rules, sampleSize: $sampleSize) { estimatedCount sampleCustomerIds sampleSize } }
230
- `;
231
- export const TEST_SEGMENT_EVALUATION = `
232
- query($segmentId: ID!, $customerId: ID!) { testSegmentEvaluation(segmentId: $segmentId, customerId: $customerId) { matches segmentId customerId } }
233
- `;
234
- // --- Experiments ---
235
- export const EXPERIMENTS = `
236
- query($status: String, $isActive: Boolean, $limit: Int, $offset: Int) { experiments(status: $status, isActive: $isActive, limit: $limit, offset: $offset) { id key name description status controlPercent isActive startDate endDate createdAt updatedAt } }
237
- `;
238
- export const EXPERIMENT = `
239
- query($id: ID!) { experiment(id: $id) { id key name description status targeting controlPercent variants assignmentPersistence mutuallyExclusive exclusionGroupKey startDate endDate metrics goals { id key name isPrimary } funnel { steps { key name order } } isActive createdAt updatedAt } }
240
- `;
241
- export const EXPERIMENT_BY_KEY = `
242
- query($key: String!) { experimentByKey(key: $key) { id key name description status targeting controlPercent variants assignmentPersistence mutuallyExclusive exclusionGroupKey startDate endDate metrics goals { id key name isPrimary } funnel { steps { key name order } } isActive createdAt updatedAt } }
243
- `;
244
- export const CREATE_EXPERIMENT = `
245
- mutation($input: CreateExperimentInput!) { createExperiment(input: $input) { id key name status isActive createdAt } }
246
- `;
247
- export const UPDATE_EXPERIMENT = `
248
- mutation($id: ID!, $input: UpdateExperimentInput!) { updateExperiment(id: $id, input: $input) { id key name status isActive updatedAt } }
249
- `;
250
- export const DELETE_EXPERIMENT = `
251
- mutation($id: ID!) { deleteExperiment(id: $id) }
252
- `;
253
- export const START_EXPERIMENT = `
254
- mutation($experimentId: ID!) { startExperiment(experimentId: $experimentId) { id key name status } }
255
- `;
256
- export const PAUSE_EXPERIMENT = `
257
- mutation($experimentId: ID!) { pauseExperiment(experimentId: $experimentId) { id key name status } }
258
- `;
259
- export const RESUME_EXPERIMENT = `
260
- mutation($experimentId: ID!) { resumeExperiment(experimentId: $experimentId) { id key name status } }
261
- `;
262
- export const END_EXPERIMENT = `
263
- mutation($experimentId: ID!) { endExperiment(experimentId: $experimentId) { id key name status } }
264
- `;
265
- export const EXPERIMENT_STATS = `
266
- query($experimentId: ID!) { experimentStats(experimentId: $experimentId) { totalAssignments variantAssignments { variantKey variantName count percentage } updatedAt } }
267
- `;
268
- // --- Settings ---
269
- export const ALL_SETTINGS = `
270
- query { allSettings { id key value category displayName description dataType isPublic isEncrypted createdAt updatedAt } }
271
- `;
272
- export const SETTINGS_BY_CATEGORY = `
273
- query($category: String!) { settingsByCategory(category: $category) { id key value category displayName description dataType isPublic isEncrypted createdAt updatedAt } }
274
- `;
275
- export const SETTING = `
276
- query($key: String!) { setting(key: $key) { id key value category displayName description dataType isPublic isEncrypted createdAt updatedAt } }
277
- `;
278
- export const SET_SETTING = `
279
- mutation($input: SetSettingInput!) { setSetting(input: $input) { id key value category dataType updatedAt } }
280
- `;
281
- export const DELETE_SETTING = `
282
- mutation($key: String!) { deleteSetting(key: $key) }
283
- `;
284
- // --- Extensions ---
285
- export const EXTENSIONS = `
286
- query($extensionType: String, $enabled: Boolean, $limit: Int, $offset: Int) { extensions(extensionType: $extensionType, enabled: $enabled, limit: $limit, offset: $offset) { id key extensionType direction name description enabled syncStatus createdAt updatedAt } }
287
- `;
288
- export const EXTENSION = `
289
- query($id: ID!) { extension(id: $id) { id key extensionType direction name description connectionDomain connectionId enabled environment syncStatus syncMetadata features config webhooks createdAt updatedAt } }
290
- `;
291
- export const EXTENSION_BY_KEY = `
292
- query($key: String!) { extensionByKey(key: $key) { id key extensionType direction name description connectionDomain connectionId enabled environment syncStatus syncMetadata features config webhooks createdAt updatedAt } }
293
- `;
294
- export const REGISTER_EXTENSION = `
295
- mutation($input: RegisterExtensionInput!) { registerExtension(input: $input) { id key name extensionType enabled createdAt } }
296
- `;
297
- export const TRIGGER_EXTENSION_SYNC = `
298
- mutation($extensionId: ID!) { triggerExtensionSync(extensionId: $extensionId) { success error results } }
299
- `;
300
- // --- Operations ---
301
- export const OPERATIONS = `
302
- query($category: String, $isActive: Boolean, $limit: Int, $offset: Int) { operations(category: $category, isActive: $isActive, limit: $limit, offset: $offset) { id key name description category endpoint isActive rateLimitWeight createdAt updatedAt } }
303
- `;
304
- export const OPERATION = `
305
- query($key: String!) { operation(key: $key) { id key name description icon category endpoint endpointAuth timeoutMs retryPolicy models inputSchema outputSchema ui isActive allowedRoles rateLimitWeight createdAt updatedAt circuitState { endpoint state consecutiveFailures lastFailureTime } } }
306
- `;
307
- export const EXECUTE_OPERATION = `
308
- mutation($input: ExecuteOperationInput!) { executeOperation(input: $input) { success result error { code message } executionId durationMs metadata } }
309
- `;
310
- export const OPERATION_EXECUTION_STATS = `
311
- query($operationKey: String!) { operationExecutionStats(operationKey: $operationKey) { totalExecutions successCount failureCount avgDurationMs lastExecutedAt } }
312
- `;
313
- export const DEAD_LETTER_OPERATIONS = `
314
- query($operationKey: String, $status: DeadLetterStatus, $limit: Int, $offset: Int) {
315
- deadLetterOperations(operationKey: $operationKey, status: $status, limit: $limit, offset: $offset) {
316
- items { id operationKey executionId attempts lastError errorCode status failedAt createdAt }
317
- total
318
- }
319
- }
320
- `;
321
- export const RETRY_DEAD_LETTER = `
322
- mutation($id: ID!) { retryDeadLetterOperation(id: $id) { success result error { code message } executionId durationMs } }
323
- `;
324
- export const DISMISS_DEAD_LETTER = `
325
- mutation($id: ID!) { dismissDeadLetterOperation(id: $id) { id status dismissedAt } }
326
- `;
327
- // --- Schedules ---
328
- export const SCHEDULES = `
329
- query($isActive: Boolean, $limit: Int, $offset: Int) {
330
- schedules(isActive: $isActive, limit: $limit, offset: $offset) {
331
- items { id key name cron cronDescription timezone isActive lastRunAt lastRunStatus nextRunAt runCount failureCount createdAt }
332
- total
333
- }
334
- }
335
- `;
336
- export const SCHEDULE = `
337
- query($key: String!) { schedule(key: $key) { id key name description cron cronDescription timezone targetType targetConfig isActive pausedAt lastRunAt lastRunStatus lastRunError nextRunAt runCount failureCount consecutiveFailures createdAt updatedAt } }
338
- `;
339
- export const CREATE_SCHEDULE = `
340
- mutation($input: CreateScheduleInput!) { createSchedule(input: $input) { id key name cron isActive createdAt } }
341
- `;
342
- export const UPDATE_SCHEDULE = `
343
- mutation($key: String!, $input: UpdateScheduleInput!) { updateSchedule(key: $key, input: $input) { id key name cron isActive updatedAt } }
344
- `;
345
- export const DELETE_SCHEDULE = `
346
- mutation($key: String!) { deleteSchedule(key: $key) }
347
- `;
348
- export const PAUSE_SCHEDULE = `
349
- mutation($key: String!) { pauseSchedule(key: $key) { id key isActive pausedAt } }
350
- `;
351
- export const RESUME_SCHEDULE = `
352
- mutation($key: String!) { resumeSchedule(key: $key) { id key isActive } }
353
- `;
354
- export const TRIGGER_SCHEDULE = `
355
- mutation($key: String!) { triggerSchedule(key: $key) { success jobId error } }
356
- `;
357
- // --- Notifications ---
358
- export const NOTIFICATIONS = `
359
- query($unreadOnly: Boolean, $limit: Int, $offset: Int) {
360
- notifications(unreadOnly: $unreadOnly, limit: $limit, offset: $offset) {
361
- items { id type title message isRead actionUrl createdAt }
362
- total
363
- unreadCount
364
- hasMore
365
- }
366
- }
367
- `;
368
- export const MARK_NOTIFICATION_READ = `
369
- mutation($id: ID!) { markNotificationRead(id: $id) { id isRead readAt } }
370
- `;
371
- export const MARK_ALL_NOTIFICATIONS_READ = `
372
- mutation { markAllNotificationsRead }
373
- `;
374
- // --- Locales ---
375
- export const LOCALES = `
376
- query($includeInactive: Boolean, $limit: Int, $offset: Int) { locales(includeInactive: $includeInactive, limit: $limit, offset: $offset) { id code name nativeName isDefault isActive direction fallbackLocaleId createdAt updatedAt } }
377
- `;
378
- export const LOCALE = `
379
- query($id: ID!) { locale(id: $id) { id code name nativeName isDefault isActive direction fallbackLocaleId createdAt updatedAt } }
380
- `;
381
- export const LOCALE_BY_CODE = `
382
- query($code: String!) { localeByCode(code: $code) { id code name nativeName isDefault isActive direction fallbackLocaleId createdAt updatedAt } }
383
- `;
384
- export const DEFAULT_LOCALE = `
385
- query { defaultLocale { id code name nativeName isDefault isActive direction createdAt } }
386
- `;
387
- export const CREATE_LOCALE = `
388
- mutation($input: CreateLocaleInput!) { createLocale(input: $input) { id code name isDefault isActive createdAt } }
389
- `;
390
- export const UPDATE_LOCALE = `
391
- mutation($id: ID!, $input: UpdateLocaleInput!) { updateLocale(id: $id, input: $input) { id code name isDefault isActive updatedAt } }
392
- `;
393
- export const DELETE_LOCALE = `
394
- mutation($id: ID!) { deleteLocale(id: $id) }
395
- `;
396
- // --- Files (Storage) ---
397
- export const FILES = `
398
- query($folder: String, $mimeType: String, $status: FileStatus, $search: String, $limit: Int, $offset: Int) {
399
- files(folder: $folder, mimeType: $mimeType, status: $status, search: $search, limit: $limit, offset: $offset) {
400
- items { id filename mimeType size folder fileUrl status tags createdAt updatedAt }
401
- total
402
- }
403
- }
404
- `;
405
- export const FILE = `
406
- query($id: ID!) { file(id: $id) { id filename mimeType size folder fileUrl storageKey status tags metadata altText caption description createdAt updatedAt } }
407
- `;
408
- export const FILE_STORAGE_USAGE = `
409
- query { fileStorageUsage { totalFiles totalSize usedStorage storageLimit } }
410
- `;
411
- export const UPDATE_FILE = `
412
- mutation($id: ID!, $filename: String, $folder: String, $tags: [String!], $status: FileStatus, $metadata: JSON) { updateFile(id: $id, filename: $filename, folder: $folder, tags: $tags, status: $status, metadata: $metadata) { id filename folder tags status updatedAt } }
413
- `;
414
- export const UPDATE_FILE_METADATA = `
415
- mutation($id: ID!, $altText: String, $caption: String, $description: String) { updateFileMetadata(id: $id, altText: $altText, caption: $caption, description: $description) { id altText caption description updatedAt } }
416
- `;
417
- export const DELETE_FILE = `
418
- mutation($id: ID!) { deleteFile(id: $id) }
419
- `;
420
- // --- Notes ---
421
- export const NOTES = `
422
- query($entityType: String!, $entityId: ID!, $includeResolved: Boolean, $limit: Int, $offset: Int) {
423
- notes(entityType: $entityType, entityId: $entityId, includeResolved: $includeResolved, limit: $limit, offset: $offset) {
424
- items { id body entityType entityId authorId isResolved resolvedAt resolvedBy parentNoteId createdAt updatedAt }
425
- total
426
- }
427
- }
428
- `;
429
- export const NOTE = `
430
- query($id: ID!) { note(id: $id) { id body entityType entityId authorId isResolved resolvedAt resolvedBy parentNoteId mentions { id userId status } createdAt updatedAt } }
431
- `;
432
- export const CREATE_NOTE = `
433
- mutation($input: CreateNoteInput!) { createNote(input: $input) { id body entityType entityId authorId createdAt } }
434
- `;
435
- export const RESOLVE_NOTE = `
436
- mutation($input: ResolveNoteInput!) { resolveNote(input: $input) { id isResolved resolvedAt resolvedBy } }
437
- `;
438
- export const DELETE_NOTE = `
439
- mutation($noteId: ID!) { deleteNote(noteId: $noteId) }
440
- `;
441
- // --- Variant Catalog ---
442
- export const VARIANT_CATALOG = `
443
- query($isActive: Boolean, $limit: Int, $offset: Int) { variantCatalog(isActive: $isActive, limit: $limit, offset: $offset) { id key name description dimensions isDefault isActive createdAt updatedAt } }
444
- `;
445
- export const VARIANT_CATALOG_ENTRY = `
446
- query($id: ID!) { variantCatalogEntry(id: $id) { id key name description dimensions isDefault isActive createdAt updatedAt } }
447
- `;
448
- export const VARIANT_CATALOG_ENTRY_BY_KEY = `
449
- query($key: String!) { variantCatalogEntryByKey(key: $key) { id key name description dimensions isDefault isActive createdAt updatedAt } }
450
- `;
451
- export const CREATE_VARIANT_CATALOG_ENTRY = `
452
- mutation($input: CreateVariantCatalogInput!) { createVariantCatalogEntry(input: $input) { id key name isDefault isActive createdAt } }
453
- `;
454
- export const UPDATE_VARIANT_CATALOG_ENTRY = `
455
- mutation($id: ID!, $input: UpdateVariantCatalogInput!) { updateVariantCatalogEntry(id: $id, input: $input) { id key name isDefault isActive updatedAt } }
456
- `;
457
- export const DELETE_VARIANT_CATALOG_ENTRY = `
458
- mutation($id: ID!) { deleteVariantCatalogEntry(id: $id) }
459
- `;