@ductape/sdk 0.1.11 → 0.1.13
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/api/services/cloudApi.service.d.ts +8 -8
- package/dist/api/services/cloudApi.service.js +30 -12
- package/dist/api/services/cloudApi.service.js.map +1 -1
- package/dist/api/services/webhooksApi.service.js +6 -4
- package/dist/api/services/webhooksApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +2 -0
- package/dist/api/urls.js +3 -1
- package/dist/api/urls.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +4 -0
- package/dist/apps/services/app.service.js +37 -0
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/brokers/brokers.service.js +23 -1
- package/dist/brokers/brokers.service.js.map +1 -1
- package/dist/brokers/utils/broker.util.js +4 -1
- package/dist/brokers/utils/broker.util.js.map +1 -1
- package/dist/brokers/utils/providers/azure-servicebus.service.d.ts +17 -0
- package/dist/brokers/utils/providers/azure-servicebus.service.js +51 -0
- package/dist/brokers/utils/providers/azure-servicebus.service.js.map +1 -0
- package/dist/cloud/cloud-api.util.d.ts +4 -0
- package/dist/cloud/cloud-api.util.js +27 -0
- package/dist/cloud/cloud-api.util.js.map +1 -0
- package/dist/cloud/cloud-broker-link.util.d.ts +9 -0
- package/dist/cloud/cloud-broker-link.util.js +83 -0
- package/dist/cloud/cloud-broker-link.util.js.map +1 -0
- package/dist/cloud/cloud-database-link.util.d.ts +12 -0
- package/dist/cloud/cloud-database-link.util.js +62 -0
- package/dist/cloud/cloud-database-link.util.js.map +1 -0
- package/dist/cloud/cloud-graph-link.util.d.ts +12 -0
- package/dist/cloud/cloud-graph-link.util.js +61 -0
- package/dist/cloud/cloud-graph-link.util.js.map +1 -0
- package/dist/cloud/cloud-runtime.util.js +21 -9
- package/dist/cloud/cloud-runtime.util.js.map +1 -1
- package/dist/cloud/cloud-service-map.util.d.ts +3 -0
- package/dist/cloud/cloud-service-map.util.js +52 -0
- package/dist/cloud/cloud-service-map.util.js.map +1 -0
- package/dist/cloud/cloud-vector-link.util.d.ts +12 -0
- package/dist/cloud/cloud-vector-link.util.js +60 -0
- package/dist/cloud/cloud-vector-link.util.js.map +1 -0
- package/dist/cloud/cloud.service.d.ts +11 -16
- package/dist/cloud/cloud.service.js +10 -14
- package/dist/cloud/cloud.service.js.map +1 -1
- package/dist/cloud/index.d.ts +6 -0
- package/dist/cloud/index.js +14 -1
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/types/cloud.types.d.ts +22 -7
- package/dist/database/databases.service.js +2 -0
- package/dist/database/databases.service.js.map +1 -1
- package/dist/database/types/connection.interface.d.ts +4 -0
- package/dist/graph/adapters/adapter.factory.js +4 -0
- package/dist/graph/adapters/adapter.factory.js.map +1 -1
- package/dist/graph/adapters/cosmos-gremlin.adapter.d.ts +12 -0
- package/dist/graph/adapters/cosmos-gremlin.adapter.js +125 -0
- package/dist/graph/adapters/cosmos-gremlin.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +2 -0
- package/dist/graph/adapters/index.js +5 -1
- package/dist/graph/adapters/index.js.map +1 -1
- package/dist/graph/adapters/neptune.adapter.d.ts +4 -4
- package/dist/graph/adapters/neptune.adapter.js.map +1 -1
- package/dist/graph/adapters/spanner-graph.adapter.d.ts +68 -0
- package/dist/graph/adapters/spanner-graph.adapter.js +220 -0
- package/dist/graph/adapters/spanner-graph.adapter.js.map +1 -0
- package/dist/graph/types/enums.d.ts +2 -0
- package/dist/graph/types/enums.js +2 -0
- package/dist/graph/types/enums.js.map +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.js +30 -9
- package/dist/index.js.map +1 -1
- package/dist/logs/logs.types.d.ts +5 -1
- package/dist/logs/logs.types.js +2 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/products/services/products.service.d.ts +14 -0
- package/dist/products/services/products.service.js +296 -118
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +22 -17
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +8 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +51 -9
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +39 -26
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.js +8 -0
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js +4 -0
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -1
- package/dist/resilience/fallback.service.js +11 -6
- package/dist/resilience/fallback.service.js.map +1 -1
- package/dist/resilience/quota.service.d.ts +1 -1
- package/dist/resilience/quota.service.js +48 -10
- package/dist/resilience/quota.service.js.map +1 -1
- package/dist/resilience/resilience-mapping.utils.d.ts +5 -0
- package/dist/resilience/resilience-mapping.utils.js +53 -0
- package/dist/resilience/resilience-mapping.utils.js.map +1 -0
- package/dist/storage/storage-cloud-link.util.d.ts +13 -0
- package/dist/storage/storage-cloud-link.util.js +92 -0
- package/dist/storage/storage-cloud-link.util.js.map +1 -0
- package/dist/types/productsBuilder.types.d.ts +17 -0
- package/dist/types/productsBuilder.types.js +6 -0
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/vector/adapters/azure-search.adapter.d.ts +25 -0
- package/dist/vector/adapters/azure-search.adapter.js +217 -0
- package/dist/vector/adapters/azure-search.adapter.js.map +1 -0
- package/dist/vector/adapters/index.d.ts +3 -0
- package/dist/vector/adapters/index.js +7 -1
- package/dist/vector/adapters/index.js.map +1 -1
- package/dist/vector/adapters/opensearch.adapter.d.ts +25 -0
- package/dist/vector/adapters/opensearch.adapter.js +224 -0
- package/dist/vector/adapters/opensearch.adapter.js.map +1 -0
- package/dist/vector/adapters/vertex-vector-search.adapter.d.ts +29 -0
- package/dist/vector/adapters/vertex-vector-search.adapter.js +178 -0
- package/dist/vector/adapters/vertex-vector-search.adapter.js.map +1 -0
- package/dist/vector/types/enums.d.ts +6 -0
- package/dist/vector/types/enums.js +6 -0
- package/dist/vector/types/enums.js.map +1 -1
- package/dist/vector/vector.service.js +6 -0
- package/dist/vector/vector.service.js.map +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.materializeCloudLinkedGraphEnv = materializeCloudLinkedGraphEnv;
|
|
4
|
+
const cloud_service_map_util_1 = require("./cloud-service-map.util");
|
|
5
|
+
function draftToGraphEnv(draft, cloudTag, slug) {
|
|
6
|
+
const envs = draft.envs;
|
|
7
|
+
if (!(envs === null || envs === void 0 ? void 0 : envs.length)) {
|
|
8
|
+
throw new Error('Cloud graph link did not return an environment draft');
|
|
9
|
+
}
|
|
10
|
+
const draftEnv = envs.find((e) => e.slug === slug) || envs[0];
|
|
11
|
+
return {
|
|
12
|
+
slug,
|
|
13
|
+
connection_url: String(draftEnv.connection_url || ''),
|
|
14
|
+
authMode: 'cloud_connection',
|
|
15
|
+
cloud: cloudTag,
|
|
16
|
+
region: draftEnv.region ? String(draftEnv.region) : undefined,
|
|
17
|
+
username: draftEnv.username ? String(draftEnv.username) : undefined,
|
|
18
|
+
password: draftEnv.password ? String(draftEnv.password) : undefined,
|
|
19
|
+
database: draftEnv.database ? String(draftEnv.database) : undefined,
|
|
20
|
+
iamAuth: draftEnv.iamAuth === true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function materializeCloudLinkedGraphEnv(env, ctx) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
const cloudTag = env.cloud;
|
|
26
|
+
if (!cloudTag) {
|
|
27
|
+
return env;
|
|
28
|
+
}
|
|
29
|
+
const connection = await ctx.cloudApi.fetchConnection(cloudTag, ctx.auth);
|
|
30
|
+
const service = (0, cloud_service_map_util_1.requireCloudService)('graphs', connection.provider);
|
|
31
|
+
const instance = String(env.instance || '').trim();
|
|
32
|
+
const region = env.region ? String(env.region) : undefined;
|
|
33
|
+
const baseInput = {
|
|
34
|
+
service,
|
|
35
|
+
componentType: 'graphs',
|
|
36
|
+
productTag: ctx.productTag,
|
|
37
|
+
componentTag: ctx.graphTag,
|
|
38
|
+
envSlug: env.slug,
|
|
39
|
+
cloud: cloudTag,
|
|
40
|
+
};
|
|
41
|
+
let result;
|
|
42
|
+
if (instance) {
|
|
43
|
+
const listed = await ctx.cloudApi.listResources({ cloud: cloudTag, service, region }, ctx.auth);
|
|
44
|
+
const exists = (_a = listed.resources) === null || _a === void 0 ? void 0 : _a.some((r) => r.id === instance || r.name === instance);
|
|
45
|
+
if (exists) {
|
|
46
|
+
result = await ctx.cloudApi.importResource(Object.assign(Object.assign({}, baseInput), { resourceId: instance }), ctx.auth);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', params: { instance, accountName: instance, region, location: region } }), ctx.auth);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', params: { region, location: region } }), ctx.auth);
|
|
54
|
+
}
|
|
55
|
+
const draft = (_b = result.componentDraft) === null || _b === void 0 ? void 0 : _b.draft;
|
|
56
|
+
if (!draft) {
|
|
57
|
+
throw new Error('Cloud graph link did not return a component draft');
|
|
58
|
+
}
|
|
59
|
+
return draftToGraphEnv(draft, cloudTag, env.slug);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=cloud-graph-link.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-graph-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-graph-link.util.ts"],"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,QAAQ,KACpC,GAAG,CAAC,IAAI,CACT,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,iCAEtC,SAAS,KACZ,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAEvE,GAAG,CAAC,IAAI,CACT,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,iCAEtC,SAAS,KACZ,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAEtC,GAAG,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,cAAc,0CAAE,KAA4C,CAAC;IAClF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -12,6 +12,7 @@ const secrets_1 = require("../secrets");
|
|
|
12
12
|
* Resolve $Secret{} references then refresh AWS/GCP/Azure credentials when authMode is cloud_connection.
|
|
13
13
|
*/
|
|
14
14
|
async function resolveCloudLinkedConfig(config, ctx) {
|
|
15
|
+
var _a, _b;
|
|
15
16
|
let resolved = Object.assign({}, config);
|
|
16
17
|
if ((0, secrets_1.mightContainSecrets)(resolved)) {
|
|
17
18
|
const secretsService = (0, secrets_1.getSecretsService)();
|
|
@@ -21,17 +22,13 @@ async function resolveCloudLinkedConfig(config, ctx) {
|
|
|
21
22
|
const result = await secretsService.resolve(resolved, { env: ctx.envSlug });
|
|
22
23
|
resolved = result.value;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
const cloudTag = resolved.cloud;
|
|
26
|
+
const legacyConnectionId = resolved.cloudConnectionId;
|
|
27
|
+
if (resolved.authMode !== 'cloud_connection' || (!cloudTag && !legacyConnectionId)) {
|
|
25
28
|
return resolved;
|
|
26
29
|
}
|
|
27
30
|
const cloudApi = new cloudApi_service_1.CloudApiService(ctx.environment);
|
|
28
|
-
const issued = await cloudApi.issueRuntimeCredentials({
|
|
29
|
-
connectionId: resolved.cloudConnectionId,
|
|
30
|
-
productTag: ctx.productTag,
|
|
31
|
-
componentTag: ctx.componentTag,
|
|
32
|
-
envSlug: ctx.envSlug,
|
|
33
|
-
purpose: 'runtime',
|
|
34
|
-
}, ctx.auth);
|
|
31
|
+
const issued = await cloudApi.issueRuntimeCredentials(Object.assign(Object.assign({}, (cloudTag ? { cloud: cloudTag } : { connectionId: legacyConnectionId })), { productTag: ctx.productTag, componentTag: ctx.componentTag, envSlug: ctx.envSlug, purpose: 'runtime' }), ctx.auth);
|
|
35
32
|
const creds = issued.credentials || {};
|
|
36
33
|
if (issued.provider === 'aws') {
|
|
37
34
|
const refreshed = Object.assign(Object.assign(Object.assign(Object.assign({}, resolved), { accessKeyId: String(creds.accessKeyId || resolved.accessKeyId || ''), secretAccessKey: String(creds.secretAccessKey || resolved.secretAccessKey || '') }), (creds.sessionToken ? { sessionToken: String(creds.sessionToken) } : {})), { region: String(creds.region || resolved.region || '') });
|
|
@@ -46,8 +43,23 @@ async function resolveCloudLinkedConfig(config, ctx) {
|
|
|
46
43
|
: creds.service_account_json;
|
|
47
44
|
return Object.assign(Object.assign({}, resolved), { config: Object.assign(Object.assign({}, resolved.config), sa) });
|
|
48
45
|
}
|
|
46
|
+
if (issued.provider === 'gcp') {
|
|
47
|
+
const sa = typeof creds.service_account_json === 'string'
|
|
48
|
+
? JSON.parse(creds.service_account_json)
|
|
49
|
+
: creds.service_account_json;
|
|
50
|
+
const privateKey = String((sa === null || sa === void 0 ? void 0 : sa.private_key) || ((_a = resolved.config) === null || _a === void 0 ? void 0 : _a.private_key) || '');
|
|
51
|
+
const clientEmail = String((sa === null || sa === void 0 ? void 0 : sa.client_email) || ((_b = resolved.config) === null || _b === void 0 ? void 0 : _b.client_email) || '');
|
|
52
|
+
return Object.assign(Object.assign({}, resolved), { config: Object.assign(Object.assign(Object.assign({}, resolved.config), sa), { private_key: privateKey, client_email: clientEmail }) });
|
|
53
|
+
}
|
|
49
54
|
if (issued.provider === 'azure') {
|
|
50
|
-
|
|
55
|
+
const refreshed = Object.assign(Object.assign({}, resolved), { connectionString: String(creds.connectionString || resolved.connectionString || ''), tenantId: String(creds.tenantId || resolved.tenantId || ''), subscriptionId: String(creds.subscriptionId || resolved.subscriptionId || ''), clientId: String(creds.clientId || resolved.clientId || ''), clientSecret: String(creds.clientSecret || resolved.clientSecret || ''), defaultLocation: String(creds.defaultLocation || resolved.defaultLocation || '') });
|
|
56
|
+
if (resolved.endpoint !== undefined) {
|
|
57
|
+
refreshed.endpoint = String(resolved.endpoint || '');
|
|
58
|
+
}
|
|
59
|
+
if (resolved.apiKey !== undefined) {
|
|
60
|
+
refreshed.apiKey = String(resolved.apiKey || '');
|
|
61
|
+
}
|
|
62
|
+
return refreshed;
|
|
51
63
|
}
|
|
52
64
|
return resolved;
|
|
53
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-runtime.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-runtime.util.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAkBH,
|
|
1
|
+
{"version":3,"file":"cloud-runtime.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-runtime.util.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAkBH,4DAmGC;AAMD,kEAKC;AA9HD,uEAAmE;AAEnE,wCAAoE;AAWpE;;GAEG;AACI,KAAK,UAAU,wBAAwB,CAC5C,MAAS,EACT,GAAyB;;IAEzB,IAAI,QAAQ,GAAG,kBAAK,MAAM,CA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CAAC,CAAC;QACzE,CAAC;QACD,IAAK,QAAgB,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1C,SAAiB,CAAC,MAAM,GAAG,MAAM,CAAE,QAAgB,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,2BAA2B,CAC/C,SAAY,EACZ,GAAyB;IAEzB,OAAO,wBAAwB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CloudComponentType, CloudResourceService } from './types';
|
|
2
|
+
export declare function cloudServiceForProvider(componentType: CloudComponentType, provider: string): CloudResourceService | null;
|
|
3
|
+
export declare function requireCloudService(componentType: CloudComponentType, provider: string): CloudResourceService;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloudServiceForProvider = cloudServiceForProvider;
|
|
4
|
+
exports.requireCloudService = requireCloudService;
|
|
5
|
+
const STORAGE = {
|
|
6
|
+
aws: 's3',
|
|
7
|
+
gcp: 'gcs',
|
|
8
|
+
azure: 'blob',
|
|
9
|
+
};
|
|
10
|
+
const BROKER = {
|
|
11
|
+
aws: 'sqs',
|
|
12
|
+
gcp: 'pubsub',
|
|
13
|
+
azure: 'servicebus',
|
|
14
|
+
};
|
|
15
|
+
const DATABASE = {
|
|
16
|
+
aws: 'rds',
|
|
17
|
+
gcp: 'cloudsql',
|
|
18
|
+
azure: 'postgresql',
|
|
19
|
+
};
|
|
20
|
+
const GRAPH = {
|
|
21
|
+
aws: 'neptune',
|
|
22
|
+
gcp: 'spanner-graph',
|
|
23
|
+
azure: 'cosmos-gremlin',
|
|
24
|
+
};
|
|
25
|
+
const VECTOR = {
|
|
26
|
+
aws: 'opensearch',
|
|
27
|
+
gcp: 'vertex-vector-search',
|
|
28
|
+
azure: 'azure-search',
|
|
29
|
+
};
|
|
30
|
+
const BY_KIND = {
|
|
31
|
+
storage: STORAGE,
|
|
32
|
+
messageBrokers: BROKER,
|
|
33
|
+
databases: DATABASE,
|
|
34
|
+
graphs: GRAPH,
|
|
35
|
+
vectors: VECTOR,
|
|
36
|
+
caches: { aws: null, gcp: null, azure: null },
|
|
37
|
+
};
|
|
38
|
+
function cloudServiceForProvider(componentType, provider) {
|
|
39
|
+
var _a;
|
|
40
|
+
const map = BY_KIND[componentType];
|
|
41
|
+
if (!map)
|
|
42
|
+
return null;
|
|
43
|
+
return (_a = map[provider]) !== null && _a !== void 0 ? _a : null;
|
|
44
|
+
}
|
|
45
|
+
function requireCloudService(componentType, provider) {
|
|
46
|
+
const service = cloudServiceForProvider(componentType, provider);
|
|
47
|
+
if (!service) {
|
|
48
|
+
throw new Error(`Cloud-linked ${componentType} does not support provider "${provider}"`);
|
|
49
|
+
}
|
|
50
|
+
return service;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=cloud-service-map.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-service-map.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-service-map.util.ts"],"names":[],"mappings":";;AAyCA,0DAOC;AAED,kDAWC;AA3DD,MAAM,OAAO,GAAuD;IAClE,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,MAAM,GAAuD;IACjE,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,QAAQ,GAAuD;IACnE,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,YAAY;CACpB,CAAC;AAEF,MAAM,KAAK,GAAuD;IAChE,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AAEF,MAAM,MAAM,GAAuD;IACjE,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,sBAAsB;IAC3B,KAAK,EAAE,cAAc;CACtB,CAAC;AAEF,MAAM,OAAO,GAAmF;IAC9F,OAAO,EAAE,OAAO;IAChB,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;CAC9C,CAAC;AAEF,SAAgB,uBAAuB,CACrC,aAAiC,EACjC,QAAgB;;IAEhB,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO,MAAA,GAAG,CAAC,QAAyB,CAAC,mCAAI,IAAI,CAAC;AAChD,CAAC;AAED,SAAgB,mBAAmB,CACjC,aAAiC,EACjC,QAAgB;IAEhB,MAAM,OAAO,GAAG,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,gBAAgB,aAAa,+BAA+B,QAAQ,GAAG,CACxE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CloudApiService } from '../api/services/cloudApi.service';
|
|
2
|
+
import { IRequestExtension } from '../types';
|
|
3
|
+
import { IProductVectorEnvs } from '../types/productsBuilder.types';
|
|
4
|
+
export type CloudLinkedVectorEnv = IProductVectorEnvs & {
|
|
5
|
+
instance?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function materializeCloudLinkedVectorEnv(env: CloudLinkedVectorEnv, ctx: {
|
|
8
|
+
cloudApi: CloudApiService;
|
|
9
|
+
auth: IRequestExtension;
|
|
10
|
+
productTag: string;
|
|
11
|
+
vectorTag: string;
|
|
12
|
+
}): Promise<IProductVectorEnvs>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.materializeCloudLinkedVectorEnv = materializeCloudLinkedVectorEnv;
|
|
4
|
+
const cloud_service_map_util_1 = require("./cloud-service-map.util");
|
|
5
|
+
function draftToVectorEnv(draft, cloudTag, slug) {
|
|
6
|
+
const envs = draft.envs;
|
|
7
|
+
if (!(envs === null || envs === void 0 ? void 0 : envs.length)) {
|
|
8
|
+
throw new Error('Cloud vector link did not return an environment draft');
|
|
9
|
+
}
|
|
10
|
+
const draftEnv = envs.find((e) => e.slug === slug) || envs[0];
|
|
11
|
+
return {
|
|
12
|
+
slug,
|
|
13
|
+
endpoint: draftEnv.endpoint ? String(draftEnv.endpoint) : undefined,
|
|
14
|
+
apiKey: draftEnv.apiKey ? String(draftEnv.apiKey) : undefined,
|
|
15
|
+
authMode: 'cloud_connection',
|
|
16
|
+
cloud: cloudTag,
|
|
17
|
+
region: draftEnv.region ? String(draftEnv.region) : undefined,
|
|
18
|
+
index: draftEnv.index ? String(draftEnv.index) : undefined,
|
|
19
|
+
namespace: draftEnv.namespace ? String(draftEnv.namespace) : undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
async function materializeCloudLinkedVectorEnv(env, ctx) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const cloudTag = env.cloud;
|
|
25
|
+
if (!cloudTag) {
|
|
26
|
+
return env;
|
|
27
|
+
}
|
|
28
|
+
const connection = await ctx.cloudApi.fetchConnection(cloudTag, ctx.auth);
|
|
29
|
+
const service = (0, cloud_service_map_util_1.requireCloudService)('vectors', connection.provider);
|
|
30
|
+
const instance = String(env.instance || '').trim();
|
|
31
|
+
const region = env.region ? String(env.region) : undefined;
|
|
32
|
+
const baseInput = {
|
|
33
|
+
service,
|
|
34
|
+
componentType: 'vectors',
|
|
35
|
+
productTag: ctx.productTag,
|
|
36
|
+
componentTag: ctx.vectorTag,
|
|
37
|
+
envSlug: env.slug,
|
|
38
|
+
cloud: cloudTag,
|
|
39
|
+
};
|
|
40
|
+
let result;
|
|
41
|
+
if (instance) {
|
|
42
|
+
const listed = await ctx.cloudApi.listResources({ cloud: cloudTag, service, region }, ctx.auth);
|
|
43
|
+
const exists = (_a = listed.resources) === null || _a === void 0 ? void 0 : _a.some((r) => r.id === instance || r.name === instance);
|
|
44
|
+
if (exists) {
|
|
45
|
+
result = await ctx.cloudApi.importResource(Object.assign(Object.assign({}, baseInput), { resourceId: instance }), ctx.auth);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', params: { instance, serviceName: instance, region, location: region } }), ctx.auth);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', params: { region, location: region } }), ctx.auth);
|
|
53
|
+
}
|
|
54
|
+
const draft = (_b = result.componentDraft) === null || _b === void 0 ? void 0 : _b.draft;
|
|
55
|
+
if (!draft) {
|
|
56
|
+
throw new Error('Cloud vector link did not return a component draft');
|
|
57
|
+
}
|
|
58
|
+
return draftToVectorEnv(draft, cloudTag, env.slug);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=cloud-vector-link.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-vector-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-vector-link.util.ts"],"names":[],"mappings":";;AA6BA,0EAiEC;AA3FD,qEAA+D;AAI/D,SAAS,gBAAgB,CACvB,KAA8B,EAC9B,QAAgB,EAChB,IAAY;IAEZ,MAAM,IAAI,GAAG,KAAK,CAAC,IAAkD,CAAC;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S,EACnB,MAAM,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAEvE,GAAG,CAAC,IAAI,CACT,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,iCAEtC,SAAS,KACZ,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAEtC,GAAG,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,cAAc,0CAAE,KAA4C,CAAC;IAClF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,43 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CloudService — workspace cloud connections (AWS, GCP, Azure).
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { CloudApiService } from '../api/services/cloudApi.service';
|
|
5
5
|
import { EnvType, IRequestExtension } from '../types';
|
|
6
6
|
import { ICloudConnection, ICloudConnectionSetup, ICompleteCloudConnectionInput, ICreateCloudConnectionInput, IImportCloudResourceInput, IImportCloudResourceResult, IListCloudResourcesInput, IListCloudResourcesResult, IProvisionCloudResourceInput, IProvisionCloudResourceResult, ICloudRuntimeCredentials, ICloudRuntimeCredentialsInput, IValidateCloudConnectionResult } from './types';
|
|
7
|
-
import ProductsBuilderService from '../products/services/products.service';
|
|
8
7
|
export declare class CloudError extends Error {
|
|
9
|
-
code
|
|
8
|
+
code?: string;
|
|
10
9
|
details?: unknown;
|
|
11
|
-
constructor(message: string, code
|
|
10
|
+
constructor(message: string, code?: string, details?: unknown);
|
|
12
11
|
}
|
|
13
12
|
export interface ICloudServiceDeps {
|
|
14
13
|
environment: EnvType;
|
|
15
14
|
getAuth: () => IRequestExtension;
|
|
16
|
-
getProductBuilder: (productTag: string) => Promise<
|
|
15
|
+
getProductBuilder: (productTag: string) => Promise<import('../products/services/products.service').default>;
|
|
17
16
|
}
|
|
18
17
|
export declare class CloudService {
|
|
19
18
|
private deps;
|
|
20
19
|
private api;
|
|
21
|
-
constructor(deps: ICloudServiceDeps, api?:
|
|
20
|
+
constructor(deps: ICloudServiceDeps, api?: CloudApiService);
|
|
22
21
|
private auth;
|
|
23
22
|
createConnection(input: ICreateCloudConnectionInput): Promise<ICloudConnectionSetup>;
|
|
24
23
|
listConnections(): Promise<ICloudConnection[]>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
/** Fetch a workspace cloud connection by tag */
|
|
25
|
+
fetchConnection(cloud: string): Promise<ICloudConnection>;
|
|
26
|
+
deleteConnection(cloud: string): Promise<void>;
|
|
27
|
+
completeConnection(cloud: string, input: ICompleteCloudConnectionInput): Promise<ICloudConnection>;
|
|
28
|
+
validateConnection(cloud: string): Promise<IValidateCloudConnectionResult>;
|
|
29
29
|
listResources(input: IListCloudResourcesInput): Promise<IListCloudResourcesResult>;
|
|
30
30
|
importResource(input: IImportCloudResourceInput): Promise<IImportCloudResourceResult>;
|
|
31
31
|
provisionResource(input: IProvisionCloudResourceInput): Promise<IProvisionCloudResourceResult>;
|
|
32
32
|
issueRuntimeCredentials(input: ICloudRuntimeCredentialsInput): Promise<ICloudRuntimeCredentials>;
|
|
33
|
-
/**
|
|
34
|
-
* Import a cloud resource and persist the returned draft on the product via ProductsBuilder.
|
|
35
|
-
*/
|
|
36
33
|
importAndPersist(input: IImportCloudResourceInput): Promise<IImportCloudResourceResult>;
|
|
37
|
-
/**
|
|
38
|
-
* Provision in cloud and persist the component draft on the product.
|
|
39
|
-
*/
|
|
40
34
|
provisionAndPersist(input: IProvisionCloudResourceInput): Promise<IProvisionCloudResourceResult>;
|
|
41
35
|
private persistComponentDraft;
|
|
42
36
|
private persistWithCreateOrUpdate;
|
|
43
37
|
}
|
|
38
|
+
export default CloudService;
|
|
@@ -28,17 +28,18 @@ class CloudService {
|
|
|
28
28
|
async listConnections() {
|
|
29
29
|
return this.api.listConnections(this.auth());
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/** Fetch a workspace cloud connection by tag */
|
|
32
|
+
async fetchConnection(cloud) {
|
|
33
|
+
return this.api.fetchConnection(cloud, this.auth());
|
|
33
34
|
}
|
|
34
|
-
async deleteConnection(
|
|
35
|
-
return this.api.deleteConnection(
|
|
35
|
+
async deleteConnection(cloud) {
|
|
36
|
+
return this.api.deleteConnection(cloud, this.auth());
|
|
36
37
|
}
|
|
37
|
-
async completeConnection(
|
|
38
|
-
return this.api.completeConnection(
|
|
38
|
+
async completeConnection(cloud, input) {
|
|
39
|
+
return this.api.completeConnection(cloud, input, this.auth());
|
|
39
40
|
}
|
|
40
|
-
async validateConnection(
|
|
41
|
-
return this.api.validateConnection(
|
|
41
|
+
async validateConnection(cloud) {
|
|
42
|
+
return this.api.validateConnection(cloud, this.auth());
|
|
42
43
|
}
|
|
43
44
|
async listResources(input) {
|
|
44
45
|
return this.api.listResources(input, this.auth());
|
|
@@ -52,17 +53,11 @@ class CloudService {
|
|
|
52
53
|
async issueRuntimeCredentials(input) {
|
|
53
54
|
return this.api.issueRuntimeCredentials(input, this.auth());
|
|
54
55
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Import a cloud resource and persist the returned draft on the product via ProductsBuilder.
|
|
57
|
-
*/
|
|
58
56
|
async importAndPersist(input) {
|
|
59
57
|
const result = await this.importResource(input);
|
|
60
58
|
await this.persistComponentDraft(input.productTag, result.componentDraft);
|
|
61
59
|
return result;
|
|
62
60
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Provision in cloud and persist the component draft on the product.
|
|
65
|
-
*/
|
|
66
61
|
async provisionAndPersist(input) {
|
|
67
62
|
const result = await this.provisionResource(input);
|
|
68
63
|
await this.persistComponentDraft(input.productTag, result.componentDraft);
|
|
@@ -118,4 +113,5 @@ class CloudService {
|
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
exports.CloudService = CloudService;
|
|
116
|
+
exports.default = CloudService;
|
|
121
117
|
//# sourceMappingURL=cloud.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.service.js","sourceRoot":"","sources":["../../src/cloud/cloud.service.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"cloud.service.js","sourceRoot":"","sources":["../../src/cloud/cloud.service.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uEAAmE;AAmBnE,MAAa,UAAW,SAAQ,KAAK;IACnC,YACE,OAAe,EACR,IAAa,EACb,OAAiB;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAAU;QAGxB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AATD,gCASC;AAQD,MAAa,YAAY;IAGvB,YAAoB,IAAuB,EAAE,GAAqB;QAA9C,SAAI,GAAJ,IAAI,CAAmB;QACzC,IAAI,CAAC,GAAG,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,IAAI,kCAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;IAEO,IAAI;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,KAAkC;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAA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CAAC;gBACjC,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA5HD,oCA4HC;AAED,kBAAe,YAAY,CAAC"}
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { CloudService, CloudError } from './cloud.service';
|
|
2
2
|
export type { ICloudServiceDeps } from './cloud.service';
|
|
3
3
|
export { resolveCloudLinkedConfig, resolveCloudLinkedEnvConfig } from './cloud-runtime.util';
|
|
4
|
+
export { materializeCloudLinkedBrokerEnv } from './cloud-broker-link.util';
|
|
5
|
+
export { materializeCloudLinkedDatabaseEnv } from './cloud-database-link.util';
|
|
6
|
+
export { materializeCloudLinkedGraphEnv } from './cloud-graph-link.util';
|
|
7
|
+
export { materializeCloudLinkedVectorEnv } from './cloud-vector-link.util';
|
|
8
|
+
export { cloudServiceForProvider, requireCloudService } from './cloud-service-map.util';
|
|
9
|
+
export { resolveCloudConnectionId } from './cloud-api.util';
|
|
4
10
|
export type { ICloudRuntimeContext } from './cloud-runtime.util';
|
|
5
11
|
export * from './types';
|
package/dist/cloud/index.js
CHANGED
|
@@ -14,12 +14,25 @@ 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
|
-
exports.resolveCloudLinkedEnvConfig = exports.resolveCloudLinkedConfig = exports.CloudError = exports.CloudService = void 0;
|
|
17
|
+
exports.resolveCloudConnectionId = exports.requireCloudService = exports.cloudServiceForProvider = exports.materializeCloudLinkedVectorEnv = exports.materializeCloudLinkedGraphEnv = exports.materializeCloudLinkedDatabaseEnv = exports.materializeCloudLinkedBrokerEnv = exports.resolveCloudLinkedEnvConfig = exports.resolveCloudLinkedConfig = exports.CloudError = exports.CloudService = void 0;
|
|
18
18
|
var cloud_service_1 = require("./cloud.service");
|
|
19
19
|
Object.defineProperty(exports, "CloudService", { enumerable: true, get: function () { return cloud_service_1.CloudService; } });
|
|
20
20
|
Object.defineProperty(exports, "CloudError", { enumerable: true, get: function () { return cloud_service_1.CloudError; } });
|
|
21
21
|
var cloud_runtime_util_1 = require("./cloud-runtime.util");
|
|
22
22
|
Object.defineProperty(exports, "resolveCloudLinkedConfig", { enumerable: true, get: function () { return cloud_runtime_util_1.resolveCloudLinkedConfig; } });
|
|
23
23
|
Object.defineProperty(exports, "resolveCloudLinkedEnvConfig", { enumerable: true, get: function () { return cloud_runtime_util_1.resolveCloudLinkedEnvConfig; } });
|
|
24
|
+
var cloud_broker_link_util_1 = require("./cloud-broker-link.util");
|
|
25
|
+
Object.defineProperty(exports, "materializeCloudLinkedBrokerEnv", { enumerable: true, get: function () { return cloud_broker_link_util_1.materializeCloudLinkedBrokerEnv; } });
|
|
26
|
+
var cloud_database_link_util_1 = require("./cloud-database-link.util");
|
|
27
|
+
Object.defineProperty(exports, "materializeCloudLinkedDatabaseEnv", { enumerable: true, get: function () { return cloud_database_link_util_1.materializeCloudLinkedDatabaseEnv; } });
|
|
28
|
+
var cloud_graph_link_util_1 = require("./cloud-graph-link.util");
|
|
29
|
+
Object.defineProperty(exports, "materializeCloudLinkedGraphEnv", { enumerable: true, get: function () { return cloud_graph_link_util_1.materializeCloudLinkedGraphEnv; } });
|
|
30
|
+
var cloud_vector_link_util_1 = require("./cloud-vector-link.util");
|
|
31
|
+
Object.defineProperty(exports, "materializeCloudLinkedVectorEnv", { enumerable: true, get: function () { return cloud_vector_link_util_1.materializeCloudLinkedVectorEnv; } });
|
|
32
|
+
var cloud_service_map_util_1 = require("./cloud-service-map.util");
|
|
33
|
+
Object.defineProperty(exports, "cloudServiceForProvider", { enumerable: true, get: function () { return cloud_service_map_util_1.cloudServiceForProvider; } });
|
|
34
|
+
Object.defineProperty(exports, "requireCloudService", { enumerable: true, get: function () { return cloud_service_map_util_1.requireCloudService; } });
|
|
35
|
+
var cloud_api_util_1 = require("./cloud-api.util");
|
|
36
|
+
Object.defineProperty(exports, "resolveCloudConnectionId", { enumerable: true, get: function () { return cloud_api_util_1.resolveCloudConnectionId; } });
|
|
24
37
|
__exportStar(require("./types"), exports);
|
|
25
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cloud/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloud/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA2D;AAAlD,6GAAA,YAAY,OAAA;AAAE,2GAAA,UAAU,OAAA;AAEjC,2DAA6F;AAApF,8HAAA,wBAAwB,OAAA;AAAE,iIAAA,2BAA2B,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloud/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA2D;AAAlD,6GAAA,YAAY,OAAA;AAAE,2GAAA,UAAU,OAAA;AAEjC,2DAA6F;AAApF,8HAAA,wBAAwB,OAAA;AAAE,iIAAA,2BAA2B,OAAA;AAC9D,mEAA2E;AAAlE,yIAAA,+BAA+B,OAAA;AACxC,uEAA+E;AAAtE,6IAAA,iCAAiC,OAAA;AAC1C,iEAAyE;AAAhE,uIAAA,8BAA8B,OAAA;AACvC,mEAA2E;AAAlE,yIAAA,+BAA+B,OAAA;AACxC,mEAAwF;AAA/E,iIAAA,uBAAuB,OAAA;AAAE,6HAAA,mBAAmB,OAAA;AACrD,mDAA4D;AAAnD,0HAAA,wBAAwB,OAAA;AAEjC,0CAAwB"}
|
|
@@ -15,6 +15,7 @@ export interface ICloudConnection {
|
|
|
15
15
|
workspace_id: string;
|
|
16
16
|
provider: CloudProvider;
|
|
17
17
|
display_name: string;
|
|
18
|
+
tag: string;
|
|
18
19
|
account_identifier: string;
|
|
19
20
|
auth_mode: CloudAuthMode;
|
|
20
21
|
status: CloudConnectionStatus;
|
|
@@ -43,12 +44,17 @@ export interface ICompleteCloudConnectionInput {
|
|
|
43
44
|
role_arn?: string;
|
|
44
45
|
/** GCP project */
|
|
45
46
|
project_id?: string;
|
|
46
|
-
/** GCP service account email (optional when using WIF) */
|
|
47
|
+
/** GCP service account JSON or email (optional when using WIF) */
|
|
47
48
|
service_account_email?: string;
|
|
48
|
-
|
|
49
|
+
service_account_json?: string | Record<string, unknown>;
|
|
50
|
+
/** Azure service principal */
|
|
49
51
|
tenant_id?: string;
|
|
50
52
|
subscription_id?: string;
|
|
51
53
|
client_id?: string;
|
|
54
|
+
client_secret?: string;
|
|
55
|
+
default_location?: string;
|
|
56
|
+
/** Azure legacy blob-only (optional when using service principal) */
|
|
57
|
+
connection_string?: string;
|
|
52
58
|
}
|
|
53
59
|
export interface IValidateCloudConnectionResult {
|
|
54
60
|
valid: boolean;
|
|
@@ -57,7 +63,7 @@ export interface IValidateCloudConnectionResult {
|
|
|
57
63
|
tested_at?: string;
|
|
58
64
|
}
|
|
59
65
|
/** Cloud resource kinds exposed by the connector */
|
|
60
|
-
export type CloudResourceService = 's3' | 'sqs' | 'sns' | 'gcs' | 'pubsub' | 'blob' | 'servicebus' | 'rds' | 'neptune' | 'opensearch' | 'pinecone';
|
|
66
|
+
export type CloudResourceService = 's3' | 'sqs' | 'sns' | 'gcs' | 'pubsub' | 'blob' | 'servicebus' | 'rds' | 'postgresql' | 'cloudsql' | 'neptune' | 'cosmos-gremlin' | 'opensearch' | 'azure-search' | 'spanner-graph' | 'vertex-vector-search' | 'pinecone';
|
|
61
67
|
export interface ICloudResource {
|
|
62
68
|
id: string;
|
|
63
69
|
name: string;
|
|
@@ -68,7 +74,8 @@ export interface ICloudResource {
|
|
|
68
74
|
metadata?: Record<string, unknown>;
|
|
69
75
|
}
|
|
70
76
|
export interface IListCloudResourcesInput {
|
|
71
|
-
|
|
77
|
+
/** Workspace cloud connection tag */
|
|
78
|
+
cloud: string;
|
|
72
79
|
service: CloudResourceService;
|
|
73
80
|
region?: string;
|
|
74
81
|
prefix?: string;
|
|
@@ -85,7 +92,8 @@ export interface IListCloudResourcesResult {
|
|
|
85
92
|
/** Target Ductape component when importing or provisioning */
|
|
86
93
|
export type CloudComponentType = 'storage' | 'messageBrokers' | 'databases' | 'graphs' | 'vectors' | 'caches';
|
|
87
94
|
export interface IImportCloudResourceInput {
|
|
88
|
-
|
|
95
|
+
/** Workspace cloud connection tag */
|
|
96
|
+
cloud: string;
|
|
89
97
|
service: CloudResourceService;
|
|
90
98
|
resourceId: string;
|
|
91
99
|
componentType: CloudComponentType;
|
|
@@ -94,7 +102,8 @@ export interface IImportCloudResourceInput {
|
|
|
94
102
|
envSlug: string;
|
|
95
103
|
}
|
|
96
104
|
export interface IProvisionCloudResourceInput {
|
|
97
|
-
|
|
105
|
+
/** Workspace cloud connection tag */
|
|
106
|
+
cloud: string;
|
|
98
107
|
service: CloudResourceService;
|
|
99
108
|
template: string;
|
|
100
109
|
componentType: CloudComponentType;
|
|
@@ -120,7 +129,10 @@ export interface IProvisionCloudResourceResult extends IImportCloudResourceResul
|
|
|
120
129
|
}
|
|
121
130
|
/** Runtime short-lived credentials (proxy / connector broker) */
|
|
122
131
|
export interface ICloudRuntimeCredentialsInput {
|
|
123
|
-
|
|
132
|
+
/** Workspace cloud connection tag */
|
|
133
|
+
cloud?: string;
|
|
134
|
+
/** @deprecated Legacy persisted configs only */
|
|
135
|
+
connectionId?: string;
|
|
124
136
|
productTag: string;
|
|
125
137
|
componentTag: string;
|
|
126
138
|
envSlug: string;
|
|
@@ -135,6 +147,9 @@ export interface ICloudRuntimeCredentials {
|
|
|
135
147
|
export type ComponentCloudAuthMode = 'manual' | 'cloud_connection';
|
|
136
148
|
export interface ICloudLinkedComponentFields {
|
|
137
149
|
authMode?: ComponentCloudAuthMode;
|
|
150
|
+
/** User-friendly cloud connection tag (preferred over cloudConnectionId) */
|
|
151
|
+
cloud?: string;
|
|
152
|
+
/** @deprecated Use cloud tag instead Host configs */
|
|
138
153
|
cloudConnectionId?: string;
|
|
139
154
|
roleArn?: string;
|
|
140
155
|
}
|
|
@@ -573,6 +573,7 @@ class DatabaseService {
|
|
|
573
573
|
description: config.description,
|
|
574
574
|
authMode: envConfig.authMode,
|
|
575
575
|
cloudConnectionId: envConfig.cloudConnectionId,
|
|
576
|
+
cloud: envConfig.cloud,
|
|
576
577
|
});
|
|
577
578
|
}
|
|
578
579
|
}
|
|
@@ -836,6 +837,7 @@ class DatabaseService {
|
|
|
836
837
|
connection_url: context.connectionUrl,
|
|
837
838
|
authMode: context.authMode,
|
|
838
839
|
cloudConnectionId: context.cloudConnectionId,
|
|
840
|
+
cloud: context.cloud,
|
|
839
841
|
}, {
|
|
840
842
|
environment: this.config.env_type,
|
|
841
843
|
auth: {
|