@tolgee/core 6.5.0 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,8 +66,8 @@ export declare function Controller({ options }: StateServiceProps): Readonly<{
66
66
  apiUrl?: string | undefined;
67
67
  apiKey?: string | undefined;
68
68
  projectId?: string | number | undefined;
69
- language?: string | undefined;
70
69
  branch?: string | undefined;
70
+ language?: string | undefined;
71
71
  defaultLanguage?: string | undefined;
72
72
  availableLanguages?: string[] | undefined;
73
73
  fallbackLanguage?: import("../types").FallbackLanguageOption;
@@ -15,8 +15,8 @@ export declare function State(onLanguageChange: EventEmitterInstance<LanguageEve
15
15
  apiUrl?: string | undefined;
16
16
  apiKey?: string | undefined;
17
17
  projectId?: string | number | undefined;
18
- language?: string | undefined;
19
18
  branch?: string | undefined;
19
+ language?: string | undefined;
20
20
  defaultLanguage?: string | undefined;
21
21
  availableLanguages?: string[] | undefined;
22
22
  fallbackLanguage?: import("../../types").FallbackLanguageOption;
@@ -131,8 +131,8 @@ declare function createTolgee(options: TolgeeOptions): Readonly<{
131
131
  apiUrl?: string | undefined;
132
132
  apiKey?: string | undefined;
133
133
  projectId?: string | number | undefined;
134
- language?: string | undefined;
135
134
  branch?: string | undefined;
135
+ language?: string | undefined;
136
136
  defaultLanguage?: string | undefined;
137
137
  availableLanguages?: string[] | undefined;
138
138
  fallbackLanguage?: import("./types").FallbackLanguageOption;
@@ -72,6 +72,7 @@ export type DevCredentials = undefined | {
72
72
  apiUrl?: string;
73
73
  apiKey?: string;
74
74
  projectId?: string | number;
75
+ branch?: string;
75
76
  };
76
77
  export type WrapperMiddleware = {
77
78
  unwrap: WrapperUnwrapFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tolgee/core",
3
- "version": "6.5.0",
3
+ "version": "6.6.0",
4
4
  "description": "Library providing ability to translate messages directly in context of developed application.",
5
5
  "main": "./dist/tolgee.cjs.js",
6
6
  "module": "./dist/tolgee.esm.js",
@@ -73,5 +73,5 @@
73
73
  "access": "public"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "2f726c8d5f573f1a399a6e36cdf472b5af56bafd"
76
+ "gitHead": "723cf70b9331e89d74056cedef8292b7defcac34"
77
77
  }
@@ -61,4 +61,35 @@ describe('initial options', () => {
61
61
 
62
62
  expect(tolgee.getInitialOptions().apiUrl).toEqual('http://localhost:8000');
63
63
  });
64
+
65
+ it('overrideCredentials with branch', () => {
66
+ const tolgee = TolgeeCore().init({
67
+ language: 'en',
68
+ apiUrl: 'http://localhost:8080',
69
+ });
70
+
71
+ tolgee.overrideCredentials({
72
+ apiUrl: 'http://localhost:8000',
73
+ apiKey: 'test',
74
+ branch: 'feature-x',
75
+ });
76
+
77
+ expect(tolgee.getInitialOptions().branch).toEqual('feature-x');
78
+ });
79
+
80
+ it('overrideCredentials branch overrides init branch', () => {
81
+ const tolgee = TolgeeCore().init({
82
+ language: 'en',
83
+ apiUrl: 'http://localhost:8080',
84
+ branch: 'original',
85
+ });
86
+
87
+ tolgee.overrideCredentials({
88
+ apiUrl: 'http://localhost:8000',
89
+ apiKey: 'test',
90
+ branch: 'override',
91
+ });
92
+
93
+ expect(tolgee.getInitialOptions().branch).toEqual('override');
94
+ });
64
95
  });
@@ -111,6 +111,7 @@ export type DevCredentials =
111
111
  apiUrl?: string;
112
112
  apiKey?: string;
113
113
  projectId?: string | number;
114
+ branch?: string;
114
115
  };
115
116
  export type WrapperMiddleware = {
116
117
  unwrap: WrapperUnwrapFunction;