Skip to content

Commit

Permalink
Prepare v8.0.0 (Catnip) release (#74)
Browse files Browse the repository at this point in the history
* Update configcat-common v9.0.0

* Bump version

* Update samples
  • Loading branch information
adams85 authored Nov 24, 2023
1 parent 3812bb7 commit 47b77f3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "configcat-js-ssr",
"version": "7.1.2",
"version": "8.0.0",
"description": "ConfigCat Feature Flags for Server Side Rendered apps like NuxtJS. Official ConfigCat SDK for Server Side Rendered to easily access feature flags.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -46,7 +46,7 @@
},
"dependencies": {
"axios": "^1.6.2",
"configcat-common": "^8.1.1",
"configcat-common": "^9.0.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
7 changes: 2 additions & 5 deletions samples/nuxt-ssr/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import Vue from "vue";
import Logo from "~/components/Logo.vue";
import * as ConfigCat from "configcat-js-ssr";
import { IConfigCatClient, LogLevel, PollingMode } from 'configcat-js-ssr';
import { LogLevel, PollingMode, User } from 'configcat-js-ssr';
import { log } from "util";
// Setting log level to Info to show detailed feature flag evaluation
Expand Down Expand Up @@ -55,10 +55,7 @@ export default Vue.extend({
},
checkPOC() {
// Read more about the User Object: https://configcat.com/docs/sdk-reference/node/#user-object
const userObject = {
identifier: "#SOME-USER-ID#",
email: this.user
};
const userObject = new User("#SOME-USER-ID#", this.user);
client.getValueAsync("isPOCFeatureEnabled", false, userObject).then(value => {
this.isPOCFeatureEnabled = value;
});
Expand Down
13 changes: 8 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,27 @@ export { FormattableLogMessage } from "configcat-common";

export type { IConfigCatCache } from "configcat-common";

export type { IConfig, ISetting, ITargetingRule, IPercentageOption, SettingValue, VariationIdValue } from "configcat-common";
export type {
IConfig, ISegment, SettingTypeMap, SettingValue, VariationIdValue, ISettingValueContainer, ISettingUnion, ISetting, ITargetingRule, IPercentageOption,
ConditionTypeMap, IConditionUnion, ICondition, UserConditionComparisonValueTypeMap, IUserConditionUnion, IUserCondition, IPrerequisiteFlagCondition, ISegmentCondition
} from "configcat-common";

export { SettingType, Comparator } from "configcat-common";
export { SettingType, UserComparator, PrerequisiteFlagComparator, SegmentComparator } from "configcat-common";

export type { IConfigCatClient, IConfigCatClientSnapshot } from "configcat-common";

export { SettingKeyValue } from "configcat-common";

export type { IEvaluationDetails, SettingTypeOf } from "configcat-common";

export type { UserAttributeValue } from "configcat-common";

export { User } from "configcat-common";

export type { FlagOverrides } from "configcat-common";

export { OverrideBehaviour } from "configcat-common";

export { RefreshResult } from "configcat-common";
export { ClientCacheState, RefreshResult } from "configcat-common";

export type { IProvidesHooks, HookEvents } from "configcat-common";

export { ClientReadyState } from "configcat-common";
2 changes: 1 addition & 1 deletion test/IndexTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("ConfigCatClient index (main)", () => {
for (const pollingMode of [PollingMode.AutoPoll, PollingMode.LazyLoad, PollingMode.ManualPoll]) {
it(`getClient() should createInstance with ${PollingMode[pollingMode]}`, () => {

const client: IConfigCatClient = configcatClient.getClient("SDKKEY", pollingMode);
const client: IConfigCatClient = configcatClient.getClient("SDKKEY-890123456789012/1234567890123456789012", pollingMode);

assert.isDefined(client);

Expand Down
8 changes: 4 additions & 4 deletions test/IntegrationTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe("Integration tests - Wrong SDK key", () => {
it("Auto poll with wrong SDK Key - getValueAsync() should return default value", async () => {

const defaultValue = "NOT_CAT";
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY", PollingMode.AutoPoll,
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY-56789012/1234567890123456789012", PollingMode.AutoPoll,
{ requestTimeoutMs: 500, maxInitWaitTimeSeconds: 1 });

const actual: string = await client.getValueAsync("stringDefaultCat", defaultValue);
Expand All @@ -212,7 +212,7 @@ describe("Integration tests - Wrong SDK key", () => {
it("Manual poll with wrong SDK Key - getValueAsync() should return default value", async () => {

const defaultValue = "NOT_CAT";
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY", PollingMode.ManualPoll, { requestTimeoutMs: 500 });
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY-56789012/1234567890123456789012", PollingMode.ManualPoll, { requestTimeoutMs: 500 });

const actual: string = await client.getValueAsync("stringDefaultCat", defaultValue);
assert.strictEqual(actual, defaultValue);
Expand All @@ -226,7 +226,7 @@ describe("Integration tests - Wrong SDK key", () => {
it("Lazy load with wrong SDK Key - getValueAsync() should return default value", async () => {

const defaultValue = "NOT_CAT";
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY", PollingMode.LazyLoad, { requestTimeoutMs: 500 });
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY-56789012/1234567890123456789012", PollingMode.LazyLoad, { requestTimeoutMs: 500 });

const actual: string = await client.getValueAsync("stringDefaultCat", defaultValue);
assert.strictEqual(actual, defaultValue);
Expand All @@ -236,7 +236,7 @@ describe("Integration tests - Wrong SDK key", () => {

it("getAllKeysAsync() should not crash with wrong SDK Key", async () => {

const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY", PollingMode.ManualPoll, { requestTimeoutMs: 500 });
const client: IConfigCatClient = configcatClient.getClient("WRONG_SDK_KEY-56789012/1234567890123456789012", PollingMode.ManualPoll, { requestTimeoutMs: 500 });

const keys: string[] = await client.getAllKeysAsync();
assert.equal(keys.length, 0);
Expand Down

0 comments on commit 47b77f3

Please sign in to comment.