@eide/foir-cli 0.45.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.
Files changed (2) hide show
  1. package/dist/cli.js +15 -3
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1347,6 +1347,9 @@ function jsFieldToProto(f) {
1347
1347
  label: f.label,
1348
1348
  type: f.type,
1349
1349
  required: f.required,
1350
+ // Declares the field for the typed-filter side table so it can be used
1351
+ // in where/orderBy. Without it the platform rejects sort by this field.
1352
+ queryable: f.queryable,
1350
1353
  helpText: f.helpText,
1351
1354
  placeholder: f.placeholder,
1352
1355
  defaultValue: f.defaultValue !== void 0 ? fromJson(ValueSchema, f.defaultValue) : void 0,
@@ -7222,7 +7225,10 @@ function registerCustomersCommands(program2, globalOpts) {
7222
7225
  }
7223
7226
 
7224
7227
  // src/commands/customer-profiles.ts
7225
- import { CustomerProfileSchemaSchema } from "@eide/foir-proto-ts/settings/v1/settings_pb";
7228
+ import {
7229
+ CustomerProfileSchemaSchema,
7230
+ CustomerProfileLookupAudience
7231
+ } from "@eide/foir-proto-ts/settings/v1/settings_pb";
7226
7232
  function registerCustomerProfilesCommands(program2, globalOpts) {
7227
7233
  const cp = program2.command("customer-profiles").alias("cp").description("Manage customer profile schema and profiles");
7228
7234
  const schema = cp.command("schema").description("Manage the customer profile schema");
@@ -7245,7 +7251,7 @@ function registerCustomerProfilesCommands(program2, globalOpts) {
7245
7251
  })
7246
7252
  );
7247
7253
  schema.command("update").description(
7248
- 'Update the customer profile schema. Accepts a JSON object with "fields" (required) and "publicFields" (optional).'
7254
+ 'Update the customer profile schema. Accepts a JSON object with "fields" (required), "publicFields" (optional), and "lookups" (optional indexed access paths).'
7249
7255
  ).option("-d, --data <json>", "Schema data as JSON").option("-f, --file <path>", "Read data from file").action(
7250
7256
  withErrorHandler(globalOpts, async (cmdOpts) => {
7251
7257
  const opts = globalOpts();
@@ -7256,9 +7262,15 @@ function registerCustomerProfilesCommands(program2, globalOpts) {
7256
7262
  'Input must be an object with a "fields" array. Example: {"fields":[{"key":"name","label":"Name","type":"text"}],"publicFields":["name"]}'
7257
7263
  );
7258
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
+ }));
7259
7270
  const result = await client.settings.updateCustomerProfileSchema({
7260
7271
  fields: inputData.fields,
7261
- publicFields: inputData.publicFields ?? []
7272
+ publicFields: inputData.publicFields ?? [],
7273
+ lookups
7262
7274
  });
7263
7275
  formatOutputProto(CustomerProfileSchemaSchema, result, opts);
7264
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.45.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.101.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",