@eide/foir-cli 0.31.0 → 0.32.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 -53
  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(
@@ -1377,7 +1392,7 @@ function createModelsMethods(client) {
1377
1392
  search: params.search,
1378
1393
  category: params.category,
1379
1394
  configId: params.configId,
1380
- first: params.first ?? 50,
1395
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1381
1396
  after: params?.after
1382
1397
  })
1383
1398
  );
@@ -1433,7 +1448,7 @@ function createModelsMethods(client) {
1433
1448
  const resp = await client.listModelVersions(
1434
1449
  create3(ListModelVersionsRequestSchema, {
1435
1450
  modelId,
1436
- first: params.first ?? 50,
1451
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1437
1452
  after: params?.after
1438
1453
  })
1439
1454
  );
@@ -1673,7 +1688,7 @@ function createRecordsMethods(client) {
1673
1688
  const resp = await client.listRecordVersions(
1674
1689
  create4(ListRecordVersionsRequestSchema, {
1675
1690
  parentId,
1676
- first: params?.first ?? 50,
1691
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1677
1692
  after: params?.after
1678
1693
  })
1679
1694
  );
@@ -1718,7 +1733,7 @@ function createRecordsMethods(client) {
1718
1733
  const resp = await client.listRecordVariants(
1719
1734
  create4(ListRecordVariantsRequestSchema, {
1720
1735
  recordId,
1721
- first: params?.first ?? 50,
1736
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1722
1737
  after: params?.after
1723
1738
  })
1724
1739
  );
@@ -1762,7 +1777,7 @@ function createRecordsMethods(client) {
1762
1777
  nanos: 0
1763
1778
  } : void 0,
1764
1779
  modelKey: params?.modelKey,
1765
- first: params?.first ?? 50,
1780
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1766
1781
  after: params?.after
1767
1782
  })
1768
1783
  );
@@ -1776,7 +1791,7 @@ function createRecordsMethods(client) {
1776
1791
  create4(ListDraftVersionsRequestSchema, {
1777
1792
  modelKey: params?.modelKey,
1778
1793
  search: params?.search,
1779
- first: params?.first ?? 50,
1794
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1780
1795
  after: params?.after
1781
1796
  })
1782
1797
  );
@@ -1897,7 +1912,7 @@ function createConfigsMethods(client) {
1897
1912
  category: params.category,
1898
1913
  isActive: params.isActive,
1899
1914
  search: params.search,
1900
- first: params.first ?? 50,
1915
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1901
1916
  after: params?.after
1902
1917
  })
1903
1918
  );
@@ -1920,7 +1935,7 @@ function createConfigsMethods(client) {
1920
1935
  create5(ListConfigsRequestSchema, {
1921
1936
  configType: params.configType,
1922
1937
  enabled: params.enabled,
1923
- first: params.first ?? 50,
1938
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1924
1939
  after: params?.after
1925
1940
  })
1926
1941
  );
@@ -2058,7 +2073,7 @@ function createSegmentsMethods(client) {
2058
2073
  create6(ListSegmentsRequestSchema, {
2059
2074
  isActive: params.isActive,
2060
2075
  configId: params.configId,
2061
- first: params.first ?? 50,
2076
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2062
2077
  after: params?.after
2063
2078
  })
2064
2079
  );
@@ -2227,7 +2242,7 @@ function createSettingsMethods(client) {
2227
2242
  create7(ListMyMentionsRequestSchema, {
2228
2243
  status: params.status ?? [],
2229
2244
  entityType: params.entityType,
2230
- first: params.first ?? 50,
2245
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2231
2246
  after: params?.after
2232
2247
  })
2233
2248
  );
@@ -2262,7 +2277,7 @@ function createSettingsMethods(client) {
2262
2277
  create7(ListNotesRequestSchema, {
2263
2278
  entityType: params.entityType,
2264
2279
  entityId: params.entityId,
2265
- first: params.first ?? 50,
2280
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2266
2281
  after: params?.after
2267
2282
  })
2268
2283
  );
