@eide/foir-cli 0.20.0 → 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.
- package/dist/cli.js +217 -827
- 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
|
|
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 ?
|
|
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 ?
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2322
|
+
create7(GetCustomerResolutionAttributesRequestSchema, { customerId })
|
|
2539
2323
|
);
|
|
2540
2324
|
},
|
|
2541
2325
|
async getEditorConfigs(modelKey) {
|
|
2542
2326
|
const resp = await client.getEditorConfigs(
|
|
2543
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
3026
|
+
create13(GetSecretRequestSchema, { ref, purpose: purpose ?? "" })
|
|
3236
3027
|
);
|
|
3237
3028
|
},
|
|
3238
3029
|
async list(args) {
|
|
3239
3030
|
const resp = await client.listSecrets(
|
|
3240
|
-
|
|
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
|
-
|
|
3043
|
+
create13(RotateSecretRequestSchema, { ref, plaintext })
|
|
3253
3044
|
);
|
|
3254
3045
|
return resp.newRef;
|
|
3255
3046
|
},
|
|
3256
3047
|
async delete(ref) {
|
|
3257
|
-
await client.deleteSecret(
|
|
3048
|
+
await client.deleteSecret(create13(DeleteSecretRequestSchema, { ref }));
|
|
3258
3049
|
},
|
|
3259
3050
|
async restore(ref) {
|
|
3260
|
-
await client.restoreSecret(
|
|
3051
|
+
await client.restoreSecret(create13(RestoreSecretRequestSchema, { ref }));
|
|
3261
3052
|
},
|
|
3262
3053
|
async purge(args = {}) {
|
|
3263
3054
|
const resp = await client.purgeSoftDeleted(
|
|
3264
|
-
|
|
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(
|
|
@@ -4945,13 +4730,37 @@ var PushConflictError = class extends Error {
|
|
|
4945
4730
|
this.conflicts = conflicts;
|
|
4946
4731
|
}
|
|
4947
4732
|
};
|
|
4733
|
+
function normalizeForDiff(v) {
|
|
4734
|
+
if (v === null || v === void 0) return void 0;
|
|
4735
|
+
if (Array.isArray(v)) {
|
|
4736
|
+
const items = v.map(normalizeForDiff).filter((x) => x !== void 0);
|
|
4737
|
+
return items.length ? items : void 0;
|
|
4738
|
+
}
|
|
4739
|
+
if (typeof v !== "object") {
|
|
4740
|
+
if (v === false || v === "" || v === 0) return void 0;
|
|
4741
|
+
return v;
|
|
4742
|
+
}
|
|
4743
|
+
const obj = v;
|
|
4744
|
+
const out = {};
|
|
4745
|
+
for (const [k, val] of Object.entries(obj)) {
|
|
4746
|
+
if (k === "$typeName") continue;
|
|
4747
|
+
if (k === "id") continue;
|
|
4748
|
+
const norm = normalizeForDiff(val);
|
|
4749
|
+
if (norm === void 0) continue;
|
|
4750
|
+
out[k] = norm;
|
|
4751
|
+
}
|
|
4752
|
+
return Object.keys(out).length ? out : void 0;
|
|
4753
|
+
}
|
|
4948
4754
|
function canonicalize(v) {
|
|
4755
|
+
return canonicalJson(normalizeForDiff(v));
|
|
4756
|
+
}
|
|
4757
|
+
function canonicalJson(v) {
|
|
4949
4758
|
if (v === void 0) return "undefined";
|
|
4950
4759
|
if (v === null || typeof v !== "object") return JSON.stringify(v);
|
|
4951
|
-
if (Array.isArray(v)) return "[" + v.map(
|
|
4760
|
+
if (Array.isArray(v)) return "[" + v.map(canonicalJson).join(",") + "]";
|
|
4952
4761
|
const obj = v;
|
|
4953
4762
|
const keys = Object.keys(obj).sort();
|
|
4954
|
-
return "{" + keys.map((k) => JSON.stringify(k) + ":" +
|
|
4763
|
+
return "{" + keys.map((k) => JSON.stringify(k) + ":" + canonicalJson(obj[k])).join(",") + "}";
|
|
4955
4764
|
}
|
|
4956
4765
|
function deepEqual(a, b) {
|
|
4957
4766
|
return canonicalize(a) === canonicalize(b);
|
|
@@ -5033,7 +4842,10 @@ async function reconcileConfig(client, configId, manifest, options = {}) {
|
|
|
5033
4842
|
placementsUpdated: false,
|
|
5034
4843
|
profileSchemaUpdated: false,
|
|
5035
4844
|
apiKeys: [],
|
|
5036
|
-
apps: zeroCounts()
|
|
4845
|
+
apps: zeroCounts(),
|
|
4846
|
+
updatedModelIds: [],
|
|
4847
|
+
updatedOperationIds: [],
|
|
4848
|
+
updatedAuthProviderIds: []
|
|
5037
4849
|
};
|
|
5038
4850
|
const operationBaseUrl = manifest.operationBaseUrl ?? "";
|
|
5039
4851
|
const modelConflicts = [];
|
|
@@ -5155,6 +4967,7 @@ async function reconcileModels(client, configId, models, summary, force, conflic
|
|
|
5155
4967
|
updatePushSnapshot: true
|
|
5156
4968
|
});
|
|
5157
4969
|
summary.models.updated++;
|
|
4970
|
+
summary.updatedModelIds.push(p.id);
|
|
5158
4971
|
} else {
|
|
5159
4972
|
await client.models.deleteModel(p.id);
|
|
5160
4973
|
summary.models.deleted++;
|
|
@@ -5210,6 +5023,7 @@ async function reconcileOperations(client, configId, operations, operationBaseUr
|
|
|
5210
5023
|
callbackTtlSeconds: op.callbackTtlSeconds
|
|
5211
5024
|
});
|
|
5212
5025
|
summary.operations.updated++;
|
|
5026
|
+
summary.updatedOperationIds.push(ex.id);
|
|
5213
5027
|
} else {
|
|
5214
5028
|
await client.operations.createOperation({
|
|
5215
5029
|
key: op.key,
|
|
@@ -5406,6 +5220,7 @@ async function reconcileAuthProviders(client, providers, summary) {
|
|
|
5406
5220
|
priority: prov.priority
|
|
5407
5221
|
});
|
|
5408
5222
|
summary.authProviders.updated++;
|
|
5223
|
+
summary.updatedAuthProviderIds.push(ex.id);
|
|
5409
5224
|
} else {
|
|
5410
5225
|
await client.identity.createAuthProvider({
|
|
5411
5226
|
key: prov.key,
|
|
@@ -5752,6 +5567,10 @@ function registerPushCommand(program2, globalOpts) {
|
|
|
5752
5567
|
"--rotate-keys",
|
|
5753
5568
|
"Rotate existing API keys and rewrite their values in .env",
|
|
5754
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
|
|
5755
5574
|
).option("--env <path>", "Path to .env file (default: .env)").action(
|
|
5756
5575
|
withErrorHandler(
|
|
5757
5576
|
globalOpts,
|
|
@@ -5843,6 +5662,55 @@ function registerPushCommand(program2, globalOpts) {
|
|
|
5843
5662
|
console.log(` Config Key: ${chalk6.cyan(config2.key)}`);
|
|
5844
5663
|
console.log();
|
|
5845
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
|
+
}
|
|
5846
5714
|
if (projectBlock?.settings && resolved) {
|
|
5847
5715
|
const s = projectBlock.settings;
|
|
5848
5716
|
await client.identity.updateProject({
|
|
@@ -7282,483 +7150,6 @@ function registerSegmentsCommands(program2, globalOpts) {
|
|
|
7282
7150
|
);
|
|
7283
7151
|
}
|
|
7284
7152
|
|
|
7285
|
-
// src/commands/experiments.ts
|
|
7286
|
-
import {
|
|
7287
|
-
ExperimentSchema,
|
|
7288
|
-
ExperimentStatsSchema,
|
|
7289
|
-
ExperimentAssignmentSchema,
|
|
7290
|
-
MetricAggregator as MetricAggregator3
|
|
7291
|
-
} from "@eide/foir-proto-ts/experiments/v1/experiments_pb";
|
|
7292
|
-
function registerExperimentsCommands(program2, globalOpts) {
|
|
7293
|
-
const experiments = program2.command("experiments").description("Manage experiments");
|
|
7294
|
-
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(
|
|
7295
|
-
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
7296
|
-
const opts = globalOpts();
|
|
7297
|
-
const client = await createPlatformClient(opts);
|
|
7298
|
-
const data = await client.experiments.listExperiments({
|
|
7299
|
-
status: cmdOpts.status,
|
|
7300
|
-
isActive: cmdOpts.active ? true : void 0,
|
|
7301
|
-
limit: parseInt(String(cmdOpts.limit ?? "50"), 10),
|
|
7302
|
-
offset: parseInt(String(cmdOpts.offset ?? "0"), 10)
|
|
7303
|
-
});
|
|
7304
|
-
formatListProto(ExperimentSchema, data.experiments, opts, {
|
|
7305
|
-
columns: [
|
|
7306
|
-
{ key: "id", header: "ID", width: 28 },
|
|
7307
|
-
{ key: "key", header: "Key", width: 20 },
|
|
7308
|
-
{ key: "name", header: "Name", width: 24 },
|
|
7309
|
-
{ key: "status", header: "Status", width: 12 },
|
|
7310
|
-
{
|
|
7311
|
-
key: "isActive",
|
|
7312
|
-
header: "Active",
|
|
7313
|
-
width: 8,
|
|
7314
|
-
format: (v) => v ? "yes" : "no"
|
|
7315
|
-
},
|
|
7316
|
-
{
|
|
7317
|
-
key: "updatedAt",
|
|
7318
|
-
header: "Updated",
|
|
7319
|
-
width: 12,
|
|
7320
|
-
format: (v) => timeAgo(v)
|
|
7321
|
-
}
|
|
7322
|
-
]
|
|
7323
|
-
});
|
|
7324
|
-
})
|
|
7325
|
-
);
|
|
7326
|
-
experiments.command("get <idOrKey>").description("Get an experiment by ID or key").action(
|
|
7327
|
-
withErrorHandler(globalOpts, async (idOrKey) => {
|
|
7328
|
-
const opts = globalOpts();
|
|
7329
|
-
const client = await createPlatformClient(opts);
|
|
7330
|
-
let result;
|
|
7331
|
-
if (isUUID(idOrKey)) {
|
|
7332
|
-
result = await client.experiments.getExperiment(idOrKey);
|
|
7333
|
-
} else {
|
|
7334
|
-
result = await client.experiments.getExperimentByKey(idOrKey);
|
|
7335
|
-
}
|
|
7336
|
-
if (!result) throw new Error(`Experiment "${idOrKey}" not found.`);
|
|
7337
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7338
|
-
})
|
|
7339
|
-
);
|
|
7340
|
-
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(
|
|
7341
|
-
withErrorHandler(globalOpts, async (cmdOpts) => {
|
|
7342
|
-
const opts = globalOpts();
|
|
7343
|
-
const client = await createPlatformClient(opts);
|
|
7344
|
-
const input = await parseInputData(cmdOpts);
|
|
7345
|
-
const result = await client.experiments.createExperiment(
|
|
7346
|
-
input
|
|
7347
|
-
);
|
|
7348
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7349
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7350
|
-
success(`Created experiment ${result?.key}`);
|
|
7351
|
-
})
|
|
7352
|
-
);
|
|
7353
|
-
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(
|
|
7354
|
-
withErrorHandler(
|
|
7355
|
-
globalOpts,
|
|
7356
|
-
async (id, cmdOpts) => {
|
|
7357
|
-
const opts = globalOpts();
|
|
7358
|
-
const client = await createPlatformClient(opts);
|
|
7359
|
-
const input = await parseInputData(cmdOpts);
|
|
7360
|
-
const result = await client.experiments.updateExperiment({
|
|
7361
|
-
id,
|
|
7362
|
-
...input
|
|
7363
|
-
});
|
|
7364
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7365
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7366
|
-
success(`Updated experiment ${id}`);
|
|
7367
|
-
}
|
|
7368
|
-
)
|
|
7369
|
-
);
|
|
7370
|
-
experiments.command("delete <id>").description("Delete an experiment").option("--confirm", "Skip confirmation prompt").action(
|
|
7371
|
-
withErrorHandler(
|
|
7372
|
-
globalOpts,
|
|
7373
|
-
async (id, cmdOpts) => {
|
|
7374
|
-
const opts = globalOpts();
|
|
7375
|
-
const confirmed = await confirmAction(`Delete experiment ${id}?`, {
|
|
7376
|
-
confirm: !!cmdOpts.confirm
|
|
7377
|
-
});
|
|
7378
|
-
if (!confirmed) {
|
|
7379
|
-
console.log("Aborted.");
|
|
7380
|
-
return;
|
|
7381
|
-
}
|
|
7382
|
-
const client = await createPlatformClient(opts);
|
|
7383
|
-
await client.experiments.deleteExperiment(id);
|
|
7384
|
-
if (opts.json || opts.jsonl)
|
|
7385
|
-
formatOutput({ deleted: true, id }, opts);
|
|
7386
|
-
else success(`Deleted experiment ${id}`);
|
|
7387
|
-
}
|
|
7388
|
-
)
|
|
7389
|
-
);
|
|
7390
|
-
experiments.command("start <id>").description("Start an experiment").action(
|
|
7391
|
-
withErrorHandler(globalOpts, async (id) => {
|
|
7392
|
-
const opts = globalOpts();
|
|
7393
|
-
const client = await createPlatformClient(opts);
|
|
7394
|
-
const result = await client.experiments.startExperiment(id);
|
|
7395
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7396
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7397
|
-
success("Experiment started");
|
|
7398
|
-
})
|
|
7399
|
-
);
|
|
7400
|
-
experiments.command("pause <id>").description("Pause a running experiment").action(
|
|
7401
|
-
withErrorHandler(globalOpts, async (id) => {
|
|
7402
|
-
const opts = globalOpts();
|
|
7403
|
-
const client = await createPlatformClient(opts);
|
|
7404
|
-
const result = await client.experiments.pauseExperiment(id);
|
|
7405
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7406
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7407
|
-
success("Experiment paused");
|
|
7408
|
-
})
|
|
7409
|
-
);
|
|
7410
|
-
experiments.command("resume <id>").description("Resume a paused experiment").action(
|
|
7411
|
-
withErrorHandler(globalOpts, async (id) => {
|
|
7412
|
-
const opts = globalOpts();
|
|
7413
|
-
const client = await createPlatformClient(opts);
|
|
7414
|
-
const result = await client.experiments.resumeExperiment(id);
|
|
7415
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7416
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7417
|
-
success("Experiment resumed");
|
|
7418
|
-
})
|
|
7419
|
-
);
|
|
7420
|
-
experiments.command("end <id>").description("End an experiment").action(
|
|
7421
|
-
withErrorHandler(globalOpts, async (id) => {
|
|
7422
|
-
const opts = globalOpts();
|
|
7423
|
-
const client = await createPlatformClient(opts);
|
|
7424
|
-
const result = await client.experiments.endExperiment(id);
|
|
7425
|
-
formatOutputProto(ExperimentSchema, result, opts);
|
|
7426
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7427
|
-
success("Experiment ended");
|
|
7428
|
-
})
|
|
7429
|
-
);
|
|
7430
|
-
experiments.command("stats <id>").description(
|
|
7431
|
-
"Decision-grade experiment statistics: per-variant assignments, per-goal conversion + significance, and optional metric aggregations."
|
|
7432
|
-
).option("--from <iso8601>", "Lower bound on converted_at (defaults to experiment start)").option("--to <iso8601>", "Upper bound on converted_at (defaults to now)").option(
|
|
7433
|
-
"--metric <spec>",
|
|
7434
|
-
"Metric aggregation in name=path:aggregator[:goal_key] form (e.g. cart=cartValue:sum:checkout_complete). Repeatable.",
|
|
7435
|
-
collectMetric,
|
|
7436
|
-
[]
|
|
7437
|
-
).option("--min-sample-size <n>", "Per-arm sample-size gate for is_significant (default 100)", parseInt).action(
|
|
7438
|
-
withErrorHandler(
|
|
7439
|
-
globalOpts,
|
|
7440
|
-
async (id, cmdOpts) => {
|
|
7441
|
-
const opts = globalOpts();
|
|
7442
|
-
const client = await createPlatformClient(opts);
|
|
7443
|
-
const metrics = cmdOpts.metric.map(parseMetricSpec);
|
|
7444
|
-
const result = await client.experiments.getExperimentStats(id, {
|
|
7445
|
-
from: cmdOpts.from ? new Date(cmdOpts.from) : void 0,
|
|
7446
|
-
to: cmdOpts.to ? new Date(cmdOpts.to) : void 0,
|
|
7447
|
-
metrics,
|
|
7448
|
-
minSampleSize: cmdOpts.minSampleSize
|
|
7449
|
-
});
|
|
7450
|
-
if (opts.json || opts.jsonl) {
|
|
7451
|
-
formatOutputProto(ExperimentStatsSchema, result, opts);
|
|
7452
|
-
return;
|
|
7453
|
-
}
|
|
7454
|
-
if (!result) {
|
|
7455
|
-
console.log("No stats \u2014 experiment not found or no data in window.");
|
|
7456
|
-
return;
|
|
7457
|
-
}
|
|
7458
|
-
renderStatsTable(result);
|
|
7459
|
-
}
|
|
7460
|
-
)
|
|
7461
|
-
);
|
|
7462
|
-
experiments.command("force-assign <experimentId>").description(
|
|
7463
|
-
"Force a known identity into a specific variant (admin override)."
|
|
7464
|
-
).requiredOption("--variant <key>", "Variant key to assign").option("--customer-id <id>", "Customer identity to bucket").option(
|
|
7465
|
-
"--viewer-key <key>",
|
|
7466
|
-
"Anonymous viewer identity (cookie/localStorage value) to bucket"
|
|
7467
|
-
).action(
|
|
7468
|
-
withErrorHandler(
|
|
7469
|
-
globalOpts,
|
|
7470
|
-
async (experimentId, cmdOpts) => {
|
|
7471
|
-
const opts = globalOpts();
|
|
7472
|
-
if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
|
|
7473
|
-
throw new Error(
|
|
7474
|
-
"Provide exactly one of --customer-id or --viewer-key."
|
|
7475
|
-
);
|
|
7476
|
-
}
|
|
7477
|
-
if (cmdOpts.customerId && cmdOpts.viewerKey) {
|
|
7478
|
-
throw new Error(
|
|
7479
|
-
"Provide exactly one of --customer-id or --viewer-key, not both."
|
|
7480
|
-
);
|
|
7481
|
-
}
|
|
7482
|
-
const client = await createPlatformClient(opts);
|
|
7483
|
-
const result = await client.experiments.forceAssignExperiment(
|
|
7484
|
-
{ customerId: cmdOpts.customerId, viewerKey: cmdOpts.viewerKey },
|
|
7485
|
-
experimentId,
|
|
7486
|
-
cmdOpts.variant
|
|
7487
|
-
);
|
|
7488
|
-
if (!result) throw new Error("Force-assign returned no assignment.");
|
|
7489
|
-
formatOutputProto(ExperimentAssignmentSchema, result, opts);
|
|
7490
|
-
if (!(opts.json || opts.jsonl || opts.quiet))
|
|
7491
|
-
success(
|
|
7492
|
-
`Assigned ${cmdOpts.customerId ? "customer" : "viewer"} ${cmdOpts.customerId ?? cmdOpts.viewerKey} \u2192 ${cmdOpts.variant}`
|
|
7493
|
-
);
|
|
7494
|
-
}
|
|
7495
|
-
)
|
|
7496
|
-
);
|
|
7497
|
-
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(
|
|
7498
|
-
withErrorHandler(
|
|
7499
|
-
globalOpts,
|
|
7500
|
-
async (experimentId, cmdOpts) => {
|
|
7501
|
-
const opts = globalOpts();
|
|
7502
|
-
if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
|
|
7503
|
-
throw new Error(
|
|
7504
|
-
"Provide exactly one of --customer-id or --viewer-key."
|
|
7505
|
-
);
|
|
7506
|
-
}
|
|
7507
|
-
if (cmdOpts.customerId && cmdOpts.viewerKey) {
|
|
7508
|
-
throw new Error(
|
|
7509
|
-
"Provide exactly one of --customer-id or --viewer-key, not both."
|
|
7510
|
-
);
|
|
7511
|
-
}
|
|
7512
|
-
const client = await createPlatformClient(opts);
|
|
7513
|
-
const ok = await client.experiments.removeExperimentAssignment(
|
|
7514
|
-
{ customerId: cmdOpts.customerId, viewerKey: cmdOpts.viewerKey },
|
|
7515
|
-
experimentId
|
|
7516
|
-
);
|
|
7517
|
-
if (opts.json || opts.jsonl)
|
|
7518
|
-
formatOutput({ removed: ok, experimentId }, opts);
|
|
7519
|
-
else if (ok) success("Assignment removed");
|
|
7520
|
-
else success("No matching assignment found");
|
|
7521
|
-
}
|
|
7522
|
-
)
|
|
7523
|
-
);
|
|
7524
|
-
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(
|
|
7525
|
-
withErrorHandler(
|
|
7526
|
-
globalOpts,
|
|
7527
|
-
async (cmdOpts) => {
|
|
7528
|
-
const opts = globalOpts();
|
|
7529
|
-
if (!cmdOpts.customerId && !cmdOpts.viewerKey) {
|
|
7530
|
-
throw new Error(
|
|
7531
|
-
"Provide exactly one of --customer-id or --viewer-key."
|
|
7532
|
-
);
|
|
7533
|
-
}
|
|
7534
|
-
if (cmdOpts.customerId && cmdOpts.viewerKey) {
|
|
7535
|
-
throw new Error(
|
|
7536
|
-
"Provide exactly one of --customer-id or --viewer-key, not both."
|
|
7537
|
-
);
|
|
7538
|
-
}
|
|
7539
|
-
const client = await createPlatformClient(opts);
|
|
7540
|
-
const data = await client.experiments.getAssignments({
|
|
7541
|
-
customerId: cmdOpts.customerId,
|
|
7542
|
-
viewerKey: cmdOpts.viewerKey
|
|
7543
|
-
});
|
|
7544
|
-
formatListProto(ExperimentAssignmentSchema, data, opts, {
|
|
7545
|
-
columns: [
|
|
7546
|
-
{ key: "experimentKey", header: "Experiment", width: 24 },
|
|
7547
|
-
{ key: "variantKey", header: "Variant", width: 16 },
|
|
7548
|
-
{ key: "assignmentMethod", header: "Method", width: 10 },
|
|
7549
|
-
{
|
|
7550
|
-
key: "assignedAt",
|
|
7551
|
-
header: "Assigned",
|
|
7552
|
-
width: 12,
|
|
7553
|
-
format: (v) => timeAgo(v)
|
|
7554
|
-
}
|
|
7555
|
-
]
|
|
7556
|
-
});
|
|
7557
|
-
}
|
|
7558
|
-
)
|
|
7559
|
-
);
|
|
7560
|
-
}
|
|
7561
|
-
function collectMetric(value, accumulator) {
|
|
7562
|
-
return [...accumulator, value];
|
|
7563
|
-
}
|
|
7564
|
-
function parseMetricSpec(raw) {
|
|
7565
|
-
const eq = raw.indexOf("=");
|
|
7566
|
-
if (eq <= 0) {
|
|
7567
|
-
throw new Error(
|
|
7568
|
-
`--metric ${JSON.stringify(raw)}: expected name=path:aggregator[:goal_key]`
|
|
7569
|
-
);
|
|
7570
|
-
}
|
|
7571
|
-
const name = raw.slice(0, eq);
|
|
7572
|
-
const rest = raw.slice(eq + 1);
|
|
7573
|
-
const parts = rest.split(":");
|
|
7574
|
-
if (parts.length < 2 || parts.length > 3) {
|
|
7575
|
-
throw new Error(
|
|
7576
|
-
`--metric ${JSON.stringify(raw)}: expected path:aggregator[:goal_key] after =`
|
|
7577
|
-
);
|
|
7578
|
-
}
|
|
7579
|
-
const path3 = parts[0];
|
|
7580
|
-
const aggStr = parts[1];
|
|
7581
|
-
const goalKey = parts[2];
|
|
7582
|
-
if (!path3 || !aggStr) {
|
|
7583
|
-
throw new Error(
|
|
7584
|
-
`--metric ${JSON.stringify(raw)}: expected path:aggregator[:goal_key] after =`
|
|
7585
|
-
);
|
|
7586
|
-
}
|
|
7587
|
-
return {
|
|
7588
|
-
name,
|
|
7589
|
-
path: path3,
|
|
7590
|
-
aggregator: parseAggregator(aggStr),
|
|
7591
|
-
goalKey: goalKey || void 0
|
|
7592
|
-
};
|
|
7593
|
-
}
|
|
7594
|
-
function parseAggregator(s) {
|
|
7595
|
-
switch (s.toLowerCase()) {
|
|
7596
|
-
case "sum":
|
|
7597
|
-
return MetricAggregator3.SUM;
|
|
7598
|
-
case "avg":
|
|
7599
|
-
case "mean":
|
|
7600
|
-
return MetricAggregator3.AVG;
|
|
7601
|
-
case "count":
|
|
7602
|
-
return MetricAggregator3.COUNT;
|
|
7603
|
-
case "min":
|
|
7604
|
-
return MetricAggregator3.MIN;
|
|
7605
|
-
case "max":
|
|
7606
|
-
return MetricAggregator3.MAX;
|
|
7607
|
-
case "p50":
|
|
7608
|
-
case "median":
|
|
7609
|
-
return MetricAggregator3.P50;
|
|
7610
|
-
case "p95":
|
|
7611
|
-
return MetricAggregator3.P95;
|
|
7612
|
-
}
|
|
7613
|
-
throw new Error(
|
|
7614
|
-
`unknown aggregator ${JSON.stringify(s)}: expected one of sum, avg, count, min, max, p50, p95`
|
|
7615
|
-
);
|
|
7616
|
-
}
|
|
7617
|
-
function renderStatsTable(s) {
|
|
7618
|
-
const winFrom = s.windowFrom?.seconds ? new Date(Number(s.windowFrom.seconds) * 1e3).toISOString().slice(0, 19) : "?";
|
|
7619
|
-
const winTo = s.windowTo?.seconds ? new Date(Number(s.windowTo.seconds) * 1e3).toISOString().slice(0, 19) : "?";
|
|
7620
|
-
console.log("");
|
|
7621
|
-
console.log(`Experiment ${s.experimentKey} (id ${s.experimentId})`);
|
|
7622
|
-
console.log(
|
|
7623
|
-
`Window ${winFrom} \u2192 ${winTo} grain: ${s.dailyGrain || "day"} total assignments: ${s.totalAssignments}`
|
|
7624
|
-
);
|
|
7625
|
-
console.log("");
|
|
7626
|
-
console.log("Variants");
|
|
7627
|
-
console.log(
|
|
7628
|
-
" " + padCols(["variant", "control", "assignments", "share"], [16, 8, 12, 8])
|
|
7629
|
-
);
|
|
7630
|
-
console.log(" " + "-".repeat(48));
|
|
7631
|
-
for (const v of s.variants) {
|
|
7632
|
-
const share = s.totalAssignments > 0 ? (v.assignmentCount / s.totalAssignments * 100).toFixed(1) + "%" : "-";
|
|
7633
|
-
console.log(
|
|
7634
|
-
" " + padCols(
|
|
7635
|
-
[v.variantKey, v.isControl ? "\u2713" : "", String(v.assignmentCount), share],
|
|
7636
|
-
[16, 8, 12, 8]
|
|
7637
|
-
)
|
|
7638
|
-
);
|
|
7639
|
-
}
|
|
7640
|
-
console.log("");
|
|
7641
|
-
const familySize = familySizeOf(s);
|
|
7642
|
-
for (const goal of s.goals) {
|
|
7643
|
-
console.log(`Goal: ${goal.goalKey}${goal.isPrimary ? " (primary)" : ""}`);
|
|
7644
|
-
console.log(
|
|
7645
|
-
" " + padCols(
|
|
7646
|
-
["variant", "count", "unique", "rate", "lift", "p (raw)", "p (corr)", "sig"],
|
|
7647
|
-
[16, 8, 8, 9, 9, 10, 10, 5]
|
|
7648
|
-
)
|
|
7649
|
-
);
|
|
7650
|
-
console.log(" " + "-".repeat(75));
|
|
7651
|
-
for (const v of s.variants) {
|
|
7652
|
-
const cell = v.goalStats.find((g) => g.goalKey === goal.goalKey);
|
|
7653
|
-
if (!cell) continue;
|
|
7654
|
-
const rate = (cell.conversionRate * 100).toFixed(2) + "%";
|
|
7655
|
-
if (v.isControl) {
|
|
7656
|
-
console.log(
|
|
7657
|
-
" " + padCols(
|
|
7658
|
-
[v.variantKey, String(cell.conversionEventCount), String(cell.uniqueConverters), rate, "-", "-", "-", "-"],
|
|
7659
|
-
[16, 8, 8, 9, 9, 10, 10, 5]
|
|
7660
|
-
)
|
|
7661
|
-
);
|
|
7662
|
-
continue;
|
|
7663
|
-
}
|
|
7664
|
-
const sig = cell.significance;
|
|
7665
|
-
const rawP = sig?.pValue ?? 1;
|
|
7666
|
-
const corrP = Math.min(1, rawP * familySize);
|
|
7667
|
-
const lift = sig ? (sig.relativeLift >= 0 ? "+" : "") + (sig.relativeLift * 100).toFixed(1) + "%" : "-";
|
|
7668
|
-
const sigFlag = corrP < 0.05 && sig?.isSignificant ? "\u2713" : "";
|
|
7669
|
-
console.log(
|
|
7670
|
-
" " + padCols(
|
|
7671
|
-
[
|
|
7672
|
-
v.variantKey,
|
|
7673
|
-
String(cell.conversionEventCount),
|
|
7674
|
-
String(cell.uniqueConverters),
|
|
7675
|
-
rate,
|
|
7676
|
-
lift,
|
|
7677
|
-
rawP.toFixed(4),
|
|
7678
|
-
corrP.toFixed(4),
|
|
7679
|
-
sigFlag
|
|
7680
|
-
],
|
|
7681
|
-
[16, 8, 8, 9, 9, 10, 10, 5]
|
|
7682
|
-
)
|
|
7683
|
-
);
|
|
7684
|
-
}
|
|
7685
|
-
console.log("");
|
|
7686
|
-
}
|
|
7687
|
-
if (s.metricStats.length > 0) {
|
|
7688
|
-
const byMetric = /* @__PURE__ */ new Map();
|
|
7689
|
-
for (const m of s.metricStats) {
|
|
7690
|
-
const list = byMetric.get(m.metricName) ?? [];
|
|
7691
|
-
list.push(m);
|
|
7692
|
-
byMetric.set(m.metricName, list);
|
|
7693
|
-
}
|
|
7694
|
-
for (const [name, rows] of byMetric) {
|
|
7695
|
-
console.log(`Metric: ${name}`);
|
|
7696
|
-
console.log(
|
|
7697
|
-
" " + padCols(
|
|
7698
|
-
["variant", "value", "n", "skipped", "lift", "p", "sig"],
|
|
7699
|
-
[16, 12, 8, 8, 9, 8, 5]
|
|
7700
|
-
)
|
|
7701
|
-
);
|
|
7702
|
-
console.log(" " + "-".repeat(70));
|
|
7703
|
-
for (const m of rows) {
|
|
7704
|
-
const sig = m.significance;
|
|
7705
|
-
const lift = sig ? (sig.relativeLift >= 0 ? "+" : "") + (sig.relativeLift * 100).toFixed(1) + "%" : "-";
|
|
7706
|
-
const p = sig ? sig.pValue.toFixed(4) : "-";
|
|
7707
|
-
const sigFlag = sig?.isSignificant ? "\u2713" : "";
|
|
7708
|
-
console.log(
|
|
7709
|
-
" " + padCols(
|
|
7710
|
-
[
|
|
7711
|
-
m.variantKey,
|
|
7712
|
-
m.value.toFixed(2),
|
|
7713
|
-
String(m.sampleSize),
|
|
7714
|
-
String(m.skippedRowCount),
|
|
7715
|
-
lift,
|
|
7716
|
-
p,
|
|
7717
|
-
sigFlag
|
|
7718
|
-
],
|
|
7719
|
-
[16, 12, 8, 8, 9, 8, 5]
|
|
7720
|
-
)
|
|
7721
|
-
);
|
|
7722
|
-
}
|
|
7723
|
-
console.log("");
|
|
7724
|
-
}
|
|
7725
|
-
}
|
|
7726
|
-
const winners = winnersOnPrimary(s, familySize);
|
|
7727
|
-
if (winners.length > 0) {
|
|
7728
|
-
console.log(`Significant on primary goal (Bonferroni-corrected): ${winners.join(", ")}`);
|
|
7729
|
-
} else {
|
|
7730
|
-
console.log("No variant has reached significance on the primary goal.");
|
|
7731
|
-
}
|
|
7732
|
-
}
|
|
7733
|
-
function familySizeOf(s) {
|
|
7734
|
-
const variantCount = s.variants.filter((v) => !v.isControl).length;
|
|
7735
|
-
const goalCount = s.goals.length;
|
|
7736
|
-
return Math.max(1, variantCount * goalCount);
|
|
7737
|
-
}
|
|
7738
|
-
function winnersOnPrimary(s, familySize) {
|
|
7739
|
-
const primary = s.goals.find((g) => g.isPrimary);
|
|
7740
|
-
if (!primary) return [];
|
|
7741
|
-
const out = [];
|
|
7742
|
-
for (const v of s.variants) {
|
|
7743
|
-
if (v.isControl) continue;
|
|
7744
|
-
const cell = v.goalStats.find((g) => g.goalKey === primary.goalKey);
|
|
7745
|
-
if (!cell?.significance) continue;
|
|
7746
|
-
const corrP = Math.min(1, cell.significance.pValue * familySize);
|
|
7747
|
-
if (corrP < 0.05 && cell.significance.isSignificant) {
|
|
7748
|
-
out.push(v.variantKey);
|
|
7749
|
-
}
|
|
7750
|
-
}
|
|
7751
|
-
return out;
|
|
7752
|
-
}
|
|
7753
|
-
function padCols(values, widths) {
|
|
7754
|
-
return values.map((v, i) => {
|
|
7755
|
-
const w = widths[i] ?? 12;
|
|
7756
|
-
const s = v ?? "";
|
|
7757
|
-
if (s.length >= w) return s.slice(0, w);
|
|
7758
|
-
return s + " ".repeat(w - s.length);
|
|
7759
|
-
}).join(" ");
|
|
7760
|
-
}
|
|
7761
|
-
|
|
7762
7153
|
// src/commands/schedules.ts
|
|
7763
7154
|
import { CronScheduleSchema } from "@eide/foir-proto-ts/schedules/v1/schedules_pb";
|
|
7764
7155
|
function registerSchedulesCommands(program2, globalOpts) {
|
|
@@ -9584,7 +8975,6 @@ registerCustomersCommands(program, getGlobalOpts);
|
|
|
9584
8975
|
registerCustomerProfilesCommands(program, getGlobalOpts);
|
|
9585
8976
|
registerOperationsCommands(program, getGlobalOpts);
|
|
9586
8977
|
registerSegmentsCommands(program, getGlobalOpts);
|
|
9587
|
-
registerExperimentsCommands(program, getGlobalOpts);
|
|
9588
8978
|
registerSchedulesCommands(program, getGlobalOpts);
|
|
9589
8979
|
registerApiKeysCommands(program, getGlobalOpts);
|
|
9590
8980
|
registerAuthProvidersCommands(program, getGlobalOpts);
|