@eide/foir-cli 0.46.0 → 0.47.0
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/cli.js +12 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -7225,7 +7225,10 @@ function registerCustomersCommands(program2, globalOpts) {
|
|
|
7225
7225
|
}
|
|
7226
7226
|
|
|
7227
7227
|
// src/commands/customer-profiles.ts
|
|
7228
|
-
import {
|
|
7228
|
+
import {
|
|
7229
|
+
CustomerProfileSchemaSchema,
|
|
7230
|
+
CustomerProfileLookupAudience
|
|
7231
|
+
} from "@eide/foir-proto-ts/settings/v1/settings_pb";
|
|
7229
7232
|
function registerCustomerProfilesCommands(program2, globalOpts) {
|
|
7230
7233
|
const cp = program2.command("customer-profiles").alias("cp").description("Manage customer profile schema and profiles");
|
|
7231
7234
|
const schema = cp.command("schema").description("Manage the customer profile schema");
|
|
@@ -7248,7 +7251,7 @@ function registerCustomerProfilesCommands(program2, globalOpts) {
|
|
|
7248
7251
|
})
|
|
7249
7252
|
);
|
|
7250
7253
|
schema.command("update").description(
|
|
7251
|
-
'Update the customer profile schema. Accepts a JSON object with "fields" (required) and "
|
|
7254
|
+
'Update the customer profile schema. Accepts a JSON object with "fields" (required), "publicFields" (optional), and "lookups" (optional indexed access paths).'
|
|
7252
7255
|
).option("-d, --data <json>", "Schema data as JSON").option("-f, --file <path>", "Read data from file").action(
|
|
7253
7256
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
7254
7257
|
const opts = globalOpts();
|
|
@@ -7259,9 +7262,15 @@ function registerCustomerProfilesCommands(program2, globalOpts) {
|
|
|
7259
7262
|
'Input must be an object with a "fields" array. Example: {"fields":[{"key":"name","label":"Name","type":"text"}],"publicFields":["name"]}'
|
|
7260
7263
|
);
|
|
7261
7264
|
}
|
|
7265
|
+
const lookups = (inputData.lookups ?? []).map((l) => ({
|
|
7266
|
+
keyBy: l.keyBy ?? l.key_by ?? [],
|
|
7267
|
+
name: l.name,
|
|
7268
|
+
audience: l.audience === "public" ? CustomerProfileLookupAudience.PUBLIC : CustomerProfileLookupAudience.OPERATOR
|
|
7269
|
+
}));
|
|
7262
7270
|
const result = await client.settings.updateCustomerProfileSchema({
|
|
7263
7271
|
fields: inputData.fields,
|
|
7264
|
-
publicFields: inputData.publicFields ?? []
|
|
7272
|
+
publicFields: inputData.publicFields ?? [],
|
|
7273
|
+
lookups
|
|
7265
7274
|
});
|
|
7266
7275
|
formatOutputProto(CustomerProfileSchemaSchema, result, opts);
|
|
7267
7276
|
if (!(opts.json || opts.jsonl || opts.quiet)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eide/foir-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Universal platform CLI for Foir platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@bufbuild/protovalidate": "^1.1.1",
|
|
51
51
|
"@connectrpc/connect": "^2.0.0",
|
|
52
52
|
"@connectrpc/connect-node": "^2.0.0",
|
|
53
|
-
"@eide/foir-proto-ts": "^0.
|
|
53
|
+
"@eide/foir-proto-ts": "^0.102.0",
|
|
54
54
|
"chalk": "^5.3.0",
|
|
55
55
|
"commander": "^12.1.0",
|
|
56
56
|
"dotenv": "^16.4.5",
|