Skip to content

Commit f6e8376

Browse files
author
Steve Arch
committed
fix: Upgrade to OpenFeature SDK 0.5.1
Release-As: 0.5.1
1 parent 7704a0b commit f6e8376

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
44
[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
5-
[![OpenFeature Specification](https://img.shields.io/static/v1?label=OpenFeature%20Specification&message=v0.4.0&color=yellow)](https://github.com/open-feature/spec/tree/v0.4.0)
6-
[![OpenFeature SDK](https://img.shields.io/static/v1?label=OpenFeature%20SDK&message=v0.4.0&color=green)](https://github.com/open-feature/js-sdk)
5+
[![OpenFeature Specification](https://img.shields.io/static/v1?label=OpenFeature%20Specification&message=v0.5.0&color=yellow)](https://github.com/open-feature/spec/tree/v0.5.0)
6+
[![OpenFeature SDK](https://img.shields.io/static/v1?label=OpenFeature%20SDK&message=v0.5.1&color=green)](https://github.com/open-feature/js-sdk/tree/v0.5.1)
77
[![npm version](https://badge.fury.io/js/cloudbees-openfeature-provider-node.svg)](https://badge.fury.io/js/cloudbees-openfeature-provider-node)
88
[![CloudBees Rox SDK](https://img.shields.io/static/v1?label=Rox%20SDK&message=v5.4.1&color=green)](https://www.npmjs.com/package/rox-node)
99
[![Known Vulnerabilities](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-node/badge.svg)](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-node)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"dist/"
5151
],
5252
"dependencies": {
53-
"@openfeature/js-sdk": "^0.4.0",
53+
"@openfeature/js-sdk": "^0.5.1",
5454
"rox-node": "^5.4.2"
5555
},
5656
"devDependencies": {

src/provider.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {EvaluationContext, JsonValue, Provider, ResolutionDetails} from '@openfeature/js-sdk'
1+
import {EvaluationContext, InvalidContextError, JsonValue, Provider, ResolutionDetails} from '@openfeature/js-sdk'
22
import Rox, {RoxSetupOptions} from 'rox-node'
33

44
/**
@@ -34,6 +34,5 @@ export class CloudbeesProvider implements Provider {
3434

3535
// eslint-disable-next-line @typescript-eslint/no-unused-vars
3636
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>> {
37-
return Promise.reject('Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean')
38-
}
37+
return Promise.reject(new InvalidContextError('Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean')) }
3938
}

test/provider.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ describe('Cloudbees Provider', () => {
7272
describe('object flags', () => {
7373
it('test we do not support these types of flag', async () => {
7474
await expect(client.getObjectDetails('not-supported', {a: 'b'})).resolves.toEqual({
75-
errorCode: 'GENERAL_ERROR',
76-
flagKey: 'not-supported',
75+
errorCode: 'INVALID_CONTEXT',
76+
errorMessage: 'Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean', flagKey: 'not-supported',
7777
reason: 'ERROR',
7878
value: {a: 'b'},
7979
})

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,10 @@
619619
"@nodelib/fs.scandir" "2.1.5"
620620
fastq "^1.6.0"
621621

622-
"@openfeature/js-sdk@^0.4.0":
623-
version "0.4.0"
624-
resolved "https://registry.yarnpkg.com/@openfeature/js-sdk/-/js-sdk-0.4.0.tgz#6ec5ae1c3d8b81cd7a6aa88ade5e6be6bc1c8272"
625-
integrity sha512-tfZNxg7QCKIVDrBRktIaqnphANXloyHSZJs2weumXRF6e1OiTSVTbnPtYZZCr15PMiIzEQUQheulloTepLzAmA==
622+
"@openfeature/js-sdk@^0.5.1":
623+
version "0.5.1"
624+
resolved "https://registry.yarnpkg.com/@openfeature/js-sdk/-/js-sdk-0.5.1.tgz#c0c86ac3083d0f85ca18699b060a12cf758a42da"
625+
integrity sha512-yPu13kZYOBK28IDmJmXrNyq8Zf32W7ZptHGR+rF6xiK/hDC8BfG5FZuD+YboefwR3cooXKRp2Mr2fRggilIgoQ==
626626

627627
"@sinclair/typebox@^0.24.1":
628628
version "0.24.38"

0 commit comments

Comments
 (0)