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