@backstage/connections 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/README.md +5 -0
- package/dist/api/DefaultConnectionService.cjs.js +205 -0
- package/dist/api/DefaultConnectionService.cjs.js.map +1 -0
- package/dist/api/declareConnection.cjs.js +14 -0
- package/dist/api/declareConnection.cjs.js.map +1 -0
- package/dist/definitions/lookup.cjs.js +16 -0
- package/dist/definitions/lookup.cjs.js.map +1 -0
- package/dist/definitions/types.cjs.js +32 -0
- package/dist/definitions/types.cjs.js.map +1 -0
- package/dist/index.cjs.js +15 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +311 -0
- package/dist/schema/awsCodeCommit.cjs.js +35 -0
- package/dist/schema/awsCodeCommit.cjs.js.map +1 -0
- package/dist/schema/awsS3.cjs.js +36 -0
- package/dist/schema/awsS3.cjs.js.map +1 -0
- package/dist/schema/azure.cjs.js +45 -0
- package/dist/schema/azure.cjs.js.map +1 -0
- package/dist/schema/azureBlobStorage.cjs.js +49 -0
- package/dist/schema/azureBlobStorage.cjs.js.map +1 -0
- package/dist/schema/bitbucketCloud.cjs.js +41 -0
- package/dist/schema/bitbucketCloud.cjs.js.map +1 -0
- package/dist/schema/bitbucketServer.cjs.js +34 -0
- package/dist/schema/bitbucketServer.cjs.js.map +1 -0
- package/dist/schema/gerrit.cjs.js +30 -0
- package/dist/schema/gerrit.cjs.js.map +1 -0
- package/dist/schema/gitea.cjs.js +28 -0
- package/dist/schema/gitea.cjs.js.map +1 -0
- package/dist/schema/github.cjs.js +49 -0
- package/dist/schema/github.cjs.js.map +1 -0
- package/dist/schema/gitlab.cjs.js +28 -0
- package/dist/schema/gitlab.cjs.js.map +1 -0
- package/dist/schema/googleGcs.cjs.js +27 -0
- package/dist/schema/googleGcs.cjs.js.map +1 -0
- package/dist/schema/harness.cjs.js +23 -0
- package/dist/schema/harness.cjs.js.map +1 -0
- package/dist/service.cjs.js +29 -0
- package/dist/service.cjs.js.map +1 -0
- package/dist/system/combineConnectionSources.cjs.js +26 -0
- package/dist/system/combineConnectionSources.cjs.js.map +1 -0
- package/dist/system/createConnectionType.cjs.js +39 -0
- package/dist/system/createConnectionType.cjs.js.map +1 -0
- package/dist/system/getLegacyIntegrations.cjs.js +332 -0
- package/dist/system/getLegacyIntegrations.cjs.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const AwsCodeCommitConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "aws-codecommit",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
region: v4.z.string()
|
|
11
|
+
}),
|
|
12
|
+
authMethods: [
|
|
13
|
+
{
|
|
14
|
+
method: "none",
|
|
15
|
+
configSchema: v4.z.object({})
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
method: "accessKey",
|
|
19
|
+
configSchema: v4.z.object({
|
|
20
|
+
accessKeyId: v4.z.string(),
|
|
21
|
+
secretAccessKey: v4.z.string()
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
method: "assumeRole",
|
|
26
|
+
configSchema: v4.z.object({
|
|
27
|
+
roleArn: v4.z.string(),
|
|
28
|
+
externalId: v4.z.string().optional()
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
exports.AwsCodeCommitConnectionType = AwsCodeCommitConnectionType;
|
|
35
|
+
//# sourceMappingURL=awsCodeCommit.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awsCodeCommit.cjs.js","sources":["../../src/schema/awsCodeCommit.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const AwsCodeCommitConnectionType = createConnectionType({\n type: 'aws-codecommit',\n configSchema: z.object({\n host: z.string(),\n region: z.string(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'accessKey',\n configSchema: z.object({\n accessKeyId: z.string(),\n secretAccessKey: z.string(),\n }),\n },\n {\n method: 'assumeRole',\n configSchema: z.object({\n roleArn: z.string(),\n externalId: z.string().optional(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,8BAA8BA,yCAAA,CAAqB;AAAA,EAC9D,IAAA,EAAM,gBAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,MAAA,EAAQA,KAAE,MAAA;AAAO,GAClB,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,WAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,WAAA,EAAaA,KAAE,MAAA,EAAO;AAAA,QACtB,eAAA,EAAiBA,KAAE,MAAA;AAAO,OAC3B;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,YAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,OAAA,EAASA,KAAE,MAAA,EAAO;AAAA,QAClB,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,OACjC;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const AwsS3ConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "aws-s3",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
endpoint: v4.z.string().optional(),
|
|
11
|
+
s3ForcePathStyle: v4.z.boolean().optional()
|
|
12
|
+
}),
|
|
13
|
+
authMethods: [
|
|
14
|
+
{
|
|
15
|
+
method: "none",
|
|
16
|
+
configSchema: v4.z.object({})
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
method: "accessKey",
|
|
20
|
+
configSchema: v4.z.object({
|
|
21
|
+
accessKeyId: v4.z.string(),
|
|
22
|
+
secretAccessKey: v4.z.string()
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
method: "assumeRole",
|
|
27
|
+
configSchema: v4.z.object({
|
|
28
|
+
roleArn: v4.z.string(),
|
|
29
|
+
externalId: v4.z.string().optional()
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.AwsS3ConnectionType = AwsS3ConnectionType;
|
|
36
|
+
//# sourceMappingURL=awsS3.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"awsS3.cjs.js","sources":["../../src/schema/awsS3.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const AwsS3ConnectionType = createConnectionType({\n type: 'aws-s3',\n configSchema: z.object({\n host: z.string(),\n endpoint: z.string().optional(),\n s3ForcePathStyle: z.boolean().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'accessKey',\n configSchema: z.object({\n accessKeyId: z.string(),\n secretAccessKey: z.string(),\n }),\n },\n {\n method: 'assumeRole',\n configSchema: z.object({\n roleArn: z.string(),\n externalId: z.string().optional(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,sBAAsBA,yCAAA,CAAqB;AAAA,EACtD,IAAA,EAAM,QAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,QAAA,EAAUA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9B,gBAAA,EAAkBA,IAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AAAS,GACxC,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,WAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,WAAA,EAAaA,KAAE,MAAA,EAAO;AAAA,QACtB,eAAA,EAAiBA,KAAE,MAAA;AAAO,OAC3B;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,YAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,OAAA,EAASA,KAAE,MAAA,EAAO;AAAA,QAClB,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,OACjC;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const AzureConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "azure",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string()
|
|
10
|
+
}),
|
|
11
|
+
authMethods: [
|
|
12
|
+
{
|
|
13
|
+
method: "none",
|
|
14
|
+
configSchema: v4.z.object({})
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
method: "pat",
|
|
18
|
+
configSchema: v4.z.object({
|
|
19
|
+
personalAccessToken: v4.z.string(),
|
|
20
|
+
orgs: v4.z.array(v4.z.string()).optional()
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
method: "clientCredentials",
|
|
25
|
+
configSchema: v4.z.object({
|
|
26
|
+
clientId: v4.z.string(),
|
|
27
|
+
clientSecret: v4.z.string(),
|
|
28
|
+
tenantId: v4.z.string(),
|
|
29
|
+
orgs: v4.z.array(v4.z.string()).optional()
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
method: "managedIdentity",
|
|
34
|
+
configSchema: v4.z.object({
|
|
35
|
+
clientId: v4.z.string(),
|
|
36
|
+
tenantId: v4.z.string().optional(),
|
|
37
|
+
managedIdentityClientId: v4.z.string().optional(),
|
|
38
|
+
orgs: v4.z.array(v4.z.string()).optional()
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
exports.AzureConnectionType = AzureConnectionType;
|
|
45
|
+
//# sourceMappingURL=azure.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure.cjs.js","sources":["../../src/schema/azure.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const AzureConnectionType = createConnectionType({\n type: 'azure',\n configSchema: z.object({\n host: z.string(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'pat',\n configSchema: z.object({\n personalAccessToken: z.string(),\n orgs: z.array(z.string()).optional(),\n }),\n },\n {\n method: 'clientCredentials',\n configSchema: z.object({\n clientId: z.string(),\n clientSecret: z.string(),\n tenantId: z.string(),\n orgs: z.array(z.string()).optional(),\n }),\n },\n {\n method: 'managedIdentity',\n configSchema: z.object({\n clientId: z.string(),\n tenantId: z.string().optional(),\n managedIdentityClientId: z.string().optional(),\n orgs: z.array(z.string()).optional(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,sBAAsBA,yCAAA,CAAqB;AAAA,EACtD,IAAA,EAAM,OAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA;AAAO,GAChB,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,KAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,mBAAA,EAAqBA,KAAE,MAAA,EAAO;AAAA,QAC9B,MAAMA,IAAA,CAAE,KAAA,CAAMA,KAAE,MAAA,EAAQ,EAAE,QAAA;AAAS,OACpC;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,mBAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,YAAA,EAAcA,KAAE,MAAA,EAAO;AAAA,QACvB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,MAAMA,IAAA,CAAE,KAAA,CAAMA,KAAE,MAAA,EAAQ,EAAE,QAAA;AAAS,OACpC;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,iBAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,QAAA,EAAUA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,QAC9B,uBAAA,EAAyBA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,QAC7C,MAAMA,IAAA,CAAE,KAAA,CAAMA,KAAE,MAAA,EAAQ,EAAE,QAAA;AAAS,OACpC;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const AzureBlobStorageConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "azure-blob-storage",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
accountName: v4.z.string().optional(),
|
|
11
|
+
endpoint: v4.z.string().optional(),
|
|
12
|
+
endpointSuffix: v4.z.string().optional()
|
|
13
|
+
}),
|
|
14
|
+
authMethods: [
|
|
15
|
+
{
|
|
16
|
+
method: "none",
|
|
17
|
+
configSchema: v4.z.object({})
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
method: "accountKey",
|
|
21
|
+
configSchema: v4.z.object({
|
|
22
|
+
accountKey: v4.z.string()
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
method: "sasToken",
|
|
27
|
+
configSchema: v4.z.object({
|
|
28
|
+
sasToken: v4.z.string()
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
method: "connectionString",
|
|
33
|
+
configSchema: v4.z.object({
|
|
34
|
+
connectionString: v4.z.string()
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
method: "aadCredential",
|
|
39
|
+
configSchema: v4.z.object({
|
|
40
|
+
clientId: v4.z.string(),
|
|
41
|
+
tenantId: v4.z.string(),
|
|
42
|
+
clientSecret: v4.z.string()
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
exports.AzureBlobStorageConnectionType = AzureBlobStorageConnectionType;
|
|
49
|
+
//# sourceMappingURL=azureBlobStorage.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azureBlobStorage.cjs.js","sources":["../../src/schema/azureBlobStorage.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const AzureBlobStorageConnectionType = createConnectionType({\n type: 'azure-blob-storage',\n configSchema: z.object({\n host: z.string(),\n accountName: z.string().optional(),\n endpoint: z.string().optional(),\n endpointSuffix: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'accountKey',\n configSchema: z.object({\n accountKey: z.string(),\n }),\n },\n {\n method: 'sasToken',\n configSchema: z.object({\n sasToken: z.string(),\n }),\n },\n {\n method: 'connectionString',\n configSchema: z.object({\n connectionString: z.string(),\n }),\n },\n {\n method: 'aadCredential',\n configSchema: z.object({\n clientId: z.string(),\n tenantId: z.string(),\n clientSecret: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,iCAAiCA,yCAAA,CAAqB;AAAA,EACjE,IAAA,EAAM,oBAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,WAAA,EAAaA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IACjC,QAAA,EAAUA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC9B,cAAA,EAAgBA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GACrC,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,YAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,UAAA,EAAYA,KAAE,MAAA;AAAO,OACtB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,UAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA;AAAO,OACpB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,kBAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,gBAAA,EAAkBA,KAAE,MAAA;AAAO,OAC5B;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,eAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,YAAA,EAAcA,KAAE,MAAA;AAAO,OACxB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const BitbucketCloudConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "bitbucket-cloud",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string()
|
|
10
|
+
}),
|
|
11
|
+
authMethods: [
|
|
12
|
+
{
|
|
13
|
+
method: "none",
|
|
14
|
+
configSchema: v4.z.object({})
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
method: "token",
|
|
18
|
+
configSchema: v4.z.object({
|
|
19
|
+
username: v4.z.string(),
|
|
20
|
+
token: v4.z.string()
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
method: "appPassword",
|
|
25
|
+
configSchema: v4.z.object({
|
|
26
|
+
username: v4.z.string(),
|
|
27
|
+
appPassword: v4.z.string()
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
method: "oauth",
|
|
32
|
+
configSchema: v4.z.object({
|
|
33
|
+
clientId: v4.z.string(),
|
|
34
|
+
clientSecret: v4.z.string()
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.BitbucketCloudConnectionType = BitbucketCloudConnectionType;
|
|
41
|
+
//# sourceMappingURL=bitbucketCloud.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucketCloud.cjs.js","sources":["../../src/schema/bitbucketCloud.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const BitbucketCloudConnectionType = createConnectionType({\n type: 'bitbucket-cloud',\n configSchema: z.object({\n host: z.string(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'token',\n configSchema: z.object({\n username: z.string(),\n token: z.string(),\n }),\n },\n {\n method: 'appPassword',\n configSchema: z.object({\n username: z.string(),\n appPassword: z.string(),\n }),\n },\n {\n method: 'oauth',\n configSchema: z.object({\n clientId: z.string(),\n clientSecret: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,+BAA+BA,yCAAA,CAAqB;AAAA,EAC/D,IAAA,EAAM,iBAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA;AAAO,GAChB,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,KAAA,EAAOA,KAAE,MAAA;AAAO,OACjB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,aAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,WAAA,EAAaA,KAAE,MAAA;AAAO,OACvB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,YAAA,EAAcA,KAAE,MAAA;AAAO,OACxB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const BitbucketServerConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "bitbucket-server",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
apiBaseUrl: v4.z.string().optional()
|
|
11
|
+
}),
|
|
12
|
+
authMethods: [
|
|
13
|
+
{
|
|
14
|
+
method: "none",
|
|
15
|
+
configSchema: v4.z.object({})
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
method: "token",
|
|
19
|
+
configSchema: v4.z.object({
|
|
20
|
+
token: v4.z.string()
|
|
21
|
+
})
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
method: "basic",
|
|
25
|
+
configSchema: v4.z.object({
|
|
26
|
+
username: v4.z.string(),
|
|
27
|
+
password: v4.z.string()
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.BitbucketServerConnectionType = BitbucketServerConnectionType;
|
|
34
|
+
//# sourceMappingURL=bitbucketServer.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucketServer.cjs.js","sources":["../../src/schema/bitbucketServer.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const BitbucketServerConnectionType = createConnectionType({\n type: 'bitbucket-server',\n configSchema: z.object({\n host: z.string(),\n apiBaseUrl: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'token',\n configSchema: z.object({\n token: z.string(),\n }),\n },\n {\n method: 'basic',\n configSchema: z.object({\n username: z.string(),\n password: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,gCAAgCA,yCAAA,CAAqB;AAAA,EAChE,IAAA,EAAM,kBAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GACjC,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,KAAA,EAAOA,KAAE,MAAA;AAAO,OACjB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,QAAA,EAAUA,KAAE,MAAA;AAAO,OACpB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const GerritConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "gerrit",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
baseUrl: v4.z.string().optional(),
|
|
11
|
+
gitilesBaseUrl: v4.z.string(),
|
|
12
|
+
cloneUrl: v4.z.string().optional()
|
|
13
|
+
}),
|
|
14
|
+
authMethods: [
|
|
15
|
+
{
|
|
16
|
+
method: "none",
|
|
17
|
+
configSchema: v4.z.object({})
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
method: "basic",
|
|
21
|
+
configSchema: v4.z.object({
|
|
22
|
+
username: v4.z.string(),
|
|
23
|
+
password: v4.z.string()
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
exports.GerritConnectionType = GerritConnectionType;
|
|
30
|
+
//# sourceMappingURL=gerrit.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gerrit.cjs.js","sources":["../../src/schema/gerrit.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const GerritConnectionType = createConnectionType({\n type: 'gerrit',\n configSchema: z.object({\n host: z.string(),\n baseUrl: z.string().optional(),\n gitilesBaseUrl: z.string(),\n cloneUrl: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'basic',\n configSchema: z.object({\n username: z.string(),\n password: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,uBAAuBA,yCAAA,CAAqB;AAAA,EACvD,IAAA,EAAM,QAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,OAAA,EAASA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAC7B,cAAA,EAAgBA,KAAE,MAAA,EAAO;AAAA,IACzB,QAAA,EAAUA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GAC/B,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,QAAA,EAAUA,KAAE,MAAA;AAAO,OACpB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const GiteaConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "gitea",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
baseUrl: v4.z.string().optional()
|
|
11
|
+
}),
|
|
12
|
+
authMethods: [
|
|
13
|
+
{
|
|
14
|
+
method: "none",
|
|
15
|
+
configSchema: v4.z.object({})
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
method: "basic",
|
|
19
|
+
configSchema: v4.z.object({
|
|
20
|
+
username: v4.z.string(),
|
|
21
|
+
password: v4.z.string()
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.GiteaConnectionType = GiteaConnectionType;
|
|
28
|
+
//# sourceMappingURL=gitea.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitea.cjs.js","sources":["../../src/schema/gitea.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const GiteaConnectionType = createConnectionType({\n type: 'gitea',\n configSchema: z.object({\n host: z.string(),\n baseUrl: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'basic',\n configSchema: z.object({\n username: z.string(),\n password: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,sBAAsBA,yCAAA,CAAqB;AAAA,EACtD,IAAA,EAAM,OAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,OAAA,EAASA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GAC9B,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,QAAA,EAAUA,KAAE,MAAA;AAAO,OACpB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const GithubConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "github",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
apiBaseUrl: v4.z.string().optional(),
|
|
11
|
+
rawBaseUrl: v4.z.string().optional()
|
|
12
|
+
}),
|
|
13
|
+
authMethods: [
|
|
14
|
+
{
|
|
15
|
+
method: "none",
|
|
16
|
+
configSchema: v4.z.object({})
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
method: "token",
|
|
20
|
+
configSchema: v4.z.object({
|
|
21
|
+
token: v4.z.string()
|
|
22
|
+
})
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
method: "app",
|
|
26
|
+
configSchema: v4.z.object({
|
|
27
|
+
appId: v4.z.union([v4.z.number(), v4.z.string()]),
|
|
28
|
+
privateKey: v4.z.string(),
|
|
29
|
+
clientId: v4.z.string(),
|
|
30
|
+
clientSecret: v4.z.string(),
|
|
31
|
+
webhookSecret: v4.z.string().optional(),
|
|
32
|
+
publicAccess: v4.z.boolean().optional(),
|
|
33
|
+
orgs: v4.z.array(v4.z.string()).optional()
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
matchAuth: (authMethods, query) => {
|
|
38
|
+
const org = new URL(query).pathname.split("/").filter(Boolean)[0];
|
|
39
|
+
const apps = authMethods.filter((a) => a.method === "app");
|
|
40
|
+
const appWithOrg = org ? apps.find((a) => a.orgs?.includes(org)) : void 0;
|
|
41
|
+
if (appWithOrg) return appWithOrg;
|
|
42
|
+
const unrestrictedApp = apps.find((a) => !a.orgs?.length);
|
|
43
|
+
if (unrestrictedApp) return unrestrictedApp;
|
|
44
|
+
return authMethods.find((a) => a.method === "token") ?? authMethods.find((a) => a.method === "none");
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
exports.GithubConnectionType = GithubConnectionType;
|
|
49
|
+
//# sourceMappingURL=github.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.cjs.js","sources":["../../src/schema/github.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const GithubConnectionType = createConnectionType({\n type: 'github',\n configSchema: z.object({\n host: z.string(),\n apiBaseUrl: z.string().optional(),\n rawBaseUrl: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'token',\n configSchema: z.object({\n token: z.string(),\n }),\n },\n {\n method: 'app',\n configSchema: z.object({\n appId: z.union([z.number(), z.string()]),\n privateKey: z.string(),\n clientId: z.string(),\n clientSecret: z.string(),\n webhookSecret: z.string().optional(),\n publicAccess: z.boolean().optional(),\n orgs: z.array(z.string()).optional(),\n }),\n },\n ],\n matchAuth: (authMethods, query) => {\n const org = new URL(query).pathname.split('/').filter(Boolean)[0];\n const apps = authMethods.filter(a => a.method === 'app');\n const appWithOrg = org ? apps.find(a => a.orgs?.includes(org)) : undefined;\n if (appWithOrg) return appWithOrg;\n const unrestrictedApp = apps.find(a => !a.orgs?.length);\n if (unrestrictedApp) return unrestrictedApp;\n\n return (\n authMethods.find(a => a.method === 'token') ??\n authMethods.find(a => a.method === 'none')\n );\n },\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,uBAAuBA,yCAAA,CAAqB;AAAA,EACvD,IAAA,EAAM,QAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAChC,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GACjC,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,KAAA,EAAOA,KAAE,MAAA;AAAO,OACjB;AAAA,KACH;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,KAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,KAAA,EAAOA,IAAA,CAAE,KAAA,CAAM,CAACA,IAAA,CAAE,QAAO,EAAGA,IAAA,CAAE,MAAA,EAAQ,CAAC,CAAA;AAAA,QACvC,UAAA,EAAYA,KAAE,MAAA,EAAO;AAAA,QACrB,QAAA,EAAUA,KAAE,MAAA,EAAO;AAAA,QACnB,YAAA,EAAcA,KAAE,MAAA,EAAO;AAAA,QACvB,aAAA,EAAeA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,QACnC,YAAA,EAAcA,IAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS;AAAA,QACnC,MAAMA,IAAA,CAAE,KAAA,CAAMA,KAAE,MAAA,EAAQ,EAAE,QAAA;AAAS,OACpC;AAAA;AACH,GACF;AAAA,EACA,SAAA,EAAW,CAAC,WAAA,EAAa,KAAA,KAAU;AACjC,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,KAAK,CAAA,CAAE,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA,CAAE,CAAC,CAAA;AAChE,IAAA,MAAM,OAAO,WAAA,CAAY,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,CAAE,WAAW,KAAK,CAAA;AACvD,IAAA,MAAM,UAAA,GAAa,GAAA,GAAM,IAAA,CAAK,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,IAAA,EAAM,QAAA,CAAS,GAAG,CAAC,CAAA,GAAI,MAAA;AACjE,IAAA,IAAI,YAAY,OAAO,UAAA;AACvB,IAAA,MAAM,kBAAkB,IAAA,CAAK,IAAA,CAAK,OAAK,CAAC,CAAA,CAAE,MAAM,MAAM,CAAA;AACtD,IAAA,IAAI,iBAAiB,OAAO,eAAA;AAE5B,IAAA,OACE,WAAA,CAAY,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,KAAW,OAAO,CAAA,IAC1C,WAAA,CAAY,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,KAAW,MAAM,CAAA;AAAA,EAE7C;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const GitlabConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "gitlab",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string(),
|
|
10
|
+
apiBaseUrl: v4.z.string().optional(),
|
|
11
|
+
baseUrl: v4.z.string().optional()
|
|
12
|
+
}),
|
|
13
|
+
authMethods: [
|
|
14
|
+
{
|
|
15
|
+
method: "none",
|
|
16
|
+
configSchema: v4.z.object({})
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
method: "token",
|
|
20
|
+
configSchema: v4.z.object({
|
|
21
|
+
token: v4.z.string()
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.GitlabConnectionType = GitlabConnectionType;
|
|
28
|
+
//# sourceMappingURL=gitlab.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.cjs.js","sources":["../../src/schema/gitlab.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const GitlabConnectionType = createConnectionType({\n type: 'gitlab',\n configSchema: z.object({\n host: z.string(),\n apiBaseUrl: z.string().optional(),\n baseUrl: z.string().optional(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'token',\n configSchema: z.object({\n token: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,uBAAuBA,yCAAA,CAAqB;AAAA,EACvD,IAAA,EAAM,QAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA,EAAO;AAAA,IACf,UAAA,EAAYA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,IAChC,OAAA,EAASA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GAC9B,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,KAAA,EAAOA,KAAE,MAAA;AAAO,OACjB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const GoogleGcsConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "google-gcs",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string()
|
|
10
|
+
}),
|
|
11
|
+
authMethods: [
|
|
12
|
+
{
|
|
13
|
+
method: "none",
|
|
14
|
+
configSchema: v4.z.object({})
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
method: "serviceAccount",
|
|
18
|
+
configSchema: v4.z.object({
|
|
19
|
+
clientEmail: v4.z.string(),
|
|
20
|
+
privateKey: v4.z.string()
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
exports.GoogleGcsConnectionType = GoogleGcsConnectionType;
|
|
27
|
+
//# sourceMappingURL=googleGcs.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googleGcs.cjs.js","sources":["../../src/schema/googleGcs.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const GoogleGcsConnectionType = createConnectionType({\n type: 'google-gcs',\n configSchema: z.object({\n host: z.string(),\n }),\n authMethods: [\n {\n method: 'none',\n configSchema: z.object({}),\n },\n {\n method: 'serviceAccount',\n configSchema: z.object({\n clientEmail: z.string(),\n privateKey: z.string(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,0BAA0BA,yCAAA,CAAqB;AAAA,EAC1D,IAAA,EAAM,YAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA;AAAO,GAChB,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,MAAA;AAAA,MACR,YAAA,EAAcA,IAAA,CAAE,MAAA,CAAO,EAAE;AAAA,KAC3B;AAAA,IACA;AAAA,MACE,MAAA,EAAQ,gBAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,WAAA,EAAaA,KAAE,MAAA,EAAO;AAAA,QACtB,UAAA,EAAYA,KAAE,MAAA;AAAO,OACtB;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createConnectionType = require('../system/createConnectionType.cjs.js');
|
|
4
|
+
var v4 = require('zod/v4');
|
|
5
|
+
|
|
6
|
+
const HarnessConnectionType = createConnectionType.createConnectionType({
|
|
7
|
+
type: "harness",
|
|
8
|
+
configSchema: v4.z.object({
|
|
9
|
+
host: v4.z.string()
|
|
10
|
+
}),
|
|
11
|
+
authMethods: [
|
|
12
|
+
{
|
|
13
|
+
method: "token",
|
|
14
|
+
configSchema: v4.z.object({
|
|
15
|
+
token: v4.z.string(),
|
|
16
|
+
apiKey: v4.z.string().optional()
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
exports.HarnessConnectionType = HarnessConnectionType;
|
|
23
|
+
//# sourceMappingURL=harness.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.cjs.js","sources":["../../src/schema/harness.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createConnectionType } from '../system/createConnectionType';\nimport { z } from 'zod/v4';\n\n/** @public */\nexport const HarnessConnectionType = createConnectionType({\n type: 'harness',\n configSchema: z.object({\n host: z.string(),\n }),\n authMethods: [\n {\n method: 'token',\n configSchema: z.object({\n token: z.string(),\n apiKey: z.string().optional(),\n }),\n },\n ],\n});\n"],"names":["createConnectionType","z"],"mappings":";;;;;AAmBO,MAAM,wBAAwBA,yCAAA,CAAqB;AAAA,EACxD,IAAA,EAAM,SAAA;AAAA,EACN,YAAA,EAAcC,KAAE,MAAA,CAAO;AAAA,IACrB,IAAA,EAAMA,KAAE,MAAA;AAAO,GAChB,CAAA;AAAA,EACD,WAAA,EAAa;AAAA,IACX;AAAA,MACE,MAAA,EAAQ,OAAA;AAAA,MACR,YAAA,EAAcA,KAAE,MAAA,CAAO;AAAA,QACrB,KAAA,EAAOA,KAAE,MAAA,EAAO;AAAA,QAChB,MAAA,EAAQA,IAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,OAC7B;AAAA;AACH;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
|
+
var DefaultConnectionService = require('./api/DefaultConnectionService.cjs.js');
|
|
5
|
+
|
|
6
|
+
const connectionsServiceRef = backendPluginApi.createServiceRef({
|
|
7
|
+
id: "core.connections",
|
|
8
|
+
scope: "plugin"
|
|
9
|
+
});
|
|
10
|
+
const connectionsServiceFactory = backendPluginApi.createServiceFactory({
|
|
11
|
+
service: connectionsServiceRef,
|
|
12
|
+
deps: {
|
|
13
|
+
pluginMetadata: backendPluginApi.coreServices.pluginMetadata,
|
|
14
|
+
rootLogger: backendPluginApi.coreServices.rootLogger,
|
|
15
|
+
logger: backendPluginApi.coreServices.logger,
|
|
16
|
+
config: backendPluginApi.coreServices.rootConfig
|
|
17
|
+
},
|
|
18
|
+
async createRootContext({ rootLogger, config }) {
|
|
19
|
+
return DefaultConnectionService.DefaultConnectionsService.create({ logger: rootLogger, config });
|
|
20
|
+
},
|
|
21
|
+
async factory({ logger, pluginMetadata }, connectionsService) {
|
|
22
|
+
const pluginId = pluginMetadata.getId();
|
|
23
|
+
return connectionsService.forPlugin(pluginId, { logger });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.connectionsServiceFactory = connectionsServiceFactory;
|
|
28
|
+
exports.connectionsServiceRef = connectionsServiceRef;
|
|
29
|
+
//# sourceMappingURL=service.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.cjs.js","sources":["../src/service.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n coreServices,\n createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { ConnectionsService, DefaultConnectionsService } from './api';\n\n/** @public */\nexport const connectionsServiceRef = createServiceRef<ConnectionsService>({\n id: 'core.connections',\n scope: 'plugin',\n});\n\n/** @public */\nexport const connectionsServiceFactory = createServiceFactory({\n service: connectionsServiceRef,\n deps: {\n pluginMetadata: coreServices.pluginMetadata,\n rootLogger: coreServices.rootLogger,\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n },\n async createRootContext({ rootLogger, config }) {\n return DefaultConnectionsService.create({ logger: rootLogger, config });\n },\n\n async factory({ logger, pluginMetadata }, connectionsService) {\n const pluginId = pluginMetadata.getId();\n return connectionsService.forPlugin(pluginId, { logger });\n },\n});\n"],"names":["createServiceRef","createServiceFactory","coreServices","DefaultConnectionsService"],"mappings":";;;;;AAwBO,MAAM,wBAAwBA,iCAAA,CAAqC;AAAA,EACxE,EAAA,EAAI,kBAAA;AAAA,EACJ,KAAA,EAAO;AACT,CAAC;AAGM,MAAM,4BAA4BC,qCAAA,CAAqB;AAAA,EAC5D,OAAA,EAAS,qBAAA;AAAA,EACT,IAAA,EAAM;AAAA,IACJ,gBAAgBC,6BAAA,CAAa,cAAA;AAAA,IAC7B,YAAYA,6BAAA,CAAa,UAAA;AAAA,IACzB,QAAQA,6BAAA,CAAa,MAAA;AAAA,IACrB,QAAQA,6BAAA,CAAa;AAAA,GACvB;AAAA,EACA,MAAM,iBAAA,CAAkB,EAAE,UAAA,EAAY,QAAO,EAAG;AAC9C,IAAA,OAAOC,mDAA0B,MAAA,CAAO,EAAE,MAAA,EAAQ,UAAA,EAAY,QAAQ,CAAA;AAAA,EACxE,CAAA;AAAA,EAEA,MAAM,OAAA,CAAQ,EAAE,MAAA,EAAQ,cAAA,IAAkB,kBAAA,EAAoB;AAC5D,IAAA,MAAM,QAAA,GAAW,eAAe,KAAA,EAAM;AACtC,IAAA,OAAO,kBAAA,CAAmB,SAAA,CAAU,QAAA,EAAU,EAAE,QAAQ,CAAA;AAAA,EAC1D;AACF,CAAC;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function combineConnectionSources(legacy, fromConfig, logger) {
|
|
4
|
+
const typeOf = (c) => c.type;
|
|
5
|
+
const typesInConfig = new Set(fromConfig.map(typeOf));
|
|
6
|
+
const warned = /* @__PURE__ */ new Set();
|
|
7
|
+
const result = [];
|
|
8
|
+
for (const legacyConn of legacy) {
|
|
9
|
+
const type = typeOf(legacyConn);
|
|
10
|
+
if (typesInConfig.has(type)) {
|
|
11
|
+
if (!warned.has(type)) {
|
|
12
|
+
warned.add(type);
|
|
13
|
+
logger.warn(
|
|
14
|
+
`Connection type "${type}" is defined in both legacy integrations and connections config; legacy integrations of this type are ignored.`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
result.push(legacyConn);
|
|
20
|
+
}
|
|
21
|
+
result.push(...fromConfig);
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.combineConnectionSources = combineConnectionSources;
|
|
26
|
+
//# sourceMappingURL=combineConnectionSources.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combineConnectionSources.cjs.js","sources":["../../src/system/combineConnectionSources.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { RootConnection } from '../api/Connection';\n\n/**\n * Merges connections derived from legacy `integrations.*` config with\n * connections defined explicitly in `connections:` config.\n *\n * If any entry in `fromConfig` declares a given connection type, all legacy\n * entries of that type are discarded — the connections config fully takes\n * over for that type. A single warning is logged per discarded type.\n */\nexport function combineConnectionSources(\n legacy: RootConnection[],\n fromConfig: RootConnection[],\n logger: LoggerService,\n): RootConnection[] {\n const typeOf = (c: RootConnection) => c.type as string;\n const typesInConfig = new Set(fromConfig.map(typeOf));\n\n const warned = new Set<string>();\n const result: RootConnection[] = [];\n\n for (const legacyConn of legacy) {\n const type = typeOf(legacyConn);\n if (typesInConfig.has(type)) {\n if (!warned.has(type)) {\n warned.add(type);\n logger.warn(\n `Connection type \"${type}\" is defined in both legacy integrations and connections config; legacy integrations of this type are ignored.`,\n );\n }\n continue;\n }\n result.push(legacyConn);\n }\n\n result.push(...fromConfig);\n\n return result;\n}\n"],"names":[],"mappings":";;AA0BO,SAAS,wBAAA,CACd,MAAA,EACA,UAAA,EACA,MAAA,EACkB;AAClB,EAAA,MAAM,MAAA,GAAS,CAAC,CAAA,KAAsB,CAAA,CAAE,IAAA;AACxC,EAAA,MAAM,gBAAgB,IAAI,GAAA,CAAI,UAAA,CAAW,GAAA,CAAI,MAAM,CAAC,CAAA;AAEpD,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAY;AAC/B,EAAA,MAAM,SAA2B,EAAC;AAElC,EAAA,KAAA,MAAW,cAAc,MAAA,EAAQ;AAC/B,IAAA,MAAM,IAAA,GAAO,OAAO,UAAU,CAAA;AAC9B,IAAA,IAAI,aAAA,CAAc,GAAA,CAAI,IAAI,CAAA,EAAG;AAC3B,MAAA,IAAI,CAAC,MAAA,CAAO,GAAA,CAAI,IAAI,CAAA,EAAG;AACrB,QAAA,MAAA,CAAO,IAAI,IAAI,CAAA;AACf,QAAA,MAAA,CAAO,IAAA;AAAA,UACL,oBAAoB,IAAI,CAAA,8GAAA;AAAA,SAC1B;AAAA,MACF;AACA,MAAA;AAAA,IACF;AACA,IAAA,MAAA,CAAO,KAAK,UAAU,CAAA;AAAA,EACxB;AAEA,EAAA,MAAA,CAAO,IAAA,CAAK,GAAG,UAAU,CAAA;AAEzB,EAAA,OAAO,MAAA;AACT;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var v4 = require('zod/v4');
|
|
4
|
+
|
|
5
|
+
const matchSchema = v4.z.object({ plugins: v4.z.array(v4.z.string()) }).strict().optional();
|
|
6
|
+
function createConnectionType({
|
|
7
|
+
configSchema,
|
|
8
|
+
type,
|
|
9
|
+
authMethods,
|
|
10
|
+
matchAuth
|
|
11
|
+
}) {
|
|
12
|
+
const authOptions = authMethods.map(
|
|
13
|
+
(am) => am.configSchema.extend({
|
|
14
|
+
method: v4.z.literal(am.method),
|
|
15
|
+
match: matchSchema
|
|
16
|
+
}).strict()
|
|
17
|
+
);
|
|
18
|
+
const validated = configSchema;
|
|
19
|
+
const schema = validated.extend({
|
|
20
|
+
type: v4.z.literal(type),
|
|
21
|
+
match: matchSchema,
|
|
22
|
+
auth: v4.z.array(
|
|
23
|
+
authOptions.length === 1 ? authOptions[0] : v4.z.discriminatedUnion(
|
|
24
|
+
"method",
|
|
25
|
+
authOptions
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
}).strict();
|
|
29
|
+
return {
|
|
30
|
+
type,
|
|
31
|
+
configSchema: validated,
|
|
32
|
+
authMethods,
|
|
33
|
+
schema,
|
|
34
|
+
matchAuth
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.createConnectionType = createConnectionType;
|
|
39
|
+
//# sourceMappingURL=createConnectionType.cjs.js.map
|