@xemahq/kernel-contracts 0.23.1 → 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/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 +4 -2
- 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.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC"}
|
package/dist/connector/index.js
CHANGED
|
@@ -24,4 +24,5 @@ __exportStar(require("./lib/envelope-schema"), exports);
|
|
|
24
24
|
__exportStar(require("./lib/filter-expr"), exports);
|
|
25
25
|
__exportStar(require("./lib/filter-expr-schema"), exports);
|
|
26
26
|
__exportStar(require("./lib/filter-expr-validate"), exports);
|
|
27
|
+
__exportStar(require("./lib/integration-provider-contribution"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,4DAA0C;AAC1C,4DAA0C;AAC1C,6DAA2C;AAC3C,wDAAsC;AACtC,oDAAkC;AAClC,2DAAyC;AACzC,6DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/connector/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,mDAAiC;AACjC,wDAAsC;AACtC,4DAA0C;AAC1C,4DAA0C;AAC1C,6DAA2C;AAC3C,wDAAsC;AACtC,oDAAkC;AAClC,2DAAyC;AACzC,6DAA2C;AAC3C,0EAAwD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CredentialKind } from './credential-kind';
|
|
1
3
|
import type { AdapterKindRef } from './adapter-kind';
|
|
2
|
-
import type { CredentialKind } from './credential-kind';
|
|
3
4
|
export interface ConnectorDescriptor {
|
|
4
5
|
readonly connectorKey: string;
|
|
5
6
|
readonly displayName: string;
|
|
@@ -10,4 +11,20 @@ export interface ConnectorDescriptor {
|
|
|
10
11
|
readonly connectionCredentialKind: CredentialKind;
|
|
11
12
|
readonly adapterKind: AdapterKindRef;
|
|
12
13
|
}
|
|
14
|
+
export declare const ConnectorDescriptorSchema: z.ZodObject<{
|
|
15
|
+
connectorKey: z.ZodString;
|
|
16
|
+
displayName: z.ZodString;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
iconName: z.ZodString;
|
|
19
|
+
providerKey: z.ZodString;
|
|
20
|
+
scopes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
21
|
+
connectionCredentialKind: z.ZodEnum<typeof CredentialKind>;
|
|
22
|
+
adapterKind: z.ZodString;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
type AssertExtends<T extends U, U> = T;
|
|
25
|
+
export type ConnectorDescriptorValueIdentityGuards = [
|
|
26
|
+
AssertExtends<z.infer<typeof ConnectorDescriptorSchema>, ConnectorDescriptor>,
|
|
27
|
+
AssertExtends<ConnectorDescriptor, z.infer<typeof ConnectorDescriptorSchema>>
|
|
28
|
+
];
|
|
29
|
+
export {};
|
|
13
30
|
//# sourceMappingURL=connector-descriptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"connector-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AASrD,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAG1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAU7B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAOnC,QAAQ,CAAC,wBAAwB,EAAE,cAAc,CAAC;IAOlD,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;CACtC;AASD,eAAO,MAAM,yBAAyB;;;;;;;;;kBASpC,CAAC;AAIH,KAAK,aAAa,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,sCAAsC,GAAG;IACnD,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,EAAE,mBAAmB,CAAC;IAC7E,aAAa,CAAC,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;CAC9E,CAAC"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorDescriptorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const credential_kind_1 = require("./credential-kind");
|
|
6
|
+
exports.ConnectorDescriptorSchema = zod_1.z.strictObject({
|
|
7
|
+
connectorKey: zod_1.z.string().min(1),
|
|
8
|
+
displayName: zod_1.z.string().min(1),
|
|
9
|
+
description: zod_1.z.string().min(1),
|
|
10
|
+
iconName: zod_1.z.string().min(1),
|
|
11
|
+
providerKey: zod_1.z.string().min(1),
|
|
12
|
+
scopes: zod_1.z.array(zod_1.z.string()).readonly(),
|
|
13
|
+
connectionCredentialKind: zod_1.z.nativeEnum(credential_kind_1.CredentialKind),
|
|
14
|
+
adapterKind: zod_1.z.string().min(1),
|
|
15
|
+
});
|
|
3
16
|
//# sourceMappingURL=connector-descriptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"connector-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/connector-descriptor.ts"],"names":[],"mappings":";;;AAoBA,6BAAwB;AAExB,uDAAmD;AAwDtC,QAAA,yBAAyB,GAAG,OAAC,CAAC,YAAY,CAAC;IACtD,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,wBAAwB,EAAE,OAAC,CAAC,UAAU,CAAC,gCAAc,CAAC;IACtD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ContributedProviderDescriptorSchema: z.ZodObject<{
|
|
3
|
+
description: z.ZodString;
|
|
4
|
+
displayName: z.ZodString;
|
|
5
|
+
providerKey: z.ZodString;
|
|
6
|
+
iconName: z.ZodString;
|
|
7
|
+
category: z.ZodString;
|
|
8
|
+
appAuthKind: z.ZodEnum<typeof import("./provider-descriptor").ProviderAppAuthKind>;
|
|
9
|
+
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
10
|
+
key: z.ZodString;
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
type: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldType>;
|
|
13
|
+
required: z.ZodBoolean;
|
|
14
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
15
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
16
|
+
transform: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldTransform>;
|
|
17
|
+
}, z.core.$strict>>>>;
|
|
18
|
+
oauthEndpoints: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
authorizationUrl: z.ZodString;
|
|
20
|
+
tokenUrl: z.ZodString;
|
|
21
|
+
extraAuthorizeParams: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
22
|
+
clientIdEnvVar: z.ZodOptional<z.ZodString>;
|
|
23
|
+
clientSecretEnvVar: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
allowOrgOverride: z.ZodBoolean;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export type ContributedProviderDescriptor = z.infer<typeof ContributedProviderDescriptorSchema>;
|
|
28
|
+
export declare const IntegrationProviderContributionManifestSchema: z.ZodObject<{
|
|
29
|
+
provider: z.ZodObject<{
|
|
30
|
+
description: z.ZodString;
|
|
31
|
+
displayName: z.ZodString;
|
|
32
|
+
providerKey: z.ZodString;
|
|
33
|
+
iconName: z.ZodString;
|
|
34
|
+
category: z.ZodString;
|
|
35
|
+
appAuthKind: z.ZodEnum<typeof import("./provider-descriptor").ProviderAppAuthKind>;
|
|
36
|
+
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
37
|
+
key: z.ZodString;
|
|
38
|
+
label: z.ZodString;
|
|
39
|
+
type: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldType>;
|
|
40
|
+
required: z.ZodBoolean;
|
|
41
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
42
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
43
|
+
transform: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldTransform>;
|
|
44
|
+
}, z.core.$strict>>>>;
|
|
45
|
+
oauthEndpoints: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
authorizationUrl: z.ZodString;
|
|
47
|
+
tokenUrl: z.ZodString;
|
|
48
|
+
extraAuthorizeParams: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
49
|
+
clientIdEnvVar: z.ZodOptional<z.ZodString>;
|
|
50
|
+
clientSecretEnvVar: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
allowOrgOverride: z.ZodBoolean;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
connectors: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
55
|
+
connectorKey: z.ZodString;
|
|
56
|
+
displayName: z.ZodString;
|
|
57
|
+
description: z.ZodString;
|
|
58
|
+
iconName: z.ZodString;
|
|
59
|
+
providerKey: z.ZodString;
|
|
60
|
+
scopes: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
61
|
+
connectionCredentialKind: z.ZodEnum<typeof import("./credential-kind").CredentialKind>;
|
|
62
|
+
adapterKind: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
export type IntegrationProviderContributionManifest = z.infer<typeof IntegrationProviderContributionManifestSchema>;
|
|
66
|
+
//# sourceMappingURL=integration-provider-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-provider-contribution.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/integration-provider-contribution.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2BxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;kBACK,CAAC;AAEtD,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAQF,eAAO,MAAM,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDtD,CAAC;AAEL,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,6CAA6C,CACrD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationProviderContributionManifestSchema = exports.ContributedProviderDescriptorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const connector_descriptor_1 = require("./connector-descriptor");
|
|
6
|
+
const provider_descriptor_1 = require("./provider-descriptor");
|
|
7
|
+
const CONTRIBUTED_PROVIDER_KEY_REGEX = /^[a-z][a-z0-9_-]*$/;
|
|
8
|
+
const CONTRIBUTED_CONNECTOR_KEY_REGEX = /^[A-Z][A-Z0-9_]*$/;
|
|
9
|
+
exports.ContributedProviderDescriptorSchema = provider_descriptor_1.ProviderDescriptorBaseSchema.omit({ origin: true });
|
|
10
|
+
exports.IntegrationProviderContributionManifestSchema = zod_1.z
|
|
11
|
+
.strictObject({
|
|
12
|
+
provider: exports.ContributedProviderDescriptorSchema,
|
|
13
|
+
connectors: zod_1.z.array(connector_descriptor_1.ConnectorDescriptorSchema).min(1).readonly(),
|
|
14
|
+
})
|
|
15
|
+
.superRefine((manifest, ctx) => {
|
|
16
|
+
(0, provider_descriptor_1.providerOAuthEndpointsInvariant)(manifest.provider, ctx, ['provider']);
|
|
17
|
+
if (!CONTRIBUTED_PROVIDER_KEY_REGEX.test(manifest.provider.providerKey)) {
|
|
18
|
+
ctx.addIssue({
|
|
19
|
+
code: 'custom',
|
|
20
|
+
path: ['provider', 'providerKey'],
|
|
21
|
+
message: `providerKey "${manifest.provider.providerKey}" must be a lowercase ` +
|
|
22
|
+
`slug matching ${CONTRIBUTED_PROVIDER_KEY_REGEX.source}.`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const seenConnectorKeys = new Set();
|
|
26
|
+
manifest.connectors.forEach((connector, index) => {
|
|
27
|
+
if (!CONTRIBUTED_CONNECTOR_KEY_REGEX.test(connector.connectorKey)) {
|
|
28
|
+
ctx.addIssue({
|
|
29
|
+
code: 'custom',
|
|
30
|
+
path: ['connectors', index, 'connectorKey'],
|
|
31
|
+
message: `connectorKey "${connector.connectorKey}" must be UPPER_SNAKE ` +
|
|
32
|
+
`matching ${CONTRIBUTED_CONNECTOR_KEY_REGEX.source}.`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (connector.providerKey !== manifest.provider.providerKey) {
|
|
36
|
+
ctx.addIssue({
|
|
37
|
+
code: 'custom',
|
|
38
|
+
path: ['connectors', index, 'providerKey'],
|
|
39
|
+
message: `Connector "${connector.connectorKey}" references provider ` +
|
|
40
|
+
`"${connector.providerKey}" but this manifest contributes provider ` +
|
|
41
|
+
`"${manifest.provider.providerKey}" — a contribution's connectors ` +
|
|
42
|
+
`must belong to its own provider.`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (seenConnectorKeys.has(connector.connectorKey)) {
|
|
46
|
+
ctx.addIssue({
|
|
47
|
+
code: 'custom',
|
|
48
|
+
path: ['connectors', index, 'connectorKey'],
|
|
49
|
+
message: `Duplicate connectorKey "${connector.connectorKey}" in manifest.`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
seenConnectorKeys.add(connector.connectorKey);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=integration-provider-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-provider-contribution.js","sourceRoot":"","sources":["../../../src/connector/lib/integration-provider-contribution.ts"],"names":[],"mappings":";;;AAwBA,6BAAwB;AAExB,iEAAmE;AACnE,+DAG+B;AAM/B,MAAM,8BAA8B,GAAG,oBAAoB,CAAC;AAQ5D,MAAM,+BAA+B,GA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CAAC,CAAC;QACL,CAAC;QACD,IAAI,SAAS,CAAC,WAAW,KAAK,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;YAC5D,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,aAAa,CAAC;gBAC1C,OAAO,EACL,cAAc,SAAS,CAAC,YAAY,wBAAwB;oBAC5D,IAAI,SAAS,CAAC,WAAW,2CAA2C;oBACpE,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,kCAAkC;oBACnE,kCAAkC;aACrC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAClD,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,cAAc,CAAC;gBAC3C,OAAO,EAAE,2BAA2B,SAAS,CAAC,YAAY,gBAAgB;aAC3E,CAAC,CAAC;QACL,CAAC;QACD,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
export declare enum CredentialFieldType {
|
|
2
3
|
TEXT = "TEXT",
|
|
3
4
|
PASSWORD = "PASSWORD",
|
|
@@ -29,6 +30,15 @@ export interface CredentialFieldSpec {
|
|
|
29
30
|
readonly hint?: string;
|
|
30
31
|
readonly transform: CredentialFieldTransform;
|
|
31
32
|
}
|
|
33
|
+
export declare const CredentialFieldSpecSchema: z.ZodObject<{
|
|
34
|
+
key: z.ZodString;
|
|
35
|
+
label: z.ZodString;
|
|
36
|
+
type: z.ZodEnum<typeof CredentialFieldType>;
|
|
37
|
+
required: z.ZodBoolean;
|
|
38
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
39
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
40
|
+
transform: z.ZodEnum<typeof CredentialFieldTransform>;
|
|
41
|
+
}, z.core.$strict>;
|
|
32
42
|
export interface ProviderOnboardingManifest {
|
|
33
43
|
readonly provider: string;
|
|
34
44
|
readonly displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-manifest.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/onboarding-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"onboarding-manifest.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/onboarding-manifest.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,SAAS,cAAc;CACxB;AAQD,oBAAY,wBAAwB;IAClC,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAWD,oBAAY,yBAAyB;IACnC,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;CAC5B;AAmBD,oBAAY,wBAAwB;IAClC,aAAa,kBAAkB;IAC/B,OAAO,YAAY;IACnB,GAAG,QAAQ;CACZ;AAOD,MAAM,WAAW,mBAAmB;IAElC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAEnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;CAC9C;AASD,eAAO,MAAM,yBAAyB;;;;;;;;kBAQpC,CAAC;AAcH,MAAM,WAAW,0BAA0B;IAEzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAM7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IAczC,QAAQ,CAAC,mCAAmC,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAIlF,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAEjD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAMvB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAIlC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectBindingAdapterKey = exports.IntegrationOnboardingKind = exports.CredentialFieldTransform = exports.CredentialFieldType = void 0;
|
|
3
|
+
exports.CredentialFieldSpecSchema = exports.ProjectBindingAdapterKey = exports.IntegrationOnboardingKind = exports.CredentialFieldTransform = exports.CredentialFieldType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
4
5
|
var CredentialFieldType;
|
|
5
6
|
(function (CredentialFieldType) {
|
|
6
7
|
CredentialFieldType["TEXT"] = "TEXT";
|
|
@@ -27,4 +28,13 @@ var ProjectBindingAdapterKey;
|
|
|
27
28
|
ProjectBindingAdapterKey["TRACKER"] = "TRACKER";
|
|
28
29
|
ProjectBindingAdapterKey["SCM"] = "SCM";
|
|
29
30
|
})(ProjectBindingAdapterKey || (exports.ProjectBindingAdapterKey = ProjectBindingAdapterKey = {}));
|
|
31
|
+
exports.CredentialFieldSpecSchema = zod_1.z.strictObject({
|
|
32
|
+
key: zod_1.z.string().min(1),
|
|
33
|
+
label: zod_1.z.string().min(1),
|
|
34
|
+
type: zod_1.z.nativeEnum(CredentialFieldType),
|
|
35
|
+
required: zod_1.z.boolean(),
|
|
36
|
+
placeholder: zod_1.z.string().optional(),
|
|
37
|
+
hint: zod_1.z.string().optional(),
|
|
38
|
+
transform: zod_1.z.nativeEnum(CredentialFieldTransform),
|
|
39
|
+
});
|
|
30
40
|
//# sourceMappingURL=onboarding-manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-manifest.js","sourceRoot":"","sources":["../../../src/connector/lib/onboarding-manifest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"onboarding-manifest.js","sourceRoot":"","sources":["../../../src/connector/lib/onboarding-manifest.ts"],"names":[],"mappings":";;;AAsBA,6BAAwB;AAOxB,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,4CAAqB,CAAA;IACrB,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,8CAAuB,CAAA;AACzB,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAQD,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,mDAAuB,CAAA;IACvB,mDAAuB,CAAA;IACvB,yCAAa,CAAA;AACf,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC;AAWD,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,wDAA2B,CAAA;IAC3B,wDAA2B,CAAA;AAC7B,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC;AAmBD,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,2DAA+B,CAAA;IAC/B,+CAAmB,CAAA;IACnB,uCAAW,CAAA;AACb,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC;AA+BY,QAAA,yBAAyB,GAAG,OAAC,CAAC,YAAY,CAAC;IACtD,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,OAAC,CAAC,UAAU,CAAC,mBAAmB,CAAC;IACvC,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,OAAC,CAAC,UAAU,CAAC,wBAAwB,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CredentialFieldSpec } from './onboarding-manifest';
|
|
2
3
|
export declare enum ProviderAppAuthKind {
|
|
3
4
|
OAuth2 = "oauth2",
|
|
4
5
|
AppInstall = "app_install",
|
|
@@ -33,5 +34,78 @@ export interface ProviderDescriptor {
|
|
|
33
34
|
readonly oauthEndpoints?: ProviderOAuthEndpoints;
|
|
34
35
|
readonly allowOrgOverride: boolean;
|
|
35
36
|
}
|
|
37
|
+
export declare const ProviderOAuthEndpointsSchema: z.ZodObject<{
|
|
38
|
+
authorizationUrl: z.ZodString;
|
|
39
|
+
tokenUrl: z.ZodString;
|
|
40
|
+
extraAuthorizeParams: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
41
|
+
clientIdEnvVar: z.ZodOptional<z.ZodString>;
|
|
42
|
+
clientSecretEnvVar: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export declare const ProviderDescriptorBaseSchema: z.ZodObject<{
|
|
45
|
+
providerKey: z.ZodString;
|
|
46
|
+
displayName: z.ZodString;
|
|
47
|
+
description: z.ZodString;
|
|
48
|
+
iconName: z.ZodString;
|
|
49
|
+
category: z.ZodString;
|
|
50
|
+
appAuthKind: z.ZodEnum<typeof ProviderAppAuthKind>;
|
|
51
|
+
origin: z.ZodEnum<typeof ProviderOrigin>;
|
|
52
|
+
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
53
|
+
key: z.ZodString;
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
type: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldType>;
|
|
56
|
+
required: z.ZodBoolean;
|
|
57
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
58
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
59
|
+
transform: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldTransform>;
|
|
60
|
+
}, z.core.$strict>>>>;
|
|
61
|
+
oauthEndpoints: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
authorizationUrl: z.ZodString;
|
|
63
|
+
tokenUrl: z.ZodString;
|
|
64
|
+
extraAuthorizeParams: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
65
|
+
clientIdEnvVar: z.ZodOptional<z.ZodString>;
|
|
66
|
+
clientSecretEnvVar: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>>;
|
|
68
|
+
allowOrgOverride: z.ZodBoolean;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export declare function providerOAuthEndpointsInvariant(provider: Pick<ProviderDescriptor, 'providerKey' | 'appAuthKind'> & {
|
|
71
|
+
readonly oauthEndpoints?: unknown;
|
|
72
|
+
}, ctx: z.RefinementCtx, basePath?: readonly (string | number)[]): void;
|
|
73
|
+
export declare const ProviderDescriptorSchema: z.ZodObject<{
|
|
74
|
+
providerKey: z.ZodString;
|
|
75
|
+
displayName: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
iconName: z.ZodString;
|
|
78
|
+
category: z.ZodString;
|
|
79
|
+
appAuthKind: z.ZodEnum<typeof ProviderAppAuthKind>;
|
|
80
|
+
origin: z.ZodEnum<typeof ProviderOrigin>;
|
|
81
|
+
appCredentialSchema: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
82
|
+
key: z.ZodString;
|
|
83
|
+
label: z.ZodString;
|
|
84
|
+
type: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldType>;
|
|
85
|
+
required: z.ZodBoolean;
|
|
86
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
87
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
88
|
+
transform: z.ZodEnum<typeof import("./onboarding-manifest").CredentialFieldTransform>;
|
|
89
|
+
}, z.core.$strict>>>>;
|
|
90
|
+
oauthEndpoints: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
authorizationUrl: z.ZodString;
|
|
92
|
+
tokenUrl: z.ZodString;
|
|
93
|
+
extraAuthorizeParams: z.ZodOptional<z.ZodReadonly<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
94
|
+
clientIdEnvVar: z.ZodOptional<z.ZodString>;
|
|
95
|
+
clientSecretEnvVar: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
97
|
+
allowOrgOverride: z.ZodBoolean;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
type AssertExtends<T extends U, U> = T;
|
|
100
|
+
type AllowUndefinedOptionals<T> = T extends readonly (infer E)[] ? readonly AllowUndefinedOptionals<E>[] : T extends object ? {
|
|
101
|
+
[K in keyof T]: AllowUndefinedOptionals<T[K]> | undefined;
|
|
102
|
+
} : T;
|
|
103
|
+
export type ProviderDescriptorValueIdentityGuards = [
|
|
104
|
+
AssertExtends<z.infer<typeof ProviderOAuthEndpointsSchema>, AllowUndefinedOptionals<ProviderOAuthEndpoints>>,
|
|
105
|
+
AssertExtends<ProviderOAuthEndpoints, z.infer<typeof ProviderOAuthEndpointsSchema>>,
|
|
106
|
+
AssertExtends<z.infer<typeof ProviderDescriptorSchema>, AllowUndefinedOptionals<ProviderDescriptor>>,
|
|
107
|
+
AssertExtends<ProviderDescriptor, z.infer<typeof ProviderDescriptorSchema>>
|
|
108
|
+
];
|
|
36
109
|
export declare function providerRequiresAppCredential(provider: Pick<ProviderDescriptor, 'appAuthKind'>): boolean;
|
|
110
|
+
export {};
|
|
37
111
|
//# sourceMappingURL=provider-descriptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/provider-descriptor.ts"],"names":[],"mappings":"AA0BA,OAAO,
|
|
1
|
+
{"version":3,"file":"provider-descriptor.d.ts","sourceRoot":"","sources":["../../../src/connector/lib/provider-descriptor.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAQ/B,oBAAY,mBAAmB;IAO7B,MAAM,WAAW;IAMjB,UAAU,gBAAgB;IAO1B,IAAI,SAAS;CACd;AAaD,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAiBD,oBAAY,uBAAuB;IACjC,QAAQ,aAAa;IACrB,GAAG,QAAQ;CACZ;AAGD,eAAO,MAAM,+BAA+B,EAAE,SAAS,uBAAuB,EACb,CAAC;AAOlE,MAAM,WAAW,sBAAsB;IAErC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAQ1B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAQjE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,kBA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AM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,GAC7D,CAAC,CAAC;AACR,MAAM,MAAM,qCAAqC,GAAG;IAClD,aAAa,CACX,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,EAC5C,uBAAuB,CAAC,sBAAsB,CAAC,CAChD;IACD,aAAa,CACX,sBAAsB,EACtB,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAC7C;IACD,aAAa,CACX,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,EACxC,uBAAuB,CAAC,kBAAkB,CAAC,CAC5C;IACD,aAAa,CAAC,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;CAC5E,CAAC;AAOF,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAChD,OAAO,CAET"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROVIDER_CREDENTIAL_SCOPE_ORDER = exports.ProviderCredentialScope = exports.ProviderOrigin = exports.ProviderAppAuthKind = void 0;
|
|
3
|
+
exports.ProviderDescriptorSchema = exports.ProviderDescriptorBaseSchema = exports.ProviderOAuthEndpointsSchema = exports.PROVIDER_CREDENTIAL_SCOPE_ORDER = exports.ProviderCredentialScope = exports.ProviderOrigin = exports.ProviderAppAuthKind = void 0;
|
|
4
|
+
exports.providerOAuthEndpointsInvariant = providerOAuthEndpointsInvariant;
|
|
4
5
|
exports.providerRequiresAppCredential = providerRequiresAppCredential;
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const onboarding_manifest_1 = require("./onboarding-manifest");
|
|
5
8
|
var ProviderAppAuthKind;
|
|
6
9
|
(function (ProviderAppAuthKind) {
|
|
7
10
|
ProviderAppAuthKind["OAuth2"] = "oauth2";
|
|
@@ -20,6 +23,36 @@ var ProviderCredentialScope;
|
|
|
20
23
|
ProviderCredentialScope["Org"] = "org";
|
|
21
24
|
})(ProviderCredentialScope || (exports.ProviderCredentialScope = ProviderCredentialScope = {}));
|
|
22
25
|
exports.PROVIDER_CREDENTIAL_SCOPE_ORDER = [ProviderCredentialScope.Org, ProviderCredentialScope.Platform];
|
|
26
|
+
exports.ProviderOAuthEndpointsSchema = zod_1.z.strictObject({
|
|
27
|
+
authorizationUrl: zod_1.z.string().url(),
|
|
28
|
+
tokenUrl: zod_1.z.string().url(),
|
|
29
|
+
extraAuthorizeParams: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).readonly().optional(),
|
|
30
|
+
clientIdEnvVar: zod_1.z.string().min(1).optional(),
|
|
31
|
+
clientSecretEnvVar: zod_1.z.string().min(1).optional(),
|
|
32
|
+
});
|
|
33
|
+
exports.ProviderDescriptorBaseSchema = zod_1.z.strictObject({
|
|
34
|
+
providerKey: zod_1.z.string().min(1),
|
|
35
|
+
displayName: zod_1.z.string().min(1),
|
|
36
|
+
description: zod_1.z.string().min(1),
|
|
37
|
+
iconName: zod_1.z.string().min(1),
|
|
38
|
+
category: zod_1.z.string().min(1),
|
|
39
|
+
appAuthKind: zod_1.z.nativeEnum(ProviderAppAuthKind),
|
|
40
|
+
origin: zod_1.z.nativeEnum(ProviderOrigin),
|
|
41
|
+
appCredentialSchema: zod_1.z.array(onboarding_manifest_1.CredentialFieldSpecSchema).readonly().optional(),
|
|
42
|
+
oauthEndpoints: exports.ProviderOAuthEndpointsSchema.optional(),
|
|
43
|
+
allowOrgOverride: zod_1.z.boolean(),
|
|
44
|
+
});
|
|
45
|
+
function providerOAuthEndpointsInvariant(provider, ctx, basePath = []) {
|
|
46
|
+
if (provider.appAuthKind === ProviderAppAuthKind.OAuth2 &&
|
|
47
|
+
provider.oauthEndpoints === undefined) {
|
|
48
|
+
ctx.addIssue({
|
|
49
|
+
code: 'custom',
|
|
50
|
+
path: [...basePath, 'oauthEndpoints'],
|
|
51
|
+
message: `Provider "${provider.providerKey}" declares appAuthKind=oauth2 but has no oauthEndpoints.`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ProviderDescriptorSchema = exports.ProviderDescriptorBaseSchema.superRefine(providerOAuthEndpointsInvariant);
|
|
23
56
|
function providerRequiresAppCredential(provider) {
|
|
24
57
|
return provider.appAuthKind !== ProviderAppAuthKind.None;
|
|
25
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/provider-descriptor.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"provider-descriptor.js","sourceRoot":"","sources":["../../../src/connector/lib/provider-descriptor.ts"],"names":[],"mappings":";;;AAyNA,0EAiBC;AA0CD,sEAIC;AA9PD,6BAAwB;AAExB,+DAG+B;AAQ/B,IAAY,mBAqBX;AArBD,WAAY,mBAAmB;IAO7B,wCAAiB,CAAA;IAMjB,iDAA0B,CAAA;IAO1B,oCAAa,CAAA;AACf,CAAC,EArBW,mBAAmB,mCAAnB,mBAAmB,QAqB9B;AAaD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,iCAAe,CAAA;AACjB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAiBD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,gDAAqB,CAAA;IACrB,sCAAW,CAAA;AACb,CAAC,EAHW,uBAAuB,uCAAvB,uBAAuB,QAGlC;AAGY,QAAA,+BAA+B,GAC1C,CAAC,uBAAuB,CAAC,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CAAC;AAgFrD,QAAA,4BAA4B,GAAG,OAAC,CAAC,YAAY,CAAC;IACzD,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAA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AAE;IAE3C,IACE,QAAQ,CAAC,WAAW,KAAK,mBAAmB,CAAC,MAAM;QACnD,QAAQ,CAAC,cAAc,KAAK,SAAS,EACrC,CAAC;QACD,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,gBAAgB,CAAC;YACrC,OAAO,EAAE,aAAa,QAAQ,CAAC,WAAW,0DAA0D;SACrG,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAMY,QAAA,wBAAwB,GAAG,oCAA4B,CAAC,WAAW,CAC9E,+BAA+B,CAChC,CAAC;AAkCF,SAAgB,6BAA6B,CAC3C,QAAiD;IAEjD,OAAO,QAAQ,CAAC,WAAW,KAAK,mBAAmB,CAAC,IAAI,CAAC;AAC3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/distribution/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/distribution/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib/install-policy"), exports);
|
|
17
18
|
__exportStar(require("./lib/distribution-selector"), exports);
|
|
18
19
|
__exportStar(require("./lib/distribution"), exports);
|
|
19
20
|
__exportStar(require("./lib/distribution-lock"), exports);
|
|
@@ -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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B;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAWD,eAAO,MAAM,iBAAiB,EAuBxB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AAU7B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,EAGlC,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAYvC,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,CAAC,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAE/B,gBAAgB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAEnD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAO7B,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;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,EAAE;IACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,MAAM,EAAmC,CAAC;AAEhC,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,uBAAe;IACrB,MAAM,EAAE,yBAAiB;IACzB,MAAM,EAAE,yBAA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C,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,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zC,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,QAAQ,EAAE;CAC7C,CAAuC,CAAC;AAgB5B,QAAA,iCAAiC,GAAG,OAAC,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,iCAAyB;CAChC,CAA2C,CAAC;AAoChC,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,kDAA0B,CAAC,CAAC,QAAQ,EAAE;IACvD,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzD,WAAW,EAAE,qCAA6B,CAAC,QAAQ,EAAE;IACrD,gBAAgB,EAAE,OAAC,CAAC,KAAK,CAAC,yCAAiC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACnF,CAA4B,CAAC;AAM9B,SAAgB,iBAAiB,CAAC,GAAY;IAC5C,MAAM,MAAM,GAAG,0BAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACjD,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"}
|
|
@@ -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)",
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
47
47
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
48
48
|
"lint": "eslint .",
|
|
49
|
-
"check:boundary": "node scripts/check-subpath-dag.mjs"
|
|
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(),
|
|
@@ -5,6 +5,10 @@ import {
|
|
|
5
5
|
type BiomeTier,
|
|
6
6
|
type BiomeOrigin,
|
|
7
7
|
} from '../../biome';
|
|
8
|
+
import {
|
|
9
|
+
BiomeInstallPolicySchema,
|
|
10
|
+
type BiomeInstallPolicy,
|
|
11
|
+
} from './install-policy';
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* A `DistributionSelector` declares which biomes an `include[]` entry pulls
|
|
@@ -26,22 +30,43 @@ import {
|
|
|
26
30
|
* property a biome self-declares in its manifest — the same biome can be
|
|
27
31
|
* force-on in one distribution and optional/installable in another.
|
|
28
32
|
*
|
|
33
|
+
* **`installPolicy`** (on the `{ tier }` and `{ biome }` forms) stamps the
|
|
34
|
+
* package-model install policy per selector — e.g.
|
|
35
|
+
* `{ tier: "base", installPolicy: "default-selected" }` plus
|
|
36
|
+
* `{ biome: "backlog", installPolicy: "optional" }`. Resolution: kernel- and
|
|
37
|
+
* system-tier biomes are ALWAYS `required` (resolver invariant); otherwise the
|
|
38
|
+
* most specific matching selector wins (`{ biome }` beats `{ tier }`;
|
|
39
|
+
* conflicting policies at the same specificity fail-fast); no selector policy
|
|
40
|
+
* → `default-selected`. Like `mandatory`, never manifest-sourced.
|
|
41
|
+
*
|
|
29
42
|
* Selector matching is resolved against the global biome index; the resolver,
|
|
30
43
|
* not any consumer, applies these rules (the lockfile is the hard boundary).
|
|
31
44
|
*/
|
|
32
45
|
export type DistributionSelector =
|
|
33
|
-
| { tier: BiomeTier; mandatory?: boolean }
|
|
46
|
+
| { tier: BiomeTier; mandatory?: boolean; installPolicy?: BiomeInstallPolicy }
|
|
34
47
|
| { origin: BiomeOrigin }
|
|
35
|
-
| {
|
|
48
|
+
| {
|
|
49
|
+
biome: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
mandatory?: boolean;
|
|
52
|
+
installPolicy?: BiomeInstallPolicy;
|
|
53
|
+
};
|
|
36
54
|
|
|
37
55
|
export const DistributionSelectorSchema = z.union([
|
|
38
|
-
z
|
|
56
|
+
z
|
|
57
|
+
.object({
|
|
58
|
+
tier: BiomeTierSchema,
|
|
59
|
+
mandatory: z.boolean().optional(),
|
|
60
|
+
installPolicy: BiomeInstallPolicySchema.optional(),
|
|
61
|
+
})
|
|
62
|
+
.strict(),
|
|
39
63
|
z.object({ origin: BiomeOriginSchema }).strict(),
|
|
40
64
|
z
|
|
41
65
|
.object({
|
|
42
66
|
biome: z.string().min(1),
|
|
43
67
|
version: z.string().min(1).optional(),
|
|
44
68
|
mandatory: z.boolean().optional(),
|
|
69
|
+
installPolicy: BiomeInstallPolicySchema.optional(),
|
|
45
70
|
})
|
|
46
71
|
.strict(),
|
|
47
72
|
]) as z.ZodType<DistributionSelector>;
|
|
@@ -24,6 +24,25 @@ export const PlatformServiceTierSchema = z.union([
|
|
|
24
24
|
z.literal('edge'),
|
|
25
25
|
]) as z.ZodType<PlatformServiceTier>;
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Canonical boot/wave rank of every tier token — THE single vocabulary source
|
|
29
|
+
* for tier ordering across the boot graph, the CLI launcher's wave derivation,
|
|
30
|
+
* and the deploy-roster generators. Lower boots first. `infra` (-1) is the
|
|
31
|
+
* pre-wave: submodules + the external generic plane (identity, event-hub,
|
|
32
|
+
* secrets, llm-gateway, keycloak, postgres, etcd) that always boot before the
|
|
33
|
+
* Xema service mesh. Do NOT redeclare local tier-rank maps in consumers.
|
|
34
|
+
*/
|
|
35
|
+
export const PLATFORM_SERVICE_TIER_RANK: Readonly<
|
|
36
|
+
Record<PlatformServiceTier | 'infra', number>
|
|
37
|
+
> = {
|
|
38
|
+
infra: -1,
|
|
39
|
+
kernel: 0,
|
|
40
|
+
system: 1,
|
|
41
|
+
base: 2,
|
|
42
|
+
platform: 3,
|
|
43
|
+
edge: 4,
|
|
44
|
+
};
|
|
45
|
+
|
|
27
46
|
/**
|
|
28
47
|
* Schema-versioning seed for `xema-distribution.json`. Bumped via a coordinated
|
|
29
48
|
* PR on an incompatible shape change; consumers refuse versions they do not
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `BiomeInstallPolicy` — the package-model install policy a DISTRIBUTION stamps
|
|
5
|
+
* on every resolved biome (never manifest-sourced; the same biome can be
|
|
6
|
+
* `required` in one edition and `optional` in another).
|
|
7
|
+
*
|
|
8
|
+
* - `required` — always installed AND always launched. Kernel- and
|
|
9
|
+
* system-tier biomes are forced to this by the resolver
|
|
10
|
+
* (a platform invariant, regardless of selectors).
|
|
11
|
+
* - `default-selected` — shipped and launched by default; a deployment may
|
|
12
|
+
* opt out.
|
|
13
|
+
* - `optional` — shipped in the lock (catalog-visible, image built)
|
|
14
|
+
* but launched only when explicitly selected.
|
|
15
|
+
*
|
|
16
|
+
* Orthogonal to `LockedBiome.mandatory`, which is the org-DISABLE governance
|
|
17
|
+
* flag (may the org switch it off once shipped) — installPolicy decides what
|
|
18
|
+
* comes up by default; mandatory decides what can be turned off.
|
|
19
|
+
*/
|
|
20
|
+
export enum BiomeInstallPolicy {
|
|
21
|
+
Required = 'required',
|
|
22
|
+
DefaultSelected = 'default-selected',
|
|
23
|
+
Optional = 'optional',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const BiomeInstallPolicySchema = z.nativeEnum(BiomeInstallPolicy);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `BiomeLaunchMode` — WHERE/HOW a biome's services are launched. A distribution
|
|
30
|
+
* decision applied at resolve time (never manifest-sourced — the biome only
|
|
31
|
+
* declares WHAT it is).
|
|
32
|
+
*
|
|
33
|
+
* - `static` — launched as regular services in the static roster
|
|
34
|
+
* (dev launcher waves + prod services.yaml). The default
|
|
35
|
+
* semantics when the lock field is absent.
|
|
36
|
+
* - `per-installation` — a sidecar-host template instantiated dynamically by
|
|
37
|
+
* biome-host-api once a biome is installed; NOT a
|
|
38
|
+
* statically-launched service, so static rosters must
|
|
39
|
+
* not boot it standalone.
|
|
40
|
+
*/
|
|
41
|
+
export enum BiomeLaunchMode {
|
|
42
|
+
Static = 'static',
|
|
43
|
+
PerInstallation = 'per-installation',
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const BiomeLaunchModeSchema = z.nativeEnum(BiomeLaunchMode);
|