Skip to content

Commit

Permalink
Merge branch 'rlamb/copy-random-uuid' of github.com:launchdarkly/js-s…
Browse files Browse the repository at this point in the history
…erver-sdk-private into rlamb/copy-random-uuid
  • Loading branch information
kinyoklion committed Nov 15, 2024
2 parents 2501c84 + 74d1f19 commit 7de7b2b
Show file tree
Hide file tree
Showing 36 changed files with 546 additions and 460 deletions.
24 changes: 12 additions & 12 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"packages/shared/common": "2.12.0",
"packages/shared/sdk-server": "2.9.1",
"packages/sdk/server-node": "9.7.1",
"packages/sdk/cloudflare": "2.6.1",
"packages/shared/sdk-server-edge": "2.5.1",
"packages/sdk/vercel": "1.3.20",
"packages/sdk/akamai-base": "2.1.19",
"packages/sdk/akamai-edgekv": "1.2.1",
"packages/shared/akamai-edgeworker-sdk": "1.3.1",
"packages/store/node-server-sdk-dynamodb": "6.2.1",
"packages/store/node-server-sdk-redis": "4.2.1",
"packages/shared/sdk-server": "2.10.0",
"packages/sdk/server-node": "9.7.2",
"packages/sdk/cloudflare": "2.6.2",
"packages/shared/sdk-server-edge": "2.5.2",
"packages/sdk/vercel": "1.3.21",
"packages/sdk/akamai-base": "2.1.20",
"packages/sdk/akamai-edgekv": "1.3.0",
"packages/shared/akamai-edgeworker-sdk": "1.3.2",
"packages/store/node-server-sdk-dynamodb": "6.2.2",
"packages/store/node-server-sdk-redis": "4.2.2",
"packages/shared/sdk-client": "1.12.0",
"packages/sdk/react-native": "10.9.2",
"packages/telemetry/node-server-sdk-otel": "1.1.1",
"packages/telemetry/node-server-sdk-otel": "1.1.2",
"packages/sdk/browser": "0.3.2",
"packages/sdk/server-ai": "0.2.0"
"packages/sdk/server-ai": "0.2.1"
}
10 changes: 10 additions & 0 deletions packages/sdk/akamai-base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ All notable changes to the LaunchDarkly SDK for Akamai Workers will be documente
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.1.1 to ^1.1.2
* @launchdarkly/js-server-sdk-common bumped from ^2.2.1 to ^2.2.2

## [2.1.20](https://github.com/launchdarkly/js-core/compare/akamai-server-base-sdk-v2.1.19...akamai-server-base-sdk-v2.1.20) (2024-11-14)


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.3.1 to ^1.3.2
* @launchdarkly/js-server-sdk-common bumped from ^2.9.1 to ^2.10.0

## [2.1.19](https://github.com/launchdarkly/js-core/compare/akamai-server-base-sdk-v2.1.18...akamai-server-base-sdk-v2.1.19) (2024-11-04)


Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/akamai-base/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
"typescript": "5.1.6"
},
"dependencies": {
"@launchdarkly/akamai-server-base-sdk": "2.1.19"
"@launchdarkly/akamai-server-base-sdk": "2.1.20"
}
}
6 changes: 3 additions & 3 deletions packages/sdk/akamai-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@launchdarkly/akamai-server-base-sdk",
"version": "2.1.19",
"version": "2.1.20",
"description": "Akamai LaunchDarkly EdgeWorker SDK",
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/akamai-base",
"repository": {
Expand Down Expand Up @@ -73,7 +73,7 @@
"typescript": "5.1.6"
},
"dependencies": {
"@launchdarkly/akamai-edgeworker-sdk-common": "^1.3.1",
"@launchdarkly/js-server-sdk-common": "^2.9.1"
"@launchdarkly/akamai-edgeworker-sdk-common": "^1.3.2",
"@launchdarkly/js-server-sdk-common": "^2.10.0"
}
}
15 changes: 15 additions & 0 deletions packages/sdk/akamai-edgekv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ All notable changes to the LaunchDarkly SDK for Akamai Workers will be documente
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.1.1 to ^1.1.2
* @launchdarkly/js-server-sdk-common bumped from ^2.2.1 to ^2.2.2

## [1.3.0](https://github.com/launchdarkly/js-core/compare/akamai-server-edgekv-sdk-v1.2.1...akamai-server-edgekv-sdk-v1.3.0) (2024-11-14)


