Skip to content

Commit

Permalink
fix: Upgrade to OpenFeature SDK 0.5.1
Browse files Browse the repository at this point in the history
Release-As: 0.5.1
  • Loading branch information
Steve Arch committed Oct 17, 2022
1 parent 7704a0b commit f6e8376
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![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)
[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
[![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)
[![OpenFeature SDK](https://img.shields.io/static/v1?label=OpenFeature%20SDK&message=v0.4.0&color=green)](https://github.com/open-feature/js-sdk)
[![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)
[![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)
[![npm version](https://badge.fury.io/js/cloudbees-openfeature-provider-node.svg)](https://badge.fury.io/js/cloudbees-openfeature-provider-node)
[![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)
[![Known Vulnerabilities](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-node/badge.svg)](https://snyk.io/test/github/rollout/cloudbees-openfeature-provider-node)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dist/"
],
"dependencies": {
"@openfeature/js-sdk": "^0.4.0",
"@openfeature/js-sdk": "^0.5.1",
"rox-node": "^5.4.2"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {EvaluationContext, JsonValue, Provider, ResolutionDetails} from '@openfeature/js-sdk'
import {EvaluationContext, InvalidContextError, JsonValue, Provider, ResolutionDetails} from '@openfeature/js-sdk'
import Rox, {RoxSetupOptions} from 'rox-node'

/**
Expand Down Expand Up @@ -34,6 +34,5 @@ export class CloudbeesProvider implements Provider {

// eslint-disable-next-line @typescript-eslint/no-unused-vars
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>> {
return Promise.reject('Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean')
}
return Promise.reject(new InvalidContextError('Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean')) }
}
4 changes: 2 additions & 2 deletions test/provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ describe('Cloudbees Provider', () => {
describe('object flags', () => {
it('test we do not support these types of flag', async () => {
await expect(client.getObjectDetails('not-supported', {a: 'b'})).resolves.toEqual({
errorCode: 'GENERAL_ERROR',
flagKey: 'not-supported',
errorCode: 'INVALID_CONTEXT',
errorMessage: 'Not implemented - CloudBees feature management does not support an object type. Only String, Number and Boolean', flagKey: 'not-supported',
reason: 'ERROR',
value: {a: 'b'},
})
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

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

"@sinclair/typebox@^0.24.1":
version "0.24.38"
Expand Down

0 comments on commit f6e8376

Please sign in to comment.