@kici-dev/shared 0.1.23 → 0.1.25
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/cold-store/bucket.js +1 -1
- package/dist/cold-store/chunk-encoder.js +1 -1
- package/dist/cold-store/chunk-id.js +1 -1
- package/dist/cold-store/cold-store.js +1 -1
- package/dist/cold-store/config.js +1 -1
- package/dist/cold-store/index.js +1 -1
- package/dist/cold-store/key.js +1 -1
- package/dist/cold-store/lru.js +1 -1
- package/dist/cold-store/manifest.js +1 -1
- package/dist/cold-store/metrics.js +1 -1
- package/dist/cold-store/table-adapter.js +1 -1
- package/dist/cold-store/types.js +1 -1
- package/dist/db-admin.d.ts +53 -0
- package/dist/db-admin.js +114 -6
- package/dist/db-collation.js +1 -1
- package/dist/db.js +1 -1
- package/dist/diagnostics/bundle-archive.js +2 -2
- package/dist/diagnostics/bundle-chunks.js +1 -1
- package/dist/env/allowlist.js +1 -1
- package/dist/env/define-env.js +2 -2
- package/dist/env/index.js +1 -1
- package/dist/env/logger-env.js +1 -1
- package/dist/graceful-shutdown.js +1 -1
- package/dist/idempotency-env-diff.js +2 -2
- package/dist/idempotency-files.js +1 -1
- package/dist/idempotency-yaml-diff.js +2 -2
- package/dist/idempotency.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -3
- package/dist/package-manager-types.js +1 -1
- package/dist/package-manager.js +1 -1
- package/dist/pg-errors.d.ts +8 -0
- package/dist/pg-errors.js +21 -0
- package/dist/pg-errors.test.d.ts +2 -0
- package/dist/reconnect-delay.js +1 -1
- package/dist/ring-buffer.js +1 -1
- package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
- package/dist/routes/health.js +1 -1
- package/dist/routes/metrics.js +1 -1
- package/dist/s3-client.js +1 -1
- package/dist/secret-crypto.d.ts +49 -0
- package/dist/secret-crypto.js +92 -0
- package/dist/secret-crypto.test.d.ts +2 -0
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/init.js +1 -1
- package/dist/telemetry/metrics.js +1 -1
- package/dist/tool-check.js +1 -1
- package/dist/ts-loader-hook.js +1 -1
- package/package.json +6 -2
- package/sbom.spdx.json +15 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { createS3Client } from "../s3-client.js";
|
|
3
3
|
import { chunkObjectKey, encodeKeySegment, tablePrefix, tenantDayPrefix } from "./key.js";
|
|
4
4
|
import { coldDaysToBucket, isLongerColdRetention } from "./bucket.js";
|
package/dist/cold-store/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { chunkObjectKey, encodeKeySegment, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix } from "./key.js";
|
|
3
3
|
import { COLD_BUCKET_NAMES, coldDaysToBucket, isLongerColdRetention } from "./bucket.js";
|
|
4
4
|
import { computeChunkId } from "./chunk-id.js";
|
package/dist/cold-store/key.js
CHANGED
package/dist/cold-store/lru.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/cold-store/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
export {};
|
package/dist/db-admin.d.ts
CHANGED
|
@@ -177,6 +177,22 @@ export declare function purgeStaleSourcesDirect(databaseUrl: string, routingKey:
|
|
|
177
177
|
export declare function purgeScopedSecretsDirect(databaseUrl: string, orgId?: string): Promise<{
|
|
178
178
|
deleted: number;
|
|
179
179
|
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Bulk-delete `environments` (and their FK-dependent rows) for an org, or for
|
|
182
|
+
* every org when `orgId` is omitted. `environment_bindings` /
|
|
183
|
+
* `environment_variables` / `environment_source_overrides` cascade
|
|
184
|
+
* automatically (ON DELETE CASCADE). `held_runs` and `execution_runs` reference
|
|
185
|
+
* `environments(id)` with ON DELETE SET NULL, so deleting environments alone
|
|
186
|
+
* would leave orphaned `held_runs` rows carrying a null environment reference;
|
|
187
|
+
* this helper deletes the org's `held_runs` too so a warm-start reset gets a
|
|
188
|
+
* clean slate. Runs in a transaction so both deletes commit atomically. Used by
|
|
189
|
+
* the E2E warm-start reset (so seeded environments don't leak between
|
|
190
|
+
* categories) and exposed via `kici-admin environment purge`.
|
|
191
|
+
*/
|
|
192
|
+
export declare function purgeEnvironmentsDirect(databaseUrl: string, orgId?: string): Promise<{
|
|
193
|
+
environmentsDeleted: number;
|
|
194
|
+
heldRunsDeleted: number;
|
|
195
|
+
}>;
|
|
180
196
|
export interface SeedEnvironmentOpts {
|
|
181
197
|
orgId: string;
|
|
182
198
|
name: string;
|
|
@@ -403,6 +419,8 @@ export interface ExecutionJobRow {
|
|
|
403
419
|
duration_ms: number | null;
|
|
404
420
|
created_at: string;
|
|
405
421
|
error_message: string | null;
|
|
422
|
+
/** Ordered bound deployment-environment names (JSON-encoded `string[]`), or null. */
|
|
423
|
+
environments: string | null;
|
|
406
424
|
}
|
|
407
425
|
export interface ListExecutionRunsOpts {
|
|
408
426
|
routingKey?: string;
|
|
@@ -1004,6 +1022,41 @@ export declare function deleteKiciEventsDirect(databaseUrl: string, opts: {
|
|
|
1004
1022
|
}): Promise<{
|
|
1005
1023
|
deleted: number;
|
|
1006
1024
|
}>;
|
|
1025
|
+
/**
|
|
1026
|
+
* INSERT a kici_events row with an explicit created_at. Lets a test place
|
|
1027
|
+
* many events on the exact same timestamp so the catch-up keyset cursor's
|
|
1028
|
+
* same-created_at tie handling is genuinely exercised (the default-NOW insert
|
|
1029
|
+
* path cannot force ties deterministically). Returns the inserted id.
|
|
1030
|
+
*/
|
|
1031
|
+
export declare function insertKiciEventAtDirect(databaseUrl: string, opts: {
|
|
1032
|
+
eventName: string;
|
|
1033
|
+
createdAt: Date;
|
|
1034
|
+
payload?: Record<string, unknown>;
|
|
1035
|
+
chainDepth?: number;
|
|
1036
|
+
sourceRoutingKey?: string | null;
|
|
1037
|
+
expiresIn?: string;
|
|
1038
|
+
}): Promise<{
|
|
1039
|
+
id: string;
|
|
1040
|
+
}>;
|
|
1041
|
+
/**
|
|
1042
|
+
* Page through unprocessed, non-DLQ kici_events for a given event_name using
|
|
1043
|
+
* the same composite `(created_at, id)` keyset cursor + `ORDER BY created_at
|
|
1044
|
+
* ASC, id ASC` that EventStore.getUnprocessedSince runs. Keep this SQL in sync
|
|
1045
|
+
* with `packages/orchestrator/src/events/event-store.ts`.
|
|
1046
|
+
*
|
|
1047
|
+
* Returns every id seen across all pages in traversal order (with duplicates
|
|
1048
|
+
* preserved so the caller can assert none occur) plus the page count. This is
|
|
1049
|
+
* the real-Postgres guard that the keyset cursor pages the entire backlog —
|
|
1050
|
+
* including same-created_at ties across a page boundary — with no skip and no
|
|
1051
|
+
* duplicate.
|
|
1052
|
+
*/
|
|
1053
|
+
export declare function paginateUnprocessedEventsKeysetDirect(databaseUrl: string, opts: {
|
|
1054
|
+
eventName: string;
|
|
1055
|
+
batchSize?: number;
|
|
1056
|
+
}): Promise<{
|
|
1057
|
+
ids: string[];
|
|
1058
|
+
pages: number;
|
|
1059
|
+
}>;
|
|
1007
1060
|
/**
|
|
1008
1061
|
* Simulate a NOTIFY on `kici_event_channel` and verify a LISTEN client
|
|
1009
1062
|
* receives it. Used by event-routing e2e to prove the infrastructure
|
package/dist/db-admin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { createPool } from "./db.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import pg from "pg";
|
|
@@ -341,11 +341,45 @@ async function purgeScopedSecretsDirect(databaseUrl, orgId) {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
|
+
* Bulk-delete `environments` (and their FK-dependent rows) for an org, or for
|
|
345
|
+
* every org when `orgId` is omitted. `environment_bindings` /
|
|
346
|
+
* `environment_variables` / `environment_source_overrides` cascade
|
|
347
|
+
* automatically (ON DELETE CASCADE). `held_runs` and `execution_runs` reference
|
|
348
|
+
* `environments(id)` with ON DELETE SET NULL, so deleting environments alone
|
|
349
|
+
* would leave orphaned `held_runs` rows carrying a null environment reference;
|
|
350
|
+
* this helper deletes the org's `held_runs` too so a warm-start reset gets a
|
|
351
|
+
* clean slate. Runs in a transaction so both deletes commit atomically. Used by
|
|
352
|
+
* the E2E warm-start reset (so seeded environments don't leak between
|
|
353
|
+
* categories) and exposed via `kici-admin environment purge`.
|
|
354
|
+
*/
|
|
355
|
+
async function purgeEnvironmentsDirect(databaseUrl, orgId) {
|
|
356
|
+
const pool = createPool(databaseUrl);
|
|
357
|
+
const client = await pool.connect();
|
|
358
|
+
try {
|
|
359
|
+
await client.query("BEGIN");
|
|
360
|
+
const where = orgId ? "WHERE org_id = $1" : "";
|
|
361
|
+
const params = orgId ? [orgId] : [];
|
|
362
|
+
const held = await client.query(`DELETE FROM held_runs ${where}`, params);
|
|
363
|
+
const envs = await client.query(`DELETE FROM environments ${where}`, params);
|
|
364
|
+
await client.query("COMMIT");
|
|
365
|
+
return {
|
|
366
|
+
environmentsDeleted: envs.rowCount ?? 0,
|
|
367
|
+
heldRunsDeleted: held.rowCount ?? 0
|
|
368
|
+
};
|
|
369
|
+
} catch (err) {
|
|
370
|
+
await client.query("ROLLBACK").catch(() => void 0);
|
|
371
|
+
throw err;
|
|
372
|
+
} finally {
|
|
373
|
+
client.release();
|
|
374
|
+
await pool.end();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
344
378
|
* Allowed policy field names for `setEnvironmentPolicyDirect`. Kept as an
|
|
345
379
|
* explicit allowlist so the column-name interpolation in the UPDATE string
|
|
346
380
|
* can never be driven by unsanitised caller input.
|
|
347
381
|
*/
|
|
348
|
-
const ENV_POLICY_COLUMNS = new Set([
|
|
382
|
+
const ENV_POLICY_COLUMNS = /* @__PURE__ */ new Set([
|
|
349
383
|
"branch_restrictions",
|
|
350
384
|
"required_reviewers",
|
|
351
385
|
"wait_timer_seconds",
|
|
@@ -782,7 +816,7 @@ async function showExecutionRunDirect(databaseUrl, opts) {
|
|
|
782
816
|
return {
|
|
783
817
|
run,
|
|
784
818
|
jobs: (await pool.query(`SELECT id, run_id, job_id, job_name, status, agent_id,
|
|
785
|
-
started_at, completed_at, duration_ms, created_at, error_message
|
|
819
|
+
started_at, completed_at, duration_ms, created_at, error_message, environments
|
|
786
820
|
FROM execution_jobs
|
|
787
821
|
WHERE run_id = $1
|
|
788
822
|
ORDER BY created_at ASC`, [run.run_id])).rows
|
|
@@ -799,7 +833,8 @@ async function listExecutionJobsDirect(databaseUrl, opts) {
|
|
|
799
833
|
const pool = createPool(databaseUrl);
|
|
800
834
|
try {
|
|
801
835
|
return { jobs: (await pool.query(`SELECT j.id, j.run_id, j.job_id, j.job_name, j.status, j.agent_id,
|
|
802
|
-
j.started_at, j.completed_at, j.duration_ms, j.created_at, j.error_message
|
|
836
|
+
j.started_at, j.completed_at, j.duration_ms, j.created_at, j.error_message,
|
|
837
|
+
j.environments
|
|
803
838
|
FROM execution_jobs j
|
|
804
839
|
INNER JOIN execution_runs r ON r.run_id = j.run_id
|
|
805
840
|
WHERE r.run_id::text = $1 OR r.id::text = $1
|
|
@@ -889,7 +924,7 @@ async function showRegistrationDirect(databaseUrl, opts) {
|
|
|
889
924
|
* Duplicated here intentionally so the helper has no runtime dependency on
|
|
890
925
|
* the engine package.
|
|
891
926
|
*/
|
|
892
|
-
const REGISTERABLE_TRIGGER_TYPES = new Set([
|
|
927
|
+
const REGISTERABLE_TRIGGER_TYPES = /* @__PURE__ */ new Set([
|
|
893
928
|
"push",
|
|
894
929
|
"pr",
|
|
895
930
|
"pull_request",
|
|
@@ -1848,6 +1883,79 @@ async function deleteKiciEventsDirect(databaseUrl, opts) {
|
|
|
1848
1883
|
}
|
|
1849
1884
|
}
|
|
1850
1885
|
/**
|
|
1886
|
+
* INSERT a kici_events row with an explicit created_at. Lets a test place
|
|
1887
|
+
* many events on the exact same timestamp so the catch-up keyset cursor's
|
|
1888
|
+
* same-created_at tie handling is genuinely exercised (the default-NOW insert
|
|
1889
|
+
* path cannot force ties deterministically). Returns the inserted id.
|
|
1890
|
+
*/
|
|
1891
|
+
async function insertKiciEventAtDirect(databaseUrl, opts) {
|
|
1892
|
+
const expiresIn = opts.expiresIn ?? "7 days";
|
|
1893
|
+
const pool = createPool(databaseUrl);
|
|
1894
|
+
try {
|
|
1895
|
+
return { id: (await pool.query(`INSERT INTO kici_events
|
|
1896
|
+
(event_name, payload, source_routing_key, chain_depth, processed, created_at, expires_at)
|
|
1897
|
+
VALUES ($1, $2::jsonb, $3, $4, false, $5::timestamptz, NOW() + ($6)::interval)
|
|
1898
|
+
RETURNING id`, [
|
|
1899
|
+
opts.eventName,
|
|
1900
|
+
JSON.stringify(opts.payload ?? {}),
|
|
1901
|
+
opts.sourceRoutingKey ?? null,
|
|
1902
|
+
opts.chainDepth ?? 0,
|
|
1903
|
+
opts.createdAt.toISOString(),
|
|
1904
|
+
expiresIn
|
|
1905
|
+
])).rows[0].id };
|
|
1906
|
+
} finally {
|
|
1907
|
+
await pool.end();
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Page through unprocessed, non-DLQ kici_events for a given event_name using
|
|
1912
|
+
* the same composite `(created_at, id)` keyset cursor + `ORDER BY created_at
|
|
1913
|
+
* ASC, id ASC` that EventStore.getUnprocessedSince runs. Keep this SQL in sync
|
|
1914
|
+
* with `packages/orchestrator/src/events/event-store.ts`.
|
|
1915
|
+
*
|
|
1916
|
+
* Returns every id seen across all pages in traversal order (with duplicates
|
|
1917
|
+
* preserved so the caller can assert none occur) plus the page count. This is
|
|
1918
|
+
* the real-Postgres guard that the keyset cursor pages the entire backlog —
|
|
1919
|
+
* including same-created_at ties across a page boundary — with no skip and no
|
|
1920
|
+
* duplicate.
|
|
1921
|
+
*/
|
|
1922
|
+
async function paginateUnprocessedEventsKeysetDirect(databaseUrl, opts) {
|
|
1923
|
+
const batchSize = Math.max(1, Math.min(1e4, opts.batchSize ?? 100));
|
|
1924
|
+
const pool = createPool(databaseUrl);
|
|
1925
|
+
try {
|
|
1926
|
+
const ids = [];
|
|
1927
|
+
let cursor = null;
|
|
1928
|
+
let pages = 0;
|
|
1929
|
+
for (;;) {
|
|
1930
|
+
const params = [opts.eventName];
|
|
1931
|
+
let cursorClause = "";
|
|
1932
|
+
if (cursor) {
|
|
1933
|
+
cursorClause = `AND (created_at, id) > ($2::timestamptz, $3::uuid)`;
|
|
1934
|
+
params.push(cursor.createdAt, cursor.id);
|
|
1935
|
+
}
|
|
1936
|
+
const { rows } = await pool.query(`SELECT id, created_at FROM kici_events
|
|
1937
|
+
WHERE event_name = $1 AND processed = false AND dlq_at IS NULL ${cursorClause}
|
|
1938
|
+
ORDER BY created_at ASC, id ASC
|
|
1939
|
+
LIMIT ${batchSize}`, params);
|
|
1940
|
+
if (rows.length === 0) break;
|
|
1941
|
+
pages += 1;
|
|
1942
|
+
for (const r of rows) ids.push(r.id);
|
|
1943
|
+
const last = rows[rows.length - 1];
|
|
1944
|
+
cursor = {
|
|
1945
|
+
createdAt: new Date(last.created_at).toISOString(),
|
|
1946
|
+
id: last.id
|
|
1947
|
+
};
|
|
1948
|
+
if (rows.length < batchSize) break;
|
|
1949
|
+
}
|
|
1950
|
+
return {
|
|
1951
|
+
ids,
|
|
1952
|
+
pages
|
|
1953
|
+
};
|
|
1954
|
+
} finally {
|
|
1955
|
+
await pool.end();
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1851
1959
|
* Simulate a NOTIFY on `kici_event_channel` and verify a LISTEN client
|
|
1852
1960
|
* receives it. Used by event-routing e2e to prove the infrastructure
|
|
1853
1961
|
* the EventRouter uses for real-time delivery is functional. Owns the
|
|
@@ -2646,6 +2754,6 @@ async function terminateIdleDbBackendsDirect(databaseUrl) {
|
|
|
2646
2754
|
}
|
|
2647
2755
|
}
|
|
2648
2756
|
//#endregion
|
|
2649
|
-
export { MIGRATION_HASH_TABLE, PROVIDER_HASH_KEY, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
|
|
2757
|
+
export { MIGRATION_HASH_TABLE, PROVIDER_HASH_KEY, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventAtDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, paginateUnprocessedEventsKeysetDirect, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeEnvironmentsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
|
|
2650
2758
|
|
|
2651
2759
|
//# sourceMappingURL=db-admin.js.map
|
package/dist/db-collation.js
CHANGED
package/dist/db.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
//#region src/diagnostics/bundle-archive.ts
|
|
@@ -16,7 +16,7 @@ const MAX_LOG_BYTES = 50 * 1024 * 1024;
|
|
|
16
16
|
* Config field names that are safe to include unredacted.
|
|
17
17
|
* Everything else gets replaced with "****".
|
|
18
18
|
*/
|
|
19
|
-
const SAFE_CONFIG_KEYS = new Set([
|
|
19
|
+
const SAFE_CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
20
20
|
"mode",
|
|
21
21
|
"host",
|
|
22
22
|
"port",
|
package/dist/env/allowlist.js
CHANGED
package/dist/env/define-env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
//#region src/env/define-env.ts
|
|
3
3
|
/** Read an env value following the alias precedence (first non-undefined wins). */
|
|
4
4
|
function readEnv(envMap, env) {
|
|
@@ -284,7 +284,7 @@ const RESERVED_NON_SCHEMA_KICI_SUFFIXES = ["_ENV_PROBE"];
|
|
|
284
284
|
* `warnOnly: true`) to downgrade to a warning during local development.
|
|
285
285
|
*/
|
|
286
286
|
function validateUnknownKiciVars(known, options = {}, env = process.env) {
|
|
287
|
-
const knownSet = new Set([
|
|
287
|
+
const knownSet = /* @__PURE__ */ new Set([
|
|
288
288
|
...known,
|
|
289
289
|
...options.extraKnown ?? [],
|
|
290
290
|
...RESERVED_NON_SCHEMA_KICI_VARS
|
package/dist/env/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { RESERVED_NON_SCHEMA_KICI_PREFIXES, RESERVED_NON_SCHEMA_KICI_VARS, defineEnv, validateUnknownKiciVars } from "./define-env.js";
|
|
3
3
|
import { LOGGER_ENV_FIELD_SPECS, LOGGER_ENV_VARS, LoggerEnvSchema } from "./logger-env.js";
|
|
4
4
|
export { LOGGER_ENV_FIELD_SPECS, LOGGER_ENV_VARS, LoggerEnvSchema, RESERVED_NON_SCHEMA_KICI_PREFIXES, RESERVED_NON_SCHEMA_KICI_VARS, defineEnv, validateUnknownKiciVars };
|
package/dist/env/logger-env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
//#region src/idempotency-env-diff.ts
|
|
3
3
|
/**
|
|
4
4
|
* Env-file semantic diff for the idempotent-step preview path.
|
|
@@ -60,7 +60,7 @@ function diffEnvFiles(local, remote) {
|
|
|
60
60
|
const localMap = parseEnvLines(local);
|
|
61
61
|
const remoteMap = parseEnvLines(remote);
|
|
62
62
|
const entries = [];
|
|
63
|
-
const keys = new Set([...localMap.keys(), ...remoteMap.keys()]);
|
|
63
|
+
const keys = /* @__PURE__ */ new Set([...localMap.keys(), ...remoteMap.keys()]);
|
|
64
64
|
for (const key of keys) {
|
|
65
65
|
const inLocal = localMap.has(key);
|
|
66
66
|
const inRemote = remoteMap.has(key);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { setYamlDiffRenderer } from "./idempotency-files.js";
|
|
3
3
|
import { parse } from "yaml";
|
|
4
4
|
//#region src/idempotency-yaml-diff.ts
|
|
@@ -89,7 +89,7 @@ function walkDiff(path, local, remote, out) {
|
|
|
89
89
|
if (lObj && rObj) {
|
|
90
90
|
const lRec = local;
|
|
91
91
|
const rRec = remote;
|
|
92
|
-
const keys = new Set([...Object.keys(lRec), ...Object.keys(rRec)]);
|
|
92
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(lRec), ...Object.keys(rRec)]);
|
|
93
93
|
for (const key of keys) walkDiff(path === "" ? key : `${path}.${key}`, lRec[key], rRec[key], out);
|
|
94
94
|
return;
|
|
95
95
|
}
|
package/dist/idempotency.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from '@kici-dev/core';
|
|
2
|
+
export { encrypt, decrypt, deriveKey, generateMasterKey, type EncryptedValue, } from './secret-crypto.js';
|
|
2
3
|
export { RingBuffer } from './ring-buffer.js';
|
|
3
4
|
export { redactConfig, addLogsToArchive, MAX_LOG_BYTES } from './diagnostics/bundle-archive.js';
|
|
4
5
|
export { chunkBuffer, BundleChunkAssembler, ChunkRequestWaiter, FLEET_CHUNK_BYTES, type BundleChunkFrame, } from './diagnostics/bundle-chunks.js';
|
|
5
6
|
export { createPool, createDb, type CreatePoolOptions, type PgPoolErrorSource } from './db.js';
|
|
6
|
-
export {
|
|
7
|
+
export { isPgUniqueViolation } from './pg-errors.js';
|
|
8
|
+
export { parseDatabaseUrl, maskDatabaseUrl, dropAndCreateDatabase, dropDatabaseDirect, ensureDatabase, type EnsureDatabaseOpts, createDbRole, createReadOnlyDbUser, computeMigrationsHash, storeMigrationContentHash, readStoredMigrationContentHash, isSchemaCurrent, clearDispatchQueueDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, purgeScopedSecretsDirect, purgeEnvironmentsDirect, seedEnvironmentDirect, deleteEnvironmentDirect, seedEnvironmentBindingDirect, setEnvironmentPolicyDirect, listEnvironmentsDirect, showEnvironmentDirect, createEnvironmentTemplateDirect, setEnvironmentSecretDirect, listQueueDirect, showQueueEntryDirect, listExecutionRunsDirect, showExecutionRunDirect, listExecutionJobsDirect, listRegistrationsDirect, showRegistrationDirect, registerWorkflowManualDirect, resetRaftStateDirect, emitKiciEventDirect, seedGenericWebhookSourceDirect, purgeSecretBackendsDirect, apiKeyExistsDirect, seedApiKeyInlineDirect, platformConnectionExistsDirect, countWebhookSourcesByConnectionIdDirect, getWebhookSourceByRoutingKeyDirect, findAnyUserApiKeyIdDirect, seedSyntheticGithubSourceDirect, seedWebhookSecretDirect, seedSourcePrivateKeyDirect, bumpRegistryVersionDirect, pollKiciEventsDirect, waitForPostgresDirect, waitForRunCompletionDirect, cleanupExecutionRowsDirect, isSchemaCurrentFromFilesDirect, storeMigrationContentHashInTableDirect, createJoinTokenDirect, deleteJoinTokensByCreatedByDirect, updateSourceRoutingKeyDirect, prunePeerCredentialsDirect, waitForPlatformRegistrationsDirect, seedUniversalGitSourceDirect, seedCiSecurityFixturesDirect, waitForExecutionRunStatusSinceDirect, latestExecutionRunByStatusDirect, waitForLatestExecutionJobStatusDirect, describeTableColumnsDirect, tableExistsDirect, insertKiciEventRawDirect, showKiciEventDirect, listKiciEventsDirect, deleteKiciEventsDirect, insertKiciEventAtDirect, paginateUnprocessedEventsKeysetDirect, verifyKiciEventNotifyDirect, seedCrossRepoTrustDirect, listCrossRepoTrustBySourceRoutingKeyDirect, deleteCrossRepoTrustDirect, insertCrossRepoTrustStrictDirect, deleteWorkflowRegistrationsDirect, getWorkflowRegistrationByIdDirect, listRegistrationsByRoutingKeyDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, updateWorkflowRegistrationCommitShaDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, getRegistryVersionDirect, bumpRegistryVersionSimpleDirect, upsertCronLastFiredDirect, countCronLastFiredDirect, insertCronLastFiredNowDirect, deleteCronLastFiredDirect, deleteExecutionRunsByWorkflowNameDirect, getGenericWebhookSourceByRoutingKeyDirect, listActiveGenericWebhookSourcesDirect, updateGenericWebhookVerificationConfigDirect, deleteGenericWebhookSourcesByNameDirect, restoreSoftDeletedGenericWebhookSourceDirect, upsertOrgSettingsGlobalWorkflowsDirect, updateOrgSettingsDeniedReposDirect, deleteOrgSettingsByCustomerIdDirect, getExecutionRunSecurityDirect, getHeldRunByIdDirect, listHeldRunApprovalsDirect, countHeldRunsByRunIdDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForEventLogRowByDeliveryIdDirect, resolvePlatformWebhookSourceRoutingKeyDirect, ensureOrgOwnerMemberDirect, deletePeerCredentialsByInstanceIdLikeDirect, insertPeerCredentialExpiredDirect, getPeerCredentialRevokedAtDirect, listActivePeerCredentialsExcludingDirect, clearPeerCredentialsRevokedAtByIdsDirect, countActivePeerCredentialsByInstanceDirect, terminateIdleDbBackendsDirect, type ColumnInfo, type KiciEventRow, type CrossRepoTrustRow, type WorkflowRegistrationFullRow, type RegistrationsScopedResult, type LatestExecutionRunResult, type WaitForLatestJobResult, type ExecutionRunSecurityRow, type HeldRunSecurityRow, type EventLogRow as PlatformEventLogRow, type UpsertOrgSettingsOpts, type OrgSettingsRepoPatternEntry, type InsertKiciEventRawOpts, type EmitKiciEventOpts, type SeedGenericWebhookSourceOpts, REGISTERABLE_TRIGGER_TYPES, MIGRATION_HASH_TABLE, type PurgeStaleExecutionResult, type PurgeStaleSourcesResult, type SeedEnvironmentOpts, type SeedEnvironmentResult, type SeedEnvironmentBindingOpts, type SetEnvironmentPolicyOpts, type EnvironmentRow, type EnvironmentVariableRow, type EnvironmentBindingRow, type ShowEnvironmentResult, type CreateEnvironmentTemplateOpts, type SetEnvironmentSecretOpts, type DispatchQueueRow, type ListQueueOpts, type ExecutionRunRow, type ExecutionJobRow, type ListExecutionRunsOpts, type WorkflowRegistrationRow, type ListRegistrationsOpts, type ListRegistrationsResult, type ShowRegistrationResult, type RegisterWorkflowManualOpts, type RegisterWorkflowManualResult, } from './db-admin.js';
|
|
7
9
|
export { createMetricsRoutes, type MetricsRoutesDeps } from './routes/metrics.js';
|
|
8
10
|
export { createHealthRoutes, type HealthRoutesDeps } from './routes/health.js';
|
|
9
11
|
export { getReconnectDelay } from './reconnect-delay.js';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { createDb, createPool } from "./db.js";
|
|
3
|
-
import { MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect } from "./db-admin.js";
|
|
3
|
+
import { MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDbRole, createEnvironmentTemplateDirect, createJoinTokenDirect, createReadOnlyDbUser, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventAtDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, paginateUnprocessedEventsKeysetDirect, parseDatabaseUrl, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeEnvironmentsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect } from "./db-admin.js";
|
|
4
4
|
import { setupGracefulShutdown } from "./graceful-shutdown.js";
|
|
5
|
+
import { decrypt, deriveKey, encrypt, generateMasterKey } from "./secret-crypto.js";
|
|
5
6
|
import { RingBuffer } from "./ring-buffer.js";
|
|
6
7
|
import { MAX_LOG_BYTES, addLogsToArchive, redactConfig } from "./diagnostics/bundle-archive.js";
|
|
7
8
|
import { BundleChunkAssembler, ChunkRequestWaiter, FLEET_CHUNK_BYTES, chunkBuffer } from "./diagnostics/bundle-chunks.js";
|
|
9
|
+
import { isPgUniqueViolation } from "./pg-errors.js";
|
|
8
10
|
import { createMetricsRoutes } from "./routes/metrics.js";
|
|
9
11
|
import { createHealthRoutes } from "./routes/health.js";
|
|
10
12
|
import { getReconnectDelay } from "./reconnect-delay.js";
|
|
@@ -24,4 +26,4 @@ import { ChunkLru } from "./cold-store/lru.js";
|
|
|
24
26
|
import { DEFAULT_TABLE_CONFIG, resolveTableConfig } from "./cold-store/config.js";
|
|
25
27
|
import "./cold-store/index.js";
|
|
26
28
|
export * from "@kici-dev/core";
|
|
27
|
-
export { BaseColdStore, BundleChunkAssembler, COLD_BUCKET_NAMES, ChunkLru, ChunkRequestWaiter, DEFAULT_TABLE_CONFIG, FLEET_CHUNK_BYTES, MAX_LOG_BYTES, MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, RingBuffer, addLogsToArchive, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, chunkBuffer, chunkObjectKey, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, coldDaysToBucket, coldStoreArchiveBytesTotal, coldStoreArchiveCyclesTotal, coldStoreArchiveDurationSeconds, coldStoreArchiveRowsTotal, coldStorePurgeBytesTotal, coldStorePurgeChunksTotal, coldStorePurgeDurationSeconds, coldStoreRehydrateBytesTotal, coldStoreRehydrateDurationSeconds, coldStoreRehydrateRequestsTotal, coldStoreReplayDurationSeconds, coldStoreReplayRowsTotal, coldStoreVerifyFailuresTotal, collectRuntimeMetricNames, computeChunkId, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDb, createDbRole, createEnvironmentTemplateDirect, createHealthRoutes, createJoinTokenDirect, createMeter, createMetricsRoutes, createPool, createReadOnlyDbUser, createS3Client, decodeChunk, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, encodeChunk, encodeKeySegment, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getPrometheusExporter, getReconnectDelay, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, initTelemetry, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isLongerColdRetention, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, parseDatabaseUrl, parseManifest, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, redactConfig, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, resolveTableConfig, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, serializeManifest, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, setupGracefulShutdown, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, validateRequiredTools, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
|
|
29
|
+
export { BaseColdStore, BundleChunkAssembler, COLD_BUCKET_NAMES, ChunkLru, ChunkRequestWaiter, DEFAULT_TABLE_CONFIG, FLEET_CHUNK_BYTES, MAX_LOG_BYTES, MIGRATION_HASH_TABLE, REGISTERABLE_TRIGGER_TYPES, RingBuffer, addLogsToArchive, apiKeyExistsDirect, bumpRegistryVersionDirect, bumpRegistryVersionSimpleDirect, chunkBuffer, chunkObjectKey, cleanupExecutionRowsDirect, clearDispatchQueueDirect, clearPeerCredentialsRevokedAtByIdsDirect, coldDaysToBucket, coldStoreArchiveBytesTotal, coldStoreArchiveCyclesTotal, coldStoreArchiveDurationSeconds, coldStoreArchiveRowsTotal, coldStorePurgeBytesTotal, coldStorePurgeChunksTotal, coldStorePurgeDurationSeconds, coldStoreRehydrateBytesTotal, coldStoreRehydrateDurationSeconds, coldStoreRehydrateRequestsTotal, coldStoreReplayDurationSeconds, coldStoreReplayRowsTotal, coldStoreVerifyFailuresTotal, collectRuntimeMetricNames, computeChunkId, computeMigrationsHash, countActivePeerCredentialsByInstanceDirect, countCronLastFiredDirect, countHeldRunsByRunIdDirect, countWebhookSourcesByConnectionIdDirect, createDb, createDbRole, createEnvironmentTemplateDirect, createHealthRoutes, createJoinTokenDirect, createMeter, createMetricsRoutes, createPool, createReadOnlyDbUser, createS3Client, decodeChunk, decrypt, deleteCronLastFiredDirect, deleteCrossRepoTrustDirect, deleteEnvironmentDirect, deleteExecutionRunsByWorkflowNameDirect, deleteGenericWebhookSourcesByNameDirect, deleteJoinTokensByCreatedByDirect, deleteKiciEventsDirect, deleteOrgSettingsByCustomerIdDirect, deletePeerCredentialsByInstanceIdLikeDirect, deleteWorkflowRegistrationsDirect, deriveKey, describeTableColumnsDirect, dropAndCreateDatabase, dropDatabaseDirect, emitKiciEventDirect, encodeChunk, encodeKeySegment, encrypt, ensureDatabase, ensureOrgOwnerMemberDirect, findAnyUserApiKeyIdDirect, generateMasterKey, getExecutionRunSecurityDirect, getGenericWebhookSourceByRoutingKeyDirect, getHeldRunByIdDirect, getPeerCredentialRevokedAtDirect, getPrometheusExporter, getReconnectDelay, getRegistryVersionDirect, getWebhookSourceByRoutingKeyDirect, getWorkflowRegistrationByIdDirect, initTelemetry, insertCronLastFiredNowDirect, insertCrossRepoTrustStrictDirect, insertKiciEventAtDirect, insertKiciEventRawDirect, insertPeerCredentialExpiredDirect, insertWorkflowRegistrationRawDirect, insertWorkflowRegistrationStrictDirect, isLongerColdRetention, isPgUniqueViolation, isSchemaCurrent, isSchemaCurrentFromFilesDirect, latestExecutionRunByStatusDirect, listActiveGenericWebhookSourcesDirect, listActivePeerCredentialsExcludingDirect, listCrossRepoTrustBySourceRoutingKeyDirect, listEnvironmentsDirect, listExecutionJobsDirect, listExecutionRunsDirect, listHeldRunApprovalsDirect, listKiciEventsDirect, listQueueDirect, listRegistrationsByRoutingKeyDirect, listRegistrationsDirect, maskDatabaseUrl, paginateUnprocessedEventsKeysetDirect, parseDatabaseUrl, parseManifest, platformConnectionExistsDirect, pollKiciEventsDirect, prunePeerCredentialsDirect, purgeEnvironmentsDirect, purgeScopedSecretsDirect, purgeSecretBackendsDirect, purgeStaleExecutionDirect, purgeStaleSourcesDirect, readStoredMigrationContentHash, redactConfig, registerWorkflowManualDirect, resetRaftStateDirect, resolvePlatformWebhookSourceRoutingKeyDirect, resolveTableConfig, restoreSoftDeletedGenericWebhookSourceDirect, seedApiKeyInlineDirect, seedCiSecurityFixturesDirect, seedCrossRepoTrustDirect, seedEnvironmentBindingDirect, seedEnvironmentDirect, seedGenericWebhookSourceDirect, seedSourcePrivateKeyDirect, seedSyntheticGithubSourceDirect, seedUniversalGitSourceDirect, seedWebhookSecretDirect, serializeManifest, setEnvironmentPolicyDirect, setEnvironmentSecretDirect, setupGracefulShutdown, showEnvironmentDirect, showExecutionRunDirect, showKiciEventDirect, showQueueEntryDirect, showRegistrationDirect, storeMigrationContentHash, storeMigrationContentHashInTableDirect, tableExistsDirect, tablePrefix, tenantDayBucketPrefix, tenantDayPrefix, terminateIdleDbBackendsDirect, updateGenericWebhookVerificationConfigDirect, updateOrgSettingsDeniedReposDirect, updateSourceRoutingKeyDirect, updateWorkflowRegistrationCommitShaDirect, upsertCronLastFiredDirect, upsertOrgSettingsGlobalWorkflowsDirect, validateRequiredTools, verifyKiciEventNotifyDirect, waitForEventLogRowByDeliveryIdDirect, waitForExecutionRunStatusSinceDirect, waitForLatestExecutionJobStatusDirect, waitForPlatformEventLogDistinctRoutedDirect, waitForPlatformExecutionRunStatusDirect, waitForPlatformRegistrationsDirect, waitForPostgresDirect, waitForRegistrationsByRoutingKeyDirect, waitForRegistrationsUpdatedAtAdvanceDirect, waitForRunCompletionDirect };
|
package/dist/package-manager.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True iff `err` is a Postgres unique-violation, optionally scoped to a named
|
|
3
|
+
* constraint. Pure guard over `unknown` — no `pg` import — so callers in the
|
|
4
|
+
* data layer can translate a raw driver error into a domain error, and it can
|
|
5
|
+
* be unit-tested without a live database.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPgUniqueViolation(err: unknown, constraint?: string): boolean;
|
|
8
|
+
//# sourceMappingURL=pg-errors.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/pg-errors.ts
|
|
3
|
+
/** Postgres SQLSTATE for a unique-violation. */
|
|
4
|
+
const PG_UNIQUE_VIOLATION = "23505";
|
|
5
|
+
/**
|
|
6
|
+
* True iff `err` is a Postgres unique-violation, optionally scoped to a named
|
|
7
|
+
* constraint. Pure guard over `unknown` — no `pg` import — so callers in the
|
|
8
|
+
* data layer can translate a raw driver error into a domain error, and it can
|
|
9
|
+
* be unit-tested without a live database.
|
|
10
|
+
*/
|
|
11
|
+
function isPgUniqueViolation(err, constraint) {
|
|
12
|
+
if (typeof err !== "object" || err === null) return false;
|
|
13
|
+
const e = err;
|
|
14
|
+
if (e.code !== PG_UNIQUE_VIOLATION) return false;
|
|
15
|
+
if (constraint !== void 0 && e.constraint !== constraint) return false;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isPgUniqueViolation };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=pg-errors.js.map
|
package/dist/reconnect-delay.js
CHANGED
package/dist/ring-buffer.js
CHANGED
package/dist/routes/health.js
CHANGED
package/dist/routes/metrics.js
CHANGED
package/dist/s3-client.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypted value with key version tracking.
|
|
3
|
+
* The data field contains base64-encoded IV || AuthTag || Ciphertext.
|
|
4
|
+
*/
|
|
5
|
+
export interface EncryptedValue {
|
|
6
|
+
/** Base64-encoded IV + auth tag + ciphertext. */
|
|
7
|
+
data: string;
|
|
8
|
+
/** Version of the encryption key used. */
|
|
9
|
+
keyVersion: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Encrypt a plaintext string using AES-256-GCM with AAD.
|
|
13
|
+
*
|
|
14
|
+
* @param plaintext - The string to encrypt
|
|
15
|
+
* @param key - 32-byte encryption key
|
|
16
|
+
* @param keyVersion - Version number for key rotation tracking
|
|
17
|
+
* @param aad - Additional authenticated data (e.g., "contextId:keyName")
|
|
18
|
+
* @returns Encrypted value with key version
|
|
19
|
+
*/
|
|
20
|
+
export declare function encrypt(plaintext: string, key: Buffer, keyVersion: number, aad: string): EncryptedValue;
|
|
21
|
+
/**
|
|
22
|
+
* Decrypt an encrypted value using AES-256-GCM with AAD verification.
|
|
23
|
+
*
|
|
24
|
+
* @param encrypted - The encrypted value to decrypt
|
|
25
|
+
* @param key - 32-byte encryption key (must match the key used for encryption)
|
|
26
|
+
* @param aad - Additional authenticated data (must match the AAD used for encryption)
|
|
27
|
+
* @returns Decrypted plaintext string
|
|
28
|
+
* @throws If decryption fails (wrong key, wrong AAD, tampered data)
|
|
29
|
+
*/
|
|
30
|
+
export declare function decrypt(encrypted: EncryptedValue, key: Buffer, aad: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Derive a 32-byte encryption key from a string input.
|
|
33
|
+
*
|
|
34
|
+
* Accepts two formats:
|
|
35
|
+
* - 64-character hex string (e.g., from generateMasterKey())
|
|
36
|
+
* - Base64-encoded 32-byte key
|
|
37
|
+
*
|
|
38
|
+
* @param input - Hex or base64 encoded key material
|
|
39
|
+
* @returns 32-byte Buffer suitable for use with encrypt/decrypt
|
|
40
|
+
* @throws If the derived key is not exactly 32 bytes
|
|
41
|
+
*/
|
|
42
|
+
export declare function deriveKey(input: string): Buffer;
|
|
43
|
+
/**
|
|
44
|
+
* Generate a new random 32-byte master key as a hex string.
|
|
45
|
+
*
|
|
46
|
+
* @returns 64-character hex string suitable for KICI_SECRET_KEY env var
|
|
47
|
+
*/
|
|
48
|
+
export declare function generateMasterKey(): string;
|
|
49
|
+
//# sourceMappingURL=secret-crypto.d.ts.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
3
|
+
//#region src/secret-crypto.ts
|
|
4
|
+
/**
|
|
5
|
+
* AES-256-GCM encryption layer for secrets management.
|
|
6
|
+
*
|
|
7
|
+
* Provides authenticated encryption with additional data (AAD)
|
|
8
|
+
* to prevent cross-context secret swaps. The AAD is typically
|
|
9
|
+
* "contextId:keyName" binding the ciphertext to its location.
|
|
10
|
+
*
|
|
11
|
+
* Wire format (base64 encoded): IV (12 bytes) || AuthTag (16 bytes) || Ciphertext
|
|
12
|
+
*/
|
|
13
|
+
/** Length of the initialization vector in bytes. */
|
|
14
|
+
const IV_LENGTH = 12;
|
|
15
|
+
/** Length of the GCM authentication tag in bytes. */
|
|
16
|
+
const TAG_LENGTH = 16;
|
|
17
|
+
/** Algorithm identifier for Node.js crypto. */
|
|
18
|
+
const ALGO = "aes-256-gcm";
|
|
19
|
+
/**
|
|
20
|
+
* Encrypt a plaintext string using AES-256-GCM with AAD.
|
|
21
|
+
*
|
|
22
|
+
* @param plaintext - The string to encrypt
|
|
23
|
+
* @param key - 32-byte encryption key
|
|
24
|
+
* @param keyVersion - Version number for key rotation tracking
|
|
25
|
+
* @param aad - Additional authenticated data (e.g., "contextId:keyName")
|
|
26
|
+
* @returns Encrypted value with key version
|
|
27
|
+
*/
|
|
28
|
+
function encrypt(plaintext, key, keyVersion, aad) {
|
|
29
|
+
const iv = randomBytes(IV_LENGTH);
|
|
30
|
+
const cipher = createCipheriv(ALGO, key, iv, { authTagLength: TAG_LENGTH });
|
|
31
|
+
cipher.setAAD(Buffer.from(aad, "utf-8"));
|
|
32
|
+
const encrypted = Buffer.concat([cipher.update(plaintext, "utf-8"), cipher.final()]);
|
|
33
|
+
const authTag = cipher.getAuthTag();
|
|
34
|
+
return {
|
|
35
|
+
data: Buffer.concat([
|
|
36
|
+
iv,
|
|
37
|
+
authTag,
|
|
38
|
+
encrypted
|
|
39
|
+
]).toString("base64"),
|
|
40
|
+
keyVersion
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Decrypt an encrypted value using AES-256-GCM with AAD verification.
|
|
45
|
+
*
|
|
46
|
+
* @param encrypted - The encrypted value to decrypt
|
|
47
|
+
* @param key - 32-byte encryption key (must match the key used for encryption)
|
|
48
|
+
* @param aad - Additional authenticated data (must match the AAD used for encryption)
|
|
49
|
+
* @returns Decrypted plaintext string
|
|
50
|
+
* @throws If decryption fails (wrong key, wrong AAD, tampered data)
|
|
51
|
+
*/
|
|
52
|
+
function decrypt(encrypted, key, aad) {
|
|
53
|
+
const packed = Buffer.from(encrypted.data, "base64");
|
|
54
|
+
if (packed.length < 28) throw new Error("Invalid encrypted data: too short");
|
|
55
|
+
const iv = packed.subarray(0, IV_LENGTH);
|
|
56
|
+
const authTag = packed.subarray(IV_LENGTH, 28);
|
|
57
|
+
const ciphertext = packed.subarray(28);
|
|
58
|
+
const decipher = createDecipheriv(ALGO, key, iv, { authTagLength: TAG_LENGTH });
|
|
59
|
+
decipher.setAuthTag(authTag);
|
|
60
|
+
decipher.setAAD(Buffer.from(aad, "utf-8"));
|
|
61
|
+
return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf-8");
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Derive a 32-byte encryption key from a string input.
|
|
65
|
+
*
|
|
66
|
+
* Accepts two formats:
|
|
67
|
+
* - 64-character hex string (e.g., from generateMasterKey())
|
|
68
|
+
* - Base64-encoded 32-byte key
|
|
69
|
+
*
|
|
70
|
+
* @param input - Hex or base64 encoded key material
|
|
71
|
+
* @returns 32-byte Buffer suitable for use with encrypt/decrypt
|
|
72
|
+
* @throws If the derived key is not exactly 32 bytes
|
|
73
|
+
*/
|
|
74
|
+
function deriveKey(input) {
|
|
75
|
+
let key;
|
|
76
|
+
if (/^[0-9a-fA-F]{64}$/.test(input)) key = Buffer.from(input, "hex");
|
|
77
|
+
else key = Buffer.from(input, "base64");
|
|
78
|
+
if (key.length !== 32) throw new Error(`Encryption key must be exactly 32 bytes, got ${key.length} bytes. Provide a 64-character hex string or a base64-encoded 32-byte value.`);
|
|
79
|
+
return key;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generate a new random 32-byte master key as a hex string.
|
|
83
|
+
*
|
|
84
|
+
* @returns 64-character hex string suitable for KICI_SECRET_KEY env var
|
|
85
|
+
*/
|
|
86
|
+
function generateMasterKey() {
|
|
87
|
+
return randomBytes(32).toString("hex");
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { decrypt, deriveKey, encrypt, generateMasterKey };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=secret-crypto.js.map
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { collectRuntimeMetricNames, getPrometheusExporter, initTelemetry } from "./init.js";
|
|
3
3
|
import { createMeter } from "./metrics.js";
|
|
4
4
|
export { collectRuntimeMetricNames, createMeter, getPrometheusExporter, initTelemetry };
|
package/dist/telemetry/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
3
3
|
import { PrometheusExporter } from "@opentelemetry/exporter-prometheus";
|
|
4
4
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
package/dist/tool-check.js
CHANGED
package/dist/ts-loader-hook.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
"import": "./dist/db-collation.js",
|
|
71
71
|
"types": "./dist/db-collation.d.ts"
|
|
72
72
|
},
|
|
73
|
+
"./secret-crypto": {
|
|
74
|
+
"import": "./dist/secret-crypto.js",
|
|
75
|
+
"types": "./dist/secret-crypto.d.ts"
|
|
76
|
+
},
|
|
73
77
|
"./package-manager": {
|
|
74
78
|
"import": "./dist/package-manager.js",
|
|
75
79
|
"types": "./dist/package-manager.d.ts"
|
|
@@ -101,7 +105,7 @@
|
|
|
101
105
|
"yaml": "^2.9.0",
|
|
102
106
|
"zod": "^4.4.3",
|
|
103
107
|
"zx": "^8.8.5",
|
|
104
|
-
"@kici-dev/core": "0.1.
|
|
108
|
+
"@kici-dev/core": "0.1.25"
|
|
105
109
|
},
|
|
106
110
|
"devDependencies": {
|
|
107
111
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
package/sbom.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@kici-dev/shared@0.1.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.
|
|
5
|
+
"name": "@kici-dev/shared@0.1.25",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.25/5f799c39-e3ad-4f51-a630-3901745fc4f4",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-
|
|
8
|
+
"created": "2026-07-05T08:32:19Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -696,9 +696,9 @@
|
|
|
696
696
|
"homepage": "https://js-sdsl.org"
|
|
697
697
|
},
|
|
698
698
|
{
|
|
699
|
-
"SPDXID": "SPDXRef-Package--kici-dev-core-0.1.
|
|
699
|
+
"SPDXID": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
700
700
|
"name": "@kici-dev/core",
|
|
701
|
-
"versionInfo": "0.1.
|
|
701
|
+
"versionInfo": "0.1.25",
|
|
702
702
|
"downloadLocation": "NOASSERTION",
|
|
703
703
|
"filesAnalyzed": false,
|
|
704
704
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -709,7 +709,7 @@
|
|
|
709
709
|
{
|
|
710
710
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
711
711
|
"referenceType": "purl",
|
|
712
|
-
"referenceLocator": "pkg:npm/%40kici-dev/core@0.1.
|
|
712
|
+
"referenceLocator": "pkg:npm/%40kici-dev/core@0.1.25"
|
|
713
713
|
}
|
|
714
714
|
],
|
|
715
715
|
"description": "Light shared utilities for the KiCI stack (logging, errors, formatting, crypto, zx init, the TypeScript ESM loader hook). No server-side dependencies.",
|
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
{
|
|
719
719
|
"SPDXID": "SPDXRef-RootPackage",
|
|
720
720
|
"name": "@kici-dev/shared",
|
|
721
|
-
"versionInfo": "0.1.
|
|
721
|
+
"versionInfo": "0.1.25",
|
|
722
722
|
"downloadLocation": "NOASSERTION",
|
|
723
723
|
"filesAnalyzed": false,
|
|
724
724
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -729,7 +729,7 @@
|
|
|
729
729
|
{
|
|
730
730
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
731
731
|
"referenceType": "purl",
|
|
732
|
-
"referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.
|
|
732
|
+
"referenceLocator": "pkg:npm/%40kici-dev/shared@0.1.25"
|
|
733
733
|
}
|
|
734
734
|
],
|
|
735
735
|
"description": "Shared utilities for the KiCI CI/CD stack — logging, zx setup, crypto, telemetry, health and metrics routes. No business logic.",
|
|
@@ -5202,32 +5202,32 @@
|
|
|
5202
5202
|
"relationshipType": "DEPENDS_ON"
|
|
5203
5203
|
},
|
|
5204
5204
|
{
|
|
5205
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5205
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5206
5206
|
"relatedSpdxElement": "SPDXRef-Package-oxc-transform-0.135.0",
|
|
5207
5207
|
"relationshipType": "DEPENDS_ON"
|
|
5208
5208
|
},
|
|
5209
5209
|
{
|
|
5210
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5210
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5211
5211
|
"relatedSpdxElement": "SPDXRef-Package-picocolors-1.1.1",
|
|
5212
5212
|
"relationshipType": "DEPENDS_ON"
|
|
5213
5213
|
},
|
|
5214
5214
|
{
|
|
5215
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5215
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5216
5216
|
"relatedSpdxElement": "SPDXRef-Package-winston-daily-rotate-file-5.0.0",
|
|
5217
5217
|
"relationshipType": "DEPENDS_ON"
|
|
5218
5218
|
},
|
|
5219
5219
|
{
|
|
5220
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5220
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5221
5221
|
"relatedSpdxElement": "SPDXRef-Package-winston-3.19.0",
|
|
5222
5222
|
"relationshipType": "DEPENDS_ON"
|
|
5223
5223
|
},
|
|
5224
5224
|
{
|
|
5225
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5225
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5226
5226
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
5227
5227
|
"relationshipType": "DEPENDS_ON"
|
|
5228
5228
|
},
|
|
5229
5229
|
{
|
|
5230
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5230
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5231
5231
|
"relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
|
|
5232
5232
|
"relationshipType": "DEPENDS_ON"
|
|
5233
5233
|
},
|
|
@@ -5238,7 +5238,7 @@
|
|
|
5238
5238
|
},
|
|
5239
5239
|
{
|
|
5240
5240
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
5241
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.
|
|
5241
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.25",
|
|
5242
5242
|
"relationshipType": "DEPENDS_ON"
|
|
5243
5243
|
},
|
|
5244
5244
|
{
|