### Features

* Upgrade edgekv bundled files to 0.6.3 ([#610](https://github.com/launchdarkly/js-core/issues/610)) ([58dfec6](https://github.com/launchdarkly/js-core/commit/58dfec68c268390852cc511191c7f9b47ec3e668))


### Dependencies

* The following workspace dependencies were updated
* dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.3.1 to ^1.3.2
* @launchdarkly/js-server-sdk-common bumped from ^2.9.1 to ^2.10.0

## [1.2.1](https://github.com/launchdarkly/js-core/compare/akamai-server-edgekv-sdk-v1.2.0...akamai-server-edgekv-sdk-v1.2.1) (2024-11-04)


Expand Down
13 changes: 11 additions & 2 deletions packages/sdk/akamai-edgekv/__tests__/edgekv/edgeKVProvider.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { LDLogger } from '@launchdarkly/js-server-sdk-common';

import { EdgeKV } from '../../src/edgekv/edgekv';
import EdgeKVProvider from '../../src/edgekv/edgeKVProvider';

Expand All @@ -11,14 +13,21 @@ const NAMESPACE = 'namespace';
const GROUP = 'group';

describe('EdgeKVProvider', () => {
let logger: LDLogger;
beforeEach(() => {
mockEdgeKV.mockImplementation(() => ({
getText: jest.fn().mockResolvedValue('some-text'),
}));
logger = {
debug: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
};
});

it('get string from edgeKV', async () => {
const edgeKVProvider = new EdgeKVProvider({ namespace: NAMESPACE, group: GROUP });
const edgeKVProvider = new EdgeKVProvider({ namespace: NAMESPACE, group: GROUP, logger });
expect(await edgeKVProvider.get('rootKey')).toEqual('some-text');
});

Expand All @@ -28,7 +37,7 @@ describe('EdgeKVProvider', () => {
getText: jest.fn().mockRejectedValueOnce(expectedError),
}));

const edgeKVProvider = new EdgeKVProvider({ namespace: NAMESPACE, group: GROUP });
const edgeKVProvider = new EdgeKVProvider({ namespace: NAMESPACE, group: GROUP, logger });
const result = await edgeKVProvider.get('rootKey');
expect(result).toBe(undefined);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/akamai-edgekv/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"typescript": "5.1.6"
},
"dependencies": {
"@launchdarkly/akamai-server-edgekv-sdk": "1.2.1"
"@launchdarkly/akamai-server-edgekv-sdk": "1.3.0"
}
}
6 changes: 3 additions & 3 deletions packages/sdk/akamai-edgekv/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@launchdarkly/akamai-server-edgekv-sdk",
"version": "1.2.1",
"version": "1.3.0",
"description": "Akamai LaunchDarkly EdgeWorker SDK for EdgeKV feature store",
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/akamai-edgekv",
"repository": {
Expand Down Expand Up @@ -73,7 +73,7 @@
"typescript": "5.1.6"
},
"dependencies": {
"@launchdarkly/akamai-edgeworker-sdk-common": "^1.3.1",
"@launchdarkly/js-server-sdk-common": "^2.9.1"
"@launchdarkly/akamai-edgeworker-sdk-common": "^1.3.2",
"@launchdarkly/js-server-sdk-common": "^2.10.0"
}
}
8 changes: 6 additions & 2 deletions packages/sdk/akamai-edgekv/src/edgekv/edgeKVProvider.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import { EdgeProvider } from '@launchdarkly/akamai-edgeworker-sdk-common';
import { LDLogger } from '@launchdarkly/js-server-sdk-common';

import { EdgeKV } from './edgekv';

type EdgeKVProviderParams = {
namespace: string;
group: string;
logger: LDLogger;
};

export default class EdgeKVProvider implements EdgeProvider {
private _edgeKv: EdgeKV;
private _logger: LDLogger;

constructor({ namespace, group }: EdgeKVProviderParams) {
constructor({ namespace, group, logger }: EdgeKVProviderParams) {
this._edgeKv = new EdgeKV({ namespace, group } as any);
this._logger = logger;
}

async get(rootKey: string): Promise<string | null | undefined> {
try {
return await this._edgeKv.getText({ item: rootKey } as any);
} catch (e) {
/* empty */
this._logger?.error(`Error getting value from EdgeKV: ${e}`);
}
return undefined;
}
Expand Down
Loading

0 comments on commit 7de7b2b

Please sign in to comment.