@xemahq/kernel-contracts 0.23.0 → 0.23.2
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/LICENSE +176 -0
- package/dist/connector/index.d.ts +1 -0
- package/dist/connector/index.d.ts.map +1 -1
- package/dist/connector/index.js +1 -0
- package/dist/connector/index.js.map +1 -1
- package/dist/connector/lib/connector-descriptor.d.ts +18 -1
- package/dist/connector/lib/connector-descriptor.d.ts.map +1 -1
- package/dist/connector/lib/connector-descriptor.js +13 -0
- package/dist/connector/lib/connector-descriptor.js.map +1 -1
- package/dist/connector/lib/integration-provider-contribution.d.ts +66 -0
- package/dist/connector/lib/integration-provider-contribution.d.ts.map +1 -0
- package/dist/connector/lib/integration-provider-contribution.js +55 -0
- package/dist/connector/lib/integration-provider-contribution.js.map +1 -0
- package/dist/connector/lib/onboarding-manifest.d.ts +10 -0
- package/dist/connector/lib/onboarding-manifest.d.ts.map +1 -1
- package/dist/connector/lib/onboarding-manifest.js +11 -1
- package/dist/connector/lib/onboarding-manifest.js.map +1 -1
- package/dist/connector/lib/provider-descriptor.d.ts +75 -1
- package/dist/connector/lib/provider-descriptor.d.ts.map +1 -1
- package/dist/connector/lib/provider-descriptor.js +34 -1
- package/dist/connector/lib/provider-descriptor.js.map +1 -1
- package/dist/distribution/index.d.ts +1 -0
- package/dist/distribution/index.d.ts.map +1 -1
- package/dist/distribution/index.js +1 -0
- package/dist/distribution/index.js.map +1 -1
- package/dist/distribution/lib/distribution-lock.d.ts +3 -0
- package/dist/distribution/lib/distribution-lock.d.ts.map +1 -1
- package/dist/distribution/lib/distribution-lock.js +3 -0
- package/dist/distribution/lib/distribution-lock.js.map +1 -1
- package/dist/distribution/lib/distribution-selector.d.ts +3 -0
- package/dist/distribution/lib/distribution-selector.d.ts.map +1 -1
- package/dist/distribution/lib/distribution-selector.js +9 -1
- package/dist/distribution/lib/distribution-selector.js.map +1 -1
- package/dist/distribution/lib/distribution.d.ts +1 -0
- package/dist/distribution/lib/distribution.d.ts.map +1 -1
- package/dist/distribution/lib/distribution.js +9 -1
- package/dist/distribution/lib/distribution.js.map +1 -1
- package/dist/distribution/lib/install-policy.d.ts +13 -0
- package/dist/distribution/lib/install-policy.d.ts.map +1 -0
- package/dist/distribution/lib/install-policy.js +18 -0
- package/dist/distribution/lib/install-policy.js.map +1 -0
- package/package.json +20 -18
- package/src/connector/index.ts +1 -0
- package/src/connector/lib/connector-descriptor.ts +30 -1
- package/src/connector/lib/integration-provider-contribution.ts +118 -0
- package/src/connector/lib/onboarding-manifest.ts +19 -0
- package/src/connector/lib/provider-descriptor.ts +101 -1
- package/src/distribution/index.ts +1 -0
- package/src/distribution/lib/distribution-lock.ts +20 -0
- package/src/distribution/lib/distribution-selector.ts +28 -3
- package/src/distribution/lib/distribution.ts +19 -0
- package/src/distribution/lib/install-policy.ts +46 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/distribution/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,qDAAmC;AACnC,0DAAwC;AACxC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/distribution/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,8DAA4C;AAC5C,qDAAmC;AACnC,0DAAwC;AACxC,mDAAiC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type BiomeTier, type BiomeTarget, type BiomeOrigin, type BiomeAudience } from '../../biome';
|
|
3
3
|
import { type PlatformServiceTier } from './distribution';
|
|
4
|
+
import { type BiomeInstallPolicy, type BiomeLaunchMode } from './install-policy';
|
|
4
5
|
export interface LockedBiome {
|
|
5
6
|
id: string;
|
|
6
7
|
version: string;
|
|
@@ -8,6 +9,8 @@ export interface LockedBiome {
|
|
|
8
9
|
target: BiomeTarget;
|
|
9
10
|
origin: BiomeOrigin;
|
|
10
11
|
mandatory: boolean;
|
|
12
|
+
installPolicy?: BiomeInstallPolicy;
|
|
13
|
+
launch?: BiomeLaunchMode;
|
|
11
14
|
repo: string;
|
|
12
15
|
path: string;
|
|
13
16
|
services: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution-lock.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"distribution-lock.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IAEpB,MAAM,EAAE,WAAW,CAAC;IAEpB,SAAS,EAAE,OAAO,CAAC;IAOnB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAKnC,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CA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AC;AAOlC,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAUpE"}
|
|
@@ -5,6 +5,7 @@ exports.parseDistributionLock = parseDistributionLock;
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const biome_1 = require("../../biome");
|
|
7
7
|
const distribution_1 = require("./distribution");
|
|
8
|
+
const install_policy_1 = require("./install-policy");
|
|
8
9
|
const LockedBiomeDisplaySchema = zod_1.z
|
|
9
10
|
.object({
|
|
10
11
|
icon: zod_1.z.string().min(1).optional(),
|
|
@@ -20,6 +21,8 @@ exports.LockedBiomeSchema = zod_1.z.object({
|
|
|
20
21
|
target: biome_1.BiomeTargetSchema,
|
|
21
22
|
origin: biome_1.BiomeOriginSchema,
|
|
22
23
|
mandatory: zod_1.z.boolean(),
|
|
24
|
+
installPolicy: install_policy_1.BiomeInstallPolicySchema.optional(),
|
|
25
|
+
launch: install_policy_1.BiomeLaunchModeSchema.optional(),
|
|
23
26
|
repo: zod_1.z.string().min(1),
|
|
24
27
|
path: zod_1.z.string().min(1),
|
|
25
28
|
services: zod_1.z.array(zod_1.z.string().min(1)).readonly(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution-lock.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-lock.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"distribution-lock.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-lock.ts"],"names":[],"mappings":";;;AAgMA,sDAUC;AA1MD,6BAAwB;AACxB,uCASqB;AACrB,iDAGwB;AACxB,qDAK0B;AAmF1B,MAAM,wBAAwB,GAAG,OAAC;KAC/B,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EA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CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAgC,CAAC;AAOlC,SAAgB,qBAAqB,CAAC,GAAY;IAChD,MAAM,MAAM,GAAG,8BAAsB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,mCAAmC,MAAM,CAAC,KAAK,CAAC,MAAM;aACnD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aAChD,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type BiomeTier, type BiomeOrigin } from '../../biome';
|
|
3
|
+
import { type BiomeInstallPolicy } from './install-policy';
|
|
3
4
|
export type DistributionSelector = {
|
|
4
5
|
tier: BiomeTier;
|
|
5
6
|
mandatory?: boolean;
|
|
7
|
+
installPolicy?: BiomeInstallPolicy;
|
|
6
8
|
} | {
|
|
7
9
|
origin: BiomeOrigin;
|
|
8
10
|
} | {
|
|
9
11
|
biome: string;
|
|
10
12
|
version?: string;
|
|
11
13
|
mandatory?: boolean;
|
|
14
|
+
installPolicy?: BiomeInstallPolicy;
|
|
12
15
|
};
|
|
13
16
|
export declare const DistributionSelectorSchema: z.ZodType<DistributionSelector>;
|
|
14
17
|
//# sourceMappingURL=distribution-selector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution-selector.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"distribution-selector.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAkC1B,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;CAAE,GAC5E;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC;AAEN,eAAO,MAAM,0BAA0B,EAiBjC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -3,14 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DistributionSelectorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const biome_1 = require("../../biome");
|
|
6
|
+
const install_policy_1 = require("./install-policy");
|
|
6
7
|
exports.DistributionSelectorSchema = zod_1.z.union([
|
|
7
|
-
zod_1.z
|
|
8
|
+
zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
tier: biome_1.BiomeTierSchema,
|
|
11
|
+
mandatory: zod_1.z.boolean().optional(),
|
|
12
|
+
installPolicy: install_policy_1.BiomeInstallPolicySchema.optional(),
|
|
13
|
+
})
|
|
14
|
+
.strict(),
|
|
8
15
|
zod_1.z.object({ origin: biome_1.BiomeOriginSchema }).strict(),
|
|
9
16
|
zod_1.z
|
|
10
17
|
.object({
|
|
11
18
|
biome: zod_1.z.string().min(1),
|
|
12
19
|
version: zod_1.z.string().min(1).optional(),
|
|
13
20
|
mandatory: zod_1.z.boolean().optional(),
|
|
21
|
+
installPolicy: install_policy_1.BiomeInstallPolicySchema.optional(),
|
|
14
22
|
})
|
|
15
23
|
.strict(),
|
|
16
24
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution-selector.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-selector.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,uCAKqB;
|
|
1
|
+
{"version":3,"file":"distribution-selector.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution-selector.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,uCAKqB;AACrB,qDAG0B;AA4Cb,QAAA,0BAA0B,GAAG,OAAC,CAAC,KAAK,CAAC;IAChD,OAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,uBAAe;QACrB,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACjC,aAAa,EAAE,yCAAwB,CAAC,QAAQ,EAAE;KACnD,CAAC;SACD,MAAM,EAAE;IACX,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,yBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChD,OAAC;SACE,MAAM,CAAC;QACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACrC,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACjC,aAAa,EAAE,yCAAwB,CAAC,QAAQ,EAAE;KACnD,CAAC;SACD,MAAM,EAAE;CACZ,CAAoC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { type BiomeOrigin, type BiomeTier } from '../../biome';
|
|
|
3
3
|
import { type DistributionSelector } from './distribution-selector';
|
|
4
4
|
export type PlatformServiceTier = BiomeTier | 'edge';
|
|
5
5
|
export declare const PlatformServiceTierSchema: z.ZodType<PlatformServiceTier>;
|
|
6
|
+
export declare const PLATFORM_SERVICE_TIER_RANK: Readonly<Record<PlatformServiceTier | 'infra', number>>;
|
|
6
7
|
export type DistributionSchemaVersion = 1;
|
|
7
8
|
export interface DistributionTrustPolicy {
|
|
8
9
|
allow: readonly BiomeOrigin[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AASjC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,eAAO,MAAM,yBAAyB,EAGhC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/distribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AASjC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,eAAO,MAAM,yBAAyB,EAGhC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAUrC,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAC/C,MAAM,CAAC,mBAAmB,GAAG,OAAO,EAAE,MAAM,CAAC,CAQ9C,CAAC;AAOF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAQ1C,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,6BAA6B,EAEpC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAUzC,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,eAAO,MAAM,iCAAiC,EAGxC,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAiB7C,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,yBAAyB,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAEzC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAMtC,gBAAgB,CAAC,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC3D;AAED,eAAO,MAAM,kBAAkB,EAUzB,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAM9B,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAU5D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DistributionSchema = exports.DistributionPlatformServiceSchema = exports.DistributionTrustPolicySchema = exports.PlatformServiceTierSchema = void 0;
|
|
3
|
+
exports.DistributionSchema = exports.DistributionPlatformServiceSchema = exports.DistributionTrustPolicySchema = exports.PLATFORM_SERVICE_TIER_RANK = exports.PlatformServiceTierSchema = void 0;
|
|
4
4
|
exports.parseDistribution = parseDistribution;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const biome_1 = require("../../biome");
|
|
@@ -9,6 +9,14 @@ exports.PlatformServiceTierSchema = zod_1.z.union([
|
|
|
9
9
|
biome_1.BiomeTierSchema,
|
|
10
10
|
zod_1.z.literal('edge'),
|
|
11
11
|
]);
|
|
12
|
+
exports.PLATFORM_SERVICE_TIER_RANK = {
|
|
13
|
+
infra: -1,
|
|
14
|
+
kernel: 0,
|
|
15
|
+
system: 1,
|
|
16
|
+
base: 2,
|
|
17
|
+
platform: 3,
|
|
18
|
+
edge: 4,
|
|
19
|
+
};
|
|
12
20
|
exports.DistributionTrustPolicySchema = zod_1.z.object({
|
|
13
21
|
allow: zod_1.z.array(biome_1.BiomeOriginSchema).readonly(),
|
|
14
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"distribution.js","sourceRoot":"","sources":["../../../src/distribution/lib/distribution.ts"],"names":[],"mappings":";;;AAuIA,8CAUC;AAjJD,6BAAwB;AACxB,uCAKqB;AACrB,mEAGiC;AAWpB,QAAA,yBAAyB,GAAG,OAAC,CAAC,KAAK,CAAC;IAC/C,uBAAe;IACf,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CAClB,CAAmC,CAAC;AAUxB,QAAA,0BAA0B,GAEnC;IACF,KAAK,EAAE,CAAC,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;CACR,CAAC;AAmBW,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,yBAAiB,CAAC,CAAC,QAA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AM;aACnD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;aAChD,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare enum BiomeInstallPolicy {
|
|
3
|
+
Required = "required",
|
|
4
|
+
DefaultSelected = "default-selected",
|
|
5
|
+
Optional = "optional"
|
|
6
|
+
}
|
|
7
|
+
export declare const BiomeInstallPolicySchema: z.ZodEnum<typeof BiomeInstallPolicy>;
|
|
8
|
+
export declare enum BiomeLaunchMode {
|
|
9
|
+
Static = "static",
|
|
10
|
+
PerInstallation = "per-installation"
|
|
11
|
+
}
|
|
12
|
+
export declare const BiomeLaunchModeSchema: z.ZodEnum<typeof BiomeLaunchMode>;
|
|
13
|
+
//# sourceMappingURL=install-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-policy.d.ts","sourceRoot":"","sources":["../../../src/distribution/lib/install-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,oBAAY,kBAAkB;IAC5B,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,wBAAwB,sCAAmC,CAAC;AAezE,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,eAAe,qBAAqB;CACrC;AAED,eAAO,MAAM,qBAAqB,mCAAgC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BiomeLaunchModeSchema = exports.BiomeLaunchMode = exports.BiomeInstallPolicySchema = exports.BiomeInstallPolicy = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var BiomeInstallPolicy;
|
|
6
|
+
(function (BiomeInstallPolicy) {
|
|
7
|
+
BiomeInstallPolicy["Required"] = "required";
|
|
8
|
+
BiomeInstallPolicy["DefaultSelected"] = "default-selected";
|
|
9
|
+
BiomeInstallPolicy["Optional"] = "optional";
|
|
10
|
+
})(BiomeInstallPolicy || (exports.BiomeInstallPolicy = BiomeInstallPolicy = {}));
|
|
11
|
+
exports.BiomeInstallPolicySchema = zod_1.z.nativeEnum(BiomeInstallPolicy);
|
|
12
|
+
var BiomeLaunchMode;
|
|
13
|
+
(function (BiomeLaunchMode) {
|
|
14
|
+
BiomeLaunchMode["Static"] = "static";
|
|
15
|
+
BiomeLaunchMode["PerInstallation"] = "per-installation";
|
|
16
|
+
})(BiomeLaunchMode || (exports.BiomeLaunchMode = BiomeLaunchMode = {}));
|
|
17
|
+
exports.BiomeLaunchModeSchema = zod_1.z.nativeEnum(BiomeLaunchMode);
|
|
18
|
+
//# sourceMappingURL=install-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-policy.js","sourceRoot":"","sources":["../../../src/distribution/lib/install-policy.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAmBxB,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,0DAAoC,CAAA;IACpC,2CAAqB,CAAA;AACvB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAEY,QAAA,wBAAwB,GAAG,OAAC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAezE,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,uDAAoC,CAAA;AACtC,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAEY,QAAA,qBAAqB,GAAG,OAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/kernel-contracts",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Consolidated Xema OS kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
|
|
@@ -19,26 +19,18 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"src"
|
|
21
21
|
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"clean": "rm -rf dist",
|
|
24
|
-
"build": "tsc -p tsconfig.json && node scripts/emit-awp-spec.mjs",
|
|
25
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
26
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
27
|
-
"lint": "eslint .",
|
|
28
|
-
"check:boundary": "node scripts/check-subpath-dag.mjs"
|
|
29
|
-
},
|
|
30
22
|
"devDependencies": {
|
|
31
|
-
"@eslint/js": "
|
|
32
|
-
"@types/node": "
|
|
33
|
-
"eslint": "
|
|
34
|
-
"eslint-config-prettier": "
|
|
23
|
+
"@eslint/js": "^9.39.4",
|
|
24
|
+
"@types/node": "25.2.3",
|
|
25
|
+
"eslint": "^9.39.4",
|
|
26
|
+
"eslint-config-prettier": "^10.1.8",
|
|
35
27
|
"eslint-plugin-import": "^2.31.0",
|
|
36
|
-
"prettier": "
|
|
37
|
-
"typescript": "
|
|
38
|
-
"typescript-eslint": "
|
|
28
|
+
"prettier": "3.6.2",
|
|
29
|
+
"typescript": "5.9.3",
|
|
30
|
+
"typescript-eslint": "^8.56.1"
|
|
39
31
|
},
|
|
40
32
|
"dependencies": {
|
|
41
|
-
"zod": "
|
|
33
|
+
"zod": "^4.3.6"
|
|
42
34
|
},
|
|
43
35
|
"exports": {
|
|
44
36
|
"./*": {
|
|
@@ -47,5 +39,15 @@
|
|
|
47
39
|
"default": "./dist/*/index.js"
|
|
48
40
|
},
|
|
49
41
|
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"clean": "rm -rf dist",
|
|
45
|
+
"build": "tsc -p tsconfig.json && node scripts/emit-awp-spec.mjs",
|
|
46
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
47
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
48
|
+
"lint": "eslint .",
|
|
49
|
+
"check:boundary": "node scripts/check-subpath-dag.mjs",
|
|
50
|
+
"docs:manifest-reference": "node scripts/generate-biome-manifest-reference.mjs",
|
|
51
|
+
"test": "node --test \"tests/*.spec.mjs\""
|
|
50
52
|
}
|
|
51
|
-
}
|
|
53
|
+
}
|
package/src/connector/index.ts
CHANGED
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
* ─────────────────────────────────────────────────────────────────────────
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
|
|
23
|
+
import { CredentialKind } from './credential-kind';
|
|
24
|
+
|
|
21
25
|
import type { AdapterKindRef } from './adapter-kind';
|
|
22
|
-
import type { CredentialKind } from './credential-kind';
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* A connector in the catalog. `connectorKey` aligns with the persisted
|
|
@@ -65,3 +68,29 @@ export interface ConnectorDescriptor {
|
|
|
65
68
|
*/
|
|
66
69
|
readonly adapterKind: AdapterKindRef;
|
|
67
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Zod mirror of {@link ConnectorDescriptor} — value-identical to the
|
|
74
|
+
* interface. Used wherever a connector descriptor crosses a trust boundary
|
|
75
|
+
* (biome integration-provider contributions). Strict: unknown keys fail fast.
|
|
76
|
+
* `adapterKind` stays an open `AdapterKindRef` string — the runtime registry
|
|
77
|
+
* is the authority on which slugs are currently known.
|
|
78
|
+
*/
|
|
79
|
+
export const ConnectorDescriptorSchema = z.strictObject({
|
|
80
|
+
connectorKey: z.string().min(1),
|
|
81
|
+
displayName: z.string().min(1),
|
|
82
|
+
description: z.string().min(1),
|
|
83
|
+
iconName: z.string().min(1),
|
|
84
|
+
providerKey: z.string().min(1),
|
|
85
|
+
scopes: z.array(z.string()).readonly(),
|
|
86
|
+
connectionCredentialKind: z.nativeEnum(CredentialKind),
|
|
87
|
+
adapterKind: z.string().min(1),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Compile-time value-identity guards: schema output <=> interface. The tuple
|
|
91
|
+
// export exists only so `noUnusedLocals` sees a use; no contract meaning.
|
|
92
|
+
type AssertExtends<T extends U, U> = T;
|
|
93
|
+
export type ConnectorDescriptorValueIdentityGuards = [
|
|
94
|
+
AssertExtends<z.infer<typeof ConnectorDescriptorSchema>, ConnectorDescriptor>,
|
|
95
|
+
AssertExtends<ConnectorDescriptor, z.infer<typeof ConnectorDescriptorSchema>>,
|
|
96
|
+
];
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
3
|
+
* IntegrationProvider contribution manifest — the `integration-provider`
|
|
4
|
+
* ContributionKind's kind-specific schema (2-file kernel rule: the enum
|
|
5
|
+
* member lives in `contribution/lib/contribution-kind.ts`, the manifest
|
|
6
|
+
* schema lives here; the parser lives in biome-host, the ingesting registry
|
|
7
|
+
* in connector-gateway-api).
|
|
8
|
+
*
|
|
9
|
+
* A biome contributes a third-party connector provider as pure data: ONE
|
|
10
|
+
* {@link ProviderDescriptor} (the authenticating authority) plus its
|
|
11
|
+
* {@link ConnectorDescriptor}[] (the connectable capability surfaces). This
|
|
12
|
+
* REUSES the existing provider vocabulary — there is deliberately no second
|
|
13
|
+
* provider shape: the manifest wraps the exact descriptors the connector
|
|
14
|
+
* registry already registers for built-ins and locally-loaded biome modules
|
|
15
|
+
* (`ConnectorRegistryService.registerContributed`).
|
|
16
|
+
*
|
|
17
|
+
* Provenance is NOT declared inline (mirrors the `capability` kind): the
|
|
18
|
+
* discovering parser stamps `biome.id`/`biome.version` from the biome's
|
|
19
|
+
* `xema-biome.json`, and the provider's `origin` is server-stamped to
|
|
20
|
+
* `ProviderOrigin.Biome` — an author-supplied `origin` is a strict-schema
|
|
21
|
+
* validation error, never silently honored.
|
|
22
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
|
|
27
|
+
import { ConnectorDescriptorSchema } from './connector-descriptor';
|
|
28
|
+
import {
|
|
29
|
+
ProviderDescriptorBaseSchema,
|
|
30
|
+
providerOAuthEndpointsInvariant,
|
|
31
|
+
} from './provider-descriptor';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Contributed provider keys are lowercase slugs (`sap`, `hubspot`,
|
|
35
|
+
* `my-crm`) — same convention as the built-in keys (`google`, `smtp`).
|
|
36
|
+
*/
|
|
37
|
+
const CONTRIBUTED_PROVIDER_KEY_REGEX = /^[a-z][a-z0-9_-]*$/;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Contributed connector keys are UPPER_SNAKE (`SAP_S4HANA`) — the same wire
|
|
41
|
+
* convention as the persisted built-in connector keys (`GMAIL`,
|
|
42
|
+
* `MICROSOFT_GRAPH`), so slug transforms (`connectorKey.toLowerCase()`)
|
|
43
|
+
* behave identically for contributed and curated connectors.
|
|
44
|
+
*/
|
|
45
|
+
const CONTRIBUTED_CONNECTOR_KEY_REGEX = /^[A-Z][A-Z0-9_]*$/;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A contributed provider descriptor: {@link ProviderDescriptorBaseSchema}
|
|
49
|
+
* minus `origin`, which is server-stamped (`ProviderOrigin.Biome`) by the
|
|
50
|
+
* discovering parser — authors MUST NOT declare it.
|
|
51
|
+
*/
|
|
52
|
+
export const ContributedProviderDescriptorSchema =
|
|
53
|
+
ProviderDescriptorBaseSchema.omit({ origin: true });
|
|
54
|
+
|
|
55
|
+
export type ContributedProviderDescriptor = z.infer<
|
|
56
|
+
typeof ContributedProviderDescriptorSchema
|
|
57
|
+
>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The `integration-provider` contribution manifest: one provider + its
|
|
61
|
+
* connectors. Validated fail-fast at BOTH ends of the sync (biome-host's
|
|
62
|
+
* `IntegrationProviderParser` at discovery time, connector-gateway-api's
|
|
63
|
+
* sync handler at the wire) — the two ends share this ONE schema.
|
|
64
|
+
*/
|
|
65
|
+
export const IntegrationProviderContributionManifestSchema = z
|
|
66
|
+
.strictObject({
|
|
67
|
+
provider: ContributedProviderDescriptorSchema,
|
|
68
|
+
connectors: z.array(ConnectorDescriptorSchema).min(1).readonly(),
|
|
69
|
+
})
|
|
70
|
+
.superRefine((manifest, ctx) => {
|
|
71
|
+
providerOAuthEndpointsInvariant(manifest.provider, ctx, ['provider']);
|
|
72
|
+
|
|
73
|
+
if (!CONTRIBUTED_PROVIDER_KEY_REGEX.test(manifest.provider.providerKey)) {
|
|
74
|
+
ctx.addIssue({
|
|
75
|
+
code: 'custom',
|
|
76
|
+
path: ['provider', 'providerKey'],
|
|
77
|
+
message:
|
|
78
|
+
`providerKey "${manifest.provider.providerKey}" must be a lowercase ` +
|
|
79
|
+
`slug matching ${CONTRIBUTED_PROVIDER_KEY_REGEX.source}.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const seenConnectorKeys = new Set<string>();
|
|
84
|
+
manifest.connectors.forEach((connector, index) => {
|
|
85
|
+
if (!CONTRIBUTED_CONNECTOR_KEY_REGEX.test(connector.connectorKey)) {
|
|
86
|
+
ctx.addIssue({
|
|
87
|
+
code: 'custom',
|
|
88
|
+
path: ['connectors', index, 'connectorKey'],
|
|
89
|
+
message:
|
|
90
|
+
`connectorKey "${connector.connectorKey}" must be UPPER_SNAKE ` +
|
|
91
|
+
`matching ${CONTRIBUTED_CONNECTOR_KEY_REGEX.source}.`,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (connector.providerKey !== manifest.provider.providerKey) {
|
|
95
|
+
ctx.addIssue({
|
|
96
|
+
code: 'custom',
|
|
97
|
+
path: ['connectors', index, 'providerKey'],
|
|
98
|
+
message:
|
|
99
|
+
`Connector "${connector.connectorKey}" references provider ` +
|
|
100
|
+
`"${connector.providerKey}" but this manifest contributes provider ` +
|
|
101
|
+
`"${manifest.provider.providerKey}" — a contribution's connectors ` +
|
|
102
|
+
`must belong to its own provider.`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (seenConnectorKeys.has(connector.connectorKey)) {
|
|
106
|
+
ctx.addIssue({
|
|
107
|
+
code: 'custom',
|
|
108
|
+
path: ['connectors', index, 'connectorKey'],
|
|
109
|
+
message: `Duplicate connectorKey "${connector.connectorKey}" in manifest.`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
seenConnectorKeys.add(connector.connectorKey);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export type IntegrationProviderContributionManifest = z.infer<
|
|
117
|
+
typeof IntegrationProviderContributionManifestSchema
|
|
118
|
+
>;
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
* ─────────────────────────────────────────────────────────────────────────
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* Closed set of credential-field input types the install wizard renders.
|
|
25
27
|
* Maps 1:1 onto HTML input affordances; extending requires both a backend
|
|
@@ -105,6 +107,23 @@ export interface CredentialFieldSpec {
|
|
|
105
107
|
readonly transform: CredentialFieldTransform;
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Zod mirror of {@link CredentialFieldSpec} — value-identical to the
|
|
112
|
+
* interface above. Used to validate credential-field declarations that cross
|
|
113
|
+
* a trust boundary (biome integration-provider contribution manifests).
|
|
114
|
+
* Strict: an unknown key is a fail-fast validation error, never silently
|
|
115
|
+
* dropped.
|
|
116
|
+
*/
|
|
117
|
+
export const CredentialFieldSpecSchema = z.strictObject({
|
|
118
|
+
key: z.string().min(1),
|
|
119
|
+
label: z.string().min(1),
|
|
120
|
+
type: z.nativeEnum(CredentialFieldType),
|
|
121
|
+
required: z.boolean(),
|
|
122
|
+
placeholder: z.string().optional(),
|
|
123
|
+
hint: z.string().optional(),
|
|
124
|
+
transform: z.nativeEnum(CredentialFieldTransform),
|
|
125
|
+
});
|
|
126
|
+
|
|
108
127
|
/**
|
|
109
128
|
* Provider-declared onboarding metadata returned by
|
|
110
129
|
* `GET /adapters/providers`. The frontend renders the install surface
|
|
@@ -24,7 +24,12 @@
|
|
|
24
24
|
* ─────────────────────────────────────────────────────────────────────────
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
import
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
CredentialFieldSpecSchema,
|
|
31
|
+
type CredentialFieldSpec,
|
|
32
|
+
} from './onboarding-manifest';
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* How a provider's APP-level credential authenticates. This is distinct from
|
|
@@ -169,6 +174,101 @@ export interface ProviderDescriptor {
|
|
|
169
174
|
readonly allowOrgOverride: boolean;
|
|
170
175
|
}
|
|
171
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Zod mirror of {@link ProviderOAuthEndpoints} — value-identical to the
|
|
179
|
+
* interface. Strict: unknown keys fail fast (a typo'd endpoint field must
|
|
180
|
+
* never be silently dropped from a contributed descriptor).
|
|
181
|
+
*/
|
|
182
|
+
export const ProviderOAuthEndpointsSchema = z.strictObject({
|
|
183
|
+
authorizationUrl: z.string().url(),
|
|
184
|
+
tokenUrl: z.string().url(),
|
|
185
|
+
extraAuthorizeParams: z.record(z.string(), z.string()).readonly().optional(),
|
|
186
|
+
clientIdEnvVar: z.string().min(1).optional(),
|
|
187
|
+
clientSecretEnvVar: z.string().min(1).optional(),
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Unrefined strict object mirror of {@link ProviderDescriptor}. Exported so
|
|
192
|
+
* derived contribution schemas can `.omit()` server-stamped fields (`origin`)
|
|
193
|
+
* and re-attach the cross-field invariant — zod object transforms drop
|
|
194
|
+
* refinements, so the invariant lives in
|
|
195
|
+
* {@link providerOAuthEndpointsInvariant} and is re-applied per derivation.
|
|
196
|
+
* Validate full descriptors with {@link ProviderDescriptorSchema}, not this.
|
|
197
|
+
*/
|
|
198
|
+
export const ProviderDescriptorBaseSchema = z.strictObject({
|
|
199
|
+
providerKey: z.string().min(1),
|
|
200
|
+
displayName: z.string().min(1),
|
|
201
|
+
description: z.string().min(1),
|
|
202
|
+
iconName: z.string().min(1),
|
|
203
|
+
category: z.string().min(1),
|
|
204
|
+
appAuthKind: z.nativeEnum(ProviderAppAuthKind),
|
|
205
|
+
origin: z.nativeEnum(ProviderOrigin),
|
|
206
|
+
appCredentialSchema: z.array(CredentialFieldSpecSchema).readonly().optional(),
|
|
207
|
+
oauthEndpoints: ProviderOAuthEndpointsSchema.optional(),
|
|
208
|
+
allowOrgOverride: z.boolean(),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Cross-field invariant shared by every provider-descriptor schema variant:
|
|
213
|
+
* an `OAuth2` provider MUST carry `oauthEndpoints` (the same rule the
|
|
214
|
+
* connector registry enforces at registration time) — validated at the
|
|
215
|
+
* contribution boundary so a malformed contributed descriptor fails at
|
|
216
|
+
* ingest, not at boot.
|
|
217
|
+
*/
|
|
218
|
+
export function providerOAuthEndpointsInvariant(
|
|
219
|
+
provider: Pick<ProviderDescriptor, 'providerKey' | 'appAuthKind'> & {
|
|
220
|
+
readonly oauthEndpoints?: unknown;
|
|
221
|
+
},
|
|
222
|
+
ctx: z.RefinementCtx,
|
|
223
|
+
basePath: readonly (string | number)[] = [],
|
|
224
|
+
): void {
|
|
225
|
+
if (
|
|
226
|
+
provider.appAuthKind === ProviderAppAuthKind.OAuth2 &&
|
|
227
|
+
provider.oauthEndpoints === undefined
|
|
228
|
+
) {
|
|
229
|
+
ctx.addIssue({
|
|
230
|
+
code: 'custom',
|
|
231
|
+
path: [...basePath, 'oauthEndpoints'],
|
|
232
|
+
message: `Provider "${provider.providerKey}" declares appAuthKind=oauth2 but has no oauthEndpoints.`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Zod mirror of {@link ProviderDescriptor} — value-identical to the
|
|
239
|
+
* interface, plus the `OAuth2` ⇒ `oauthEndpoints` invariant.
|
|
240
|
+
*/
|
|
241
|
+
export const ProviderDescriptorSchema = ProviderDescriptorBaseSchema.superRefine(
|
|
242
|
+
providerOAuthEndpointsInvariant,
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
// ── Compile-time value-identity guards (schema output <=> interface) ──────
|
|
246
|
+
// `AllowUndefinedOptionals` bridges zod's `?: T | undefined` optionals to the
|
|
247
|
+
// interfaces' exact optionals (`exactOptionalPropertyTypes`) — runtime shape
|
|
248
|
+
// is identical. The tuple export exists only so `noUnusedLocals` sees a use;
|
|
249
|
+
// it carries no contract meaning.
|
|
250
|
+
type AssertExtends<T extends U, U> = T;
|
|
251
|
+
type AllowUndefinedOptionals<T> = T extends readonly (infer E)[]
|
|
252
|
+
? readonly AllowUndefinedOptionals<E>[]
|
|
253
|
+
: T extends object
|
|
254
|
+
? { [K in keyof T]: AllowUndefinedOptionals<T[K]> | undefined }
|
|
255
|
+
: T;
|
|
256
|
+
export type ProviderDescriptorValueIdentityGuards = [
|
|
257
|
+
AssertExtends<
|
|
258
|
+
z.infer<typeof ProviderOAuthEndpointsSchema>,
|
|
259
|
+
AllowUndefinedOptionals<ProviderOAuthEndpoints>
|
|
260
|
+
>,
|
|
261
|
+
AssertExtends<
|
|
262
|
+
ProviderOAuthEndpoints,
|
|
263
|
+
z.infer<typeof ProviderOAuthEndpointsSchema>
|
|
264
|
+
>,
|
|
265
|
+
AssertExtends<
|
|
266
|
+
z.infer<typeof ProviderDescriptorSchema>,
|
|
267
|
+
AllowUndefinedOptionals<ProviderDescriptor>
|
|
268
|
+
>,
|
|
269
|
+
AssertExtends<ProviderDescriptor, z.infer<typeof ProviderDescriptorSchema>>,
|
|
270
|
+
];
|
|
271
|
+
|
|
172
272
|
/**
|
|
173
273
|
* True when a provider needs an app credential provisioned before any of its
|
|
174
274
|
* connectors can be connected (i.e. anything other than `None`). Callers use
|
|
@@ -13,6 +13,12 @@ import {
|
|
|
13
13
|
PlatformServiceTierSchema,
|
|
14
14
|
type PlatformServiceTier,
|
|
15
15
|
} from './distribution';
|
|
16
|
+
import {
|
|
17
|
+
BiomeInstallPolicySchema,
|
|
18
|
+
BiomeLaunchModeSchema,
|
|
19
|
+
type BiomeInstallPolicy,
|
|
20
|
+
type BiomeLaunchMode,
|
|
21
|
+
} from './install-policy';
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* A single biome as resolved into a distribution lockfile. Version-pinned and
|
|
@@ -29,6 +35,18 @@ export interface LockedBiome {
|
|
|
29
35
|
origin: BiomeOrigin;
|
|
30
36
|
/** Whether the org may disable this biome once shipped (cannot-disable). */
|
|
31
37
|
mandatory: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Package-model install policy (which biomes come up by default vs only when
|
|
40
|
+
* explicitly selected). Optional in the SCHEMA only for backward-compat with
|
|
41
|
+
* locks resolved before the package model — the resolver ALWAYS stamps it;
|
|
42
|
+
* consumers treat absence as `default-selected`.
|
|
43
|
+
*/
|
|
44
|
+
installPolicy?: BiomeInstallPolicy;
|
|
45
|
+
/**
|
|
46
|
+
* Launch placement (a distribution decision, never manifest-sourced).
|
|
47
|
+
* Absent = `static` (statically launched in the roster).
|
|
48
|
+
*/
|
|
49
|
+
launch?: BiomeLaunchMode;
|
|
32
50
|
/** Source repo + path the biome was resolved from (provenance for the build). */
|
|
33
51
|
repo: string;
|
|
34
52
|
path: string;
|
|
@@ -99,6 +117,8 @@ export const LockedBiomeSchema = z.object({
|
|
|
99
117
|
target: BiomeTargetSchema,
|
|
100
118
|
origin: BiomeOriginSchema,
|
|
101
119
|
mandatory: z.boolean(),
|
|
120
|
+
installPolicy: BiomeInstallPolicySchema.optional(),
|
|
121
|
+
launch: BiomeLaunchModeSchema.optional(),
|
|
102
122
|
repo: z.string().min(1),
|
|
103
123
|
path: z.string().min(1),
|
|
104
124
|
services: z.array(z.string().min(1)).readonly(),
|