From 6f5dbd91b11c2e19eb0aeaba40d68661c077fc52 Mon Sep 17 00:00:00 2001 From: jhsinger-klotho <111291520+jhsinger-klotho@users.noreply.github.com> Date: Tue, 24 Jan 2023 21:08:13 -0600 Subject: [PATCH] make kv use new doc client (#138) --- pkg/lang/javascript/aws_runtime/_keyvalue.ts | 5 +++-- pkg/lang/javascript/aws_runtime/keyvalue.js.tmpl | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/lang/javascript/aws_runtime/_keyvalue.ts b/pkg/lang/javascript/aws_runtime/_keyvalue.ts index 6ca88e9a9..b619e1e08 100644 --- a/pkg/lang/javascript/aws_runtime/_keyvalue.ts +++ b/pkg/lang/javascript/aws_runtime/_keyvalue.ts @@ -5,10 +5,11 @@ import _ = require('lodash') import moment = require('moment') import { AWSConfig } from './clients' +import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb' -import DynamoDB = require('aws-sdk/clients/dynamodb') -const docClient = new DynamoDB.DocumentClient(AWSConfig) +const { DynamoDBClient } = require('@aws-sdk/client-dynamodb') +const docClient = new DynamoDBDocumentClient(new DynamoDBClient(AWSConfig)) let alldMaps: dMap[] = [] import { Entity } from 'electrodb' diff --git a/pkg/lang/javascript/aws_runtime/keyvalue.js.tmpl b/pkg/lang/javascript/aws_runtime/keyvalue.js.tmpl index 850821b65..ce24d8ee7 100644 --- a/pkg/lang/javascript/aws_runtime/keyvalue.js.tmpl +++ b/pkg/lang/javascript/aws_runtime/keyvalue.js.tmpl @@ -5,8 +5,9 @@ exports.dMap = void 0; const _ = require("lodash"); const moment = require("moment"); const clients_1 = require("./clients"); -const DynamoDB = require("aws-sdk/clients/dynamodb"); -const docClient = new DynamoDB.DocumentClient(clients_1.AWSConfig); +const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb"); +const { DynamoDBClient } = require('@aws-sdk/client-dynamodb'); +const docClient = new lib_dynamodb_1.DynamoDBDocumentClient(new DynamoDBClient(clients_1.AWSConfig)); let alldMaps = []; const electrodb_1 = require("electrodb"); const KVStore = new electrodb_1.Entity({