@eide/foir-cli 0.31.0 → 0.33.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 +72 -54
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -557,6 +557,11 @@ import {
557
557
  ProjectStatus,
558
558
  InvitationStatus
559
559
  } from "@eide/foir-proto-ts/identity/v1/identity_pb";
560
+
561
+ // src/lib/rpc/_pagination.ts
562
+ var DEFAULT_PAGE_SIZE = 50;
563
+
564
+ // src/lib/rpc/identity.ts
560
565
  function createIdentityMethods(client) {
561
566
  return {
562
567
  // ── Auth ──────────────────────────────────────────────
@@ -704,7 +709,7 @@ function createIdentityMethods(client) {
704
709
  search: params.search,
705
710
  status: params.status,
706
711
  role: params.role,
707
- first: params.first ?? 50,
712
+ first: params.first ?? DEFAULT_PAGE_SIZE,
708
713
  after: params?.after
709
714
  })
710
715
  );
@@ -768,7 +773,7 @@ function createIdentityMethods(client) {
768
773
  create(ListCustomersRequestSchema, {
769
774
  search: params.search,
770
775
  status: params.status,
771
- first: params.first ?? 50,
776
+ first: params.first ?? DEFAULT_PAGE_SIZE,
772
777
  after: params?.after
773
778
  })
774
779
  );
