@eide/foir-cli 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +191 -825
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -464,7 +464,6 @@ import { ModelsService as ModelsService2 } from "@eide/foir-proto-ts/models/v1/m
464
464
  import { RecordsService as RecordsService2 } from "@eide/foir-proto-ts/records/v1/records_pb";
465
465
  import { ConfigsService as ConfigsService2 } from "@eide/foir-proto-ts/configs/v1/configs_pb";
466
466
  import { SegmentsService as SegmentsService2 } from "@eide/foir-proto-ts/segments/v1/segments_pb";
467
- import { ExperimentsService as ExperimentsService2 } from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
468
467
  import { SettingsService as SettingsService2 } from "@eide/foir-proto-ts/settings/v1/settings_pb";
469
468
  import { StorageService as StorageService2 } from "@eide/foir-proto-ts/storage/v1/storage_pb";
470
469
  import { OperationsService as OperationsService2 } from "@eide/foir-proto-ts/operations/v1/operations_pb";
@@ -536,6 +535,7 @@ import {
536
535
  CreateAuthProviderRequestSchema,
537
536
  UpdateAuthProviderRequestSchema,
538
537
  DeleteAuthProviderRequestSchema,
538
+ PublishAuthProviderRequestSchema,
539
539
  EnabledOAuthProvidersRequestSchema,
540
540
  CheckEmailAvailabilityRequestSchema,
541
541
  CompleteAccountSetupRequestSchema,
@@ -1074,6 +1074,12 @@ function createIdentityMethods(client) {
1074
1074
  );
1075
1075
  return resp.success;
1076
1076
  },
