@ductape/sdk 0.1.14 → 0.1.17
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 +49 -1
- package/dist/api/services/cloudApi.service.js +49 -0
- package/dist/api/services/cloudApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +9 -0
- package/dist/api/urls.js +21 -1
- package/dist/api/urls.js.map +1 -1
- package/dist/clients/products.client.js +2 -1
- package/dist/clients/products.client.js.map +1 -1
- package/dist/cloud/aws-vpc-provision.util.d.ts +23 -0
- package/dist/cloud/aws-vpc-provision.util.js +54 -0
- package/dist/cloud/aws-vpc-provision.util.js.map +1 -0
- package/dist/cloud/cloud-broker-link.util.js +11 -9
- package/dist/cloud/cloud-broker-link.util.js.map +1 -1
- package/dist/cloud/cloud-database-link.util.js +28 -19
- package/dist/cloud/cloud-database-link.util.js.map +1 -1
- package/dist/cloud/cloud-graph-link.util.js +18 -4
- package/dist/cloud/cloud-graph-link.util.js.map +1 -1
- package/dist/cloud/cloud-runtime.util.js +9 -2
- package/dist/cloud/cloud-runtime.util.js.map +1 -1
- package/dist/cloud/cloud-vector-link.util.js +9 -3
- package/dist/cloud/cloud-vector-link.util.js.map +1 -1
- package/dist/cloud/cloud.service.d.ts +25 -1
- package/dist/cloud/cloud.service.js +21 -0
- package/dist/cloud/cloud.service.js.map +1 -1
- package/dist/cloud/index.d.ts +5 -0
- package/dist/cloud/index.js +15 -1
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/types/cloud.types.d.ts +105 -2
- package/dist/cloud/vpc-connector-connect.util.d.ts +10 -0
- package/dist/cloud/vpc-connector-connect.util.js +23 -0
- package/dist/cloud/vpc-connector-connect.util.js.map +1 -0
- package/dist/cloud/vpc-connector-endpoint.util.d.ts +4 -0
- package/dist/cloud/vpc-connector-endpoint.util.js +24 -0
- package/dist/cloud/vpc-connector-endpoint.util.js.map +1 -0
- package/dist/cloud/vpc-connector-relay.util.d.ts +3 -0
- package/dist/cloud/vpc-connector-relay.util.js +17 -0
- package/dist/cloud/vpc-connector-relay.util.js.map +1 -0
- package/dist/cloud/vpc-connector-tunnel.client.d.ts +16 -0
- package/dist/cloud/vpc-connector-tunnel.client.js +149 -0
- package/dist/cloud/vpc-connector-tunnel.client.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.js +47 -5
- package/dist/database/adapters/postgresql.adapter.js.map +1 -1
- package/dist/database/databases.service.js +19 -16
- package/dist/database/databases.service.js.map +1 -1
- package/dist/database/types/connection.interface.d.ts +9 -0
- package/dist/graph/adapters/base.adapter.d.ts +2 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -1
- package/dist/graph/adapters/neptune.adapter.js +37 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -1
- package/dist/graph/graphs.service.js +22 -20
- package/dist/graph/graphs.service.js.map +1 -1
- package/dist/graph/types/connection.interface.d.ts +2 -0
- package/dist/index.d.ts +26 -2
- package/dist/index.js +36 -1
- package/dist/index.js.map +1 -1
- package/dist/products/services/products.service.js +65 -54
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +5 -0
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +27 -16
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +10 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.js +6 -2
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -1
- package/dist/storage/storage-cloud-link.util.js +4 -8
- package/dist/storage/storage-cloud-link.util.js.map +1 -1
- package/dist/types/processor.types.d.ts +7 -1
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +36 -0
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-graph-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-graph-link.util.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cloud-graph-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-graph-link.util.ts"],"names":[],"mappings":";;AAiCA,wEAgFC;AA9GD,qEAA+D;AAC/D,qEAAqE;AAIrE,SAAS,eAAe,CACtB,KAA8B,EAC9B,QAAgB,EAChB,IAAY;IAEZ,MAAM,IAAI,GAAG,KAAK,CAAC,IAAkD,CAAC;IACtE,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9D,OAAO;QACL,IAAI;QACJ,cAAc,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9E,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QAC7D,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QACnE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,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,MAAA,MAAM,CAAC,cAAc,0CAAE,KAA4C,CAAC;IAClF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,eAAe,KAAK,cAAc,IAAI,QAAQ,CAAC,eAAe,KAAK,cAAc,EAAE,CAAC;QAC5F,QAAQ,CAAC,eAAe,GAAG,cAAc,CAAC;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -29,9 +29,16 @@ async function resolveCloudLinkedConfig(config, ctx) {
|
|
|
29
29
|
}
|
|
30
30
|
const cloudApi = new cloudApi_service_1.CloudApiService(ctx.environment);
|
|
31
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);
|
|
32
|
+
const withVpcTunnelHint = (value) => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (((_a = issued.networking) === null || _a === void 0 ? void 0 : _a.mode) === 'vpc_connector' && cloudTag) {
|
|
35
|
+
return Object.assign(Object.assign({}, value), { useVpcConnectorTunnel: true, cloud: cloudTag });
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
};
|
|
32
39
|
const creds = issued.credentials || {};
|
|
33
40
|
if (issued.provider === 'aws') {
|
|
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 || '') });
|
|
41
|
+
const refreshed = withVpcTunnelHint(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 || '') }));
|
|
35
42
|
if (resolved.connection_url !== undefined) {
|
|
36
43
|
refreshed.connection_url = String(resolved.connection_url || '');
|
|
37
44
|
}
|
|
@@ -52,7 +59,7 @@ async function resolveCloudLinkedConfig(config, ctx) {
|
|
|
52
59
|
return Object.assign(Object.assign({}, resolved), { config: Object.assign(Object.assign(Object.assign({}, resolved.config), sa), { private_key: privateKey, client_email: clientEmail }) });
|
|
53
60
|
}
|
|
54
61
|
if (issued.provider === 'azure') {
|
|
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 || '') });
|
|
62
|
+
const refreshed = withVpcTunnelHint(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
63
|
if (resolved.endpoint !== undefined) {
|
|
57
64
|
refreshed.endpoint = String(resolved.endpoint || '');
|
|
58
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-runtime.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-runtime.util.ts"],"names":[],"mappings":";AAAA;;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AAM,CAAC,KAAK,CAAC,QAAQ,IAAK,QAAgB,CAAC,QAAQ,IAAI,EAAE,CAAC,EACpE,cAAc,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,IAAK,QAAgB,CAAC,cAAc,IAAI,EAAE,CAAC,EACtF,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAK,QAAgB,CAAC,QAAQ,IAAI,EAAE,CAAC,EACpE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,YAAY,IAAK,QAAgB,CAAC,YAAY,IAAI,EAAE,CAAC,EAChF,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,IAAK,QAAgB,CAAC,eAAe,IAAI,EAAE,CAAC,IACpF,CAAC;QACR,IAAK,QAAgB,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5C,SAAiB,CAAC,QAAQ,GAAG,MAAM,CAAE,QAAgB,CAAC,QAAQ,IAAI,EAAE,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"}
|
|
@@ -17,6 +17,8 @@ function draftToVectorEnv(draft, cloudTag, slug) {
|
|
|
17
17
|
region: draftEnv.region ? String(draftEnv.region) : undefined,
|
|
18
18
|
index: draftEnv.index ? String(draftEnv.index) : undefined,
|
|
19
19
|
namespace: draftEnv.namespace ? String(draftEnv.namespace) : undefined,
|
|
20
|
+
provisionStatus: draftEnv.provisionStatus,
|
|
21
|
+
provisionError: draftEnv.provisionError ? String(draftEnv.provisionError) : undefined,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
async function materializeCloudLinkedVectorEnv(env, ctx) {
|
|
@@ -45,16 +47,20 @@ async function materializeCloudLinkedVectorEnv(env, ctx) {
|
|
|
45
47
|
result = await ctx.cloudApi.importResource(Object.assign(Object.assign({}, baseInput), { resourceId: instance }), ctx.auth);
|
|
46
48
|
}
|
|
47
49
|
else {
|
|
48
|
-
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default',
|
|
50
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', waitForReady: false, instance, serviceName: instance, region, location: region }), ctx.auth);
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
else {
|
|
52
|
-
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default',
|
|
54
|
+
result = await ctx.cloudApi.provisionResource(Object.assign(Object.assign({}, baseInput), { template: 'default', waitForReady: false, region, location: region }), ctx.auth);
|
|
53
55
|
}
|
|
54
56
|
const draft = (_b = result.componentDraft) === null || _b === void 0 ? void 0 : _b.draft;
|
|
55
57
|
if (!draft) {
|
|
56
58
|
throw new Error('Cloud vector link did not return a component draft');
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
const envDraft = draftToVectorEnv(draft, cloudTag, env.slug);
|
|
61
|
+
if (draft.provisionStatus === 'provisioning' || envDraft.provisionStatus === 'provisioning') {
|
|
62
|
+
envDraft.provisionStatus = 'provisioning';
|
|
63
|
+
}
|
|
64
|
+
return envDraft;
|
|
59
65
|
}
|
|
60
66
|
//# sourceMappingURL=cloud-vector-link.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-vector-link.util.js","sourceRoot":"","sources":["../../src/cloud/cloud-vector-link.util.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cloud-vector-link.util.js","sourceRoot":"","sources":["../../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cloudApi.service';
|
|
5
5
|
import { EnvType, IRequestExtension } from '../types';
|
|
6
|
-
import { ICloudConnection, ICloudConnectionSetup, ICompleteCloudConnectionInput, IUpdateCloudConnectionInput, ICreateCloudConnectionInput, IImportCloudResourceInput, IImportCloudResourceResult, IListCloudResourcesInput, IListCloudResourcesResult, IProvisionCloudResourceInput, IProvisionCloudResourceResult, ICloudRuntimeCredentials, ICloudRuntimeCredentialsInput, IValidateCloudConnectionResult } from './types';
|
|
6
|
+
import { ICloudConnection, ICloudConnectionSetup, ICompleteCloudConnectionInput, IUpdateCloudConnectionInput, IUpdateCloudSecurityGroupsInput, IUpdateCloudManagedNetworkingInput, IUpdateCloudVpcConnectorInput, ICloudVpcConnectorStatus, IResolveCloudHostResult, ICreateCloudConnectionInput, IImportCloudResourceInput, IImportCloudResourceResult, IListCloudResourcesInput, IListCloudResourcesResult, IProvisionCloudResourceInput, IProvisionCloudResourceResult, ICloudRuntimeCredentials, ICloudRuntimeCredentialsInput, IValidateCloudConnectionResult } from './types';
|
|
7
7
|
export declare class CloudError extends Error {
|
|
8
8
|
code?: string;
|
|
9
9
|
details?: unknown;
|
|
@@ -25,6 +25,30 @@ export declare class CloudService {
|
|
|
25
25
|
fetchConnection(cloud: string): Promise<ICloudConnection>;
|
|
26
26
|
deleteConnection(cloud: string): Promise<void>;
|
|
27
27
|
updateConnection(cloud: string, input: IUpdateCloudConnectionInput): Promise<ICloudConnection>;
|
|
28
|
+
updateSecurityGroups(cloud: string, input: IUpdateCloudSecurityGroupsInput): Promise<ICloudConnection>;
|
|
29
|
+
updateManagedNetworking(cloud: string, input: IUpdateCloudManagedNetworkingInput): Promise<ICloudConnection>;
|
|
30
|
+
resolveNetworkingHost(host: string): Promise<IResolveCloudHostResult>;
|
|
31
|
+
updateVpcConnector(cloud: string, input: IUpdateCloudVpcConnectorInput): Promise<ICloudConnection & {
|
|
32
|
+
vpc_connector?: Record<string, unknown>;
|
|
33
|
+
}>;
|
|
34
|
+
getVpcConnectorStatus(cloud: string): Promise<ICloudVpcConnectorStatus>;
|
|
35
|
+
listVpcConnectorVpcs(cloud: string, region: string): Promise<{
|
|
36
|
+
region: string;
|
|
37
|
+
vpcs: Array<{
|
|
38
|
+
vpcId: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
isDefault: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
}>;
|
|
43
|
+
listVpcConnectorSubnets(cloud: string, region: string, vpcId: string): Promise<{
|
|
44
|
+
region: string;
|
|
45
|
+
vpc_id: string;
|
|
46
|
+
subnets: Array<{
|
|
47
|
+
subnetId: string;
|
|
48
|
+
availabilityZone?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
}>;
|
|
51
|
+
}>;
|
|
28
52
|
completeConnection(cloud: string, input: ICompleteCloudConnectionInput): Promise<ICloudConnection>;
|
|
29
53
|
validateConnection(cloud: string): Promise<IValidateCloudConnectionResult>;
|
|
30
54
|
listResources(input: IListCloudResourcesInput): Promise<IListCloudResourcesResult>;
|
|
@@ -38,6 +38,27 @@ class CloudService {
|
|
|
38
38
|
async updateConnection(cloud, input) {
|
|
39
39
|
return this.api.updateConnection(cloud, input, this.auth());
|
|
40
40
|
}
|
|
41
|
+
async updateSecurityGroups(cloud, input) {
|
|
42
|
+
return this.api.updateSecurityGroups(cloud, input, this.auth());
|
|
43
|
+
}
|
|
44
|
+
async updateManagedNetworking(cloud, input) {
|
|
45
|
+
return this.api.updateManagedNetworking(cloud, input, this.auth());
|
|
46
|
+
}
|
|
47
|
+
async resolveNetworkingHost(host) {
|
|
48
|
+
return this.api.resolveNetworkingHost(host, this.auth());
|
|
49
|
+
}
|
|
50
|
+
async updateVpcConnector(cloud, input) {
|
|
51
|
+
return this.api.updateVpcConnector(cloud, input, this.auth());
|
|
52
|
+
}
|
|
53
|
+
async getVpcConnectorStatus(cloud) {
|
|
54
|
+
return this.api.getVpcConnectorStatus(cloud, this.auth());
|
|
55
|
+
}
|
|
56
|
+
async listVpcConnectorVpcs(cloud, region) {
|
|
57
|
+
return this.api.listVpcConnectorVpcs(cloud, region, this.auth());
|
|
58
|
+
}
|
|
59
|
+
async listVpcConnectorSubnets(cloud, region, vpcId) {
|
|
60
|
+
return this.api.listVpcConnectorSubnets(cloud, region, vpcId, this.auth());
|
|
61
|
+
}
|
|
41
62
|
async completeConnection(cloud, input) {
|
|
42
63
|
return this.api.completeConnection(cloud, input, this.auth());
|
|
43
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud.service.js","sourceRoot":"","sources":["../../src/cloud/cloud.service.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uEAAmE;
|
|
1
|
+
{"version":3,"file":"cloud.service.js","sourceRoot":"","sources":["../../src/cloud/cloud.service.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,uEAAmE;AAyBnE,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,IAA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AC;YACb,IAAI,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,UAAU,EAAE,CAAC;gBAC1C,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBACjC,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AArKD,oCAqKC;AAED,kBAAe,YAAY,CAAC"}
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export { materializeCloudLinkedBrokerEnv } from './cloud-broker-link.util';
|
|
|
5
5
|
export { materializeCloudLinkedDatabaseEnv } from './cloud-database-link.util';
|
|
6
6
|
export { materializeCloudLinkedGraphEnv } from './cloud-graph-link.util';
|
|
7
7
|
export { materializeCloudLinkedVectorEnv } from './cloud-vector-link.util';
|
|
8
|
+
export { openVpcConnectorTunnelStream } from './vpc-connector-tunnel.client';
|
|
9
|
+
export { buildVpcConnectorTunnelAdapterOptions } from './vpc-connector-connect.util';
|
|
10
|
+
export { parseTcpEndpointFromUrl } from './vpc-connector-endpoint.util';
|
|
11
|
+
export { buildVpcConnectorRelayWebSocketUrl } from './vpc-connector-relay.util';
|
|
12
|
+
export { AWS_VPC_PROVISION_SERVICES, parseVpcSecurityGroupIds, requireAwsVpcEnvFields, requireVpcSecurityGroupIds, withAwsVpcProvisionParams, } from './aws-vpc-provision.util';
|
|
8
13
|
export { cloudServiceForProvider, requireCloudService } from './cloud-service-map.util';
|
|
9
14
|
export { resolveCloudConnectionId } from './cloud-api.util';
|
|
10
15
|
export type { ICloudRuntimeContext } from './cloud-runtime.util';
|
package/dist/cloud/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.resolveCloudConnectionId = exports.requireCloudService = exports.cloudServiceForProvider = exports.materializeCloudLinkedVectorEnv = exports.materializeCloudLinkedGraphEnv = exports.materializeCloudLinkedDatabaseEnv = exports.materializeCloudLinkedBrokerEnv = exports.resolveCloudLinkedEnvConfig = exports.resolveCloudLinkedConfig = exports.CloudError = exports.CloudService = void 0;
|
|
17
|
+
exports.resolveCloudConnectionId = exports.requireCloudService = exports.cloudServiceForProvider = exports.withAwsVpcProvisionParams = exports.requireVpcSecurityGroupIds = exports.requireAwsVpcEnvFields = exports.parseVpcSecurityGroupIds = exports.AWS_VPC_PROVISION_SERVICES = exports.buildVpcConnectorRelayWebSocketUrl = exports.parseTcpEndpointFromUrl = exports.buildVpcConnectorTunnelAdapterOptions = exports.openVpcConnectorTunnelStream = 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; } });
|
|
@@ -29,6 +29,20 @@ var cloud_graph_link_util_1 = require("./cloud-graph-link.util");
|
|
|
29
29
|
Object.defineProperty(exports, "materializeCloudLinkedGraphEnv", { enumerable: true, get: function () { return cloud_graph_link_util_1.materializeCloudLinkedGraphEnv; } });
|
|
30
30
|
var cloud_vector_link_util_1 = require("./cloud-vector-link.util");
|
|
31
31
|
Object.defineProperty(exports, "materializeCloudLinkedVectorEnv", { enumerable: true, get: function () { return cloud_vector_link_util_1.materializeCloudLinkedVectorEnv; } });
|
|
32
|
+
var vpc_connector_tunnel_client_1 = require("./vpc-connector-tunnel.client");
|
|
33
|
+
Object.defineProperty(exports, "openVpcConnectorTunnelStream", { enumerable: true, get: function () { return vpc_connector_tunnel_client_1.openVpcConnectorTunnelStream; } });
|
|
34
|
+
var vpc_connector_connect_util_1 = require("./vpc-connector-connect.util");
|
|
35
|
+
Object.defineProperty(exports, "buildVpcConnectorTunnelAdapterOptions", { enumerable: true, get: function () { return vpc_connector_connect_util_1.buildVpcConnectorTunnelAdapterOptions; } });
|
|
36
|
+
var vpc_connector_endpoint_util_1 = require("./vpc-connector-endpoint.util");
|
|
37
|
+
Object.defineProperty(exports, "parseTcpEndpointFromUrl", { enumerable: true, get: function () { return vpc_connector_endpoint_util_1.parseTcpEndpointFromUrl; } });
|
|
38
|
+
var vpc_connector_relay_util_1 = require("./vpc-connector-relay.util");
|
|
39
|
+
Object.defineProperty(exports, "buildVpcConnectorRelayWebSocketUrl", { enumerable: true, get: function () { return vpc_connector_relay_util_1.buildVpcConnectorRelayWebSocketUrl; } });
|
|
40
|
+
var aws_vpc_provision_util_1 = require("./aws-vpc-provision.util");
|
|
41
|
+
Object.defineProperty(exports, "AWS_VPC_PROVISION_SERVICES", { enumerable: true, get: function () { return aws_vpc_provision_util_1.AWS_VPC_PROVISION_SERVICES; } });
|
|
42
|
+
Object.defineProperty(exports, "parseVpcSecurityGroupIds", { enumerable: true, get: function () { return aws_vpc_provision_util_1.parseVpcSecurityGroupIds; } });
|
|
43
|
+
Object.defineProperty(exports, "requireAwsVpcEnvFields", { enumerable: true, get: function () { return aws_vpc_provision_util_1.requireAwsVpcEnvFields; } });
|
|
44
|
+
Object.defineProperty(exports, "requireVpcSecurityGroupIds", { enumerable: true, get: function () { return aws_vpc_provision_util_1.requireVpcSecurityGroupIds; } });
|
|
45
|
+
Object.defineProperty(exports, "withAwsVpcProvisionParams", { enumerable: true, get: function () { return aws_vpc_provision_util_1.withAwsVpcProvisionParams; } });
|
|
32
46
|
var cloud_service_map_util_1 = require("./cloud-service-map.util");
|
|
33
47
|
Object.defineProperty(exports, "cloudServiceForProvider", { enumerable: true, get: function () { return cloud_service_map_util_1.cloudServiceForProvider; } });
|
|
34
48
|
Object.defineProperty(exports, "requireCloudService", { enumerable: true, get: function () { return cloud_service_map_util_1.requireCloudService; } });
|
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;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"}
|
|
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,6EAA6E;AAApE,2IAAA,4BAA4B,OAAA;AACrC,2EAAqF;AAA5E,mJAAA,qCAAqC,OAAA;AAC9C,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,uEAAgF;AAAvE,8IAAA,kCAAkC,OAAA;AAC3C,mEAMkC;AALhC,oIAAA,0BAA0B,OAAA;AAC1B,kIAAA,wBAAwB,OAAA;AACxB,gIAAA,sBAAsB,OAAA;AACtB,oIAAA,0BAA0B,OAAA;AAC1B,mIAAA,yBAAyB,OAAA;AAE3B,mEAAwF;AAA/E,iIAAA,uBAAuB,OAAA;AAAE,6HAAA,mBAAmB,OAAA;AACrD,mDAA4D;AAAnD,0HAAA,wBAAwB,OAAA;AAEjC,0CAAwB"}
|
|
@@ -44,6 +44,70 @@ export interface IUpdateCloudConnectionInput {
|
|
|
44
44
|
description?: string;
|
|
45
45
|
scopes?: CloudConnectionScope[];
|
|
46
46
|
}
|
|
47
|
+
export type AwsSecurityGroupResourceType = 'rds' | 'neptune';
|
|
48
|
+
/** Customer-managed VPC security group registered on an AWS cloud connection */
|
|
49
|
+
export interface IAwsRegisteredSecurityGroup {
|
|
50
|
+
tag: string;
|
|
51
|
+
groupId: string;
|
|
52
|
+
resourceTypes: AwsSecurityGroupResourceType[];
|
|
53
|
+
region?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface IUpdateCloudSecurityGroupsInput {
|
|
57
|
+
security_groups: IAwsRegisteredSecurityGroup[];
|
|
58
|
+
}
|
|
59
|
+
export type CloudNetworkingMode = 'customer' | 'managed' | 'vpc_connector';
|
|
60
|
+
export interface IVpcConnectorSecurityGroupRef {
|
|
61
|
+
groupId: string;
|
|
62
|
+
region: string;
|
|
63
|
+
vpcId?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IVpcConnectorConfig {
|
|
67
|
+
vpc_id: string;
|
|
68
|
+
subnet_ids: string[];
|
|
69
|
+
region: string;
|
|
70
|
+
connector_security_group: IVpcConnectorSecurityGroupRef;
|
|
71
|
+
data_security_group: IVpcConnectorSecurityGroupRef;
|
|
72
|
+
app_security_group_ids?: string[];
|
|
73
|
+
agent_status?: 'pending' | 'connected' | 'disconnected';
|
|
74
|
+
agent_last_seen_at?: string;
|
|
75
|
+
enrollment_token?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface IUpdateCloudVpcConnectorInput {
|
|
78
|
+
vpc_id: string;
|
|
79
|
+
subnet_ids: string[];
|
|
80
|
+
region?: string;
|
|
81
|
+
app_security_group_ids?: string[];
|
|
82
|
+
rotate_enrollment_token?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface ICloudVpcConnectorStatus {
|
|
85
|
+
connection_tag: string;
|
|
86
|
+
agent_status: 'pending' | 'connected' | 'disconnected';
|
|
87
|
+
agent_last_seen_at?: string;
|
|
88
|
+
vpc_id: string;
|
|
89
|
+
region: string;
|
|
90
|
+
subnet_ids: string[];
|
|
91
|
+
connector_security_group: IVpcConnectorSecurityGroupRef;
|
|
92
|
+
data_security_group: IVpcConnectorSecurityGroupRef;
|
|
93
|
+
}
|
|
94
|
+
export interface IAllowedSourceCidr {
|
|
95
|
+
cidr: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
source?: 'custom' | 'ductape_proxy' | 'detected';
|
|
98
|
+
}
|
|
99
|
+
export interface IUpdateCloudManagedNetworkingInput {
|
|
100
|
+
mode?: CloudNetworkingMode;
|
|
101
|
+
allowed_sources?: IAllowedSourceCidr[];
|
|
102
|
+
include_ductape_proxy?: boolean;
|
|
103
|
+
ductape_proxy_host?: string;
|
|
104
|
+
ductape_proxy_addresses?: string[];
|
|
105
|
+
region?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface IResolveCloudHostResult {
|
|
108
|
+
host: string;
|
|
109
|
+
addresses: string[];
|
|
110
|
+
}
|
|
47
111
|
export interface ICompleteCloudConnectionInput {
|
|
48
112
|
/** AWS cross-account role */
|
|
49
113
|
role_arn?: string;
|
|
@@ -105,16 +169,45 @@ export interface IImportCloudResourceInput {
|
|
|
105
169
|
productTag: string;
|
|
106
170
|
componentTag: string;
|
|
107
171
|
envSlug: string;
|
|
172
|
+
/** Required when importing existing RDS / Cloud SQL / PostgreSQL — AWS does not return passwords */
|
|
173
|
+
masterPassword?: string;
|
|
108
174
|
}
|
|
109
|
-
|
|
175
|
+
/** Service-specific provision fields (top-level on provision input, not nested under params). */
|
|
176
|
+
export interface ICloudProvisionFields {
|
|
177
|
+
securityGroups?: string[];
|
|
178
|
+
region?: string;
|
|
179
|
+
location?: string;
|
|
180
|
+
publiclyAccessible?: boolean;
|
|
181
|
+
instance?: string;
|
|
182
|
+
serverName?: string;
|
|
183
|
+
clusterIdentifier?: string;
|
|
184
|
+
engine?: string;
|
|
185
|
+
dbName?: string;
|
|
186
|
+
databaseName?: string;
|
|
187
|
+
bucketName?: string;
|
|
188
|
+
containerName?: string;
|
|
189
|
+
name?: string;
|
|
190
|
+
queueName?: string;
|
|
191
|
+
topicName?: string;
|
|
192
|
+
namespaceName?: string;
|
|
193
|
+
domainName?: string;
|
|
194
|
+
indexName?: string;
|
|
195
|
+
serviceName?: string;
|
|
196
|
+
accountName?: string;
|
|
197
|
+
dbSubnetGroupName?: string;
|
|
198
|
+
}
|
|
199
|
+
export interface IProvisionCloudResourceInput extends ICloudProvisionFields {
|
|
110
200
|
/** Workspace cloud connection tag */
|
|
111
201
|
cloud: string;
|
|
112
202
|
service: CloudResourceService;
|
|
113
|
-
template
|
|
203
|
+
template?: string;
|
|
114
204
|
componentType: CloudComponentType;
|
|
115
205
|
productTag: string;
|
|
116
206
|
componentTag: string;
|
|
117
207
|
envSlug: string;
|
|
208
|
+
/** When false, start cloud create and return immediately (databases only). Default true. */
|
|
209
|
+
waitForReady?: boolean;
|
|
210
|
+
/** @deprecated Put provision fields on the input root instead */
|
|
118
211
|
params?: Record<string, unknown>;
|
|
119
212
|
}
|
|
120
213
|
/** Partial product component returned by the connector for builder persistence */
|
|
@@ -131,6 +224,8 @@ export interface IImportCloudResourceResult {
|
|
|
131
224
|
}
|
|
132
225
|
export interface IProvisionCloudResourceResult extends IImportCloudResourceResult {
|
|
133
226
|
provisioned: boolean;
|
|
227
|
+
/** True when provision was accepted but cloud resource is not ready yet */
|
|
228
|
+
pending?: boolean;
|
|
134
229
|
}
|
|
135
230
|
/** Runtime short-lived credentials (proxy / connector broker) */
|
|
136
231
|
export interface ICloudRuntimeCredentialsInput {
|
|
@@ -143,10 +238,18 @@ export interface ICloudRuntimeCredentialsInput {
|
|
|
143
238
|
envSlug: string;
|
|
144
239
|
purpose?: 'runtime' | 'validate';
|
|
145
240
|
}
|
|
241
|
+
export interface ICloudRuntimeCredentialsNetworking {
|
|
242
|
+
mode?: CloudNetworkingMode;
|
|
243
|
+
vpc_connector?: {
|
|
244
|
+
cloud?: string;
|
|
245
|
+
agent_status?: 'pending' | 'connected' | 'disconnected';
|
|
246
|
+
};
|
|
247
|
+
}
|
|
146
248
|
export interface ICloudRuntimeCredentials {
|
|
147
249
|
provider: CloudProvider;
|
|
148
250
|
expiresAt: string;
|
|
149
251
|
credentials: Record<string, unknown>;
|
|
252
|
+
networking?: ICloudRuntimeCredentialsNetworking;
|
|
150
253
|
}
|
|
151
254
|
/** Optional fields on storage/broker configs when linked via cloud connection */
|
|
152
255
|
export type ComponentCloudAuthMode = 'manual' | 'cloud_connection';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAdapterConnectionOptions } from '../database/types/connection.interface';
|
|
2
|
+
import { EnvType, IRequestExtension } from '../types';
|
|
3
|
+
export interface IVpcConnectorTunnelConnectHint {
|
|
4
|
+
useVpcConnectorTunnel?: boolean;
|
|
5
|
+
cloud?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildVpcConnectorTunnelAdapterOptions(hint: IVpcConnectorTunnelConnectHint, connectionUrl: string, ctx: {
|
|
8
|
+
environment: EnvType;
|
|
9
|
+
auth: IRequestExtension;
|
|
10
|
+
}): Pick<IAdapterConnectionOptions, 'vpcConnectorTunnel'>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildVpcConnectorTunnelAdapterOptions = buildVpcConnectorTunnelAdapterOptions;
|
|
4
|
+
const vpc_connector_endpoint_util_1 = require("./vpc-connector-endpoint.util");
|
|
5
|
+
function buildVpcConnectorTunnelAdapterOptions(hint, connectionUrl, ctx) {
|
|
6
|
+
if (!hint.useVpcConnectorTunnel || !hint.cloud) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
const endpoint = (0, vpc_connector_endpoint_util_1.parseTcpEndpointFromUrl)(connectionUrl);
|
|
10
|
+
if (!endpoint) {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
vpcConnectorTunnel: {
|
|
15
|
+
cloudTag: hint.cloud,
|
|
16
|
+
host: endpoint.host,
|
|
17
|
+
port: endpoint.port,
|
|
18
|
+
environment: ctx.environment,
|
|
19
|
+
auth: ctx.auth,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=vpc-connector-connect.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpc-connector-connect.util.js","sourceRoot":"","sources":["../../src/cloud/vpc-connector-connect.util.ts"],"names":[],"mappings":";;AASA,sFAuBC;AA9BD,+EAAwE;AAOxE,SAAgB,qCAAqC,CACnD,IAAoC,EACpC,aAAqB,EACrB,GAAsD;IAEtD,IAAI,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,qDAAuB,EAAC,aAAa,CAAC,CAAC;IACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,kBAAkB,EAAE;YAClB,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;SACf;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseTcpEndpointFromUrl = parseTcpEndpointFromUrl;
|
|
4
|
+
function parseTcpEndpointFromUrl(connectionUrl) {
|
|
5
|
+
try {
|
|
6
|
+
const normalized = connectionUrl.includes('://')
|
|
7
|
+
? connectionUrl
|
|
8
|
+
: `postgresql://${connectionUrl}`;
|
|
9
|
+
const parsed = new URL(normalized);
|
|
10
|
+
const host = parsed.hostname;
|
|
11
|
+
if (!host)
|
|
12
|
+
return null;
|
|
13
|
+
const port = parsed.port
|
|
14
|
+
? Number(parsed.port)
|
|
15
|
+
: parsed.protocol === 'https:' || parsed.protocol === 'wss:'
|
|
16
|
+
? 8182
|
|
17
|
+
: 5432;
|
|
18
|
+
return { host, port };
|
|
19
|
+
}
|
|
20
|
+
catch (_a) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=vpc-connector-endpoint.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpc-connector-endpoint.util.js","sourceRoot":"","sources":["../../src/cloud/vpc-connector-endpoint.util.ts"],"names":[],"mappings":";;AAAA,0DAiBC;AAjBD,SAAgB,uBAAuB,CAAC,aAAqB;IAC3D,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC9C,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI;YACtB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACrB,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM;gBAC1D,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,IAAI,CAAC;QACX,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildVpcConnectorRelayWebSocketUrl = buildVpcConnectorRelayWebSocketUrl;
|
|
4
|
+
const urls_1 = require("../api/urls");
|
|
5
|
+
const urls_2 = require("../api/urls");
|
|
6
|
+
/** Builds the VPC connector relay WebSocket URL used by hosted proxy / SDK database connects. */
|
|
7
|
+
function buildVpcConnectorRelayWebSocketUrl(environment, auth) {
|
|
8
|
+
const base = (0, urls_1.getUrlForEnvironment)(environment, 'integrations');
|
|
9
|
+
const wsBase = base.replace(/^http/i, 'ws');
|
|
10
|
+
const params = new URLSearchParams({
|
|
11
|
+
workspace_id: auth.workspace_id,
|
|
12
|
+
public_key: auth.public_key,
|
|
13
|
+
user_id: auth.user_id,
|
|
14
|
+
});
|
|
15
|
+
return `${wsBase}${urls_2.CLOUD_VPC_CONNECTOR_RELAY_WS_PATH}?${params.toString()}`;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=vpc-connector-relay.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpc-connector-relay.util.js","sourceRoot":"","sources":["../../src/cloud/vpc-connector-relay.util.ts"],"names":[],"mappings":";;AAKA,gFAYC;AAjBD,sCAAmD;AACnD,sCAAgE;AAGhE,iGAAiG;AACjG,SAAgB,kCAAkC,CAChD,WAAoB,EACpB,IAAuB;IAEvB,MAAM,IAAI,GAAG,IAAA,2BAAoB,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAC;IACH,OAAO,GAAG,MAAM,GAAG,wCAAiC,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Duplex } from 'stream';
|
|
2
|
+
import { EnvType, IRequestExtension } from '../types';
|
|
3
|
+
export interface IVpcConnectorTunnelTarget {
|
|
4
|
+
cloudTag: string;
|
|
5
|
+
host: string;
|
|
6
|
+
port: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Opens a TCP stream to a private VPC host via the Ductape VPC connector relay.
|
|
10
|
+
* Used by hosted proxy / SDK when cloud connection networking mode is vpc_connector.
|
|
11
|
+
*/
|
|
12
|
+
export declare function openVpcConnectorTunnelStream(target: IVpcConnectorTunnelTarget, ctx: {
|
|
13
|
+
environment: EnvType;
|
|
14
|
+
auth: IRequestExtension;
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
}): Promise<Duplex>;
|