@eide/foir-cli 0.1.23 → 0.1.25
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.
- package/dist/auth/credentials.js +0 -1
- package/dist/cli.js +6 -0
- package/dist/codegen/fetch-customer-profile-schema.d.ts.map +1 -1
- package/dist/codegen/fetch-customer-profile-schema.js +4 -4
- package/dist/codegen/fetch-models.d.ts.map +1 -1
- package/dist/codegen/fetch-models.js +7 -7
- package/dist/codegen/field-mapping.d.ts.map +1 -1
- package/dist/codegen/field-mapping.js +1 -2
- package/dist/codegen/generators/static-documents.d.ts.map +1 -1
- package/dist/codegen/generators/static-documents.js +31 -29
- package/dist/codegen/generators/typed-operations.d.ts.map +1 -1
- package/dist/commands/api-keys.d.ts.map +1 -1
- package/dist/commands/api-keys.js +5 -5
- package/dist/commands/auth-config.d.ts +4 -0
- package/dist/commands/auth-config.d.ts.map +1 -0
- package/dist/commands/auth-config.js +37 -0
- package/dist/commands/auth-providers.d.ts.map +1 -1
- package/dist/commands/auth-providers.js +6 -6
- package/dist/commands/customer-profiles.d.ts.map +1 -1
- package/dist/commands/customer-profiles.js +5 -5
- package/dist/commands/customers.d.ts.map +1 -1
- package/dist/commands/customers.js +6 -6
- package/dist/commands/embeddings.d.ts +4 -0
- package/dist/commands/embeddings.d.ts.map +1 -0
- package/dist/commands/embeddings.js +139 -0
- package/dist/commands/experiments.d.ts.map +1 -1
- package/dist/commands/experiments.js +12 -12
- package/dist/commands/extensions.d.ts.map +1 -1
- package/dist/commands/extensions.js +52 -6
- package/dist/commands/files.d.ts.map +1 -1
- package/dist/commands/files.js +8 -8
- package/dist/commands/hooks.d.ts +4 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/hooks.js +182 -0
- package/dist/commands/locales.d.ts.map +1 -1
- package/dist/commands/locales.js +18 -13
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +11 -11
- package/dist/commands/notes.d.ts.map +1 -1
- package/dist/commands/notes.js +18 -8
- package/dist/commands/notifications.d.ts.map +1 -1
- package/dist/commands/notifications.js +4 -4
- package/dist/commands/operations.d.ts.map +1 -1
- package/dist/commands/operations.js +126 -12
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +2 -2
- package/dist/commands/records.d.ts.map +1 -1
- package/dist/commands/records.js +32 -20
- package/dist/commands/schedules.d.ts.map +1 -1
- package/dist/commands/schedules.js +9 -9
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +2 -2
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +9 -9
- package/dist/commands/settings.d.ts.map +1 -1
- package/dist/commands/settings.js +8 -8
- package/dist/commands/variant-catalog.d.ts.map +1 -1
- package/dist/commands/variant-catalog.js +7 -7
- package/dist/config/pull-config.js +2 -2
- package/dist/config/types.d.ts +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/graphql/generated.d.ts +8244 -0
- package/dist/graphql/generated.d.ts.map +1 -0
- package/dist/graphql/generated.js +134 -0
- package/dist/lib/config.js +1 -1
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +11 -0
- package/package.json +32 -10
- package/dist/graphql/queries.d.ts +0 -115
- package/dist/graphql/queries.d.ts.map +0 -1
- package/dist/graphql/queries.js +0 -459
package/dist/commands/records.js
CHANGED
|
@@ -2,7 +2,7 @@ import { withErrorHandler } from '../lib/errors.js';
|
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, timeAgo, success } from '../lib/output.js';
|
|
4
4
|
import { parseInputData, parseFilters, parseSort, isUUID, confirmAction, } from '../lib/input.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ListRecordsDocument, GetRecordDocument, GetRecordResolvedDocument, GetRecordByKeyDocument, GetRecordByKeyResolvedDocument, CreateRecordDocument, UpdateRecordDocument, DeleteRecordDocument, PublishVersionDocument, UnpublishRecordDocument, DuplicateRecordDocument, CreateVersionDocument, CreateVariantDocument, RecordVersionsDocument, RecordVariantsDocument, } from '../graphql/generated.js';
|
|
6
6
|
export function registerRecordsCommands(program, globalOpts) {
|
|
7
7
|
const records = program.command('records').description('Manage records');
|
|
8
8
|
// list
|
|
@@ -25,7 +25,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
25
25
|
variables.filters = parseFilters(cmdOpts.filter);
|
|
26
26
|
if (cmdOpts.sort)
|
|
27
27
|
variables.sort = parseSort(cmdOpts.sort);
|
|
28
|
-
const data = await client.request(
|
|
28
|
+
const data = await client.request(ListRecordsDocument, variables);
|
|
29
29
|
formatList(data.records.items, opts, {
|
|
30
30
|
columns: [
|
|
31
31
|
{ key: 'id', header: 'ID', width: 28 },
|
|
@@ -54,28 +54,40 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
54
54
|
let result;
|
|
55
55
|
const useResolved = !!cmdOpts.resolved || !!cmdOpts.preview;
|
|
56
56
|
if (isUUID(idOrKey)) {
|
|
57
|
-
const query = useResolved ? RECORD_RESOLVED : RECORD;
|
|
58
|
-
const variables = { id: idOrKey };
|
|
59
57
|
if (useResolved) {
|
|
58
|
+
const variables = { id: idOrKey };
|
|
60
59
|
if (cmdOpts.locale)
|
|
61
60
|
variables.locale = cmdOpts.locale;
|
|
62
61
|
if (cmdOpts.preview)
|
|
63
62
|
variables.preview = true;
|
|
63
|
+
const data = await client.request(GetRecordResolvedDocument, variables);
|
|
64
|
+
result = data.record;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const data = await client.request(GetRecordDocument, { id: idOrKey });
|
|
68
|
+
result = data.record;
|
|
64
69
|
}
|
|
65
|
-
const data = await client.request(query, variables);
|
|
66
|
-
result = data.record;
|
|
67
70
|
}
|
|
68
71
|
else {
|
|
69
|
-
const query = useResolved ? RECORD_BY_KEY_RESOLVED : RECORD_BY_KEY;
|
|
70
|
-
const variables = { modelKey, naturalKey: idOrKey };
|
|
71
72
|
if (useResolved) {
|
|
73
|
+
const variables = {
|
|
74
|
+
modelKey,
|
|
75
|
+
naturalKey: idOrKey,
|
|
76
|
+
};
|
|
72
77
|
if (cmdOpts.locale)
|
|
73
78
|
variables.locale = cmdOpts.locale;
|
|
74
79
|
if (cmdOpts.preview)
|
|
75
80
|
variables.preview = true;
|
|
81
|
+
const data = await client.request(GetRecordByKeyResolvedDocument, variables);
|
|
82
|
+
result = data.recordByKey;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const data = await client.request(GetRecordByKeyDocument, {
|
|
86
|
+
modelKey,
|
|
87
|
+
naturalKey: idOrKey,
|
|
88
|
+
});
|
|
89
|
+
result = data.recordByKey;
|
|
76
90
|
}
|
|
77
|
-
const data = await client.request(query, variables);
|
|
78
|
-
result = data.recordByKey;
|
|
79
91
|
}
|
|
80
92
|
if (!result) {
|
|
81
93
|
throw new Error(`Record "${idOrKey}" not found in model "${modelKey}".`);
|
|
@@ -93,7 +105,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
93
105
|
const client = await createClient(opts);
|
|
94
106
|
const inputData = await parseInputData(cmdOpts);
|
|
95
107
|
const input = { modelKey, ...inputData };
|
|
96
|
-
const data = await client.request(
|
|
108
|
+
const data = await client.request(CreateRecordDocument, { input });
|
|
97
109
|
formatOutput(data.createRecord, opts);
|
|
98
110
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
99
111
|
success(`Created record ${data.createRecord.record.id}`);
|
|
@@ -110,7 +122,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
110
122
|
const client = await createClient(opts);
|
|
111
123
|
const inputData = await parseInputData(cmdOpts);
|
|
112
124
|
const input = { id, ...inputData };
|
|
113
|
-
const data = await client.request(
|
|
125
|
+
const data = await client.request(UpdateRecordDocument, { input });
|
|
114
126
|
formatOutput(data.updateRecord, opts);
|
|
115
127
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
116
128
|
success(`Updated record ${id}`);
|
|
@@ -131,7 +143,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
131
143
|
return;
|
|
132
144
|
}
|
|
133
145
|
const client = await createClient(opts);
|
|
134
|
-
const data = await client.request(
|
|
146
|
+
const data = await client.request(DeleteRecordDocument, { id });
|
|
135
147
|
formatOutput(data.deleteRecord, opts);
|
|
136
148
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
137
149
|
success(`Deleted record ${id}`);
|
|
@@ -144,7 +156,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
144
156
|
.action(withErrorHandler(globalOpts, async (versionId) => {
|
|
145
157
|
const opts = globalOpts();
|
|
146
158
|
const client = await createClient(opts);
|
|
147
|
-
await client.request(
|
|
159
|
+
await client.request(PublishVersionDocument, { versionId });
|
|
148
160
|
if (opts.json || opts.jsonl) {
|
|
149
161
|
formatOutput({ published: true, versionId }, opts);
|
|
150
162
|
}
|
|
@@ -159,7 +171,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
159
171
|
.action(withErrorHandler(globalOpts, async (id) => {
|
|
160
172
|
const opts = globalOpts();
|
|
161
173
|
const client = await createClient(opts);
|
|
162
|
-
await client.request(
|
|
174
|
+
await client.request(UnpublishRecordDocument, { id });
|
|
163
175
|
if (opts.json || opts.jsonl) {
|
|
164
176
|
formatOutput({ unpublished: true, id }, opts);
|
|
165
177
|
}
|
|
@@ -176,7 +188,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
176
188
|
const opts = globalOpts();
|
|
177
189
|
const client = await createClient(opts);
|
|
178
190
|
const naturalKey = cmdOpts.naturalKey ?? `${id}-copy`;
|
|
179
|
-
const data = await client.request(
|
|
191
|
+
const data = await client.request(DuplicateRecordDocument, { input: { recordId: id, naturalKey } });
|
|
180
192
|
formatOutput(data.duplicateRecord, opts);
|
|
181
193
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
182
194
|
success(`Duplicated → ${data.duplicateRecord.record.id}`);
|
|
@@ -190,7 +202,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
190
202
|
.action(withErrorHandler(globalOpts, async (parentId, cmdOpts) => {
|
|
191
203
|
const opts = globalOpts();
|
|
192
204
|
const client = await createClient(opts);
|
|
193
|
-
const data = await client.request(
|
|
205
|
+
const data = await client.request(RecordVersionsDocument, {
|
|
194
206
|
parentId,
|
|
195
207
|
limit: parseInt(cmdOpts.limit ?? '20', 10),
|
|
196
208
|
});
|
|
@@ -215,7 +227,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
215
227
|
.action(withErrorHandler(globalOpts, async (recordId) => {
|
|
216
228
|
const opts = globalOpts();
|
|
217
229
|
const client = await createClient(opts);
|
|
218
|
-
const data = await client.request(
|
|
230
|
+
const data = await client.request(RecordVariantsDocument, { recordId });
|
|
219
231
|
formatList(data.recordVariants.items, opts, {
|
|
220
232
|
columns: [
|
|
221
233
|
{ key: 'id', header: 'Variant ID', width: 28 },
|
|
@@ -250,7 +262,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
250
262
|
input.changeDescription = cmdOpts.message;
|
|
251
263
|
if (cmdOpts.sourceVersion)
|
|
252
264
|
input.sourceVersionId = cmdOpts.sourceVersion;
|
|
253
|
-
const data = await client.request(
|
|
265
|
+
const data = await client.request(CreateVersionDocument, { input });
|
|
254
266
|
formatOutput(data.createVersion, opts);
|
|
255
267
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
256
268
|
success(`Created version ${data.createVersion.id}`);
|
|
@@ -283,7 +295,7 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
283
295
|
input.priority = parseInt(cmdOpts.priority, 10);
|
|
284
296
|
if (cmdOpts.default)
|
|
285
297
|
input.isDefault = true;
|
|
286
|
-
const data = await client.request(
|
|
298
|
+
const data = await client.request(CreateVariantDocument, { input });
|
|
287
299
|
formatOutput(data.createVariant, opts);
|
|
288
300
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
289
301
|
success(`Created variant ${data.createVariant.id}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/commands/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../src/commands/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CA8KN"}
|
|
@@ -2,7 +2,7 @@ import { withErrorHandler } from '../lib/errors.js';
|
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, timeAgo, success } from '../lib/output.js';
|
|
4
4
|
import { parseInputData, confirmAction } from '../lib/input.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ListSchedulesDocument, GetScheduleDocument, CreateScheduleDocument, UpdateScheduleDocument, DeleteScheduleDocument, PauseScheduleDocument, ResumeScheduleDocument, TriggerScheduleDocument, } from '../graphql/generated.js';
|
|
6
6
|
export function registerSchedulesCommands(program, globalOpts) {
|
|
7
7
|
const schedules = program
|
|
8
8
|
.command('schedules')
|
|
@@ -16,7 +16,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
16
16
|
.action(withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
17
17
|
const opts = globalOpts();
|
|
18
18
|
const client = await createClient(opts);
|
|
19
|
-
const data = await client.request(
|
|
19
|
+
const data = await client.request(ListSchedulesDocument, {
|
|
20
20
|
isActive: cmdOpts.active ? true : undefined,
|
|
21
21
|
limit: parseInt(String(cmdOpts.limit ?? '50'), 10),
|
|
22
22
|
});
|
|
@@ -49,7 +49,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
49
49
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
50
50
|
const opts = globalOpts();
|
|
51
51
|
const client = await createClient(opts);
|
|
52
|
-
const data = await client.request(
|
|
52
|
+
const data = await client.request(GetScheduleDocument, { key });
|
|
53
53
|
if (!data.schedule)
|
|
54
54
|
throw new Error(`Schedule "${key}" not found.`);
|
|
55
55
|
formatOutput(data.schedule, opts);
|
|
@@ -64,7 +64,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
64
64
|
const opts = globalOpts();
|
|
65
65
|
const client = await createClient(opts);
|
|
66
66
|
const input = await parseInputData(cmdOpts);
|
|
67
|
-
const data = await client.request(
|
|
67
|
+
const data = await client.request(CreateScheduleDocument, { input });
|
|
68
68
|
formatOutput(data.createSchedule, opts);
|
|
69
69
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
70
70
|
success(`Created schedule ${data.createSchedule.key}`);
|
|
@@ -79,7 +79,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
79
79
|
const opts = globalOpts();
|
|
80
80
|
const client = await createClient(opts);
|
|
81
81
|
const input = await parseInputData(cmdOpts);
|
|
82
|
-
const data = await client.request(
|
|
82
|
+
const data = await client.request(UpdateScheduleDocument, { key, input });
|
|
83
83
|
formatOutput(data.updateSchedule, opts);
|
|
84
84
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
85
85
|
success(`Updated schedule "${key}"`);
|
|
@@ -91,7 +91,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
91
91
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
92
92
|
const opts = globalOpts();
|
|
93
93
|
const client = await createClient(opts);
|
|
94
|
-
const data = await client.request(
|
|
94
|
+
const data = await client.request(TriggerScheduleDocument, { key });
|
|
95
95
|
if (opts.json || opts.jsonl) {
|
|
96
96
|
formatOutput(data.triggerSchedule, opts);
|
|
97
97
|
}
|
|
@@ -109,7 +109,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
109
109
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
110
110
|
const opts = globalOpts();
|
|
111
111
|
const client = await createClient(opts);
|
|
112
|
-
const data = await client.request(
|
|
112
|
+
const data = await client.request(PauseScheduleDocument, { key });
|
|
113
113
|
formatOutput(data.pauseSchedule, opts);
|
|
114
114
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
115
115
|
success(`Paused schedule "${key}"`);
|
|
@@ -121,7 +121,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
121
121
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
122
122
|
const opts = globalOpts();
|
|
123
123
|
const client = await createClient(opts);
|
|
124
|
-
const data = await client.request(
|
|
124
|
+
const data = await client.request(ResumeScheduleDocument, { key });
|
|
125
125
|
formatOutput(data.resumeSchedule, opts);
|
|
126
126
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
127
127
|
success(`Resumed schedule "${key}"`);
|
|
@@ -141,7 +141,7 @@ export function registerSchedulesCommands(program, globalOpts) {
|
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
const client = await createClient(opts);
|
|
144
|
-
await client.request(
|
|
144
|
+
await client.request(DeleteScheduleDocument, { key });
|
|
145
145
|
if (opts.json || opts.jsonl)
|
|
146
146
|
formatOutput({ deleted: true, key }, opts);
|
|
147
147
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CAwEN"}
|
package/dist/commands/search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { withErrorHandler } from '../lib/errors.js';
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, timeAgo } from '../lib/output.js';
|
|
4
|
-
import {
|
|
4
|
+
import { GlobalSearchDocument } from '../graphql/generated.js';
|
|
5
5
|
export function registerSearchCommands(program, globalOpts) {
|
|
6
6
|
program
|
|
7
7
|
.command('search <query>')
|
|
@@ -15,7 +15,7 @@ export function registerSearchCommands(program, globalOpts) {
|
|
|
15
15
|
const modelKeys = typeof cmdOpts.models === 'string'
|
|
16
16
|
? cmdOpts.models.split(',').map((k) => k.trim())
|
|
17
17
|
: undefined;
|
|
18
|
-
const data = await client.request(
|
|
18
|
+
const data = await client.request(GlobalSearchDocument, {
|
|
19
19
|
query,
|
|
20
20
|
limit: parseInt(String(cmdOpts.limit ?? '20'), 10),
|
|
21
21
|
modelKeys,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/commands/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/commands/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CAuKN"}
|
|
@@ -2,7 +2,7 @@ import { withErrorHandler } from '../lib/errors.js';
|
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, timeAgo, success } from '../lib/output.js';
|
|
4
4
|
import { parseInputData, isUUID, confirmAction } from '../lib/input.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ListSegmentsDocument, GetSegmentDocument, GetSegmentByKeyDocument, CreateSegmentDocument, UpdateSegmentDocument, DeleteSegmentDocument, PreviewSegmentRulesDocument, TestSegmentEvaluationDocument, } from '../graphql/generated.js';
|
|
6
6
|
export function registerSegmentsCommands(program, globalOpts) {
|
|
7
7
|
const segments = program.command('segments').description('Manage segments');
|
|
8
8
|
// list
|
|
@@ -15,7 +15,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
15
15
|
.action(withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
16
16
|
const opts = globalOpts();
|
|
17
17
|
const client = await createClient(opts);
|
|
18
|
-
const data = await client.request(
|
|
18
|
+
const data = await client.request(ListSegmentsDocument, {
|
|
19
19
|
isActive: cmdOpts.active ? true : undefined,
|
|
20
20
|
limit: parseInt(String(cmdOpts.limit ?? '50'), 10),
|
|
21
21
|
offset: parseInt(String(cmdOpts.offset ?? '0'), 10),
|
|
@@ -50,11 +50,11 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
50
50
|
const client = await createClient(opts);
|
|
51
51
|
let result;
|
|
52
52
|
if (isUUID(idOrKey)) {
|
|
53
|
-
const data = await client.request(
|
|
53
|
+
const data = await client.request(GetSegmentDocument, { id: idOrKey });
|
|
54
54
|
result = data.segment;
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
const data = await client.request(
|
|
57
|
+
const data = await client.request(GetSegmentByKeyDocument, { key: idOrKey });
|
|
58
58
|
result = data.segmentByKey;
|
|
59
59
|
}
|
|
60
60
|
if (!result)
|
|
@@ -71,7 +71,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
71
71
|
const opts = globalOpts();
|
|
72
72
|
const client = await createClient(opts);
|
|
73
73
|
const input = await parseInputData(cmdOpts);
|
|
74
|
-
const data = await client.request(
|
|
74
|
+
const data = await client.request(CreateSegmentDocument, { input });
|
|
75
75
|
formatOutput(data.createSegment, opts);
|
|
76
76
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
77
77
|
success(`Created segment ${data.createSegment.key}`);
|
|
@@ -86,7 +86,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
86
86
|
const opts = globalOpts();
|
|
87
87
|
const client = await createClient(opts);
|
|
88
88
|
const input = await parseInputData(cmdOpts);
|
|
89
|
-
const data = await client.request(
|
|
89
|
+
const data = await client.request(UpdateSegmentDocument, { id, input });
|
|
90
90
|
formatOutput(data.updateSegment, opts);
|
|
91
91
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
92
92
|
success(`Updated segment ${id}`);
|
|
@@ -106,7 +106,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
const client = await createClient(opts);
|
|
109
|
-
await client.request(
|
|
109
|
+
await client.request(DeleteSegmentDocument, { id });
|
|
110
110
|
if (opts.json || opts.jsonl)
|
|
111
111
|
formatOutput({ deleted: true, id }, opts);
|
|
112
112
|
else
|
|
@@ -124,7 +124,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
124
124
|
const client = await createClient(opts);
|
|
125
125
|
const inputData = await parseInputData(cmdOpts);
|
|
126
126
|
const rules = inputData.rules ?? inputData;
|
|
127
|
-
const data = await client.request(
|
|
127
|
+
const data = await client.request(PreviewSegmentRulesDocument, {
|
|
128
128
|
rules,
|
|
129
129
|
sampleSize: parseInt(cmdOpts.sampleSize ?? '100', 10),
|
|
130
130
|
});
|
|
@@ -137,7 +137,7 @@ export function registerSegmentsCommands(program, globalOpts) {
|
|
|
137
137
|
.action(withErrorHandler(globalOpts, async (segmentId, customerId) => {
|
|
138
138
|
const opts = globalOpts();
|
|
139
139
|
const client = await createClient(opts);
|
|
140
|
-
const data = await client.request(
|
|
140
|
+
const data = await client.request(TestSegmentEvaluationDocument, { segmentId, customerId });
|
|
141
141
|
formatOutput(data.testSegmentEvaluation, opts);
|
|
142
142
|
}));
|
|
143
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/commands/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA0BtD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/commands/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA0BtD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CAgHN"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { withErrorHandler } from '../lib/errors.js';
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, success } from '../lib/output.js';
|
|
4
|
-
import {
|
|
4
|
+
import { AllSettingsDocument, SettingsByCategoryDocument, GetSettingDocument, SetSettingDocument, DeleteSettingDocument, } from '../graphql/generated.js';
|
|
5
5
|
function inferDataType(value) {
|
|
6
6
|
if (value === 'true' || value === 'false')
|
|
7
7
|
return { dataType: 'BOOLEAN', parsed: value === 'true' };
|
|
@@ -30,11 +30,11 @@ export function registerSettingsCommands(program, globalOpts) {
|
|
|
30
30
|
const client = await createClient(opts);
|
|
31
31
|
let items;
|
|
32
32
|
if (cmdOpts.category) {
|
|
33
|
-
const data = await client.request(
|
|
33
|
+
const data = await client.request(SettingsByCategoryDocument, { category: cmdOpts.category });
|
|
34
34
|
items = data.settingsByCategory;
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
const data = await client.request(
|
|
37
|
+
const data = await client.request(AllSettingsDocument);
|
|
38
38
|
items = data.allSettings;
|
|
39
39
|
}
|
|
40
40
|
formatList(items, opts, {
|
|
@@ -64,7 +64,7 @@ export function registerSettingsCommands(program, globalOpts) {
|
|
|
64
64
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
65
65
|
const opts = globalOpts();
|
|
66
66
|
const client = await createClient(opts);
|
|
67
|
-
const data = await client.request(
|
|
67
|
+
const data = await client.request(GetSettingDocument, { key });
|
|
68
68
|
if (!data.setting)
|
|
69
69
|
throw new Error(`Setting "${key}" not found.`);
|
|
70
70
|
formatOutput(data.setting, opts);
|
|
@@ -79,18 +79,18 @@ export function registerSettingsCommands(program, globalOpts) {
|
|
|
79
79
|
const opts = globalOpts();
|
|
80
80
|
const client = await createClient(opts);
|
|
81
81
|
// Try to fetch existing to get category/dataType
|
|
82
|
-
const existing = await client.request(
|
|
82
|
+
const existing = await client.request(GetSettingDocument, { key });
|
|
83
83
|
const inferred = inferDataType(value);
|
|
84
84
|
const category = cmdOpts.category ?? existing.setting?.category;
|
|
85
85
|
if (!category)
|
|
86
86
|
throw new Error('--category is required for new settings.');
|
|
87
87
|
const dataType = cmdOpts.dataType ?? existing.setting?.dataType ?? inferred.dataType;
|
|
88
|
-
const data = await client.request(
|
|
88
|
+
const data = await client.request(SetSettingDocument, {
|
|
89
89
|
input: {
|
|
90
90
|
key,
|
|
91
91
|
value: inferred.parsed,
|
|
92
92
|
category,
|
|
93
|
-
dataType,
|
|
93
|
+
dataType: dataType,
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
96
|
formatOutput(data.setSetting, opts);
|
|
@@ -104,7 +104,7 @@ export function registerSettingsCommands(program, globalOpts) {
|
|
|
104
104
|
.action(withErrorHandler(globalOpts, async (key) => {
|
|
105
105
|
const opts = globalOpts();
|
|
106
106
|
const client = await createClient(opts);
|
|
107
|
-
await client.request(
|
|
107
|
+
await client.request(DeleteSettingDocument, { key });
|
|
108
108
|
if (opts.json || opts.jsonl)
|
|
109
109
|
formatOutput({ deleted: true, key }, opts);
|
|
110
110
|
else
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant-catalog.d.ts","sourceRoot":"","sources":["../../src/commands/variant-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AActD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"variant-catalog.d.ts","sourceRoot":"","sources":["../../src/commands/variant-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AActD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CAsIN"}
|
|
@@ -2,7 +2,7 @@ import { withErrorHandler } from '../lib/errors.js';
|
|
|
2
2
|
import { createClient } from '../lib/client.js';
|
|
3
3
|
import { formatOutput, formatList, success } from '../lib/output.js';
|
|
4
4
|
import { parseInputData, isUUID, confirmAction } from '../lib/input.js';
|
|
5
|
-
import {
|
|
5
|
+
import { ListVariantCatalogDocument, GetVariantCatalogEntryDocument, GetVariantCatalogEntryByKeyDocument, CreateVariantCatalogEntryDocument, UpdateVariantCatalogEntryDocument, DeleteVariantCatalogEntryDocument, } from '../graphql/generated.js';
|
|
6
6
|
export function registerVariantCatalogCommands(program, globalOpts) {
|
|
7
7
|
const catalog = program
|
|
8
8
|
.command('variant-catalog')
|
|
@@ -16,7 +16,7 @@ export function registerVariantCatalogCommands(program, globalOpts) {
|
|
|
16
16
|
.action(withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
17
17
|
const opts = globalOpts();
|
|
18
18
|
const client = await createClient(opts);
|
|
19
|
-
const data = await client.request(
|
|
19
|
+
const data = await client.request(ListVariantCatalogDocument, {
|
|
20
20
|
isActive: cmdOpts.active ? true : undefined,
|
|
21
21
|
limit: parseInt(String(cmdOpts.limit ?? '50'), 10),
|
|
22
22
|
});
|
|
@@ -48,11 +48,11 @@ export function registerVariantCatalogCommands(program, globalOpts) {
|
|
|
48
48
|
const client = await createClient(opts);
|
|
49
49
|
let result;
|
|
50
50
|
if (isUUID(idOrKey)) {
|
|
51
|
-
const data = await client.request(
|
|
51
|
+
const data = await client.request(GetVariantCatalogEntryDocument, { id: idOrKey });
|
|
52
52
|
result = data.variantCatalogEntry;
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
const data = await client.request(
|
|
55
|
+
const data = await client.request(GetVariantCatalogEntryByKeyDocument, { key: idOrKey });
|
|
56
56
|
result = data.variantCatalogEntryByKey;
|
|
57
57
|
}
|
|
58
58
|
if (!result)
|
|
@@ -69,7 +69,7 @@ export function registerVariantCatalogCommands(program, globalOpts) {
|
|
|
69
69
|
const opts = globalOpts();
|
|
70
70
|
const client = await createClient(opts);
|
|
71
71
|
const input = await parseInputData(cmdOpts);
|
|
72
|
-
const data = await client.request(
|
|
72
|
+
const data = await client.request(CreateVariantCatalogEntryDocument, { input });
|
|
73
73
|
formatOutput(data.createVariantCatalogEntry, opts);
|
|
74
74
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
75
75
|
success(`Created variant catalog entry ${data.createVariantCatalogEntry.key}`);
|
|
@@ -84,7 +84,7 @@ export function registerVariantCatalogCommands(program, globalOpts) {
|
|
|
84
84
|
const opts = globalOpts();
|
|
85
85
|
const client = await createClient(opts);
|
|
86
86
|
const input = await parseInputData(cmdOpts);
|
|
87
|
-
const data = await client.request(
|
|
87
|
+
const data = await client.request(UpdateVariantCatalogEntryDocument, { id, input });
|
|
88
88
|
formatOutput(data.updateVariantCatalogEntry, opts);
|
|
89
89
|
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
90
90
|
success(`Updated variant catalog entry ${data.updateVariantCatalogEntry.key}`);
|
|
@@ -102,7 +102,7 @@ export function registerVariantCatalogCommands(program, globalOpts) {
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
const client = await createClient(opts);
|
|
105
|
-
await client.request(
|
|
105
|
+
await client.request(DeleteVariantCatalogEntryDocument, { id });
|
|
106
106
|
if (opts.json || opts.jsonl)
|
|
107
107
|
formatOutput({ deleted: true, id }, opts);
|
|
108
108
|
else
|
|
@@ -23,7 +23,7 @@ const ALL_DOMAINS = {
|
|
|
23
23
|
operations: true,
|
|
24
24
|
schedules: true,
|
|
25
25
|
sharing: true,
|
|
26
|
-
|
|
26
|
+
embeddings: true,
|
|
27
27
|
analytics: true,
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -99,7 +99,7 @@ export async function loadPullConfig(flags) {
|
|
|
99
99
|
operations: false,
|
|
100
100
|
schedules: false,
|
|
101
101
|
sharing: false,
|
|
102
|
-
|
|
102
|
+
embeddings: false,
|
|
103
103
|
analytics: false,
|
|
104
104
|
};
|
|
105
105
|
}
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE;QACP,kFAAkF;QAClF,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,uFAAuF;QACvF,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,kFAAkF;QAClF,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,oEAAoE;QACpE,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,sEAAsE;QACtE,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,sEAAsE;QACtE,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,oFAAoF;IACpF,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACjC,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE3D"}
|