@@ -2288,7 +2303,7 @@ function createSettingsMethods(client) {
2288
2303
  return client.listContextDimensions(
2289
2304
  create7(ListContextDimensionsRequestSchema, {
2290
2305
  search: params.search,
2291
- first: params.first ?? 50,
2306
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2292
2307
  after: params?.after
2293
2308
  })
2294
2309
  );
@@ -2322,7 +2337,7 @@ function createSettingsMethods(client) {
2322
2337
  create7(GetContextDimensionValuesRequestSchema, {
2323
2338
  dimensionKey,
2324
2339
  search: params.search,
2325
- first: params.first ?? 50,
2340
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2326
2341
  after: params?.after
2327
2342
  })
2328
2343
  );
@@ -2422,7 +2437,7 @@ function createSettingsMethods(client) {
2422
2437
  return client.listVariantCatalog(
2423
2438
  create7(ListVariantCatalogRequestSchema, {
2424
2439
  isActive: params.isActive,
2425
- first: params.first ?? 50,
2440
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2426
2441
  after: params?.after
2427
2442
  })
2428
2443
  );
@@ -2472,7 +2487,7 @@ function createSettingsMethods(client) {
2472
2487
  return client.listLocales(
2473
2488
  create7(ListLocalesRequestSchema, {
2474
2489
  includeInactive: params.includeInactive,
2475
- first: params.first ?? 50,
2490
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2476
2491
  after: params?.after
2477
2492
  })
2478
2493
  );
@@ -2635,7 +2650,7 @@ function createStorageMethods(client) {
2635
2650
  mimeType: params.mimeType,
2636
2651
  search: params.search,
2637
2652
  includeDeleted: params.includeDeleted ?? false,
2638
- first: params.first ?? 50,
2653
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2639
2654
  after: params?.after
2640
2655
  })
2641
2656
  );
@@ -2737,7 +2752,7 @@ function createOperationsMethods(client) {
2737
2752
  category: params.category,
2738
2753
  isActive: params.isActive,
2739
2754
  search: params.search,
2740
- first: params.first ?? 50,
2755
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2741
2756
  after: params?.after
2742
2757
  })
2743
2758
  );
@@ -2826,7 +2841,7 @@ function createOperationsMethods(client) {
2826
2841
  return client.listDeadLetterEntries(
2827
2842
  create9(ListDeadLetterEntriesRequestSchema, {
2828
2843
  operationKey: params.operationKey,
2829
- first: params.first ?? 50,
2844
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2830
2845
  after: params?.after
2831
2846
  })
2832
2847
  );
@@ -2874,7 +2889,7 @@ function createHooksMethods(client) {
2874
2889
  event: params.event,
2875
2890
  isActive: params.isActive,
2876
2891
  configId: params.configId,
2877
- first: params.first ?? 50,
2892
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2878
2893
  after: params?.after
2879
2894
  })
2880
2895
  );
@@ -2933,7 +2948,7 @@ function createHooksMethods(client) {
2933
2948
  create10(ListHookDeliveriesRequestSchema, {
2934
2949
  hookId: params.hookId,
2935
2950
  status: params.status,
2936
- first: params.first ?? 50,
2951
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2937
2952
  after: params?.after
2938
2953
  })
2939
2954
  );
@@ -3014,7 +3029,7 @@ function createCronSchedulesMethods(client) {
3014
3029
  create12(ListCronSchedulesRequestSchema, {
3015
3030
  configId: params.configId,
3016
3031
  isActive: params.isActive,
3017
- first: params.first ?? 50,
3032
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3018
3033
  after: params?.after
3019
3034
  })
3020
3035
  );
@@ -3111,7 +3126,7 @@ function createPublishBatchesMethods(client) {
3111
3126
  const resp = await client.listPublishBatches(
3112
3127
  create13(ListPublishBatchesRequestSchema, {
3113
3128
  status: params.status,
3114
- first: params.first ?? 50,
3129
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3115
3130
  after: params?.after
3116
3131
  })
3117
3132
  );
@@ -3256,16 +3271,19 @@ function createSecretsMethods(client) {
3256
3271
  );
3257
3272
  },
