@openfeature/flagd-provider 0.13.4 → 0.14.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
CHANGED
|
@@ -4906,357 +4906,6 @@ function isSet$2(value) {
|
|
|
4906
4906
|
}
|
|
4907
4907
|
|
|
4908
4908
|
/* eslint-disable */
|
|
4909
|
-
function createBaseResolveAllRequest() {
|
|
4910
|
-
return { context: undefined };
|
|
4911
|
-
}
|
|
4912
|
-
const ResolveAllRequest = {
|
|
4913
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
4914
|
-
if (message.context !== undefined) {
|
|
4915
|
-
Struct.encode(Struct.wrap(message.context), writer.uint32(10).fork()).ldelim();
|
|
4916
|
-
}
|
|
4917
|
-
return writer;
|
|
4918
|
-
},
|
|
4919
|
-
decode(input, length) {
|
|
4920
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
4921
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4922
|
-
const message = createBaseResolveAllRequest();
|
|
4923
|
-
while (reader.pos < end) {
|
|
4924
|
-
const tag = reader.uint32();
|
|
4925
|
-
switch (tag >>> 3) {
|
|
4926
|
-
case 1:
|
|
4927
|
-
if (tag !== 10) {
|
|
4928
|
-
break;
|
|
4929
|
-
}
|
|
4930
|
-
message.context = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
4931
|
-
continue;
|
|
4932
|
-
}
|
|
4933
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
4934
|
-
break;
|
|
4935
|
-
}
|
|
4936
|
-
reader.skipType(tag & 7);
|
|
4937
|
-
}
|
|
4938
|
-
return message;
|
|
4939
|
-
},
|
|
4940
|
-
fromJSON(object) {
|
|
4941
|
-
return { context: isObject$1(object.context) ? object.context : undefined };
|
|
4942
|
-
},
|
|
4943
|
-
toJSON(message) {
|
|
4944
|
-
const obj = {};
|
|
4945
|
-
if (message.context !== undefined) {
|
|
4946
|
-
obj.context = message.context;
|
|
4947
|
-
}
|
|
4948
|
-
return obj;
|
|
4949
|
-
},
|
|
4950
|
-
create(base) {
|
|
4951
|
-
return ResolveAllRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
4952
|
-
},
|
|
4953
|
-
fromPartial(object) {
|
|
4954
|
-
var _a;
|
|
4955
|
-
const message = createBaseResolveAllRequest();
|
|
4956
|
-
message.context = (_a = object.context) !== null && _a !== void 0 ? _a : undefined;
|
|
4957
|
-
return message;
|
|
4958
|
-
},
|
|
4959
|
-
};
|
|
4960
|
-
function createBaseResolveAllResponse() {
|
|
4961
|
-
return { flags: {}, metadata: undefined };
|
|
4962
|
-
}
|
|
4963
|
-
const ResolveAllResponse = {
|
|
4964
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
4965
|
-
Object.entries(message.flags).forEach(([key, value]) => {
|
|
4966
|
-
ResolveAllResponse_FlagsEntry.encode({ key: key, value }, writer.uint32(10).fork()).ldelim();
|
|
4967
|
-
});
|
|
4968
|
-
if (message.metadata !== undefined) {
|
|
4969
|
-
Struct.encode(Struct.wrap(message.metadata), writer.uint32(18).fork()).ldelim();
|
|
4970
|
-
}
|
|
4971
|
-
return writer;
|
|
4972
|
-
},
|
|
4973
|
-
decode(input, length) {
|
|
4974
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
4975
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4976
|
-
const message = createBaseResolveAllResponse();
|
|
4977
|
-
while (reader.pos < end) {
|
|
4978
|
-
const tag = reader.uint32();
|
|
4979
|
-
switch (tag >>> 3) {
|
|
4980
|
-
case 1:
|
|
4981
|
-
if (tag !== 10) {
|
|
4982
|
-
break;
|
|
4983
|
-
}
|
|
4984
|
-
const entry1 = ResolveAllResponse_FlagsEntry.decode(reader, reader.uint32());
|
|
4985
|
-
if (entry1.value !== undefined) {
|
|
4986
|
-
message.flags[entry1.key] = entry1.value;
|
|
4987
|
-
}
|
|
4988
|
-
continue;
|
|
4989
|
-
case 2:
|
|
4990
|
-
if (tag !== 18) {
|
|
4991
|
-
break;
|
|
4992
|
-
}
|
|
4993
|
-
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
4994
|
-
continue;
|
|
4995
|
-
}
|
|
4996
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
4997
|
-
break;
|
|
4998
|
-
}
|
|
4999
|
-
reader.skipType(tag & 7);
|
|
5000
|
-
}
|
|
5001
|
-
return message;
|
|
5002
|
-
},
|
|
5003
|
-
fromJSON(object) {
|
|
5004
|
-
return {
|
|
5005
|
-
flags: isObject$1(object.flags)
|
|
5006
|
-
? Object.entries(object.flags).reduce((acc, [key, value]) => {
|
|
5007
|
-
acc[key] = AnyFlag.fromJSON(value);
|
|
5008
|
-
return acc;
|
|
5009
|
-
}, {})
|
|
5010
|
-
: {},
|
|
5011
|
-
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5012
|
-
};
|
|
5013
|
-
},
|
|
5014
|
-
toJSON(message) {
|
|
5015
|
-
const obj = {};
|
|
5016
|
-
if (message.flags) {
|
|
5017
|
-
const entries = Object.entries(message.flags);
|
|
5018
|
-
if (entries.length > 0) {
|
|
5019
|
-
obj.flags = {};
|
|
5020
|
-
entries.forEach(([k, v]) => {
|
|
5021
|
-
obj.flags[k] = AnyFlag.toJSON(v);
|
|
5022
|
-
});
|
|
5023
|
-
}
|
|
5024
|
-
}
|
|
5025
|
-
if (message.metadata !== undefined) {
|
|
5026
|
-
obj.metadata = message.metadata;
|
|
5027
|
-
}
|
|
5028
|
-
return obj;
|
|
5029
|
-
},
|
|
5030
|
-
create(base) {
|
|
5031
|
-
return ResolveAllResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
5032
|
-
},
|
|
5033
|
-
fromPartial(object) {
|
|
5034
|
-
var _a, _b;
|
|
5035
|
-
const message = createBaseResolveAllResponse();
|
|
5036
|
-
message.flags = Object.entries((_a = object.flags) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => {
|
|
5037
|
-
if (value !== undefined) {
|
|
5038
|
-
acc[key] = AnyFlag.fromPartial(value);
|
|
5039
|
-
}
|
|
5040
|
-
return acc;
|
|
5041
|
-
}, {});
|
|
5042
|
-
message.metadata = (_b = object.metadata) !== null && _b !== void 0 ? _b : undefined;
|
|
5043
|
-
return message;
|
|
5044
|
-
},
|
|
5045
|
-
};
|
|
5046
|
-
function createBaseResolveAllResponse_FlagsEntry() {
|
|
5047
|
-
return { key: "", value: undefined };
|
|
5048
|
-
}
|
|
5049
|
-
const ResolveAllResponse_FlagsEntry = {
|
|
5050
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
5051
|
-
if (message.key !== "") {
|
|
5052
|
-
writer.uint32(10).string(message.key);
|
|
5053
|
-
}
|
|
5054
|
-
if (message.value !== undefined) {
|
|
5055
|
-
AnyFlag.encode(message.value, writer.uint32(18).fork()).ldelim();
|
|
5056
|
-
}
|
|
5057
|
-
return writer;
|
|
5058
|
-
},
|
|
5059
|
-
decode(input, length) {
|
|
5060
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
5061
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5062
|
-
const message = createBaseResolveAllResponse_FlagsEntry();
|
|
5063
|
-
while (reader.pos < end) {
|
|
5064
|
-
const tag = reader.uint32();
|
|
5065
|
-
switch (tag >>> 3) {
|
|
5066
|
-
case 1:
|
|
5067
|
-
if (tag !== 10) {
|
|
5068
|
-
break;
|
|
5069
|
-
}
|
|
5070
|
-
message.key = reader.string();
|
|
5071
|
-
continue;
|
|
5072
|
-
case 2:
|
|
5073
|
-
if (tag !== 18) {
|
|
5074
|
-
break;
|
|
5075
|
-
}
|
|
5076
|
-
message.value = AnyFlag.decode(reader, reader.uint32());
|
|
5077
|
-
continue;
|
|
5078
|
-
}
|
|
5079
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
5080
|
-
break;
|
|
5081
|
-
}
|
|
5082
|
-
reader.skipType(tag & 7);
|
|
5083
|
-
}
|
|
5084
|
-
return message;
|
|
5085
|
-
},
|
|
5086
|
-
fromJSON(object) {
|
|
5087
|
-
return {
|
|
5088
|
-
key: isSet$1(object.key) ? String(object.key) : "",
|
|
5089
|
-
value: isSet$1(object.value) ? AnyFlag.fromJSON(object.value) : undefined,
|
|
5090
|
-
};
|
|
5091
|
-
},
|
|
5092
|
-
toJSON(message) {
|
|
5093
|
-
const obj = {};
|
|
5094
|
-
if (message.key !== "") {
|
|
5095
|
-
obj.key = message.key;
|
|
5096
|
-
}
|
|
5097
|
-
if (message.value !== undefined) {
|
|
5098
|
-
obj.value = AnyFlag.toJSON(message.value);
|
|
5099
|
-
}
|
|
5100
|
-
return obj;
|
|
5101
|
-
},
|
|
5102
|
-
create(base) {
|
|
5103
|
-
return ResolveAllResponse_FlagsEntry.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
5104
|
-
},
|
|
5105
|
-
fromPartial(object) {
|
|
5106
|
-
var _a;
|
|
5107
|
-
const message = createBaseResolveAllResponse_FlagsEntry();
|
|
5108
|
-
message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
|
|
5109
|
-
message.value = (object.value !== undefined && object.value !== null)
|
|
5110
|
-
? AnyFlag.fromPartial(object.value)
|
|
5111
|
-
: undefined;
|
|
5112
|
-
return message;
|
|
5113
|
-
},
|
|
5114
|
-
};
|
|
5115
|
-
function createBaseAnyFlag() {
|
|
5116
|
-
return {
|
|
5117
|
-
reason: "",
|
|
5118
|
-
variant: "",
|
|
5119
|
-
boolValue: undefined,
|
|
5120
|
-
stringValue: undefined,
|
|
5121
|
-
doubleValue: undefined,
|
|
5122
|
-
objectValue: undefined,
|
|
5123
|
-
metadata: undefined,
|
|
5124
|
-
};
|
|
5125
|
-
}
|
|
5126
|
-
const AnyFlag = {
|
|
5127
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
5128
|
-
if (message.reason !== "") {
|
|
5129
|
-
writer.uint32(10).string(message.reason);
|
|
5130
|
-
}
|
|
5131
|
-
if (message.variant !== "") {
|
|
5132
|
-
writer.uint32(18).string(message.variant);
|
|
5133
|
-
}
|
|
5134
|
-
if (message.boolValue !== undefined) {
|
|
5135
|
-
writer.uint32(24).bool(message.boolValue);
|
|
5136
|
-
}
|
|
5137
|
-
if (message.stringValue !== undefined) {
|
|
5138
|
-
writer.uint32(34).string(message.stringValue);
|
|
5139
|
-
}
|
|
5140
|
-
if (message.doubleValue !== undefined) {
|
|
5141
|
-
writer.uint32(41).double(message.doubleValue);
|
|
5142
|
-
}
|
|
5143
|
-
if (message.objectValue !== undefined) {
|
|
5144
|
-
Struct.encode(Struct.wrap(message.objectValue), writer.uint32(50).fork()).ldelim();
|
|
5145
|
-
}
|
|
5146
|
-
if (message.metadata !== undefined) {
|
|
5147
|
-
Struct.encode(Struct.wrap(message.metadata), writer.uint32(58).fork()).ldelim();
|
|
5148
|
-
}
|
|
5149
|
-
return writer;
|
|
5150
|
-
},
|
|
5151
|
-
decode(input, length) {
|
|
5152
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
5153
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5154
|
-
const message = createBaseAnyFlag();
|
|
5155
|
-
while (reader.pos < end) {
|
|
5156
|
-
const tag = reader.uint32();
|
|
5157
|
-
switch (tag >>> 3) {
|
|
5158
|
-
case 1:
|
|
5159
|
-
if (tag !== 10) {
|
|
5160
|
-
break;
|
|
5161
|
-
}
|
|
5162
|
-
message.reason = reader.string();
|
|
5163
|
-
continue;
|
|
5164
|
-
case 2:
|
|
5165
|
-
if (tag !== 18) {
|
|
5166
|
-
break;
|
|
5167
|
-
}
|
|
5168
|
-
message.variant = reader.string();
|
|
5169
|
-
continue;
|
|
5170
|
-
case 3:
|
|
5171
|
-
if (tag !== 24) {
|
|
5172
|
-
break;
|
|
5173
|
-
}
|
|
5174
|
-
message.boolValue = reader.bool();
|
|
5175
|
-
continue;
|
|
5176
|
-
case 4:
|
|
5177
|
-
if (tag !== 34) {
|
|
5178
|
-
break;
|
|
5179
|
-
}
|
|
5180
|
-
message.stringValue = reader.string();
|
|
5181
|
-
continue;
|
|
5182
|
-
case 5:
|
|
5183
|
-
if (tag !== 41) {
|
|
5184
|
-
break;
|
|
5185
|
-
}
|
|
5186
|
-
message.doubleValue = reader.double();
|
|
5187
|
-
continue;
|
|
5188
|
-
case 6:
|
|
5189
|
-
if (tag !== 50) {
|
|
5190
|
-
break;
|
|
5191
|
-
}
|
|
5192
|
-
message.objectValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
5193
|
-
continue;
|
|
5194
|
-
case 7:
|
|
5195
|
-
if (tag !== 58) {
|
|
5196
|
-
break;
|
|
5197
|
-
}
|
|
5198
|
-
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
5199
|
-
continue;
|
|
5200
|
-
}
|
|
5201
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
5202
|
-
break;
|
|
5203
|
-
}
|
|
5204
|
-
reader.skipType(tag & 7);
|
|
5205
|
-
}
|
|
5206
|
-
return message;
|
|
5207
|
-
},
|
|
5208
|
-
fromJSON(object) {
|
|
5209
|
-
return {
|
|
5210
|
-
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
5211
|
-
variant: isSet$1(object.variant) ? String(object.variant) : "",
|
|
5212
|
-
boolValue: isSet$1(object.boolValue) ? Boolean(object.boolValue) : undefined,
|
|
5213
|
-
stringValue: isSet$1(object.stringValue) ? String(object.stringValue) : undefined,
|
|
5214
|
-
doubleValue: isSet$1(object.doubleValue) ? Number(object.doubleValue) : undefined,
|
|
5215
|
-
objectValue: isObject$1(object.objectValue) ? object.objectValue : undefined,
|
|
5216
|
-
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5217
|
-
};
|
|
5218
|
-
},
|
|
5219
|
-
toJSON(message) {
|
|
5220
|
-
const obj = {};
|
|
5221
|
-
if (message.reason !== "") {
|
|
5222
|
-
obj.reason = message.reason;
|
|
5223
|
-
}
|
|
5224
|
-
if (message.variant !== "") {
|
|
5225
|
-
obj.variant = message.variant;
|
|
5226
|
-
}
|
|
5227
|
-
if (message.boolValue !== undefined) {
|
|
5228
|
-
obj.boolValue = message.boolValue;
|
|
5229
|
-
}
|
|
5230
|
-
if (message.stringValue !== undefined) {
|
|
5231
|
-
obj.stringValue = message.stringValue;
|
|
5232
|
-
}
|
|
5233
|
-
if (message.doubleValue !== undefined) {
|
|
5234
|
-
obj.doubleValue = message.doubleValue;
|
|
5235
|
-
}
|
|
5236
|
-
if (message.objectValue !== undefined) {
|
|
5237
|
-
obj.objectValue = message.objectValue;
|
|
5238
|
-
}
|
|
5239
|
-
if (message.metadata !== undefined) {
|
|
5240
|
-
obj.metadata = message.metadata;
|
|
5241
|
-
}
|
|
5242
|
-
return obj;
|
|
5243
|
-
},
|
|
5244
|
-
create(base) {
|
|
5245
|
-
return AnyFlag.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
5246
|
-
},
|
|
5247
|
-
fromPartial(object) {
|
|
5248
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
5249
|
-
const message = createBaseAnyFlag();
|
|
5250
|
-
message.reason = (_a = object.reason) !== null && _a !== void 0 ? _a : "";
|
|
5251
|
-
message.variant = (_b = object.variant) !== null && _b !== void 0 ? _b : "";
|
|
5252
|
-
message.boolValue = (_c = object.boolValue) !== null && _c !== void 0 ? _c : undefined;
|
|
5253
|
-
message.stringValue = (_d = object.stringValue) !== null && _d !== void 0 ? _d : undefined;
|
|
5254
|
-
message.doubleValue = (_e = object.doubleValue) !== null && _e !== void 0 ? _e : undefined;
|
|
5255
|
-
message.objectValue = (_f = object.objectValue) !== null && _f !== void 0 ? _f : undefined;
|
|
5256
|
-
message.metadata = (_g = object.metadata) !== null && _g !== void 0 ? _g : undefined;
|
|
5257
|
-
return message;
|
|
5258
|
-
},
|
|
5259
|
-
};
|
|
5260
4909
|
function createBaseResolveBooleanRequest() {
|
|
5261
4910
|
return { flagKey: "", context: undefined };
|
|
5262
4911
|
}
|
|
@@ -5325,17 +4974,17 @@ const ResolveBooleanRequest = {
|
|
|
5325
4974
|
},
|
|
5326
4975
|
};
|
|
5327
4976
|
function createBaseResolveBooleanResponse() {
|
|
5328
|
-
return { value:
|
|
4977
|
+
return { value: undefined, reason: "", variant: undefined, metadata: undefined };
|
|
5329
4978
|
}
|
|
5330
4979
|
const ResolveBooleanResponse = {
|
|
5331
4980
|
encode(message, writer = _m0.Writer.create()) {
|
|
5332
|
-
if (message.value
|
|
4981
|
+
if (message.value !== undefined) {
|
|
5333
4982
|
writer.uint32(8).bool(message.value);
|
|
5334
4983
|
}
|
|
5335
4984
|
if (message.reason !== "") {
|
|
5336
4985
|
writer.uint32(18).string(message.reason);
|
|
5337
4986
|
}
|
|
5338
|
-
if (message.variant !==
|
|
4987
|
+
if (message.variant !== undefined) {
|
|
5339
4988
|
writer.uint32(26).string(message.variant);
|
|
5340
4989
|
}
|
|
5341
4990
|
if (message.metadata !== undefined) {
|
|
@@ -5384,21 +5033,21 @@ const ResolveBooleanResponse = {
|
|
|
5384
5033
|
},
|
|
5385
5034
|
fromJSON(object) {
|
|
5386
5035
|
return {
|
|
5387
|
-
value: isSet$1(object.value) ? Boolean(object.value) :
|
|
5036
|
+
value: isSet$1(object.value) ? Boolean(object.value) : undefined,
|
|
5388
5037
|
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
5389
|
-
variant: isSet$1(object.variant) ? String(object.variant) :
|
|
5038
|
+
variant: isSet$1(object.variant) ? String(object.variant) : undefined,
|
|
5390
5039
|
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5391
5040
|
};
|
|
5392
5041
|
},
|
|
5393
5042
|
toJSON(message) {
|
|
5394
5043
|
const obj = {};
|
|
5395
|
-
if (message.value
|
|
5044
|
+
if (message.value !== undefined) {
|
|
5396
5045
|
obj.value = message.value;
|
|
5397
5046
|
}
|
|
5398
5047
|
if (message.reason !== "") {
|
|
5399
5048
|
obj.reason = message.reason;
|
|
5400
5049
|
}
|
|
5401
|
-
if (message.variant !==
|
|
5050
|
+
if (message.variant !== undefined) {
|
|
5402
5051
|
obj.variant = message.variant;
|
|
5403
5052
|
}
|
|
5404
5053
|
if (message.metadata !== undefined) {
|
|
@@ -5412,9 +5061,9 @@ const ResolveBooleanResponse = {
|
|
|
5412
5061
|
fromPartial(object) {
|
|
5413
5062
|
var _a, _b, _c, _d;
|
|
5414
5063
|
const message = createBaseResolveBooleanResponse();
|
|
5415
|
-
message.value = (_a = object.value) !== null && _a !== void 0 ? _a :
|
|
5064
|
+
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
|
|
5416
5065
|
message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : "";
|
|
5417
|
-
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c :
|
|
5066
|
+
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c : undefined;
|
|
5418
5067
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : undefined;
|
|
5419
5068
|
return message;
|
|
5420
5069
|
},
|
|
@@ -5487,17 +5136,17 @@ const ResolveStringRequest = {
|
|
|
5487
5136
|
},
|
|
5488
5137
|
};
|
|
5489
5138
|
function createBaseResolveStringResponse() {
|
|
5490
|
-
return { value:
|
|
5139
|
+
return { value: undefined, reason: "", variant: undefined, metadata: undefined };
|
|
5491
5140
|
}
|
|
5492
5141
|
const ResolveStringResponse = {
|
|
5493
5142
|
encode(message, writer = _m0.Writer.create()) {
|
|
5494
|
-
if (message.value !==
|
|
5143
|
+
if (message.value !== undefined) {
|
|
5495
5144
|
writer.uint32(10).string(message.value);
|
|
5496
5145
|
}
|
|
5497
5146
|
if (message.reason !== "") {
|
|
5498
5147
|
writer.uint32(18).string(message.reason);
|
|
5499
5148
|
}
|
|
5500
|
-
if (message.variant !==
|
|
5149
|
+
if (message.variant !== undefined) {
|
|
5501
5150
|
writer.uint32(26).string(message.variant);
|
|
5502
5151
|
}
|
|
5503
5152
|
if (message.metadata !== undefined) {
|
|
@@ -5546,21 +5195,21 @@ const ResolveStringResponse = {
|
|
|
5546
5195
|
},
|
|
5547
5196
|
fromJSON(object) {
|
|
5548
5197
|
return {
|
|
5549
|
-
value: isSet$1(object.value) ? String(object.value) :
|
|
5198
|
+
value: isSet$1(object.value) ? String(object.value) : undefined,
|
|
5550
5199
|
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
5551
|
-
variant: isSet$1(object.variant) ? String(object.variant) :
|
|
5200
|
+
variant: isSet$1(object.variant) ? String(object.variant) : undefined,
|
|
5552
5201
|
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5553
5202
|
};
|
|
5554
5203
|
},
|
|
5555
5204
|
toJSON(message) {
|
|
5556
5205
|
const obj = {};
|
|
5557
|
-
if (message.value !==
|
|
5206
|
+
if (message.value !== undefined) {
|
|
5558
5207
|
obj.value = message.value;
|
|
5559
5208
|
}
|
|
5560
5209
|
if (message.reason !== "") {
|
|
5561
5210
|
obj.reason = message.reason;
|
|
5562
5211
|
}
|
|
5563
|
-
if (message.variant !==
|
|
5212
|
+
if (message.variant !== undefined) {
|
|
5564
5213
|
obj.variant = message.variant;
|
|
5565
5214
|
}
|
|
5566
5215
|
if (message.metadata !== undefined) {
|
|
@@ -5574,9 +5223,9 @@ const ResolveStringResponse = {
|
|
|
5574
5223
|
fromPartial(object) {
|
|
5575
5224
|
var _a, _b, _c, _d;
|
|
5576
5225
|
const message = createBaseResolveStringResponse();
|
|
5577
|
-
message.value = (_a = object.value) !== null && _a !== void 0 ? _a :
|
|
5226
|
+
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
|
|
5578
5227
|
message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : "";
|
|
5579
|
-
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c :
|
|
5228
|
+
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c : undefined;
|
|
5580
5229
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : undefined;
|
|
5581
5230
|
return message;
|
|
5582
5231
|
},
|
|
@@ -5649,17 +5298,17 @@ const ResolveFloatRequest = {
|
|
|
5649
5298
|
},
|
|
5650
5299
|
};
|
|
5651
5300
|
function createBaseResolveFloatResponse() {
|
|
5652
|
-
return { value:
|
|
5301
|
+
return { value: undefined, reason: "", variant: undefined, metadata: undefined };
|
|
5653
5302
|
}
|
|
5654
5303
|
const ResolveFloatResponse = {
|
|
5655
5304
|
encode(message, writer = _m0.Writer.create()) {
|
|
5656
|
-
if (message.value !==
|
|
5305
|
+
if (message.value !== undefined) {
|
|
5657
5306
|
writer.uint32(9).double(message.value);
|
|
5658
5307
|
}
|
|
5659
5308
|
if (message.reason !== "") {
|
|
5660
5309
|
writer.uint32(18).string(message.reason);
|
|
5661
5310
|
}
|
|
5662
|
-
if (message.variant !==
|
|
5311
|
+
if (message.variant !== undefined) {
|
|
5663
5312
|
writer.uint32(26).string(message.variant);
|
|
5664
5313
|
}
|
|
5665
5314
|
if (message.metadata !== undefined) {
|
|
@@ -5708,21 +5357,21 @@ const ResolveFloatResponse = {
|
|
|
5708
5357
|
},
|
|
5709
5358
|
fromJSON(object) {
|
|
5710
5359
|
return {
|
|
5711
|
-
value: isSet$1(object.value) ? Number(object.value) :
|
|
5360
|
+
value: isSet$1(object.value) ? Number(object.value) : undefined,
|
|
5712
5361
|
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
5713
|
-
variant: isSet$1(object.variant) ? String(object.variant) :
|
|
5362
|
+
variant: isSet$1(object.variant) ? String(object.variant) : undefined,
|
|
5714
5363
|
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5715
5364
|
};
|
|
5716
5365
|
},
|
|
5717
5366
|
toJSON(message) {
|
|
5718
5367
|
const obj = {};
|
|
5719
|
-
if (message.value !==
|
|
5368
|
+
if (message.value !== undefined) {
|
|
5720
5369
|
obj.value = message.value;
|
|
5721
5370
|
}
|
|
5722
5371
|
if (message.reason !== "") {
|
|
5723
5372
|
obj.reason = message.reason;
|
|
5724
5373
|
}
|
|
5725
|
-
if (message.variant !==
|
|
5374
|
+
if (message.variant !== undefined) {
|
|
5726
5375
|
obj.variant = message.variant;
|
|
5727
5376
|
}
|
|
5728
5377
|
if (message.metadata !== undefined) {
|
|
@@ -5736,9 +5385,9 @@ const ResolveFloatResponse = {
|
|
|
5736
5385
|
fromPartial(object) {
|
|
5737
5386
|
var _a, _b, _c, _d;
|
|
5738
5387
|
const message = createBaseResolveFloatResponse();
|
|
5739
|
-
message.value = (_a = object.value) !== null && _a !== void 0 ? _a :
|
|
5388
|
+
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
|
|
5740
5389
|
message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : "";
|
|
5741
|
-
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c :
|
|
5390
|
+
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c : undefined;
|
|
5742
5391
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : undefined;
|
|
5743
5392
|
return message;
|
|
5744
5393
|
},
|
|
@@ -5811,17 +5460,17 @@ const ResolveIntRequest = {
|
|
|
5811
5460
|
},
|
|
5812
5461
|
};
|
|
5813
5462
|
function createBaseResolveIntResponse() {
|
|
5814
|
-
return { value:
|
|
5463
|
+
return { value: undefined, reason: "", variant: undefined, metadata: undefined };
|
|
5815
5464
|
}
|
|
5816
5465
|
const ResolveIntResponse = {
|
|
5817
5466
|
encode(message, writer = _m0.Writer.create()) {
|
|
5818
|
-
if (message.value !==
|
|
5467
|
+
if (message.value !== undefined) {
|
|
5819
5468
|
writer.uint32(8).int64(message.value);
|
|
5820
5469
|
}
|
|
5821
5470
|
if (message.reason !== "") {
|
|
5822
5471
|
writer.uint32(18).string(message.reason);
|
|
5823
5472
|
}
|
|
5824
|
-
if (message.variant !==
|
|
5473
|
+
if (message.variant !== undefined) {
|
|
5825
5474
|
writer.uint32(26).string(message.variant);
|
|
5826
5475
|
}
|
|
5827
5476
|
if (message.metadata !== undefined) {
|
|
@@ -5870,21 +5519,21 @@ const ResolveIntResponse = {
|
|
|
5870
5519
|
},
|
|
5871
5520
|
fromJSON(object) {
|
|
5872
5521
|
return {
|
|
5873
|
-
value: isSet$1(object.value) ? String(object.value) :
|
|
5522
|
+
value: isSet$1(object.value) ? String(object.value) : undefined,
|
|
5874
5523
|
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
5875
|
-
variant: isSet$1(object.variant) ? String(object.variant) :
|
|
5524
|
+
variant: isSet$1(object.variant) ? String(object.variant) : undefined,
|
|
5876
5525
|
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
5877
5526
|
};
|
|
5878
5527
|
},
|
|
5879
5528
|
toJSON(message) {
|
|
5880
5529
|
const obj = {};
|
|
5881
|
-
if (message.value !==
|
|
5530
|
+
if (message.value !== undefined) {
|
|
5882
5531
|
obj.value = message.value;
|
|
5883
5532
|
}
|
|
5884
5533
|
if (message.reason !== "") {
|
|
5885
5534
|
obj.reason = message.reason;
|
|
5886
5535
|
}
|
|
5887
|
-
if (message.variant !==
|
|
5536
|
+
if (message.variant !== undefined) {
|
|
5888
5537
|
obj.variant = message.variant;
|
|
5889
5538
|
}
|
|
5890
5539
|
if (message.metadata !== undefined) {
|
|
@@ -5898,9 +5547,9 @@ const ResolveIntResponse = {
|
|
|
5898
5547
|
fromPartial(object) {
|
|
5899
5548
|
var _a, _b, _c, _d;
|
|
5900
5549
|
const message = createBaseResolveIntResponse();
|
|
5901
|
-
message.value = (_a = object.value) !== null && _a !== void 0 ? _a :
|
|
5550
|
+
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
|
|
5902
5551
|
message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : "";
|
|
5903
|
-
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c :
|
|
5552
|
+
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c : undefined;
|
|
5904
5553
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : undefined;
|
|
5905
5554
|
return message;
|
|
5906
5555
|
},
|
|
@@ -5973,7 +5622,7 @@ const ResolveObjectRequest = {
|
|
|
5973
5622
|
},
|
|
5974
5623
|
};
|
|
5975
5624
|
function createBaseResolveObjectResponse() {
|
|
5976
|
-
return { value: undefined, reason: "", variant:
|
|
5625
|
+
return { value: undefined, reason: "", variant: undefined, metadata: undefined };
|
|
5977
5626
|
}
|
|
5978
5627
|
const ResolveObjectResponse = {
|
|
5979
5628
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -5983,7 +5632,7 @@ const ResolveObjectResponse = {
|
|
|
5983
5632
|
if (message.reason !== "") {
|
|
5984
5633
|
writer.uint32(18).string(message.reason);
|
|
5985
5634
|
}
|
|
5986
|
-
if (message.variant !==
|
|
5635
|
+
if (message.variant !== undefined) {
|
|
5987
5636
|
writer.uint32(26).string(message.variant);
|
|
5988
5637
|
}
|
|
5989
5638
|
if (message.metadata !== undefined) {
|
|
@@ -6034,7 +5683,7 @@ const ResolveObjectResponse = {
|
|
|
6034
5683
|
return {
|
|
6035
5684
|
value: isObject$1(object.value) ? object.value : undefined,
|
|
6036
5685
|
reason: isSet$1(object.reason) ? String(object.reason) : "",
|
|
6037
|
-
variant: isSet$1(object.variant) ? String(object.variant) :
|
|
5686
|
+
variant: isSet$1(object.variant) ? String(object.variant) : undefined,
|
|
6038
5687
|
metadata: isObject$1(object.metadata) ? object.metadata : undefined,
|
|
6039
5688
|
};
|
|
6040
5689
|
},
|
|
@@ -6046,7 +5695,7 @@ const ResolveObjectResponse = {
|
|
|
6046
5695
|
if (message.reason !== "") {
|
|
6047
5696
|
obj.reason = message.reason;
|
|
6048
5697
|
}
|
|
6049
|
-
if (message.variant !==
|
|
5698
|
+
if (message.variant !== undefined) {
|
|
6050
5699
|
obj.variant = message.variant;
|
|
6051
5700
|
}
|
|
6052
5701
|
if (message.metadata !== undefined) {
|
|
@@ -6062,7 +5711,7 @@ const ResolveObjectResponse = {
|
|
|
6062
5711
|
const message = createBaseResolveObjectResponse();
|
|
6063
5712
|
message.value = (_a = object.value) !== null && _a !== void 0 ? _a : undefined;
|
|
6064
5713
|
message.reason = (_b = object.reason) !== null && _b !== void 0 ? _b : "";
|
|
6065
|
-
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c :
|
|
5714
|
+
message.variant = (_c = object.variant) !== null && _c !== void 0 ? _c : undefined;
|
|
6066
5715
|
message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : undefined;
|
|
6067
5716
|
return message;
|
|
6068
5717
|
},
|
|
@@ -6170,17 +5819,8 @@ const EventStreamRequest = {
|
|
|
6170
5819
|
},
|
|
6171
5820
|
};
|
|
6172
5821
|
const ServiceService = {
|
|
6173
|
-
resolveAll: {
|
|
6174
|
-
path: "/flagd.evaluation.v1.Service/ResolveAll",
|
|
6175
|
-
requestStream: false,
|
|
6176
|
-
responseStream: false,
|
|
6177
|
-
requestSerialize: (value) => Buffer.from(ResolveAllRequest.encode(value).finish()),
|
|
6178
|
-
requestDeserialize: (value) => ResolveAllRequest.decode(value),
|
|
6179
|
-
responseSerialize: (value) => Buffer.from(ResolveAllResponse.encode(value).finish()),
|
|
6180
|
-
responseDeserialize: (value) => ResolveAllResponse.decode(value),
|
|
6181
|
-
},
|
|
6182
5822
|
resolveBoolean: {
|
|
6183
|
-
path: "/flagd.evaluation.
|
|
5823
|
+
path: "/flagd.evaluation.v2.Service/ResolveBoolean",
|
|
6184
5824
|
requestStream: false,
|
|
6185
5825
|
responseStream: false,
|
|
6186
5826
|
requestSerialize: (value) => Buffer.from(ResolveBooleanRequest.encode(value).finish()),
|
|
@@ -6189,7 +5829,7 @@ const ServiceService = {
|
|
|
6189
5829
|
responseDeserialize: (value) => ResolveBooleanResponse.decode(value),
|
|
6190
5830
|
},
|
|
6191
5831
|
resolveString: {
|
|
6192
|
-
path: "/flagd.evaluation.
|
|
5832
|
+
path: "/flagd.evaluation.v2.Service/ResolveString",
|
|
6193
5833
|
requestStream: false,
|
|
6194
5834
|
responseStream: false,
|
|
6195
5835
|
requestSerialize: (value) => Buffer.from(ResolveStringRequest.encode(value).finish()),
|
|
@@ -6198,7 +5838,7 @@ const ServiceService = {
|
|
|
6198
5838
|
responseDeserialize: (value) => ResolveStringResponse.decode(value),
|
|
6199
5839
|
},
|
|
6200
5840
|
resolveFloat: {
|
|
6201
|
-
path: "/flagd.evaluation.
|
|
5841
|
+
path: "/flagd.evaluation.v2.Service/ResolveFloat",
|
|
6202
5842
|
requestStream: false,
|
|
6203
5843
|
responseStream: false,
|
|
6204
5844
|
requestSerialize: (value) => Buffer.from(ResolveFloatRequest.encode(value).finish()),
|
|
@@ -6207,7 +5847,7 @@ const ServiceService = {
|
|
|
6207
5847
|
responseDeserialize: (value) => ResolveFloatResponse.decode(value),
|
|
6208
5848
|
},
|
|
6209
5849
|
resolveInt: {
|
|
6210
|
-
path: "/flagd.evaluation.
|
|
5850
|
+
path: "/flagd.evaluation.v2.Service/ResolveInt",
|
|
6211
5851
|
requestStream: false,
|
|
6212
5852
|
responseStream: false,
|
|
6213
5853
|
requestSerialize: (value) => Buffer.from(ResolveIntRequest.encode(value).finish()),
|
|
@@ -6216,7 +5856,7 @@ const ServiceService = {
|
|
|
6216
5856
|
responseDeserialize: (value) => ResolveIntResponse.decode(value),
|
|
6217
5857
|
},
|
|
6218
5858
|
resolveObject: {
|
|
6219
|
-
path: "/flagd.evaluation.
|
|
5859
|
+
path: "/flagd.evaluation.v2.Service/ResolveObject",
|
|
6220
5860
|
requestStream: false,
|
|
6221
5861
|
responseStream: false,
|
|
6222
5862
|
requestSerialize: (value) => Buffer.from(ResolveObjectRequest.encode(value).finish()),
|
|
@@ -6225,7 +5865,7 @@ const ServiceService = {
|
|
|
6225
5865
|
responseDeserialize: (value) => ResolveObjectResponse.decode(value),
|
|
6226
5866
|
},
|
|
6227
5867
|
eventStream: {
|
|
6228
|
-
path: "/flagd.evaluation.
|
|
5868
|
+
path: "/flagd.evaluation.v2.Service/EventStream",
|
|
6229
5869
|
requestStream: false,
|
|
6230
5870
|
responseStream: true,
|
|
6231
5871
|
requestSerialize: (value) => Buffer.from(EventStreamRequest.encode(value).finish()),
|
|
@@ -6234,7 +5874,7 @@ const ServiceService = {
|
|
|
6234
5874
|
responseDeserialize: (value) => EventStreamResponse.decode(value),
|
|
6235
5875
|
},
|
|
6236
5876
|
};
|
|
6237
|
-
const ServiceClient = grpcJs.makeGenericClientConstructor(ServiceService, "flagd.evaluation.
|
|
5877
|
+
const ServiceClient = grpcJs.makeGenericClientConstructor(ServiceService, "flagd.evaluation.v2.Service");
|
|
6238
5878
|
function longToString(long) {
|
|
6239
5879
|
return long.toString();
|
|
6240
5880
|
}
|
|
@@ -6293,7 +5933,7 @@ const CONFIG_TO_GRPC_OPTIONS = [
|
|
|
6293
5933
|
*/
|
|
6294
5934
|
function buildClientOptions(config) {
|
|
6295
5935
|
const options = {
|
|
6296
|
-
'grpc.service_config': buildRetryPolicy(['flagd.evaluation.v1.Service', 'flagd.sync.v1.FlagSyncService'], config.retryBackoffMs, config.retryBackoffMaxMs),
|
|
5936
|
+
'grpc.service_config': buildRetryPolicy(['flagd.evaluation.v1.Service', 'flagd.evaluation.v2.Service', 'flagd.sync.v1.FlagSyncService'], config.retryBackoffMs, config.retryBackoffMaxMs),
|
|
6297
5937
|
};
|
|
6298
5938
|
for (const { configKey, grpcKey, condition } of CONFIG_TO_GRPC_OPTIONS) {
|
|
6299
5939
|
const value = config[configKey];
|
|
@@ -6443,24 +6083,24 @@ class GRPCService {
|
|
|
6443
6083
|
this._client.close();
|
|
6444
6084
|
});
|
|
6445
6085
|
}
|
|
6446
|
-
resolveBoolean(flagKey,
|
|
6086
|
+
resolveBoolean(flagKey, defaultValue, context, logger) {
|
|
6447
6087
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6448
|
-
return this.resolve(this._client.resolveBoolean, flagKey, context, logger);
|
|
6088
|
+
return this.resolve(this._client.resolveBoolean, flagKey, defaultValue, context, logger);
|
|
6449
6089
|
});
|
|
6450
6090
|
}
|
|
6451
|
-
resolveString(flagKey,
|
|
6091
|
+
resolveString(flagKey, defaultValue, context, logger) {
|
|
6452
6092
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6453
|
-
return this.resolve(this._client.resolveString, flagKey, context, logger);
|
|
6093
|
+
return this.resolve(this._client.resolveString, flagKey, defaultValue, context, logger);
|
|
6454
6094
|
});
|
|
6455
6095
|
}
|
|
6456
|
-
resolveNumber(flagKey,
|
|
6096
|
+
resolveNumber(flagKey, defaultValue, context, logger) {
|
|
6457
6097
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6458
|
-
return this.resolve(this._client.resolveFloat, flagKey, context, logger);
|
|
6098
|
+
return this.resolve(this._client.resolveFloat, flagKey, defaultValue, context, logger);
|
|
6459
6099
|
});
|
|
6460
6100
|
}
|
|
6461
|
-
resolveObject(flagKey,
|
|
6101
|
+
resolveObject(flagKey, defaultValue, context, logger) {
|
|
6462
6102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6463
|
-
return this.resolve(this._client.resolveObject, flagKey, context, logger);
|
|
6103
|
+
return this.resolve(this._client.resolveObject, flagKey, defaultValue, context, logger);
|
|
6464
6104
|
});
|
|
6465
6105
|
}
|
|
6466
6106
|
listen(reconnectCallback, changedCallback, disconnectCallback, resolveConnect, rejectConnect) {
|
|
@@ -6547,7 +6187,7 @@ class GRPCService {
|
|
|
6547
6187
|
(_b = this._cache) === null || _b === void 0 ? void 0 : _b.clear();
|
|
6548
6188
|
this.reconnect(reconnectCallback, changedCallback, disconnectCallback);
|
|
6549
6189
|
}
|
|
6550
|
-
resolve(promise, flagKey, context, logger) {
|
|
6190
|
+
resolve(promise, flagKey, defaultValue, context, logger) {
|
|
6551
6191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6552
6192
|
var _a, _b;
|
|
6553
6193
|
const resolver = node_util.promisify(promise);
|
|
@@ -6561,8 +6201,14 @@ class GRPCService {
|
|
|
6561
6201
|
const response = yield resolver
|
|
6562
6202
|
.call(this._client, { flagKey, context }, this._metadata)
|
|
6563
6203
|
.then((resolved) => resolved, this.onRejected);
|
|
6204
|
+
let value = response.value;
|
|
6205
|
+
// When no default variant is configured, the server returns an empty/zero proto
|
|
6206
|
+
// value with reason=DEFAULT. In that case, return the caller's code default value.
|
|
6207
|
+
if (response.reason === serverSdk.StandardResolutionReasons.DEFAULT && !response.variant) {
|
|
6208
|
+
value = defaultValue;
|
|
6209
|
+
}
|
|
6564
6210
|
const resolved = {
|
|
6565
|
-
value
|
|
6211
|
+
value,
|
|
6566
6212
|
reason: response.reason,
|
|
6567
6213
|
variant: response.variant,
|
|
6568
6214
|
flagMetadata: response.metadata,
|