Skip to content

chore(deps): replace deprecated lib to alternative #2247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/idempotency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
},
"dependencies": {
"@aws-lambda-powertools/commons": "^2.0.3",
"@aws-sdk/util-base64-node": "^3.209.0",
"jmespath": "^0.16.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/parameters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@
"@aws-sdk/client-secrets-manager": "^3.535.0",
"@aws-sdk/client-ssm": "^3.535.0",
"@aws-sdk/util-dynamodb": "^3.538.0",
"@smithy/util-base64": "^2.3.0",
"aws-sdk-client-mock": "^4.0.0",
"aws-sdk-client-mock-jest": "^4.0.0"
},
"dependencies": {
"@aws-lambda-powertools/commons": "^2.0.3",
"@aws-sdk/util-base64-node": "^3.209.0"
"@aws-lambda-powertools/commons": "^2.0.3"
},
"peerDependencies": {
"@aws-sdk/client-appconfigdata": ">=3.x",
Expand Down
6 changes: 3 additions & 3 deletions packages/parameters/src/base/transformValue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JSONValue } from '@aws-lambda-powertools/commons/types';
import { isString } from '@aws-lambda-powertools/commons';
import { fromBase64 } from '@aws-sdk/util-base64-node';
import { fromBase64 } from '@aws-lambda-powertools/commons/utils/base64';
import {
TRANSFORM_METHOD_BINARY,
TRANSFORM_METHOD_JSON,
Expand All @@ -19,7 +19,7 @@ import type { TransformOptions } from '../types/BaseProvider.js';
* the value will be parsed as JSON using the `JSON.parse` function.
*
* When the transform is `binary` or `auto` and the key ends with `.binary`, the value will be decoded from base64 using the `fromBase64` function
* from the `@aws-sdk/util-base64-node` package.
* from the `@aws-lambda-powertools/commons/utils/base64` package.
*
* If the transformation fails, the function will return the value as-is unless `throwOnTransformError` is set to `true`.
*
Expand Down Expand Up @@ -67,7 +67,7 @@ const transformValue = (
return JSON.parse(value) as JSONValue;
// If the transform is `binary` or `auto` and the key ends with `.binary`, decode the value from base64
} else if (isBinaryTransform || isAutoBinaryTransform) {
return new TextDecoder('utf-8').decode(fromBase64(value));
return new TextDecoder('utf-8').decode(fromBase64(value, 'base64'));
}
} catch (error) {
if (throwOnTransformError)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TestStack,
} from '@aws-lambda-powertools/testing-utils';
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
import { toBase64 } from '@aws-sdk/util-base64-node';
import { toBase64 } from '@smithy/util-base64';
import { join } from 'node:path';
import { TestAppConfigWithProfiles } from '../helpers/resources.js';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/parameters/tests/unit/BaseProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
TransformParameterError,
clearCaches,
} from '../../src/index.js';
import { toBase64 } from '@aws-sdk/util-base64-node';
import { toBase64 } from '@smithy/util-base64';

const encoder = new TextEncoder();
jest.mock('@aws-lambda-powertools/commons', () => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/parameters/tests/unit/SSMProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
SSMGetParametersByNameOutputInterface,
} from '../../src/types/SSMProvider.js';
import { ExpirableValue } from '../../src/base/ExpirableValue.js';
import { toBase64 } from '@aws-sdk/util-base64-node';
import { toBase64 } from '@smithy/util-base64';
import { addUserAgentMiddleware } from '@aws-lambda-powertools/commons';

const encoder = new TextEncoder();
Expand Down
2 changes: 1 addition & 1 deletion packages/parameters/tests/unit/getAppConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@aws-sdk/client-appconfigdata';
import { mockClient } from 'aws-sdk-client-mock';
import 'aws-sdk-client-mock-jest';
import { toBase64 } from '@aws-sdk/util-base64-node';
import { toBase64 } from '@smithy/util-base64';
import { Uint8ArrayBlobAdapter } from '@smithy/util-stream';
import type { JSONValue } from '@aws-lambda-powertools/commons/types';

Expand Down