@eide/foir-cli 0.1.19 → 0.1.21
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/codegen/fetch-models.d.ts.map +1 -1
- package/dist/codegen/fetch-models.js +5 -1
- package/dist/codegen/field-mapping.d.ts.map +1 -1
- package/dist/codegen/field-mapping.js +1 -7
- package/dist/codegen/generators/field-types.js +5 -5
- package/dist/codegen/generators/model-types.js +4 -2
- package/dist/codegen/swift-field-mapping.d.ts.map +1 -1
- package/dist/codegen/swift-field-mapping.js +0 -6
- package/dist/commands/customer-profiles.d.ts.map +1 -1
- package/dist/commands/customer-profiles.js +11 -11
- package/dist/commands/records.d.ts.map +1 -1
- package/dist/commands/records.js +83 -4
- package/dist/graphql/queries.d.ts +6 -2
- package/dist/graphql/queries.d.ts.map +1 -1
- package/dist/graphql/queries.js +34 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-models.d.ts","sourceRoot":"","sources":["../../src/codegen/fetch-models.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,CAAC;YAAE,SA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AAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACvD,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAsCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAyC9E;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC,CAiBzB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EAAE,EACtB,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GACpD,YAAY,EAAE,CAahB"}
|
|
@@ -36,6 +36,10 @@ function normalizeConfig(raw) {
|
|
|
36
36
|
export function normalizeField(raw) {
|
|
37
37
|
const field = raw;
|
|
38
38
|
const options = { ...(field.options ?? {}) };
|
|
39
|
+
// Resolve composite type to its inline schema reference
|
|
40
|
+
const resolvedType = field.type === 'composite' && field.config?.schema
|
|
41
|
+
? field.config.schema
|
|
42
|
+
: field.type;
|
|
39
43
|
// Resolve itemType from all possible locations (first wins)
|
|
40
44
|
if (!options.itemType) {
|
|
41
45
|
const resolved = field.itemType ??
|
|
@@ -54,7 +58,7 @@ export function normalizeField(raw) {
|
|
|
54
58
|
}
|
|
55
59
|
return {
|
|
56
60
|
key: field.key,
|
|
57
|
-
type:
|
|
61
|
+
type: resolvedType,
|
|
58
62
|
label: field.label,
|
|
59
63
|
required: field.required,
|
|
60
64
|
helpText: field.helpText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-mapping.d.ts","sourceRoot":"","sources":["../../src/codegen/field-mapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"field-mapping.d.ts","sourceRoot":"","sources":["../../src/codegen/field-mapping.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,aAoBhC,CAAC;AAEH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAoD1D,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,iBAAiB,EACxB,IAAI,GAAE,QAAQ,GAAG,OAAkB,GAClC,MAAM,CAqCR;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAY3E;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,EAAE,GAC1B,GAAG,CAAC,MAAM,CAAC,CAcb;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA8EjE"}
|
|
@@ -19,7 +19,6 @@ export const PRIMITIVE_FIELD_TYPES = new Set([
|
|
|
19
19
|
'multiselect',
|
|
20
20
|
'json',
|
|
21
21
|
'list',
|
|
22
|
-
'entity-reference',
|
|
23
22
|
'reference',
|
|
24
23
|
'link',
|
|
25
24
|
'flexible',
|
|
@@ -69,11 +68,6 @@ export const FIELD_TYPE_MAPPING = {
|
|
|
69
68
|
inputType: 'FlexibleFieldItem[]',
|
|
70
69
|
needsImport: 'field-types',
|
|
71
70
|
},
|
|
72
|
-
'entity-reference': {
|
|
73
|
-
outputType: 'ReferenceValue',
|
|
74
|
-
inputType: 'ReferenceValue',
|
|
75
|
-
needsImport: 'field-types',
|
|
76
|
-
},
|
|
77
71
|
reference: {
|
|
78
72
|
outputType: 'ReferenceValue',
|
|
79
73
|
inputType: 'ReferenceValue',
|
|
@@ -211,7 +205,7 @@ export function generateFieldDef(field) {
|
|
|
211
205
|
.join(', ');
|
|
212
206
|
parts.push(`options: [${optionsStr}]`);
|
|
213
207
|
}
|
|
214
|
-
if (
|
|
208
|
+
if (field.type === 'reference' &&
|
|
215
209
|
field.options?.referenceTypes) {
|
|
216
210
|
const refTypes = field.options.referenceTypes;
|
|
217
211
|
parts.push(`referenceTypes: [${refTypes.map((t) => `'${t}'`).join(', ')}]`);
|
|
@@ -52,18 +52,18 @@ export interface FileValue {
|
|
|
52
52
|
/** Link value (internal reference or external URL) */
|
|
53
53
|
export interface LinkValue {
|
|
54
54
|
type: 'entity' | 'url';
|
|
55
|
-
entity?:
|
|
55
|
+
entity?: LinkRecordReference;
|
|
56
56
|
url?: string;
|
|
57
57
|
target?: '_self' | '_blank';
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
export interface
|
|
60
|
+
/** Record reference for internal links */
|
|
61
|
+
export interface LinkRecordReference {
|
|
62
62
|
modelKey: string;
|
|
63
63
|
naturalKey: string;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
/**
|
|
66
|
+
/** Record reference value */
|
|
67
67
|
export interface ReferenceValue {
|
|
68
68
|
_type: 'reference';
|
|
69
69
|
_schema: string;
|
|
@@ -299,7 +299,7 @@ export interface LinkFieldDef extends BaseFieldDef {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
export interface ReferenceFieldDef extends BaseFieldDef {
|
|
302
|
-
type: '
|
|
302
|
+
type: 'reference';
|
|
303
303
|
referenceTypes?: string[];
|
|
304
304
|
multiple?: boolean;
|
|
305
305
|
}
|
|
@@ -37,6 +37,8 @@ function buildImportStatements(model, fieldTypeImports, inlineSchemaRefs, allMod
|
|
|
37
37
|
imports.push(`import type { ${types} } from '../field-types.js';`);
|
|
38
38
|
}
|
|
39
39
|
for (const refKey of inlineSchemaRefs) {
|
|
40
|
+
if (refKey === model.key)
|
|
41
|
+
continue; // skip self-reference
|
|
40
42
|
const refModel = allModels.find((m) => m.key === refKey);
|
|
41
43
|
if (refModel) {
|
|
42
44
|
const refTypeName = isInlineOnlyModel(refModel)
|
|
@@ -137,12 +139,12 @@ function getFieldTypeImportsForFields(fields) {
|
|
|
137
139
|
for (const field of fields) {
|
|
138
140
|
const mapping = FIELD_TYPE_MAPPING[field.type];
|
|
139
141
|
if (mapping?.needsImport === 'field-types') {
|
|
140
|
-
imports.add(mapping.outputType);
|
|
142
|
+
imports.add(mapping.outputType.replace(/\[\]$/, ''));
|
|
141
143
|
}
|
|
142
144
|
if (field.type === 'list' && field.options?.itemType) {
|
|
143
145
|
const itemMapping = FIELD_TYPE_MAPPING[field.options.itemType];
|
|
144
146
|
if (itemMapping?.needsImport === 'field-types') {
|
|
145
|
-
imports.add(itemMapping.outputType);
|
|
147
|
+
imports.add(itemMapping.outputType.replace(/\[\]$/, ''));
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swift-field-mapping.d.ts","sourceRoot":"","sources":["../../src/codegen/swift-field-mapping.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,cAAc,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"swift-field-mapping.d.ts","sourceRoot":"","sources":["../../src/codegen/swift-field-mapping.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,cAAc,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAwHrE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACvC,CAeA"}
|
|
@@ -111,12 +111,6 @@ export const SWIFT_FIELD_TYPE_MAPPING = {
|
|
|
111
111
|
defaultValue: '[]',
|
|
112
112
|
castExpression: 'as? [[String: Any]]',
|
|
113
113
|
},
|
|
114
|
-
'entity-reference': {
|
|
115
|
-
type: 'String',
|
|
116
|
-
alwaysOptional: true,
|
|
117
|
-
defaultValue: '""',
|
|
118
|
-
castExpression: 'as? String',
|
|
119
|
-
},
|
|
120
114
|
reference: {
|
|
121
115
|
type: 'String',
|
|
122
116
|
alwaysOptional: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer-profiles.d.ts","sourceRoot":"","sources":["../../src/commands/customer-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAYtD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,
|
|
1
|
+
{"version":3,"file":"customer-profiles.d.ts","sourceRoot":"","sources":["../../src/commands/customer-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAYtD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CAkIN"}
|
|
@@ -34,22 +34,22 @@ export function registerCustomerProfilesCommands(program, globalOpts) {
|
|
|
34
34
|
// schema update
|
|
35
35
|
schema
|
|
36
36
|
.command('update')
|
|
37
|
-
.description('Update the customer profile schema
|
|
38
|
-
.option('-d, --data <json>', '
|
|
39
|
-
.option('-f, --file <path>', 'Read
|
|
37
|
+
.description('Update the customer profile schema. Accepts a JSON object with "fields" (required) and "publicFields" (optional).')
|
|
38
|
+
.option('-d, --data <json>', 'Schema data as JSON')
|
|
39
|
+
.option('-f, --file <path>', 'Read data from file')
|
|
40
40
|
.action(withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
41
41
|
const opts = globalOpts();
|
|
42
42
|
const client = await createClient(opts);
|
|
43
43
|
const inputData = await parseInputData(cmdOpts);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
: (inputData.fields ?? inputData);
|
|
48
|
-
if (!Array.isArray(fields)) {
|
|
49
|
-
throw new Error('Input must be a fields array or an object with a "fields" key. ' +
|
|
50
|
-
'Example: [{"key":"name","label":"Name","type":"text"}]');
|
|
44
|
+
if (!inputData.fields || !Array.isArray(inputData.fields)) {
|
|
45
|
+
throw new Error('Input must be an object with a "fields" array. ' +
|
|
46
|
+
'Example: {"fields":[{"key":"name","label":"Name","type":"text"}],"publicFields":["name"]}');
|
|
51
47
|
}
|
|
52
|
-
const
|
|
48
|
+
const variables = {
|
|
49
|
+
fields: inputData.fields,
|
|
50
|
+
publicFields: inputData.publicFields ?? undefined,
|
|
51
|
+
};
|
|
52
|
+
const data = await client.request(UPDATE_CUSTOMER_PROFILE_SCHEMA, variables);
|
|
53
53
|
formatOutput(data.updateCustomerProfileSchema, opts);
|
|
54
54
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
55
55
|
const version = data.updateCustomerProfileSchema.version;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/commands/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/commands/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA6BtD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,aAAa,GAC9B,IAAI,CA2YN"}
|
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 { RECORDS, RECORD, RECORD_BY_KEY, CREATE_RECORD, UPDATE_RECORD, DELETE_RECORD, PUBLISH_VERSION, UNPUBLISH_RECORD, DUPLICATE_RECORD, RECORD_VERSIONS, RECORD_VARIANTS, } from '../graphql/queries.js';
|
|
5
|
+
import { RECORDS, RECORD, RECORD_RESOLVED, RECORD_BY_KEY, RECORD_BY_KEY_RESOLVED, CREATE_RECORD, UPDATE_RECORD, DELETE_RECORD, PUBLISH_VERSION, UNPUBLISH_RECORD, DUPLICATE_RECORD, CREATE_VERSION, CREATE_VARIANT, RECORD_VERSIONS, RECORD_VARIANTS, } from '../graphql/queries.js';
|
|
6
6
|
export function registerRecordsCommands(program, globalOpts) {
|
|
7
7
|
const records = program.command('records').description('Manage records');
|
|
8
8
|
// list
|
|
@@ -46,16 +46,36 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
46
46
|
records
|
|
47
47
|
.command('get <modelKey> <idOrKey>')
|
|
48
48
|
.description('Get a record by ID or natural key')
|
|
49
|
-
.
|
|
49
|
+
.option('--resolved', 'Include resolved content (published version)')
|
|
50
|
+
.option('--preview', 'Resolve latest draft instead of published version')
|
|
51
|
+
.option('--locale <locale>', 'Locale for field translations')
|
|
52
|
+
.action(withErrorHandler(globalOpts, async (modelKey, idOrKey, cmdOpts) => {
|
|
50
53
|
const opts = globalOpts();
|
|
51
54
|
const client = await createClient(opts);
|
|
52
55
|
let result;
|
|
56
|
+
const useResolved = !!cmdOpts.resolved || !!cmdOpts.preview;
|
|
53
57
|
if (isUUID(idOrKey)) {
|
|
54
|
-
const
|
|
58
|
+
const query = useResolved ? RECORD_RESOLVED : RECORD;
|
|
59
|
+
const variables = { id: idOrKey };
|
|
60
|
+
if (useResolved) {
|
|
61
|
+
if (cmdOpts.locale)
|
|
62
|
+
variables.locale = cmdOpts.locale;
|
|
63
|
+
if (cmdOpts.preview)
|
|
64
|
+
variables.preview = true;
|
|
65
|
+
}
|
|
66
|
+
const data = await client.request(query, variables);
|
|
55
67
|
result = data.record;
|
|
56
68
|
}
|
|
57
69
|
else {
|
|
58
|
-
const
|
|
70
|
+
const query = useResolved ? RECORD_BY_KEY_RESOLVED : RECORD_BY_KEY;
|
|
71
|
+
const variables = { modelKey, naturalKey: idOrKey };
|
|
72
|
+
if (useResolved) {
|
|
73
|
+
if (cmdOpts.locale)
|
|
74
|
+
variables.locale = cmdOpts.locale;
|
|
75
|
+
if (cmdOpts.preview)
|
|
76
|
+
variables.preview = true;
|
|
77
|
+
}
|
|
78
|
+
const data = await client.request(query, variables);
|
|
59
79
|
result = data.recordByKey;
|
|
60
80
|
}
|
|
61
81
|
if (!result) {
|
|
@@ -213,4 +233,63 @@ export function registerRecordsCommands(program, globalOpts) {
|
|
|
213
233
|
],
|
|
214
234
|
});
|
|
215
235
|
}));
|
|
236
|
+
// create-version
|
|
237
|
+
records
|
|
238
|
+
.command('create-version <parentId>')
|
|
239
|
+
.description('Create a new version on a versioned record (or variant). parentId is the record or variant ID.')
|
|
240
|
+
.option('-d, --data <json>', 'Version content as JSON')
|
|
241
|
+
.option('-f, --file <path>', 'Read content from file')
|
|
242
|
+
.option('-m, --message <msg>', 'Change description')
|
|
243
|
+
.option('--source-version <id>', 'Source version ID to base off')
|
|
244
|
+
.action(withErrorHandler(globalOpts, async (parentId, cmdOpts) => {
|
|
245
|
+
const opts = globalOpts();
|
|
246
|
+
const client = await createClient(opts);
|
|
247
|
+
const inputData = await parseInputData(cmdOpts);
|
|
248
|
+
const input = {
|
|
249
|
+
parentId,
|
|
250
|
+
content: inputData,
|
|
251
|
+
};
|
|
252
|
+
if (cmdOpts.message)
|
|
253
|
+
input.changeDescription = cmdOpts.message;
|
|
254
|
+
if (cmdOpts.sourceVersion)
|
|
255
|
+
input.sourceVersionId = cmdOpts.sourceVersion;
|
|
256
|
+
const data = await client.request(CREATE_VERSION, { input });
|
|
257
|
+
formatOutput(data.createVersion, opts);
|
|
258
|
+
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
259
|
+
success(`Created version ${data.createVersion.id}`);
|
|
260
|
+
}
|
|
261
|
+
}));
|
|
262
|
+
// create-variant
|
|
263
|
+
records
|
|
264
|
+
.command('create-variant <recordId>')
|
|
265
|
+
.description('Create a new variant on a record')
|
|
266
|
+
.requiredOption('--key <variantKey>', 'Variant key (e.g. "uk-market")')
|
|
267
|
+
.option('--name <name>', 'Variant display name')
|
|
268
|
+
.option('--description <desc>', 'Variant description')
|
|
269
|
+
.option('--catalog-id <id>', 'Variant catalog entry ID')
|
|
270
|
+
.option('--priority <n>', 'Priority (lower = higher priority)')
|
|
271
|
+
.option('--default', 'Set as default variant')
|
|
272
|
+
.action(withErrorHandler(globalOpts, async (recordId, cmdOpts) => {
|
|
273
|
+
const opts = globalOpts();
|
|
274
|
+
const client = await createClient(opts);
|
|
275
|
+
const input = {
|
|
276
|
+
recordId,
|
|
277
|
+
variantKey: cmdOpts.key,
|
|
278
|
+
};
|
|
279
|
+
if (cmdOpts.name)
|
|
280
|
+
input.name = cmdOpts.name;
|
|
281
|
+
if (cmdOpts.description)
|
|
282
|
+
input.description = cmdOpts.description;
|
|
283
|
+
if (cmdOpts.catalogId)
|
|
284
|
+
input.catalogId = cmdOpts.catalogId;
|
|
285
|
+
if (cmdOpts.priority !== undefined)
|
|
286
|
+
input.priority = parseInt(cmdOpts.priority, 10);
|
|
287
|
+
if (cmdOpts.default)
|
|
288
|
+
input.isDefault = true;
|
|
289
|
+
const data = await client.request(CREATE_VARIANT, { input });
|
|
290
|
+
formatOutput(data.createVariant, opts);
|
|
291
|
+
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
|
292
|
+
success(`Created variant ${data.createVariant.id}`);
|
|
293
|
+
}
|
|
294
|
+
}));
|
|
216
295
|
}
|
|
@@ -10,7 +10,9 @@ export declare const CREATE_AUTH_PROVIDER = "\n mutation($input: CreateAuthProv
|
|
|
10
10
|
export declare const UPDATE_AUTH_PROVIDER = "\n mutation($id: ID!, $input: UpdateAuthProviderInput!) {\n updateCustomerAuthProvider(id: $id, input: $input) {\n id key name type enabled isDefault priority updatedAt\n }\n }\n";
|
|
11
11
|
export declare const DELETE_AUTH_PROVIDER = "\n mutation($id: ID!) { deleteCustomerAuthProvider(id: $id) }\n";
|
|
12
12
|
export declare const RECORD = "\n query($id: ID!) { record(id: $id) { id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy } }\n";
|
|
13
|
+
export declare const RECORD_RESOLVED = "\n query($id: ID!, $locale: String, $preview: Boolean) {\n record(id: $id) {\n id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy\n resolved(locale: $locale, preview: $preview) {\n content\n record { id modelKey naturalKey }\n variant { id variantKey }\n version { id versionNumber publishStatus }\n }\n }\n }\n";
|
|
13
14
|
export declare const RECORD_BY_KEY = "\n query($modelKey: String!, $naturalKey: String!) { recordByKey(modelKey: $modelKey, naturalKey: $naturalKey) { id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy } }\n";
|
|
15
|
+
export declare const RECORD_BY_KEY_RESOLVED = "\n query($modelKey: String!, $naturalKey: String!, $locale: String, $preview: Boolean) {\n recordByKey(modelKey: $modelKey, naturalKey: $naturalKey) {\n id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy\n resolved(locale: $locale, preview: $preview) {\n content\n record { id modelKey naturalKey }\n variant { id variantKey }\n version { id versionNumber publishStatus }\n }\n }\n }\n";
|
|
14
16
|
export declare const RECORDS = "\n query($modelKey: String!, $limit: Int, $offset: Int, $filters: [FilterInput!], $sort: SortInput) {\n records(modelKey: $modelKey, limit: $limit, offset: $offset, filters: $filters, sort: $sort) {\n items { id modelKey naturalKey recordType publishStatus versionNumber customerId createdAt updatedAt }\n total\n }\n }\n";
|
|
15
17
|
export declare const CREATE_RECORD = "\n mutation($input: CreateRecordInput!) { createRecord(input: $input) { record { id modelKey naturalKey recordType data metadata createdAt } variant { id variantKey } version { id versionNumber } } }\n";
|
|
16
18
|
export declare const UPDATE_RECORD = "\n mutation($input: UpdateRecordInput!) { updateRecord(input: $input) { record { id modelKey naturalKey data metadata updatedAt } matched } }\n";
|
|
@@ -18,6 +20,8 @@ export declare const DELETE_RECORD = "\n mutation($id: ID!) { deleteRecord(id:
|
|
|
18
20
|
export declare const PUBLISH_VERSION = "\n mutation($versionId: ID!) { publishVersion(versionId: $versionId) }\n";
|
|
19
21
|
export declare const UNPUBLISH_RECORD = "\n mutation($id: ID!) { unpublishRecord(id: $id) }\n";
|
|
20
22
|
export declare const DUPLICATE_RECORD = "\n mutation($input: DuplicateRecordInput!) { duplicateRecord(input: $input) { record { id modelKey naturalKey } variant { id variantKey } version { id versionNumber } } }\n";
|
|
23
|
+
export declare const CREATE_VERSION = "\n mutation($input: CreateVersionInput!) { createVersion(input: $input) { id modelKey recordType parentId data metadata versionNumber contentHash changeDescription publishStatus createdAt } }\n";
|
|
24
|
+
export declare const CREATE_VARIANT = "\n mutation($input: CreateVariantInput!) { createVariant(input: $input) { id modelKey recordType parentId variantKey variantName isDefault priority createdAt } }\n";
|
|
21
25
|
export declare const RECORD_VERSIONS = "\n query($parentId: ID!, $limit: Int, $offset: Int) { recordVersions(parentId: $parentId, limit: $limit, offset: $offset) { items { id versionNumber publishStatus data contentHash changeDescription createdAt createdBy } } }\n";
|
|
22
26
|
export declare const RECORD_VARIANTS = "\n query($recordId: ID!, $limit: Int, $offset: Int) { recordVariants(recordId: $recordId, limit: $limit, offset: $offset) { items { id variantKey variantName isDefault priority createdAt } } }\n";
|
|
23
27
|
export declare const MODELS_FOR_CODEGEN = "\n query($limit: Int) {\n models(limit: $limit) {\n items { id key name pluralName description category fields config hooks }\n total\n }\n }\n";
|
|
@@ -28,8 +32,8 @@ export declare const UPDATE_MODEL = "\n mutation($input: UpdateModelInput!) { u
|
|
|
28
32
|
export declare const DELETE_MODEL = "\n mutation($id: ID!) { deleteModel(id: $id) }\n";
|
|
29
33
|
export declare const MODEL_VERSIONS = "\n query($modelId: ID!, $limit: Int, $offset: Int) { modelVersions(modelId: $modelId, limit: $limit, offset: $offset) { items { id modelId versionNumber contentHash changeDescription createdAt createdBy } } }\n";
|
|
30
34
|
export declare const GLOBAL_SEARCH = "\n query($query: String!, $limit: Int, $modelKeys: [String!], $includeMedia: Boolean) {\n globalSearch(query: $query, limit: $limit, modelKeys: $modelKeys, includeMedia: $includeMedia) {\n records { id modelKey title naturalKey subtitle modelName updatedAt }\n media { id fileName altText fileUrl }\n }\n }\n";
|
|
31
|
-
export declare const CUSTOMER_PROFILE_SCHEMA = "\n query { customerProfileSchema { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } version createdAt updatedAt updatedBy } }\n";
|
|
32
|
-
export declare const UPDATE_CUSTOMER_PROFILE_SCHEMA = "\n mutation($fields: [FieldDefinitionInput!]!) { updateCustomerProfileSchema(fields: $fields) { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } version createdAt updatedAt } }\n";
|
|
35
|
+
export declare const CUSTOMER_PROFILE_SCHEMA = "\n query { customerProfileSchema { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } publicFields version createdAt updatedAt updatedBy } }\n";
|
|
36
|
+
export declare const UPDATE_CUSTOMER_PROFILE_SCHEMA = "\n 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 } }\n";
|
|
33
37
|
export declare const CUSTOMER_PROFILE = "\n query($customerId: ID!) { customerProfile(customerId: $customerId) { id customerId data schemaVersionNumber createdAt updatedAt createdBy updatedBy } }\n";
|
|
34
38
|
export declare const SET_CUSTOMER_PROFILE = "\n mutation($customerId: ID!, $data: JSON!) { setCustomerProfile(customerId: $customerId, data: $data) { id customerId data schemaVersionNumber createdAt updatedAt } }\n";
|
|
35
39
|
export declare const CUSTOMERS = "\n query($status: CustomerStatus, $search: String, $filters: [FilterInput!], $limit: Int, $offset: Int) {\n customers(status: $status, search: $search, filters: $filters, limit: $limit, offset: $offset) {\n customers { id email status lastLoginAt createdAt updatedAt }\n total\n }\n }\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/graphql/queries.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,8HAE/B,CAAC;AAIF,eAAO,MAAM,aAAa,oVAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,oOAEvB,CAAC;AAEF,eAAO,MAAM,cAAc,2JAE1B,CAAC;AAEF,eAAO,MAAM,cAAc,mH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AAK,+VAOjB,CAAC;AAEF,eAAO,MAAM,IAAI,yKAEhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,uFAE9B,CAAC;AAEF,eAAO,MAAM,WAAW,uRAEvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,qOAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,qDAEvB,CAAC;AAIF,eAAO,MAAM,KAAK,6XAOjB,CAAC;AAEF,eAAO,MAAM,IAAI,qLAEhB,CAAC;AAEF,eAAO,MAAM,WAAW,8HAEvB,CAAC;AAEF,eAAO,MAAM,YAAY,qHAExB,CAAC;AAEF,eAAO,MAAM,WAAW,iEAEvB,CAAC;AAIF,eAAO,MAAM,eAAe,qNAE3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,yIAEjC,CAAC;AAEF,eAAO,MAAM,4BAA4B,qJAExC,CAAC;AAEF,eAAO,MAAM,4BAA4B,iJAExC,CAAC;AAEF,eAAO,MAAM,4BAA4B,oKAExC,CAAC;AAEF,eAAO,MAAM,4BAA4B,oEAExC,CAAC"}
|
package/dist/graphql/queries.js
CHANGED
|
@@ -64,9 +64,35 @@ export const DELETE_AUTH_PROVIDER = `
|
|
|
64
64
|
export const RECORD = `
|
|
65
65
|
query($id: ID!) { record(id: $id) { id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy } }
|
|
66
66
|
`;
|
|
67
|
+
export const RECORD_RESOLVED = `
|
|
68
|
+
query($id: ID!, $locale: String, $preview: Boolean) {
|
|
69
|
+
record(id: $id) {
|
|
70
|
+
id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy
|
|
71
|
+
resolved(locale: $locale, preview: $preview) {
|
|
72
|
+
content
|
|
73
|
+
record { id modelKey naturalKey }
|
|
74
|
+
variant { id variantKey }
|
|
75
|
+
version { id versionNumber publishStatus }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
67
80
|
export const RECORD_BY_KEY = `
|
|
68
81
|
query($modelKey: String!, $naturalKey: String!) { recordByKey(modelKey: $modelKey, naturalKey: $naturalKey) { id modelKey naturalKey recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy } }
|
|
69
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 recordType parentId data metadata currentVersionId publishedVersionId publishedVersionNumber publishedAt publishedBy publishStatus versionNumber customerId createdAt updatedAt createdBy updatedBy
|
|
87
|
+
resolved(locale: $locale, preview: $preview) {
|
|
88
|
+
content
|
|
89
|
+
record { id modelKey naturalKey }
|
|
90
|
+
variant { id variantKey }
|
|
91
|
+
version { id versionNumber publishStatus }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
70
96
|
export const RECORDS = `
|
|
71
97
|
query($modelKey: String!, $limit: Int, $offset: Int, $filters: [FilterInput!], $sort: SortInput) {
|
|
72
98
|
records(modelKey: $modelKey, limit: $limit, offset: $offset, filters: $filters, sort: $sort) {
|
|
@@ -93,6 +119,12 @@ export const UNPUBLISH_RECORD = `
|
|
|
93
119
|
export const DUPLICATE_RECORD = `
|
|
94
120
|
mutation($input: DuplicateRecordInput!) { duplicateRecord(input: $input) { record { id modelKey naturalKey } variant { id variantKey } version { id versionNumber } } }
|
|
95
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
|
+
`;
|
|
96
128
|
export const RECORD_VERSIONS = `
|
|
97
129
|
query($parentId: ID!, $limit: Int, $offset: Int) { recordVersions(parentId: $parentId, limit: $limit, offset: $offset) { items { id versionNumber publishStatus data contentHash changeDescription createdAt createdBy } } }
|
|
98
130
|
`;
|
|
@@ -142,10 +174,10 @@ export const GLOBAL_SEARCH = `
|
|
|
142
174
|
`;
|
|
143
175
|
// --- Customer Profile Schema ---
|
|
144
176
|
export const CUSTOMER_PROFILE_SCHEMA = `
|
|
145
|
-
query { customerProfileSchema { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } version createdAt updatedAt updatedBy } }
|
|
177
|
+
query { customerProfileSchema { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } publicFields version createdAt updatedAt updatedBy } }
|
|
146
178
|
`;
|
|
147
179
|
export const UPDATE_CUSTOMER_PROFILE_SCHEMA = `
|
|
148
|
-
mutation($fields: [FieldDefinitionInput!]!) { updateCustomerProfileSchema(fields: $fields) { id fields { id key label type required helpText placeholder defaultValue config validation { rule value message } isTranslatable } version createdAt updatedAt } }
|
|
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 } }
|
|
149
181
|
`;
|
|
150
182
|
export const CUSTOMER_PROFILE = `
|
|
151
183
|
query($customerId: ID!) { customerProfile(customerId: $customerId) { id customerId data schemaVersionNumber createdAt updatedAt createdBy updatedBy } }
|