@eide/foir-cli 0.10.0 → 0.10.2

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.
package/dist/cli.js CHANGED
@@ -64,6 +64,9 @@ function isTokenExpired(credentials) {
64
64
  return Date.now() > expiresAt.getTime() - bufferMs;
65
65
  }
66
66
  var REPO_ROOT_MARKERS = [
67
+ // `.foir` first so a nested sub-project with its own `.foir/project.json`
68
+ // wins over a parent monorepo's `.git` or `foir.config.ts`.
69
+ ".foir",
67
70
  ".git",
68
71
  "foir.config.ts",
69
72
  ".foirrc.ts",
@@ -468,7 +471,6 @@ import { OperationsService as OperationsService2 } from "@eide/foir-proto-ts/ope
468
471
  import { HooksService as HooksService2 } from "@eide/foir-proto-ts/hooks/v1/hooks_pb";
469
472
  import { NotificationsService as NotificationsService2 } from "@eide/foir-proto-ts/notifications/v1/notifications_pb";
470
473
  import { SchedulesService as SchedulesService2 } from "@eide/foir-proto-ts/schedules/v1/schedules_pb";
471
- import { IntegrationsService as IntegrationsService2 } from "@eide/foir-proto-ts/integrations/v1/integrations_pb";
472
474
  import { AppsService as AppsService2 } from "@eide/foir-proto-ts/apps/v1/apps_service_pb";
473
475
 
474
476
  // src/lib/rpc/identity.ts
@@ -1146,129 +1148,8 @@ function createIdentityMethods(client) {
1146
1148
  };
1147
1149
  }
1148
1150
 
1149
- // src/lib/rpc/integrations.ts
1150
- import { create as create2 } from "@bufbuild/protobuf";
1151
- import {
1152
- ListIntegrationsRequestSchema,
1153
- ListExtensionsRequestSchema,
1154
- CredentialStrategy,
1155
- ExtensionTarget
1156
- } from "@eide/foir-proto-ts/integrations/v1/integrations_pb";
1157
- function createIntegrationsMethods(client) {
1158
- return {
1159
- async listIntegrations(projectId) {
1160
- const resp = await client.listIntegrations(
1161
- create2(ListIntegrationsRequestSchema, { projectId })
1162
- );
1163
- return resp.integrations.map((s) => s.config).filter((c) => c !== void 0);
1164
- },
1165
- async listExtensions(projectId) {
1166
- const resp = await client.listExtensions(
1167
- create2(ListExtensionsRequestSchema, { projectId })
1168
- );
1169
- return resp.extensions;
1170
- }
1171
- };
1172
- }
1173
- var STRATEGY_FROM_PROTO = {
1174
- [CredentialStrategy.UNSPECIFIED]: "none",
1175
- [CredentialStrategy.OAUTH]: "oauth",
1176
- [CredentialStrategy.API_KEY]: "api_key",
1177
- [CredentialStrategy.SHARED_SECRET]: "shared_secret",
1178
- [CredentialStrategy.SSH_KEY]: "ssh_key",
1179
- [CredentialStrategy.NONE]: "none",
1180
- [CredentialStrategy.MANAGED]: "managed"
1181
- };
1182
- var TARGET_FROM_PROTO = {
1183
- [ExtensionTarget.UNSPECIFIED]: "record",
1184
- [ExtensionTarget.RECORD]: "record",
1185
- [ExtensionTarget.MODEL_LIST]: "model-list"
1186
- };
1187
- var STRATEGY_STRING_MAP = {
1188
- CREDENTIAL_STRATEGY_UNSPECIFIED: "none",
1189
- CREDENTIAL_STRATEGY_OAUTH: "oauth",
1190
- CREDENTIAL_STRATEGY_API_KEY: "api_key",
1191
- CREDENTIAL_STRATEGY_SHARED_SECRET: "shared_secret",
1192
- CREDENTIAL_STRATEGY_SSH_KEY: "ssh_key",
1193
- CREDENTIAL_STRATEGY_NONE: "none",
1194
- CREDENTIAL_STRATEGY_MANAGED: "managed"
1195
- };
1196
- function resolveStrategy(raw) {
1197
- if (typeof raw === "number") {
1198
- return STRATEGY_FROM_PROTO[raw] ?? "none";
1199
- }
1200
- if (typeof raw === "string") {
1201
- return STRATEGY_STRING_MAP[raw] ?? raw.toLowerCase().replace("credential_strategy_", "");
1202
- }
1203
- return "none";
1204
- }
1205
- function integrationConfigToInput(cfg) {
1206
- const sync = {};
1207
- for (const [k, v] of Object.entries(cfg.sync)) {
1208
- sync[k] = syncMappingFromProto(v);
1209
- }
1210
- const out = {
1211
- middleware: { url: cfg.middleware?.url ?? "" },
1212
- credentials: {
1213
- strategy: resolveStrategy(cfg.credentials?.strategy)
1214
- },
1215
- sync
1216
- };
1217
- out.enabled = cfg.enabled !== false;
1218
- if (cfg.settings && Object.keys(cfg.settings).length > 0) {
1219
- out.settings = cfg.settings;
1220
- }
1221
- if (cfg.metadata && Object.keys(cfg.metadata).length > 0) {
1222
- out.metadata = cfg.metadata;
1223
- }
1224
- return out;
1225
- }
1226
- function syncMappingFromProto(m) {
1227
- const out = {
1228
- model: m.model,
1229
- naturalKey: m.naturalKey,
1230
- fields: { ...m.fields }
1231
- };
1232
- if (m.modelSeed) {
1233
- const seed = { fields: {} };
1234
- for (const [fk, fv] of Object.entries(m.modelSeed.fields)) {
1235
- seed.fields[fk] = {
1236
- type: fv.type,
1237
- ...fv.required ? { required: true } : {},
1238
- ...fv.naturalKey ? { naturalKey: true } : {},
1239
- ...fv.label ? { label: fv.label } : {},
1240
- ...fv.helpText ? { helpText: fv.helpText } : {},
1241
- ...fv.config && Object.keys(fv.config).length > 0 ? { config: fv.config } : {}
1242
- };
1243
- }
1244
- out.modelSeed = seed;
1245
- }
1246
- return out;
1247
- }
1248
- function extensionConfigToInput(cfg) {
1249
- const out = {
1250
- url: cfg.url,
1251
- placements: cfg.placements.map((p) => {
1252
- const placement = {
1253
- target: TARGET_FROM_PROTO[p.target] ?? "record",
1254
- model: p.model,
1255
- tab: p.tab,
1256
- title: p.title
1257
- };
1258
- if (p.hints && Object.keys(p.hints).length > 0) {
1259
- placement.hints = p.hints;
1260
- }
1261
- return placement;
1262
- })
1263
- };
1264
- if (cfg.metadata && Object.keys(cfg.metadata).length > 0) {
1265
- out.metadata = cfg.metadata;
1266
- }
1267
- return out;
1268
- }
1269
-
1270
1151
  // src/lib/rpc/apps.ts
