@eide/foir-cli 0.44.0 → 0.45.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
@@ -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,
@@ -1407,9 +1421,7 @@ function createModelsMethods(client) {
1407
1421
  async listModels(params = {}) {
1408
1422
  const resp = await client.listModels(
1409
1423
  create3(ListModelsRequestSchema, {
1410
- search: params.search,
1411
- category: params.category,
1412
- configId: params.configId,
1424
+ where: buildModelWhere(params),
1413
1425
  first: params.first ?? DEFAULT_PAGE_SIZE,
1414
1426
  after: params?.after
1415
1427
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.44.0",
3
+ "version": "0.45.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",