@kici-dev/shared 0.1.21 → 0.1.23
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/db-admin.d.ts +12 -2
- package/dist/db-admin.js +19 -10
- package/package.json +2 -2
- package/sbom.spdx.json +15 -15
package/dist/db-admin.d.ts
CHANGED
|
@@ -221,10 +221,13 @@ export interface SeedEnvironmentBindingOpts {
|
|
|
221
221
|
orgId: string;
|
|
222
222
|
envName: string;
|
|
223
223
|
scopePattern: string;
|
|
224
|
+
/** Host selector; defaults to `'**'` (all hosts). */
|
|
225
|
+
hostPattern?: string;
|
|
224
226
|
}
|
|
225
227
|
/**
|
|
226
|
-
* Upsert an `environment_bindings` row connecting `envName` to `scopePattern
|
|
227
|
-
* Throws if the environment does
|
|
228
|
+
* Upsert an `environment_bindings` row connecting `envName` to `scopePattern`
|
|
229
|
+
* (scoped to `hostPattern`, default `'**'`). Throws if the environment does
|
|
230
|
+
* not exist.
|
|
228
231
|
*/
|
|
229
232
|
export declare function seedEnvironmentBindingDirect(databaseUrl: string, opts: SeedEnvironmentBindingOpts): Promise<{
|
|
230
233
|
created: boolean;
|
|
@@ -275,6 +278,7 @@ export interface EnvironmentVariableRow {
|
|
|
275
278
|
}
|
|
276
279
|
export interface EnvironmentBindingRow {
|
|
277
280
|
scope_pattern: string;
|
|
281
|
+
host_pattern: string;
|
|
278
282
|
created_at: string;
|
|
279
283
|
}
|
|
280
284
|
export interface ShowEnvironmentResult {
|
|
@@ -668,6 +672,12 @@ export declare function findAnyUserApiKeyIdDirect(databaseUrl: string, preferred
|
|
|
668
672
|
export declare function seedSyntheticGithubSourceDirect(databaseUrl: string, opts: {
|
|
669
673
|
routingKey: string;
|
|
670
674
|
orgId: string;
|
|
675
|
+
/** Display name pushed by the orchestrator on register. Optional. */
|
|
676
|
+
name?: string;
|
|
677
|
+
/** Fine-grained subtype (e.g. 'github_app'). Optional. */
|
|
678
|
+
subtype?: string;
|
|
679
|
+
/** GitHub App slug. Optional. */
|
|
680
|
+
slug?: string;
|
|
671
681
|
}): Promise<void>;
|
|
672
682
|
/**
|
|
673
683
|
* Seed a webhook secret into the orchestrator's `scoped_secrets` table,
|
package/dist/db-admin.js
CHANGED
|
@@ -433,8 +433,9 @@ async function deleteEnvironmentDirect(databaseUrl, opts) {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
/**
|
|
436
|
-
* Upsert an `environment_bindings` row connecting `envName` to `scopePattern
|
|
437
|
-
* Throws if the environment does
|
|
436
|
+
* Upsert an `environment_bindings` row connecting `envName` to `scopePattern`
|
|
437
|
+
* (scoped to `hostPattern`, default `'**'`). Throws if the environment does
|
|
438
|
+
* not exist.
|
|
438
439
|
*/
|
|
439
440
|
async function seedEnvironmentBindingDirect(databaseUrl, opts) {
|
|
440
441
|
const pool = new pg.Pool({
|
|
@@ -445,13 +446,14 @@ async function seedEnvironmentBindingDirect(databaseUrl, opts) {
|
|
|
445
446
|
const envRow = await pool.query(`SELECT id FROM environments WHERE org_id = $1 AND name = $2`, [opts.orgId, opts.envName]);
|
|
446
447
|
if (envRow.rows.length === 0) throw new Error(`environment: not found (org=${opts.orgId}, name=${opts.envName})`);
|
|
447
448
|
const envId = envRow.rows[0].id;
|
|
448
|
-
return { created: (await pool.query(`INSERT INTO environment_bindings (org_id, environment_id, scope_pattern)
|
|
449
|
-
VALUES ($1, $2, $3)
|
|
449
|
+
return { created: (await pool.query(`INSERT INTO environment_bindings (org_id, environment_id, scope_pattern, host_pattern)
|
|
450
|
+
VALUES ($1, $2, $3, $4)
|
|
450
451
|
ON CONFLICT DO NOTHING
|
|
451
452
|
RETURNING (xmax = 0) AS inserted`, [
|
|
452
453
|
opts.orgId,
|
|
453
454
|
envId,
|
|
454
|
-
opts.scopePattern
|
|
455
|
+
opts.scopePattern,
|
|
456
|
+
opts.hostPattern ?? "**"
|
|
455
457
|
])).rows[0]?.inserted ?? false };
|
|
456
458
|
} finally {
|
|
457
459
|
await pool.end();
|
|
@@ -537,10 +539,10 @@ async function showEnvironmentDirect(databaseUrl, opts) {
|
|
|
537
539
|
FROM environment_variables
|
|
538
540
|
WHERE environment_id = $1
|
|
539
541
|
ORDER BY key`, [env.id]);
|
|
540
|
-
const bindings = await pool.query(`SELECT scope_pattern, created_at
|
|
542
|
+
const bindings = await pool.query(`SELECT scope_pattern, host_pattern, created_at
|
|
541
543
|
FROM environment_bindings
|
|
542
544
|
WHERE environment_id = $1
|
|
543
|
-
ORDER BY scope_pattern`, [env.id]);
|
|
545
|
+
ORDER BY scope_pattern, host_pattern`, [env.id]);
|
|
544
546
|
return {
|
|
545
547
|
environment: env,
|
|
546
548
|
variables: variables.rows,
|
|
@@ -1234,9 +1236,16 @@ async function seedSyntheticGithubSourceDirect(databaseUrl, opts) {
|
|
|
1234
1236
|
WHERE org_id = $1 AND provider = 'github'
|
|
1235
1237
|
AND orchestrator_connection_id = 'e2e-synthetic'
|
|
1236
1238
|
AND routing_key != $2`, [opts.orgId, opts.routingKey]);
|
|
1237
|
-
await pool.query(`INSERT INTO webhook_sources (routing_key, provider, orchestrator_connection_id, org_id)
|
|
1238
|
-
VALUES ($1, 'github', 'e2e-synthetic', $2)
|
|
1239
|
-
ON CONFLICT (routing_key, orchestrator_connection_id)
|
|
1239
|
+
await pool.query(`INSERT INTO webhook_sources (routing_key, provider, orchestrator_connection_id, org_id, name, subtype, slug)
|
|
1240
|
+
VALUES ($1, 'github', 'e2e-synthetic', $2, $3, $4, $5)
|
|
1241
|
+
ON CONFLICT (routing_key, orchestrator_connection_id)
|
|
1242
|
+
DO UPDATE SET org_id = $2, name = $3, subtype = $4, slug = $5`, [
|
|
1243
|
+
opts.routingKey,
|
|
1244
|
+
opts.orgId,
|
|
1245
|
+
opts.name ?? null,
|
|
1246
|
+
opts.subtype ?? null,
|
|
1247
|
+
opts.slug ?? null
|
|
1248
|
+
]);
|
|
1240
1249
|
} finally {
|
|
1241
1250
|
await pool.end();
|
|
1242
1251
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"yaml": "^2.9.0",
|
|
102
102
|
"zod": "^4.4.3",
|
|
103
103
|
"zx": "^8.8.5",
|
|
104
|
-
"@kici-dev/core": "0.1.
|
|
104
|
+
"@kici-dev/core": "0.1.23"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@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.23",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fshared/0.1.23/1a6722a5-09a5-4867-83e3-89789b97e947",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-06-
|
|
8
|
+
"created": "2026-06-25T11:12:36Z",
|
|
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.23",
|
|
700
700
|
"name": "@kici-dev/core",
|
|
701
|
-
"versionInfo": "0.1.
|
|
701
|
+
"versionInfo": "0.1.23",
|
|
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.23"
|
|
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.23",
|
|
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.23"
|
|
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.23",
|
|
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.23",
|
|
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.23",
|
|
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.23",
|
|
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.23",
|
|
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.23",
|
|
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.23",
|
|
5242
5242
|
"relationshipType": "DEPENDS_ON"
|
|
5243
5243
|
},
|
|
5244
5244
|
{
|