1271
- import { create as create3 } from "@bufbuild/protobuf";
1152
+ import { create as create2 } from "@bufbuild/protobuf";
1272
1153
  import {
1273
1154
  ListAppsRequestSchema,
1274
1155
  GetAppRequestSchema,
@@ -1285,24 +1166,24 @@ function createAppsMethods(client) {
1285
1166
  return {
1286
1167
  async listApps(tenantId, projectId) {
1287
1168
  const resp = await client.listApps(
1288
- create3(ListAppsRequestSchema, { tenantId, projectId })
1169
+ create2(ListAppsRequestSchema, { tenantId, projectId })
1289
1170
  );
1290
1171
  return resp.apps;
1291
1172
  },
1292
1173
  async getApp(tenantId, projectId, name) {
1293
1174
  const resp = await client.getApp(
1294
- create3(GetAppRequestSchema, { tenantId, projectId, name })
1175
+ create2(GetAppRequestSchema, { tenantId, projectId, name })
1295
1176
  );
1296
1177
  return resp.app ?? null;
1297
1178
  },
1298
1179
  async installApp(tenantId, projectId, manifestUrl) {
1299
1180
  return client.installApp(
1300
- create3(InstallAppRequestSchema, { tenantId, projectId, manifestUrl })
1181
+ create2(InstallAppRequestSchema, { tenantId, projectId, manifestUrl })
1301
1182
  );
1302
1183
  },
1303
1184
  async confirmInstallApp(params) {
1304
1185
  const resp = await client.confirmInstallApp(
1305
- create3(ConfirmInstallAppRequestSchema, {
1186
+ create2(ConfirmInstallAppRequestSchema, {
1306
1187
  installTicket: params.installTicket,
1307
1188
  sourceMappings: params.sourceMappings ?? {},
1308
1189
  sinkMappings: params.sinkMappings ?? {},
@@ -1314,12 +1195,12 @@ function createAppsMethods(client) {
1314
1195
  },
1315
1196
  async updateApp(tenantId, projectId, name) {
1316
1197
  return client.updateApp(
1317
- create3(UpdateAppRequestSchema, { tenantId, projectId, name })
1198
+ create2(UpdateAppRequestSchema, { tenantId, projectId, name })
1318
1199
  );
1319
1200
  },
1320
1201
  async confirmUpdateApp(tenantId, projectId, name, newManifestHash) {
1321
1202
  const resp = await client.confirmUpdateApp(
1322
- create3(ConfirmUpdateAppRequestSchema, {
1203
+ create2(ConfirmUpdateAppRequestSchema, {
1323
1204
  tenantId,
1324
1205
  projectId,
1325
1206
  name,
@@ -1330,12 +1211,12 @@ function createAppsMethods(client) {
1330
1211
  },
1331
1212
  async uninstallApp(tenantId, projectId, name, force = false) {
1332
1213
  return client.uninstallApp(
1333
- create3(UninstallAppRequestSchema, { tenantId, projectId, name, force })
1214
+ create2(UninstallAppRequestSchema, { tenantId, projectId, name, force })
1334
1215
  );
1335
1216
  },
1336
1217
  async setAppMapping(params) {
1337
1218
  const resp = await client.setAppMapping(
1338
- create3(SetAppMappingRequestSchema, {
1219
+ create2(SetAppMappingRequestSchema, {
1339
1220
  tenantId: params.tenantId,
1340
1221
  projectId: params.projectId,
1341
1222
  name: params.name,
@@ -1348,21 +1229,21 @@ function createAppsMethods(client) {
1348
1229
  },
1349
1230
  async validateManifestUrl(manifestUrl) {
1350
1231
  return client.validateManifest(
1351
- create3(ValidateManifestRequestSchema, {
1232
+ create2(ValidateManifestRequestSchema, {
1352
1233
  source: { case: "manifestUrl", value: manifestUrl }
1353
1234
  })
1354
1235
  );
1355
1236
  },
1356
1237
  async validateManifestJson(manifestJson) {
1357
1238
  return client.validateManifest(
1358
- create3(ValidateManifestRequestSchema, {
1239
+ create2(ValidateManifestRequestSchema, {
1359
1240
  source: { case: "manifestJson", value: manifestJson }
1360
1241
  })
1361
1242
  );
1362
1243
  },
1363
1244
  async triggerOperation(tenantId, projectId, operationKey, input) {
1364
1245
  const resp = await client.triggerOperation(
1365
- create3(TriggerOperationRequestSchema, {
1246
+ create2(TriggerOperationRequestSchema, {
1366
1247
  tenantId,
1367
1248
  projectId,
1368
1249
  operationKey,
@@ -1375,7 +1256,7 @@ function createAppsMethods(client) {
1375
1256
  }
1376
1257
 
1377
1258
  // src/lib/rpc/models.ts
1378
- import { create as create4, fromJson } from "@bufbuild/protobuf";
1259
+ import { create as create3, fromJson } from "@bufbuild/protobuf";
1379
1260
  import { ValueSchema } from "@bufbuild/protobuf/wkt";
1380
1261
  import {
1381
1262
  FieldSchema as ProtoFieldSchema,
@@ -1392,7 +1273,7 @@ import {
1392
1273
  RestoreModelVersionRequestSchema
1393
1274
  } from "@eide/foir-proto-ts/models/v1/models_pb";
1394
1275
  function jsFieldToProto(f) {
1395
- return create4(ProtoFieldSchema, {
1276
+ return create3(ProtoFieldSchema, {
1396
1277
  id: f.id,
1397
1278
  key: f.key,
1398
1279
  label: f.label,
@@ -1409,13 +1290,13 @@ function jsFieldToProto(f) {
1409
1290
  });
1410
1291
  }
1411
1292
  function jsConfigToProto(c) {
1412
- return create4(ProtoModelConfigSchema, {
1293
+ return create3(ProtoModelConfigSchema, {
1413
1294
  versioning: c.versioning ?? false,
1414
1295
  publishing: c.publishing ?? false,
1415
1296
  variants: c.variants ?? false,
1416
1297
  inline: c.inline ?? false,
1417
1298
  customerScoped: c.customerScoped ?? false,
1418
- sharing: c.sharing ? create4(ProtoSharingConfigSchema, {
1299
+ sharing: c.sharing ? create3(ProtoSharingConfigSchema, {
1419
1300
  enabled: c.sharing.enabled,
1420
1301
  requireAcceptance: c.sharing.requireAcceptance
1421
1302
  }) : void 0,
@@ -1434,18 +1315,18 @@ function createModelsMethods(client) {
1434
1315
  return {
1435
1316
  // ── Queries ──────────────────────────────────────────────
1436
1317
  async getModel(id) {
1437
- const resp = await client.getModel(create4(GetModelRequestSchema, { id }));
1318
+ const resp = await client.getModel(create3(GetModelRequestSchema, { id }));
1438
1319
  return resp.model ?? null;
1439
1320
  },
1440
1321
  async getModelByKey(key) {
1441
1322
  const resp = await client.getModelByKey(
1442
- create4(GetModelByKeyRequestSchema, { key })
1323
+ create3(GetModelByKeyRequestSchema, { key })
1443
1324
  );
1444
1325
  return resp.model ?? null;
1445
1326
  },
1446
1327
  async listModels(params = {}) {
1447
1328
  const resp = await client.listModels(
1448
- create4(ListModelsRequestSchema, {
1329
+ create3(ListModelsRequestSchema, {
1449
1330
  search: params.search,
1450
1331
  category: params.category,
1451
1332
  configId: params.configId,
@@ -1461,7 +1342,7 @@ function createModelsMethods(client) {
1461
1342
  // ── Mutations ────────────────────────────────────────────
1462
1343
  async createModel(params) {
1463
1344
  const resp = await client.createModel(
1464
- create4(CreateModelRequestSchema, {
1345
+ create3(CreateModelRequestSchema, {
1465
1346
  key: params.key,
1466
1347
  name: params.name,
1467
1348
  fields: params.fields.map(jsFieldToProto),
@@ -1473,7 +1354,7 @@ function createModelsMethods(client) {
1473
1354
  },
1474
1355
  async updateModel(params) {
1475
1356
  const resp = await client.updateModel(
1476
- create4(UpdateModelRequestSchema, {
1357
+ create3(UpdateModelRequestSchema, {
1477
1358
  id: params.id,
1478
1359
  name: params.name,
1479
1360
  updateFields: params.fields != null,
@@ -1486,20 +1367,20 @@ function createModelsMethods(client) {
1486
1367
  },
1487
1368
  async deleteModel(id) {
1488
1369
  const resp = await client.deleteModel(
1489
- create4(DeleteModelRequestSchema, { id })
1370
+ create3(DeleteModelRequestSchema, { id })
1490
1371
  );
1491
1372
  return resp.success;
1492
1373
  },
1493
1374
  async duplicateModel(params) {
1494
1375
  const resp = await client.duplicateModel(
1495
- create4(DuplicateModelRequestSchema, params)
1376
+ create3(DuplicateModelRequestSchema, params)
1496
1377
  );
1497
1378
  return resp.model ?? null;
1498
1379
  },
1499
1380
  // ── Versioning ───────────────────────────────────────────
1500
1381
  async listModelVersions(modelId, params = {}) {
1501
1382
  const resp = await client.listModelVersions(
1502
- create4(ListModelVersionsRequestSchema, {
1383
+ create3(ListModelVersionsRequestSchema, {
1503
1384
  modelId,
1504
1385
  limit: params.limit ?? 50,
1505
1386
  offset: params.offset ?? 0
@@ -1512,7 +1393,7 @@ function createModelsMethods(client) {
1512
1393
  },
1513
1394
  async restoreModelVersion(modelId, versionId) {
1514
1395
  const resp = await client.restoreModelVersion(
1515
- create4(RestoreModelVersionRequestSchema, { modelId, versionId })
1396
+ create3(RestoreModelVersionRequestSchema, { modelId, versionId })
1516
1397
  );
1517
1398
  return resp.model ?? null;
1518
1399
  }
@@ -1520,7 +1401,7 @@ function createModelsMethods(client) {
1520
1401
  }
1521
1402
 
1522
1403
  // src/lib/rpc/records.ts
1523
- import { create as create5 } from "@bufbuild/protobuf";
1404
+ import { create as create4 } from "@bufbuild/protobuf";
1524
1405
  import {
1525
1406
  CreateRecordRequestSchema,
1526
1407
  GetRecordRequestSchema,
@@ -1591,7 +1472,7 @@ function createRecordsMethods(client) {
1591
1472
  // ── CRUD ──────────────────────────────────────────────────
1592
1473
  async createRecord(params) {
1593
1474
  const resp = await client.createRecord(
1594
- create5(CreateRecordRequestSchema, {
1475
+ create4(CreateRecordRequestSchema, {
1595
1476
  modelKey: params.modelKey,
1596
1477
  naturalKey: params.naturalKey,
1597
1478
  data: params.data ? sanitizeData(params.data) : void 0,
@@ -1608,32 +1489,32 @@ function createRecordsMethods(client) {
1608
1489
  },
1609
1490
  async getRecord(id) {
1610
1491
  const resp = await client.getRecord(
1611
- create5(GetRecordRequestSchema, { id })
1492
+ create4(GetRecordRequestSchema, { id })
1612
1493
  );
1613
1494
  return resp.record ?? null;
1614
1495
  },
1615
1496
  async getRecordByKey(modelKey, naturalKey) {
1616
1497
  const resp = await client.getRecordByKey(
1617
- create5(GetRecordByKeyRequestSchema, { modelKey, naturalKey })
1498
+ create4(GetRecordByKeyRequestSchema, { modelKey, naturalKey })
1618
1499
  );
1619
1500
  return resp.record ?? null;
1620
1501
  },
1621
1502
  async getRecordByKeyOrId(modelKey, identifier) {
1622
1503
  const resp = await client.getRecordByKeyOrId(
1623
- create5(GetRecordByKeyOrIdRequestSchema, { modelKey, identifier })
1504
+ create4(GetRecordByKeyOrIdRequestSchema, { modelKey, identifier })
1624
1505
  );
1625
1506
  return resp.record ?? null;
1626
1507
  },
1627
1508
  async listRecords(params) {
1628
1509
  const resp = await client.listRecords(
1629
- create5(ListRecordsRequestSchema, {
1510
+ create4(ListRecordsRequestSchema, {
1630
1511
  modelKey: params.modelKey,
1631
1512
  limit: params.limit ?? 50,
1632
1513
  offset: params.offset ?? 0,
1633
1514
  customerId: params.customerId,
1634
1515
  search: params.search,
1635
1516
  filters: params.filters?.map(
1636
- (f) => create5(RecordFilterSchema, {
1517
+ (f) => create4(RecordFilterSchema, {
1637
1518
  field: f.field,
1638
1519
  operator: f.operator
1639
1520
  })
@@ -1647,7 +1528,7 @@ function createRecordsMethods(client) {
1647
1528
  },
1648
1529
  async updateRecord(params) {
1649
1530
  const resp = await client.updateRecord(
1650
- create5(UpdateRecordRequestSchema, {
1531
+ create4(UpdateRecordRequestSchema, {
1651
1532
  id: params.id,
1652
1533
  data: sanitizeData(params.data),
1653
1534
  naturalKey: params.naturalKey
@@ -1657,28 +1538,28 @@ function createRecordsMethods(client) {
1657
1538
  },
1658
1539
  async deleteRecord(id) {
1659
1540
  const resp = await client.deleteRecord(
1660
- create5(DeleteRecordRequestSchema, { id })
1541
+ create4(DeleteRecordRequestSchema, { id })
1661
1542
  );
1662
1543
  return resp.success;
1663
1544
  },
1664
1545
  async duplicateRecord(id, newNaturalKey) {
1665
1546
  const resp = await client.duplicateRecord(
1666
- create5(DuplicateRecordRequestSchema, { id, newNaturalKey })
1547
+ create4(DuplicateRecordRequestSchema, { id, newNaturalKey })
1667
1548
  );
1668
1549
  return resp.record ?? null;
1669
1550
  },
1670
1551
  async duplicateRecordsBulk(ids, modelKey) {
1671
1552
  const resp = await client.duplicateRecordsBulk(
1672
- create5(DuplicateRecordsBulkRequestSchema, { ids, modelKey })
1553
+ create4(DuplicateRecordsBulkRequestSchema, { ids, modelKey })
1673
1554
  );
1674
1555
  return resp.records ?? [];
1675
1556
  },
1676
1557
  async batchRecordOperations(operations) {
1677
1558
  const typeMap = { create: 1, update: 2, delete: 3 };
1678
1559
  const resp = await client.batchRecordOperations(
1679
- create5(BatchRecordOperationsRequestSchema, {
1560
+ create4(BatchRecordOperationsRequestSchema, {
1680
1561
  operations: operations.map(
1681
- (op) => create5(BatchOperationSchema, {
1562
+ (op) => create4(BatchOperationSchema, {
1682
1563
  type: typeMap[op.type],
1683
1564
  id: op.id,
1684
1565
  modelKey: op.modelKey,
@@ -1695,7 +1576,7 @@ function createRecordsMethods(client) {
1695
1576
  },
1696
1577
  async bulkUpdateRecords(params) {
1697
1578
  const resp = await client.bulkUpdateRecords(
1698
- create5(BulkUpdateRecordsRequestSchema, {
1579
+ create4(BulkUpdateRecordsRequestSchema, {
1699
1580
  modelKey: params.modelKey,
1700
1581
  data: sanitizeData(params.data)
1701
1582
  })
@@ -1705,7 +1586,7 @@ function createRecordsMethods(client) {
1705
1586
  // ── Versioning ────────────────────────────────────────────
1706
1587
  async createVersion(parentId, data, changeDescription) {
1707
1588
  const resp = await client.createVersion(
1708
- create5(CreateVersionRequestSchema, {
1589
+ create4(CreateVersionRequestSchema, {
1709
1590
  parentId,
1710
1591
  data: data ? sanitizeData(data) : void 0,
1711
1592
  changeDescription
@@ -1715,25 +1596,25 @@ function createRecordsMethods(client) {
1715
1596
  },
1716
1597
  async publishVersion(versionId) {
1717
1598
  const resp = await client.publishVersion(
1718
- create5(PublishVersionRequestSchema, { versionId })
1599
+ create4(PublishVersionRequestSchema, { versionId })
1719
1600
  );
1720
1601
  return resp.record ?? null;
1721
1602
  },
1722
1603
  async unpublishRecord(recordId) {
1723
1604
  const resp = await client.unpublishRecord(
1724
- create5(UnpublishRecordRequestSchema, { recordId })
1605
+ create4(UnpublishRecordRequestSchema, { recordId })
1725
1606
  );
1726
1607
  return resp.success;
1727
1608
  },
1728
1609
  async revertToVersion(versionId) {
1729
1610
  const resp = await client.revertToVersion(
1730
- create5(RevertToVersionRequestSchema, { versionId })
1611
+ create4(RevertToVersionRequestSchema, { versionId })
1731
1612
  );
1732
1613
  return resp.record ?? null;
1733
1614
  },
1734
1615
  async listRecordVersions(parentId, params) {
1735
1616
  const resp = await client.listRecordVersions(
1736
- create5(ListRecordVersionsRequestSchema, {
1617
+ create4(ListRecordVersionsRequestSchema, {
1737
1618
  parentId,
1738
1619
  limit: params?.limit ?? 50,
1739
1620
  offset: params?.offset ?? 0
@@ -1746,7 +1627,7 @@ function createRecordsMethods(client) {
1746
1627
  },
1747
1628
  async saveContent(params) {
1748
1629
  const resp = await client.saveContent(
1749
- create5(SaveContentRequestSchema, {
1630
+ create4(SaveContentRequestSchema, {
1750
1631
  recordId: params.recordId,
1751
1632
  data: sanitizeData(params.data),
1752
1633
  variantKey: params.variantKey,
@@ -1761,7 +1642,7 @@ function createRecordsMethods(client) {
1761
1642
  // ── Variants ──────────────────────────────────────────────
1762
1643
  async createVariant(recordId, variantKey, data) {
1763
1644
  const resp = await client.createVariant(
1764
- create5(CreateVariantRequestSchema, {
1645
+ create4(CreateVariantRequestSchema, {
1765
1646
  recordId,
1766
1647
  variantKey,
1767
1648
  data: data ? sanitizeData(data) : void 0
@@ -1771,7 +1652,7 @@ function createRecordsMethods(client) {
1771
1652
  },
1772
1653
  async updateVariant(variantId, data) {
1773
1654
  const resp = await client.updateVariant(
1774
- create5(UpdateVariantRequestSchema, {
1655
+ create4(UpdateVariantRequestSchema, {
1775
1656
  variantId,
1776
1657
  data: sanitizeData(data)
1777
1658
  })
@@ -1780,19 +1661,19 @@ function createRecordsMethods(client) {
1780
1661
  },
1781
1662
  async deleteVariant(variantId) {
1782
1663
  const resp = await client.deleteVariant(
1783
- create5(DeleteVariantRequestSchema, { variantId })
1664
+ create4(DeleteVariantRequestSchema, { variantId })
1784
1665
  );
1785
1666
  return resp.success;
1786
1667
  },
1787
1668
  async setDefaultVariant(recordId, variantId) {
1788
1669
  const resp = await client.setDefaultVariant(
1789
- create5(SetDefaultVariantRequestSchema, { recordId, variantId })
1670
+ create4(SetDefaultVariantRequestSchema, { recordId, variantId })
1790
1671
  );
1791
1672
  return resp.record ?? null;
1792
1673
  },
1793
1674
  async listRecordVariants(recordId, params) {
1794
1675
  const resp = await client.listRecordVariants(
1795
- create5(ListRecordVariantsRequestSchema, {
1676
+ create4(ListRecordVariantsRequestSchema, {
1796
1677
  recordId,
1797
1678
  limit: params?.limit ?? 50,
1798
1679
  offset: params?.offset ?? 0
@@ -1806,7 +1687,7 @@ function createRecordsMethods(client) {
1806
1687
  // ── Scheduling ────────────────────────────────────────────
1807
1688
  async scheduleRecordPublish(versionId, publishAt, unpublishAt) {
1808
1689
  const resp = await client.scheduleRecordPublish(
1809
- create5(ScheduleRecordPublishRequestSchema, {
1690
+ create4(ScheduleRecordPublishRequestSchema, {
1810
1691
  versionId,
1811
1692
  publishAt: {
1812
1693
  seconds: BigInt(Math.floor(publishAt.getTime() / 1e3)),
@@ -1822,13 +1703,13 @@ function createRecordsMethods(client) {
1822
1703
  },
1823
1704
  async cancelScheduledRecordPublish(versionId) {
1824
1705
  const resp = await client.cancelScheduledRecordPublish(
1825
- create5(CancelScheduledRecordPublishRequestSchema, { versionId })
1706
+ create4(CancelScheduledRecordPublishRequestSchema, { versionId })
1826
1707
  );
1827
1708
  return resp.version ?? null;
1828
1709
  },
1829
1710
  async listScheduledPublishes(params) {
1830
1711
  const resp = await client.listScheduledPublishes(
1831
- create5(ListScheduledPublishesRequestSchema, {
1712
+ create4(ListScheduledPublishesRequestSchema, {
1832
1713
  from: params?.from ? {
1833
1714
  seconds: BigInt(Math.floor(params.from.getTime() / 1e3)),
1834
1715
  nanos: 0
@@ -1849,7 +1730,7 @@ function createRecordsMethods(client) {
1849
1730
  },
1850
1731
  async listDraftVersions(params) {
1851
1732
  const resp = await client.listDraftVersions(
1852
- create5(ListDraftVersionsRequestSchema, {
1733
+ create4(ListDraftVersionsRequestSchema, {
1853
1734
  modelKey: params?.modelKey,
1854
1735
  search: params?.search,
1855
1736
  limit: params?.limit ?? 50,
@@ -1864,7 +1745,7 @@ function createRecordsMethods(client) {
1864
1745
  // ── Batch Publishing ──────────────────────────────────────
1865
1746
  async batchPublishVersions(versionIds) {
1866
1747
  const resp = await client.batchPublishVersions(
1867
- create5(BatchPublishVersionsRequestSchema, { versionIds })
1748
+ create4(BatchPublishVersionsRequestSchema, { versionIds })
1868
1749
  );
1869
1750
  return {
1870
1751
  records: resp.records ?? [],
@@ -1874,7 +1755,7 @@ function createRecordsMethods(client) {
1874
1755
  // ── Publish Batches ───────────────────────────────────────
1875
1756
  async createPublishBatch(params) {
1876
1757
  const resp = await client.createPublishBatch(
1877
- create5(CreatePublishBatchRequestSchema, {
1758
+ create4(CreatePublishBatchRequestSchema, {
1878
1759
  name: params.name,
1879
1760
  versionIds: params.versionIds,
1880
1761
  scheduledAt: params.scheduledAt ? {
@@ -1889,7 +1770,7 @@ function createRecordsMethods(client) {
1889
1770
  },
1890
1771
  async updatePublishBatch(params) {
1891
1772
  const resp = await client.updatePublishBatch(
1892
- create5(UpdatePublishBatchRequestSchema, {
1773
+ create4(UpdatePublishBatchRequestSchema, {
1893
1774
  batchId: params.batchId,
1894
1775
  name: params.name,
1895
1776
  scheduledAt: params.scheduledAt ? {
@@ -1904,19 +1785,19 @@ function createRecordsMethods(client) {
1904
1785
  },
1905
1786
  async cancelPublishBatch(batchId) {
1906
1787
  const resp = await client.cancelPublishBatch(
1907
- create5(CancelPublishBatchRequestSchema, { batchId })
1788
+ create4(CancelPublishBatchRequestSchema, { batchId })
1908
1789
  );
1909
1790
  return resp.batch ?? null;
1910
1791
  },
1911
1792
  async rollbackPublishBatch(batchId) {
1912
1793
  const resp = await client.rollbackPublishBatch(
1913
- create5(RollbackPublishBatchRequestSchema, { batchId })
1794
+ create4(RollbackPublishBatchRequestSchema, { batchId })
1914
1795
  );
1915
1796
  return resp.batch ?? null;
1916
1797
  },
1917
1798
  async retryFailedBatchItems(batchId) {
1918
1799
  const resp = await client.retryFailedBatchItems(
1919
- create5(RetryFailedBatchItemsRequestSchema, { batchId })
1800
+ create4(RetryFailedBatchItemsRequestSchema, { batchId })
1920
1801
  );
1921
1802
  return {
1922
1803
  batch: resp.batch ?? null,
@@ -1925,13 +1806,13 @@ function createRecordsMethods(client) {
1925
1806
  },
1926
1807
  async addItemsToPublishBatch(batchId, versionIds) {
1927
1808
  const resp = await client.addItemsToPublishBatch(
1928
- create5(AddItemsToPublishBatchRequestSchema, { batchId, versionIds })
1809
+ create4(AddItemsToPublishBatchRequestSchema, { batchId, versionIds })
1929
1810
  );
1930
1811
  return resp.batch ?? null;
1931
1812
  },
1932
1813
  async removeItemsFromPublishBatch(batchId, versionIds) {
1933
1814
  const resp = await client.removeItemsFromPublishBatch(
1934
- create5(RemoveItemsFromPublishBatchRequestSchema, {
1815
+ create4(RemoveItemsFromPublishBatchRequestSchema, {
1935
1816
  batchId,
1936
1817
  versionIds
1937
1818
  })
@@ -1940,7 +1821,7 @@ function createRecordsMethods(client) {
1940
1821
  },
1941
1822
  async listPublishBatches(params) {
1942
1823
  const resp = await client.listPublishBatches(
1943
- create5(ListPublishBatchesRequestSchema, {
1824
+ create4(ListPublishBatchesRequestSchema, {
1944
1825
  status: params?.status,
1945
1826
  from: params?.from ? {
1946
1827
  seconds: BigInt(Math.floor(params.from.getTime() / 1e3)),
@@ -1961,7 +1842,7 @@ function createRecordsMethods(client) {
1961
1842
  },
1962
1843
  async getPublishBatch(batchId) {
1963
1844
  const resp = await client.getPublishBatch(
1964
- create5(GetPublishBatchRequestSchema, { batchId })
1845
+ create4(GetPublishBatchRequestSchema, { batchId })
1965
1846
  );
1966
1847
  return {
1967
1848
  batch: resp.batch ?? null,
@@ -1971,7 +1852,7 @@ function createRecordsMethods(client) {
1971
1852
  // ── Search & Embeddings ──────────────────────────────────
1972
1853
  async globalSearch(params) {
1973
1854
  const resp = await client.globalSearch(
1974
- create5(GlobalSearchRequestSchema, {
1855
+ create4(GlobalSearchRequestSchema, {
1975
1856
  query: params.query,
1976
1857
  modelKeys: params.modelKeys ?? [],
1977
1858
  limit: params.limit ?? 20
@@ -1984,7 +1865,7 @@ function createRecordsMethods(client) {
1984
1865
  },
1985
1866
  async getEmbeddingStats(modelKey) {
1986
1867
  const resp = await client.getEmbeddingStats(
1987
- create5(GetEmbeddingStatsRequestSchema, {
1868
+ create4(GetEmbeddingStatsRequestSchema, {
1988
1869
  modelKey
1989
1870
  })
1990
1871
  );
@@ -1992,13 +1873,13 @@ function createRecordsMethods(client) {
1992
1873
  },
1993
1874
  async getRecordEmbeddings(recordId) {
1994
1875
  const resp = await client.getRecordEmbeddings(
1995
- create5(GetRecordEmbeddingsRequestSchema, { recordId })
1876
+ create4(GetRecordEmbeddingsRequestSchema, { recordId })
1996
1877
  );
1997
1878
  return resp.embeddings ?? [];
1998
1879
  },
1999
1880
  async findSimilarRecords(params) {
2000
1881
  const resp = await client.findSimilarRecords(
2001
- create5(FindSimilarRecordsRequestSchema, {
1882
+ create4(FindSimilarRecordsRequestSchema, {
2002
1883
  recordId: params.recordId,
2003
1884
  modelKey: params.modelKey,
2004
1885
  limit: params.limit ?? 10
@@ -2010,7 +1891,7 @@ function createRecordsMethods(client) {
2010
1891
  }
2011
1892
 
2012
1893
  // src/lib/rpc/configs.ts
2013
- import { create as create6 } from "@bufbuild/protobuf";
1894
+ import { create as create5 } from "@bufbuild/protobuf";
2014
1895
  import {
2015
1896
  CreateConfigRequestSchema,
2016
1897
  GetConfigRequestSchema,
@@ -2035,7 +1916,7 @@ function createConfigsMethods(client) {
2035
1916
  // ── Operations ────────────────────────────────────────────
2036
1917
  async listOperations(params = {}) {
2037
1918
  return client.listOperations(
2038
- create6(ListOperationsRequestSchema, {
1919
+ create5(ListOperationsRequestSchema, {
2039
1920
  category: params.category,
2040
1921
  isActive: params.isActive,
2041
1922
  search: params.search,
@@ -2047,19 +1928,19 @@ function createConfigsMethods(client) {
2047
1928
  // ── Queries ──────────────────────────────────────────────
2048
1929
  async getConfig(id) {
2049
1930
  const resp = await client.getConfig(
2050
- create6(GetConfigRequestSchema, { id })
1931
+ create5(GetConfigRequestSchema, { id })
2051
1932
  );
2052
1933
  return resp.config ?? null;
2053
1934
  },
2054
1935
  async getConfigByKey(key) {
2055
1936
  const resp = await client.getConfigByKey(
2056
- create6(GetConfigByKeyRequestSchema, { key })
1937
+ create5(GetConfigByKeyRequestSchema, { key })
2057
1938
  );
2058
1939
  return resp.config ?? null;
2059
1940
  },
2060
1941
  async listConfigs(params = {}) {
2061
1942
  return client.listConfigs(
2062
- create6(ListConfigsRequestSchema, {
1943
+ create5(ListConfigsRequestSchema, {
2063
1944
  configType: params.configType,
2064
1945
  enabled: params.enabled,
2065
1946
  limit: params.limit ?? 50,
@@ -2070,7 +1951,7 @@ function createConfigsMethods(client) {
2070
1951
  // ── Mutations ────────────────────────────────────────────
2071
1952
  async createConfig(params) {
2072
1953
  const resp = await client.createConfig(
2073
- create6(CreateConfigRequestSchema, {
1954
+ create5(CreateConfigRequestSchema, {
2074
1955
  key: params.key,
2075
1956
  configType: params.configType,
2076
1957
  direction: DIRECTION_TO_PROTO[params.direction ?? "read"] ?? ConfigDirection.READ,
@@ -2084,7 +1965,7 @@ function createConfigsMethods(client) {
2084
1965
  },
2085
1966
  async updateConfig(params) {
2086
1967
  const resp = await client.updateConfig(
2087
- create6(UpdateConfigRequestSchema, {
1968
+ create5(UpdateConfigRequestSchema, {
2088
1969
  id: params.id,
2089
1970
  name: params.name,
2090
1971
  description: params.description,
@@ -2098,7 +1979,7 @@ function createConfigsMethods(client) {
2098
1979
  },
2099
1980
  async applyConfig(configKey, configData) {
2100
1981
  const resp = await client.applyConfig(
2101
- create6(ApplyConfigRequestSchema, {
1982
+ create5(ApplyConfigRequestSchema, {
2102
1983
  configKey,
2103
1984
  configData
2104
1985
  })
@@ -2114,7 +1995,7 @@ function createConfigsMethods(client) {
2114
1995
  },
2115
1996
  async writeConfigCredential(params) {
2116
1997
  const resp = await client.writeConfigCredential(
2117
- create6(WriteConfigCredentialRequestSchema, {
1998
+ create5(WriteConfigCredentialRequestSchema, {
2118
1999
  configKey: params.configKey,
2119
2000
  value: params.value
2120
2001
  })
@@ -2126,13 +2007,13 @@ function createConfigsMethods(client) {
2126
2007
  },
2127
2008
  async triggerConfigSync(configId) {
2128
2009
  const resp = await client.triggerConfigSync(
2129
- create6(TriggerConfigSyncRequestSchema, { configId })
2010
+ create5(TriggerConfigSyncRequestSchema, { configId })
2130
2011
  );
2131
2012
  return resp.success;
2132
2013
  },
2133
2014
  async deleteConfig(id) {
2134
2015
  const resp = await client.deleteConfig(
2135
- create6(DeleteConfigRequestSchema, { id })
2016
+ create5(DeleteConfigRequestSchema, { id })
2136
2017
  );
2137
2018
  return resp.success;
2138
2019
  }
@@ -2140,7 +2021,7 @@ function createConfigsMethods(client) {
2140
2021
  }
2141
2022
 
2142
2023
  // src/lib/rpc/segments.ts
2143
- import { create as create7, fromJson as fromJson2 } from "@bufbuild/protobuf";
2024
+ import { create as create6, fromJson as fromJson2 } from "@bufbuild/protobuf";
2144
2025
  import { ValueSchema as ValueSchema2 } from "@bufbuild/protobuf/wkt";
2145
2026
  import {
2146
2027
  RuleExpressionSchema,
@@ -2161,7 +2042,7 @@ import {
2161
2042
  OptBackIntoSegmentRequestSchema
2162
2043
  } from "@eide/foir-proto-ts/segments/v1/segments_pb";
2163
2044
  function rawOperandToProto(raw) {
2164
- return create7(RuleOperandSchema, {
2045
+ return create6(RuleOperandSchema, {
2165
2046
  type: raw.type,
2166
2047
  path: raw.path,
2167
2048
  value: raw.value !== void 0 ? fromJson2(ValueSchema2, raw.value) : void 0,
@@ -2170,7 +2051,7 @@ function rawOperandToProto(raw) {
2170
2051
  });
2171
2052
  }
2172
2053
  function rawRulesToProto(raw) {
2173
- return create7(RuleExpressionSchema, {
2054
+ return create6(RuleExpressionSchema, {
2174
2055
  type: raw.type,
2175
2056
  id: raw.id,
2176
2057
  left: raw.left ? rawOperandToProto(raw.left) : void 0,
@@ -2186,19 +2067,19 @@ function createSegmentsMethods(client) {
2186
2067
  // ── Queries ──────────────────────────────────────────────
2187
2068
  async getSegment(id) {
2188
2069
  const resp = await client.getSegment(
2189
- create7(GetSegmentRequestSchema, { id })
2070
+ create6(GetSegmentRequestSchema, { id })
2190
2071
  );
2191
2072
  return resp.segment ?? null;
2192
2073
  },
2193
2074
  async getSegmentByKey(key) {
2194
2075
  const resp = await client.getSegmentByKey(
2195
- create7(GetSegmentByKeyRequestSchema, { key })
2076
+ create6(GetSegmentByKeyRequestSchema, { key })
2196
2077
  );
2197
2078
  return resp.segment ?? null;
2198
2079
  },
2199
2080
  async listSegments(params = {}) {
2200
2081
  return client.listSegments(
2201
- create7(ListSegmentsRequestSchema, {
2082
+ create6(ListSegmentsRequestSchema, {
2202
2083
  isActive: params.isActive,
2203
2084
  configId: params.configId,
2204
2085
  limit: params.limit ?? 50,
@@ -2210,7 +2091,7 @@ function createSegmentsMethods(client) {
2210
2091
  async createSegment(params) {
2211
2092
  const rules = params.rules && !("$typeName" in params.rules) ? rawRulesToProto(params.rules) : params.rules;
2212
2093
  const resp = await client.createSegment(
2213
- create7(CreateSegmentRequestSchema, {
2094
+ create6(CreateSegmentRequestSchema, {
2214
2095
  key: params.key,
2215
2096
  name: params.name,
2216
2097
  description: params.description,
@@ -2227,7 +2108,7 @@ function createSegmentsMethods(client) {
2227
2108
  async updateSegment(params) {
2228
2109
  const rules = params.rules && !("$typeName" in params.rules) ? rawRulesToProto(params.rules) : params.rules;
2229
2110
  const resp = await client.updateSegment(
2230
- create7(UpdateSegmentRequestSchema, {
2111
+ create6(UpdateSegmentRequestSchema, {
2231
2112
  id: params.id,
2232
2113
  name: params.name,
2233
2114
  description: params.description,
@@ -2240,19 +2121,19 @@ function createSegmentsMethods(client) {
2240
2121
  },
2241
2122
  async deleteSegment(id) {
2242
2123
  const resp = await client.deleteSegment(
2243
- create7(DeleteSegmentRequestSchema, { id })
2124
+ create6(DeleteSegmentRequestSchema, { id })
2244
2125
  );
2245
2126
  return resp.success;
2246
2127
  },
2247
2128
  // ── Customer Operations ──────────────────────────────────
2248
2129
  async getCustomerMemberships(customerId) {
2249
2130
  return client.getCustomerMemberships(
2250
- create7(GetCustomerMembershipsRequestSchema, { customerId })
2131
+ create6(GetCustomerMembershipsRequestSchema, { customerId })
2251
2132
  );
2252
2133
  },
2253
2134
  async previewSegmentRules(rules, sampleSize) {
2254
2135
  const resp = await client.previewSegmentRules(
2255
- create7(PreviewSegmentRulesRequestSchema, {
2136
+ create6(PreviewSegmentRulesRequestSchema, {
2256
2137
  rules,
2257
2138
  sampleSize: sampleSize ?? 10
2258
2139
  })
@@ -2261,26 +2142,26 @@ function createSegmentsMethods(client) {
2261
2142
  },
2262
2143
  async testSegmentEvaluation(segmentId, customerId) {
2263
2144
  const resp = await client.testSegmentEvaluation(
2264
- create7(TestSegmentEvaluationRequestSchema, { segmentId, customerId })
2145
+ create6(TestSegmentEvaluationRequestSchema, { segmentId, customerId })
2265
2146
  );
2266
2147
  return resp.result ?? null;
2267
2148
  },
2268
2149
  // ── Opt-out Management ───────────────────────────────────
2269
2150
  async setGlobalOptOut(customerId, optedOut) {
2270
2151
  const resp = await client.setGlobalOptOut(
2271
- create7(SetGlobalOptOutRequestSchema, { customerId, optedOut })
2152
+ create6(SetGlobalOptOutRequestSchema, { customerId, optedOut })
2272
2153
  );
2273
2154
  return resp.success;
2274
2155
  },
2275
2156
  async optOutOfSegment(customerId, segmentId) {
2276
2157
  const resp = await client.optOutOfSegment(
2277
- create7(OptOutOfSegmentRequestSchema, { customerId, segmentId })
2158
+ create6(OptOutOfSegmentRequestSchema, { customerId, segmentId })
2278
2159
  );
2279
2160
  return resp.success;
2280
2161
  },
2281
2162
  async optBackIntoSegment(customerId, segmentId) {
2282
2163
  const resp = await client.optBackIntoSegment(
2283
- create7(OptBackIntoSegmentRequestSchema, { customerId, segmentId })
2164
+ create6(OptBackIntoSegmentRequestSchema, { customerId, segmentId })
2284
2165
  );
2285
2166
  return resp.success;
2286
2167
  }
@@ -2288,7 +2169,7 @@ function createSegmentsMethods(client) {
2288
2169
  }
2289
2170
 
2290
2171
  // src/lib/rpc/experiments.ts
2291
- import { create as create8 } from "@bufbuild/protobuf";
2172
+ import { create as create7 } from "@bufbuild/protobuf";
2292
2173
  import {
2293
2174
  ExperimentStatus,
2294
2175
  CreateExperimentRequestSchema,
@@ -2321,19 +2202,19 @@ function createExperimentsMethods(client) {
2321
2202
  // ── Queries ──────────────────────────────────────────────
2322
2203
  async getExperiment(id) {
2323
2204
  const resp = await client.getExperiment(
2324
- create8(GetExperimentRequestSchema, { id })
2205
+ create7(GetExperimentRequestSchema, { id })
2325
2206
  );
2326
2207
  return resp.experiment ?? null;
2327
2208
  },
2328
2209
  async getExperimentByKey(key) {
2329
2210
  const resp = await client.getExperimentByKey(
2330
- create8(GetExperimentByKeyRequestSchema, { key })
2211
+ create7(GetExperimentByKeyRequestSchema, { key })
2331
2212
  );
2332
2213
  return resp.experiment ?? null;
2333
2214
  },
2334
2215
  async listExperiments(params = {}) {
2335
2216
  return client.listExperiments(
2336
- create8(ListExperimentsRequestSchema, {
2217
+ create7(ListExperimentsRequestSchema, {
2337
2218
  status: params.status ? STATUS_TO_PROTO[params.status] : void 0,
2338
2219
  isActive: params.isActive,
2339
2220
  limit: params.limit ?? 50,
@@ -2343,21 +2224,21 @@ function createExperimentsMethods(client) {
2343
2224
  },
2344
2225
  async getExperimentStats(experimentId) {
2345
2226
  const resp = await client.getExperimentStats(
2346
- create8(GetExperimentStatsRequestSchema, { experimentId })
2227
+ create7(GetExperimentStatsRequestSchema, { experimentId })
2347
2228
  );
2348
2229
  return resp.stats ?? null;
2349
2230
  },
2350
2231
  // ── Mutations ────────────────────────────────────────────
2351
2232
  async createExperiment(params) {
2352
2233
  const resp = await client.createExperiment(
2353
- create8(CreateExperimentRequestSchema, {
2234
+ create7(CreateExperimentRequestSchema, {
2354
2235
  key: params.key,
2355
2236
  name: params.name,
2356
2237
  description: params.description,
2357
2238
  targeting: params.targeting,
2358
2239
  controlPercent: params.controlPercent,
2359
2240
  variants: params.variants?.map(
2360
- (v) => create8(ExperimentVariantSchema, {
2241
+ (v) => create7(ExperimentVariantSchema, {
2361
2242
  key: v.key,
2362
2243
  name: v.name,
2363
2244
  percent: v.percent
@@ -2369,14 +2250,14 @@ function createExperimentsMethods(client) {
2369
2250
  },
2370
2251
  async updateExperiment(params) {
2371
2252
  const resp = await client.updateExperiment(
2372
- create8(UpdateExperimentRequestSchema, {
2253
+ create7(UpdateExperimentRequestSchema, {
2373
2254
  id: params.id,
2374
2255
  name: params.name,
2375
2256
  description: params.description,
2376
2257
  targeting: params.targeting,
2377
2258
  controlPercent: params.controlPercent,
2378
2259
  variants: params.variants?.map(
2379
- (v) => create8(ExperimentVariantSchema, {
2260
+ (v) => create7(ExperimentVariantSchema, {
2380
2261
  key: v.key,
2381
2262
  name: v.name,
2382
2263
  percent: v.percent
@@ -2388,38 +2269,38 @@ function createExperimentsMethods(client) {
2388
2269
  },
2389
2270
  async deleteExperiment(id) {
2390
2271
  const resp = await client.deleteExperiment(
2391
- create8(DeleteExperimentRequestSchema, { id })
2272
+ create7(DeleteExperimentRequestSchema, { id })
2392
2273
  );
2393
2274
  return resp.success;
2394
2275
  },
2395
2276
  // ── Lifecycle ────────────────────────────────────────────
2396
2277
  async startExperiment(experimentId) {
2397
2278
  const resp = await client.startExperiment(
2398
- create8(StartExperimentRequestSchema, { experimentId })
2279
+ create7(StartExperimentRequestSchema, { experimentId })
2399
2280
  );
2400
2281
  return resp.experiment ?? null;
2401
2282
  },
2402
2283
  async pauseExperiment(experimentId) {
2403
2284
  const resp = await client.pauseExperiment(
2404
- create8(PauseExperimentRequestSchema, { experimentId })
2285
+ create7(PauseExperimentRequestSchema, { experimentId })
2405
2286
  );
2406
2287
  return resp.experiment ?? null;
2407
2288
  },
2408
2289
  async resumeExperiment(experimentId) {
2409
2290
  const resp = await client.resumeExperiment(
2410
- create8(ResumeExperimentRequestSchema, { experimentId })
2291
+ create7(ResumeExperimentRequestSchema, { experimentId })
2411
2292
  );
2412
2293
  return resp.experiment ?? null;
2413
2294
  },
2414
2295
  async endExperiment(experimentId) {
2415
2296
  const resp = await client.endExperiment(
2416
- create8(EndExperimentRequestSchema, { experimentId })
2297
+ create7(EndExperimentRequestSchema, { experimentId })
2417
2298
  );
2418
2299
  return resp.experiment ?? null;
2419
2300
  },
2420
2301
  async applyExperimentWinner(experimentId, winnerVariantKey) {
2421
2302
  const resp = await client.applyExperimentWinner(
2422
- create8(ApplyExperimentWinnerRequestSchema, {
2303
+ create7(ApplyExperimentWinnerRequestSchema, {
2423
2304
  experimentId,
2424
2305
  winnerVariantKey
2425
2306
  })
@@ -2429,7 +2310,7 @@ function createExperimentsMethods(client) {
2429
2310
  // ── Assignments ──────────────────────────────────────────
2430
2311
  async forceAssignExperiment(customerId, experimentId, variantKey) {
2431
2312
  const resp = await client.forceAssignExperiment(
2432
- create8(ForceAssignExperimentRequestSchema, {
2313
+ create7(ForceAssignExperimentRequestSchema, {
2433
2314
  customerId,
2434
2315
  experimentId,
2435
2316
  variantKey
@@ -2439,7 +2320,7 @@ function createExperimentsMethods(client) {
2439
2320
  },
2440
2321
  async removeExperimentAssignment(customerId, experimentId) {
2441
2322
  const resp = await client.removeExperimentAssignment(
2442
- create8(RemoveExperimentAssignmentRequestSchema, {
2323
+ create7(RemoveExperimentAssignmentRequestSchema, {
2443
2324
  customerId,
2444
2325
  experimentId
2445
2326
  })
@@ -2448,7 +2329,7 @@ function createExperimentsMethods(client) {
2448
2329
  },
2449
2330
  async getCustomerAssignments(customerId) {
2450
2331
  const resp = await client.getCustomerAssignments(
2451
- create8(GetCustomerAssignmentsRequestSchema, { customerId })
2332
+ create7(GetCustomerAssignmentsRequestSchema, { customerId })
2452
2333
  );
2453
2334
  return resp.assignments ?? [];
2454
2335
  }
@@ -2456,7 +2337,7 @@ function createExperimentsMethods(client) {
2456
2337
  }
2457
2338
 
2458
2339
  // src/lib/rpc/settings.ts
2459
- import { create as create9 } from "@bufbuild/protobuf";
2340
+ import { create as create8 } from "@bufbuild/protobuf";
2460
2341
  import {
2461
2342
  GetSettingsRequestSchema,
2462
2343
  UpdateSettingRequestSchema,
@@ -2507,7 +2388,7 @@ function createSettingsMethods(client) {
2507
2388
  // ── Settings ─────────────────────────────────────────────
2508
2389
  async getSettings(params = {}) {
2509
2390
  const resp = await client.getSettings(
2510
- create9(GetSettingsRequestSchema, {
2391
+ create8(GetSettingsRequestSchema, {
2511
2392
  category: params.category,
2512
2393
  key: params.key
2513
2394
  })
@@ -2516,7 +2397,7 @@ function createSettingsMethods(client) {
2516
2397
  },
2517
2398
  async updateSetting(params) {
2518
2399
  const resp = await client.updateSetting(
2519
- create9(UpdateSettingRequestSchema, {
2400
+ create8(UpdateSettingRequestSchema, {
2520
2401
  key: params.key,
2521
2402
  value: params.value
2522
2403
  })
@@ -2525,14 +2406,14 @@ function createSettingsMethods(client) {
2525
2406
  },
2526
2407
  async deleteSetting(key) {
2527
2408
  const resp = await client.deleteSetting(
2528
- create9(DeleteSettingRequestSchema, { key })
2409
+ create8(DeleteSettingRequestSchema, { key })
2529
2410
  );
2530
2411
  return resp.success;
2531
2412
  },
2532
2413
  // ── Mentions ─────────────────────────────────────────────
2533
2414
  async listMyMentions(params = {}) {
2534
2415
  return client.listMyMentions(
2535
- create9(ListMyMentionsRequestSchema, {
2416
+ create8(ListMyMentionsRequestSchema, {
2536
2417
  status: params.status ?? [],
2537
2418
  entityType: params.entityType,
2538
2419
  limit: params.limit ?? 50,
@@ -2542,7 +2423,7 @@ function createSettingsMethods(client) {
2542
2423
  },
2543
2424
  async updateMentionStatus(params) {
2544
2425
  const resp = await client.updateMentionStatus(
2545
- create9(UpdateMentionStatusRequestSchema, {
2426
+ create8(UpdateMentionStatusRequestSchema, {
2546
2427
  mentionId: params.mentionId,
2547
2428
  status: params.status,
2548
2429
  completedNote: params.completedNote,
@@ -2554,7 +2435,7 @@ function createSettingsMethods(client) {
2554
2435
  // ── Notes ────────────────────────────────────────────────
2555
2436
  async createNote(params) {
2556
2437
  const resp = await client.createNote(
2557
- create9(CreateNoteRequestSchema, {
2438
+ create8(CreateNoteRequestSchema, {
2558
2439
  ...params,
2559
2440
  content: params.content
2560
2441
  })
@@ -2562,12 +2443,12 @@ function createSettingsMethods(client) {
2562
2443
  return resp.note ?? null;
2563
2444
  },
2564
2445
  async getNote(id) {
2565
- const resp = await client.getNote(create9(GetNoteRequestSchema, { id }));
2446
+ const resp = await client.getNote(create8(GetNoteRequestSchema, { id }));
2566
2447
  return resp.note ?? null;
2567
2448
  },
2568
2449
  async listNotes(params) {
2569
2450
  return client.listNotes(
2570
- create9(ListNotesRequestSchema, {
2451
+ create8(ListNotesRequestSchema, {
2571
2452
  entityType: params.entityType,
2572
2453
  entityId: params.entityId,
2573
2454
  limit: params.limit ?? 50,
@@ -2577,7 +2458,7 @@ function createSettingsMethods(client) {
2577
2458
  },
2578
2459
  async updateNote(params) {
2579
2460
  const resp = await client.updateNote(
2580
- create9(UpdateNoteRequestSchema, {
2461
+ create8(UpdateNoteRequestSchema, {
2581
2462
  id: params.id,
2582
2463
  content: params.content,
2583
2464
  isResolved: params.isResolved
@@ -2587,14 +2468,14 @@ function createSettingsMethods(client) {
2587
2468
  },
2588
2469
  async deleteNote(id) {
2589
2470
  const resp = await client.deleteNote(
2590
- create9(DeleteNoteRequestSchema, { id })
2471
+ create8(DeleteNoteRequestSchema, { id })
2591
2472
  );
2592
2473
  return resp.success;
2593
2474
  },
2594
2475
  // ── Context Dimensions ───────────────────────────────────
2595
2476
  async listContextDimensions(params = {}) {
2596
2477
  return client.listContextDimensions(
2597
- create9(ListContextDimensionsRequestSchema, {
2478
+ create8(ListContextDimensionsRequestSchema, {
2598
2479
  search: params.search,
2599
2480
  limit: params.limit ?? 50,
2600
2481
  offset: params.offset ?? 0
@@ -2603,31 +2484,31 @@ function createSettingsMethods(client) {
2603
2484
  },
2604
2485
  async getContextDimension(id) {
2605
2486
  const resp = await client.getContextDimension(
2606
- create9(GetContextDimensionRequestSchema, { id })
2487
+ create8(GetContextDimensionRequestSchema, { id })
2607
2488
  );
2608
2489
  return resp.dimension ?? null;
2609
2490
  },
2610
2491
  async createContextDimension(params) {
2611
2492
  const resp = await client.createContextDimension(
2612
- create9(CreateContextDimensionRequestSchema, params)
2493
+ create8(CreateContextDimensionRequestSchema, params)
2613
2494
  );
2614
2495
  return resp.dimension ?? null;
2615
2496
  },
2616
2497
  async updateContextDimension(params) {
2617
2498
  const resp = await client.updateContextDimension(
2618
- create9(UpdateContextDimensionRequestSchema, params)
2499
+ create8(UpdateContextDimensionRequestSchema, params)
2619
2500
  );
2620
2501
  return resp.dimension ?? null;
2621
2502
  },
2622
2503
  async deleteContextDimension(id) {
2623
2504
  const resp = await client.deleteContextDimension(
2624
- create9(DeleteContextDimensionRequestSchema, { id })
2505
+ create8(DeleteContextDimensionRequestSchema, { id })
2625
2506
  );
2626
2507
  return resp.success;
2627
2508
  },
2628
2509
  async getContextDimensionValues(dimensionKey, params = {}) {
2629
2510
  return client.getContextDimensionValues(
2630
- create9(GetContextDimensionValuesRequestSchema, {
2511
+ create8(GetContextDimensionValuesRequestSchema, {
2631
2512
  dimensionKey,
2632
2513
  search: params.search,
2633
2514
  limit: params.limit ?? 50,
@@ -2638,19 +2519,19 @@ function createSettingsMethods(client) {
2638
2519
  // ── Customer Profile Schema ──────────────────────────────
2639
2520
  async getCustomerProfileSchema() {
2640
2521
  const resp = await client.getCustomerProfileSchema(
2641
- create9(GetCustomerProfileSchemaRequestSchema, {})
2522
+ create8(GetCustomerProfileSchemaRequestSchema, {})
2642
2523
  );
2643
2524
  return resp.schema ?? null;
2644
2525
  },
2645
2526
  async getCustomerProfile(customerId) {
2646
2527
  const resp = await client.getCustomerProfile(
2647
- create9(GetCustomerProfileRequestSchema, { customerId })
2528
+ create8(GetCustomerProfileRequestSchema, { customerId })
2648
2529
  );
2649
2530
  return resp.data ?? null;
2650
2531
  },
2651
2532
  async setCustomerProfile(params) {
2652
2533
  const resp = await client.setCustomerProfile(
2653
- create9(SetCustomerProfileRequestSchema, {
2534
+ create8(SetCustomerProfileRequestSchema, {
2654
2535
  customerId: params.customerId,
2655
2536
  data: params.data
2656
2537
  })
@@ -2659,7 +2540,7 @@ function createSettingsMethods(client) {
2659
2540
  },
2660
2541
  async updateCustomerProfileSchema(params) {
2661
2542
  const resp = await client.updateCustomerProfileSchema(
2662
- create9(UpdateCustomerProfileSchemaRequestSchema, {
2543
+ create8(UpdateCustomerProfileSchemaRequestSchema, {
2663
2544
  fields: params.fields.map((f) => ({
2664
2545
  id: f.id,
2665
2546
  key: f.key,
@@ -2677,19 +2558,19 @@ function createSettingsMethods(client) {
2677
2558
  },
2678
2559
  async getCustomerResolutionAttributes(customerId) {
2679
2560
  return client.getCustomerResolutionAttributes(
2680
- create9(GetCustomerResolutionAttributesRequestSchema, { customerId })
2561
+ create8(GetCustomerResolutionAttributesRequestSchema, { customerId })
2681
2562
  );
2682
2563
  },
2683
2564
  async getEditorConfigs(modelKey) {
2684
2565
  const resp = await client.getEditorConfigs(
2685
- create9(GetEditorConfigsRequestSchema, { modelKey })
2566
+ create8(GetEditorConfigsRequestSchema, { modelKey })
2686
2567
  );
2687
2568
  return resp.placements ?? [];
2688
2569
  },
2689
2570
  // ── Variant Catalog ──────────────────────────────────────
2690
2571
  async listVariantCatalog(params = {}) {
2691
2572
  return client.listVariantCatalog(
2692
- create9(ListVariantCatalogRequestSchema, {
2573
+ create8(ListVariantCatalogRequestSchema, {
2693
2574
  isActive: params.isActive,
2694
2575
  limit: params.limit ?? 50,
2695
2576
  offset: params.offset ?? 0
@@ -2698,13 +2579,13 @@ function createSettingsMethods(client) {
2698
2579
  },
2699
2580
  async getVariantCatalogEntry(id) {
2700
2581
  const resp = await client.getVariantCatalogEntry(
2701
- create9(GetVariantCatalogEntryRequestSchema, { id })
2582
+ create8(GetVariantCatalogEntryRequestSchema, { id })
2702
2583
  );
2703
2584
  return resp.entry ?? null;
2704
2585
  },
2705
2586
  async createVariantCatalogEntry(params) {
2706
2587
  const resp = await client.createVariantCatalogEntry(
2707
- create9(CreateVariantCatalogEntryRequestSchema, {
2588
+ create8(CreateVariantCatalogEntryRequestSchema, {
2708
2589
  key: params.key,
2709
2590
  name: params.name,
2710
2591
  description: params.description,
@@ -2718,7 +2599,7 @@ function createSettingsMethods(client) {
2718
2599
  },
2719
2600
  async updateVariantCatalogEntry(params) {
2720
2601
  const resp = await client.updateVariantCatalogEntry(
2721
- create9(UpdateVariantCatalogEntryRequestSchema, {
2602
+ create8(UpdateVariantCatalogEntryRequestSchema, {
2722
2603
  id: params.id,
2723
2604
  name: params.name,
2724
2605
  description: params.description,
@@ -2732,14 +2613,14 @@ function createSettingsMethods(client) {
2732
2613
  },
2733
2614
  async deleteVariantCatalogEntry(id) {
2734
2615
  const resp = await client.deleteVariantCatalogEntry(
2735
- create9(DeleteVariantCatalogEntryRequestSchema, { id })
2616
+ create8(DeleteVariantCatalogEntryRequestSchema, { id })
2736
2617
  );
2737
2618
  return resp.success;
2738
2619
  },
2739
2620
  // ── Locales ──────────────────────────────────────────────
2740
2621
  async listLocales(params = {}) {
2741
2622
  return client.listLocales(
2742
- create9(ListLocalesRequestSchema, {
2623
+ create8(ListLocalesRequestSchema, {
2743
2624
  includeInactive: params.includeInactive,
2744
2625
  limit: params.limit ?? 50,
2745
2626
  offset: params.offset ?? 0
@@ -2748,25 +2629,25 @@ function createSettingsMethods(client) {
2748
2629
  },
2749
2630
  async getLocale(id) {
2750
2631
  const resp = await client.getLocale(
2751
- create9(GetLocaleRequestSchema, { id })
2632
+ create8(GetLocaleRequestSchema, { id })
2752
2633
  );
2753
2634
  return resp.locale ?? null;
2754
2635
  },
2755
2636
  async getLocaleByCode(code) {
2756
2637
  const resp = await client.getLocaleByCode(
2757
- create9(GetLocaleByCodeRequestSchema, { code })
2638
+ create8(GetLocaleByCodeRequestSchema, { code })
2758
2639
  );
2759
2640
  return resp.locale ?? null;
2760
2641
  },
2761
2642
  async getDefaultLocale() {
2762
2643
  const resp = await client.getDefaultLocale(
2763
- create9(GetDefaultLocaleRequestSchema, {})
2644
+ create8(GetDefaultLocaleRequestSchema, {})
2764
2645
  );
2765
2646
  return resp.locale ?? null;
2766
2647
  },
2767
2648
  async createLocale(params) {
2768
2649
  const resp = await client.createLocale(
2769
- create9(CreateLocaleRequestSchema, {
2650
+ create8(CreateLocaleRequestSchema, {
2770
2651
  locale: params.locale,
2771
2652
  displayName: params.displayName,
2772
2653
  nativeName: params.nativeName,
@@ -2779,7 +2660,7 @@ function createSettingsMethods(client) {
2779
2660
  },
2780
2661
  async updateLocale(params) {
2781
2662
  const resp = await client.updateLocale(
2782
- create9(UpdateLocaleRequestSchema, {
2663
+ create8(UpdateLocaleRequestSchema, {
2783
2664
  id: params.id,
2784
2665
  displayName: params.displayName,
2785
2666
  nativeName: params.nativeName,
@@ -2793,20 +2674,20 @@ function createSettingsMethods(client) {
2793
2674
  },
2794
2675
  async deleteLocale(id) {
2795
2676
  const resp = await client.deleteLocale(
2796
- create9(DeleteLocaleRequestSchema, { id })
2677
+ create8(DeleteLocaleRequestSchema, { id })
2797
2678
  );
2798
2679
  return resp.success;
2799
2680
  },
2800
2681
  // ── Nav Preferences ─────────────────────────────────────
2801
2682
  async getNavPreferences() {
2802
2683
  const resp = await client.getNavPreferences(
2803
- create9(GetNavPreferencesRequestSchema, {})
2684
+ create8(GetNavPreferencesRequestSchema, {})
2804
2685
  );
2805
2686
  return resp.preferences ?? null;
2806
2687
  },
2807
2688
  async updateNavPreferences(params) {
2808
2689
  const resp = await client.updateNavPreferences(
2809
- create9(UpdateNavPreferencesRequestSchema, {
2690
+ create8(UpdateNavPreferencesRequestSchema, {
2810
2691
  preferences: params.preferences ? {
2811
2692
  favoriteProjects: params.preferences.favoriteProjects,
2812
2693
  favoriteNavItems: params.preferences.favoriteNavItems,
@@ -2823,7 +2704,7 @@ function createSettingsMethods(client) {
2823
2704
  // ── Recently Opened ─────────────────────────────────────
2824
2705
  async listRecentlyOpened(limit) {
2825
2706
  const resp = await client.listRecentlyOpened(
2826
- create9(ListRecentlyOpenedRequestSchema, {
2707
+ create8(ListRecentlyOpenedRequestSchema, {
2827
2708
  limit: limit ?? 20
2828
2709
  })
2829
2710
  );
@@ -2831,7 +2712,7 @@ function createSettingsMethods(client) {
2831
2712
  },
2832
2713
  async trackRecentlyOpened(params) {
2833
2714
  const resp = await client.trackRecentlyOpened(
2834
- create9(TrackRecentlyOpenedRequestSchema, {
2715
+ create8(TrackRecentlyOpenedRequestSchema, {
2835
2716
  type: params.type,
2836
2717
  id: params.id,
2837
2718
  label: params.label,
@@ -2842,7 +2723,7 @@ function createSettingsMethods(client) {
2842
2723
  },
2843
2724
  async removeRecentlyOpened(params) {
2844
2725
  const resp = await client.removeRecentlyOpened(
2845
- create9(RemoveRecentlyOpenedRequestSchema, {
2726
+ create8(RemoveRecentlyOpenedRequestSchema, {
2846
2727
  type: params.type,
2847
2728
  id: params.id
2848
2729
  })
@@ -2851,14 +2732,14 @@ function createSettingsMethods(client) {
2851
2732
  },
2852
2733
  async clearRecentlyOpened() {
2853
2734
  const resp = await client.clearRecentlyOpened(
2854
- create9(ClearRecentlyOpenedRequestSchema, {})
2735
+ create8(ClearRecentlyOpenedRequestSchema, {})
2855
2736
  );
2856
2737
  return resp.success;
2857
2738
  },
2858
2739
  // ── Email Actions ──────────────────────────────────────────
2859
2740
  async listEmailActions(params = {}) {
2860
2741
  return client.listEmailActions(
2861
- create9(ListEmailActionsRequestSchema, {
2742
+ create8(ListEmailActionsRequestSchema, {
2862
2743
  limit: params.limit ?? 50,
2863
2744
  offset: params.offset ?? 0
2864
2745
  })
@@ -2866,7 +2747,7 @@ function createSettingsMethods(client) {
2866
2747
  },
2867
2748
  async updateEmailAction(params) {
2868
2749
  const resp = await client.updateEmailAction(
2869
- create9(UpdateEmailActionRequestSchema, {
2750
+ create8(UpdateEmailActionRequestSchema, {
2870
2751
  key: params.key,
2871
2752
  resendTemplateId: params.resendTemplateId,
2872
2753
  defaultFrom: params.defaultFrom,
@@ -2879,7 +2760,7 @@ function createSettingsMethods(client) {
2879
2760
  },
2880
2761
  async listResendTemplates() {
2881
2762
  const resp = await client.listResendTemplates(
2882
- create9(ListResendTemplatesRequestSchema, {})
2763
+ create8(ListResendTemplatesRequestSchema, {})
2883
2764
  );
2884
2765
  return resp.templates ?? [];
2885
2766
  }
@@ -2887,7 +2768,7 @@ function createSettingsMethods(client) {
2887
2768
  }
2888
2769
 
2889
2770
  // src/lib/rpc/storage.ts
2890
- import { create as create10 } from "@bufbuild/protobuf";
2771
+ import { create as create9 } from "@bufbuild/protobuf";
2891
2772
  import {
2892
2773
  CreateFileUploadRequestSchema,
2893
2774
  ConfirmFileUploadRequestSchema,
@@ -2907,7 +2788,7 @@ function createStorageMethods(client) {
2907
2788
  return {
2908
2789
  async createFileUpload(params) {
2909
2790
  return client.createFileUpload(
2910
- create10(CreateFileUploadRequestSchema, {
2791
+ create9(CreateFileUploadRequestSchema, {
2911
2792
  filename: params.filename,
2912
2793
  mimeType: params.mimeType,
2913
2794
  size: BigInt(params.size),
@@ -2917,17 +2798,17 @@ function createStorageMethods(client) {
2917
2798
  },
2918
2799
  async confirmFileUpload(uploadId) {
2919
2800
  const resp = await client.confirmFileUpload(
2920
- create10(ConfirmFileUploadRequestSchema, { uploadId })
2801
+ create9(ConfirmFileUploadRequestSchema, { uploadId })
2921
2802
  );
2922
2803
  return resp.file ?? null;
2923
2804
  },
2924
2805
  async getFile(id) {
2925
- const resp = await client.getFile(create10(GetFileRequestSchema, { id }));
2806
+ const resp = await client.getFile(create9(GetFileRequestSchema, { id }));
2926
2807
  return resp.file ?? null;
2927
2808
  },
2928
2809
  async listFiles(params) {
2929
2810
  return client.listFiles(
2930
- create10(ListFilesRequestSchema, {
2811
+ create9(ListFilesRequestSchema, {
2931
2812
  folder: params.folder,
2932
2813
  mimeType: params.mimeType,
2933
2814
  search: params.search,
@@ -2939,13 +2820,13 @@ function createStorageMethods(client) {
2939
2820
  },
2940
2821
  async getStorageUsage() {
2941
2822
  const resp = await client.getStorageUsage(
2942
- create10(GetStorageUsageRequestSchema, {})
2823
+ create9(GetStorageUsageRequestSchema, {})
2943
2824
  );
2944
2825
  return resp.usage ?? null;
2945
2826
  },
2946
2827
  async updateFile(params) {
2947
2828
  const resp = await client.updateFile(
2948
- create10(UpdateFileRequestSchema, {
2829
+ create9(UpdateFileRequestSchema, {
2949
2830
  id: params.id,
2950
2831
  filename: params.filename,
2951
2832
  folder: params.folder,
@@ -2956,7 +2837,7 @@ function createStorageMethods(client) {
2956
2837
  },
2957
2838
  async updateFileMetadata(params) {
2958
2839
  const resp = await client.updateFileMetadata(
2959
- create10(UpdateFileMetadataRequestSchema, {
2840
+ create9(UpdateFileMetadataRequestSchema, {
2960
2841
  id: params.id,
2961
2842
  altText: params.altText,
2962
2843
  caption: params.caption,
@@ -2967,37 +2848,37 @@ function createStorageMethods(client) {
2967
2848
  },
2968
2849
  async deleteFile(id) {
2969
2850
  const resp = await client.deleteFile(
2970
- create10(DeleteFileRequestSchema, { id })
2851
+ create9(DeleteFileRequestSchema, { id })
2971
2852
  );
2972
2853
  return resp.success;
2973
2854
  },
2974
2855
  async permanentlyDeleteFile(id) {
2975
2856
  const resp = await client.permanentlyDeleteFile(
2976
- create10(PermanentlyDeleteFileRequestSchema, { id })
2857
+ create9(PermanentlyDeleteFileRequestSchema, { id })
2977
2858
  );
2978
2859
  return resp.success;
2979
2860
  },
2980
2861
  async restoreFile(id) {
2981
2862
  const resp = await client.restoreFile(
2982
- create10(RestoreFileRequestSchema, { id })
2863
+ create9(RestoreFileRequestSchema, { id })
2983
2864
  );
2984
2865
  return resp.file ?? null;
2985
2866
  },
2986
2867
  async trackFileUsage(fileId, entityType) {
2987
2868
  const resp = await client.trackFileUsage(
2988
- create10(TrackFileUsageRequestSchema, { fileId, entityType })
2869
+ create9(TrackFileUsageRequestSchema, { fileId, entityType })
2989
2870
  );
2990
2871
  return resp.file ?? null;
2991
2872
  },
2992
2873
  async removeFileUsage(fileId, entityType) {
2993
2874
  const resp = await client.removeFileUsage(
2994
- create10(RemoveFileUsageRequestSchema, { fileId, entityType })
2875
+ create9(RemoveFileUsageRequestSchema, { fileId, entityType })
2995
2876
  );
2996
2877
  return resp.success;
2997
2878
  },
2998
2879
  async cleanupOrphanedFiles(params) {
2999
2880
  return client.cleanupOrphanedFiles(
3000
- create10(CleanupOrphanedFilesRequestSchema, {
2881
+ create9(CleanupOrphanedFilesRequestSchema, {
3001
2882
  orphanThresholdDays: params?.orphanThresholdDays ?? 30,
3002
2883
  dryRun: params?.dryRun ?? false,
3003
2884
  limit: params?.limit ?? 100
@@ -3008,7 +2889,7 @@ function createStorageMethods(client) {
3008
2889
  }
3009
2890
 
3010
2891
  // src/lib/rpc/operations.ts
3011
- import { create as create11 } from "@bufbuild/protobuf";
2892
+ import { create as create10 } from "@bufbuild/protobuf";
3012
2893
  import {
3013
2894
  ListOperationsRequestSchema as ListOperationsRequestSchema2,
3014
2895
  GetOperationRequestSchema,
@@ -3026,7 +2907,7 @@ function createOperationsMethods(client) {
3026
2907
  // ── CRUD ──────────────────────────────────────────────────
3027
2908
  async listOperations(params = {}) {
3028
2909
  return client.listOperations(
3029
- create11(ListOperationsRequestSchema2, {
2910
+ create10(ListOperationsRequestSchema2, {
3030
2911
  configId: params.configId,
3031
2912
  category: params.category,
3032
2913
  isActive: params.isActive,
@@ -3038,7 +2919,7 @@ function createOperationsMethods(client) {
3038
2919
  },
3039
2920
  async getOperation(params) {
3040
2921
  const resp = await client.getOperation(
3041
- create11(GetOperationRequestSchema, {
2922
+ create10(GetOperationRequestSchema, {
3042
2923
  id: params.id ?? "",
3043
2924
  key: params.key
3044
2925
  })
@@ -3047,7 +2928,7 @@ function createOperationsMethods(client) {
3047
2928
  },
3048
2929
  async createOperation(params) {
3049
2930
  const resp = await client.createOperation(
3050
- create11(CreateOperationRequestSchema, {
2931
+ create10(CreateOperationRequestSchema, {
3051
2932
  key: params.key,
3052
2933
  name: params.name,
3053
2934
  endpoint: params.endpoint,
@@ -3071,7 +2952,7 @@ function createOperationsMethods(client) {
3071
2952
  },
3072
2953
  async updateOperation(params) {
3073
2954
  const resp = await client.updateOperation(
3074
- create11(UpdateOperationRequestSchema, {
2955
+ create10(UpdateOperationRequestSchema, {
3075
2956
  id: params.id,
3076
2957
  name: params.name,
3077
2958
  description: params.description,
@@ -3092,20 +2973,20 @@ function createOperationsMethods(client) {
3092
2973
  },
3093
2974
  async deleteOperation(id) {
3094
2975
  const resp = await client.deleteOperation(
3095
- create11(DeleteOperationRequestSchema, { id })
2976
+ create10(DeleteOperationRequestSchema, { id })
3096
2977
  );
3097
2978
  return resp.success;
3098
2979
  },
3099
2980
  async getSigningSecret() {
3100
2981
  const resp = await client.getSigningSecret(
3101
- create11(GetSigningSecretRequestSchema, {})
2982
+ create10(GetSigningSecretRequestSchema, {})
3102
2983
  );
3103
2984
  return { secret: resp.secret, prefix: resp.prefix };
3104
2985
  },
3105
2986
  // ── Execution ─────────────────────────────────────────────
3106
2987
  async executeOperation(params) {
3107
2988
  return client.executeOperation(
3108
- create11(ExecuteOperationRequestSchema, {
2989
+ create10(ExecuteOperationRequestSchema, {
3109
2990
  operationKey: params.operationKey,
3110
2991
  input: params.input,
3111
2992
  triggerType: params.triggerType,
@@ -3116,7 +2997,7 @@ function createOperationsMethods(client) {
3116
2997
  // ── Dead Letter Queue ─────────────────────────────────────
3117
2998
  async listDeadLetterEntries(params = {}) {
3118
2999
  return client.listDeadLetterEntries(
3119
- create11(ListDeadLetterEntriesRequestSchema, {
3000
+ create10(ListDeadLetterEntriesRequestSchema, {
3120
3001
  operationKey: params.operationKey,
3121
3002
  limit: params.limit ?? 50,
3122
3003
  offset: params.offset ?? 0
@@ -3125,13 +3006,13 @@ function createOperationsMethods(client) {
3125
3006
  },
3126
3007
  async retryDeadLetterEntry(id) {
3127
3008
  const resp = await client.retryDeadLetterEntry(
3128
- create11(RetryDeadLetterEntryRequestSchema, { id })
3009
+ create10(RetryDeadLetterEntryRequestSchema, { id })
3129
3010
  );
3130
3011
  return resp.success;
3131
3012
  },
3132
3013
  async dismissDeadLetterEntry(id) {
3133
3014
  const resp = await client.dismissDeadLetterEntry(
3134
- create11(DismissDeadLetterEntryRequestSchema, { id })
3015
+ create10(DismissDeadLetterEntryRequestSchema, { id })
3135
3016
  );
3136
3017
  return resp.success;
3137
3018
  }
@@ -3139,7 +3020,7 @@ function createOperationsMethods(client) {
3139
3020
  }
3140
3021
 
3141
3022
  // src/lib/rpc/hooks.ts
3142
- import { create as create12 } from "@bufbuild/protobuf";
3023
+ import { create as create11 } from "@bufbuild/protobuf";
3143
3024
  import {
3144
3025
  ListHooksRequestSchema,
3145
3026
  GetHookRequestSchema,
@@ -3156,7 +3037,7 @@ function createHooksMethods(client) {
3156
3037
  // ── Queries ──────────────────────────────────────────────
3157
3038
  async listHooks(params = {}) {
3158
3039
  return client.listHooks(
3159
- create12(ListHooksRequestSchema, {
3040
+ create11(ListHooksRequestSchema, {
3160
3041
  event: params.event,
3161
3042
  isActive: params.isActive,
3162
3043
  configId: params.configId,
@@ -3166,13 +3047,13 @@ function createHooksMethods(client) {
3166
3047
  );
3167
3048
  },
3168
3049
  async getHook(id) {
3169
- const resp = await client.getHook(create12(GetHookRequestSchema, { id }));
3050
+ const resp = await client.getHook(create11(GetHookRequestSchema, { id }));
3170
3051
  return resp.hook ?? null;
3171
3052
  },
3172
3053
  // ── Mutations ────────────────────────────────────────────
3173
3054
  async createHook(params) {
3174
3055
  const resp = await client.createHook(
3175
- create12(CreateHookRequestSchema, {
3056
+ create11(CreateHookRequestSchema, {
3176
3057
  key: params.key,
3177
3058
  name: params.name,
3178
3059
  event: params.event,
@@ -3188,7 +3069,7 @@ function createHooksMethods(client) {
3188
3069
  },
3189
3070
  async updateHook(params) {
3190
3071
  const resp = await client.updateHook(
3191
- create12(UpdateHookRequestSchema, {
3072
+ create11(UpdateHookRequestSchema, {
3192
3073
  id: params.id,
3193
3074
  name: params.name,
3194
3075
  description: params.description,
@@ -3202,21 +3083,21 @@ function createHooksMethods(client) {
3202
3083
  },
3203
3084
  async deleteHook(id) {
3204
3085
  const resp = await client.deleteHook(
3205
- create12(DeleteHookRequestSchema, { id })
3086
+ create11(DeleteHookRequestSchema, { id })
3206
3087
  );
3207
3088
  return resp.success;
3208
3089
  },
3209
3090
  // ── Get by Key ──────────────────────────────────────────
3210
3091
  async getHookByKey(key) {
3211
3092
  const resp = await client.getHookByKey(
3212
- create12(GetHookByKeyRequestSchema, { key })
3093
+ create11(GetHookByKeyRequestSchema, { key })
3213
3094
  );
3214
3095
  return resp.hook ?? null;
3215
3096
  },
3216
3097
  // ── Deliveries ──────────────────────────────────────────
3217
3098
  async listHookDeliveries(params) {
3218
3099
  return client.listHookDeliveries(
3219
- create12(ListHookDeliveriesRequestSchema, {
3100
+ create11(ListHookDeliveriesRequestSchema, {
3220
3101
  hookId: params.hookId,
3221
3102
  status: params.status,
3222
3103
  limit: params.limit ?? 50,
@@ -3226,14 +3107,14 @@ function createHooksMethods(client) {
3226
3107
  },
3227
3108
  async retryHookDelivery(deliveryId) {
3228
3109
  const resp = await client.retryHookDelivery(
3229
- create12(RetryHookDeliveryRequestSchema, { deliveryId })
3110
+ create11(RetryHookDeliveryRequestSchema, { deliveryId })
3230
3111
  );
3231
3112
  return resp.success;
3232
3113
  },
3233
3114
  // ── Testing ─────────────────────────────────────────────
3234
3115
  async testHook(params) {
3235
3116
  const resp = await client.testHook(
3236
- create12(TestHookRequestSchema, {
3117
+ create11(TestHookRequestSchema, {
3237
3118
  hookId: params.hookId,
3238
3119
  testPayload: params.testPayload
3239
3120
  })
@@ -3247,7 +3128,7 @@ function createHooksMethods(client) {
3247
3128
  }
3248
3129
 
3249
3130
  // src/lib/rpc/notifications.ts
3250
- import { create as create13 } from "@bufbuild/protobuf";
3131
+ import { create as create12 } from "@bufbuild/protobuf";
3251
3132
  import {
3252
3133
  ListNotificationsRequestSchema,
3253
3134
  MarkNotificationReadRequestSchema,
@@ -3257,7 +3138,7 @@ function createNotificationsMethods(client) {
3257
3138
  return {
3258
3139
  async listNotifications(params = {}) {
3259
3140
  return client.listNotifications(
3260
- create13(ListNotificationsRequestSchema, {
3141
+ create12(ListNotificationsRequestSchema, {
3261
3142
  isRead: params.unreadOnly ? false : void 0,
3262
3143
  limit: params.limit ?? 20,
3263
3144
  offset: params.offset ?? 0
@@ -3266,13 +3147,13 @@ function createNotificationsMethods(client) {
3266
3147
  },
3267
3148
  async markNotificationRead(id) {
3268
3149
  const resp = await client.markNotificationRead(
3269
- create13(MarkNotificationReadRequestSchema, { id })
3150
+ create12(MarkNotificationReadRequestSchema, { id })
3270
3151
  );
3271
3152
  return resp.success;
3272
3153
  },
3273
3154
  async markAllNotificationsRead() {
3274
3155
  const resp = await client.markAllNotificationsRead(
3275
- create13(MarkAllNotificationsReadRequestSchema, {})
3156
+ create12(MarkAllNotificationsReadRequestSchema, {})
3276
3157
  );
3277
3158
  return resp.count;
3278
3159
  }
@@ -3280,7 +3161,7 @@ function createNotificationsMethods(client) {
3280
3161
  }
3281
3162
 
3282
3163
  // src/lib/rpc/cron-schedules.ts
3283
- import { create as create14 } from "@bufbuild/protobuf";
3164
+ import { create as create13 } from "@bufbuild/protobuf";
3284
3165
  import {
3285
3166
  ListCronSchedulesRequestSchema,
3286
3167
  GetCronScheduleRequestSchema,
@@ -3297,7 +3178,7 @@ function createCronSchedulesMethods(client) {
3297
3178
  // ── Queries ──────────────────────────────────────────────
3298
3179
  async listCronSchedules(params = {}) {
3299
3180
  return client.listCronSchedules(
3300
- create14(ListCronSchedulesRequestSchema, {
3181
+ create13(ListCronSchedulesRequestSchema, {
3301
3182
  configId: params.configId,
3302
3183
  isActive: params.isActive,
3303
3184
  limit: params.limit ?? 50,
@@ -3307,20 +3188,20 @@ function createCronSchedulesMethods(client) {
3307
3188
  },
3308
3189
  async getCronSchedule(id) {
3309
3190
  const resp = await client.getCronSchedule(
3310
- create14(GetCronScheduleRequestSchema, { id })
3191
+ create13(GetCronScheduleRequestSchema, { id })
3311
3192
  );
3312
3193
  return resp.schedule ?? null;
3313
3194
  },
3314
3195
  async getCronScheduleByKey(key) {
3315
3196
  const resp = await client.getCronScheduleByKey(
3316
- create14(GetCronScheduleByKeyRequestSchema, { key })
3197
+ create13(GetCronScheduleByKeyRequestSchema, { key })
3317
3198
  );
3318
3199
  return resp.schedule ?? null;
3319
3200
  },
3320
3201
  // ── Mutations ────────────────────────────────────────────
3321
3202
  async createCronSchedule(params) {
3322
3203
  const resp = await client.createCronSchedule(
3323
- create14(CreateCronScheduleRequestSchema, {
3204
+ create13(CreateCronScheduleRequestSchema, {
3324
3205
  key: params.key,
3325
3206
  name: params.name,
3326
3207
  description: params.description,
@@ -3334,7 +3215,7 @@ function createCronSchedulesMethods(client) {
3334
3215
  },
3335
3216
  async updateCronSchedule(params) {
3336
3217
  const resp = await client.updateCronSchedule(
3337
- create14(UpdateCronScheduleRequestSchema, {
3218
+ create13(UpdateCronScheduleRequestSchema, {
3338
3219
  id: params.id,
3339
3220
  name: params.name,
3340
3221
  description: params.description,
@@ -3348,25 +3229,25 @@ function createCronSchedulesMethods(client) {
3348
3229
  },
3349
3230
  async deleteCronSchedule(id) {
3350
3231
  const resp = await client.deleteCronSchedule(
3351
- create14(DeleteCronScheduleRequestSchema, { id })
3232
+ create13(DeleteCronScheduleRequestSchema, { id })
3352
3233
  );
3353
3234
  return resp.success;
3354
3235
  },
3355
3236
  async pauseCronSchedule(params) {
3356
3237
  const resp = await client.pauseCronSchedule(
3357
- create14(PauseCronScheduleRequestSchema, { id: params.id })
3238
+ create13(PauseCronScheduleRequestSchema, { id: params.id })
3358
3239
  );
3359
3240
  return resp.schedule ?? null;
3360
3241
  },
3361
3242
  async resumeCronSchedule(params) {
3362
3243
  const resp = await client.resumeCronSchedule(
3363
- create14(ResumeCronScheduleRequestSchema, { id: params.id })
3244
+ create13(ResumeCronScheduleRequestSchema, { id: params.id })
3364
3245
  );
3365
3246
  return resp.schedule ?? null;
3366
3247
  },
3367
3248
  async triggerCronSchedule(params) {
3368
3249
  const resp = await client.triggerCronSchedule(
3369
- create14(TriggerCronScheduleRequestSchema, { id: params.id })
3250
+ create13(TriggerCronScheduleRequestSchema, { id: params.id })
3370
3251
  );
3371
3252
  return resp.schedule ?? null;
3372
3253
  }
@@ -3432,9 +3313,6 @@ async function createPlatformClient(options) {
3432
3313
  cronSchedules: createCronSchedulesMethods(
3433
3314
  createRpcClient(SchedulesService2, transport)
3434
3315
  ),
3435
- integrations: createIntegrationsMethods(
3436
- createRpcClient(IntegrationsService2, transport)
3437
- ),
3438
3316
  apps: createAppsMethods(createRpcClient(AppsService2, transport))
3439
3317
  };
3440
3318
  }
@@ -3471,9 +3349,6 @@ function createPlatformClientWithHeaders(apiUrl, headers) {
3471
3349
  cronSchedules: createCronSchedulesMethods(
3472
3350
  createRpcClient(SchedulesService2, transport)
3473
3351
  ),
3474
- integrations: createIntegrationsMethods(
3475
- createRpcClient(IntegrationsService2, transport)
3476
- ),
3477
3352
  apps: createAppsMethods(createRpcClient(AppsService2, transport))
3478
3353
  };
3479
3354
  }
@@ -5534,275 +5409,6 @@ function toPlacementFieldChoices(input) {
5534
5409
  return out;
5535
5410
  }
5536
5411
 
5537
- // src/lib/validate-integrations.ts
5538
- import { fromJson as fromJson3 } from "@bufbuild/protobuf";
5539
- import { pathToString } from "@bufbuild/protobuf/reflect";
5540
- import { createValidator } from "@bufbuild/protovalidate";
5541
- import {
5542
- IntegrationConfigSchema,
5543
- ExtensionConfigSchema
5544
- } from "@eide/foir-proto-ts/integrations/v1/integrations_pb";
5545
- var IntegrationValidationError = class extends Error {
5546
- errors;
5547
- constructor(errors) {
5548
- super(
5549
- `foir.config.ts failed validation:
5550
- ${errors.map((e) => ` - ${e}`).join("\n")}`
5551
- );
5552
- this.name = "IntegrationValidationError";
5553
- this.errors = errors;
5554
- }
5555
- };
5556
- var validator = createValidator();
5557
- function validateIntegrationsAndExtensions(manifest) {
5558
- const errors = [];
5559
- const warnings = [];
5560
- const modelsByKey = /* @__PURE__ */ new Map();
5561
- for (const model of manifest.models ?? []) {
5562
- modelsByKey.set(model.key, model);
5563
- }
5564
- if (manifest.integrations) {
5565
- for (const [name, integration] of Object.entries(manifest.integrations)) {
5566
- validateIntegration(name, integration, modelsByKey, errors, warnings);
5567
- }
5568
- }
5569
- if (manifest.extensions) {
5570
- for (const [name, extension] of Object.entries(manifest.extensions)) {
5571
- validateExtension(name, extension, modelsByKey, errors);
5572
- }
5573
- }
5574
- return { errors, warnings };
5575
- }
5576
- function assertValid(result) {
5577
- if (result.errors.length > 0) {
5578
- throw new IntegrationValidationError(result.errors);
5579
- }
5580
- }
5581
- function validateIntegration(name, integration, modelsByKey, errors, warnings) {
5582
- const prefix = `integration '${name}'`;
5583
- const protoJson = toIntegrationProtoJson(name, integration);
5584
- const structuralErrors = runProtoValidation(
5585
- prefix,
5586
- protoJson,
5587
- (json) => fromJson3(IntegrationConfigSchema, json, { ignoreUnknownFields: true })
5588
- );
5589
- errors.push(...structuralErrors);
5590
- const sync = integration.sync ?? {};
5591
- for (const [sourceType, mapping] of Object.entries(sync)) {
5592
- validateSyncMapping(
5593
- `${prefix} sync.${sourceType}`,
5594
- mapping,
5595
- name,
5596
- modelsByKey,
5597
- errors,
5598
- warnings
5599
- );
5600
- }
5601
- }
5602
- function validateSyncMapping(prefix, mapping, integrationName, modelsByKey, errors, warnings) {
5603
- const model = mapping.model ? modelsByKey.get(mapping.model) : void 0;
5604
- const seed = mapping.modelSeed;
5605
- if (!mapping.model) {
5606
- return;
5607
- }
5608
- if (!model && !seed) {
5609
- errors.push(
5610
- `${prefix}: missing model '${mapping.model}' referenced by integration '${integrationName}' \u2014 declare it under models or provide a modelSeed`
5611
- );
5612
- return;
5613
- }
5614
- const fieldKeys = model ? new Set((model.fields ?? []).map((f) => f.key)) : new Set(Object.keys(seed?.fields ?? {}));
5615
- if (mapping.naturalKey && !fieldKeys.has(mapping.naturalKey)) {
5616
- errors.push(
5617
- `${prefix}: naturalKey '${mapping.naturalKey}' does not exist on ${model ? `model '${mapping.model}'` : `modelSeed for '${mapping.model}'`}`
5618
- );
5619
- }
5620
- const fields = mapping.fields ?? {};
5621
- for (const [sourceField, foirField] of Object.entries(fields)) {
5622
- if (!foirField) continue;
5623
- if (!fieldKeys.has(foirField)) {
5624
- errors.push(
5625
- `${prefix}: field mapping '${sourceField} -> ${foirField}' references field '${foirField}' which does not exist on ${model ? `model '${mapping.model}'` : `modelSeed for '${mapping.model}'`}`
5626
- );
5627
- }
5628
- }
5629
- if (seed && model) {
5630
- detectSeedDrift(prefix, seed, model, warnings);
5631
- }
5632
- }
5633
- function detectSeedDrift(prefix, seed, model, warnings) {
5634
- const modelFieldTypes = /* @__PURE__ */ new Map();
5635
- for (const field of model.fields ?? []) {
5636
- modelFieldTypes.set(field.key, field.type);
5637
- }
5638
- for (const [key, field] of Object.entries(seed.fields ?? {})) {
5639
- const modelType = modelFieldTypes.get(key);
5640
- if (!modelType) {
5641
- warnings.push(
5642
- `${prefix}: modelSeed.fields.${key} is not present on existing model \u2014 modelSeed is ignored on subsequent pushes`
5643
- );
5644
- } else if (field.type && modelType !== field.type) {
5645
- warnings.push(
5646
- `${prefix}: modelSeed.fields.${key}.type '${field.type}' disagrees with existing model field type '${modelType}' \u2014 modelSeed is ignored on subsequent pushes`
5647
- );
5648
- }
5649
- }
5650
- }
5651
- function validateExtension(name, extension, modelsByKey, errors) {
5652
- const prefix = `extension '${name}'`;
5653
- const protoJson = toExtensionProtoJson(name, extension);
5654
- const structuralErrors = runProtoValidation(
5655
- prefix,
5656
- protoJson,
5657
- (json) => fromJson3(ExtensionConfigSchema, json, { ignoreUnknownFields: true })
5658
- );
5659
- errors.push(...structuralErrors);
5660
- const placements = extension.placements ?? [];
5661
- placements.forEach((placement, index) => {
5662
- if (placement.model && !modelsByKey.has(placement.model)) {
5663
- errors.push(
5664
- `${prefix} placements[${index}]: missing model '${placement.model}' referenced by extension '${name}'`
5665
- );
5666
- }
5667
- });
5668
- }
5669
- function runProtoValidation(prefix, json, decode) {
5670
- let message;
5671
- try {
5672
- message = decode(json);
5673
- } catch (err) {
5674
- const msg = err instanceof Error ? err.message : String(err);
5675
- return [`${prefix}: cannot decode as proto \u2014 ${msg}`];
5676
- }
5677
- const result = runValidate(message);
5678
- if (result.kind === "valid") return [];
5679
- if (result.kind === "error") {
5680
- return [`${prefix}: validator error \u2014 ${result.error.message}`];
5681
- }
5682
- return result.violations.map((v) => `${prefix}: ${formatViolation(v)}`);
5683
- }
5684
- function runValidate(message) {
5685
- if (!message || typeof message !== "object") {
5686
- return { kind: "error", error: new Error("message is not an object") };
5687
- }
5688
- const anyMsg = message;
5689
- let schema;
5690
- if (anyMsg.$typeName === "integrations.v1.IntegrationConfig") {
5691
- schema = IntegrationConfigSchema;
5692
- } else if (anyMsg.$typeName === "integrations.v1.ExtensionConfig") {
5693
- schema = ExtensionConfigSchema;
5694
- } else {
5695
- return { kind: "error", error: new Error(`unknown message type ${anyMsg.$typeName ?? "?"}`) };
5696
- }
5697
- const result = validator.validate(
5698
- // Both schema/message casts are safe because we picked schema by $typeName.
5699
- schema,
5700
- message
5701
- );
5702
- if (result.kind === "valid") return { kind: "valid" };
5703
- if (result.kind === "error") return { kind: "error", error: result.error };
5704
- return { kind: "invalid", violations: result.violations };
5705
- }
5706
- function formatViolation(v) {
5707
- let path3 = "";
5708
- try {
5709
- path3 = pathToString(v.field);
5710
- } catch {
5711
- path3 = "";
5712
- }
5713
- const message = v.message ?? "";
5714
- return path3 ? `${path3}: ${message}` : message;
5715
- }
5716
- function compact(obj) {
5717
- const out = {};
5718
- for (const [k, v] of Object.entries(obj)) {
5719
- if (v !== void 0) out[k] = v;
5720
- }
5721
- return out;
5722
- }
5723
- function toIntegrationProtoJson(name, integration) {
5724
- return compact({
5725
- name,
5726
- enabled: integration.enabled ?? true,
5727
- middleware: integration.middleware ? { url: integration.middleware.url ?? "" } : void 0,
5728
- credentials: {
5729
- strategy: integration.credentials?.strategy ? credentialStrategyToProto(integration.credentials.strategy) : "CREDENTIAL_STRATEGY_UNSPECIFIED"
5730
- },
5731
- sync: integration.sync ? Object.fromEntries(
5732
- Object.entries(integration.sync).map(([k, v]) => [k, syncMappingToProto(v)])
5733
- ) : {},
5734
- settings: integration.settings,
5735
- metadata: integration.metadata
5736
- });
5737
- }
5738
- function syncMappingToProto(mapping) {
5739
- return compact({
5740
- model: mapping.model ?? "",
5741
- naturalKey: mapping.naturalKey ?? "",
5742
- fields: mapping.fields ?? {},
5743
- modelSeed: mapping.modelSeed ? {
5744
- fields: Object.fromEntries(
5745
- Object.entries(mapping.modelSeed.fields ?? {}).map(([k, v]) => [
5746
- k,
5747
- compact({
5748
- type: v.type ?? "",
5749
- required: v.required ?? false,
5750
- naturalKey: v.naturalKey ?? false,
5751
- label: v.label,
5752
- helpText: v.helpText,
5753
- config: v.config
5754
- })
5755
- ])
5756
- )
5757
- } : void 0
5758
- });
5759
- }
5760
- function credentialStrategyToProto(strategy) {
5761
- switch (strategy) {
5762
- case "oauth":
5763
- return "CREDENTIAL_STRATEGY_OAUTH";
5764
- case "api_key":
5765
- return "CREDENTIAL_STRATEGY_API_KEY";
5766
- case "shared_secret":
5767
- return "CREDENTIAL_STRATEGY_SHARED_SECRET";
5768
- case "ssh_key":
5769
- return "CREDENTIAL_STRATEGY_SSH_KEY";
5770
- case "none":
5771
- return "CREDENTIAL_STRATEGY_NONE";
5772
- case "managed":
5773
- return "CREDENTIAL_STRATEGY_MANAGED";
5774
- default:
5775
- return "CREDENTIAL_STRATEGY_UNSPECIFIED";
5776
- }
5777
- }
5778
- function toExtensionProtoJson(name, extension) {
5779
- const placements = (extension.placements ?? []).map(
5780
- (p) => compact({
5781
- target: extensionTargetToProto(p.target),
5782
- model: p.model ?? "",
5783
- tab: p.tab ?? "",
5784
- title: p.title ?? "",
5785
- hints: p.hints
5786
- })
5787
- );
5788
- return compact({
5789
- name,
5790
- url: extension.url ?? "",
5791
- placements,
5792
- metadata: extension.metadata
5793
- });
5794
- }
5795
- function extensionTargetToProto(target) {
5796
- switch (target) {
5797
- case "record":
5798
- return "EXTENSION_TARGET_RECORD";
5799
- case "model-list":
5800
- return "EXTENSION_TARGET_MODEL_LIST";
5801
- default:
5802
- return "EXTENSION_TARGET_UNSPECIFIED";
5803
- }
5804
- }
5805
-
5806
5412
  // src/commands/push.ts
5807
5413
  var CONFIG_FILE_NAMES = [
5808
5414
  "foir.config.ts",
@@ -5884,11 +5490,6 @@ function registerPushCommand(program2, globalOpts) {
5884
5490
  'Config must have at least "key" and "name" fields.'
5885
5491
  );
5886
5492
  }
5887
- const validation = validateIntegrationsAndExtensions(config2);
5888
- for (const warning of validation.warnings) {
5889
- console.log(chalk6.yellow(`\u26A0 ${warning}`));
5890
- }
5891
- assertValid(validation);
5892
5493
  const gOpts = globalOpts();
5893
5494
  const client = await createPlatformClient(gOpts);
5894
5495
  const resolved = await resolveProjectContext(gOpts);
@@ -6015,26 +5616,10 @@ function registerPullCommand(program2, globalOpts) {
6015
5616
  );
6016
5617
  }
6017
5618
  const resolved = await resolveProjectContext(globalOpts());
6018
- let integrations;
6019
- let extensions;
6020
5619
  let apps;
6021
5620
  if (resolved) {
6022
5621
  const projectId = resolved.project.id;
6023
5622
  const tenantId = resolved.project.tenantId;
6024
- const protoIntegrations = await client.integrations.listIntegrations(projectId);
6025
- if (protoIntegrations.length > 0) {
6026
- integrations = {};
6027
- for (const cfg of protoIntegrations) {
6028
- integrations[cfg.name] = integrationConfigToInput(cfg);
6029
- }
6030
- }
6031
- const protoExtensions = await client.integrations.listExtensions(projectId);
6032
- if (protoExtensions.length > 0) {
6033
- extensions = {};
6034
- for (const cfg of protoExtensions) {
6035
- extensions[cfg.name] = extensionConfigToInput(cfg);
6036
- }
6037
- }
6038
5623
  const installedApps = await client.apps.listApps(tenantId, projectId);
6039
5624
  if (installedApps.length > 0) {
6040
5625
  apps = {};
@@ -6044,8 +5629,6 @@ function registerPullCommand(program2, globalOpts) {
6044
5629
  }
6045
5630
  }
6046
5631
  const configDataNoInteg = { ...configData };
6047
- delete configDataNoInteg.integrations;
6048
- delete configDataNoInteg.extensions;
6049
5632
  delete configDataNoInteg.apps;
6050
5633
  const manifest = {
6051
5634
  key: config2.key,
@@ -6055,8 +5638,6 @@ function registerPullCommand(program2, globalOpts) {
6055
5638
  ...config2.description ? { description: config2.description } : {},
6056
5639
  ...config2.connectionDomain ? { operationBaseUrl: config2.connectionDomain } : {},
6057
5640
  ...configDataNoInteg,
6058
- ...integrations ? { integrations } : {},
6059
- ...extensions ? { extensions } : {},
6060
5641
  ...apps ? { apps } : {}
6061
5642
  };
6062
5643
  delete manifest.force;
@@ -6104,12 +5685,6 @@ export default defineConfig(${jsonContent});
6104
5685
  if (schedules.length > 0) parts.push(`${schedules.length} schedule(s)`);
6105
5686
  if (authProviders.length > 0) parts.push(`${authProviders.length} auth provider(s)`);
6106
5687
  if (configData.customerProfileSchema) parts.push("customer profile schema");
6107
- if (integrations && Object.keys(integrations).length > 0) {
6108
- parts.push(`${Object.keys(integrations).length} integration(s)`);
6109
- }
6110
- if (extensions && Object.keys(extensions).length > 0) {
6111
- parts.push(`${Object.keys(extensions).length} extension(s)`);
6112
- }
6113
5688
  if (apps) {
6114
5689
  parts.push(`${Object.keys(apps).length} app(s)`);
6115
5690
  }
@@ -8446,7 +8021,7 @@ function registerNotificationsCommands(program2, globalOpts) {
8446
8021
 
8447
8022
  // src/commands/configs.ts
8448
8023
  function registerConfigsCommands(program2, globalOpts) {
8449
- const configs = program2.command("configs").description("Manage configs (integrations, extensions, webhooks)");
8024
+ const configs = program2.command("configs").description("Manage configs (apps, webhooks)");
8450
8025
  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(
8451
8026
  withErrorHandler(globalOpts, async (cmdOpts) => {
8452
8027
  const opts = globalOpts();