1077
+ async publishAuthProvider(id) {
1078
+ const resp = await client.publishAuthProvider(
1079
+ create(PublishAuthProviderRequestSchema, { id })
1080
+ );
1081
+ return resp.provider ?? null;
1082
+ },
1077
1083
  async enabledOAuthProviders() {
1078
1084
  const resp = await client.enabledOAuthProviders(
1079
1085
  create(EnabledOAuthProvidersRequestSchema, {})
@@ -1283,7 +1289,8 @@ import {
1283
1289
  DeleteModelRequestSchema,
1284
1290
  DuplicateModelRequestSchema,
1285
1291
  ListModelVersionsRequestSchema,
1286
- RestoreModelVersionRequestSchema
1292
+ RestoreModelVersionRequestSchema,
1293
+ PublishModelRequestSchema
1287
1294
  } from "@eide/foir-proto-ts/models/v1/models_pb";
1288
1295
  function jsFieldToProto(f) {
1289
1296
  return create3(ProtoFieldSchema, {
@@ -1412,6 +1419,12 @@ function createModelsMethods(client) {
1412
1419
  create3(RestoreModelVersionRequestSchema, { modelId, versionId })
1413
1420
  );
1414
1421
  return resp.model ?? null;
1422
+ },
1423
+ async publishModel(id) {
1424
+ const resp = await client.publishModel(
1425
+ create3(PublishModelRequestSchema, { id })
1426
+ );
1427
+ return resp.model ?? null;
1415
1428
  }
1416
1429
  };
1417
1430
  }
@@ -1934,8 +1947,7 @@ function createConfigsMethods(client) {
1934
1947
  }
1935
1948
 
1936
1949
  // src/lib/rpc/segments.ts
1937
- import { create as create6, fromJson as fromJson2 } from "@bufbuild/protobuf";
1938
- import { ValueSchema as ValueSchema2 } from "@bufbuild/protobuf/wkt";
1950
+ import { create as create6 } from "@bufbuild/protobuf";
1939
1951
  import {
1940
1952
  RuleExpressionSchema,
1941
1953
  RuleOperandSchema
@@ -1958,7 +1970,7 @@ function rawOperandToProto(raw) {
1958
1970
  return create6(RuleOperandSchema, {
1959
1971
  type: raw.type,
1960
1972
  path: raw.path,
1961
- value: raw.value !== void 0 ? fromJson2(ValueSchema2, raw.value) : void 0,
1973
+ value: raw.value !== void 0 ? JSON.stringify(raw.value ?? null) : void 0,
1962
1974
  valueType: raw.valueType,
1963
1975
  label: raw.label
1964
1976
  });
@@ -1972,7 +1984,7 @@ function rawRulesToProto(raw) {
1972
1984
  right: raw.right ? rawOperandToProto(raw.right) : void 0,
1973
1985
  conditions: Array.isArray(raw.conditions) ? raw.conditions.map((c) => rawRulesToProto(c)) : [],
1974
1986
  logicalOperator: raw.logicalOperator,
1975
- value: raw.value !== void 0 ? fromJson2(ValueSchema2, raw.value) : void 0
1987
+ value: raw.value !== void 0 ? JSON.stringify(raw.value ?? null) : void 0
1976
1988
  });
1977
1989
  }
1978
1990
  function createSegmentsMethods(client) {
@@ -2081,243 +2093,8 @@ function createSegmentsMethods(client) {
2081
2093
  };
2082
2094
  }
2083
2095
 
2084
- // src/lib/rpc/experiments.ts
2085
- import { create as create7 } from "@bufbuild/protobuf";
2086
- import { timestampFromDate } from "@bufbuild/protobuf/wkt";
2087
- import {
2088
- ExperimentStatus,
2089
- CreateExperimentRequestSchema,
2090
- GetExperimentRequestSchema,
2091
- GetExperimentByKeyRequestSchema,
2092
- ListExperimentsRequestSchema,
2093
- UpdateExperimentRequestSchema,
2094
- DeleteExperimentRequestSchema,
2095
- StartExperimentRequestSchema,
2096
- PauseExperimentRequestSchema,
2097
- ResumeExperimentRequestSchema,
2098
- EndExperimentRequestSchema,
2099
- GetExperimentStatsRequestSchema,
2100
- ExperimentMetricSpecSchema,
2101
- ForceAssignExperimentRequestSchema,
2102
- RemoveExperimentAssignmentRequestSchema,
2103
- ApplyExperimentWinnerRequestSchema,
2104
- GetAssignmentsRequestSchema,
2105
- ListExperimentDeclarationsRequestSchema,
2106
- ExperimentVariantSchema,
2107
- ExperimentGoalSchema,
2108
- ExperimentFunnelStepSchema
2109
- } from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
2110
- import { MetricAggregator as MetricAggregator2 } from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
2111
- import { ExperimentStatus as ExperimentStatus2 } from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
2112
- var STATUS_TO_PROTO = {
2113
- draft: ExperimentStatus.DRAFT,
2114
- running: ExperimentStatus.RUNNING,
2115
- paused: ExperimentStatus.PAUSED,
2116
- ended: ExperimentStatus.COMPLETED,
2117
- completed: ExperimentStatus.COMPLETED
2118
- };
2119
- function createExperimentsMethods(client) {
2120
- return {
2121
- // ── Queries ──────────────────────────────────────────────
2122
- async getExperiment(id) {
2123
- const resp = await client.getExperiment(
2124
- create7(GetExperimentRequestSchema, { id })
2125
- );
2126
- return resp.experiment ?? null;
2127
- },
2128
- async getExperimentByKey(key) {
2129
- const resp = await client.getExperimentByKey(
2130
- create7(GetExperimentByKeyRequestSchema, { key })
2131
- );
2132
- return resp.experiment ?? null;
2133
- },
2134
- async listExperiments(params = {}) {
2135
- return client.listExperiments(
2136
- create7(ListExperimentsRequestSchema, {
2137
- status: params.status ? STATUS_TO_PROTO[params.status] : void 0,
2138
- isActive: params.isActive,
2139
- limit: params.limit ?? 50,
2140
- offset: params.offset ?? 0
2141
- })
2142
- );
2143
- },
2144
- async getExperimentStats(experimentId, params = {}) {
2145
- const resp = await client.getExperimentStats(
2146
- create7(GetExperimentStatsRequestSchema, {
2147
- experimentId,
2148
- from: params.from ? timestampFromDate(params.from) : void 0,
2149
- to: params.to ? timestampFromDate(params.to) : void 0,
2150
- metrics: params.metrics?.map(
2151
- (m) => create7(ExperimentMetricSpecSchema, {
2152
- name: m.name,
2153
- path: m.path,
2154
- aggregator: m.aggregator,
2155
- goalKey: m.goalKey
2156
- })
2157
- ) ?? [],
2158
- minSampleSize: params.minSampleSize
2159
- })
2160
- );
2161
- return resp.stats ?? null;
2162
- },
2163
- // ── Mutations ────────────────────────────────────────────
2164
- async createExperiment(params) {
2165
- const resp = await client.createExperiment(
2166
- create7(CreateExperimentRequestSchema, {
2167
- key: params.key,
2168
- name: params.name,
2169
- description: params.description,
2170
- targeting: params.targeting,
2171
- controlPercent: params.controlPercent,
2172
- variants: params.variants?.map(
2173
- (v) => create7(ExperimentVariantSchema, {
2174
- key: v.key,
2175
- name: v.name,
2176
- percent: v.percent
2177
- })
2178
- ) ?? [],
2179
- assignmentPersistence: params.assignmentPersistence,
2180
- goals: params.goals?.map(
2181
- (g) => create7(ExperimentGoalSchema, {
2182
- key: g.key,
2183
- name: g.name,
2184
- description: g.description,
2185
- isPrimary: g.isPrimary ?? false
2186
- })
2187
- ) ?? [],
2188
- funnelSteps: params.funnelSteps?.map(
2189
- (s) => create7(ExperimentFunnelStepSchema, {
2190
- goalKey: s.goalKey,
2191
- name: s.name,
2192
- description: s.description
2193
- })
2194
- ) ?? [],
2195
- exclusionGroupKey: params.exclusionGroupKey
2196
- })
2197
- );
2198
- return resp.experiment ?? null;
2199
- },
2200
- async updateExperiment(params) {
2201
- const resp = await client.updateExperiment(
2202
- create7(UpdateExperimentRequestSchema, {
2203
- id: params.id,
2204
- name: params.name,
2205
- description: params.description,
2206
- targeting: params.targeting,
2207
- controlPercent: params.controlPercent,
2208
- variants: params.variants?.map(
2209
- (v) => create7(ExperimentVariantSchema, {
2210
- key: v.key,
2211
- name: v.name,
2212
- percent: v.percent
2213
- })
2214
- ),
2215
- assignmentPersistence: params.assignmentPersistence,
2216
- goals: params.goals?.map(
2217
- (g) => create7(ExperimentGoalSchema, {
2218
- key: g.key,
2219
- name: g.name,
2220
- description: g.description,
2221
- isPrimary: g.isPrimary ?? false
2222
- })
2223
- ) ?? [],
2224
- goalsClear: params.goalsClear ?? false,
2225
- funnelSteps: params.funnelSteps?.map(
2226
- (s) => create7(ExperimentFunnelStepSchema, {
2227
- goalKey: s.goalKey,
2228
- name: s.name,
2229
- description: s.description
2230
- })
2231
- ) ?? [],
2232
- funnelStepsClear: params.funnelStepsClear ?? false,
2233
- exclusionGroupKey: params.exclusionGroupKey,
2234
- exclusionGroupKeyClear: params.exclusionGroupKeyClear ?? false
2235
- })
2236
- );
2237
- return resp.experiment ?? null;
2238
- },
2239
- async deleteExperiment(id) {
2240
- const resp = await client.deleteExperiment(
2241
- create7(DeleteExperimentRequestSchema, { id })
2242
- );
2243
- return resp.success;
2244
- },
2245
- // ── Lifecycle ────────────────────────────────────────────
2246
- async startExperiment(experimentId) {
2247
- const resp = await client.startExperiment(
2248
- create7(StartExperimentRequestSchema, { experimentId })
2249
- );
2250
- return resp.experiment ?? null;
2251
- },
2252
- async pauseExperiment(experimentId) {
2253
- const resp = await client.pauseExperiment(
2254
- create7(PauseExperimentRequestSchema, { experimentId })
2255
- );
2256
- return resp.experiment ?? null;
2257
- },
2258
- async resumeExperiment(experimentId) {
2259
- const resp = await client.resumeExperiment(
2260
- create7(ResumeExperimentRequestSchema, { experimentId })
2261
- );
2262
- return resp.experiment ?? null;
2263
- },
2264
- async endExperiment(experimentId) {
2265
- const resp = await client.endExperiment(
2266
- create7(EndExperimentRequestSchema, { experimentId })
2267
- );
2268
- return resp.experiment ?? null;
2269
- },
2270
- async applyExperimentWinner(experimentId, winnerVariantKey) {
2271
- const resp = await client.applyExperimentWinner(
2272
- create7(ApplyExperimentWinnerRequestSchema, {
2273
- experimentId,
2274
- winnerVariantKey
2275
- })
2276
- );
2277
- return resp.experiment ?? null;
2278
- },
2279
- // ── Assignments ──────────────────────────────────────────
2280
- async forceAssignExperiment(identity, experimentId, variantKey) {
2281
- const resp = await client.forceAssignExperiment(
2282
- create7(ForceAssignExperimentRequestSchema, {
2283
- customerId: identity.customerId,
2284
- viewerKey: identity.viewerKey,
2285
- experimentId,
2286
- variantKey
2287
- })
2288
- );
2289
- return resp.assignment ?? null;
2290
- },
2291
- async removeExperimentAssignment(identity, experimentId) {
2292
- const resp = await client.removeExperimentAssignment(
2293
- create7(RemoveExperimentAssignmentRequestSchema, {
2294
- customerId: identity.customerId,
2295
- viewerKey: identity.viewerKey,
2296
- experimentId
2297
- })
2298
- );
2299
- return resp.success;
2300
- },
2301
- async getAssignments(identity) {
2302
- const resp = await client.getAssignments(
2303
- create7(GetAssignmentsRequestSchema, {
2304
- customerId: identity.customerId,
2305
- viewerKey: identity.viewerKey
2306
- })
2307
- );
2308
- return resp.assignments ?? [];
2309
- },
2310
- async listExperimentDeclarations() {
2311
- const resp = await client.listExperimentDeclarations(
2312
- create7(ListExperimentDeclarationsRequestSchema, {})
2313
- );
2314
- return resp.declarations ?? [];
2315
- }
2316
- };
2317
- }
2318
-
2319
2096
  // src/lib/rpc/settings.ts
2320
- import { create as create8 } from "@bufbuild/protobuf";
2097
+ import { create as create7 } from "@bufbuild/protobuf";
2321
2098
  import {
2322
2099
  GetSettingsRequestSchema,
2323
2100
  UpdateSettingRequestSchema,
@@ -2331,6 +2108,7 @@ import {
2331
2108
  GetCustomerProfileRequestSchema,
2332
2109
  SetCustomerProfileRequestSchema,
2333
2110
  UpdateCustomerProfileSchemaRequestSchema,
2111
+ PublishProfileSchemaRequestSchema,
2334
2112
  GetCustomerResolutionAttributesRequestSchema,
2335
2113
  GetEditorConfigsRequestSchema,
2336
2114
  ListVariantCatalogRequestSchema,
@@ -2365,7 +2143,7 @@ function createSettingsMethods(client) {
2365
2143
  // ── Settings ─────────────────────────────────────────────
2366
2144
  async getSettings(params = {}) {
2367
2145
  const resp = await client.getSettings(
2368
- create8(GetSettingsRequestSchema, {
2146
+ create7(GetSettingsRequestSchema, {
2369
2147
  category: params.category,
2370
2148
  key: params.key
2371
2149
  })
@@ -2374,7 +2152,7 @@ function createSettingsMethods(client) {
2374
2152
  },
2375
2153
  async updateSetting(params) {
2376
2154
  const resp = await client.updateSetting(
2377
- create8(UpdateSettingRequestSchema, {
2155
+ create7(UpdateSettingRequestSchema, {
2378
2156
  key: params.key,
2379
2157
  value: params.value
2380
2158
  })
@@ -2383,14 +2161,14 @@ function createSettingsMethods(client) {
2383
2161
  },
2384
2162
  async deleteSetting(key) {
2385
2163
  const resp = await client.deleteSetting(
2386
- create8(DeleteSettingRequestSchema, { key })
2164
+ create7(DeleteSettingRequestSchema, { key })
2387
2165
  );
2388
2166
  return resp.success;
2389
2167
  },
2390
2168
  // ── Mentions ─────────────────────────────────────────────
2391
2169
  async listMyMentions(params = {}) {
2392
2170
  return client.listMyMentions(
2393
- create8(ListMyMentionsRequestSchema, {
2171
+ create7(ListMyMentionsRequestSchema, {
2394
2172
  status: params.status ?? [],
2395
2173
  entityType: params.entityType,
2396
2174
  limit: params.limit ?? 50,
@@ -2400,7 +2178,7 @@ function createSettingsMethods(client) {
2400
2178
  },
2401
2179
  async updateMentionStatus(params) {
2402
2180
  const resp = await client.updateMentionStatus(
2403
- create8(UpdateMentionStatusRequestSchema, {
2181
+ create7(UpdateMentionStatusRequestSchema, {
2404
2182
  mentionId: params.mentionId,
2405
2183
  status: params.status,
2406
2184
  completedNote: params.completedNote,
@@ -2412,7 +2190,7 @@ function createSettingsMethods(client) {
2412
2190
  // ── Notes ────────────────────────────────────────────────
2413
2191
  async createNote(params) {
2414
2192
  const resp = await client.createNote(
2415
- create8(CreateNoteRequestSchema, {
2193
+ create7(CreateNoteRequestSchema, {
2416
2194
  ...params,
2417
2195
  content: params.content
2418
2196
  })
@@ -2420,12 +2198,12 @@ function createSettingsMethods(client) {
2420
2198
  return resp.note ?? null;
2421
2199
  },
2422
2200
  async getNote(id) {
2423
- const resp = await client.getNote(create8(GetNoteRequestSchema, { id }));
2201
+ const resp = await client.getNote(create7(GetNoteRequestSchema, { id }));
2424
2202
  return resp.note ?? null;
2425
2203
  },
2426
2204
  async listNotes(params) {
2427
2205
  return client.listNotes(
2428
- create8(ListNotesRequestSchema, {
2206
+ create7(ListNotesRequestSchema, {
2429
2207
  entityType: params.entityType,
2430
2208
  entityId: params.entityId,
2431
2209
  limit: params.limit ?? 50,
@@ -2435,7 +2213,7 @@ function createSettingsMethods(client) {
2435
2213
  },
2436
2214
  async updateNote(params) {
2437
2215
  const resp = await client.updateNote(
2438
- create8(UpdateNoteRequestSchema, {
2216
+ create7(UpdateNoteRequestSchema, {
2439
2217
  id: params.id,
2440
2218
  content: params.content,
2441
2219
  isResolved: params.isResolved
@@ -2445,14 +2223,14 @@ function createSettingsMethods(client) {
2445
2223
  },
2446
2224
  async deleteNote(id) {
2447
2225
  const resp = await client.deleteNote(
2448
- create8(DeleteNoteRequestSchema, { id })
2226
+ create7(DeleteNoteRequestSchema, { id })
2449
2227
  );
2450
2228
  return resp.success;
2451
2229
  },
2452
2230
  // ── Context Dimensions ───────────────────────────────────
2453
2231
  async listContextDimensions(params = {}) {
2454
2232
  return client.listContextDimensions(
2455
- create8(ListContextDimensionsRequestSchema, {
2233
+ create7(ListContextDimensionsRequestSchema, {
2456
2234
  search: params.search,
2457
2235
  limit: params.limit ?? 50,
2458
2236
  offset: params.offset ?? 0
@@ -2461,31 +2239,31 @@ function createSettingsMethods(client) {
2461
2239
  },
2462
2240
  async getContextDimension(id) {
2463
2241
  const resp = await client.getContextDimension(
2464
- create8(GetContextDimensionRequestSchema, { id })
2242
+ create7(GetContextDimensionRequestSchema, { id })
2465
2243
  );
2466
2244
  return resp.dimension ?? null;
2467
2245
  },
2468
2246
  async createContextDimension(params) {
2469
2247
  const resp = await client.createContextDimension(
2470
- create8(CreateContextDimensionRequestSchema, params)
2248
+ create7(CreateContextDimensionRequestSchema, params)
2471
2249
  );
2472
2250
  return resp.dimension ?? null;
2473
2251
  },
2474
2252
  async updateContextDimension(params) {
2475
2253
  const resp = await client.updateContextDimension(
2476
- create8(UpdateContextDimensionRequestSchema, params)
2254
+ create7(UpdateContextDimensionRequestSchema, params)
2477
2255
  );
2478
2256
  return resp.dimension ?? null;
2479
2257
  },
2480
2258
  async deleteContextDimension(id) {
2481
2259
  const resp = await client.deleteContextDimension(
2482
- create8(DeleteContextDimensionRequestSchema, { id })
2260
+ create7(DeleteContextDimensionRequestSchema, { id })
2483
2261
  );
2484
2262
  return resp.success;
2485
2263
  },
2486
2264
  async getContextDimensionValues(dimensionKey, params = {}) {
2487
2265
  return client.getContextDimensionValues(
2488
- create8(GetContextDimensionValuesRequestSchema, {
2266
+ create7(GetContextDimensionValuesRequestSchema, {
2489
2267
  dimensionKey,
2490
2268
  search: params.search,
2491
2269
  limit: params.limit ?? 50,
@@ -2496,19 +2274,19 @@ function createSettingsMethods(client) {
2496
2274
  // ── Customer Profile Schema ──────────────────────────────
2497
2275
  async getCustomerProfileSchema() {
2498
2276
  const resp = await client.getCustomerProfileSchema(
2499
- create8(GetCustomerProfileSchemaRequestSchema, {})
2277
+ create7(GetCustomerProfileSchemaRequestSchema, {})
2500
2278
  );
2501
2279
  return resp.schema ?? null;
2502
2280
  },
2503
2281
  async getCustomerProfile(customerId) {
2504
2282
  const resp = await client.getCustomerProfile(
2505
- create8(GetCustomerProfileRequestSchema, { customerId })
2283
+ create7(GetCustomerProfileRequestSchema, { customerId })
2506
2284
  );
2507
2285
  return resp.data ?? null;
2508
2286
  },
2509
2287
  async setCustomerProfile(params) {
2510
2288
  const resp = await client.setCustomerProfile(
2511
- create8(SetCustomerProfileRequestSchema, {
2289
+ create7(SetCustomerProfileRequestSchema, {
2512
2290
  customerId: params.customerId,
2513
2291
  data: params.data
2514
2292
  })
@@ -2517,7 +2295,7 @@ function createSettingsMethods(client) {
2517
2295
  },
2518
2296
  async updateCustomerProfileSchema(params) {
2519
2297
  const resp = await client.updateCustomerProfileSchema(
2520
- create8(UpdateCustomerProfileSchemaRequestSchema, {
2298
+ create7(UpdateCustomerProfileSchemaRequestSchema, {
2521
2299
  fields: params.fields.map((f) => ({
2522
2300
  id: f.id,
2523
2301
  key: f.key,
@@ -2533,21 +2311,27 @@ function createSettingsMethods(client) {
2533
2311
  );
2534
2312
  return resp.schema ?? null;
2535
2313
  },
2314
+ async publishProfileSchema() {
2315
+ const resp = await client.publishProfileSchema(
2316
+ create7(PublishProfileSchemaRequestSchema, {})
2317
+ );
2318
+ return resp.profileSchema ?? null;
2319
+ },
2536
2320
  async getCustomerResolutionAttributes(customerId) {
2537
2321
  return client.getCustomerResolutionAttributes(
2538
- create8(GetCustomerResolutionAttributesRequestSchema, { customerId })
2322
+ create7(GetCustomerResolutionAttributesRequestSchema, { customerId })
2539
2323
  );
2540
2324
  },
2541
2325
  async getEditorConfigs(modelKey) {
2542
2326
  const resp = await client.getEditorConfigs(
2543
- create8(GetEditorConfigsRequestSchema, { modelKey })
2327
+ create7(GetEditorConfigsRequestSchema, { modelKey })
2544
2328
  );
2545
2329
  return resp.placements ?? [];
2546
2330
  },
2547
2331
  // ── Variant Catalog ──────────────────────────────────────
2548
2332
  async listVariantCatalog(params = {}) {
2549
2333
  return client.listVariantCatalog(
2550
- create8(ListVariantCatalogRequestSchema, {
2334
+ create7(ListVariantCatalogRequestSchema, {
2551
2335
  isActive: params.isActive,
2552
2336
  limit: params.limit ?? 50,
2553
2337
  offset: params.offset ?? 0
@@ -2556,13 +2340,13 @@ function createSettingsMethods(client) {
2556
2340
  },
2557
2341
  async getVariantCatalogEntry(id) {
2558
2342
  const resp = await client.getVariantCatalogEntry(
2559
- create8(GetVariantCatalogEntryRequestSchema, { id })
2343
+ create7(GetVariantCatalogEntryRequestSchema, { id })
2560
2344
  );
2561
2345
  return resp.entry ?? null;
2562
2346
  },
2563
2347
  async createVariantCatalogEntry(params) {
2564
2348
  const resp = await client.createVariantCatalogEntry(
2565
- create8(CreateVariantCatalogEntryRequestSchema, {
2349
+ create7(CreateVariantCatalogEntryRequestSchema, {
2566
2350
  key: params.key,
2567
2351
  name: params.name,
2568
2352
  description: params.description,
@@ -2576,7 +2360,7 @@ function createSettingsMethods(client) {
2576
2360
  },
2577
2361
  async updateVariantCatalogEntry(params) {
2578
2362
  const resp = await client.updateVariantCatalogEntry(
2579
- create8(UpdateVariantCatalogEntryRequestSchema, {
2363
+ create7(UpdateVariantCatalogEntryRequestSchema, {
2580
2364
  id: params.id,
2581
2365
  name: params.name,
2582
2366
  description: params.description,
@@ -2590,14 +2374,14 @@ function createSettingsMethods(client) {
2590
2374
  },
2591
2375
  async deleteVariantCatalogEntry(id) {
2592
2376
  const resp = await client.deleteVariantCatalogEntry(
2593
- create8(DeleteVariantCatalogEntryRequestSchema, { id })
2377
+ create7(DeleteVariantCatalogEntryRequestSchema, { id })
2594
2378
  );
2595
2379
  return resp.success;
2596
2380
  },
2597
2381
  // ── Locales ──────────────────────────────────────────────
2598
2382
  async listLocales(params = {}) {
2599
2383
  return client.listLocales(
2600
- create8(ListLocalesRequestSchema, {
2384
+ create7(ListLocalesRequestSchema, {
2601
2385
  includeInactive: params.includeInactive,
2602
2386
  limit: params.limit ?? 50,
2603
2387
  offset: params.offset ?? 0
@@ -2606,25 +2390,25 @@ function createSettingsMethods(client) {
2606
2390
  },
2607
2391
  async getLocale(id) {
2608
2392
  const resp = await client.getLocale(
2609
- create8(GetLocaleRequestSchema, { id })
2393
+ create7(GetLocaleRequestSchema, { id })
2610
2394
  );
2611
2395
  return resp.locale ?? null;
2612
2396
  },
2613
2397
  async getLocaleByCode(code) {
2614
2398
  const resp = await client.getLocaleByCode(
2615
- create8(GetLocaleByCodeRequestSchema, { code })
2399
+ create7(GetLocaleByCodeRequestSchema, { code })
2616
2400
  );
2617
2401
  return resp.locale ?? null;
2618
2402
  },
2619
2403
  async getDefaultLocale() {
2620
2404
  const resp = await client.getDefaultLocale(
2621
- create8(GetDefaultLocaleRequestSchema, {})
2405
+ create7(GetDefaultLocaleRequestSchema, {})
2622
2406
  );
2623
2407
  return resp.locale ?? null;
2624
2408
  },
2625
2409
  async createLocale(params) {
2626
2410
  const resp = await client.createLocale(
2627
- create8(CreateLocaleRequestSchema, {
2411
+ create7(CreateLocaleRequestSchema, {
2628
2412
  locale: params.locale,
2629
2413
  displayName: params.displayName,
2630
2414
  nativeName: params.nativeName,
@@ -2637,7 +2421,7 @@ function createSettingsMethods(client) {
2637
2421
  },
2638
2422
  async updateLocale(params) {
2639
2423
  const resp = await client.updateLocale(
2640
- create8(UpdateLocaleRequestSchema, {
2424
+ create7(UpdateLocaleRequestSchema, {
2641
2425
  id: params.id,
2642
2426
  displayName: params.displayName,
2643
2427
  nativeName: params.nativeName,
@@ -2651,20 +2435,20 @@ function createSettingsMethods(client) {
2651
2435
  },
2652
2436
  async deleteLocale(id) {
2653
2437
  const resp = await client.deleteLocale(
2654
- create8(DeleteLocaleRequestSchema, { id })
2438
+ create7(DeleteLocaleRequestSchema, { id })
2655
2439
  );
2656
2440
  return resp.success;
2657
2441
  },
2658
2442
  // ── Nav Preferences ─────────────────────────────────────
2659
2443
  async getNavPreferences() {
2660
2444
  const resp = await client.getNavPreferences(
2661
- create8(GetNavPreferencesRequestSchema, {})
2445
+ create7(GetNavPreferencesRequestSchema, {})
2662
2446
  );
2663
2447
  return resp.preferences ?? null;
2664
2448
  },
2665
2449
  async updateNavPreferences(params) {
2666
2450
  const resp = await client.updateNavPreferences(
2667
- create8(UpdateNavPreferencesRequestSchema, {
2451
+ create7(UpdateNavPreferencesRequestSchema, {
2668
2452
  preferences: params.preferences ? {
2669
2453
  favoriteProjects: params.preferences.favoriteProjects,
2670
2454
  favoriteNavItems: params.preferences.favoriteNavItems,
@@ -2681,7 +2465,7 @@ function createSettingsMethods(client) {
2681
2465
  // ── Recently Opened ─────────────────────────────────────
2682
2466
  async listRecentlyOpened(limit) {
2683
2467
  const resp = await client.listRecentlyOpened(
2684
- create8(ListRecentlyOpenedRequestSchema, {
2468
+ create7(ListRecentlyOpenedRequestSchema, {
2685
2469
  limit: limit ?? 20
2686
2470
  })
2687
2471
  );
@@ -2689,7 +2473,7 @@ function createSettingsMethods(client) {
2689
2473
  },
2690
2474
  async trackRecentlyOpened(params) {
2691
2475
  const resp = await client.trackRecentlyOpened(
2692
- create8(TrackRecentlyOpenedRequestSchema, {
2476
+ create7(TrackRecentlyOpenedRequestSchema, {
2693
2477
  type: params.type,
2694
2478
  id: params.id,
2695
2479
  label: params.label,
@@ -2700,7 +2484,7 @@ function createSettingsMethods(client) {
2700
2484
  },
2701
2485
  async removeRecentlyOpened(params) {
2702
2486
  const resp = await client.removeRecentlyOpened(
2703
- create8(RemoveRecentlyOpenedRequestSchema, {
2487
+ create7(RemoveRecentlyOpenedRequestSchema, {
2704
2488
  type: params.type,
2705
2489
  id: params.id
2706
2490
  })
@@ -2709,7 +2493,7 @@ function createSettingsMethods(client) {
2709
2493
  },
2710
2494
  async clearRecentlyOpened() {
2711
2495
  const resp = await client.clearRecentlyOpened(
2712
- create8(ClearRecentlyOpenedRequestSchema, {})
2496
+ create7(ClearRecentlyOpenedRequestSchema, {})
2713
2497
  );
2714
2498
  return resp.success;
2715
2499
  }
@@ -2717,7 +2501,7 @@ function createSettingsMethods(client) {
2717
2501
  }
2718
2502
 
2719
2503
  // src/lib/rpc/storage.ts
2720
- import { create as create9 } from "@bufbuild/protobuf";
2504
+ import { create as create8 } from "@bufbuild/protobuf";
2721
2505
  import {
2722
2506
  CreateFileUploadRequestSchema,
2723
2507
  ConfirmFileUploadRequestSchema,
@@ -2737,7 +2521,7 @@ function createStorageMethods(client) {
2737
2521
  return {
2738
2522
  async createFileUpload(params) {
2739
2523
  return client.createFileUpload(
2740
- create9(CreateFileUploadRequestSchema, {
2524
+ create8(CreateFileUploadRequestSchema, {
2741
2525
  filename: params.filename,
2742
2526
  mimeType: params.mimeType,
2743
2527
  size: BigInt(params.size),
@@ -2747,17 +2531,17 @@ function createStorageMethods(client) {
2747
2531
  },
2748
2532
  async confirmFileUpload(uploadId) {
2749
2533
  const resp = await client.confirmFileUpload(
2750
- create9(ConfirmFileUploadRequestSchema, { uploadId })
2534
+ create8(ConfirmFileUploadRequestSchema, { uploadId })
2751
2535
  );
2752
2536
  return resp.file ?? null;
2753
2537
  },
2754
2538
  async getFile(id) {
2755
- const resp = await client.getFile(create9(GetFileRequestSchema, { id }));
2539
+ const resp = await client.getFile(create8(GetFileRequestSchema, { id }));
2756
2540
  return resp.file ?? null;
2757
2541
  },
2758
2542
  async listFiles(params) {
2759
2543
  return client.listFiles(
2760
- create9(ListFilesRequestSchema, {
2544
+ create8(ListFilesRequestSchema, {
2761
2545
  folder: params.folder,
2762
2546
  mimeType: params.mimeType,
2763
2547
  search: params.search,
@@ -2769,13 +2553,13 @@ function createStorageMethods(client) {
2769
2553
  },
2770
2554
  async getStorageUsage() {
2771
2555
  const resp = await client.getStorageUsage(
2772
- create9(GetStorageUsageRequestSchema, {})
2556
+ create8(GetStorageUsageRequestSchema, {})
2773
2557
  );
2774
2558
  return resp.usage ?? null;
2775
2559
  },
2776
2560
  async updateFile(params) {
2777
2561
  const resp = await client.updateFile(
2778
- create9(UpdateFileRequestSchema, {
2562
+ create8(UpdateFileRequestSchema, {
2779
2563
  id: params.id,
2780
2564
  filename: params.filename,
2781
2565
  folder: params.folder,
@@ -2786,7 +2570,7 @@ function createStorageMethods(client) {
2786
2570
  },
2787
2571
  async updateFileMetadata(params) {
2788
2572
  const resp = await client.updateFileMetadata(
2789
- create9(UpdateFileMetadataRequestSchema, {
2573
+ create8(UpdateFileMetadataRequestSchema, {
2790
2574
  id: params.id,
2791
2575
  altText: params.altText,
2792
2576
  caption: params.caption,
@@ -2797,37 +2581,37 @@ function createStorageMethods(client) {
2797
2581
  },
2798
2582
  async deleteFile(id) {
2799
2583
  const resp = await client.deleteFile(
2800
- create9(DeleteFileRequestSchema, { id })
2584
+ create8(DeleteFileRequestSchema, { id })
2801
2585
  );
2802
2586
  return resp.success;
2803
2587
  },
2804
2588
  async permanentlyDeleteFile(id) {
2805
2589
  const resp = await client.permanentlyDeleteFile(
2806
- create9(PermanentlyDeleteFileRequestSchema, { id })
2590
+ create8(PermanentlyDeleteFileRequestSchema, { id })
2807
2591
  );
2808
2592
  return resp.success;
2809
2593
  },
2810
2594
  async restoreFile(id) {
2811
2595
  const resp = await client.restoreFile(
2812
- create9(RestoreFileRequestSchema, { id })
2596
+ create8(RestoreFileRequestSchema, { id })
2813
2597
  );
2814
2598
  return resp.file ?? null;
2815
2599
  },
2816
2600
  async trackFileUsage(fileId, entityType) {
2817
2601
  const resp = await client.trackFileUsage(
2818
- create9(TrackFileUsageRequestSchema, { fileId, entityType })
2602
+ create8(TrackFileUsageRequestSchema, { fileId, entityType })
2819
2603
  );
2820
2604
  return resp.file ?? null;
2821
2605
  },
2822
2606
  async removeFileUsage(fileId, entityType) {
2823
2607
  const resp = await client.removeFileUsage(
2824
- create9(RemoveFileUsageRequestSchema, { fileId, entityType })
2608
+ create8(RemoveFileUsageRequestSchema, { fileId, entityType })
2825
2609
  );
2826
2610
  return resp.success;
2827
2611
  },
2828
2612
  async cleanupOrphanedFiles(params) {
2829
2613
  return client.cleanupOrphanedFiles(
2830
- create9(CleanupOrphanedFilesRequestSchema, {
2614
+ create8(CleanupOrphanedFilesRequestSchema, {
2831
2615
  orphanThresholdDays: params?.orphanThresholdDays ?? 30,
2832
2616
  dryRun: params?.dryRun ?? false,
2833
2617
  limit: params?.limit ?? 100
@@ -2838,7 +2622,7 @@ function createStorageMethods(client) {
2838
2622
  }
2839
2623
 
2840
2624
  // src/lib/rpc/operations.ts
2841
- import { create as create10 } from "@bufbuild/protobuf";
2625
+ import { create as create9 } from "@bufbuild/protobuf";
2842
2626
  import {
2843
2627
  ListOperationsRequestSchema as ListOperationsRequestSchema2,
2844
2628
  GetOperationRequestSchema,
@@ -2849,14 +2633,15 @@ import {
2849
2633
  ExecuteOperationRequestSchema,
2850
2634
  ListDeadLetterEntriesRequestSchema,
2851
2635
  RetryDeadLetterEntryRequestSchema,
2852
- DismissDeadLetterEntryRequestSchema
2636
+ DismissDeadLetterEntryRequestSchema,
2637
+ PublishOperationRequestSchema
2853
2638
  } from "@eide/foir-proto-ts/operations/v1/operations_pb";
2854
2639
  function createOperationsMethods(client) {
2855
2640
  return {
2856
2641
  // ── CRUD ──────────────────────────────────────────────────
2857
2642
  async listOperations(params = {}) {
2858
2643
  return client.listOperations(
2859
- create10(ListOperationsRequestSchema2, {
2644
+ create9(ListOperationsRequestSchema2, {
2860
2645
  configId: params.configId,
2861
2646
  category: params.category,
2862
2647
  isActive: params.isActive,
@@ -2868,7 +2653,7 @@ function createOperationsMethods(client) {
2868
2653
  },
2869
2654
  async getOperation(params) {
2870
2655
  const resp = await client.getOperation(
2871
- create10(GetOperationRequestSchema, {
2656
+ create9(GetOperationRequestSchema, {
2872
2657
  id: params.id ?? "",
2873
2658
  key: params.key
2874
2659
  })
@@ -2877,7 +2662,7 @@ function createOperationsMethods(client) {
2877
2662
  },
2878
2663
  async createOperation(params) {
2879
2664
  const resp = await client.createOperation(
2880
- create10(CreateOperationRequestSchema, {
2665
+ create9(CreateOperationRequestSchema, {
2881
2666
  key: params.key,
2882
2667
  name: params.name,
2883
2668
  endpoint: params.endpoint,
@@ -2901,7 +2686,7 @@ function createOperationsMethods(client) {
2901
2686
  },
2902
2687
  async updateOperation(params) {
2903
2688
  const resp = await client.updateOperation(
2904
- create10(UpdateOperationRequestSchema, {
2689
+ create9(UpdateOperationRequestSchema, {
2905
2690
  id: params.id,
2906
2691
  name: params.name,
2907
2692
  description: params.description,
@@ -2922,20 +2707,20 @@ function createOperationsMethods(client) {
2922
2707
  },
2923
2708
  async deleteOperation(id) {
2924
2709
  const resp = await client.deleteOperation(
2925
- create10(DeleteOperationRequestSchema, { id })
2710
+ create9(DeleteOperationRequestSchema, { id })
2926
2711
  );
2927
2712
  return resp.success;
2928
2713
  },
2929
2714
  async getSigningSecret() {
2930
2715
  const resp = await client.getSigningSecret(
2931
- create10(GetSigningSecretRequestSchema, {})
2716
+ create9(GetSigningSecretRequestSchema, {})
2932
2717
  );
2933
2718
  return { secret: resp.secret, prefix: resp.prefix };
2934
2719
  },
2935
2720
  // ── Execution ─────────────────────────────────────────────
2936
2721
  async executeOperation(params) {
2937
2722
  return client.executeOperation(
2938
- create10(ExecuteOperationRequestSchema, {
2723
+ create9(ExecuteOperationRequestSchema, {
2939
2724
  operationKey: params.operationKey,
2940
2725
  input: params.input,
2941
2726
  triggerType: params.triggerType,
@@ -2946,7 +2731,7 @@ function createOperationsMethods(client) {
2946
2731
  // ── Dead Letter Queue ─────────────────────────────────────
2947
2732
  async listDeadLetterEntries(params = {}) {
2948
2733
  return client.listDeadLetterEntries(
2949
- create10(ListDeadLetterEntriesRequestSchema, {
2734
+ create9(ListDeadLetterEntriesRequestSchema, {
2950
2735
  operationKey: params.operationKey,
2951
2736
  limit: params.limit ?? 50,
2952
2737
  offset: params.offset ?? 0
@@ -2955,21 +2740,27 @@ function createOperationsMethods(client) {
2955
2740
  },
2956
2741
  async retryDeadLetterEntry(id) {
2957
2742
  const resp = await client.retryDeadLetterEntry(
2958
- create10(RetryDeadLetterEntryRequestSchema, { id })
2743
+ create9(RetryDeadLetterEntryRequestSchema, { id })
2959
2744
  );
2960
2745
  return resp.success;
2961
2746
  },
2962
2747
  async dismissDeadLetterEntry(id) {
2963
2748
  const resp = await client.dismissDeadLetterEntry(
2964
- create10(DismissDeadLetterEntryRequestSchema, { id })
2749
+ create9(DismissDeadLetterEntryRequestSchema, { id })
2965
2750
  );
2966
2751
  return resp.success;
2752
+ },
2753
+ async publishOperation(id) {
2754
+ const resp = await client.publishOperation(
2755
+ create9(PublishOperationRequestSchema, { id })
2756
+ );
2757
+ return resp.operation ?? null;
2967
2758
  }
2968
2759
  };
2969
2760
  }
2970
2761
 
2971
2762
  // src/lib/rpc/hooks.ts
2972
- import { create as create11 } from "@bufbuild/protobuf";
2763
+ import { create as create10 } from "@bufbuild/protobuf";
2973
2764
  import {
2974
2765
  ListHooksRequestSchema,
2975
2766
  GetHookRequestSchema,
@@ -2986,7 +2777,7 @@ function createHooksMethods(client) {
2986
2777
  // ── Queries ──────────────────────────────────────────────
2987
2778
  async listHooks(params = {}) {
2988
2779
  return client.listHooks(
2989
- create11(ListHooksRequestSchema, {
2780
+ create10(ListHooksRequestSchema, {
2990
2781
  event: params.event,
2991
2782
  isActive: params.isActive,
2992
2783
  configId: params.configId,
@@ -2996,13 +2787,13 @@ function createHooksMethods(client) {
2996
2787
  );
2997
2788
  },
2998
2789
  async getHook(id) {
2999
- const resp = await client.getHook(create11(GetHookRequestSchema, { id }));
2790
+ const resp = await client.getHook(create10(GetHookRequestSchema, { id }));
3000
2791
  return resp.hook ?? null;
3001
2792
  },
3002
2793
  // ── Mutations ────────────────────────────────────────────
3003
2794
  async createHook(params) {
3004
2795
  const resp = await client.createHook(
3005
- create11(CreateHookRequestSchema, {
2796
+ create10(CreateHookRequestSchema, {
3006
2797
  key: params.key,
3007
2798
  name: params.name,
3008
2799
  event: params.event,
@@ -3018,7 +2809,7 @@ function createHooksMethods(client) {
3018
2809
  },
3019
2810
  async updateHook(params) {
3020
2811
  const resp = await client.updateHook(
3021
- create11(UpdateHookRequestSchema, {
2812
+ create10(UpdateHookRequestSchema, {
3022
2813
  id: params.id,
3023
2814
  name: params.name,
3024
2815
  description: params.description,
@@ -3032,21 +2823,21 @@ function createHooksMethods(client) {
3032
2823
  },
3033
2824
  async deleteHook(id) {
3034
2825
  const resp = await client.deleteHook(
3035
- create11(DeleteHookRequestSchema, { id })
2826
+ create10(DeleteHookRequestSchema, { id })
3036
2827
  );
3037
2828
  return resp.success;
3038
2829
  },
3039
2830
  // ── Get by Key ──────────────────────────────────────────
3040
2831
  async getHookByKey(key) {
3041
2832
  const resp = await client.getHookByKey(
3042
- create11(GetHookByKeyRequestSchema, { key })
2833
+ create10(GetHookByKeyRequestSchema, { key })
3043
2834
  );
3044
2835
  return resp.hook ?? null;
3045
2836
  },
3046
2837
  // ── Deliveries ──────────────────────────────────────────
3047
2838
  async listHookDeliveries(params) {
3048
2839
  return client.listHookDeliveries(
3049
- create11(ListHookDeliveriesRequestSchema, {
2840
+ create10(ListHookDeliveriesRequestSchema, {
3050
2841
  hookId: params.hookId,
3051
2842
  status: params.status,
3052
2843
  limit: params.limit ?? 50,
@@ -3056,14 +2847,14 @@ function createHooksMethods(client) {
3056
2847
  },
3057
2848
  async retryHookDelivery(deliveryId) {
3058
2849
  const resp = await client.retryHookDelivery(
3059
- create11(RetryHookDeliveryRequestSchema, { deliveryId })
2850
+ create10(RetryHookDeliveryRequestSchema, { deliveryId })
3060
2851
  );
3061
2852
  return resp.success;
3062
2853
  },
3063
2854
  // ── Testing ─────────────────────────────────────────────
3064
2855
  async testHook(params) {
3065
2856
  const resp = await client.testHook(
3066
- create11(TestHookRequestSchema, {
2857
+ create10(TestHookRequestSchema, {
3067
2858
  hookId: params.hookId,
3068
2859
  testPayload: params.testPayload
3069
2860
  })
@@ -3077,7 +2868,7 @@ function createHooksMethods(client) {
3077
2868
  }
3078
2869
 
3079
2870
  // src/lib/rpc/notifications.ts
3080
- import { create as create12 } from "@bufbuild/protobuf";
2871
+ import { create as create11 } from "@bufbuild/protobuf";
3081
2872
  import {
3082
2873
  ListNotificationsRequestSchema,
3083
2874
  MarkNotificationReadRequestSchema,
@@ -3087,7 +2878,7 @@ function createNotificationsMethods(client) {
3087
2878
  return {
3088
2879
  async listNotifications(params = {}) {
3089
2880
  return client.listNotifications(
3090
- create12(ListNotificationsRequestSchema, {
2881
+ create11(ListNotificationsRequestSchema, {
3091
2882
  isRead: params.unreadOnly ? false : void 0,
3092
2883
  limit: params.limit ?? 20,
3093
2884
  offset: params.offset ?? 0
@@ -3096,13 +2887,13 @@ function createNotificationsMethods(client) {
3096
2887
  },
3097
2888
  async markNotificationRead(id) {
3098
2889
  const resp = await client.markNotificationRead(
3099
- create12(MarkNotificationReadRequestSchema, { id })
2890
+ create11(MarkNotificationReadRequestSchema, { id })
3100
2891
  );
3101
2892
  return resp.success;
3102
2893
  },
3103
2894
  async markAllNotificationsRead() {
3104
2895
  const resp = await client.markAllNotificationsRead(
3105
- create12(MarkAllNotificationsReadRequestSchema, {})
2896
+ create11(MarkAllNotificationsReadRequestSchema, {})
3106
2897
  );
3107
2898
  return resp.count;
3108
2899
  }
@@ -3110,7 +2901,7 @@ function createNotificationsMethods(client) {
3110
2901
  }
3111
2902
 
3112
2903
  // src/lib/rpc/cron-schedules.ts
3113
- import { create as create13 } from "@bufbuild/protobuf";
2904
+ import { create as create12 } from "@bufbuild/protobuf";
3114
2905
  import {
3115
2906
  ListCronSchedulesRequestSchema,
3116
2907
  GetCronScheduleRequestSchema,
@@ -3127,7 +2918,7 @@ function createCronSchedulesMethods(client) {
3127
2918
  // ── Queries ──────────────────────────────────────────────
3128
2919
  async listCronSchedules(params = {}) {
3129
2920
  return client.listCronSchedules(
3130
- create13(ListCronSchedulesRequestSchema, {
2921
+ create12(ListCronSchedulesRequestSchema, {
3131
2922
  configId: params.configId,
3132
2923
  isActive: params.isActive,
3133
2924
  limit: params.limit ?? 50,
@@ -3137,20 +2928,20 @@ function createCronSchedulesMethods(client) {
3137
2928
  },
3138
2929
  async getCronSchedule(id) {
3139
2930
  const resp = await client.getCronSchedule(
3140
- create13(GetCronScheduleRequestSchema, { id })
2931
+ create12(GetCronScheduleRequestSchema, { id })
3141
2932
  );
3142
2933
  return resp.schedule ?? null;
3143
2934
  },
3144
2935
  async getCronScheduleByKey(key) {
3145
2936
  const resp = await client.getCronScheduleByKey(
3146
- create13(GetCronScheduleByKeyRequestSchema, { key })
2937
+ create12(GetCronScheduleByKeyRequestSchema, { key })
3147
2938
  );
3148
2939
  return resp.schedule ?? null;
3149
2940
  },
3150
2941
  // ── Mutations ────────────────────────────────────────────
3151
2942
  async createCronSchedule(params) {
3152
2943
  const resp = await client.createCronSchedule(
3153
- create13(CreateCronScheduleRequestSchema, {
2944
+ create12(CreateCronScheduleRequestSchema, {
3154
2945
  key: params.key,
3155
2946
  name: params.name,
3156
2947
  description: params.description,
@@ -3164,7 +2955,7 @@ function createCronSchedulesMethods(client) {
3164
2955
  },
3165
2956
  async updateCronSchedule(params) {
3166
2957
  const resp = await client.updateCronSchedule(
3167
- create13(UpdateCronScheduleRequestSchema, {
2958
+ create12(UpdateCronScheduleRequestSchema, {
3168
2959
  id: params.id,
3169
2960
  name: params.name,
3170
2961
  description: params.description,
@@ -3178,25 +2969,25 @@ function createCronSchedulesMethods(client) {
3178
2969
  },
3179
2970
  async deleteCronSchedule(id) {
3180
2971
  const resp = await client.deleteCronSchedule(
3181
- create13(DeleteCronScheduleRequestSchema, { id })
2972
+ create12(DeleteCronScheduleRequestSchema, { id })
3182
2973
  );
3183
2974
  return resp.success;
3184
2975
  },
3185
2976
  async pauseCronSchedule(params) {
3186
2977
  const resp = await client.pauseCronSchedule(
3187
- create13(PauseCronScheduleRequestSchema, { id: params.id })
2978
+ create12(PauseCronScheduleRequestSchema, { id: params.id })
3188
2979
  );
3189
2980
  return resp.schedule ?? null;
3190
2981
  },
3191
2982
  async resumeCronSchedule(params) {
3192
2983
  const resp = await client.resumeCronSchedule(
3193
- create13(ResumeCronScheduleRequestSchema, { id: params.id })
2984
+ create12(ResumeCronScheduleRequestSchema, { id: params.id })
3194
2985
  );
3195
2986
  return resp.schedule ?? null;
3196
2987
  },
3197
2988
  async triggerCronSchedule(params) {
3198
2989
  const resp = await client.triggerCronSchedule(
3199
- create13(TriggerCronScheduleRequestSchema, { id: params.id })
2990
+ create12(TriggerCronScheduleRequestSchema, { id: params.id })
3200
2991
  );
3201
2992
  return resp.schedule ?? null;
3202
2993
  }
@@ -3204,7 +2995,7 @@ function createCronSchedulesMethods(client) {
3204
2995
  }
3205
2996
 
3206
2997
  // src/lib/rpc/secrets.ts
3207
- import { create as create14 } from "@bufbuild/protobuf";
2998
+ import { create as create13 } from "@bufbuild/protobuf";
3208
2999
  import {
3209
3000
  PutSecretRequestSchema,
3210
3001
  GetSecretRequestSchema,
@@ -3219,7 +3010,7 @@ function createSecretsMethods(client) {
3219
3010
  return {
3220
3011
  async put(args) {
3221
3012
  const resp = await client.putSecret(
3222
- create14(PutSecretRequestSchema, {
3013
+ create13(PutSecretRequestSchema, {
3223
3014
  tenantId: args.tenantId,
3224
3015
  projectId: args.projectId,
3225
3016
  ownerKind: args.ownerKind,
@@ -3232,12 +3023,12 @@ function createSecretsMethods(client) {
3232
3023
  },
3233
3024
  async get(ref, purpose) {
3234
3025
  return client.getSecret(
3235
- create14(GetSecretRequestSchema, { ref, purpose: purpose ?? "" })
3026
+ create13(GetSecretRequestSchema, { ref, purpose: purpose ?? "" })
3236
3027
  );
3237
3028
  },
3238
3029
  async list(args) {
3239
3030
  const resp = await client.listSecrets(
3240
- create14(ListSecretsRequestSchema, {
3031
+ create13(ListSecretsRequestSchema, {
3241
3032
  tenantId: args.tenantId,
3242
3033
  projectId: args.projectId,
3243
3034
  ownerKind: args.ownerKind ?? OwnerKind.UNSPECIFIED,
@@ -3249,19 +3040,19 @@ function createSecretsMethods(client) {
3249
3040
  },
3250
3041
  async rotate(ref, plaintext) {
3251
3042
  const resp = await client.rotateSecret(
3252
- create14(RotateSecretRequestSchema, { ref, plaintext })
3043
+ create13(RotateSecretRequestSchema, { ref, plaintext })
3253
3044
  );
3254
3045
  return resp.newRef;
3255
3046
  },
3256
3047
  async delete(ref) {
3257
- await client.deleteSecret(create14(DeleteSecretRequestSchema, { ref }));
3048
+ await client.deleteSecret(create13(DeleteSecretRequestSchema, { ref }));
3258
3049
  },
3259
3050
  async restore(ref) {
3260
- await client.restoreSecret(create14(RestoreSecretRequestSchema, { ref }));
3051
+ await client.restoreSecret(create13(RestoreSecretRequestSchema, { ref }));
3261
3052
  },
3262
3053
  async purge(args = {}) {
3263
3054
  const resp = await client.purgeSoftDeleted(
3264
- create14(PurgeSoftDeletedRequestSchema, {
3055
+ create13(PurgeSoftDeletedRequestSchema, {
3265
3056
  tenantId: args.tenantId ?? "",
3266
3057
  projectId: args.projectId ?? ""
3267
3058
  })
@@ -3315,9 +3106,6 @@ async function createPlatformClient(options) {
3315
3106
  records: createRecordsMethods(createRpcClient(RecordsService2, transport)),
3316
3107
  configs: createConfigsMethods(createRpcClient(ConfigsService2, transport)),
3317
3108
  segments: createSegmentsMethods(createRpcClient(SegmentsService2, transport)),
3318
- experiments: createExperimentsMethods(
3319
- createRpcClient(ExperimentsService2, transport)
3320
- ),
3321
3109
  settings: createSettingsMethods(createRpcClient(SettingsService2, transport)),
3322
3110
  storage: createStorageMethods(createRpcClient(StorageService2, transport)),
3323
3111
  operations: createOperationsMethods(
@@ -3352,9 +3140,6 @@ function createPlatformClientWithHeaders(apiUrl, headers) {
3352
3140
  records: createRecordsMethods(createRpcClient(RecordsService2, transport)),
3353
3141
  configs: createConfigsMethods(createRpcClient(ConfigsService2, transport)),
3354
3142
  segments: createSegmentsMethods(createRpcClient(SegmentsService2, transport)),
3355
- experiments: createExperimentsMethods(
3356
- createRpcClient(ExperimentsService2, transport)
3357
- ),
3358
3143
  settings: createSettingsMethods(createRpcClient(SettingsService2, transport)),
3359
3144
  storage: createStorageMethods(createRpcClient(StorageService2, transport)),
3360
3145
  operations: createOperationsMethods(
@@ -5057,7 +4842,10 @@ async function reconcileConfig(client, configId, manifest, options = {}) {
5057
4842
  placementsUpdated: false,
5058
4843
  profileSchemaUpdated: false,
5059
4844
  apiKeys: [],
5060
- apps: zeroCounts()
4845
+ apps: zeroCounts(),
4846
+ updatedModelIds: [],
4847
+ updatedOperationIds: [],
4848
+ updatedAuthProviderIds: []
5061
4849
  };
5062
4850
  const operationBaseUrl = manifest.operationBaseUrl ?? "";
5063
4851
  const modelConflicts = [];
@@ -5179,6 +4967,7 @@ async function reconcileModels(client, configId, models, summary, force, conflic
5179
4967
  updatePushSnapshot: true
5180
4968
  });
5181
4969
  summary.models.updated++;
4970
+ summary.updatedModelIds.push(p.id);
5182
4971
  } else {
5183
4972
  await client.models.deleteModel(p.id);
5184
4973
  summary.models.deleted++;
@@ -5234,6 +5023,7 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
5234
5023
  callbackTtlSeconds: op.callbackTtlSeconds
5235
5024
  });
5236
5025
  summary.operations.updated++;
5026
+ summary.updatedOperationIds.push(ex.id);
5237
5027
  } else {
5238
5028
  await client.operations.createOperation({
5239
5029
  key: op.key,
@@ -5430,6 +5220,7 @@ async function reconcileAuthProviders(client, providers, summary) {
5430
5220
  priority: prov.priority
5431
5221
  });
5432
5222
  summary.authProviders.updated++;
5223
+ summary.updatedAuthProviderIds.push(ex.id);
5433
5224
  } else {
5434
5225
  await client.identity.createAuthProvider({
5435
5226
  key: prov.key,
@@ -5776,6 +5567,10 @@ function registerPushCommand(program2, globalOpts) {
5776
5567
  "--rotate-keys",
5777
5568
  "Rotate existing API keys and rewrite their values in .env",
5778
5569
  false
5570
+ ).option(
5571
+ "--publish",
5572
+ "Promote updated models, operations, auth providers, and profile schema to the published channel after the push. New resources auto-publish; this flag covers updates, which are otherwise left as drafts.",
5573
+ false
5779
5574
  ).option("--env <path>", "Path to .env file (default: .env)").action(
5780
5575
  withErrorHandler(
5781
5576
  globalOpts,
@@ -5867,6 +5662,55 @@ function registerPushCommand(program2, globalOpts) {
5867
5662
  console.log(` Config Key: ${chalk6.cyan(config2.key)}`);
5868
5663
  console.log();
5869
5664
  printSummary(summary);
5665
+ if (opts.publish) {
5666
+ const publishCounts = {
5667
+ models: 0,
5668
+ operations: 0,
5669
+ authProviders: 0,
5670
+ profileSchema: false
5671
+ };
5672
+ for (const id of summary.updatedModelIds) {
5673
+ await client.models.publishModel(id);
5674
+ publishCounts.models++;
5675
+ }
5676
+ for (const id of summary.updatedOperationIds) {
5677
+ await client.operations.publishOperation(id);
5678
+ publishCounts.operations++;
5679
+ }
5680
+ for (const id of summary.updatedAuthProviderIds) {
5681
+ await client.identity.publishAuthProvider(id);
5682
+ publishCounts.authProviders++;
5683
+ }
5684
+ if (summary.profileSchemaUpdated) {
5685
+ await client.settings.publishProfileSchema();
5686
+ publishCounts.profileSchema = true;
5687
+ }
5688
+ const lines = [];
5689
+ if (publishCounts.models)
5690
+ lines.push(`${publishCounts.models} models`);
5691
+ if (publishCounts.operations)
5692
+ lines.push(`${publishCounts.operations} operations`);
5693
+ if (publishCounts.authProviders)
5694
+ lines.push(`${publishCounts.authProviders} auth providers`);
5695
+ if (publishCounts.profileSchema) lines.push("profile schema");
5696
+ console.log();
5697
+ if (lines.length > 0) {
5698
+ console.log(
5699
+ chalk6.green("\u2713 Published: ") + chalk6.dim(lines.join(", "))
5700
+ );
5701
+ } else {
5702
+ console.log(
5703
+ chalk6.dim(" Nothing to publish (no resources were updated).")
5704
+ );
5705
+ }
5706
+ } else if (summary.updatedModelIds.length + summary.updatedOperationIds.length + summary.updatedAuthProviderIds.length > 0 || summary.profileSchemaUpdated) {
5707
+ console.log();
5708
+ console.log(
5709
+ chalk6.dim(
5710
+ " Updates left as drafts. Re-run with --publish to release them, or publish from the admin app."
5711
+ )
5712
+ );
5713
+ }
5870
5714
  if (projectBlock?.settings && resolved) {
5871
5715
  const s = projectBlock.settings;
5872
5716
  await client.identity.updateProject({
@@ -7306,483 +7150,6 @@ function registerSegmentsCommands(program2, globalOpts) {
7306
7150
  );
7307
7151
  }
7308
7152
 
7309
- // src/commands/experiments.ts
7310
- import {
7311
- ExperimentSchema,
7312
- ExperimentStatsSchema,
7313
- ExperimentAssignmentSchema,
7314
- MetricAggregator as MetricAggregator3
7315
- } from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
7316
- function registerExperimentsCommands(program2, globalOpts) {
7317
- const experiments = program2.command("experiments").description("Manage experiments");
7318
- experiments.command("list").description("List experiments").option("--status <status>", "Filter by status").option("--active", "Only active experiments").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(
7319
- withErrorHandler(globalOpts, async (cmdOpts) => {
7320
- const opts = globalOpts();
7321
- const client = await createPlatformClient(opts);
7322
- const data = await client.experiments.listExperiments({
7323
- status: cmdOpts.status,
7324
- isActive: cmdOpts.active ? true : void 0,
7325
- limit: parseInt(String(cmdOpts.limit ?? "50"), 10),
7326
- offset: parseInt(String(cmdOpts.offset ?? "0"), 10)
7327
- });
7328
- formatListProto(ExperimentSchema, data.experiments, opts, {
7329
- columns: [
7330
- { key: "id", header: "ID", width: 28 },
7331
- { key: "key", header: "Key", width: 20 },
7332
- { key: "name", header: "Name", width: 24 },
7333
- { key: "status", header: "Status", width: 12 },
7334
- {
7335
- key: "isActive",
7336
- header: "Active",
7337
- width: 8,
7338
- format: (v) => v ? "yes" : "no"
7339
- },
7340
- {
7341
- key: "updatedAt",
7342
- header: "Updated",
7343
- width: 12,
7344
- format: (v) => timeAgo(v)
7345
- }
7346
- ]
7347
- });
7348
- })
7349
- );
7350
- experiments.command("get <idOrKey>").description("Get an experiment by ID or key").action(
7351
- withErrorHandler(globalOpts, async (idOrKey) => {
7352
- const opts = globalOpts();
7353
- const client = await createPlatformClient(opts);
7354
- let result;
7355
- if (isUUID(idOrKey)) {
7356
- result = await client.experiments.getExperiment(idOrKey);
7357
- } else {
7358
- result = await client.experiments.getExperimentByKey(idOrKey);
7359
- }
7360
- if (!result) throw new Error(`Experiment "${idOrKey}" not found.`);
7361
- formatOutputProto(ExperimentSchema, result, opts);
7362
- })
7363
- );
7364
- experiments.command("create").description("Create a new experiment").option("-d, --data <json>", "Experiment data as JSON").option("-f, --file <path>", "Read data from file").action(
7365
- withErrorHandler(globalOpts, async (cmdOpts) => {
7366
- const opts = globalOpts();
7367
- const client = await createPlatformClient(opts);
7368
- const input = await parseInputData(cmdOpts);
7369
- const result = await client.experiments.createExperiment(
7370
- input
7371
- );
7372
- formatOutputProto(ExperimentSchema, result, opts);
7373
- if (!(opts.json || opts.jsonl || opts.quiet))
7374
- success(`Created experiment ${result?.key}`);
7375
- })
7376
- );
7377
- experiments.command("update <id>").description("Update an experiment").option("-d, --data <json>", "Experiment data as JSON").option("-f, --file <path>", "Read data from file").action(
7378
- withErrorHandler(
7379
- globalOpts,
7380
- async (id, cmdOpts) => {
7381
- const opts = globalOpts();
7382
- const client = await createPlatformClient(opts);
7383
- const input = await parseInputData(cmdOpts);
7384
- const result = await client.experiments.updateExperiment({
7385
- id,
7386
- ...input
7387
- });
7388
- formatOutputProto(ExperimentSchema, result, opts);
7389
- if (!(opts.json || opts.jsonl || opts.quiet))
7390
- success(`Updated experiment ${id}`);
7391
- }
7392
- )
7393
- );
7394
- experiments.command("delete <id>").description("Delete an experiment").option("--confirm", "Skip confirmation prompt").action(
7395
- withErrorHandler(
7396
- globalOpts,
7397
- async (id, cmdOpts) => {
7398
- const opts = globalOpts();
7399
- const confirmed = await confirmAction(`Delete experiment ${id}?`, {
7400
- confirm: !!cmdOpts.confirm
7401
- });
7402
- if (!confirmed) {
7403
- console.log("Aborted.");
7404
- return;
7405
- }
7406
- const client = await createPlatformClient(opts);
7407
- await client.experiments.deleteExperiment(id);
7408
- if (opts.json || opts.jsonl)
7409
- formatOutput({ deleted: true, id }, opts);
7410
- else success(`Deleted experiment ${id}`);
7411
- }
7412
- )
7413
- );
7414
- experiments.command("start <id>").description("Start an experiment").action(
7415
- withErrorHandler(globalOpts, async (id) => {
7416
- const opts = globalOpts();
7417
- const client = await createPlatformClient(opts);
7418
- const result = await client.experiments.startExperiment(id);
7419
- formatOutputProto(ExperimentSchema, result, opts);
7420
- if (!(opts.json || opts.jsonl || opts.quiet))
7421
- success("Experiment started");
7422
- })
7423
- );
7424
- experiments.command("pause <id>").description("Pause a running experiment").action(
7425
- withErrorHandler(globalOpts, async (id) => {
7426
- const opts = globalOpts();
7427
- const client = await createPlatformClient(opts);
7428
- const result = await client.experiments.pauseExperiment(id);
7429
- formatOutputProto(ExperimentSchema, result, opts);
7430
- if (!(opts.json || opts.jsonl || opts.quiet))
7431
- success("Experiment paused");
7432
- })
7433
- );
7434
- experiments.command("resume <id>").description("Resume a paused experiment").action(
7435
- withErrorHandler(globalOpts, async (id) => {
7436
- const opts = globalOpts();
7437
- const client = await createPlatformClient(opts);
7438
- const result = await client.experiments.resumeExperiment(id);
7439
- formatOutputProto(ExperimentSchema, result, opts);
7440
- if (!(opts.json || opts.jsonl || opts.quiet))
7441
- success("Experiment resumed");
7442
- })
7443
- );
7444
- experiments.command("end <id>").description("End an experiment").action(
7445
- withErrorHandler(globalOpts, async (id) => {
7446
- const opts = globalOpts();
7447
- const client = await createPlatformClient(opts);
7448
- const result = await client.experiments.endExperiment(id);
7449
- formatOutputProto(ExperimentSchema, result, opts);
7450
- if (!(opts.json || opts.jsonl || opts.quiet))
7451
- success("Experiment ended");
7452
- })
7453
- );
7454
- experiments.command("stats <id>").description(
7455
- "Decision-grade experiment statistics: per-variant assignments, per-goal conversion + significance, and optional metric aggregations."
7456
- ).option("--from <iso8601>", "Lower bound on converted_at (defaults to experiment start)").option("--to <iso8601>", "Upper bound on converted_at (defaults to now)").option(
7457
- "--metric <spec>",
7458
- "Metric aggregation in name=path:aggregator[:goal_key] form (e.g. cart=cartValue:sum:checkout_complete). Repeatable.",
7459
- collectMetric,
7460
- []
7461
- ).option("--min-sample-size <n>", "Per-arm sample-size gate for is_significant (default 100)", parseInt).action(
7462
- withErrorHandler(
7463
- globalOpts,
7464
- async (id, cmdOpts) => {
7465
- const opts = globalOpts();
7466
- const client = await createPlatformClient(opts);
7467
- const metrics = cmdOpts.metric.map(parseMetricSpec);
7468
- const result = await client.experiments.getExperimentStats(id, {
7469
- from: cmdOpts.from ? new Date(cmdOpts.from) : void 0,
7470
- to: cmdOpts.to ? new Date(cmdOpts.to) : void 0,
7471
- metrics,
7472
- minSampleSize: cmdOpts.minSampleSize
7473
- });
7474
- if (opts.json || opts.jsonl) {
7475
- formatOutputProto(ExperimentStatsSchema, result, opts);
7476
- return;
7477
- }
7478
- if (!result) {
7479
- console.log("No stats \u2014 experiment not found or no data in window.");
7480
- return;
7481
- }
7482
- renderStatsTable(result);
7483
- }
7484
- )
7485
- );
7486
- experiments.command("force-assign <experimentId>").description(
7487
- "Force a known identity into a specific variant (admin override)."
7488
- ).requiredOption("--variant <key>", "Variant key to assign").option("--customer-id <id>", "Customer identity to bucket").option(
7489
- "--viewer-key <key>",
7490
- "Anonymous viewer identity (cookie/localStorage value) to bucket"
7491
- ).action(
7492
- withErrorHandler(
7493
- globalOpts,
7494
- async (experimentId, cmdOpts) => {
7495
- const opts = globalOpts();
7496
- if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
7497
- throw new Error(
7498
- "Provide exactly one of --customer-id or --viewer-key."
7499
- );
7500
- }
7501
- if (cmdOpts.customerId && cmdOpts.viewerKey) {
7502
- throw new Error(
7503
- "Provide exactly one of --customer-id or --viewer-key, not both."
7504
- );
7505
- }
7506
- const client = await createPlatformClient(opts);
7507
- const result = await client.experiments.forceAssignExperiment(
7508
- { customerId: cmdOpts.customerId, viewerKey: cmdOpts.viewerKey },
7509
- experimentId,
7510
- cmdOpts.variant
7511
- );
7512
- if (!result) throw new Error("Force-assign returned no assignment.");
7513
- formatOutputProto(ExperimentAssignmentSchema, result, opts);
7514
- if (!(opts.json || opts.jsonl || opts.quiet))
7515
- success(
7516
- `Assigned ${cmdOpts.customerId ? "customer" : "viewer"} ${cmdOpts.customerId ?? cmdOpts.viewerKey} \u2192 ${cmdOpts.variant}`
7517
- );
7518
- }
7519
- )
7520
- );
7521
- experiments.command("remove-assignment <experimentId>").description("Remove the assignment for a known identity.").option("--customer-id <id>", "Customer identity to clear").option("--viewer-key <key>", "Anonymous viewer identity to clear").action(
7522
- withErrorHandler(
7523
- globalOpts,
7524
- async (experimentId, cmdOpts) => {
7525
- const opts = globalOpts();
7526
- if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
7527
- throw new Error(
7528
- "Provide exactly one of --customer-id or --viewer-key."
7529
- );
7530
- }
7531
- if (cmdOpts.customerId && cmdOpts.viewerKey) {
7532
- throw new Error(
7533
- "Provide exactly one of --customer-id or --viewer-key, not both."
7534
- );
7535
- }
7536
- const client = await createPlatformClient(opts);
7537
- const ok = await client.experiments.removeExperimentAssignment(
7538
- { customerId: cmdOpts.customerId, viewerKey: cmdOpts.viewerKey },
7539
- experimentId
7540
- );
7541
- if (opts.json || opts.jsonl)
7542
- formatOutput({ removed: ok, experimentId }, opts);
7543
- else if (ok) success("Assignment removed");
7544
- else success("No matching assignment found");
7545
- }
7546
- )
7547
- );
7548
- experiments.command("assignments").description("List assignments for a single identity across experiments.").option("--customer-id <id>", "Customer identity to look up").option("--viewer-key <key>", "Anonymous viewer identity to look up").action(
7549
- withErrorHandler(
7550
- globalOpts,
7551
- async (cmdOpts) => {
7552
- const opts = globalOpts();
7553
- if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
7554
- throw new Error(
7555
- "Provide exactly one of --customer-id or --viewer-key."
7556
- );
7557
- }
7558
- if (cmdOpts.customerId && cmdOpts.viewerKey) {
7559
- throw new Error(
7560
- "Provide exactly one of --customer-id or --viewer-key, not both."
7561
- );
7562
- }
7563
- const client = await createPlatformClient(opts);
7564
- const data = await client.experiments.getAssignments({
7565
- customerId: cmdOpts.customerId,
7566
- viewerKey: cmdOpts.viewerKey
7567
- });
7568
- formatListProto(ExperimentAssignmentSchema, data, opts, {
7569
- columns: [
7570
- { key: "experimentKey", header: "Experiment", width: 24 },
7571
- { key: "variantKey", header: "Variant", width: 16 },
7572
- { key: "assignmentMethod", header: "Method", width: 10 },
7573
- {
7574
- key: "assignedAt",
7575
- header: "Assigned",
7576
- width: 12,
7577
- format: (v) => timeAgo(v)
7578
- }
7579
- ]
7580
- });
7581
- }
7582
- )
7583
- );
7584
- }
7585
- function collectMetric(value, accumulator) {
7586
- return [...accumulator, value];
7587
- }
7588
- function parseMetricSpec(raw) {
7589
- const eq = raw.indexOf("=");
7590
- if (eq <= 0) {
7591
- throw new Error(
7592
- `--metric ${JSON.stringify(raw)}: expected name=path:aggregator[:goal_key]`
7593
- );
7594
- }
7595
- const name = raw.slice(0, eq);
7596
- const rest = raw.slice(eq + 1);
7597
- const parts = rest.split(":");
7598
- if (parts.length < 2 || parts.length > 3) {
7599
- throw new Error(
7600
- `--metric ${JSON.stringify(raw)}: expected path:aggregator[:goal_key] after =`
7601
- );
7602
- }
7603
- const path3 = parts[0];
7604
- const aggStr = parts[1];
7605
- const goalKey = parts[2];
7606
- if (!path3 || !aggStr) {
7607
- throw new Error(
7608
- `--metric ${JSON.stringify(raw)}: expected path:aggregator[:goal_key] after =`
7609
- );
7610
- }
7611
- return {
7612
- name,
7613
- path: path3,
7614
- aggregator: parseAggregator(aggStr),
7615
- goalKey: goalKey || void 0
7616
- };
7617
- }
7618
- function parseAggregator(s) {
7619
- switch (s.toLowerCase()) {
7620
- case "sum":
7621
- return MetricAggregator3.SUM;
7622
- case "avg":
7623
- case "mean":
7624
- return MetricAggregator3.AVG;
7625
- case "count":
7626
- return MetricAggregator3.COUNT;
7627
- case "min":
7628
- return MetricAggregator3.MIN;
7629
- case "max":
7630
- return MetricAggregator3.MAX;
7631
- case "p50":
7632
- case "median":
7633
- return MetricAggregator3.P50;
7634
- case "p95":
7635
- return MetricAggregator3.P95;
7636
- }
7637
- throw new Error(
7638
- `unknown aggregator ${JSON.stringify(s)}: expected one of sum, avg, count, min, max, p50, p95`
7639
- );
7640
- }
7641
- function renderStatsTable(s) {
7642
- const winFrom = s.windowFrom?.seconds ? new Date(Number(s.windowFrom.seconds) * 1e3).toISOString().slice(0, 19) : "?";
7643
- const winTo = s.windowTo?.seconds ? new Date(Number(s.windowTo.seconds) * 1e3).toISOString().slice(0, 19) : "?";
7644
- console.log("");
7645
- console.log(`Experiment ${s.experimentKey} (id ${s.experimentId})`);
7646
- console.log(
7647
- `Window ${winFrom} \u2192 ${winTo} grain: ${s.dailyGrain || "day"} total assignments: ${s.totalAssignments}`
7648
- );
7649
- console.log("");
7650
- console.log("Variants");
7651
- console.log(
7652
- " " + padCols(["variant", "control", "assignments", "share"], [16, 8, 12, 8])
7653
- );
7654
- console.log(" " + "-".repeat(48));
7655
- for (const v of s.variants) {
7656
- const share = s.totalAssignments > 0 ? (v.assignmentCount / s.totalAssignments * 100).toFixed(1) + "%" : "-";
7657
- console.log(
7658
- " " + padCols(
7659
- [v.variantKey, v.isControl ? "\u2713" : "", String(v.assignmentCount), share],
7660
- [16, 8, 12, 8]
7661
- )
7662
- );
7663
- }
7664
- console.log("");
7665
- const familySize = familySizeOf(s);
7666
- for (const goal of s.goals) {
7667
- console.log(`Goal: ${goal.goalKey}${goal.isPrimary ? " (primary)" : ""}`);
7668
- console.log(
7669
- " " + padCols(
7670
- ["variant", "count", "unique", "rate", "lift", "p (raw)", "p (corr)", "sig"],
7671
- [16, 8, 8, 9, 9, 10, 10, 5]
7672
- )
7673
- );
7674
- console.log(" " + "-".repeat(75));
7675
- for (const v of s.variants) {
7676
- const cell = v.goalStats.find((g) => g.goalKey === goal.goalKey);
7677
- if (!cell) continue;
7678
- const rate = (cell.conversionRate * 100).toFixed(2) + "%";
7679
- if (v.isControl) {
7680
- console.log(
7681
- " " + padCols(
7682
- [v.variantKey, String(cell.conversionEventCount), String(cell.uniqueConverters), rate, "-", "-", "-", "-"],
7683
- [16, 8, 8, 9, 9, 10, 10, 5]
7684
- )
7685
- );
7686
- continue;
7687
- }
7688
- const sig = cell.significance;
7689
- const rawP = sig?.pValue ?? 1;
7690
- const corrP = Math.min(1, rawP * familySize);
7691
- const lift = sig ? (sig.relativeLift >= 0 ? "+" : "") + (sig.relativeLift * 100).toFixed(1) + "%" : "-";
7692
- const sigFlag = corrP < 0.05 && sig?.isSignificant ? "\u2713" : "";
7693
- console.log(
7694
- " " + padCols(
7695
- [
7696
- v.variantKey,
7697
- String(cell.conversionEventCount),
7698
- String(cell.uniqueConverters),
7699
- rate,
7700
- lift,
7701
- rawP.toFixed(4),
7702
- corrP.toFixed(4),
7703
- sigFlag
7704
- ],
7705
- [16, 8, 8, 9, 9, 10, 10, 5]
7706
- )
7707
- );
7708
- }
7709
- console.log("");
7710
- }
7711
- if (s.metricStats.length > 0) {
7712
- const byMetric = /* @__PURE__ */ new Map();
7713
- for (const m of s.metricStats) {
7714
- const list = byMetric.get(m.metricName) ?? [];
7715
- list.push(m);
7716
- byMetric.set(m.metricName, list);
7717
- }
7718
- for (const [name, rows] of byMetric) {
7719
- console.log(`Metric: ${name}`);
7720
- console.log(
7721
- " " + padCols(
7722
- ["variant", "value", "n", "skipped", "lift", "p", "sig"],
7723
- [16, 12, 8, 8, 9, 8, 5]
7724
- )
7725
- );
7726
- console.log(" " + "-".repeat(70));
7727
- for (const m of rows) {
7728
- const sig = m.significance;
7729
- const lift = sig ? (sig.relativeLift >= 0 ? "+" : "") + (sig.relativeLift * 100).toFixed(1) + "%" : "-";
7730
- const p = sig ? sig.pValue.toFixed(4) : "-";
7731
- const sigFlag = sig?.isSignificant ? "\u2713" : "";
7732
- console.log(
7733
- " " + padCols(
7734
- [
7735
- m.variantKey,
7736
- m.value.toFixed(2),
7737
- String(m.sampleSize),
7738
- String(m.skippedRowCount),
7739
- lift,
7740
- p,
7741
- sigFlag
7742
- ],
7743
- [16, 12, 8, 8, 9, 8, 5]
7744
- )
7745
- );
7746
- }
7747
- console.log("");
7748
- }
7749
- }
7750
- const winners = winnersOnPrimary(s, familySize);
7751
- if (winners.length > 0) {
7752
- console.log(`Significant on primary goal (Bonferroni-corrected): ${winners.join(", ")}`);
7753
- } else {
7754
- console.log("No variant has reached significance on the primary goal.");
7755
- }
7756
- }
7757
- function familySizeOf(s) {
7758
- const variantCount = s.variants.filter((v) => !v.isControl).length;
7759
- const goalCount = s.goals.length;
7760
- return Math.max(1, variantCount * goalCount);
7761
- }
7762
- function winnersOnPrimary(s, familySize) {
7763
- const primary = s.goals.find((g) => g.isPrimary);
7764
- if (!primary) return [];
7765
- const out = [];
7766
- for (const v of s.variants) {
7767
- if (v.isControl) continue;
7768
- const cell = v.goalStats.find((g) => g.goalKey === primary.goalKey);
7769
- if (!cell?.significance) continue;
7770
- const corrP = Math.min(1, cell.significance.pValue * familySize);
7771
- if (corrP < 0.05 && cell.significance.isSignificant) {
7772
- out.push(v.variantKey);
7773
- }
7774
- }
7775
- return out;
7776
- }
7777
- function padCols(values, widths) {
7778
- return values.map((v, i) => {
7779
- const w = widths[i] ?? 12;
7780
- const s = v ?? "";
7781
- if (s.length >= w) return s.slice(0, w);
7782
- return s + " ".repeat(w - s.length);
7783
- }).join(" ");
7784
- }
7785
-
7786
7153
  // src/commands/schedules.ts
7787
7154
  import { CronScheduleSchema } from "@eide/foir-proto-ts/schedules/v1/schedules_pb";
7788
7155
  function registerSchedulesCommands(program2, globalOpts) {
@@ -9608,7 +8975,6 @@ registerCustomersCommands(program, getGlobalOpts);
9608
8975
  registerCustomerProfilesCommands(program, getGlobalOpts);
9609
8976
  registerOperationsCommands(program, getGlobalOpts);
9610
8977
  registerSegmentsCommands(program, getGlobalOpts);
9611
- registerExperimentsCommands(program, getGlobalOpts);
9612
8978
  registerSchedulesCommands(program, getGlobalOpts);
9613
8979
  registerApiKeysCommands(program, getGlobalOpts);
9614
8980
  registerAuthProvidersCommands(program, getGlobalOpts);