@openfeature/ofrep-web-provider 0.2.0 → 0.3.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.
- package/index.cjs.js +2 -5
- package/index.esm.js +2 -5
- package/package.json +4 -4
package/index.cjs.js
CHANGED
|
@@ -33,7 +33,7 @@ class OFREPWebProvider {
|
|
|
33
33
|
this._options = options;
|
|
34
34
|
this._logger = logger;
|
|
35
35
|
this._etag = null;
|
|
36
|
-
this._ofrepAPI = new ofrepCore.OFREPApi(this._options
|
|
36
|
+
this._ofrepAPI = new ofrepCore.OFREPApi(this._options, this._options.fetchImplementation);
|
|
37
37
|
this._pollingInterval = (_a = this._options.pollInterval) !== null && _a !== void 0 ? _a : this.DEFAULT_POLL_INTERVAL;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -138,10 +138,7 @@ class OFREPWebProvider {
|
|
|
138
138
|
const evalReq = {
|
|
139
139
|
context,
|
|
140
140
|
};
|
|
141
|
-
const
|
|
142
|
-
'Content-Type': 'application/json',
|
|
143
|
-
}) }, (this._etag !== null ? { headers: { 'If-None-Match': this._etag } } : {}));
|
|
144
|
-
const response = yield this._ofrepAPI.postBulkEvaluateFlags(evalReq, options);
|
|
141
|
+
const response = yield this._ofrepAPI.postBulkEvaluateFlags(evalReq, this._etag);
|
|
145
142
|
if (response.httpStatus === 304) {
|
|
146
143
|
// nothing has changed since last time, we are doing nothing
|
|
147
144
|
return { status: BulkEvaluationStatus.SUCCESS_NO_CHANGES, flags: [] };
|
package/index.esm.js
CHANGED
|
@@ -29,7 +29,7 @@ class OFREPWebProvider {
|
|
|
29
29
|
this._options = options;
|
|
30
30
|
this._logger = logger;
|
|
31
31
|
this._etag = null;
|
|
32
|
-
this._ofrepAPI = new OFREPApi(this._options
|
|
32
|
+
this._ofrepAPI = new OFREPApi(this._options, this._options.fetchImplementation);
|
|
33
33
|
this._pollingInterval = (_a = this._options.pollInterval) !== null && _a !== void 0 ? _a : this.DEFAULT_POLL_INTERVAL;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -134,10 +134,7 @@ class OFREPWebProvider {
|
|
|
134
134
|
const evalReq = {
|
|
135
135
|
context,
|
|
136
136
|
};
|
|
137
|
-
const
|
|
138
|
-
'Content-Type': 'application/json',
|
|
139
|
-
}) }, (this._etag !== null ? { headers: { 'If-None-Match': this._etag } } : {}));
|
|
140
|
-
const response = yield this._ofrepAPI.postBulkEvaluateFlags(evalReq, options);
|
|
137
|
+
const response = yield this._ofrepAPI.postBulkEvaluateFlags(evalReq, this._etag);
|
|
141
138
|
if (response.httpStatus === 304) {
|
|
142
139
|
// nothing has changed since last time, we are doing nothing
|
|
143
140
|
return { status: BulkEvaluationStatus.SUCCESS_NO_CHANGES, flags: [] };
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfeature/ofrep-web-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"tslib": "^2.3.0"
|
|
5
|
+
"tslib": "^2.3.0",
|
|
6
|
+
"@openfeature/ofrep-core": "0.2.0"
|
|
6
7
|
},
|
|
7
8
|
"main": "./index.cjs.js",
|
|
8
9
|
"typings": "./src/index.d.ts",
|
|
@@ -11,8 +12,7 @@
|
|
|
11
12
|
"current-version": "echo $npm_package_version"
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {
|
|
14
|
-
"@openfeature/web-sdk": ">=0.4.0"
|
|
15
|
-
"@openfeature/ofrep-core": "^0.1.5"
|
|
15
|
+
"@openfeature/web-sdk": ">=0.4.0"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
"./package.json": "./package.json",
|