@eide/foir-cli 0.10.0 → 0.10.1
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 +206 -634
- package/dist/lib/config-helpers.d.ts +1 -63
- package/dist/lib/config-helpers.js +0 -10
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -468,7 +468,6 @@ import { OperationsService as OperationsService2 } from "@eide/foir-proto-ts/ope
|
|
|
468
468
|
import { HooksService as HooksService2 } from "@eide/foir-proto-ts/hooks/v1/hooks_pb";
|
|
469
469
|
import { NotificationsService as NotificationsService2 } from "@eide/foir-proto-ts/notifications/v1/notifications_pb";
|
|
470
470
|
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
471
|
import { AppsService as AppsService2 } from "@eide/foir-proto-ts/apps/v1/apps_service_pb";
|
|
473
472
|
|
|
474
473
|
// src/lib/rpc/identity.ts
|
|
@@ -1146,129 +1145,8 @@ function createIdentityMethods(client) {
|
|
|
1146
1145
|
};
|
|
1147
1146
|
}
|
|
1148
1147
|
|
|
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
1148
|
// src/lib/rpc/apps.ts
|
|
1271
|
-
import { create as
|
|
1149
|
+
import { create as create2 } from "@bufbuild/protobuf";
|
|
1272
1150
|
import {
|
|
1273
1151
|
ListAppsRequestSchema,
|
|
1274
1152
|
GetAppRequestSchema,
|
|
@@ -1285,24 +1163,24 @@ function createAppsMethods(client) {
|
|
|
1285
1163
|
return {
|
|
1286
1164
|
async listApps(tenantId, projectId) {
|
|
1287
1165
|
const resp = await client.listApps(
|
|
1288
|
-
|
|
1166
|
+
create2(ListAppsRequestSchema, { tenantId, projectId })
|
|
1289
1167
|
);
|
|
1290
1168
|
return resp.apps;
|
|
1291
1169
|
},
|
|
1292
1170
|
async getApp(tenantId, projectId, name) {
|
|
1293
1171
|
const resp = await client.getApp(
|
|
1294
|
-
|
|
1172
|
+
create2(GetAppRequestSchema, { tenantId, projectId, name })
|
|
1295
1173
|
);
|
|
1296
1174
|
return resp.app ?? null;
|
|
1297
1175
|
},
|
|
1298
1176
|
async installApp(tenantId, projectId, manifestUrl) {
|
|
1299
1177
|
return client.installApp(
|
|
1300
|
-
|
|
1178
|
+
create2(InstallAppRequestSchema, { tenantId, projectId, manifestUrl })
|
|
1301
1179
|
);
|
|
1302
1180
|
},
|
|
1303
1181
|
async confirmInstallApp(params) {
|
|
1304
1182
|
const resp = await client.confirmInstallApp(
|
|
1305
|
-
|
|
1183
|
+
create2(ConfirmInstallAppRequestSchema, {
|
|
1306
1184
|
installTicket: params.installTicket,
|
|
1307
1185
|
sourceMappings: params.sourceMappings ?? {},
|
|
1308
1186
|
sinkMappings: params.sinkMappings ?? {},
|
|
@@ -1314,12 +1192,12 @@ function createAppsMethods(client) {
|
|
|
1314
1192
|
},
|
|
1315
1193
|
async updateApp(tenantId, projectId, name) {
|
|
1316
1194
|
return client.updateApp(
|
|
1317
|
-
|
|
1195
|
+
create2(UpdateAppRequestSchema, { tenantId, projectId, name })
|
|
1318
1196
|
);
|
|
1319
1197
|
},
|
|
1320
1198
|
async confirmUpdateApp(tenantId, projectId, name, newManifestHash) {
|
|
1321
1199
|
const resp = await client.confirmUpdateApp(
|
|
1322
|
-
|
|
1200
|
+
create2(ConfirmUpdateAppRequestSchema, {
|
|
1323
1201
|
tenantId,
|
|
1324
1202
|
projectId,
|
|
1325
1203
|
name,
|
|
@@ -1330,12 +1208,12 @@ function createAppsMethods(client) {
|
|
|
1330
1208
|
},
|
|
1331
1209
|
async uninstallApp(tenantId, projectId, name, force = false) {
|
|
1332
1210
|
return client.uninstallApp(
|
|
1333
|
-
|
|
1211
|
+
create2(UninstallAppRequestSchema, { tenantId, projectId, name, force })
|
|
1334
1212
|
);
|
|
1335
1213
|
},
|
|
1336
1214
|
async setAppMapping(params) {
|
|
1337
1215
|
const resp = await client.setAppMapping(
|
|
1338
|
-
|
|
1216
|
+
create2(SetAppMappingRequestSchema, {
|
|
1339
1217
|
tenantId: params.tenantId,
|
|
1340
1218
|
projectId: params.projectId,
|
|
1341
1219
|
name: params.name,
|
|
@@ -1348,21 +1226,21 @@ function createAppsMethods(client) {
|
|
|
1348
1226
|
},
|
|
1349
1227
|
async validateManifestUrl(manifestUrl) {
|
|
1350
1228
|
return client.validateManifest(
|
|
1351
|
-
|
|
1229
|
+
create2(ValidateManifestRequestSchema, {
|
|
1352
1230
|
source: { case: "manifestUrl", value: manifestUrl }
|
|
1353
1231
|
})
|
|
1354
1232
|
);
|
|
1355
1233
|
},
|
|
1356
1234
|
async validateManifestJson(manifestJson) {
|
|
1357
1235
|
return client.validateManifest(
|
|
1358
|
-
|
|
1236
|
+
create2(ValidateManifestRequestSchema, {
|
|
1359
1237
|
source: { case: "manifestJson", value: manifestJson }
|
|
1360
1238
|
})
|
|
1361
1239
|
);
|
|
1362
1240
|
},
|
|
1363
1241
|
async triggerOperation(tenantId, projectId, operationKey, input) {
|
|
1364
1242
|
const resp = await client.triggerOperation(
|
|
1365
|
-
|
|
1243
|
+
create2(TriggerOperationRequestSchema, {
|
|
1366
1244
|
tenantId,
|
|
1367
1245
|
projectId,
|
|
1368
1246
|
operationKey,
|
|
@@ -1375,7 +1253,7 @@ function createAppsMethods(client) {
|
|
|
1375
1253
|
}
|
|
1376
1254
|
|
|
1377
1255
|
// src/lib/rpc/models.ts
|
|
1378
|
-
import { create as
|
|
1256
|
+
import { create as create3, fromJson } from "@bufbuild/protobuf";
|
|
1379
1257
|
import { ValueSchema } from "@bufbuild/protobuf/wkt";
|
|
1380
1258
|
import {
|
|
1381
1259
|
FieldSchema as ProtoFieldSchema,
|
|
@@ -1392,7 +1270,7 @@ import {
|
|
|
1392
1270
|
RestoreModelVersionRequestSchema
|
|
1393
1271
|
} from "@eide/foir-proto-ts/models/v1/models_pb";
|
|
1394
1272
|
function jsFieldToProto(f) {
|
|
1395
|
-
return
|
|
1273
|
+
return create3(ProtoFieldSchema, {
|
|
1396
1274
|
id: f.id,
|
|
1397
1275
|
key: f.key,
|
|
1398
1276
|
label: f.label,
|
|
@@ -1409,13 +1287,13 @@ function jsFieldToProto(f) {
|
|
|
1409
1287
|
});
|
|
1410
1288
|
}
|
|
1411
1289
|
function jsConfigToProto(c) {
|
|
1412
|
-
return
|
|
1290
|
+
return create3(ProtoModelConfigSchema, {
|
|
1413
1291
|
versioning: c.versioning ?? false,
|
|
1414
1292
|
publishing: c.publishing ?? false,
|
|
1415
1293
|
variants: c.variants ?? false,
|
|
1416
1294
|
inline: c.inline ?? false,
|
|
1417
1295
|
customerScoped: c.customerScoped ?? false,
|
|
1418
|
-
sharing: c.sharing ?
|
|
1296
|
+
sharing: c.sharing ? create3(ProtoSharingConfigSchema, {
|
|
1419
1297
|
enabled: c.sharing.enabled,
|
|
1420
1298
|
requireAcceptance: c.sharing.requireAcceptance
|
|
1421
1299
|
}) : void 0,
|
|
@@ -1434,18 +1312,18 @@ function createModelsMethods(client) {
|
|
|
1434
1312
|
return {
|
|
1435
1313
|
// ── Queries ──────────────────────────────────────────────
|
|
1436
1314
|
async getModel(id) {
|
|
1437
|
-
const resp = await client.getModel(
|
|
1315
|
+
const resp = await client.getModel(create3(GetModelRequestSchema, { id }));
|
|
1438
1316
|
return resp.model ?? null;
|
|
1439
1317
|
},
|
|
1440
1318
|
async getModelByKey(key) {
|
|
1441
1319
|
const resp = await client.getModelByKey(
|
|
1442
|
-
|
|
1320
|
+
create3(GetModelByKeyRequestSchema, { key })
|
|
1443
1321
|
);
|
|
1444
1322
|
return resp.model ?? null;
|
|
1445
1323
|
},
|
|
1446
1324
|
async listModels(params = {}) {
|
|
1447
1325
|
const resp = await client.listModels(
|
|
1448
|
-
|
|
1326
|
+
create3(ListModelsRequestSchema, {
|
|
1449
1327
|
search: params.search,
|
|
1450
1328
|
category: params.category,
|
|
1451
1329
|
configId: params.configId,
|
|
@@ -1461,7 +1339,7 @@ function createModelsMethods(client) {
|
|
|
1461
1339
|
// ── Mutations ────────────────────────────────────────────
|
|
1462
1340
|
async createModel(params) {
|
|
1463
1341
|
const resp = await client.createModel(
|
|
1464
|
-
|
|
1342
|
+
create3(CreateModelRequestSchema, {
|
|
1465
1343
|
key: params.key,
|
|
1466
1344
|
name: params.name,
|
|
1467
1345
|
fields: params.fields.map(jsFieldToProto),
|
|
@@ -1473,7 +1351,7 @@ function createModelsMethods(client) {
|
|
|
1473
1351
|
},
|
|
1474
1352
|
async updateModel(params) {
|
|
1475
1353
|
const resp = await client.updateModel(
|
|
1476
|
-
|
|
1354
|
+
create3(UpdateModelRequestSchema, {
|
|
1477
1355
|
id: params.id,
|
|
1478
1356
|
name: params.name,
|
|
1479
1357
|
updateFields: params.fields != null,
|
|
@@ -1486,20 +1364,20 @@ function createModelsMethods(client) {
|
|
|
1486
1364
|
},
|
|
1487
1365
|
async deleteModel(id) {
|
|
1488
1366
|
const resp = await client.deleteModel(
|
|
1489
|
-
|
|
1367
|
+
create3(DeleteModelRequestSchema, { id })
|
|
1490
1368
|
);
|
|
1491
1369
|
return resp.success;
|
|
1492
1370
|
},
|
|
1493
1371
|
async duplicateModel(params) {
|
|
1494
1372
|
const resp = await client.duplicateModel(
|
|
1495
|
-
|
|
1373
|
+
create3(DuplicateModelRequestSchema, params)
|
|
1496
1374
|
);
|
|
1497
1375
|
return resp.model ?? null;
|
|
1498
1376
|
},
|
|
1499
1377
|
// ── Versioning ───────────────────────────────────────────
|
|
1500
1378
|
async listModelVersions(modelId, params = {}) {
|
|
1501
1379
|
const resp = await client.listModelVersions(
|
|
1502
|
-
|
|
1380
|
+
create3(ListModelVersionsRequestSchema, {
|
|
1503
1381
|
modelId,
|
|
1504
1382
|
limit: params.limit ?? 50,
|
|
1505
1383
|
offset: params.offset ?? 0
|
|
@@ -1512,7 +1390,7 @@ function createModelsMethods(client) {
|
|
|
1512
1390
|
},
|
|
1513
1391
|
async restoreModelVersion(modelId, versionId) {
|
|
1514
1392
|
const resp = await client.restoreModelVersion(
|
|
1515
|
-
|
|
1393
|
+
create3(RestoreModelVersionRequestSchema, { modelId, versionId })
|
|
1516
1394
|
);
|
|
1517
1395
|
return resp.model ?? null;
|
|
1518
1396
|
}
|
|
@@ -1520,7 +1398,7 @@ function createModelsMethods(client) {
|
|
|
1520
1398
|
}
|
|
1521
1399
|
|
|
1522
1400
|
// src/lib/rpc/records.ts
|
|
1523
|
-
import { create as
|
|
1401
|
+
import { create as create4 } from "@bufbuild/protobuf";
|
|
1524
1402
|
import {
|
|
1525
1403
|
CreateRecordRequestSchema,
|
|
1526
1404
|
GetRecordRequestSchema,
|
|
@@ -1591,7 +1469,7 @@ function createRecordsMethods(client) {
|
|
|
1591
1469
|
// ── CRUD ──────────────────────────────────────────────────
|
|
1592
1470
|
async createRecord(params) {
|
|
1593
1471
|
const resp = await client.createRecord(
|
|
1594
|
-
|
|
1472
|
+
create4(CreateRecordRequestSchema, {
|
|
1595
1473
|
modelKey: params.modelKey,
|
|
1596
1474
|
naturalKey: params.naturalKey,
|
|
1597
1475
|
data: params.data ? sanitizeData(params.data) : void 0,
|
|
@@ -1608,32 +1486,32 @@ function createRecordsMethods(client) {
|
|
|
1608
1486
|
},
|
|
1609
1487
|
async getRecord(id) {
|
|
1610
1488
|
const resp = await client.getRecord(
|
|
1611
|
-
|
|
1489
|
+
create4(GetRecordRequestSchema, { id })
|
|
1612
1490
|
);
|
|
1613
1491
|
return resp.record ?? null;
|
|
1614
1492
|
},
|
|
1615
1493
|
async getRecordByKey(modelKey, naturalKey) {
|
|
1616
1494
|
const resp = await client.getRecordByKey(
|
|
1617
|
-
|
|
1495
|
+
create4(GetRecordByKeyRequestSchema, { modelKey, naturalKey })
|
|
1618
1496
|
);
|
|
1619
1497
|
return resp.record ?? null;
|
|
1620
1498
|
},
|
|
1621
1499
|
async getRecordByKeyOrId(modelKey, identifier) {
|
|
1622
1500
|
const resp = await client.getRecordByKeyOrId(
|
|
1623
|
-
|
|
1501
|
+
create4(GetRecordByKeyOrIdRequestSchema, { modelKey, identifier })
|
|
1624
1502
|
);
|
|
1625
1503
|
return resp.record ?? null;
|
|
1626
1504
|
},
|
|
1627
1505
|
async listRecords(params) {
|
|
1628
1506
|
const resp = await client.listRecords(
|
|
1629
|
-
|
|
1507
|
+
create4(ListRecordsRequestSchema, {
|
|
1630
1508
|
modelKey: params.modelKey,
|
|
1631
1509
|
limit: params.limit ?? 50,
|
|
1632
1510
|
offset: params.offset ?? 0,
|
|
1633
1511
|
customerId: params.customerId,
|
|
1634
1512
|
search: params.search,
|
|
1635
1513
|
filters: params.filters?.map(
|
|
1636
|
-
(f) =>
|
|
1514
|
+
(f) => create4(RecordFilterSchema, {
|
|
1637
1515
|
field: f.field,
|
|
1638
1516
|
operator: f.operator
|
|
1639
1517
|
})
|
|
@@ -1647,7 +1525,7 @@ function createRecordsMethods(client) {
|
|
|
1647
1525
|
},
|
|
1648
1526
|
async updateRecord(params) {
|
|
1649
1527
|
const resp = await client.updateRecord(
|
|
1650
|
-
|
|
1528
|
+
create4(UpdateRecordRequestSchema, {
|
|
1651
1529
|
id: params.id,
|
|
1652
1530
|
data: sanitizeData(params.data),
|
|
1653
1531
|
naturalKey: params.naturalKey
|
|
@@ -1657,28 +1535,28 @@ function createRecordsMethods(client) {
|
|
|
1657
1535
|
},
|
|
1658
1536
|
async deleteRecord(id) {
|
|
1659
1537
|
const resp = await client.deleteRecord(
|
|
1660
|
-
|
|
1538
|
+
create4(DeleteRecordRequestSchema, { id })
|
|
1661
1539
|
);
|
|
1662
1540
|
return resp.success;
|
|
1663
1541
|
},
|
|
1664
1542
|
async duplicateRecord(id, newNaturalKey) {
|
|
1665
1543
|
const resp = await client.duplicateRecord(
|
|
1666
|
-
|
|
1544
|
+
create4(DuplicateRecordRequestSchema, { id, newNaturalKey })
|
|
1667
1545
|
);
|
|
1668
1546
|
return resp.record ?? null;
|
|
1669
1547
|
},
|
|
1670
1548
|
async duplicateRecordsBulk(ids, modelKey) {
|
|
1671
1549
|
const resp = await client.duplicateRecordsBulk(
|
|
1672
|
-
|
|
1550
|
+
create4(DuplicateRecordsBulkRequestSchema, { ids, modelKey })
|
|
1673
1551
|
);
|
|
1674
1552
|
return resp.records ?? [];
|
|
1675
1553
|
},
|
|
1676
1554
|
async batchRecordOperations(operations) {
|
|
1677
1555
|
const typeMap = { create: 1, update: 2, delete: 3 };
|
|
1678
1556
|
const resp = await client.batchRecordOperations(
|
|
1679
|
-
|
|
1557
|
+
create4(BatchRecordOperationsRequestSchema, {
|
|
1680
1558
|
operations: operations.map(
|
|
1681
|
-
(op) =>
|
|
1559
|
+
(op) => create4(BatchOperationSchema, {
|
|
1682
1560
|
type: typeMap[op.type],
|
|
1683
1561
|
id: op.id,
|
|
1684
1562
|
modelKey: op.modelKey,
|
|
@@ -1695,7 +1573,7 @@ function createRecordsMethods(client) {
|
|
|
1695
1573
|
},
|
|
1696
1574
|
async bulkUpdateRecords(params) {
|
|
1697
1575
|
const resp = await client.bulkUpdateRecords(
|
|
1698
|
-
|
|
1576
|
+
create4(BulkUpdateRecordsRequestSchema, {
|
|
1699
1577
|
modelKey: params.modelKey,
|
|
1700
1578
|
data: sanitizeData(params.data)
|
|
1701
1579
|
})
|
|
@@ -1705,7 +1583,7 @@ function createRecordsMethods(client) {
|
|
|
1705
1583
|
// ── Versioning ────────────────────────────────────────────
|
|
1706
1584
|
async createVersion(parentId, data, changeDescription) {
|
|
1707
1585
|
const resp = await client.createVersion(
|
|
1708
|
-
|
|
1586
|
+
create4(CreateVersionRequestSchema, {
|
|
1709
1587
|
parentId,
|
|
1710
1588
|
data: data ? sanitizeData(data) : void 0,
|
|
1711
1589
|
changeDescription
|
|
@@ -1715,25 +1593,25 @@ function createRecordsMethods(client) {
|
|
|
1715
1593
|
},
|
|
1716
1594
|
async publishVersion(versionId) {
|
|
1717
1595
|
const resp = await client.publishVersion(
|
|
1718
|
-
|
|
1596
|
+
create4(PublishVersionRequestSchema, { versionId })
|
|
1719
1597
|
);
|
|
1720
1598
|
return resp.record ?? null;
|
|
1721
1599
|
},
|
|
1722
1600
|
async unpublishRecord(recordId) {
|
|
1723
1601
|
const resp = await client.unpublishRecord(
|
|
1724
|
-
|
|
1602
|
+
create4(UnpublishRecordRequestSchema, { recordId })
|
|
1725
1603
|
);
|
|
1726
1604
|
return resp.success;
|
|
1727
1605
|
},
|
|
1728
1606
|
async revertToVersion(versionId) {
|
|
1729
1607
|
const resp = await client.revertToVersion(
|
|
1730
|
-
|
|
1608
|
+
create4(RevertToVersionRequestSchema, { versionId })
|
|
1731
1609
|
);
|
|
1732
1610
|
return resp.record ?? null;
|
|
1733
1611
|
},
|
|
1734
1612
|
async listRecordVersions(parentId, params) {
|
|
1735
1613
|
const resp = await client.listRecordVersions(
|
|
1736
|
-
|
|
1614
|
+
create4(ListRecordVersionsRequestSchema, {
|
|
1737
1615
|
parentId,
|
|
1738
1616
|
limit: params?.limit ?? 50,
|
|
1739
1617
|
offset: params?.offset ?? 0
|
|
@@ -1746,7 +1624,7 @@ function createRecordsMethods(client) {
|
|
|
1746
1624
|
},
|
|
1747
1625
|
async saveContent(params) {
|
|
1748
1626
|
const resp = await client.saveContent(
|
|
1749
|
-
|
|
1627
|
+
create4(SaveContentRequestSchema, {
|
|
1750
1628
|
recordId: params.recordId,
|
|
1751
1629
|
data: sanitizeData(params.data),
|
|
1752
1630
|
variantKey: params.variantKey,
|
|
@@ -1761,7 +1639,7 @@ function createRecordsMethods(client) {
|
|
|
1761
1639
|
// ── Variants ──────────────────────────────────────────────
|
|
1762
1640
|
async createVariant(recordId, variantKey, data) {
|
|
1763
1641
|
const resp = await client.createVariant(
|
|
1764
|
-
|
|
1642
|
+
create4(CreateVariantRequestSchema, {
|
|
1765
1643
|
recordId,
|
|
1766
1644
|
variantKey,
|
|
1767
1645
|
data: data ? sanitizeData(data) : void 0
|
|
@@ -1771,7 +1649,7 @@ function createRecordsMethods(client) {
|
|
|
1771
1649
|
},
|
|
1772
1650
|
async updateVariant(variantId, data) {
|
|
1773
1651
|
const resp = await client.updateVariant(
|
|
1774
|
-
|
|
1652
|
+
create4(UpdateVariantRequestSchema, {
|
|
1775
1653
|
variantId,
|
|
1776
1654
|
data: sanitizeData(data)
|
|
1777
1655
|
})
|
|
@@ -1780,19 +1658,19 @@ function createRecordsMethods(client) {
|
|
|
1780
1658
|
},
|
|
1781
1659
|
async deleteVariant(variantId) {
|
|
1782
1660
|
const resp = await client.deleteVariant(
|
|
1783
|
-
|
|
1661
|
+
create4(DeleteVariantRequestSchema, { variantId })
|
|
1784
1662
|
);
|
|
1785
1663
|
return resp.success;
|
|
1786
1664
|
},
|
|
1787
1665
|
async setDefaultVariant(recordId, variantId) {
|
|
1788
1666
|
const resp = await client.setDefaultVariant(
|
|
1789
|
-
|
|
1667
|
+
create4(SetDefaultVariantRequestSchema, { recordId, variantId })
|
|
1790
1668
|
);
|
|
1791
1669
|
return resp.record ?? null;
|
|
1792
1670
|
},
|
|
1793
1671
|
async listRecordVariants(recordId, params) {
|
|
1794
1672
|
const resp = await client.listRecordVariants(
|
|
1795
|
-
|
|
1673
|
+
create4(ListRecordVariantsRequestSchema, {
|
|
1796
1674
|
recordId,
|
|
1797
1675
|
limit: params?.limit ?? 50,
|
|
1798
1676
|
offset: params?.offset ?? 0
|
|
@@ -1806,7 +1684,7 @@ function createRecordsMethods(client) {
|
|
|
1806
1684
|
// ── Scheduling ────────────────────────────────────────────
|
|
1807
1685
|
async scheduleRecordPublish(versionId, publishAt, unpublishAt) {
|
|
1808
1686
|
const resp = await client.scheduleRecordPublish(
|
|
1809
|
-
|
|
1687
|
+
create4(ScheduleRecordPublishRequestSchema, {
|
|
1810
1688
|
versionId,
|
|
1811
1689
|
publishAt: {
|
|
1812
1690
|
seconds: BigInt(Math.floor(publishAt.getTime() / 1e3)),
|
|
@@ -1822,13 +1700,13 @@ function createRecordsMethods(client) {
|
|
|
1822
1700
|
},
|
|
1823
1701
|
async cancelScheduledRecordPublish(versionId) {
|
|
1824
1702
|
const resp = await client.cancelScheduledRecordPublish(
|
|
1825
|
-
|
|
1703
|
+
create4(CancelScheduledRecordPublishRequestSchema, { versionId })
|
|
1826
1704
|
);
|
|
1827
1705
|
return resp.version ?? null;
|
|
1828
1706
|
},
|
|
1829
1707
|
async listScheduledPublishes(params) {
|
|
1830
1708
|
const resp = await client.listScheduledPublishes(
|
|
1831
|
-
|
|
1709
|
+
create4(ListScheduledPublishesRequestSchema, {
|
|
1832
1710
|
from: params?.from ? {
|
|
1833
1711
|
seconds: BigInt(Math.floor(params.from.getTime() / 1e3)),
|
|
1834
1712
|
nanos: 0
|
|
@@ -1849,7 +1727,7 @@ function createRecordsMethods(client) {
|
|
|
1849
1727
|
},
|
|
1850
1728
|
async listDraftVersions(params) {
|
|
1851
1729
|
const resp = await client.listDraftVersions(
|
|
1852
|
-
|
|
1730
|
+
create4(ListDraftVersionsRequestSchema, {
|
|
1853
1731
|
modelKey: params?.modelKey,
|
|
1854
1732
|
search: params?.search,
|
|
1855
1733
|
limit: params?.limit ?? 50,
|
|
@@ -1864,7 +1742,7 @@ function createRecordsMethods(client) {
|
|
|
1864
1742
|
// ── Batch Publishing ──────────────────────────────────────
|
|
1865
1743
|
async batchPublishVersions(versionIds) {
|
|
1866
1744
|
const resp = await client.batchPublishVersions(
|
|
1867
|
-
|
|
1745
|
+
create4(BatchPublishVersionsRequestSchema, { versionIds })
|
|
1868
1746
|
);
|
|
1869
1747
|
return {
|
|
1870
1748
|
records: resp.records ?? [],
|
|
@@ -1874,7 +1752,7 @@ function createRecordsMethods(client) {
|
|
|
1874
1752
|
// ── Publish Batches ───────────────────────────────────────
|
|
1875
1753
|
async createPublishBatch(params) {
|
|
1876
1754
|
const resp = await client.createPublishBatch(
|
|
1877
|
-
|
|
1755
|
+
create4(CreatePublishBatchRequestSchema, {
|
|
1878
1756
|
name: params.name,
|
|
1879
1757
|
versionIds: params.versionIds,
|
|
1880
1758
|
scheduledAt: params.scheduledAt ? {
|
|
@@ -1889,7 +1767,7 @@ function createRecordsMethods(client) {
|
|
|
1889
1767
|
},
|
|
1890
1768
|
async updatePublishBatch(params) {
|
|
1891
1769
|
const resp = await client.updatePublishBatch(
|
|
1892
|
-
|
|
1770
|
+
create4(UpdatePublishBatchRequestSchema, {
|
|
1893
1771
|
batchId: params.batchId,
|
|
1894
1772
|
name: params.name,
|
|
1895
1773
|
scheduledAt: params.scheduledAt ? {
|
|
@@ -1904,19 +1782,19 @@ function createRecordsMethods(client) {
|
|
|
1904
1782
|
},
|
|
1905
1783
|
async cancelPublishBatch(batchId) {
|
|
1906
1784
|
const resp = await client.cancelPublishBatch(
|
|
1907
|
-
|
|
1785
|
+
create4(CancelPublishBatchRequestSchema, { batchId })
|
|
1908
1786
|
);
|
|
1909
1787
|
return resp.batch ?? null;
|
|
1910
1788
|
},
|
|
1911
1789
|
async rollbackPublishBatch(batchId) {
|
|
1912
1790
|
const resp = await client.rollbackPublishBatch(
|
|
1913
|
-
|
|
1791
|
+
create4(RollbackPublishBatchRequestSchema, { batchId })
|
|
1914
1792
|
);
|
|
1915
1793
|
return resp.batch ?? null;
|
|
1916
1794
|
},
|
|
1917
1795
|
async retryFailedBatchItems(batchId) {
|
|
1918
1796
|
const resp = await client.retryFailedBatchItems(
|
|
1919
|
-
|
|
1797
|
+
create4(RetryFailedBatchItemsRequestSchema, { batchId })
|
|
1920
1798
|
);
|
|
1921
1799
|
return {
|
|
1922
1800
|
batch: resp.batch ?? null,
|
|
@@ -1925,13 +1803,13 @@ function createRecordsMethods(client) {
|
|
|
1925
1803
|
},
|
|
1926
1804
|
async addItemsToPublishBatch(batchId, versionIds) {
|
|
1927
1805
|
const resp = await client.addItemsToPublishBatch(
|
|
1928
|
-
|
|
1806
|
+
create4(AddItemsToPublishBatchRequestSchema, { batchId, versionIds })
|
|
1929
1807
|
);
|
|
1930
1808
|
return resp.batch ?? null;
|
|
1931
1809
|
},
|
|
1932
1810
|
async removeItemsFromPublishBatch(batchId, versionIds) {
|
|
1933
1811
|
const resp = await client.removeItemsFromPublishBatch(
|
|
1934
|
-
|
|
1812
|
+
create4(RemoveItemsFromPublishBatchRequestSchema, {
|
|
1935
1813
|
batchId,
|
|
1936
1814
|
versionIds
|
|
1937
1815
|
})
|
|
@@ -1940,7 +1818,7 @@ function createRecordsMethods(client) {
|
|
|
1940
1818
|
},
|
|
1941
1819
|
async listPublishBatches(params) {
|
|
1942
1820
|
const resp = await client.listPublishBatches(
|
|
1943
|
-
|
|
1821
|
+
create4(ListPublishBatchesRequestSchema, {
|
|
1944
1822
|
status: params?.status,
|
|
1945
1823
|
from: params?.from ? {
|
|
1946
1824
|
seconds: BigInt(Math.floor(params.from.getTime() / 1e3)),
|
|
@@ -1961,7 +1839,7 @@ function createRecordsMethods(client) {
|
|
|
1961
1839
|
},
|
|
1962
1840
|
async getPublishBatch(batchId) {
|
|
1963
1841
|
const resp = await client.getPublishBatch(
|
|
1964
|
-
|
|
1842
|
+
create4(GetPublishBatchRequestSchema, { batchId })
|
|
1965
1843
|
);
|
|
1966
1844
|
return {
|
|
1967
1845
|
batch: resp.batch ?? null,
|
|
@@ -1971,7 +1849,7 @@ function createRecordsMethods(client) {
|
|
|
1971
1849
|
// ── Search & Embeddings ──────────────────────────────────
|
|
1972
1850
|
async globalSearch(params) {
|
|
1973
1851
|
const resp = await client.globalSearch(
|
|
1974
|
-
|
|
1852
|
+
create4(GlobalSearchRequestSchema, {
|
|
1975
1853
|
query: params.query,
|
|
1976
1854
|
modelKeys: params.modelKeys ?? [],
|
|
1977
1855
|
limit: params.limit ?? 20
|
|
@@ -1984,7 +1862,7 @@ function createRecordsMethods(client) {
|
|
|
1984
1862
|
},
|
|
1985
1863
|
async getEmbeddingStats(modelKey) {
|
|
1986
1864
|
const resp = await client.getEmbeddingStats(
|
|
1987
|
-
|
|
1865
|
+
create4(GetEmbeddingStatsRequestSchema, {
|
|
1988
1866
|
modelKey
|
|
1989
1867
|
})
|
|
1990
1868
|
);
|
|
@@ -1992,13 +1870,13 @@ function createRecordsMethods(client) {
|
|
|
1992
1870
|
},
|
|
1993
1871
|
async getRecordEmbeddings(recordId) {
|
|
1994
1872
|
const resp = await client.getRecordEmbeddings(
|
|
1995
|
-
|
|
1873
|
+
create4(GetRecordEmbeddingsRequestSchema, { recordId })
|
|
1996
1874
|
);
|
|
1997
1875
|
return resp.embeddings ?? [];
|
|
1998
1876
|
},
|
|
1999
1877
|
async findSimilarRecords(params) {
|
|
2000
1878
|
const resp = await client.findSimilarRecords(
|
|
2001
|
-
|
|
1879
|
+
create4(FindSimilarRecordsRequestSchema, {
|
|
2002
1880
|
recordId: params.recordId,
|
|
2003
1881
|
modelKey: params.modelKey,
|
|
2004
1882
|
limit: params.limit ?? 10
|
|
@@ -2010,7 +1888,7 @@ function createRecordsMethods(client) {
|
|
|
2010
1888
|
}
|
|
2011
1889
|
|
|
2012
1890
|
// src/lib/rpc/configs.ts
|
|
2013
|
-
import { create as
|
|
1891
|
+
import { create as create5 } from "@bufbuild/protobuf";
|
|
2014
1892
|
import {
|
|
2015
1893
|
CreateConfigRequestSchema,
|
|
2016
1894
|
GetConfigRequestSchema,
|
|
@@ -2035,7 +1913,7 @@ function createConfigsMethods(client) {
|
|
|
2035
1913
|
// ── Operations ────────────────────────────────────────────
|
|
2036
1914
|
async listOperations(params = {}) {
|
|
2037
1915
|
return client.listOperations(
|
|
2038
|
-
|
|
1916
|
+
create5(ListOperationsRequestSchema, {
|
|
2039
1917
|
category: params.category,
|
|
2040
1918
|
isActive: params.isActive,
|
|
2041
1919
|
search: params.search,
|
|
@@ -2047,19 +1925,19 @@ function createConfigsMethods(client) {
|
|
|
2047
1925
|
// ── Queries ──────────────────────────────────────────────
|
|
2048
1926
|
async getConfig(id) {
|
|
2049
1927
|
const resp = await client.getConfig(
|
|
2050
|
-
|
|
1928
|
+
create5(GetConfigRequestSchema, { id })
|
|
2051
1929
|
);
|
|
2052
1930
|
return resp.config ?? null;
|
|
2053
1931
|
},
|
|
2054
1932
|
async getConfigByKey(key) {
|
|
2055
1933
|
const resp = await client.getConfigByKey(
|
|
2056
|
-
|
|
1934
|
+
create5(GetConfigByKeyRequestSchema, { key })
|
|
2057
1935
|
);
|
|
2058
1936
|
return resp.config ?? null;
|
|
2059
1937
|
},
|
|
2060
1938
|
async listConfigs(params = {}) {
|
|
2061
1939
|
return client.listConfigs(
|
|
2062
|
-
|
|
1940
|
+
create5(ListConfigsRequestSchema, {
|
|
2063
1941
|
configType: params.configType,
|
|
2064
1942
|
enabled: params.enabled,
|
|
2065
1943
|
limit: params.limit ?? 50,
|
|
@@ -2070,7 +1948,7 @@ function createConfigsMethods(client) {
|
|
|
2070
1948
|
// ── Mutations ────────────────────────────────────────────
|
|
2071
1949
|
async createConfig(params) {
|
|
2072
1950
|
const resp = await client.createConfig(
|
|
2073
|
-
|
|
1951
|
+
create5(CreateConfigRequestSchema, {
|
|
2074
1952
|
key: params.key,
|
|
2075
1953
|
configType: params.configType,
|
|
2076
1954
|
direction: DIRECTION_TO_PROTO[params.direction ?? "read"] ?? ConfigDirection.READ,
|
|
@@ -2084,7 +1962,7 @@ function createConfigsMethods(client) {
|
|
|
2084
1962
|
},
|
|
2085
1963
|
async updateConfig(params) {
|
|
2086
1964
|
const resp = await client.updateConfig(
|
|
2087
|
-
|
|
1965
|
+
create5(UpdateConfigRequestSchema, {
|
|
2088
1966
|
id: params.id,
|
|
2089
1967
|
name: params.name,
|
|
2090
1968
|
description: params.description,
|
|
@@ -2098,7 +1976,7 @@ function createConfigsMethods(client) {
|
|
|
2098
1976
|
},
|
|
2099
1977
|
async applyConfig(configKey, configData) {
|
|
2100
1978
|
const resp = await client.applyConfig(
|
|
2101
|
-
|
|
1979
|
+
create5(ApplyConfigRequestSchema, {
|
|
2102
1980
|
configKey,
|
|
2103
1981
|
configData
|
|
2104
1982
|
})
|
|
@@ -2114,7 +1992,7 @@ function createConfigsMethods(client) {
|
|
|
2114
1992
|
},
|
|
2115
1993
|
async writeConfigCredential(params) {
|
|
2116
1994
|
const resp = await client.writeConfigCredential(
|
|
2117
|
-
|
|
1995
|
+
create5(WriteConfigCredentialRequestSchema, {
|
|
2118
1996
|
configKey: params.configKey,
|
|
2119
1997
|
value: params.value
|
|
2120
1998
|
})
|
|
@@ -2126,13 +2004,13 @@ function createConfigsMethods(client) {
|
|
|
2126
2004
|
},
|
|
2127
2005
|
async triggerConfigSync(configId) {
|
|
2128
2006
|
const resp = await client.triggerConfigSync(
|
|
2129
|
-
|
|
2007
|
+
create5(TriggerConfigSyncRequestSchema, { configId })
|
|
2130
2008
|
);
|
|
2131
2009
|
return resp.success;
|
|
2132
2010
|
},
|
|
2133
2011
|
async deleteConfig(id) {
|
|
2134
2012
|
const resp = await client.deleteConfig(
|
|
2135
|
-
|
|
2013
|
+
create5(DeleteConfigRequestSchema, { id })
|
|
2136
2014
|
);
|
|
2137
2015
|
return resp.success;
|
|
2138
2016
|
}
|
|
@@ -2140,7 +2018,7 @@ function createConfigsMethods(client) {
|
|
|
2140
2018
|
}
|
|
2141
2019
|
|
|
2142
2020
|
// src/lib/rpc/segments.ts
|
|
2143
|
-
import { create as
|
|
2021
|
+
import { create as create6, fromJson as fromJson2 } from "@bufbuild/protobuf";
|
|
2144
2022
|
import { ValueSchema as ValueSchema2 } from "@bufbuild/protobuf/wkt";
|
|
2145
2023
|
import {
|
|
2146
2024
|
RuleExpressionSchema,
|
|
@@ -2161,7 +2039,7 @@ import {
|
|
|
2161
2039
|
OptBackIntoSegmentRequestSchema
|
|
2162
2040
|
} from "@eide/foir-proto-ts/segments/v1/segments_pb";
|
|
2163
2041
|
function rawOperandToProto(raw) {
|
|
2164
|
-
return
|
|
2042
|
+
return create6(RuleOperandSchema, {
|
|
2165
2043
|
type: raw.type,
|
|
2166
2044
|
path: raw.path,
|
|
2167
2045
|
value: raw.value !== void 0 ? fromJson2(ValueSchema2, raw.value) : void 0,
|
|
@@ -2170,7 +2048,7 @@ function rawOperandToProto(raw) {
|
|
|
2170
2048
|
});
|
|
2171
2049
|
}
|
|
2172
2050
|
function rawRulesToProto(raw) {
|
|
2173
|
-
return
|
|
2051
|
+
return create6(RuleExpressionSchema, {
|
|
2174
2052
|
type: raw.type,
|
|
2175
2053
|
id: raw.id,
|
|
2176
2054
|
left: raw.left ? rawOperandToProto(raw.left) : void 0,
|
|
@@ -2186,19 +2064,19 @@ function createSegmentsMethods(client) {
|
|
|
2186
2064
|
// ── Queries ──────────────────────────────────────────────
|
|
2187
2065
|
async getSegment(id) {
|
|
2188
2066
|
const resp = await client.getSegment(
|
|
2189
|
-
|
|
2067
|
+
create6(GetSegmentRequestSchema, { id })
|
|
2190
2068
|
);
|
|
2191
2069
|
return resp.segment ?? null;
|
|
2192
2070
|
},
|
|
2193
2071
|
async getSegmentByKey(key) {
|
|
2194
2072
|
const resp = await client.getSegmentByKey(
|
|
2195
|
-
|
|
2073
|
+
create6(GetSegmentByKeyRequestSchema, { key })
|
|
2196
2074
|
);
|
|
2197
2075
|
return resp.segment ?? null;
|
|
2198
2076
|
},
|
|
2199
2077
|
async listSegments(params = {}) {
|
|
2200
2078
|
return client.listSegments(
|
|
2201
|
-
|
|
2079
|
+
create6(ListSegmentsRequestSchema, {
|
|
2202
2080
|
isActive: params.isActive,
|
|
2203
2081
|
configId: params.configId,
|
|
2204
2082
|
limit: params.limit ?? 50,
|
|
@@ -2210,7 +2088,7 @@ function createSegmentsMethods(client) {
|
|
|
2210
2088
|
async createSegment(params) {
|
|
2211
2089
|
const rules = params.rules && !("$typeName" in params.rules) ? rawRulesToProto(params.rules) : params.rules;
|
|
2212
2090
|
const resp = await client.createSegment(
|
|
2213
|
-
|
|
2091
|
+
create6(CreateSegmentRequestSchema, {
|
|
2214
2092
|
key: params.key,
|
|
2215
2093
|
name: params.name,
|
|
2216
2094
|
description: params.description,
|
|
@@ -2227,7 +2105,7 @@ function createSegmentsMethods(client) {
|
|
|
2227
2105
|
async updateSegment(params) {
|
|
2228
2106
|
const rules = params.rules && !("$typeName" in params.rules) ? rawRulesToProto(params.rules) : params.rules;
|
|
2229
2107
|
const resp = await client.updateSegment(
|
|
2230
|
-
|
|
2108
|
+
create6(UpdateSegmentRequestSchema, {
|
|
2231
2109
|
id: params.id,
|
|
2232
2110
|
name: params.name,
|
|
2233
2111
|
description: params.description,
|
|
@@ -2240,19 +2118,19 @@ function createSegmentsMethods(client) {
|
|
|
2240
2118
|
},
|
|
2241
2119
|
async deleteSegment(id) {
|
|
2242
2120
|
const resp = await client.deleteSegment(
|
|
2243
|
-
|
|
2121
|
+
create6(DeleteSegmentRequestSchema, { id })
|
|
2244
2122
|
);
|
|
2245
2123
|
return resp.success;
|
|
2246
2124
|
},
|
|
2247
2125
|
// ── Customer Operations ──────────────────────────────────
|
|
2248
2126
|
async getCustomerMemberships(customerId) {
|
|
2249
2127
|
return client.getCustomerMemberships(
|
|
2250
|
-
|
|
2128
|
+
create6(GetCustomerMembershipsRequestSchema, { customerId })
|
|
2251
2129
|
);
|
|
2252
2130
|
},
|
|
2253
2131
|
async previewSegmentRules(rules, sampleSize) {
|
|
2254
2132
|
const resp = await client.previewSegmentRules(
|
|
2255
|
-
|
|
2133
|
+
create6(PreviewSegmentRulesRequestSchema, {
|
|
2256
2134
|
rules,
|
|
2257
2135
|
sampleSize: sampleSize ?? 10
|
|
2258
2136
|
})
|
|
@@ -2261,26 +2139,26 @@ function createSegmentsMethods(client) {
|
|
|
2261
2139
|
},
|
|
2262
2140
|
async testSegmentEvaluation(segmentId, customerId) {
|
|
2263
2141
|
const resp = await client.testSegmentEvaluation(
|
|
2264
|
-
|
|
2142
|
+
create6(TestSegmentEvaluationRequestSchema, { segmentId, customerId })
|
|
2265
2143
|
);
|
|
2266
2144
|
return resp.result ?? null;
|
|
2267
2145
|
},
|
|
2268
2146
|
// ── Opt-out Management ───────────────────────────────────
|
|
2269
2147
|
async setGlobalOptOut(customerId, optedOut) {
|
|
2270
2148
|
const resp = await client.setGlobalOptOut(
|
|
2271
|
-
|
|
2149
|
+
create6(SetGlobalOptOutRequestSchema, { customerId, optedOut })
|
|
2272
2150
|
);
|
|
2273
2151
|
return resp.success;
|
|
2274
2152
|
},
|
|
2275
2153
|
async optOutOfSegment(customerId, segmentId) {
|
|
2276
2154
|
const resp = await client.optOutOfSegment(
|
|
2277
|
-
|
|
2155
|
+
create6(OptOutOfSegmentRequestSchema, { customerId, segmentId })
|
|
2278
2156
|
);
|
|
2279
2157
|
return resp.success;
|
|
2280
2158
|
},
|
|
2281
2159
|
async optBackIntoSegment(customerId, segmentId) {
|
|
2282
2160
|
const resp = await client.optBackIntoSegment(
|
|
2283
|
-
|
|
2161
|
+
create6(OptBackIntoSegmentRequestSchema, { customerId, segmentId })
|
|
2284
2162
|
);
|
|
2285
2163
|
return resp.success;
|
|
2286
2164
|
}
|
|
@@ -2288,7 +2166,7 @@ function createSegmentsMethods(client) {
|
|
|
2288
2166
|
}
|
|
2289
2167
|
|
|
2290
2168
|
// src/lib/rpc/experiments.ts
|
|
2291
|
-
import { create as
|
|
2169
|
+
import { create as create7 } from "@bufbuild/protobuf";
|
|
2292
2170
|
import {
|
|
2293
2171
|
ExperimentStatus,
|
|
2294
2172
|
CreateExperimentRequestSchema,
|
|
@@ -2321,19 +2199,19 @@ function createExperimentsMethods(client) {
|
|
|
2321
2199
|
// ── Queries ──────────────────────────────────────────────
|
|
2322
2200
|
async getExperiment(id) {
|
|
2323
2201
|
const resp = await client.getExperiment(
|
|
2324
|
-
|
|
2202
|
+
create7(GetExperimentRequestSchema, { id })
|
|
2325
2203
|
);
|
|
2326
2204
|
return resp.experiment ?? null;
|
|
2327
2205
|
},
|
|
2328
2206
|
async getExperimentByKey(key) {
|
|
2329
2207
|
const resp = await client.getExperimentByKey(
|
|
2330
|
-
|
|
2208
|
+
create7(GetExperimentByKeyRequestSchema, { key })
|
|
2331
2209
|
);
|
|
2332
2210
|
return resp.experiment ?? null;
|
|
2333
2211
|
},
|
|
2334
2212
|
async listExperiments(params = {}) {
|
|
2335
2213
|
return client.listExperiments(
|
|
2336
|
-
|
|
2214
|
+
create7(ListExperimentsRequestSchema, {
|
|
2337
2215
|
status: params.status ? STATUS_TO_PROTO[params.status] : void 0,
|
|
2338
2216
|
isActive: params.isActive,
|
|
2339
2217
|
limit: params.limit ?? 50,
|
|
@@ -2343,21 +2221,21 @@ function createExperimentsMethods(client) {
|
|
|
2343
2221
|
},
|
|
2344
2222
|
async getExperimentStats(experimentId) {
|
|
2345
2223
|
const resp = await client.getExperimentStats(
|
|
2346
|
-
|
|
2224
|
+
create7(GetExperimentStatsRequestSchema, { experimentId })
|
|
2347
2225
|
);
|
|
2348
2226
|
return resp.stats ?? null;
|
|
2349
2227
|
},
|
|
2350
2228
|
// ── Mutations ────────────────────────────────────────────
|
|
2351
2229
|
async createExperiment(params) {
|
|
2352
2230
|
const resp = await client.createExperiment(
|
|
2353
|
-
|
|
2231
|
+
create7(CreateExperimentRequestSchema, {
|
|
2354
2232
|
key: params.key,
|
|
2355
2233
|
name: params.name,
|
|
2356
2234
|
description: params.description,
|
|
2357
2235
|
targeting: params.targeting,
|
|
2358
2236
|
controlPercent: params.controlPercent,
|
|
2359
2237
|
variants: params.variants?.map(
|
|
2360
|
-
(v) =>
|
|
2238
|
+
(v) => create7(ExperimentVariantSchema, {
|
|
2361
2239
|
key: v.key,
|
|
2362
2240
|
name: v.name,
|
|
2363
2241
|
percent: v.percent
|
|
@@ -2369,14 +2247,14 @@ function createExperimentsMethods(client) {
|
|
|
2369
2247
|
},
|
|
2370
2248
|
async updateExperiment(params) {
|
|
2371
2249
|
const resp = await client.updateExperiment(
|
|
2372
|
-
|
|
2250
|
+
create7(UpdateExperimentRequestSchema, {
|
|
2373
2251
|
id: params.id,
|
|
2374
2252
|
name: params.name,
|
|
2375
2253
|
description: params.description,
|
|
2376
2254
|
targeting: params.targeting,
|
|
2377
2255
|
controlPercent: params.controlPercent,
|
|
2378
2256
|
variants: params.variants?.map(
|
|
2379
|
-
(v) =>
|
|
2257
|
+
(v) => create7(ExperimentVariantSchema, {
|
|
2380
2258
|
key: v.key,
|
|
2381
2259
|
name: v.name,
|
|
2382
2260
|
percent: v.percent
|
|
@@ -2388,38 +2266,38 @@ function createExperimentsMethods(client) {
|
|
|
2388
2266
|
},
|
|
2389
2267
|
async deleteExperiment(id) {
|
|
2390
2268
|
const resp = await client.deleteExperiment(
|
|
2391
|
-
|
|
2269
|
+
create7(DeleteExperimentRequestSchema, { id })
|
|
2392
2270
|
);
|
|
2393
2271
|
return resp.success;
|
|
2394
2272
|
},
|
|
2395
2273
|
// ── Lifecycle ────────────────────────────────────────────
|
|
2396
2274
|
async startExperiment(experimentId) {
|
|
2397
2275
|
const resp = await client.startExperiment(
|
|
2398
|
-
|
|
2276
|
+
create7(StartExperimentRequestSchema, { experimentId })
|
|
2399
2277
|
);
|
|
2400
2278
|
return resp.experiment ?? null;
|
|
2401
2279
|
},
|
|
2402
2280
|
async pauseExperiment(experimentId) {
|
|
2403
2281
|
const resp = await client.pauseExperiment(
|
|
2404
|
-
|
|
2282
|
+
create7(PauseExperimentRequestSchema, { experimentId })
|
|
2405
2283
|
);
|
|
2406
2284
|
return resp.experiment ?? null;
|
|
2407
2285
|
},
|
|
2408
2286
|
async resumeExperiment(experimentId) {
|
|
2409
2287
|
const resp = await client.resumeExperiment(
|
|
2410
|
-
|
|
2288
|
+
create7(ResumeExperimentRequestSchema, { experimentId })
|
|
2411
2289
|
);
|
|
2412
2290
|
return resp.experiment ?? null;
|
|
2413
2291
|
},
|
|
2414
2292
|
async endExperiment(experimentId) {
|
|
2415
2293
|
const resp = await client.endExperiment(
|
|
2416
|
-
|
|
2294
|
+
create7(EndExperimentRequestSchema, { experimentId })
|
|
2417
2295
|
);
|
|
2418
2296
|
return resp.experiment ?? null;
|
|
2419
2297
|
},
|
|
2420
2298
|
async applyExperimentWinner(experimentId, winnerVariantKey) {
|
|
2421
2299
|
const resp = await client.applyExperimentWinner(
|
|
2422
|
-
|
|
2300
|
+
create7(ApplyExperimentWinnerRequestSchema, {
|
|
2423
2301
|
experimentId,
|
|
2424
2302
|
winnerVariantKey
|
|
2425
2303
|
})
|
|
@@ -2429,7 +2307,7 @@ function createExperimentsMethods(client) {
|
|
|
2429
2307
|
// ── Assignments ──────────────────────────────────────────
|
|
2430
2308
|
async forceAssignExperiment(customerId, experimentId, variantKey) {
|
|
2431
2309
|
const resp = await client.forceAssignExperiment(
|
|
2432
|
-
|
|
2310
|
+
create7(ForceAssignExperimentRequestSchema, {
|
|
2433
2311
|
customerId,
|
|
2434
2312
|
experimentId,
|
|
2435
2313
|
variantKey
|
|
@@ -2439,7 +2317,7 @@ function createExperimentsMethods(client) {
|
|
|
2439
2317
|
},
|
|
2440
2318
|
async removeExperimentAssignment(customerId, experimentId) {
|
|
2441
2319
|
const resp = await client.removeExperimentAssignment(
|
|
2442
|
-
|
|
2320
|
+
create7(RemoveExperimentAssignmentRequestSchema, {
|
|
2443
2321
|
customerId,
|
|
2444
2322
|
experimentId
|
|
2445
2323
|
})
|
|
@@ -2448,7 +2326,7 @@ function createExperimentsMethods(client) {
|
|
|
2448
2326
|
},
|
|
2449
2327
|
async getCustomerAssignments(customerId) {
|
|
2450
2328
|
const resp = await client.getCustomerAssignments(
|
|
2451
|
-
|
|
2329
|
+
create7(GetCustomerAssignmentsRequestSchema, { customerId })
|
|
2452
2330
|
);
|
|
2453
2331
|
return resp.assignments ?? [];
|
|
2454
2332
|
}
|
|
@@ -2456,7 +2334,7 @@ function createExperimentsMethods(client) {
|
|
|
2456
2334
|
}
|
|
2457
2335
|
|
|
2458
2336
|
// src/lib/rpc/settings.ts
|
|
2459
|
-
import { create as
|
|
2337
|
+
import { create as create8 } from "@bufbuild/protobuf";
|
|
2460
2338
|
import {
|
|
2461
2339
|
GetSettingsRequestSchema,
|
|
2462
2340
|
UpdateSettingRequestSchema,
|
|
@@ -2507,7 +2385,7 @@ function createSettingsMethods(client) {
|
|
|
2507
2385
|
// ── Settings ─────────────────────────────────────────────
|
|
2508
2386
|
async getSettings(params = {}) {
|
|
2509
2387
|
const resp = await client.getSettings(
|
|
2510
|
-
|
|
2388
|
+
create8(GetSettingsRequestSchema, {
|
|
2511
2389
|
category: params.category,
|
|
2512
2390
|
key: params.key
|
|
2513
2391
|
})
|
|
@@ -2516,7 +2394,7 @@ function createSettingsMethods(client) {
|
|
|
2516
2394
|
},
|
|
2517
2395
|
async updateSetting(params) {
|
|
2518
2396
|
const resp = await client.updateSetting(
|
|
2519
|
-
|
|
2397
|
+
create8(UpdateSettingRequestSchema, {
|
|
2520
2398
|
key: params.key,
|
|
2521
2399
|
value: params.value
|
|
2522
2400
|
})
|
|
@@ -2525,14 +2403,14 @@ function createSettingsMethods(client) {
|
|
|
2525
2403
|
},
|
|
2526
2404
|
async deleteSetting(key) {
|
|
2527
2405
|
const resp = await client.deleteSetting(
|
|
2528
|
-
|
|
2406
|
+
create8(DeleteSettingRequestSchema, { key })
|
|
2529
2407
|
);
|
|
2530
2408
|
return resp.success;
|
|
2531
2409
|
},
|
|
2532
2410
|
// ── Mentions ─────────────────────────────────────────────
|
|
2533
2411
|
async listMyMentions(params = {}) {
|
|
2534
2412
|
return client.listMyMentions(
|
|
2535
|
-
|
|
2413
|
+
create8(ListMyMentionsRequestSchema, {
|
|
2536
2414
|
status: params.status ?? [],
|
|
2537
2415
|
entityType: params.entityType,
|
|
2538
2416
|
limit: params.limit ?? 50,
|
|
@@ -2542,7 +2420,7 @@ function createSettingsMethods(client) {
|
|
|
2542
2420
|
},
|
|
2543
2421
|
async updateMentionStatus(params) {
|
|
2544
2422
|
const resp = await client.updateMentionStatus(
|
|
2545
|
-
|
|
2423
|
+
create8(UpdateMentionStatusRequestSchema, {
|
|
2546
2424
|
mentionId: params.mentionId,
|
|
2547
2425
|
status: params.status,
|
|
2548
2426
|
completedNote: params.completedNote,
|
|
@@ -2554,7 +2432,7 @@ function createSettingsMethods(client) {
|
|
|
2554
2432
|
// ── Notes ────────────────────────────────────────────────
|
|
2555
2433
|
async createNote(params) {
|
|
2556
2434
|
const resp = await client.createNote(
|
|
2557
|
-
|
|
2435
|
+
create8(CreateNoteRequestSchema, {
|
|
2558
2436
|
...params,
|
|
2559
2437
|
content: params.content
|
|
2560
2438
|
})
|
|
@@ -2562,12 +2440,12 @@ function createSettingsMethods(client) {
|
|
|
2562
2440
|
return resp.note ?? null;
|
|
2563
2441
|
},
|
|
2564
2442
|
async getNote(id) {
|
|
2565
|
-
const resp = await client.getNote(
|
|
2443
|
+
const resp = await client.getNote(create8(GetNoteRequestSchema, { id }));
|
|
2566
2444
|
return resp.note ?? null;
|
|
2567
2445
|
},
|
|
2568
2446
|
async listNotes(params) {
|
|
2569
2447
|
return client.listNotes(
|
|
2570
|
-
|
|
2448
|
+
create8(ListNotesRequestSchema, {
|
|
2571
2449
|
entityType: params.entityType,
|
|
2572
2450
|
entityId: params.entityId,
|
|
2573
2451
|
limit: params.limit ?? 50,
|
|
@@ -2577,7 +2455,7 @@ function createSettingsMethods(client) {
|
|
|
2577
2455
|
},
|
|
2578
2456
|
async updateNote(params) {
|
|
2579
2457
|
const resp = await client.updateNote(
|
|
2580
|
-
|
|
2458
|
+
create8(UpdateNoteRequestSchema, {
|
|
2581
2459
|
id: params.id,
|
|
2582
2460
|
content: params.content,
|
|
2583
2461
|
isResolved: params.isResolved
|
|
@@ -2587,14 +2465,14 @@ function createSettingsMethods(client) {
|
|
|
2587
2465
|
},
|
|
2588
2466
|
async deleteNote(id) {
|
|
2589
2467
|
const resp = await client.deleteNote(
|
|
2590
|
-
|
|
2468
|
+
create8(DeleteNoteRequestSchema, { id })
|
|
2591
2469
|
);
|
|
2592
2470
|
return resp.success;
|
|
2593
2471
|
},
|
|
2594
2472
|
// ── Context Dimensions ───────────────────────────────────
|
|
2595
2473
|
async listContextDimensions(params = {}) {
|
|
2596
2474
|
return client.listContextDimensions(
|
|
2597
|
-
|
|
2475
|
+
create8(ListContextDimensionsRequestSchema, {
|
|
2598
2476
|
search: params.search,
|
|
2599
2477
|
limit: params.limit ?? 50,
|
|
2600
2478
|
offset: params.offset ?? 0
|
|
@@ -2603,31 +2481,31 @@ function createSettingsMethods(client) {
|
|
|
2603
2481
|
},
|
|
2604
2482
|
async getContextDimension(id) {
|
|
2605
2483
|
const resp = await client.getContextDimension(
|
|
2606
|
-
|
|
2484
|
+
create8(GetContextDimensionRequestSchema, { id })
|
|
2607
2485
|
);
|
|
2608
2486
|
return resp.dimension ?? null;
|
|
2609
2487
|
},
|
|
2610
2488
|
async createContextDimension(params) {
|
|
2611
2489
|
const resp = await client.createContextDimension(
|
|
2612
|
-
|
|
2490
|
+
create8(CreateContextDimensionRequestSchema, params)
|
|
2613
2491
|
);
|
|
2614
2492
|
return resp.dimension ?? null;
|
|
2615
2493
|
},
|
|
2616
2494
|
async updateContextDimension(params) {
|
|
2617
2495
|
const resp = await client.updateContextDimension(
|
|
2618
|
-
|
|
2496
|
+
create8(UpdateContextDimensionRequestSchema, params)
|
|
2619
2497
|
);
|
|
2620
2498
|
return resp.dimension ?? null;
|
|
2621
2499
|
},
|
|
2622
2500
|
async deleteContextDimension(id) {
|
|
2623
2501
|
const resp = await client.deleteContextDimension(
|
|
2624
|
-
|
|
2502
|
+
create8(DeleteContextDimensionRequestSchema, { id })
|
|
2625
2503
|
);
|
|
2626
2504
|
return resp.success;
|
|
2627
2505
|
},
|
|
2628
2506
|
async getContextDimensionValues(dimensionKey, params = {}) {
|
|
2629
2507
|
return client.getContextDimensionValues(
|
|
2630
|
-
|
|
2508
|
+
create8(GetContextDimensionValuesRequestSchema, {
|
|
2631
2509
|
dimensionKey,
|
|
2632
2510
|
search: params.search,
|
|
2633
2511
|
limit: params.limit ?? 50,
|
|
@@ -2638,19 +2516,19 @@ function createSettingsMethods(client) {
|
|
|
2638
2516
|
// ── Customer Profile Schema ──────────────────────────────
|
|
2639
2517
|
async getCustomerProfileSchema() {
|
|
2640
2518
|
const resp = await client.getCustomerProfileSchema(
|
|
2641
|
-
|
|
2519
|
+
create8(GetCustomerProfileSchemaRequestSchema, {})
|
|
2642
2520
|
);
|
|
2643
2521
|
return resp.schema ?? null;
|
|
2644
2522
|
},
|
|
2645
2523
|
async getCustomerProfile(customerId) {
|
|
2646
2524
|
const resp = await client.getCustomerProfile(
|
|
2647
|
-
|
|
2525
|
+
create8(GetCustomerProfileRequestSchema, { customerId })
|
|
2648
2526
|
);
|
|
2649
2527
|
return resp.data ?? null;
|
|
2650
2528
|
},
|
|
2651
2529
|
async setCustomerProfile(params) {
|
|
2652
2530
|
const resp = await client.setCustomerProfile(
|
|
2653
|
-
|
|
2531
|
+
create8(SetCustomerProfileRequestSchema, {
|
|
2654
2532
|
customerId: params.customerId,
|
|
2655
2533
|
data: params.data
|
|
2656
2534
|
})
|
|
@@ -2659,7 +2537,7 @@ function createSettingsMethods(client) {
|
|
|
2659
2537
|
},
|
|
2660
2538
|
async updateCustomerProfileSchema(params) {
|
|
2661
2539
|
const resp = await client.updateCustomerProfileSchema(
|
|
2662
|
-
|
|
2540
|
+
create8(UpdateCustomerProfileSchemaRequestSchema, {
|
|
2663
2541
|
fields: params.fields.map((f) => ({
|
|
2664
2542
|
id: f.id,
|
|
2665
2543
|
key: f.key,
|
|
@@ -2677,19 +2555,19 @@ function createSettingsMethods(client) {
|
|
|
2677
2555
|
},
|
|
2678
2556
|
async getCustomerResolutionAttributes(customerId) {
|
|
2679
2557
|
return client.getCustomerResolutionAttributes(
|
|
2680
|
-
|
|
2558
|
+
create8(GetCustomerResolutionAttributesRequestSchema, { customerId })
|
|
2681
2559
|
);
|
|
2682
2560
|
},
|
|
2683
2561
|
async getEditorConfigs(modelKey) {
|
|
2684
2562
|
const resp = await client.getEditorConfigs(
|
|
2685
|
-
|
|
2563
|
+
create8(GetEditorConfigsRequestSchema, { modelKey })
|
|
2686
2564
|
);
|
|
2687
2565
|
return resp.placements ?? [];
|
|
2688
2566
|
},
|
|
2689
2567
|
// ── Variant Catalog ──────────────────────────────────────
|
|
2690
2568
|
async listVariantCatalog(params = {}) {
|
|
2691
2569
|
return client.listVariantCatalog(
|
|
2692
|
-
|
|
2570
|
+
create8(ListVariantCatalogRequestSchema, {
|
|
2693
2571
|
isActive: params.isActive,
|
|
2694
2572
|
limit: params.limit ?? 50,
|
|
2695
2573
|
offset: params.offset ?? 0
|
|
@@ -2698,13 +2576,13 @@ function createSettingsMethods(client) {
|
|
|
2698
2576
|
},
|
|
2699
2577
|
async getVariantCatalogEntry(id) {
|
|
2700
2578
|
const resp = await client.getVariantCatalogEntry(
|
|
2701
|
-
|
|
2579
|
+
create8(GetVariantCatalogEntryRequestSchema, { id })
|
|
2702
2580
|
);
|
|
2703
2581
|
return resp.entry ?? null;
|
|
2704
2582
|
},
|
|
2705
2583
|
async createVariantCatalogEntry(params) {
|
|
2706
2584
|
const resp = await client.createVariantCatalogEntry(
|
|
2707
|
-
|
|
2585
|
+
create8(CreateVariantCatalogEntryRequestSchema, {
|
|
2708
2586
|
key: params.key,
|
|
2709
2587
|
name: params.name,
|
|
2710
2588
|
description: params.description,
|
|
@@ -2718,7 +2596,7 @@ function createSettingsMethods(client) {
|
|
|
2718
2596
|
},
|
|
2719
2597
|
async updateVariantCatalogEntry(params) {
|
|
2720
2598
|
const resp = await client.updateVariantCatalogEntry(
|
|
2721
|
-
|
|
2599
|
+
create8(UpdateVariantCatalogEntryRequestSchema, {
|
|
2722
2600
|
id: params.id,
|
|
2723
2601
|
name: params.name,
|
|
2724
2602
|
description: params.description,
|
|
@@ -2732,14 +2610,14 @@ function createSettingsMethods(client) {
|
|
|
2732
2610
|
},
|
|
2733
2611
|
async deleteVariantCatalogEntry(id) {
|
|
2734
2612
|
const resp = await client.deleteVariantCatalogEntry(
|
|
2735
|
-
|
|
2613
|
+
create8(DeleteVariantCatalogEntryRequestSchema, { id })
|
|
2736
2614
|
);
|
|
2737
2615
|
return resp.success;
|
|
2738
2616
|
},
|
|
2739
2617
|
// ── Locales ──────────────────────────────────────────────
|
|
2740
2618
|
async listLocales(params = {}) {
|
|
2741
2619
|
return client.listLocales(
|
|
2742
|
-
|
|
2620
|
+
create8(ListLocalesRequestSchema, {
|
|
2743
2621
|
includeInactive: params.includeInactive,
|
|
2744
2622
|
limit: params.limit ?? 50,
|
|
2745
2623
|
offset: params.offset ?? 0
|
|
@@ -2748,25 +2626,25 @@ function createSettingsMethods(client) {
|
|
|
2748
2626
|
},
|
|
2749
2627
|
async getLocale(id) {
|
|
2750
2628
|
const resp = await client.getLocale(
|
|
2751
|
-
|
|
2629
|
+
create8(GetLocaleRequestSchema, { id })
|
|
2752
2630
|
);
|
|
2753
2631
|
return resp.locale ?? null;
|
|
2754
2632
|
},
|
|
2755
2633
|
async getLocaleByCode(code) {
|
|
2756
2634
|
const resp = await client.getLocaleByCode(
|
|
2757
|
-
|
|
2635
|
+
create8(GetLocaleByCodeRequestSchema, { code })
|
|
2758
2636
|
);
|
|
2759
2637
|
return resp.locale ?? null;
|
|
2760
2638
|
},
|
|
2761
2639
|
async getDefaultLocale() {
|
|
2762
2640
|
const resp = await client.getDefaultLocale(
|
|
2763
|
-
|
|
2641
|
+
create8(GetDefaultLocaleRequestSchema, {})
|
|
2764
2642
|
);
|
|
2765
2643
|
return resp.locale ?? null;
|
|
2766
2644
|
},
|
|
2767
2645
|
async createLocale(params) {
|
|
2768
2646
|
const resp = await client.createLocale(
|
|
2769
|
-
|
|
2647
|
+
create8(CreateLocaleRequestSchema, {
|
|
2770
2648
|
locale: params.locale,
|
|
2771
2649
|
displayName: params.displayName,
|
|
2772
2650
|
nativeName: params.nativeName,
|
|
@@ -2779,7 +2657,7 @@ function createSettingsMethods(client) {
|
|
|
2779
2657
|
},
|
|
2780
2658
|
async updateLocale(params) {
|
|
2781
2659
|
const resp = await client.updateLocale(
|
|
2782
|
-
|
|
2660
|
+
create8(UpdateLocaleRequestSchema, {
|
|
2783
2661
|
id: params.id,
|
|
2784
2662
|
displayName: params.displayName,
|
|
2785
2663
|
nativeName: params.nativeName,
|
|
@@ -2793,20 +2671,20 @@ function createSettingsMethods(client) {
|
|
|
2793
2671
|
},
|
|
2794
2672
|
async deleteLocale(id) {
|
|
2795
2673
|
const resp = await client.deleteLocale(
|
|
2796
|
-
|
|
2674
|
+
create8(DeleteLocaleRequestSchema, { id })
|
|
2797
2675
|
);
|
|
2798
2676
|
return resp.success;
|
|
2799
2677
|
},
|
|
2800
2678
|
// ── Nav Preferences ─────────────────────────────────────
|
|
2801
2679
|
async getNavPreferences() {
|
|
2802
2680
|
const resp = await client.getNavPreferences(
|
|
2803
|
-
|
|
2681
|
+
create8(GetNavPreferencesRequestSchema, {})
|
|
2804
2682
|
);
|
|
2805
2683
|
return resp.preferences ?? null;
|
|
2806
2684
|
},
|
|
2807
2685
|
async updateNavPreferences(params) {
|
|
2808
2686
|
const resp = await client.updateNavPreferences(
|
|
2809
|
-
|
|
2687
|
+
create8(UpdateNavPreferencesRequestSchema, {
|
|
2810
2688
|
preferences: params.preferences ? {
|
|
2811
2689
|
favoriteProjects: params.preferences.favoriteProjects,
|
|
2812
2690
|
favoriteNavItems: params.preferences.favoriteNavItems,
|
|
@@ -2823,7 +2701,7 @@ function createSettingsMethods(client) {
|
|
|
2823
2701
|
// ── Recently Opened ─────────────────────────────────────
|
|
2824
2702
|
async listRecentlyOpened(limit) {
|
|
2825
2703
|
const resp = await client.listRecentlyOpened(
|
|
2826
|
-
|
|
2704
|
+
create8(ListRecentlyOpenedRequestSchema, {
|
|
2827
2705
|
limit: limit ?? 20
|
|
2828
2706
|
})
|
|
2829
2707
|
);
|
|
@@ -2831,7 +2709,7 @@ function createSettingsMethods(client) {
|
|
|
2831
2709
|
},
|
|
2832
2710
|
async trackRecentlyOpened(params) {
|
|
2833
2711
|
const resp = await client.trackRecentlyOpened(
|
|
2834
|
-
|
|
2712
|
+
create8(TrackRecentlyOpenedRequestSchema, {
|
|
2835
2713
|
type: params.type,
|
|
2836
2714
|
id: params.id,
|
|
2837
2715
|
label: params.label,
|
|
@@ -2842,7 +2720,7 @@ function createSettingsMethods(client) {
|
|
|
2842
2720
|
},
|
|
2843
2721
|
async removeRecentlyOpened(params) {
|
|
2844
2722
|
const resp = await client.removeRecentlyOpened(
|
|
2845
|
-
|
|
2723
|
+
create8(RemoveRecentlyOpenedRequestSchema, {
|
|
2846
2724
|
type: params.type,
|
|
2847
2725
|
id: params.id
|
|
2848
2726
|
})
|
|
@@ -2851,14 +2729,14 @@ function createSettingsMethods(client) {
|
|
|
2851
2729
|
},
|
|
2852
2730
|
async clearRecentlyOpened() {
|
|
2853
2731
|
const resp = await client.clearRecentlyOpened(
|
|
2854
|
-
|
|
2732
|
+
create8(ClearRecentlyOpenedRequestSchema, {})
|
|
2855
2733
|
);
|
|
2856
2734
|
return resp.success;
|
|
2857
2735
|
},
|
|
2858
2736
|
// ── Email Actions ──────────────────────────────────────────
|
|
2859
2737
|
async listEmailActions(params = {}) {
|
|
2860
2738
|
return client.listEmailActions(
|
|
2861
|
-
|
|
2739
|
+
create8(ListEmailActionsRequestSchema, {
|
|
2862
2740
|
limit: params.limit ?? 50,
|
|
2863
2741
|
offset: params.offset ?? 0
|
|
2864
2742
|
})
|
|
@@ -2866,7 +2744,7 @@ function createSettingsMethods(client) {
|
|
|
2866
2744
|
},
|
|
2867
2745
|
async updateEmailAction(params) {
|
|
2868
2746
|
const resp = await client.updateEmailAction(
|
|
2869
|
-
|
|
2747
|
+
create8(UpdateEmailActionRequestSchema, {
|
|
2870
2748
|
key: params.key,
|
|
2871
2749
|
resendTemplateId: params.resendTemplateId,
|
|
2872
2750
|
defaultFrom: params.defaultFrom,
|
|
@@ -2879,7 +2757,7 @@ function createSettingsMethods(client) {
|
|
|
2879
2757
|
},
|
|
2880
2758
|
async listResendTemplates() {
|
|
2881
2759
|
const resp = await client.listResendTemplates(
|
|
2882
|
-
|
|
2760
|
+
create8(ListResendTemplatesRequestSchema, {})
|
|
2883
2761
|
);
|
|
2884
2762
|
return resp.templates ?? [];
|
|
2885
2763
|
}
|
|
@@ -2887,7 +2765,7 @@ function createSettingsMethods(client) {
|
|
|
2887
2765
|
}
|
|
2888
2766
|
|
|
2889
2767
|
// src/lib/rpc/storage.ts
|
|
2890
|
-
import { create as
|
|
2768
|
+
import { create as create9 } from "@bufbuild/protobuf";
|
|
2891
2769
|
import {
|
|
2892
2770
|
CreateFileUploadRequestSchema,
|
|
2893
2771
|
ConfirmFileUploadRequestSchema,
|
|
@@ -2907,7 +2785,7 @@ function createStorageMethods(client) {
|
|
|
2907
2785
|
return {
|
|
2908
2786
|
async createFileUpload(params) {
|
|
2909
2787
|
return client.createFileUpload(
|
|
2910
|
-
|
|
2788
|
+
create9(CreateFileUploadRequestSchema, {
|
|
2911
2789
|
filename: params.filename,
|
|
2912
2790
|
mimeType: params.mimeType,
|
|
2913
2791
|
size: BigInt(params.size),
|
|
@@ -2917,17 +2795,17 @@ function createStorageMethods(client) {
|
|
|
2917
2795
|
},
|
|
2918
2796
|
async confirmFileUpload(uploadId) {
|
|
2919
2797
|
const resp = await client.confirmFileUpload(
|
|
2920
|
-
|
|
2798
|
+
create9(ConfirmFileUploadRequestSchema, { uploadId })
|
|
2921
2799
|
);
|
|
2922
2800
|
return resp.file ?? null;
|
|
2923
2801
|
},
|
|
2924
2802
|
async getFile(id) {
|
|
2925
|
-
const resp = await client.getFile(
|
|
2803
|
+
const resp = await client.getFile(create9(GetFileRequestSchema, { id }));
|
|
2926
2804
|
return resp.file ?? null;
|
|
2927
2805
|
},
|
|
2928
2806
|
async listFiles(params) {
|
|
2929
2807
|
return client.listFiles(
|
|
2930
|
-
|
|
2808
|
+
create9(ListFilesRequestSchema, {
|
|
2931
2809
|
folder: params.folder,
|
|
2932
2810
|
mimeType: params.mimeType,
|
|
2933
2811
|
search: params.search,
|
|
@@ -2939,13 +2817,13 @@ function createStorageMethods(client) {
|
|
|
2939
2817
|
},
|
|
2940
2818
|
async getStorageUsage() {
|
|
2941
2819
|
const resp = await client.getStorageUsage(
|
|
2942
|
-
|
|
2820
|
+
create9(GetStorageUsageRequestSchema, {})
|
|
2943
2821
|
);
|
|
2944
2822
|
return resp.usage ?? null;
|
|
2945
2823
|
},
|
|
2946
2824
|
async updateFile(params) {
|
|
2947
2825
|
const resp = await client.updateFile(
|
|
2948
|
-
|
|
2826
|
+
create9(UpdateFileRequestSchema, {
|
|
2949
2827
|
id: params.id,
|
|
2950
2828
|
filename: params.filename,
|
|
2951
2829
|
folder: params.folder,
|
|
@@ -2956,7 +2834,7 @@ function createStorageMethods(client) {
|
|
|
2956
2834
|
},
|
|
2957
2835
|
async updateFileMetadata(params) {
|
|
2958
2836
|
const resp = await client.updateFileMetadata(
|
|
2959
|
-
|
|
2837
|
+
create9(UpdateFileMetadataRequestSchema, {
|
|
2960
2838
|
id: params.id,
|
|
2961
2839
|
altText: params.altText,
|
|
2962
2840
|
caption: params.caption,
|
|
@@ -2967,37 +2845,37 @@ function createStorageMethods(client) {
|
|
|
2967
2845
|
},
|
|
2968
2846
|
async deleteFile(id) {
|
|
2969
2847
|
const resp = await client.deleteFile(
|
|
2970
|
-
|
|
2848
|
+
create9(DeleteFileRequestSchema, { id })
|
|
2971
2849
|
);
|
|
2972
2850
|
return resp.success;
|
|
2973
2851
|
},
|
|
2974
2852
|
async permanentlyDeleteFile(id) {
|
|
2975
2853
|
const resp = await client.permanentlyDeleteFile(
|
|
2976
|
-
|
|
2854
|
+
create9(PermanentlyDeleteFileRequestSchema, { id })
|
|
2977
2855
|
);
|
|
2978
2856
|
return resp.success;
|
|
2979
2857
|
},
|
|
2980
2858
|
async restoreFile(id) {
|
|
2981
2859
|
const resp = await client.restoreFile(
|
|
2982
|
-
|
|
2860
|
+
create9(RestoreFileRequestSchema, { id })
|
|
2983
2861
|
);
|
|
2984
2862
|
return resp.file ?? null;
|
|
2985
2863
|
},
|
|
2986
2864
|
async trackFileUsage(fileId, entityType) {
|
|
2987
2865
|
const resp = await client.trackFileUsage(
|
|
2988
|
-
|
|
2866
|
+
create9(TrackFileUsageRequestSchema, { fileId, entityType })
|
|
2989
2867
|
);
|
|
2990
2868
|
return resp.file ?? null;
|
|
2991
2869
|
},
|
|
2992
2870
|
async removeFileUsage(fileId, entityType) {
|
|
2993
2871
|
const resp = await client.removeFileUsage(
|
|
2994
|
-
|
|
2872
|
+
create9(RemoveFileUsageRequestSchema, { fileId, entityType })
|
|
2995
2873
|
);
|
|
2996
2874
|
return resp.success;
|
|
2997
2875
|
},
|
|
2998
2876
|
async cleanupOrphanedFiles(params) {
|
|
2999
2877
|
return client.cleanupOrphanedFiles(
|
|
3000
|
-
|
|
2878
|
+
create9(CleanupOrphanedFilesRequestSchema, {
|
|
3001
2879
|
orphanThresholdDays: params?.orphanThresholdDays ?? 30,
|
|
3002
2880
|
dryRun: params?.dryRun ?? false,
|
|
3003
2881
|
limit: params?.limit ?? 100
|
|
@@ -3008,7 +2886,7 @@ function createStorageMethods(client) {
|
|
|
3008
2886
|
}
|
|
3009
2887
|
|
|
3010
2888
|
// src/lib/rpc/operations.ts
|
|
3011
|
-
import { create as
|
|
2889
|
+
import { create as create10 } from "@bufbuild/protobuf";
|
|
3012
2890
|
import {
|
|
3013
2891
|
ListOperationsRequestSchema as ListOperationsRequestSchema2,
|
|
3014
2892
|
GetOperationRequestSchema,
|
|
@@ -3026,7 +2904,7 @@ function createOperationsMethods(client) {
|
|
|
3026
2904
|
// ── CRUD ──────────────────────────────────────────────────
|
|
3027
2905
|
async listOperations(params = {}) {
|
|
3028
2906
|
return client.listOperations(
|
|
3029
|
-
|
|
2907
|
+
create10(ListOperationsRequestSchema2, {
|
|
3030
2908
|
configId: params.configId,
|
|
3031
2909
|
category: params.category,
|
|
3032
2910
|
isActive: params.isActive,
|
|
@@ -3038,7 +2916,7 @@ function createOperationsMethods(client) {
|
|
|
3038
2916
|
},
|
|
3039
2917
|
async getOperation(params) {
|
|
3040
2918
|
const resp = await client.getOperation(
|
|
3041
|
-
|
|
2919
|
+
create10(GetOperationRequestSchema, {
|
|
3042
2920
|
id: params.id ?? "",
|
|
3043
2921
|
key: params.key
|
|
3044
2922
|
})
|
|
@@ -3047,7 +2925,7 @@ function createOperationsMethods(client) {
|
|
|
3047
2925
|
},
|
|
3048
2926
|
async createOperation(params) {
|
|
3049
2927
|
const resp = await client.createOperation(
|
|
3050
|
-
|
|
2928
|
+
create10(CreateOperationRequestSchema, {
|
|
3051
2929
|
key: params.key,
|
|
3052
2930
|
name: params.name,
|
|
3053
2931
|
endpoint: params.endpoint,
|
|
@@ -3071,7 +2949,7 @@ function createOperationsMethods(client) {
|
|
|
3071
2949
|
},
|
|
3072
2950
|
async updateOperation(params) {
|
|
3073
2951
|
const resp = await client.updateOperation(
|
|
3074
|
-
|
|
2952
|
+
create10(UpdateOperationRequestSchema, {
|
|
3075
2953
|
id: params.id,
|
|
3076
2954
|
name: params.name,
|
|
3077
2955
|
description: params.description,
|
|
@@ -3092,20 +2970,20 @@ function createOperationsMethods(client) {
|
|
|
3092
2970
|
},
|
|
3093
2971
|
async deleteOperation(id) {
|
|
3094
2972
|
const resp = await client.deleteOperation(
|
|
3095
|
-
|
|
2973
|
+
create10(DeleteOperationRequestSchema, { id })
|
|
3096
2974
|
);
|
|
3097
2975
|
return resp.success;
|
|
3098
2976
|
},
|
|
3099
2977
|
async getSigningSecret() {
|
|
3100
2978
|
const resp = await client.getSigningSecret(
|
|
3101
|
-
|
|
2979
|
+
create10(GetSigningSecretRequestSchema, {})
|
|
3102
2980
|
);
|
|
3103
2981
|
return { secret: resp.secret, prefix: resp.prefix };
|
|
3104
2982
|
},
|
|
3105
2983
|
// ── Execution ─────────────────────────────────────────────
|
|
3106
2984
|
async executeOperation(params) {
|
|
3107
2985
|
return client.executeOperation(
|
|
3108
|
-
|
|
2986
|
+
create10(ExecuteOperationRequestSchema, {
|
|
3109
2987
|
operationKey: params.operationKey,
|
|
3110
2988
|
input: params.input,
|
|
3111
2989
|
triggerType: params.triggerType,
|
|
@@ -3116,7 +2994,7 @@ function createOperationsMethods(client) {
|
|
|
3116
2994
|
// ── Dead Letter Queue ─────────────────────────────────────
|
|
3117
2995
|
async listDeadLetterEntries(params = {}) {
|
|
3118
2996
|
return client.listDeadLetterEntries(
|
|
3119
|
-
|
|
2997
|
+
create10(ListDeadLetterEntriesRequestSchema, {
|
|
3120
2998
|
operationKey: params.operationKey,
|
|
3121
2999
|
limit: params.limit ?? 50,
|
|
3122
3000
|
offset: params.offset ?? 0
|
|
@@ -3125,13 +3003,13 @@ function createOperationsMethods(client) {
|
|
|
3125
3003
|
},
|
|
3126
3004
|
async retryDeadLetterEntry(id) {
|
|
3127
3005
|
const resp = await client.retryDeadLetterEntry(
|
|
3128
|
-
|
|
3006
|
+
create10(RetryDeadLetterEntryRequestSchema, { id })
|
|
3129
3007
|
);
|
|
3130
3008
|
return resp.success;
|
|
3131
3009
|
},
|
|
3132
3010
|
async dismissDeadLetterEntry(id) {
|
|
3133
3011
|
const resp = await client.dismissDeadLetterEntry(
|
|
3134
|
-
|
|
3012
|
+
create10(DismissDeadLetterEntryRequestSchema, { id })
|
|
3135
3013
|
);
|
|
3136
3014
|
return resp.success;
|
|
3137
3015
|
}
|
|
@@ -3139,7 +3017,7 @@ function createOperationsMethods(client) {
|
|
|
3139
3017
|
}
|
|
3140
3018
|
|
|
3141
3019
|
// src/lib/rpc/hooks.ts
|
|
3142
|
-
import { create as
|
|
3020
|
+
import { create as create11 } from "@bufbuild/protobuf";
|
|
3143
3021
|
import {
|
|
3144
3022
|
ListHooksRequestSchema,
|
|
3145
3023
|
GetHookRequestSchema,
|
|
@@ -3156,7 +3034,7 @@ function createHooksMethods(client) {
|
|
|
3156
3034
|
// ── Queries ──────────────────────────────────────────────
|
|
3157
3035
|
async listHooks(params = {}) {
|
|
3158
3036
|
return client.listHooks(
|
|
3159
|
-
|
|
3037
|
+
create11(ListHooksRequestSchema, {
|
|
3160
3038
|
event: params.event,
|
|
3161
3039
|
isActive: params.isActive,
|
|
3162
3040
|
configId: params.configId,
|
|
@@ -3166,13 +3044,13 @@ function createHooksMethods(client) {
|
|
|
3166
3044
|
);
|
|
3167
3045
|
},
|
|
3168
3046
|
async getHook(id) {
|
|
3169
|
-
const resp = await client.getHook(
|
|
3047
|
+
const resp = await client.getHook(create11(GetHookRequestSchema, { id }));
|
|
3170
3048
|
return resp.hook ?? null;
|
|
3171
3049
|
},
|
|
3172
3050
|
// ── Mutations ────────────────────────────────────────────
|
|
3173
3051
|
async createHook(params) {
|
|
3174
3052
|
const resp = await client.createHook(
|
|
3175
|
-
|
|
3053
|
+
create11(CreateHookRequestSchema, {
|
|
3176
3054
|
key: params.key,
|
|
3177
3055
|
name: params.name,
|
|
3178
3056
|
event: params.event,
|
|
@@ -3188,7 +3066,7 @@ function createHooksMethods(client) {
|
|
|
3188
3066
|
},
|
|
3189
3067
|
async updateHook(params) {
|
|
3190
3068
|
const resp = await client.updateHook(
|
|
3191
|
-
|
|
3069
|
+
create11(UpdateHookRequestSchema, {
|
|
3192
3070
|
id: params.id,
|
|
3193
3071
|
name: params.name,
|
|
3194
3072
|
description: params.description,
|
|
@@ -3202,21 +3080,21 @@ function createHooksMethods(client) {
|
|
|
3202
3080
|
},
|
|
3203
3081
|
async deleteHook(id) {
|
|
3204
3082
|
const resp = await client.deleteHook(
|
|
3205
|
-
|
|
3083
|
+
create11(DeleteHookRequestSchema, { id })
|
|
3206
3084
|
);
|
|
3207
3085
|
return resp.success;
|
|
3208
3086
|
},
|
|
3209
3087
|
// ── Get by Key ──────────────────────────────────────────
|
|
3210
3088
|
async getHookByKey(key) {
|
|
3211
3089
|
const resp = await client.getHookByKey(
|
|
3212
|
-
|
|
3090
|
+
create11(GetHookByKeyRequestSchema, { key })
|
|
3213
3091
|
);
|
|
3214
3092
|
return resp.hook ?? null;
|
|
3215
3093
|
},
|
|
3216
3094
|
// ── Deliveries ──────────────────────────────────────────
|
|
3217
3095
|
async listHookDeliveries(params) {
|
|
3218
3096
|
return client.listHookDeliveries(
|
|
3219
|
-
|
|
3097
|
+
create11(ListHookDeliveriesRequestSchema, {
|
|
3220
3098
|
hookId: params.hookId,
|
|
3221
3099
|
status: params.status,
|
|
3222
3100
|
limit: params.limit ?? 50,
|
|
@@ -3226,14 +3104,14 @@ function createHooksMethods(client) {
|
|
|
3226
3104
|
},
|
|
3227
3105
|
async retryHookDelivery(deliveryId) {
|
|
3228
3106
|
const resp = await client.retryHookDelivery(
|
|
3229
|
-
|
|
3107
|
+
create11(RetryHookDeliveryRequestSchema, { deliveryId })
|
|
3230
3108
|
);
|
|
3231
3109
|
return resp.success;
|
|
3232
3110
|
},
|
|
3233
3111
|
// ── Testing ─────────────────────────────────────────────
|
|
3234
3112
|
async testHook(params) {
|
|
3235
3113
|
const resp = await client.testHook(
|
|
3236
|
-
|
|
3114
|
+
create11(TestHookRequestSchema, {
|
|
3237
3115
|
hookId: params.hookId,
|
|
3238
3116
|
testPayload: params.testPayload
|
|
3239
3117
|
})
|
|
@@ -3247,7 +3125,7 @@ function createHooksMethods(client) {
|
|
|
3247
3125
|
}
|
|
3248
3126
|
|
|
3249
3127
|
// src/lib/rpc/notifications.ts
|
|
3250
|
-
import { create as
|
|
3128
|
+
import { create as create12 } from "@bufbuild/protobuf";
|
|
3251
3129
|
import {
|
|
3252
3130
|
ListNotificationsRequestSchema,
|
|
3253
3131
|
MarkNotificationReadRequestSchema,
|
|
@@ -3257,7 +3135,7 @@ function createNotificationsMethods(client) {
|
|
|
3257
3135
|
return {
|
|
3258
3136
|
async listNotifications(params = {}) {
|
|
3259
3137
|
return client.listNotifications(
|
|
3260
|
-
|
|
3138
|
+
create12(ListNotificationsRequestSchema, {
|
|
3261
3139
|
isRead: params.unreadOnly ? false : void 0,
|
|
3262
3140
|
limit: params.limit ?? 20,
|
|
3263
3141
|
offset: params.offset ?? 0
|
|
@@ -3266,13 +3144,13 @@ function createNotificationsMethods(client) {
|
|
|
3266
3144
|
},
|
|
3267
3145
|
async markNotificationRead(id) {
|
|
3268
3146
|
const resp = await client.markNotificationRead(
|
|
3269
|
-
|
|
3147
|
+
create12(MarkNotificationReadRequestSchema, { id })
|
|
3270
3148
|
);
|
|
3271
3149
|
return resp.success;
|
|
3272
3150
|
},
|
|
3273
3151
|
async markAllNotificationsRead() {
|
|
3274
3152
|
const resp = await client.markAllNotificationsRead(
|
|
3275
|
-
|
|
3153
|
+
create12(MarkAllNotificationsReadRequestSchema, {})
|
|
3276
3154
|
);
|
|
3277
3155
|
return resp.count;
|
|
3278
3156
|
}
|
|
@@ -3280,7 +3158,7 @@ function createNotificationsMethods(client) {
|
|
|
3280
3158
|
}
|
|
3281
3159
|
|
|
3282
3160
|
// src/lib/rpc/cron-schedules.ts
|
|
3283
|
-
import { create as
|
|
3161
|
+
import { create as create13 } from "@bufbuild/protobuf";
|
|
3284
3162
|
import {
|
|
3285
3163
|
ListCronSchedulesRequestSchema,
|
|
3286
3164
|
GetCronScheduleRequestSchema,
|
|
@@ -3297,7 +3175,7 @@ function createCronSchedulesMethods(client) {
|
|
|
3297
3175
|
// ── Queries ──────────────────────────────────────────────
|
|
3298
3176
|
async listCronSchedules(params = {}) {
|
|
3299
3177
|
return client.listCronSchedules(
|
|
3300
|
-
|
|
3178
|
+
create13(ListCronSchedulesRequestSchema, {
|
|
3301
3179
|
configId: params.configId,
|
|
3302
3180
|
isActive: params.isActive,
|
|
3303
3181
|
limit: params.limit ?? 50,
|
|
@@ -3307,20 +3185,20 @@ function createCronSchedulesMethods(client) {
|
|
|
3307
3185
|
},
|
|
3308
3186
|
async getCronSchedule(id) {
|
|
3309
3187
|
const resp = await client.getCronSchedule(
|
|
3310
|
-
|
|
3188
|
+
create13(GetCronScheduleRequestSchema, { id })
|
|
3311
3189
|
);
|
|
3312
3190
|
return resp.schedule ?? null;
|
|
3313
3191
|
},
|
|
3314
3192
|
async getCronScheduleByKey(key) {
|
|
3315
3193
|
const resp = await client.getCronScheduleByKey(
|
|
3316
|
-
|
|
3194
|
+
create13(GetCronScheduleByKeyRequestSchema, { key })
|
|
3317
3195
|
);
|
|
3318
3196
|
return resp.schedule ?? null;
|
|
3319
3197
|
},
|
|
3320
3198
|
// ── Mutations ────────────────────────────────────────────
|
|
3321
3199
|
async createCronSchedule(params) {
|
|
3322
3200
|
const resp = await client.createCronSchedule(
|
|
3323
|
-
|
|
3201
|
+
create13(CreateCronScheduleRequestSchema, {
|
|
3324
3202
|
key: params.key,
|
|
3325
3203
|
name: params.name,
|
|
3326
3204
|
description: params.description,
|
|
@@ -3334,7 +3212,7 @@ function createCronSchedulesMethods(client) {
|
|
|
3334
3212
|
},
|
|
3335
3213
|
async updateCronSchedule(params) {
|
|
3336
3214
|
const resp = await client.updateCronSchedule(
|
|
3337
|
-
|
|
3215
|
+
create13(UpdateCronScheduleRequestSchema, {
|
|
3338
3216
|
id: params.id,
|
|
3339
3217
|
name: params.name,
|
|
3340
3218
|
description: params.description,
|
|
@@ -3348,25 +3226,25 @@ function createCronSchedulesMethods(client) {
|
|
|
3348
3226
|
},
|
|
3349
3227
|
async deleteCronSchedule(id) {
|
|
3350
3228
|
const resp = await client.deleteCronSchedule(
|
|
3351
|
-
|
|
3229
|
+
create13(DeleteCronScheduleRequestSchema, { id })
|
|
3352
3230
|
);
|
|
3353
3231
|
return resp.success;
|
|
3354
3232
|
},
|
|
3355
3233
|
async pauseCronSchedule(params) {
|
|
3356
3234
|
const resp = await client.pauseCronSchedule(
|
|
3357
|
-
|
|
3235
|
+
create13(PauseCronScheduleRequestSchema, { id: params.id })
|
|
3358
3236
|
);
|
|
3359
3237
|
return resp.schedule ?? null;
|
|
3360
3238
|
},
|
|
3361
3239
|
async resumeCronSchedule(params) {
|
|
3362
3240
|
const resp = await client.resumeCronSchedule(
|
|
3363
|
-
|
|
3241
|
+
create13(ResumeCronScheduleRequestSchema, { id: params.id })
|
|
3364
3242
|
);
|
|
3365
3243
|
return resp.schedule ?? null;
|
|
3366
3244
|
},
|
|
3367
3245
|
async triggerCronSchedule(params) {
|
|
3368
3246
|
const resp = await client.triggerCronSchedule(
|
|
3369
|
-
|
|
3247
|
+
create13(TriggerCronScheduleRequestSchema, { id: params.id })
|
|
3370
3248
|
);
|
|
3371
3249
|
return resp.schedule ?? null;
|
|
3372
3250
|
}
|
|
@@ -3432,9 +3310,6 @@ async function createPlatformClient(options) {
|
|
|
3432
3310
|
cronSchedules: createCronSchedulesMethods(
|
|
3433
3311
|
createRpcClient(SchedulesService2, transport)
|
|
3434
3312
|
),
|
|
3435
|
-
integrations: createIntegrationsMethods(
|
|
3436
|
-
createRpcClient(IntegrationsService2, transport)
|
|
3437
|
-
),
|
|
3438
3313
|
apps: createAppsMethods(createRpcClient(AppsService2, transport))
|
|
3439
3314
|
};
|
|
3440
3315
|
}
|
|
@@ -3471,9 +3346,6 @@ function createPlatformClientWithHeaders(apiUrl, headers) {
|
|
|
3471
3346
|
cronSchedules: createCronSchedulesMethods(
|
|
3472
3347
|
createRpcClient(SchedulesService2, transport)
|
|
3473
3348
|
),
|
|
3474
|
-
integrations: createIntegrationsMethods(
|
|
3475
|
-
createRpcClient(IntegrationsService2, transport)
|
|
3476
|
-
),
|
|
3477
3349
|
apps: createAppsMethods(createRpcClient(AppsService2, transport))
|
|
3478
3350
|
};
|
|
3479
3351
|
}
|
|
@@ -5534,275 +5406,6 @@ function toPlacementFieldChoices(input) {
|
|
|
5534
5406
|
return out;
|
|
5535
5407
|
}
|
|
5536
5408
|
|
|
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
5409
|
// src/commands/push.ts
|
|
5807
5410
|
var CONFIG_FILE_NAMES = [
|
|
5808
5411
|
"foir.config.ts",
|
|
@@ -5884,11 +5487,6 @@ function registerPushCommand(program2, globalOpts) {
|
|
|
5884
5487
|
'Config must have at least "key" and "name" fields.'
|
|
5885
5488
|
);
|
|
5886
5489
|
}
|
|
5887
|
-
const validation = validateIntegrationsAndExtensions(config2);
|
|
5888
|
-
for (const warning of validation.warnings) {
|
|
5889
|
-
console.log(chalk6.yellow(`\u26A0 ${warning}`));
|
|
5890
|
-
}
|
|
5891
|
-
assertValid(validation);
|
|
5892
5490
|
const gOpts = globalOpts();
|
|
5893
5491
|
const client = await createPlatformClient(gOpts);
|
|
5894
5492
|
const resolved = await resolveProjectContext(gOpts);
|
|
@@ -6015,26 +5613,10 @@ function registerPullCommand(program2, globalOpts) {
|
|
|
6015
5613
|
);
|
|
6016
5614
|
}
|
|
6017
5615
|
const resolved = await resolveProjectContext(globalOpts());
|
|
6018
|
-
let integrations;
|
|
6019
|
-
let extensions;
|
|
6020
5616
|
let apps;
|
|
6021
5617
|
if (resolved) {
|
|
6022
5618
|
const projectId = resolved.project.id;
|
|
6023
5619
|
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
5620
|
const installedApps = await client.apps.listApps(tenantId, projectId);
|
|
6039
5621
|
if (installedApps.length > 0) {
|
|
6040
5622
|
apps = {};
|
|
@@ -6044,8 +5626,6 @@ function registerPullCommand(program2, globalOpts) {
|
|
|
6044
5626
|
}
|
|
6045
5627
|
}
|
|
6046
5628
|
const configDataNoInteg = { ...configData };
|
|
6047
|
-
delete configDataNoInteg.integrations;
|
|
6048
|
-
delete configDataNoInteg.extensions;
|
|
6049
5629
|
delete configDataNoInteg.apps;
|
|
6050
5630
|
const manifest = {
|
|
6051
5631
|
key: config2.key,
|
|
@@ -6055,8 +5635,6 @@ function registerPullCommand(program2, globalOpts) {
|
|
|
6055
5635
|
...config2.description ? { description: config2.description } : {},
|
|
6056
5636
|
...config2.connectionDomain ? { operationBaseUrl: config2.connectionDomain } : {},
|
|
6057
5637
|
...configDataNoInteg,
|
|
6058
|
-
...integrations ? { integrations } : {},
|
|
6059
|
-
...extensions ? { extensions } : {},
|
|
6060
5638
|
...apps ? { apps } : {}
|
|
6061
5639
|
};
|
|
6062
5640
|
delete manifest.force;
|
|
@@ -6104,12 +5682,6 @@ export default defineConfig(${jsonContent});
|
|
|
6104
5682
|
if (schedules.length > 0) parts.push(`${schedules.length} schedule(s)`);
|
|
6105
5683
|
if (authProviders.length > 0) parts.push(`${authProviders.length} auth provider(s)`);
|
|
6106
5684
|
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
5685
|
if (apps) {
|
|
6114
5686
|
parts.push(`${Object.keys(apps).length} app(s)`);
|
|
6115
5687
|
}
|
|
@@ -8446,7 +8018,7 @@ function registerNotificationsCommands(program2, globalOpts) {
|
|
|
8446
8018
|
|
|
8447
8019
|
// src/commands/configs.ts
|
|
8448
8020
|
function registerConfigsCommands(program2, globalOpts) {
|
|
8449
|
-
const configs = program2.command("configs").description("Manage configs (
|
|
8021
|
+
const configs = program2.command("configs").description("Manage configs (apps, webhooks)");
|
|
8450
8022
|
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
8023
|
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
8452
8024
|
const opts = globalOpts();
|