Skip to content

Commit f5d40b3

Browse files
Merge branch 'upgrade_js_commons' into upgrade_js_commons_spec_1.3
2 parents 7069143 + d14bcfa commit f5d40b3

File tree

3 files changed

+30
-62
lines changed

3 files changed

+30
-62
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"license": "Apache-2.0",
3737
"scripts": {
3838
"check": "npm run check:lint && npm run check:types",
39-
"check:lint": "eslint src --ext .js,.ts",
39+
"check:lint": "eslint src types --ext .js,.ts",
4040
"check:types": "tsc --noEmit",
4141
"build": "npm run build:esm && npm run build:cjs",
4242
"build:esm": "rimraf lib/esm && tsc -m es2015 --outDir lib/esm --importHelpers && scripts/build_esm_replace_imports.sh && replace @VERSION@ $npm_package_version lib/esm/settings/defaults.js",
@@ -50,7 +50,7 @@
5050
"prepublishOnly": "npm run check && npm run test && npm run build"
5151
},
5252
"dependencies": {
53-
"@splitsoftware/splitio-commons": "2.2.1-rc.5",
53+
"@splitsoftware/splitio-commons": "2.3.1-rc.0",
5454
"dotenv": "^9.0.1",
5555
"node-fetch": "^2.7.0",
5656
"yargs": "^17.0.1"

types/index.d.ts

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ declare module JsSyncTools {
1414
export class Synchronizer {
1515
/**
1616
* Creates a new Synchronizer instance
17-
* @param config The synchronizer config object
17+
* @param config - The synchronizer config object
1818
*/
1919
constructor(config: ISynchronizerSettings);
2020
/**
2121
* Execute synchronization
22-
* @param cb Optional error-first callback to be invoked when the synchronization ends. The callback will be invoked with an error as first argument if the synchronization fails.
23-
* @return {Promise<boolean>} A promise that resolves when the operation ends,
24-
* with a boolean indicating if operation succeeded or not. The promise never rejects.
22+
* @param cb - Optional error-first callback to be invoked when the synchronization ends. The callback will be invoked with an error as first argument if the synchronization fails.
23+
* @returns A promise that resolves when the operation ends, with a boolean indicating if operation succeeded or not. The promise never rejects.
2524
*/
2625
execute(cb?: (err?: Error) => void): Promise<boolean>;
2726
// @TODO expose settings eventually
@@ -30,8 +29,6 @@ declare module JsSyncTools {
3029

3130
/**
3231
* Log levels.
33-
*
34-
* @typedef {string} LogLevel
3532
*/
3633
type LogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE';
3734
/**
@@ -41,30 +38,25 @@ declare module JsSyncTools {
4138
/**
4239
* String property to override the base URL where the synchronizer will get feature flagging related data like a feature flag rollout plan or segments information.
4340
*
44-
* @property {string} sdk
45-
* @default 'https://sdk.split.io/api'
41+
* @defaultValue `'https://sdk.split.io/api'`
4642
*/
4743
sdk?: string
4844
/**
4945
* String property to override the base URL where the synchronizer will post impressions and events.
5046
*
51-
* @property {string} events
52-
* @default 'https://events.split.io/api'
47+
* @defaultValue `'https://events.split.io/api'`
5348
*/
5449
events?: string,
5550
/**
5651
* String property to override the base URL where the synchronizer will post telemetry data.
5752
*
58-
* @property {string} telemetry
59-
* @default 'https://telemetry.split.io/api'
53+
* @defaultValue `'https://telemetry.split.io/api'`
6054
*/
6155
telemetry?: string
6256
};
6357

6458
/**
6559
* SplitFilter type.
66-
*
67-
* @typedef {string} SplitFilterType
6860
*/
6961
type SplitFilterType = 'byName' | 'bySet';
7062
/**
@@ -73,73 +65,56 @@ declare module JsSyncTools {
7365
interface SplitFilter {
7466
/**
7567
* Type of the filter.
76-
*
77-
* @property {SplitFilterType} type
7868
*/
7969
type: SplitFilterType,
8070
/**
8171
* List of values: feature flag names for 'byName' filter type, and feature flag name prefixes for 'byPrefix' type.
82-
*
83-
* @property {string[]} values
8472
*/
8573
values: string[],
8674
}
8775
/**
8876
* ImpressionsMode type.
89-
*
90-
* @typedef {string} ImpressionsMode
9177
*/
9278
type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
9379
/**
9480
* Settings interface for Synchronizer instances.
9581
*
96-
* @interface ISynchronizerSettings
9782
* @see {@link https://help.split.io/hc/en-us/articles/4421513571469-Split-JavaScript-synchronizer-tools#configuration}
9883
*/
9984
interface ISynchronizerSettings {
10085
/**
10186
* Core settings.
102-
*
103-
* @property {Object} core
10487
*/
10588
core: {
10689
/**
107-
* Your SDK key. More information: @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
90+
* Your SDK key.
10891
*
109-
* @property {string} authorizationKey
92+
* @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
11093
*/
11194
authorizationKey: string
11295
}
11396
/**
11497
* Defines which kind of storage we should instantiate.
115-
*
116-
* @property {Object} storage
11798
*/
11899
storage: {
119100
/**
120101
* Storage type. The only possible value is "PLUGGABLE", which is the default.
121-
* @property {'PLUGGABLE'} type
122102
*/
123103
type?: 'PLUGGABLE',
124104
/**
125105
* A valid storage instance.
126-
*
127-
* @property {Object} wrapper
128106
*/
129107
wrapper: Object
130108
/**
131109
* Optional prefix added to the storage keys to prevent any kind of data collision between SDK versions.
132110
*
133-
* @property {string} prefix
134-
* @default 'SPLITIO'
111+
* @defaultValue `'SPLITIO'`
135112
*/
136113
prefix?: string
137114
}
138115
/**
139116
* List of URLs that the Synchronizer will use as base for it's synchronization functionalities.
140117
* Do not change these settings unless you're working an advanced use case, like connecting to a proxy.
141-
*
142-
* @property {Object} urls
143118
*/
144119
urls?: UrlSettings
145120
/**
@@ -150,30 +125,29 @@ declare module JsSyncTools {
150125
* config.debug = true
151126
* config.debug = 'WARN'
152127
* ```
153-
* @property {boolean | LogLevel | ILogger} debug
154-
* @default false
128+
* @defaultValue `false`
155129
*/
156130
debug?: boolean | LogLevel
157131
/**
158132
* Synchronization settings.
159-
* @property {Object} sync
160133
*/
161134
sync?: {
162135
/**
163136
* List of feature flag filters. These filters are used to fetch a subset of the feature flag definitions in your environment.
164137
*
165138
* Example:
166-
* `splitFilter: [
167-
* { type: 'byName', values: ['my_feature_flag_1', 'my_feature_flag_2'] }, // will fetch feature flags named 'my_feature_flag_1' and 'my_feature_flag_2'
168-
* ]`
169-
* @property {SplitFilter[]} splitFilters
139+
* ```
140+
* splitFilter: [
141+
* { type: 'byName', values: ['my_feature_flag_1', 'my_feature_flag_2'] }, // will fetch feature flags named 'my_feature_flag_1' and 'my_feature_flag_2'
142+
* ]
143+
* ```
170144
*/
171145
splitFilters?: SplitFilter[]
172146
/**
173147
* Feature Flag Spec version. Option to determine which version of the feature flag definitions are fetched and stored.
174148
* Possible values are `'1.0'`, `'1.1'`, `'1.2'`, and `'1.3'`.
175149
*
176-
* @default '1.3'
150+
* @defaultValue `'1.3'`
177151
*/
178152
flagSpecVersion?: '1.0' | '1.1' | '1.2' | '1.3'
179153
/**
@@ -183,8 +157,7 @@ declare module JsSyncTools {
183157
* - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
184158
* - OPTIMIZED: will send unique impressions to Split Servers avoiding a considerable amount of traffic that duplicated impressions could generate.
185159
*
186-
* @property {String} impressionsMode
187-
* @default 'OPTIMIZED'
160+
* @defaultValue `'OPTIMIZED'`
188161
*/
189162
impressionsMode?: ImpressionsMode
190163
/**
@@ -237,33 +210,28 @@ declare module JsSyncTools {
237210
*
238211
* @see {@link https://nodejs.org/api/https.html#class-httpsagent}
239212
*
240-
* @property {http.Agent | https.Agent} agent
241-
* @default undefined
213+
* @defaultValue `undefined`
242214
*/
243215
agent?: RequestOptions['agent']
244216
},
245217
}
246218
/**
247219
* Scheduler settings.
248-
* @property {Object} scheduler
249220
*/
250221
scheduler?: {
251222
/**
252223
* Maximum number of impressions to send per POST request.
253-
* @property {number} impressionsPerPost
254-
* @default 1000
224+
* @defaultValue `1000`
255225
*/
256226
impressionsPerPost?: number
257227
/**
258228
* Maximum number of events to send per POST request.
259-
* @property {number} eventsPerPost
260-
* @default 1000
229+
* @defaultValue `1000`
261230
*/
262231
eventsPerPost?: number
263232
/**
264233
* Maximum number of retry attempts for posting impressions and events.
265-
* @property {number} maxRetries
266-
* @default 3
234+
* @defaultValue `3`
267235
*/
268236
maxRetries?: number
269237
}

0 commit comments

Comments
 (0)