3258
3273
  async list(args) {
3259
- const resp = await client.listSecrets(
3274
+ return client.listSecrets(
3260
3275
  create14(ListSecretsRequestSchema, {
3261
3276
  tenantId: args.tenantId,
3262
3277
  projectId: args.projectId,
3263
3278
  ownerKind: args.ownerKind ?? OwnerKind.UNSPECIFIED,
3264
3279
  ownerId: args.ownerId ?? "",
3265
- includeSoftDeleted: args.includeSoftDeleted ?? false
3280
+ includeSoftDeleted: args.includeSoftDeleted ?? false,
3281
+ first: args.first ?? DEFAULT_PAGE_SIZE,
3282
+ after: args.after,
3283
+ last: args.last,
3284
+ before: args.before
3266
3285
  })
3267
3286
  );
3268
- return resp.secrets;
3269
3287
  },
3270
3288
  async rotate(ref, plaintext) {
3271
3289
  const resp = await client.rotateSecret(
@@ -5610,8 +5628,8 @@ async function reconcileApps(client, tenantId, projectId, apps, summary, force,
5610
5628
  );
5611
5629
  return;
5612
5630
  }
5613
- const existingList = await client.apps.listApps(tenantId, projectId);
5614
- const existingByName = new Map(existingList.map((a) => [a.name, a]));
5631
+ const existingResp = await client.apps.listApps({ tenantId, projectId });
5632
+ const existingByName = new Map(existingResp.apps.map((a) => [a.name, a]));
5615
5633
  const plans = [];
5616
5634
  for (const [name, input] of entries) {
5617
5635
  const existing = existingByName.get(name);
@@ -6124,10 +6142,10 @@ function registerPullCommand(program2, globalOpts) {
6124
6142
  if (resolved) {
6125
6143
  const projectId = resolved.project.id;
6126
6144
  const tenantId = resolved.project.tenantId;
6127
- const installedApps = await client.apps.listApps(tenantId, projectId);
6128
- if (installedApps.length > 0) {
6145
+ const installedAppsResp = await client.apps.listApps({ tenantId, projectId });
6146
+ if (installedAppsResp.apps.length > 0) {
6129
6147
  apps = {};
6130
- for (const a of installedApps) {
6148
+ for (const a of installedAppsResp.apps) {
6131
6149
  apps[a.name] = appToInput(a);
6132
6150
  }
6133
6151
  }
@@ -9529,11 +9547,11 @@ function registerAppsCommands(program2, globalOpts) {
9529
9547
  const opts = globalOpts();
9530
9548
  const resolved = await requireProject(opts);
9531
9549
  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, {
9550
+ const resp = await client.apps.listApps({
9551
+ tenantId: resolved.project.tenantId,
9552
+ projectId: resolved.project.id
9553
+ });
9554
+ formatListProto(AppSchema, resp.apps, opts, {
9537
9555
  columns: [
9538
9556
  { key: "name", header: "Name", width: 24 },
9539
9557
  {
@@ -10020,13 +10038,14 @@ function registerSecretsCommands(program2, globalOpts) {
10020
10038
  const resolved = await requireProject2(opts);
10021
10039
  const client = await createPlatformClient(opts);
10022
10040
  const ownerKind = cmdOpts.app ? OwnerKind.APP : OwnerKind.PROJECT;
10023
- const items = await client.secrets.list({
10041
+ const resp = await client.secrets.list({
10024
10042
  tenantId: resolved.project.tenantId,
10025
10043
  projectId: resolved.project.id,
10026
10044
  ownerKind,
10027
10045
  ownerId: typeof cmdOpts.app === "string" ? cmdOpts.app : "",
10028
10046
  includeSoftDeleted: !!cmdOpts.includeSoftDeleted
10029
10047
  });
10048
+ const items = resp.secrets;
10030
10049
  if (opts.json || opts.jsonl) {
10031
10050
  formatOutput(
10032
10051
  items.map((s) => ({
@@ -10123,7 +10142,7 @@ function registerSecretsCommands(program2, globalOpts) {
10123
10142
  const groups = groupDeclarations(declared.secrets);
10124
10143
  const planEntries = [];
10125
10144
  for (const group of groups) {
10126
- const existing = await client.secrets.list({
10145
+ const existingResp = await client.secrets.list({
10127
10146
  tenantId: resolved.project.tenantId,
10128
10147
  projectId: resolved.project.id,
10129
10148
  ownerKind: group.ownerKind,
@@ -10131,7 +10150,7 @@ function registerSecretsCommands(program2, globalOpts) {
10131
10150
  includeSoftDeleted: false
10132
10151
  });
10133
10152
  const existingByLabel = new Map(
10134
- existing.filter((s) => s.label).map((s) => [s.label, s])
10153
+ existingResp.secrets.filter((s) => s.label).map((s) => [s.label, s])
10135
10154
  );
10136
10155
  for (const decl of group.decls) {
10137
10156
  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.32.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.79.0",
54
54
  "chalk": "^5.3.0",
55
55
  "commander": "^12.1.0",
56
56
  "dotenv": "^16.4.5",