@@ -812,7 +817,7 @@ function createIdentityMethods(client) {
812
817
  const resp = await client.listTenants(
813
818
  create(ListTenantsRequestSchema, {
814
819
  status: params.status,
815
- first: params.first ?? 50,
820
+ first: params.first ?? DEFAULT_PAGE_SIZE,
816
821
  after: params?.after
817
822
  })
818
823
  );
@@ -868,7 +873,7 @@ function createIdentityMethods(client) {
868
873
  create(ListProjectsRequestSchema, {
869
874
  tenantId: params.tenantId,
870
875
  status: params.status,
871
- first: params.first ?? 50,
876
+ first: params.first ?? DEFAULT_PAGE_SIZE,
872
877
  after: params?.after
873
878
  })
874
879
  );
@@ -918,7 +923,7 @@ function createIdentityMethods(client) {
918
923
  create(ListInvitationsRequestSchema, {
919
924
  tenantId: params.tenantId,
920
925
  status: params.status,
921
- first: params.first ?? 50,
926
+ first: params.first ?? DEFAULT_PAGE_SIZE,
922
927
  after: params?.after
923
928
  })
924
929
  );
@@ -976,7 +981,7 @@ function createIdentityMethods(client) {
976
981
  async listApiKeys(params = {}) {
977
982
  const resp = await client.listApiKeys(
978
983
  create(ListApiKeysRequestSchema, {
979
- first: params.first ?? 50,
984
+ first: params.first ?? DEFAULT_PAGE_SIZE,
980
985
  after: params?.after
981
986
  })
982
987
  );
@@ -1026,7 +1031,7 @@ function createIdentityMethods(client) {
1026
1031
  const resp = await client.listAuthProviders(
1027
1032
  create(ListAuthProvidersRequestSchema, {
1028
1033
  enabled: params.enabled,
1029
- first: params.first ?? 50,
1034
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1030
1035
  after: params?.after
1031
1036
  })
1032
1037
  );
@@ -1123,11 +1128,15 @@ function createIdentityMethods(client) {
1123
1128
  );
1124
1129
  return resp.user ?? null;
1125
1130
  },
1126
- async listMyOAuthConnections() {
1127
- const resp = await client.listMyOAuthConnections(
1128
- create(ListMyOAuthConnectionsRequestSchema, {})
1131
+ async listMyOAuthConnections(params = {}) {
1132
+ return client.listMyOAuthConnections(
1133
+ create(ListMyOAuthConnectionsRequestSchema, {
1134
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1135
+ after: params.after,
1136
+ last: params.last,
1137
+ before: params.before
1138
+ })
1129
1139
  );
1130
- return resp.connections ?? [];
1131
1140
  },
1132
1141
  async unlinkOAuthProvider(provider) {
1133
1142
  const resp = await client.unlinkOAuthProvider(
@@ -1180,11 +1189,17 @@ import {
1180
1189
  } from "@eide/foir-proto-ts/apps/v1/apps_service_pb";
1181
1190
  function createAppsMethods(client) {
1182
1191
  return {
1183
- async listApps(tenantId, projectId) {
1184
- const resp = await client.listApps(
1185
- create2(ListAppsRequestSchema, { tenantId, projectId })
1192
+ async listApps(params) {
1193
+ return client.listApps(
1194
+ create2(ListAppsRequestSchema, {
1195
+ tenantId: params.tenantId,
1196
+ projectId: params.projectId,
1197
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1198
+ after: params.after,
1199
+ last: params.last,
1200
+ before: params.before
1201
+ })
1186
1202
  );
1187
- return resp.apps;
1188
1203
  },
1189
1204
  async getApp(tenantId, projectId, name) {
1190
1205
  const resp = await client.getApp(
@@ -1329,7 +1344,6 @@ function jsConfigToProto(c) {
1329
1344
  category: c.category,
1330
1345
  icon: c.icon,
1331
1346
  displayField: c.displayField,
1332
- naturalKeyField: c.naturalKeyField,
1333
1347
  systemEntity: c.systemEntity ?? false,
1334
1348
  deletable: c.deletable,
1335
1349
  editable: c.editable,
@@ -1377,7 +1391,7 @@ function createModelsMethods(client) {
1377
1391
  search: params.search,
1378
1392
  category: params.category,
1379
1393
  configId: params.configId,
1380
- first: params.first ?? 50,
1394
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1381
1395
  after: params?.after
1382
1396
  })
1383
1397
  );
@@ -1433,7 +1447,7 @@ function createModelsMethods(client) {
1433
1447
  const resp = await client.listModelVersions(
1434
1448
  create3(ListModelVersionsRequestSchema, {
1435
1449
  modelId,
1436
- first: params.first ?? 50,
1450
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1437
1451
  after: params?.after
1438
1452
  })
1439
1453
  );
@@ -1673,7 +1687,7 @@ function createRecordsMethods(client) {
1673
1687
  const resp = await client.listRecordVersions(
1674
1688
  create4(ListRecordVersionsRequestSchema, {
1675
1689
  parentId,
1676
- first: params?.first ?? 50,
1690
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1677
1691
  after: params?.after
1678
1692
  })
1679
1693
  );
@@ -1718,7 +1732,7 @@ function createRecordsMethods(client) {
1718
1732
  const resp = await client.listRecordVariants(
1719
1733
  create4(ListRecordVariantsRequestSchema, {
1720
1734
  recordId,
1721
- first: params?.first ?? 50,
1735
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1722
1736
  after: params?.after
1723
1737
  })
1724
1738
  );
@@ -1762,7 +1776,7 @@ function createRecordsMethods(client) {
1762
1776
  nanos: 0
1763
1777
  } : void 0,
1764
1778
  modelKey: params?.modelKey,
1765
- first: params?.first ?? 50,
1779
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1766
1780
  after: params?.after
1767
1781
  })
1768
1782
  );
@@ -1776,7 +1790,7 @@ function createRecordsMethods(client) {
1776
1790
  create4(ListDraftVersionsRequestSchema, {
1777
1791
  modelKey: params?.modelKey,
1778
1792
  search: params?.search,
1779
- first: params?.first ?? 50,
1793
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1780
1794
  after: params?.after
1781
1795
  })
1782
1796
  );
@@ -1897,7 +1911,7 @@ function createConfigsMethods(client) {
1897
1911
  category: params.category,
1898
1912
  isActive: params.isActive,
1899
1913
  search: params.search,
1900
- first: params.first ?? 50,
1914
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1901
1915
  after: params?.after
1902
1916
  })
1903
1917
  );
@@ -1920,7 +1934,7 @@ function createConfigsMethods(client) {
1920
1934
  create5(ListConfigsRequestSchema, {
1921
1935
  configType: params.configType,
1922
1936
  enabled: params.enabled,
1923
- first: params.first ?? 50,
1937
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1924
1938
  after: params?.after
1925
1939
  })
1926
1940
  );
@@ -2058,7 +2072,7 @@ function createSegmentsMethods(client) {
2058
2072
  create6(ListSegmentsRequestSchema, {
2059
2073
  isActive: params.isActive,
2060
2074
  configId: params.configId,
2061
- first: params.first ?? 50,
2075
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2062
2076
  after: params?.after
2063
2077
  })
2064
2078
  );
@@ -2227,7 +2241,7 @@ function createSettingsMethods(client) {
2227
2241
  create7(ListMyMentionsRequestSchema, {
2228
2242
  status: params.status ?? [],
2229
2243
  entityType: params.entityType,
2230
- first: params.first ?? 50,
2244
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2231
2245
  after: params?.after
2232
2246
  })
2233
2247
  );
@@ -2262,7 +2276,7 @@ function createSettingsMethods(client) {
2262
2276
  create7(ListNotesRequestSchema, {
2263
2277
  entityType: params.entityType,
2264
2278
  entityId: params.entityId,
2265
- first: params.first ?? 50,
2279
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2266
2280
  after: params?.after
2267
2281
  })
2268
2282
  );
@@ -2288,7 +2302,7 @@ function createSettingsMethods(client) {
2288
2302
  return client.listContextDimensions(
2289
2303
  create7(ListContextDimensionsRequestSchema, {
2290
2304
  search: params.search,
2291
- first: params.first ?? 50,
2305
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2292
2306
  after: params?.after
2293
2307
  })
2294
2308
  );
@@ -2322,7 +2336,7 @@ function createSettingsMethods(client) {
2322
2336
  create7(GetContextDimensionValuesRequestSchema, {
2323
2337
  dimensionKey,
2324
2338
  search: params.search,
2325
- first: params.first ?? 50,
2339
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2326
2340
  after: params?.after
2327
2341
  })
2328
2342
  );
@@ -2422,7 +2436,7 @@ function createSettingsMethods(client) {
2422
2436
  return client.listVariantCatalog(
2423
2437
  create7(ListVariantCatalogRequestSchema, {
2424
2438
  isActive: params.isActive,
2425
- first: params.first ?? 50,
2439
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2426
2440
  after: params?.after
2427
2441
  })
2428
2442
  );
@@ -2472,7 +2486,7 @@ function createSettingsMethods(client) {
2472
2486
  return client.listLocales(
2473
2487
  create7(ListLocalesRequestSchema, {
2474
2488
  includeInactive: params.includeInactive,
2475
- first: params.first ?? 50,
2489
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2476
2490
  after: params?.after
2477
2491
  })
2478
2492
  );
@@ -2635,7 +2649,7 @@ function createStorageMethods(client) {
2635
2649
  mimeType: params.mimeType,
2636
2650
  search: params.search,
2637
2651
  includeDeleted: params.includeDeleted ?? false,
2638
- first: params.first ?? 50,
2652
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2639
2653
  after: params?.after
2640
2654
  })
2641
2655
  );
@@ -2737,7 +2751,7 @@ function createOperationsMethods(client) {
2737
2751
  category: params.category,
2738
2752
  isActive: params.isActive,
2739
2753
  search: params.search,
2740
- first: params.first ?? 50,
2754
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2741
2755
  after: params?.after
2742
2756
  })
2743
2757
  );
@@ -2826,7 +2840,7 @@ function createOperationsMethods(client) {
2826
2840
  return client.listDeadLetterEntries(
2827
2841
  create9(ListDeadLetterEntriesRequestSchema, {
2828
2842
  operationKey: params.operationKey,
2829
- first: params.first ?? 50,
2843
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2830
2844
  after: params?.after
2831
2845
  })
2832
2846
  );
@@ -2874,7 +2888,7 @@ function createHooksMethods(client) {
2874
2888
  event: params.event,
2875
2889
  isActive: params.isActive,
2876
2890
  configId: params.configId,
2877
- first: params.first ?? 50,
2891
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2878
2892
  after: params?.after
2879
2893
  })
2880
2894
  );
@@ -2933,7 +2947,7 @@ function createHooksMethods(client) {
2933
2947
  create10(ListHookDeliveriesRequestSchema, {
2934
2948
  hookId: params.hookId,
2935
2949
  status: params.status,
2936
- first: params.first ?? 50,
2950
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2937
2951
  after: params?.after
2938
2952
  })
2939
2953
  );
@@ -3014,7 +3028,7 @@ function createCronSchedulesMethods(client) {
3014
3028
  create12(ListCronSchedulesRequestSchema, {
3015
3029
  configId: params.configId,
3016
3030
  isActive: params.isActive,
3017
- first: params.first ?? 50,
3031
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3018
3032
  after: params?.after
3019
3033
  })
3020
3034
  );
@@ -3111,7 +3125,7 @@ function createPublishBatchesMethods(client) {
3111
3125
  const resp = await client.listPublishBatches(
3112
3126
  create13(ListPublishBatchesRequestSchema, {
3113
3127
  status: params.status,
3114
- first: params.first ?? 50,
3128
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3115
3129
  after: params?.after
3116
3130
  })
3117
3131
  );
@@ -3256,16 +3270,19 @@ function createSecretsMethods(client) {
3256
3270
  );
3257
3271
  },
3258
3272
  async list(args) {
3259
- const resp = await client.listSecrets(
3273
+ return client.listSecrets(
3260
3274
  create14(ListSecretsRequestSchema, {
3261
3275
  tenantId: args.tenantId,
3262
3276
  projectId: args.projectId,
3263
3277
  ownerKind: args.ownerKind ?? OwnerKind.UNSPECIFIED,
3264
3278
  ownerId: args.ownerId ?? "",
3265
- includeSoftDeleted: args.includeSoftDeleted ?? false
3279
+ includeSoftDeleted: args.includeSoftDeleted ?? false,
3280
+ first: args.first ?? DEFAULT_PAGE_SIZE,
3281
+ after: args.after,
3282
+ last: args.last,
3283
+ before: args.before
3266
3284
  })
3267
3285
  );
3268
- return resp.secrets;
3269
3286
  },
3270
3287
  async rotate(ref, plaintext) {
3271
3288
  const resp = await client.rotateSecret(
@@ -5610,8 +5627,8 @@ async function reconcileApps(client, tenantId, projectId, apps, summary, force,
5610
5627
  );
5611
5628
  return;
5612
5629
  }
5613
- const existingList = await client.apps.listApps(tenantId, projectId);
5614
- const existingByName = new Map(existingList.map((a) => [a.name, a]));
5630
+ const existingResp = await client.apps.listApps({ tenantId, projectId });
5631
+ const existingByName = new Map(existingResp.apps.map((a) => [a.name, a]));
5615
5632
  const plans = [];
5616
5633
  for (const [name, input] of entries) {
5617
5634
  const existing = existingByName.get(name);
@@ -6124,10 +6141,10 @@ function registerPullCommand(program2, globalOpts) {
6124
6141
  if (resolved) {
6125
6142
  const projectId = resolved.project.id;
6126
6143
  const tenantId = resolved.project.tenantId;
6127
- const installedApps = await client.apps.listApps(tenantId, projectId);
6128
- if (installedApps.length > 0) {
6144
+ const installedAppsResp = await client.apps.listApps({ tenantId, projectId });
6145
+ if (installedAppsResp.apps.length > 0) {
6129
6146
  apps = {};
6130
- for (const a of installedApps) {
6147
+ for (const a of installedAppsResp.apps) {
6131
6148
  apps[a.name] = appToInput(a);
6132
6149
  }
6133
6150
  }
@@ -9529,11 +9546,11 @@ function registerAppsCommands(program2, globalOpts) {
9529
9546
  const opts = globalOpts();
9530
9547
  const resolved = await requireProject(opts);
9531
9548
  const client = await createPlatformClient(opts);
9532
- const apps2 = await client.apps.listApps(
9533
- resolved.project.tenantId,
9534
- resolved.project.id
9535
- );
9536
- formatListProto(AppSchema, apps2, opts, {
9549
+ const resp = await client.apps.listApps({
9550
+ tenantId: resolved.project.tenantId,
9551
+ projectId: resolved.project.id
9552
+ });
9553
+ formatListProto(AppSchema, resp.apps, opts, {
9537
9554
  columns: [
9538
9555
  { key: "name", header: "Name", width: 24 },
9539
9556
  {
@@ -10020,13 +10037,14 @@ function registerSecretsCommands(program2, globalOpts) {
10020
10037
  const resolved = await requireProject2(opts);
10021
10038
  const client = await createPlatformClient(opts);
10022
10039
  const ownerKind = cmdOpts.app ? OwnerKind.APP : OwnerKind.PROJECT;
10023
- const items = await client.secrets.list({
10040
+ const resp = await client.secrets.list({
10024
10041
  tenantId: resolved.project.tenantId,
10025
10042
  projectId: resolved.project.id,
10026
10043
  ownerKind,
10027
10044
  ownerId: typeof cmdOpts.app === "string" ? cmdOpts.app : "",
10028
10045
  includeSoftDeleted: !!cmdOpts.includeSoftDeleted
10029
10046
  });
10047
+ const items = resp.secrets;
10030
10048
  if (opts.json || opts.jsonl) {
10031
10049
  formatOutput(
10032
10050
  items.map((s) => ({
@@ -10123,7 +10141,7 @@ function registerSecretsCommands(program2, globalOpts) {
10123
10141
  const groups = groupDeclarations(declared.secrets);
10124
10142
  const planEntries = [];
10125
10143
  for (const group of groups) {
10126
- const existing = await client.secrets.list({
10144
+ const existingResp = await client.secrets.list({
10127
10145
  tenantId: resolved.project.tenantId,
10128
10146
  projectId: resolved.project.id,
10129
10147
  ownerKind: group.ownerKind,
@@ -10131,7 +10149,7 @@ function registerSecretsCommands(program2, globalOpts) {
10131
10149
  includeSoftDeleted: false
10132
10150
  });
10133
10151
  const existingByLabel = new Map(
10134
- existing.filter((s) => s.label).map((s) => [s.label, s])
10152
+ existingResp.secrets.filter((s) => s.label).map((s) => [s.label, s])
10135
10153
  );
10136
10154
  for (const decl of group.decls) {
10137
10155
  const remote = existingByLabel.get(decl.label);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eide/foir-cli",
3
- "version": "0.31.0",
3
+ "version": "0.33.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.78.0",
53
+ "@eide/foir-proto-ts": "^0.82.0",
54
54
  "chalk": "^5.3.0",
55
55
  "commander": "^12.1.0",
56
56
  "dotenv": "^16.4.5",