@eide/foir-cli 0.44.0 → 0.46.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 +18 -3
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1326,6 +1326,20 @@ import {
1326
1326
  RestoreModelVersionRequestSchema,
1327
1327
  PublishModelRequestSchema
1328
1328
  } from "@eide/foir-proto-ts/models/v1/models_pb";
1329
+ function buildModelWhere(p) {
1330
+ const clauses = [];
1331
+ if (p.search) {
1332
+ clauses.push({
1333
+ OR: [{ name: { contains: p.search } }, { key: { contains: p.search } }]
1334
+ });
1335
+ }
1336
+ if (p.category) clauses.push({ category: { eq: p.category } });
1337
+ if (p.configId) clauses.push({ configId: { eq: p.configId } });
1338
+ if (p.inline !== void 0) clauses.push({ inline: { eq: p.inline } });
1339
+ if (clauses.length === 0) return void 0;
1340
+ if (clauses.length === 1) return clauses[0];
1341
+ return { AND: clauses };
1342
+ }
1329
1343
  function jsFieldToProto(f) {
1330
1344
  return create3(ProtoFieldSchema, {
1331
1345
  id: f.id,
@@ -1333,6 +1347,9 @@ function jsFieldToProto(f) {
1333
1347
  label: f.label,
1334
1348
  type: f.type,
1335
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,
1336
1353
  helpText: f.helpText,
1337
1354
  placeholder: f.placeholder,
1338
1355
  defaultValue: f.defaultValue !== void 0 ? fromJson(ValueSchema, f.defaultValue) : void 0,
@@ -1407,9 +1424,7 @@ function createModelsMethods(client) {
1407
1424
  async listModels(params = {}) {
1408
1425
  const resp = await client.listModels(
1409
1426
  create3(ListModelsRequestSchema, {
1410
- search: params.search,
1411
- category: params.category,
1412
- configId: params.configId,
1427
+ where: buildModelWhere(params),
1413
1428
  first: params.first ?? DEFAULT_PAGE_SIZE,
1414
1429
  after: params?.after
1415
1430
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.44.0",
3
+ "version": "0.46.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.100.0",
53
+ "@eide/foir-proto-ts": "^0.101.0",
54
54
  "chalk": "^5.3.0",
55
55
  "commander": "^12.1.0",
56
56
  "dotenv": "^16.4.5",