@ductape/sdk 0.0.4-v78 → 0.0.4-v80

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.
@@ -1743,14 +1743,18 @@ class ProductsBuilderService {
1743
1743
  async fetchVectors(version) {
1744
1744
  const components = await this.productApi.fetchProductComponents(this.product_id, 'vector', this.getUserAccess());
1745
1745
  // Decrypt sensitive fields in vector envs
1746
- const decryptedComponents = components.map((vectorComponent) => {
1747
- var _a;
1748
- const decryptedEnvs = (_a = vectorComponent.envs) === null || _a === void 0 ? void 0 : _a.map((env) => {
1749
- return Object.assign(Object.assign({}, env), { apiKey: env.apiKey ? (0, processor_utils_1.decrypt)(env.apiKey, this.product.private_key) : env.apiKey, endpoint: env.endpoint ? (0, processor_utils_1.decrypt)(env.endpoint, this.product.private_key) : env.endpoint });
1750
- });
1751
- return Object.assign(Object.assign({}, vectorComponent), { envs: decryptedEnvs });
1752
- });
1753
- return decryptedComponents;
1746
+ /* const decryptedComponents = components.map((vectorComponent: any) => {
1747
+ const decryptedEnvs = vectorComponent.envs?.map((env: any) => {
1748
+ return {
1749
+ ...env,
1750
+ apiKey: env.apiKey ? decrypt(env.apiKey, this.product.private_key) : env.apiKey,
1751
+ endpoint: env.endpoint ? decrypt(env.endpoint, this.product.private_key) : env.endpoint,
1752
+ };
1753
+ });
1754
+ return { ...vectorComponent, envs: decryptedEnvs };
1755
+ }); */
1756
+ //return decryptedComponents as unknown as IProductVector[];
1757
+ return components;
1754
1758
  }
1755
1759
  /**
1756
1760
  * Fetch a specific vector database configuration by tag
@@ -1758,15 +1762,19 @@ class ProductsBuilderService {
1758
1762
  * @param version Optional version
1759
1763
  */
1760
1764
  async fetchVector(tag, version) {
1761
- var _a;
1762
1765
  const component = await this.productApi.fetchProductComponentByTag(this.product_id, 'vector', tag, this.getUserAccess());
1766
+ /*console.log(JSON.stringify(component))
1763
1767
  if (component) {
1764
- // Decrypt sensitive fields in vector envs
1765
- const decryptedEnvs = (_a = component.envs) === null || _a === void 0 ? void 0 : _a.map((env) => {
1766
- return Object.assign(Object.assign({}, env), { apiKey: env.apiKey ? (0, processor_utils_1.decrypt)(env.apiKey, this.product.private_key) : env.apiKey, endpoint: env.endpoint ? (0, processor_utils_1.decrypt)(env.endpoint, this.product.private_key) : env.endpoint });
1767
- });
1768
- return Object.assign(Object.assign({}, component), { envs: decryptedEnvs });
1769
- }
1768
+ // Decrypt sensitive fields in vector envs
1769
+ const decryptedEnvs = component.envs?.map((env: any) => {
1770
+ return {
1771
+ ...env,
1772
+ apiKey: env.apiKey ? decrypt(env.apiKey, this.product.private_key) : env.apiKey,
1773
+ endpoint: env.endpoint ? decrypt(env.endpoint, this.product.private_key) : env.endpoint,
1774
+ };
1775
+ });
1776
+ return { ...component, envs: decryptedEnvs } as unknown as IProductVector;
1777
+ }*/
1770
1778
  return component;
1771
1779
  }
1772
1780
  /**