@eide/foir-cli 0.30.1 → 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 +180 -156
  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,8 +709,8 @@ function createIdentityMethods(client) {
704
709
  search: params.search,
705
710
  status: params.status,
706
711
  role: params.role,
707
- limit: params.limit ?? 50,
708
- offset: params.offset ?? 0
712
+ first: params.first ?? DEFAULT_PAGE_SIZE,
713
+ after: params?.after
709
714
  })
710
715
  );
711
716
  return {
@@ -768,8 +773,8 @@ function createIdentityMethods(client) {
768
773
  create(ListCustomersRequestSchema, {
769
774
  search: params.search,
770
775
  status: params.status,
771
- limit: params.limit ?? 50,
772
- offset: params.offset ?? 0
776
+ first: params.first ?? DEFAULT_PAGE_SIZE,
777
+ after: params?.after
773
778
  })
774
779
  );
775
780
  return {
@@ -812,8 +817,8 @@ function createIdentityMethods(client) {
812
817
  const resp = await client.listTenants(
813
818
  create(ListTenantsRequestSchema, {
814
819
  status: params.status,
815
- limit: params.limit ?? 50,
816
- offset: params.offset ?? 0
820
+ first: params.first ?? DEFAULT_PAGE_SIZE,
821
+ after: params?.after
817
822
  })
818
823
  );
819
824
  return {
@@ -868,8 +873,8 @@ function createIdentityMethods(client) {
868
873
  create(ListProjectsRequestSchema, {
869
874
  tenantId: params.tenantId,
870
875
  status: params.status,
871
- limit: params.limit ?? 50,
872
- offset: params.offset ?? 0
876
+ first: params.first ?? DEFAULT_PAGE_SIZE,
877
+ after: params?.after
873
878
  })
874
879
  );
875
880
  return {
@@ -918,8 +923,8 @@ function createIdentityMethods(client) {
918
923
  create(ListInvitationsRequestSchema, {
919
924
  tenantId: params.tenantId,
920
925
  status: params.status,
921
- limit: params.limit ?? 50,
922
- offset: params.offset ?? 0
926
+ first: params.first ?? DEFAULT_PAGE_SIZE,
927
+ after: params?.after
923
928
  })
924
929
  );
925
930
  return {
@@ -976,8 +981,8 @@ function createIdentityMethods(client) {
976
981
  async listApiKeys(params = {}) {
977
982
  const resp = await client.listApiKeys(
978
983
  create(ListApiKeysRequestSchema, {
979
- limit: params.limit ?? 50,
980
- offset: params.offset ?? 0
984
+ first: params.first ?? DEFAULT_PAGE_SIZE,
985
+ after: params?.after
981
986
  })
982
987
  );
983
988
  return {
@@ -1026,8 +1031,8 @@ function createIdentityMethods(client) {
1026
1031
  const resp = await client.listAuthProviders(
1027
1032
  create(ListAuthProvidersRequestSchema, {
1028
1033
  enabled: params.enabled,
1029
- limit: params.limit ?? 50,
1030
- offset: params.offset ?? 0
1034
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1035
+ after: params?.after
1031
1036
  })
1032
1037
  );
1033
1038
  return {
@@ -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,8 +1392,8 @@ function createModelsMethods(client) {
1377
1392
  search: params.search,
1378
1393
  category: params.category,
1379
1394
  configId: params.configId,
1380
- limit: params.limit ?? 50,
1381
- offset: params.offset ?? 0
1395
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1396
+ after: params?.after
1382
1397
  })
1383
1398
  );
1384
1399
  return {
@@ -1433,8 +1448,8 @@ function createModelsMethods(client) {
1433
1448
  const resp = await client.listModelVersions(
1434
1449
  create3(ListModelVersionsRequestSchema, {
1435
1450
  modelId,
1436
- limit: params.limit ?? 50,
1437
- offset: params.offset ?? 0
1451
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1452
+ after: params?.after
1438
1453
  })
1439
1454
  );
1440
1455
  return {
@@ -1673,8 +1688,8 @@ function createRecordsMethods(client) {
1673
1688
  const resp = await client.listRecordVersions(
1674
1689
  create4(ListRecordVersionsRequestSchema, {
1675
1690
  parentId,
1676
- limit: params?.limit ?? 50,
1677
- offset: params?.offset ?? 0
1691
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1692
+ after: params?.after
1678
1693
  })
1679
1694
  );
1680
1695
  return {
@@ -1718,8 +1733,8 @@ function createRecordsMethods(client) {
1718
1733
  const resp = await client.listRecordVariants(
1719
1734
  create4(ListRecordVariantsRequestSchema, {
1720
1735
  recordId,
1721
- limit: params?.limit ?? 50,
1722
- offset: params?.offset ?? 0
1736
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1737
+ after: params?.after
1723
1738
  })
1724
1739
  );
1725
1740
  return {
@@ -1762,8 +1777,8 @@ function createRecordsMethods(client) {
1762
1777
  nanos: 0
1763
1778
  } : void 0,
1764
1779
  modelKey: params?.modelKey,
1765
- limit: params?.limit ?? 50,
1766
- offset: params?.offset ?? 0
1780
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1781
+ after: params?.after
1767
1782
  })
1768
1783
  );
1769
1784
  return {
@@ -1776,8 +1791,8 @@ function createRecordsMethods(client) {
1776
1791
  create4(ListDraftVersionsRequestSchema, {
1777
1792
  modelKey: params?.modelKey,
1778
1793
  search: params?.search,
1779
- limit: params?.limit ?? 50,
1780
- offset: params?.offset ?? 0
1794
+ first: params?.first ?? DEFAULT_PAGE_SIZE,
1795
+ after: params?.after
1781
1796
  })
1782
1797
  );
1783
1798
  return {
@@ -1801,7 +1816,8 @@ function createRecordsMethods(client) {
1801
1816
  create4(GlobalSearchRequestSchema, {
1802
1817
  query: params.query,
1803
1818
  modelKeys: params.modelKeys ?? [],
1804
- limit: params.limit ?? 20
1819
+ first: params.first ?? 20,
1820
+ after: params?.after
1805
1821
  })
1806
1822
  );
1807
1823
  return {
@@ -1828,7 +1844,8 @@ function createRecordsMethods(client) {
1828
1844
  create4(FindSimilarRecordsRequestSchema, {
1829
1845
  recordId: params.recordId,
1830
1846
  modelKey: params.modelKey,
1831
- limit: params.limit ?? 10
1847
+ first: params.first ?? 10,
1848
+ after: params?.after
1832
1849
  })
1833
1850
  );
1834
1851
  return resp.records ?? [];
@@ -1856,7 +1873,8 @@ function createRecordsMethods(client) {
1856
1873
  create4(SearchEmbeddingsRequestSchema, {
1857
1874
  queryVector: params.queryVector,
1858
1875
  modelKey: params.modelKey,
1859
- limit: params.limit ?? 10
1876
+ first: params.first ?? 10,
1877
+ after: params?.after
1860
1878
  })
1861
1879
  );
1862
1880
  return resp.results ?? [];
@@ -1894,8 +1912,8 @@ function createConfigsMethods(client) {
1894
1912
  category: params.category,
1895
1913
  isActive: params.isActive,
1896
1914
  search: params.search,
1897
- limit: params.limit ?? 50,
1898
- offset: params.offset ?? 0
1915
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1916
+ after: params?.after
1899
1917
  })
1900
1918
  );
1901
1919
  },
@@ -1917,8 +1935,8 @@ function createConfigsMethods(client) {
1917
1935
  create5(ListConfigsRequestSchema, {
1918
1936
  configType: params.configType,
1919
1937
  enabled: params.enabled,
1920
- limit: params.limit ?? 50,
1921
- offset: params.offset ?? 0
1938
+ first: params.first ?? DEFAULT_PAGE_SIZE,
1939
+ after: params?.after
1922
1940
  })
1923
1941
  );
1924
1942
  },
@@ -2055,8 +2073,8 @@ function createSegmentsMethods(client) {
2055
2073
  create6(ListSegmentsRequestSchema, {
2056
2074
  isActive: params.isActive,
2057
2075
  configId: params.configId,
2058
- limit: params.limit ?? 50,
2059
- offset: params.offset ?? 0
2076
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2077
+ after: params?.after
2060
2078
  })
2061
2079
  );
2062
2080
  },
@@ -2224,8 +2242,8 @@ function createSettingsMethods(client) {
2224
2242
  create7(ListMyMentionsRequestSchema, {
2225
2243
  status: params.status ?? [],
2226
2244
  entityType: params.entityType,
2227
- limit: params.limit ?? 50,
2228
- offset: params.offset ?? 0
2245
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2246
+ after: params?.after
2229
2247
  })
2230
2248
  );
2231
2249
  },
@@ -2259,8 +2277,8 @@ function createSettingsMethods(client) {
2259
2277
  create7(ListNotesRequestSchema, {
2260
2278
  entityType: params.entityType,
2261
2279
  entityId: params.entityId,
2262
- limit: params.limit ?? 50,
2263
- offset: params.offset ?? 0
2280
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2281
+ after: params?.after
2264
2282
  })
2265
2283
  );
2266
2284
  },
@@ -2285,8 +2303,8 @@ function createSettingsMethods(client) {
2285
2303
  return client.listContextDimensions(
2286
2304
  create7(ListContextDimensionsRequestSchema, {
2287
2305
  search: params.search,
2288
- limit: params.limit ?? 50,
2289
- offset: params.offset ?? 0
2306
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2307
+ after: params?.after
2290
2308
  })
2291
2309
  );
2292
2310
  },
@@ -2319,8 +2337,8 @@ function createSettingsMethods(client) {
2319
2337
  create7(GetContextDimensionValuesRequestSchema, {
2320
2338
  dimensionKey,
2321
2339
  search: params.search,
2322
- limit: params.limit ?? 50,
2323
- offset: params.offset ?? 0
2340
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2341
+ after: params?.after
2324
2342
  })
2325
2343
  );
2326
2344
  },
@@ -2419,8 +2437,8 @@ function createSettingsMethods(client) {
2419
2437
  return client.listVariantCatalog(
2420
2438
  create7(ListVariantCatalogRequestSchema, {
2421
2439
  isActive: params.isActive,
2422
- limit: params.limit ?? 50,
2423
- offset: params.offset ?? 0
2440
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2441
+ after: params?.after
2424
2442
  })
2425
2443
  );
2426
2444
  },
@@ -2469,8 +2487,8 @@ function createSettingsMethods(client) {
2469
2487
  return client.listLocales(
2470
2488
  create7(ListLocalesRequestSchema, {
2471
2489
  includeInactive: params.includeInactive,
2472
- limit: params.limit ?? 50,
2473
- offset: params.offset ?? 0
2490
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2491
+ after: params?.after
2474
2492
  })
2475
2493
  );
2476
2494
  },
@@ -2549,10 +2567,10 @@ function createSettingsMethods(client) {
2549
2567
  return resp.preferences ?? null;
2550
2568
  },
2551
2569
  // ── Recently Opened ─────────────────────────────────────
2552
- async listRecentlyOpened(limit) {
2570
+ async listRecentlyOpened(first) {
2553
2571
  const resp = await client.listRecentlyOpened(
2554
2572
  create7(ListRecentlyOpenedRequestSchema, {
2555
- limit: limit ?? 20
2573
+ first: first ?? 20
2556
2574
  })
2557
2575
  );
2558
2576
  return resp.items ?? [];
@@ -2632,8 +2650,8 @@ function createStorageMethods(client) {
2632
2650
  mimeType: params.mimeType,
2633
2651
  search: params.search,
2634
2652
  includeDeleted: params.includeDeleted ?? false,
2635
- limit: params.limit ?? 50,
2636
- offset: params.offset ?? 0
2653
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2654
+ after: params?.after
2637
2655
  })
2638
2656
  );
2639
2657
  },
@@ -2695,6 +2713,8 @@ function createStorageMethods(client) {
2695
2713
  );
2696
2714
  return resp.success;
2697
2715
  },
2716
+ // Documented Stage-9 exception: CleanupOrphanedFiles is a write-batch
2717
+ // ceiling, not list pagination, so it keeps `limit` rather than `first`.
2698
2718
  async cleanupOrphanedFiles(params) {
2699
2719
  return client.cleanupOrphanedFiles(
2700
2720
  create8(CleanupOrphanedFilesRequestSchema, {
@@ -2732,8 +2752,8 @@ function createOperationsMethods(client) {
2732
2752
  category: params.category,
2733
2753
  isActive: params.isActive,
2734
2754
  search: params.search,
2735
- limit: params.limit ?? 50,
2736
- offset: params.offset ?? 0
2755
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2756
+ after: params?.after
2737
2757
  })
2738
2758
  );
2739
2759
  },
@@ -2821,8 +2841,8 @@ function createOperationsMethods(client) {
2821
2841
  return client.listDeadLetterEntries(
2822
2842
  create9(ListDeadLetterEntriesRequestSchema, {
2823
2843
  operationKey: params.operationKey,
2824
- limit: params.limit ?? 50,
2825
- offset: params.offset ?? 0
2844
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2845
+ after: params?.after
2826
2846
  })
2827
2847
  );
2828
2848
  },
@@ -2869,8 +2889,8 @@ function createHooksMethods(client) {
2869
2889
  event: params.event,
2870
2890
  isActive: params.isActive,
2871
2891
  configId: params.configId,
2872
- limit: params.limit ?? 50,
2873
- offset: params.offset ?? 0
2892
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2893
+ after: params?.after
2874
2894
  })
2875
2895
  );
2876
2896
  },
@@ -2928,8 +2948,8 @@ function createHooksMethods(client) {
2928
2948
  create10(ListHookDeliveriesRequestSchema, {
2929
2949
  hookId: params.hookId,
2930
2950
  status: params.status,
2931
- limit: params.limit ?? 50,
2932
- offset: params.offset ?? 0
2951
+ first: params.first ?? DEFAULT_PAGE_SIZE,
2952
+ after: params?.after
2933
2953
  })
2934
2954
  );
2935
2955
  },
@@ -2968,8 +2988,8 @@ function createNotificationsMethods(client) {
2968
2988
  return client.listNotifications(
2969
2989
  create11(ListNotificationsRequestSchema, {
2970
2990
  isRead: params.unreadOnly ? false : void 0,
2971
- limit: params.limit ?? 20,
2972
- offset: params.offset ?? 0
2991
+ first: params.first ?? 20,
2992
+ after: params?.after
2973
2993
  })
2974
2994
  );
2975
2995
  },
@@ -3009,8 +3029,8 @@ function createCronSchedulesMethods(client) {
3009
3029
  create12(ListCronSchedulesRequestSchema, {
3010
3030
  configId: params.configId,
3011
3031
  isActive: params.isActive,
3012
- limit: params.limit ?? 50,
3013
- offset: params.offset ?? 0
3032
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3033
+ after: params?.after
3014
3034
  })
3015
3035
  );
3016
3036
  },
@@ -3106,8 +3126,8 @@ function createPublishBatchesMethods(client) {
3106
3126
  const resp = await client.listPublishBatches(
3107
3127
  create13(ListPublishBatchesRequestSchema, {
3108
3128
  status: params.status,
3109
- limit: params.limit ?? 50,
3110
- offset: params.offset ?? 0
3129
+ first: params.first ?? DEFAULT_PAGE_SIZE,
3130
+ after: params?.after
3111
3131
  })
3112
3132
  );
3113
3133
  return { batches: resp.batches ?? [], total: resp.total };
@@ -3251,16 +3271,19 @@ function createSecretsMethods(client) {
3251
3271
  );
3252
3272
  },
3253
3273
  async list(args) {
3254
- const resp = await client.listSecrets(
3274
+ return client.listSecrets(
3255
3275
  create14(ListSecretsRequestSchema, {
3256
3276
  tenantId: args.tenantId,
3257
3277
  projectId: args.projectId,
3258
3278
  ownerKind: args.ownerKind ?? OwnerKind.UNSPECIFIED,
3259
3279
  ownerId: args.ownerId ?? "",
3260
- 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
3261
3285
  })
3262
3286
  );
3263
- return resp.secrets;
3264
3287
  },
3265
3288
  async rotate(ref, plaintext) {
3266
3289
  const resp = await client.rotateSecret(
@@ -3480,7 +3503,7 @@ function registerSelectProjectCommand(program2, globalOpts) {
3480
3503
  tenantId: tenant.id,
3481
3504
  status: 1,
3482
3505
  // PROJECT_STATUS_ACTIVE
3483
- limit: 100
3506
+ first: 100
3484
3507
  });
3485
3508
  for (const p of items) {
3486
3509
  projects.push({ id: p.id, name: p.name, tenantId: p.tenantId });
@@ -3565,7 +3588,7 @@ function registerSelectProjectCommand(program2, globalOpts) {
3565
3588
  );
3566
3589
  }
3567
3590
  async function provisionApiKey(client) {
3568
- const { items: apiKeys } = await client.identity.listApiKeys({ limit: 100 });
3591
+ const { items: apiKeys } = await client.identity.listApiKeys({ first: 100 });
3569
3592
  const existing = apiKeys.find(
3570
3593
  (k) => k.name === CLI_API_KEY_NAME && k.isActive
3571
3594
  );
@@ -3969,7 +3992,7 @@ function registerMediaCommands(program2, globalOpts) {
3969
3992
  }
3970
3993
  )
3971
3994
  );
3972
- media.command("list").description("List files").option("--folder <folder>", "Filter by folder").option("--mime-type <type>", "Filter by MIME type").option("--search <query>", "Search files").option("--include-deleted", "Include soft-deleted files").option("--limit <n>", "Max results", "50").option("--offset <n>", "Offset", "0").action(
3995
+ media.command("list").description("List files").option("--folder <folder>", "Filter by folder").option("--mime-type <type>", "Filter by MIME type").option("--search <query>", "Search files").option("--include-deleted", "Include soft-deleted files").option("--first <n>", "Max results", "50").option("--after <cursor>", "Offset", "0").action(
3973
3996
  withErrorHandler(
3974
3997
  globalOpts,
3975
3998
  async (flags) => {
@@ -3981,8 +4004,8 @@ function registerMediaCommands(program2, globalOpts) {
3981
4004
  mimeType: flags["mime-type"] ?? flags.mimeType,
3982
4005
  search: flags.search,
3983
4006
  includeDeleted: !!flags.includeDeleted,
3984
- limit: Number(flags.limit) || 50,
3985
- offset: Number(flags.offset) || 0
4007
+ first: Number(flags.first) || 50,
4008
+ after: flags.after
3986
4009
  });
3987
4010
  formatListProto(FileSchema, result.items, opts, {
3988
4011
  columns: [
@@ -4678,7 +4701,7 @@ function registerSearchCommands(program2, globalOpts) {
4678
4701
  program2.command("search <query>").description("Search across all records").option(
4679
4702
  "--models <keys>",
4680
4703
  "Filter to specific model keys (comma-separated)"
4681
- ).option("--limit <n>", "Max results", "20").action(
4704
+ ).option("--first <n>", "Max results", "20").action(
4682
4705
  withErrorHandler(
4683
4706
  globalOpts,
4684
4707
  async (query, cmdOpts) => {
@@ -4687,7 +4710,7 @@ function registerSearchCommands(program2, globalOpts) {
4687
4710
  const modelKeys = typeof cmdOpts.models === "string" ? cmdOpts.models.split(",").map((k) => k.trim()) : void 0;
4688
4711
  const result = await client.records.globalSearch({
4689
4712
  query,
4690
- limit: parseInt(String(cmdOpts.limit ?? "20"), 10),
4713
+ first: parseInt(String(cmdOpts.first ?? "20"), 10),
4691
4714
  modelKeys
4692
4715
  });
4693
4716
  if (opts.json || opts.jsonl) {
@@ -4861,7 +4884,7 @@ Edit the file, then run:
4861
4884
  async (opts) => {
4862
4885
  const globalFlags = globalOpts();
4863
4886
  const client = await createPlatformClient(globalFlags);
4864
- const result = await client.models.listModels({ limit: 100 });
4887
+ const result = await client.models.listModels({ first: 100 });
4865
4888
  const models = result.items.map((m) => ({
4866
4889
  key: m.key,
4867
4890
  name: m.name,
@@ -5129,7 +5152,7 @@ async function reconcileConfig(client, configId, manifest, options = {}) {
5129
5152
  return summary;
5130
5153
  }
5131
5154
  async function reconcileModels(client, configId, models, summary, force, allowLookupRebuild, conflictOut) {
5132
- const existing = await client.models.listModels({ limit: 200 });
5155
+ const existing = await client.models.listModels({ first: 200 });
5133
5156
  const allByKey = new Map(
5134
5157
  existing.items.map((m) => [m.key, m])
5135
5158
  );
@@ -5231,7 +5254,7 @@ function resolveEndpoint(endpoint, baseUrl) {
5231
5254
  return baseUrl ? `${baseUrl.replace(/\/+$/, "")}${endpoint.startsWith("/") ? "" : "/"}${endpoint}` : endpoint;
5232
5255
  }
5233
5256
  async function reconcileOperations(client, configId, operations, operationBaseUrl, summary) {
5234
- const existing = await client.operations.listOperations({ configId, limit: 200 });
5257
+ const existing = await client.operations.listOperations({ configId, first: 200 });
5235
5258
  const existingByKey = new Map(
5236
5259
  (existing.operations ?? []).map((o) => [o.key, o])
5237
5260
  );
@@ -5311,7 +5334,7 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
5311
5334
  }
5312
5335
  }
5313
5336
  async function reconcileHooks(client, configId, hooks, summary) {
5314
- const existing = await client.hooks.listHooks({ configId, limit: 200 });
5337
+ const existing = await client.hooks.listHooks({ configId, first: 200 });
5315
5338
  const existingByKey = new Map(
5316
5339
  (existing.hooks ?? []).map((h) => [h.key, h])
5317
5340
  );
@@ -5359,8 +5382,8 @@ async function reconcileHooks(client, configId, hooks, summary) {
5359
5382
  }
5360
5383
  async function reconcileSegments(client, configId, segments, summary) {
5361
5384
  const [scoped, all] = await Promise.all([
5362
- client.segments.listSegments({ configId, limit: 200 }),
5363
- client.segments.listSegments({ limit: 200 })
5385
+ client.segments.listSegments({ configId, first: 200 }),
5386
+ client.segments.listSegments({ first: 200 })
5364
5387
  ]);
5365
5388
  const existingByKey = /* @__PURE__ */ new Map();
5366
5389
  for (const s of all.segments ?? []) {
@@ -5408,7 +5431,7 @@ async function reconcileSegments(client, configId, segments, summary) {
5408
5431
  }
5409
5432
  }
5410
5433
  async function reconcileCronSchedules(client, configId, schedules, summary) {
5411
- const existing = await client.cronSchedules.listCronSchedules({ configId, limit: 200 });
5434
+ const existing = await client.cronSchedules.listCronSchedules({ configId, first: 200 });
5412
5435
  const schedulesList = existing.schedules ?? [];
5413
5436
  const existingByKey = new Map(
5414
5437
  schedulesList.map((s) => [s.key, s])
@@ -5457,7 +5480,7 @@ async function reconcileCronSchedules(client, configId, schedules, summary) {
5457
5480
  }
5458
5481
  }
5459
5482
  async function reconcileAuthProviders(client, providers, summary) {
5460
- const existing = await client.identity.listAuthProviders({ limit: 200 });
5483
+ const existing = await client.identity.listAuthProviders({ first: 200 });
5461
5484
  const existingByKey = new Map(
5462
5485
  existing.items.map((p) => [p.key, p])
5463
5486
  );
@@ -5537,7 +5560,7 @@ async function reconcileDesignTokens(client, manifest, summary, publishAfterAppl
5537
5560
  }
5538
5561
  async function reconcileApiKeys(client, configKey, apiKeys, summary, rotateKeys) {
5539
5562
  if (apiKeys.length === 0) return;
5540
- const existing = await client.identity.listApiKeys({ limit: 200 });
5563
+ const existing = await client.identity.listApiKeys({ first: 200 });
5541
5564
  const existingByName = new Map(
5542
5565
  existing.items.map((k) => [k.name, k])
5543
5566
  );
@@ -5605,8 +5628,8 @@ async function reconcileApps(client, tenantId, projectId, apps, summary, force,
5605
5628
  );
5606
5629
  return;
5607
5630
  }
5608
- const existingList = await client.apps.listApps(tenantId, projectId);
5609
- 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]));
5610
5633
  const plans = [];
5611
5634
  for (const [name, input] of entries) {
5612
5635
  const existing = existingByName.get(name);
@@ -6084,7 +6107,7 @@ function registerPullCommand(program2, globalOpts) {
6084
6107
  const client = await createPlatformClient(globalOpts());
6085
6108
  let configKey = opts.key;
6086
6109
  if (!configKey) {
6087
- const { configs } = await client.configs.listConfigs({ limit: 50 });
6110
+ const { configs } = await client.configs.listConfigs({ first: 50 });
6088
6111
  if (!configs || configs.length === 0) {
6089
6112
  throw new Error(
6090
6113
  "No configs found in this project. Push one first with `foir push`."
@@ -6119,10 +6142,10 @@ function registerPullCommand(program2, globalOpts) {
6119
6142
  if (resolved) {
6120
6143
  const projectId = resolved.project.id;
6121
6144
  const tenantId = resolved.project.tenantId;
6122
- const installedApps = await client.apps.listApps(tenantId, projectId);
6123
- if (installedApps.length > 0) {
6145
+ const installedAppsResp = await client.apps.listApps({ tenantId, projectId });
6146
+ if (installedAppsResp.apps.length > 0) {
6124
6147
  apps = {};
6125
- for (const a of installedApps) {
6148
+ for (const a of installedAppsResp.apps) {
6126
6149
  apps[a.name] = appToInput(a);
6127
6150
  }
6128
6151
  }
@@ -6193,7 +6216,7 @@ export default defineConfig(${jsonContent});
6193
6216
  writeFileSync3(outPath, formatted, "utf-8");
6194
6217
  console.log(chalk7.green(`\u2713 Exported to ${outPath}`));
6195
6218
  try {
6196
- const { items: platformModels } = await client.models.listModels({ limit: 200 });
6219
+ const { items: platformModels } = await client.models.listModels({ first: 200 });
6197
6220
  for (const pm of platformModels) {
6198
6221
  await client.models.updateModel({
6199
6222
  id: pm.id,
@@ -6580,15 +6603,15 @@ import {
6580
6603
  } from "@eide/foir-proto-ts/models/v1/models_pb";
6581
6604
  function registerModelsCommands(program2, globalOpts) {
6582
6605
  const models = program2.command("models").description("Manage models");
6583
- models.command("list").description("List all models").option("--category <cat>", "Filter by category").option("--search <term>", "Search by name").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(
6606
+ models.command("list").description("List all models").option("--category <cat>", "Filter by category").option("--search <term>", "Search by name").option("--first <n>", "Max results", "50").option("--after <cursor>", "Opaque cursor from previous page", "0").action(
6584
6607
  withErrorHandler(globalOpts, async (cmdOpts) => {
6585
6608
  const opts = globalOpts();
6586
6609
  const client = await createPlatformClient(opts);
6587
6610
  const result = await client.models.listModels({
6588
6611
  search: cmdOpts.search,
6589
6612
  category: cmdOpts.category,
6590
- limit: parseInt(cmdOpts.limit ?? "50", 10),
6591
- offset: parseInt(cmdOpts.offset ?? "0", 10)
6613
+ first: parseInt(cmdOpts.first ?? "50", 10),
6614
+ after: cmdOpts.after
6592
6615
  });
6593
6616
  formatListProto(ModelSchema, result.items, opts, {
6594
6617
  columns: [
@@ -6677,7 +6700,7 @@ function registerModelsCommands(program2, globalOpts) {
6677
6700
  }
6678
6701
  )
6679
6702
  );
6680
- models.command("versions <key>").description("List schema versions for a model").option("--limit <n>", "Max results", "20").action(
6703
+ models.command("versions <key>").description("List schema versions for a model").option("--first <n>", "Max results", "20").action(
6681
6704
  withErrorHandler(
6682
6705
  globalOpts,
6683
6706
  async (key, cmdOpts) => {
@@ -6688,7 +6711,7 @@ function registerModelsCommands(program2, globalOpts) {
6688
6711
  throw new Error(`Model "${key}" not found.`);
6689
6712
  }
6690
6713
  const result = await client.models.listModelVersions(existing.id, {
6691
- limit: parseInt(cmdOpts.limit ?? "20", 10)
6714
+ first: parseInt(cmdOpts.first ?? "20", 10)
6692
6715
  });
6693
6716
  formatListProto(ModelVersionSchema, result.items, opts, {
6694
6717
  columns: [
@@ -6889,14 +6912,14 @@ function registerRecordsCommands(program2, globalOpts) {
6889
6912
  }
6890
6913
  )
6891
6914
  );
6892
- records.command("versions <id>").description("List versions for a record").option("--limit <n>", "Max results", "20").action(
6915
+ records.command("versions <id>").description("List versions for a record").option("--first <n>", "Max results", "20").action(
6893
6916
  withErrorHandler(
6894
6917
  globalOpts,
6895
6918
  async (parentId, cmdOpts) => {
6896
6919
  const opts = globalOpts();
6897
6920
  const client = await createPlatformClient(opts);
6898
6921
  const result = await client.records.listRecordVersions(parentId, {
6899
- limit: parseInt(cmdOpts.limit ?? "20", 10)
6922
+ first: parseInt(cmdOpts.first ?? "20", 10)
6900
6923
  });
6901
6924
  formatListProto(RecordSchema, result.items, opts, {
6902
6925
  columns: [
@@ -6986,15 +7009,15 @@ function registerCustomersCommands(program2, globalOpts) {
6986
7009
  customers.command("list").description("List customers").option(
6987
7010
  "--status <status>",
6988
7011
  "Filter by status (ACTIVE, PENDING, SUSPENDED)"
6989
- ).option("--search <term>", "Search by email").option("--limit <n>", "Max results", "20").option("--offset <n>", "Skip results", "0").action(
7012
+ ).option("--search <term>", "Search by email").option("--first <n>", "Max results", "20").option("--after <cursor>", "Opaque cursor from previous page", "0").action(
6990
7013
  withErrorHandler(globalOpts, async (cmdOpts) => {
6991
7014
  const opts = globalOpts();
6992
7015
  const client = await createPlatformClient(opts);
6993
7016
  const result = await client.identity.listCustomers({
6994
7017
  status: cmdOpts.status ? statusMap[cmdOpts.status.toUpperCase()] : void 0,
6995
7018
  search: cmdOpts.search,
6996
- limit: parseInt(cmdOpts.limit ?? "20", 10),
6997
- offset: parseInt(cmdOpts.offset ?? "0", 10)
7019
+ first: parseInt(cmdOpts.first ?? "20", 10),
7020
+ after: cmdOpts.after
6998
7021
  });
6999
7022
  formatListProto(CustomerSchema, result.items, opts, {
7000
7023
  columns: [
@@ -7026,7 +7049,7 @@ function registerCustomersCommands(program2, globalOpts) {
7026
7049
  if (idOrEmail.includes("@")) {
7027
7050
  const list = await client.identity.listCustomers({
7028
7051
  search: idOrEmail,
7029
- limit: 1
7052
+ first: 1
7030
7053
  });
7031
7054
  customer = list.items[0] ?? null;
7032
7055
  } else {
@@ -7179,14 +7202,14 @@ import {
7179
7202
  } from "@eide/foir-proto-ts/operations/v1/operations_pb";
7180
7203
  function registerOperationsCommands(program2, globalOpts) {
7181
7204
  const operations = program2.command("operations").description("Manage operations");
7182
- operations.command("list").description("List operations").option("--category <cat>", "Filter by category").option("--active", "Only active operations").option("--limit <n>", "Max results", "50").action(
7205
+ operations.command("list").description("List operations").option("--category <cat>", "Filter by category").option("--active", "Only active operations").option("--first <n>", "Max results", "50").action(
7183
7206
  withErrorHandler(globalOpts, async (cmdOpts) => {
7184
7207
  const opts = globalOpts();
7185
7208
  const client = await createPlatformClient(opts);
7186
7209
  const data = await client.operations.listOperations({
7187
7210
  category: cmdOpts.category,
7188
7211
  isActive: cmdOpts.active ? true : void 0,
7189
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
7212
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
7190
7213
  });
7191
7214
  formatListProto(OperationSchema, data.operations, opts, {
7192
7215
  columns: [
@@ -7253,13 +7276,13 @@ function registerOperationsCommands(program2, globalOpts) {
7253
7276
  }
7254
7277
  )
7255
7278
  );
7256
- operations.command("dead-letters").description("List failed operations in the dead letter queue").option("--operation <key>", "Filter by operation key").option("--limit <n>", "Max results", "20").action(
7279
+ operations.command("dead-letters").description("List failed operations in the dead letter queue").option("--operation <key>", "Filter by operation key").option("--first <n>", "Max results", "20").action(
7257
7280
  withErrorHandler(globalOpts, async (cmdOpts) => {
7258
7281
  const opts = globalOpts();
7259
7282
  const client = await createPlatformClient(opts);
7260
7283
  const data = await client.operations.listDeadLetterEntries({
7261
7284
  operationKey: cmdOpts.operation,
7262
- limit: parseInt(cmdOpts.limit ?? "20", 10)
7285
+ first: parseInt(cmdOpts.first ?? "20", 10)
7263
7286
  });
7264
7287
  formatListProto(DeadLetterEntrySchema, data.entries, opts, {
7265
7288
  columns: [
@@ -7315,14 +7338,14 @@ import {
7315
7338
  } from "@eide/foir-proto-ts/segments/v1/segments_pb";
7316
7339
  function registerSegmentsCommands(program2, globalOpts) {
7317
7340
  const segments = program2.command("segments").description("Manage segments");
7318
- segments.command("list").description("List segments").option("--active", "Only active segments").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(
7341
+ segments.command("list").description("List segments").option("--active", "Only active segments").option("--first <n>", "Page size", "50").option("--after <cursor>", "Opaque cursor from previous page").action(
7319
7342
  withErrorHandler(globalOpts, async (cmdOpts) => {
7320
7343
  const opts = globalOpts();
7321
7344
  const client = await createPlatformClient(opts);
7322
7345
  const data = await client.segments.listSegments({
7323
7346
  isActive: cmdOpts.active ? true : void 0,
7324
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10),
7325
- offset: parseInt(String(cmdOpts.offset ?? "0"), 10)
7347
+ first: parseInt(String(cmdOpts.first ?? "50"), 10),
7348
+ after: cmdOpts.after
7326
7349
  });
7327
7350
  formatListProto(SegmentSchema, data.segments, opts, {
7328
7351
  columns: [
@@ -7443,13 +7466,13 @@ function registerSegmentsCommands(program2, globalOpts) {
7443
7466
  import { CronScheduleSchema } from "@eide/foir-proto-ts/schedules/v1/schedules_pb";
7444
7467
  function registerSchedulesCommands(program2, globalOpts) {
7445
7468
  const schedules = program2.command("schedules").description("Manage schedules");
7446
- schedules.command("list").description("List schedules").option("--active", "Only active schedules").option("--limit <n>", "Max results", "50").action(
7469
+ schedules.command("list").description("List schedules").option("--active", "Only active schedules").option("--first <n>", "Max results", "50").action(
7447
7470
  withErrorHandler(globalOpts, async (cmdOpts) => {
7448
7471
  const opts = globalOpts();
7449
7472
  const client = await createPlatformClient(opts);
7450
7473
  const data = await client.cronSchedules.listCronSchedules({
7451
7474
  isActive: cmdOpts.active ? true : void 0,
7452
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
7475
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
7453
7476
  });
7454
7477
  formatListProto(CronScheduleSchema, data.schedules, opts, {
7455
7478
  columns: [
@@ -7595,12 +7618,12 @@ import { toJson as toJson4 } from "@bufbuild/protobuf";
7595
7618
  import { ApiKeySchema } from "@eide/foir-proto-ts/identity/v1/identity_pb";
7596
7619
  function registerApiKeysCommands(program2, globalOpts) {
7597
7620
  const apiKeys = program2.command("api-keys").description("Manage API keys");
7598
- apiKeys.command("list").description("List API keys").option("--include-inactive", "Include revoked/inactive keys").option("--search <term>", "Search by name").option("--limit <n>", "Max results", "50").action(
7621
+ apiKeys.command("list").description("List API keys").option("--include-inactive", "Include revoked/inactive keys").option("--search <term>", "Search by name").option("--first <n>", "Max results", "50").action(
7599
7622
  withErrorHandler(globalOpts, async (cmdOpts) => {
7600
7623
  const opts = globalOpts();
7601
7624
  const client = await createPlatformClient(opts);
7602
7625
  const result = await client.identity.listApiKeys({
7603
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
7626
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
7604
7627
  });
7605
7628
  formatListProto(ApiKeySchema, result.items, opts, {
7606
7629
  columns: [
@@ -8019,7 +8042,7 @@ function registerEmbeddingsCommands(program2, globalOpts) {
8019
8042
  );
8020
8043
  embeddings.command("search").description("Search by vector similarity").requiredOption(
8021
8044
  "-d, --data <json>",
8022
- 'Search input as JSON: {"queryVector":[\u2026],"modelKey":"\u2026","limit":10}'
8045
+ 'Search input as JSON: {"queryVector":[\u2026],"modelKey":"\u2026","first":10}'
8023
8046
  ).action(
8024
8047
  withErrorHandler(globalOpts, async (cmdOpts) => {
8025
8048
  const opts = globalOpts();
@@ -8035,7 +8058,7 @@ function registerEmbeddingsCommands(program2, globalOpts) {
8035
8058
  const results = await client.records.searchEmbeddings({
8036
8059
  queryVector: input.queryVector,
8037
8060
  modelKey: input.modelKey,
8038
- limit: input.limit
8061
+ first: input.first
8039
8062
  });
8040
8063
  if (opts.json || opts.jsonl) {
8041
8064
  formatOutput(results, opts);
@@ -8081,7 +8104,7 @@ function registerEmbeddingsCommands(program2, globalOpts) {
8081
8104
  }
8082
8105
  })
8083
8106
  );
8084
- embeddings.command("similar <recordId>").description("Find records similar to the given record").option("--model-key <key>", "Limit matches to a specific model").option("--limit <n>", "Maximum results (default: 10)").action(
8107
+ embeddings.command("similar <recordId>").description("Find records similar to the given record").option("--model-key <key>", "Limit matches to a specific model").option("--first <n>", "Page size").action(
8085
8108
  withErrorHandler(
8086
8109
  globalOpts,
8087
8110
  async (recordId, cmdOpts) => {
@@ -8090,7 +8113,7 @@ function registerEmbeddingsCommands(program2, globalOpts) {
8090
8113
  const results = await client.records.findSimilarRecords({
8091
8114
  recordId,
8092
8115
  modelKey: cmdOpts.modelKey,
8093
- limit: cmdOpts.limit ? parseInt(String(cmdOpts.limit), 10) : void 0
8116
+ first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0
8094
8117
  });
8095
8118
  if (opts.json || opts.jsonl) {
8096
8119
  formatOutput(results, opts);
@@ -8118,7 +8141,7 @@ import {
8118
8141
  } from "@eide/foir-proto-ts/hooks/v1/hooks_pb";
8119
8142
  function registerHooksCommands(program2, globalOpts) {
8120
8143
  const hooks = program2.command("hooks").description("Manage lifecycle hooks (event-driven webhooks)");
8121
- hooks.command("list").description("List hooks").option("--event <event>", "Filter by event name").option("--active", "Show only active hooks").option("--inactive", "Show only inactive hooks").option("--limit <n>", "Maximum results (default: 50)").option("--offset <n>", "Pagination offset").action(
8144
+ hooks.command("list").description("List hooks").option("--event <event>", "Filter by event name").option("--active", "Show only active hooks").option("--inactive", "Show only inactive hooks").option("--first <n>", "Page size").option("--after <cursor>", "Opaque cursor from previous page").action(
8122
8145
  withErrorHandler(globalOpts, async (cmdOpts) => {
8123
8146
  const opts = globalOpts();
8124
8147
  const client = await createPlatformClient(opts);
@@ -8128,8 +8151,8 @@ function registerHooksCommands(program2, globalOpts) {
8128
8151
  const resp = await client.hooks.listHooks({
8129
8152
  event: cmdOpts.event,
8130
8153
  isActive,
8131
- limit: cmdOpts.limit ? parseInt(String(cmdOpts.limit), 10) : void 0,
8132
- offset: cmdOpts.offset ? parseInt(String(cmdOpts.offset), 10) : void 0
8154
+ first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
8155
+ after: cmdOpts.after
8133
8156
  });
8134
8157
  formatListProto(HookSchema, resp.hooks ?? [], opts, {
8135
8158
  columns: [
@@ -8243,7 +8266,7 @@ function registerHooksCommands(program2, globalOpts) {
8243
8266
  }
8244
8267
  )
8245
8268
  );
8246
- hooks.command("deliveries <hookId>").description("List recent deliveries for a hook").option("--status <status>", "Filter by status (success / failed / pending)").option("--limit <n>", "Maximum results (default: 50)").option("--offset <n>", "Pagination offset").action(
8269
+ hooks.command("deliveries <hookId>").description("List recent deliveries for a hook").option("--status <status>", "Filter by status (success / failed / pending)").option("--first <n>", "Page size").option("--after <cursor>", "Opaque cursor from previous page").action(
8247
8270
  withErrorHandler(
8248
8271
  globalOpts,
8249
8272
  async (hookId, cmdOpts) => {
@@ -8252,8 +8275,8 @@ function registerHooksCommands(program2, globalOpts) {
8252
8275
  const resp = await client.hooks.listHookDeliveries({
8253
8276
  hookId,
8254
8277
  status: cmdOpts.status,
8255
- limit: cmdOpts.limit ? parseInt(String(cmdOpts.limit), 10) : void 0,
8256
- offset: cmdOpts.offset ? parseInt(String(cmdOpts.offset), 10) : void 0
8278
+ first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
8279
+ after: cmdOpts.after
8257
8280
  });
8258
8281
  formatListProto(HookDeliverySchema, resp.deliveries ?? [], opts, {
8259
8282
  columns: [
@@ -8326,14 +8349,14 @@ function parseScheduledAt(value) {
8326
8349
  }
8327
8350
  function registerRolloutsCommands(program2, globalOpts) {
8328
8351
  const rollouts = program2.command("rollouts").description("Manage bulk scheduled publishing rollouts");
8329
- rollouts.command("list").description("List rollouts").option("--status <status>", "Filter by status").option("--limit <n>", "Maximum results (default: 50)").option("--offset <n>", "Pagination offset").action(
8352
+ rollouts.command("list").description("List rollouts").option("--status <status>", "Filter by status").option("--first <n>", "Page size").option("--after <cursor>", "Opaque cursor from previous page").action(
8330
8353
  withErrorHandler(globalOpts, async (cmdOpts) => {
8331
8354
  const opts = globalOpts();
8332
8355
  const client = await createPlatformClient(opts);
8333
8356
  const { batches } = await client.publishBatches.listPublishBatches({
8334
8357
  status: cmdOpts.status,
8335
- limit: cmdOpts.limit ? parseInt(String(cmdOpts.limit), 10) : void 0,
8336
- offset: cmdOpts.offset ? parseInt(String(cmdOpts.offset), 10) : void 0
8358
+ first: cmdOpts.first ? parseInt(String(cmdOpts.first), 10) : void 0,
8359
+ after: cmdOpts.after
8337
8360
  });
8338
8361
  formatListProto(PublishBatchSchema, batches, opts, {
8339
8362
  columns: [
@@ -8590,13 +8613,13 @@ function registerRolloutsCommands(program2, globalOpts) {
8590
8613
  import { LocaleSchema } from "@eide/foir-proto-ts/settings/v1/settings_pb";
8591
8614
  function registerLocalesCommands(program2, globalOpts) {
8592
8615
  const locales = program2.command("locales").description("Manage locales");
8593
- locales.command("list").description("List locales").option("--include-inactive", "Include inactive locales").option("--limit <n>", "Max results", "50").action(
8616
+ locales.command("list").description("List locales").option("--include-inactive", "Include inactive locales").option("--first <n>", "Max results", "50").action(
8594
8617
  withErrorHandler(globalOpts, async (cmdOpts) => {
8595
8618
  const opts = globalOpts();
8596
8619
  const client = await createPlatformClient(opts);
8597
8620
  const result = await client.settings.listLocales({
8598
8621
  includeInactive: !!cmdOpts.includeInactive,
8599
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
8622
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
8600
8623
  });
8601
8624
  formatListProto(LocaleSchema, result.locales, opts, {
8602
8625
  columns: [
@@ -8897,13 +8920,13 @@ function registerDesignTokensCommands(program2, globalOpts) {
8897
8920
  import { VariantCatalogEntrySchema } from "@eide/foir-proto-ts/settings/v1/settings_pb";
8898
8921
  function registerVariantCatalogCommands(program2, globalOpts) {
8899
8922
  const catalog = program2.command("variant-catalog").description("Manage variant catalog entries (markets, devices, locales)");
8900
- catalog.command("list").description("List variant catalog entries").option("--active", "Only active entries").option("--limit <n>", "Max results", "50").action(
8923
+ catalog.command("list").description("List variant catalog entries").option("--active", "Only active entries").option("--first <n>", "Max results", "50").action(
8901
8924
  withErrorHandler(globalOpts, async (cmdOpts) => {
8902
8925
  const opts = globalOpts();
8903
8926
  const client = await createPlatformClient(opts);
8904
8927
  const result = await client.settings.listVariantCatalog({
8905
8928
  isActive: cmdOpts.active ? true : void 0,
8906
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
8929
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
8907
8930
  });
8908
8931
  formatListProto(VariantCatalogEntrySchema, result.entries, opts, {
8909
8932
  columns: [
@@ -8933,7 +8956,7 @@ function registerVariantCatalogCommands(program2, globalOpts) {
8933
8956
  if (isUUID(idOrKey)) {
8934
8957
  result = await client.settings.getVariantCatalogEntry(idOrKey);
8935
8958
  } else {
8936
- const list = await client.settings.listVariantCatalog({ limit: 200 });
8959
+ const list = await client.settings.listVariantCatalog({ first: 200 });
8937
8960
  result = list.entries.find(
8938
8961
  (e) => e.key === idOrKey
8939
8962
  ) ?? null;
@@ -9003,7 +9026,7 @@ import {
9003
9026
  } from "@eide/foir-proto-ts/storage/v1/storage_pb";
9004
9027
  function registerFilesCommands(program2, globalOpts) {
9005
9028
  const files = program2.command("files").description("Manage files (for upload, use `foir media upload`)");
9006
- files.command("list").description("List files").option("--folder <folder>", "Filter by folder").option("--mime-type <type>", "Filter by MIME type").option("--search <term>", "Search by filename").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(
9029
+ files.command("list").description("List files").option("--folder <folder>", "Filter by folder").option("--mime-type <type>", "Filter by MIME type").option("--search <term>", "Search by filename").option("--first <n>", "Max results", "50").option("--after <cursor>", "Opaque cursor from previous page", "0").action(
9007
9030
  withErrorHandler(globalOpts, async (cmdOpts) => {
9008
9031
  const opts = globalOpts();
9009
9032
  const client = await createPlatformClient(opts);
@@ -9011,8 +9034,8 @@ function registerFilesCommands(program2, globalOpts) {
9011
9034
  folder: cmdOpts.folder,
9012
9035
  mimeType: cmdOpts.mimeType,
9013
9036
  search: cmdOpts.search,
9014
- limit: parseInt(cmdOpts.limit ?? "50", 10),
9015
- offset: parseInt(cmdOpts.offset ?? "0", 10)
9037
+ first: parseInt(cmdOpts.first ?? "50", 10),
9038
+ after: cmdOpts.after
9016
9039
  });
9017
9040
  formatListProto(FileSchema2, data.items, opts, {
9018
9041
  columns: [
@@ -9125,14 +9148,14 @@ function formatBytes(bytes) {
9125
9148
  import { NoteSchema } from "@eide/foir-proto-ts/settings/v1/settings_pb";
9126
9149
  function registerNotesCommands(program2, globalOpts) {
9127
9150
  const notes = program2.command("notes").description("Manage notes and comments");
9128
- notes.command("list").description("List notes for an entity").requiredOption("--entity-type <type>", "Entity type (e.g. record, model)").requiredOption("--entity-id <id>", "Entity ID").option("--include-resolved", "Include resolved notes").option("--limit <n>", "Max results", "20").action(
9151
+ notes.command("list").description("List notes for an entity").requiredOption("--entity-type <type>", "Entity type (e.g. record, model)").requiredOption("--entity-id <id>", "Entity ID").option("--include-resolved", "Include resolved notes").option("--first <n>", "Max results", "20").action(
9129
9152
  withErrorHandler(globalOpts, async (cmdOpts) => {
9130
9153
  const opts = globalOpts();
9131
9154
  const client = await createPlatformClient(opts);
9132
9155
  const data = await client.settings.listNotes({
9133
9156
  entityType: cmdOpts.entityType,
9134
9157
  entityId: cmdOpts.entityId,
9135
- limit: parseInt(String(cmdOpts.limit ?? "20"), 10)
9158
+ first: parseInt(String(cmdOpts.first ?? "20"), 10)
9136
9159
  });
9137
9160
  formatListProto(NoteSchema, data.notes, opts, {
9138
9161
  columns: [
@@ -9224,13 +9247,13 @@ function registerNotesCommands(program2, globalOpts) {
9224
9247
  import { NotificationSchema } from "@eide/foir-proto-ts/notifications/v1/notifications_pb";
9225
9248
  function registerNotificationsCommands(program2, globalOpts) {
9226
9249
  const notifications = program2.command("notifications").description("Manage notifications");
9227
- notifications.command("list").description("List notifications").option("--unread", "Only unread notifications").option("--limit <n>", "Max results", "20").action(
9250
+ notifications.command("list").description("List notifications").option("--unread", "Only unread notifications").option("--first <n>", "Max results", "20").action(
9228
9251
  withErrorHandler(globalOpts, async (cmdOpts) => {
9229
9252
  const opts = globalOpts();
9230
9253
  const client = await createPlatformClient(opts);
9231
9254
  const data = await client.notifications.listNotifications({
9232
9255
  unreadOnly: !!cmdOpts.unread,
9233
- limit: parseInt(String(cmdOpts.limit ?? "20"), 10)
9256
+ first: parseInt(String(cmdOpts.first ?? "20"), 10)
9234
9257
  });
9235
9258
  if (!(opts.json || opts.jsonl || opts.quiet)) {
9236
9259
  console.log(`Unread: ${data.unreadCount}
@@ -9288,14 +9311,14 @@ function registerNotificationsCommands(program2, globalOpts) {
9288
9311
  import { ConfigSchema } from "@eide/foir-proto-ts/configs/v1/configs_pb";
9289
9312
  function registerConfigsCommands(program2, globalOpts) {
9290
9313
  const configs = program2.command("configs").description("Manage configs (apps, webhooks)");
9291
- configs.command("list").description("List configs").option("--type <type>", "Filter by config type").option("--enabled", "Only enabled configs").option("--limit <n>", "Max results", "50").action(
9314
+ configs.command("list").description("List configs").option("--type <type>", "Filter by config type").option("--enabled", "Only enabled configs").option("--first <n>", "Max results", "50").action(
9292
9315
  withErrorHandler(globalOpts, async (cmdOpts) => {
9293
9316
  const opts = globalOpts();
9294
9317
  const client = await createPlatformClient(opts);
9295
9318
  const data = await client.configs.listConfigs({
9296
9319
  configType: cmdOpts.type,
9297
9320
  enabled: cmdOpts.enabled ? true : void 0,
9298
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10)
9321
+ first: parseInt(String(cmdOpts.first ?? "50"), 10)
9299
9322
  });
9300
9323
  formatListProto(ConfigSchema, data.configs, opts, {
9301
9324
  columns: [
@@ -9524,11 +9547,11 @@ function registerAppsCommands(program2, globalOpts) {
9524
9547
  const opts = globalOpts();
9525
9548
  const resolved = await requireProject(opts);
9526
9549
  const client = await createPlatformClient(opts);
9527
- const apps2 = await client.apps.listApps(
9528
- resolved.project.tenantId,
9529
- resolved.project.id
9530
- );
9531
- 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, {
9532
9555
  columns: [
9533
9556
  { key: "name", header: "Name", width: 24 },
9534
9557
  {
@@ -10015,13 +10038,14 @@ function registerSecretsCommands(program2, globalOpts) {
10015
10038
  const resolved = await requireProject2(opts);
10016
10039
  const client = await createPlatformClient(opts);
10017
10040
  const ownerKind = cmdOpts.app ? OwnerKind.APP : OwnerKind.PROJECT;
10018
- const items = await client.secrets.list({
10041
+ const resp = await client.secrets.list({
10019
10042
  tenantId: resolved.project.tenantId,
10020
10043
  projectId: resolved.project.id,
10021
10044
  ownerKind,
10022
10045
  ownerId: typeof cmdOpts.app === "string" ? cmdOpts.app : "",
10023
10046
  includeSoftDeleted: !!cmdOpts.includeSoftDeleted
10024
10047
  });
10048
+ const items = resp.secrets;
10025
10049
  if (opts.json || opts.jsonl) {
10026
10050
  formatOutput(
10027
10051
  items.map((s) => ({
@@ -10118,7 +10142,7 @@ function registerSecretsCommands(program2, globalOpts) {
10118
10142
  const groups = groupDeclarations(declared.secrets);
10119
10143
  const planEntries = [];
10120
10144
  for (const group of groups) {
10121
- const existing = await client.secrets.list({
10145
+ const existingResp = await client.secrets.list({
10122
10146
  tenantId: resolved.project.tenantId,
10123
10147
  projectId: resolved.project.id,
10124
10148
  ownerKind: group.ownerKind,
@@ -10126,7 +10150,7 @@ function registerSecretsCommands(program2, globalOpts) {
10126
10150
  includeSoftDeleted: false
10127
10151
  });
10128
10152
  const existingByLabel = new Map(
10129
- existing.filter((s) => s.label).map((s) => [s.label, s])
10153
+ existingResp.secrets.filter((s) => s.label).map((s) => [s.label, s])
10130
10154
  );
10131
10155
  for (const decl of group.decls) {
10132
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.30.1",
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.77.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",