@spotify-confidence/openfeature-server-provider-local 0.4.0 → 0.5.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/CHANGELOG.md +14 -0
- package/README.md +64 -7
- package/dist/confidence_resolver.wasm +0 -0
- package/dist/index.browser.d.ts +247 -99
- package/dist/index.browser.js +1626 -754
- package/dist/index.node.d.ts +247 -99
- package/dist/index.node.js +1626 -754
- package/dist/{messages-CvypvyG4.js → messages-BjOGSPNo.js} +1 -1
- package/dist/messages-ZL-6wQib.js +208 -0
- package/package.json +2 -2
- package/dist/messages-Bw39oRlC.js +0 -524
package/dist/index.browser.js
CHANGED
|
@@ -1,147 +1,52 @@
|
|
|
1
|
-
import { Request, Response as Response$1, SetResolverStateRequest,
|
|
1
|
+
import { Request, Response as Response$1, SetResolverStateRequest, Void } from "./messages-ZL-6wQib.js";
|
|
2
2
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
3
|
-
let
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
SdkId$1[SdkId$1["SDK_ID_SWIFT_PROVIDER"] = 3] = "SDK_ID_SWIFT_PROVIDER";
|
|
8
|
-
SdkId$1[SdkId$1["SDK_ID_JS_WEB_PROVIDER"] = 4] = "SDK_ID_JS_WEB_PROVIDER";
|
|
9
|
-
SdkId$1[SdkId$1["SDK_ID_JS_SERVER_PROVIDER"] = 5] = "SDK_ID_JS_SERVER_PROVIDER";
|
|
10
|
-
SdkId$1[SdkId$1["SDK_ID_PYTHON_PROVIDER"] = 6] = "SDK_ID_PYTHON_PROVIDER";
|
|
11
|
-
SdkId$1[SdkId$1["SDK_ID_GO_PROVIDER"] = 7] = "SDK_ID_GO_PROVIDER";
|
|
12
|
-
SdkId$1[SdkId$1["SDK_ID_RUBY_PROVIDER"] = 8] = "SDK_ID_RUBY_PROVIDER";
|
|
13
|
-
SdkId$1[SdkId$1["SDK_ID_RUST_PROVIDER"] = 9] = "SDK_ID_RUST_PROVIDER";
|
|
14
|
-
SdkId$1[SdkId$1["SDK_ID_JAVA_CONFIDENCE"] = 10] = "SDK_ID_JAVA_CONFIDENCE";
|
|
15
|
-
SdkId$1[SdkId$1["SDK_ID_KOTLIN_CONFIDENCE"] = 11] = "SDK_ID_KOTLIN_CONFIDENCE";
|
|
16
|
-
SdkId$1[SdkId$1["SDK_ID_SWIFT_CONFIDENCE"] = 12] = "SDK_ID_SWIFT_CONFIDENCE";
|
|
17
|
-
SdkId$1[SdkId$1["SDK_ID_JS_CONFIDENCE"] = 13] = "SDK_ID_JS_CONFIDENCE";
|
|
18
|
-
SdkId$1[SdkId$1["SDK_ID_PYTHON_CONFIDENCE"] = 14] = "SDK_ID_PYTHON_CONFIDENCE";
|
|
19
|
-
SdkId$1[SdkId$1["SDK_ID_GO_CONFIDENCE"] = 15] = "SDK_ID_GO_CONFIDENCE";
|
|
20
|
-
SdkId$1[SdkId$1["SDK_ID_RUST_CONFIDENCE"] = 16] = "SDK_ID_RUST_CONFIDENCE";
|
|
21
|
-
SdkId$1[SdkId$1["SDK_ID_FLUTTER_IOS_CONFIDENCE"] = 17] = "SDK_ID_FLUTTER_IOS_CONFIDENCE";
|
|
22
|
-
SdkId$1[SdkId$1["SDK_ID_FLUTTER_ANDROID_CONFIDENCE"] = 18] = "SDK_ID_FLUTTER_ANDROID_CONFIDENCE";
|
|
23
|
-
SdkId$1[SdkId$1["SDK_ID_DOTNET_CONFIDENCE"] = 19] = "SDK_ID_DOTNET_CONFIDENCE";
|
|
24
|
-
SdkId$1[SdkId$1["SDK_ID_GO_LOCAL_PROVIDER"] = 20] = "SDK_ID_GO_LOCAL_PROVIDER";
|
|
25
|
-
SdkId$1[SdkId$1["SDK_ID_JAVA_LOCAL_PROVIDER"] = 21] = "SDK_ID_JAVA_LOCAL_PROVIDER";
|
|
26
|
-
SdkId$1[SdkId$1["SDK_ID_JS_LOCAL_SERVER_PROVIDER"] = 22] = "SDK_ID_JS_LOCAL_SERVER_PROVIDER";
|
|
27
|
-
SdkId$1[SdkId$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
28
|
-
return SdkId$1;
|
|
3
|
+
let NullValue = /* @__PURE__ */ function(NullValue$1) {
|
|
4
|
+
NullValue$1[NullValue$1["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
5
|
+
NullValue$1[NullValue$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
6
|
+
return NullValue$1;
|
|
29
7
|
}({});
|
|
30
|
-
function
|
|
8
|
+
function nullValueFromJSON(object) {
|
|
31
9
|
switch (object) {
|
|
32
10
|
case 0:
|
|
33
|
-
case "
|
|
34
|
-
case 1:
|
|
35
|
-
case "SDK_ID_JAVA_PROVIDER": return SdkId.SDK_ID_JAVA_PROVIDER;
|
|
36
|
-
case 2:
|
|
37
|
-
case "SDK_ID_KOTLIN_PROVIDER": return SdkId.SDK_ID_KOTLIN_PROVIDER;
|
|
38
|
-
case 3:
|
|
39
|
-
case "SDK_ID_SWIFT_PROVIDER": return SdkId.SDK_ID_SWIFT_PROVIDER;
|
|
40
|
-
case 4:
|
|
41
|
-
case "SDK_ID_JS_WEB_PROVIDER": return SdkId.SDK_ID_JS_WEB_PROVIDER;
|
|
42
|
-
case 5:
|
|
43
|
-
case "SDK_ID_JS_SERVER_PROVIDER": return SdkId.SDK_ID_JS_SERVER_PROVIDER;
|
|
44
|
-
case 6:
|
|
45
|
-
case "SDK_ID_PYTHON_PROVIDER": return SdkId.SDK_ID_PYTHON_PROVIDER;
|
|
46
|
-
case 7:
|
|
47
|
-
case "SDK_ID_GO_PROVIDER": return SdkId.SDK_ID_GO_PROVIDER;
|
|
48
|
-
case 8:
|
|
49
|
-
case "SDK_ID_RUBY_PROVIDER": return SdkId.SDK_ID_RUBY_PROVIDER;
|
|
50
|
-
case 9:
|
|
51
|
-
case "SDK_ID_RUST_PROVIDER": return SdkId.SDK_ID_RUST_PROVIDER;
|
|
52
|
-
case 10:
|
|
53
|
-
case "SDK_ID_JAVA_CONFIDENCE": return SdkId.SDK_ID_JAVA_CONFIDENCE;
|
|
54
|
-
case 11:
|
|
55
|
-
case "SDK_ID_KOTLIN_CONFIDENCE": return SdkId.SDK_ID_KOTLIN_CONFIDENCE;
|
|
56
|
-
case 12:
|
|
57
|
-
case "SDK_ID_SWIFT_CONFIDENCE": return SdkId.SDK_ID_SWIFT_CONFIDENCE;
|
|
58
|
-
case 13:
|
|
59
|
-
case "SDK_ID_JS_CONFIDENCE": return SdkId.SDK_ID_JS_CONFIDENCE;
|
|
60
|
-
case 14:
|
|
61
|
-
case "SDK_ID_PYTHON_CONFIDENCE": return SdkId.SDK_ID_PYTHON_CONFIDENCE;
|
|
62
|
-
case 15:
|
|
63
|
-
case "SDK_ID_GO_CONFIDENCE": return SdkId.SDK_ID_GO_CONFIDENCE;
|
|
64
|
-
case 16:
|
|
65
|
-
case "SDK_ID_RUST_CONFIDENCE": return SdkId.SDK_ID_RUST_CONFIDENCE;
|
|
66
|
-
case 17:
|
|
67
|
-
case "SDK_ID_FLUTTER_IOS_CONFIDENCE": return SdkId.SDK_ID_FLUTTER_IOS_CONFIDENCE;
|
|
68
|
-
case 18:
|
|
69
|
-
case "SDK_ID_FLUTTER_ANDROID_CONFIDENCE": return SdkId.SDK_ID_FLUTTER_ANDROID_CONFIDENCE;
|
|
70
|
-
case 19:
|
|
71
|
-
case "SDK_ID_DOTNET_CONFIDENCE": return SdkId.SDK_ID_DOTNET_CONFIDENCE;
|
|
72
|
-
case 20:
|
|
73
|
-
case "SDK_ID_GO_LOCAL_PROVIDER": return SdkId.SDK_ID_GO_LOCAL_PROVIDER;
|
|
74
|
-
case 21:
|
|
75
|
-
case "SDK_ID_JAVA_LOCAL_PROVIDER": return SdkId.SDK_ID_JAVA_LOCAL_PROVIDER;
|
|
76
|
-
case 22:
|
|
77
|
-
case "SDK_ID_JS_LOCAL_SERVER_PROVIDER": return SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER;
|
|
11
|
+
case "NULL_VALUE": return NullValue.NULL_VALUE;
|
|
78
12
|
case -1:
|
|
79
13
|
case "UNRECOGNIZED":
|
|
80
|
-
default: return
|
|
14
|
+
default: return NullValue.UNRECOGNIZED;
|
|
81
15
|
}
|
|
82
16
|
}
|
|
83
|
-
function
|
|
17
|
+
function nullValueToJSON(object) {
|
|
84
18
|
switch (object) {
|
|
85
|
-
case
|
|
86
|
-
case
|
|
87
|
-
case SdkId.SDK_ID_KOTLIN_PROVIDER: return "SDK_ID_KOTLIN_PROVIDER";
|
|
88
|
-
case SdkId.SDK_ID_SWIFT_PROVIDER: return "SDK_ID_SWIFT_PROVIDER";
|
|
89
|
-
case SdkId.SDK_ID_JS_WEB_PROVIDER: return "SDK_ID_JS_WEB_PROVIDER";
|
|
90
|
-
case SdkId.SDK_ID_JS_SERVER_PROVIDER: return "SDK_ID_JS_SERVER_PROVIDER";
|
|
91
|
-
case SdkId.SDK_ID_PYTHON_PROVIDER: return "SDK_ID_PYTHON_PROVIDER";
|
|
92
|
-
case SdkId.SDK_ID_GO_PROVIDER: return "SDK_ID_GO_PROVIDER";
|
|
93
|
-
case SdkId.SDK_ID_RUBY_PROVIDER: return "SDK_ID_RUBY_PROVIDER";
|
|
94
|
-
case SdkId.SDK_ID_RUST_PROVIDER: return "SDK_ID_RUST_PROVIDER";
|
|
95
|
-
case SdkId.SDK_ID_JAVA_CONFIDENCE: return "SDK_ID_JAVA_CONFIDENCE";
|
|
96
|
-
case SdkId.SDK_ID_KOTLIN_CONFIDENCE: return "SDK_ID_KOTLIN_CONFIDENCE";
|
|
97
|
-
case SdkId.SDK_ID_SWIFT_CONFIDENCE: return "SDK_ID_SWIFT_CONFIDENCE";
|
|
98
|
-
case SdkId.SDK_ID_JS_CONFIDENCE: return "SDK_ID_JS_CONFIDENCE";
|
|
99
|
-
case SdkId.SDK_ID_PYTHON_CONFIDENCE: return "SDK_ID_PYTHON_CONFIDENCE";
|
|
100
|
-
case SdkId.SDK_ID_GO_CONFIDENCE: return "SDK_ID_GO_CONFIDENCE";
|
|
101
|
-
case SdkId.SDK_ID_RUST_CONFIDENCE: return "SDK_ID_RUST_CONFIDENCE";
|
|
102
|
-
case SdkId.SDK_ID_FLUTTER_IOS_CONFIDENCE: return "SDK_ID_FLUTTER_IOS_CONFIDENCE";
|
|
103
|
-
case SdkId.SDK_ID_FLUTTER_ANDROID_CONFIDENCE: return "SDK_ID_FLUTTER_ANDROID_CONFIDENCE";
|
|
104
|
-
case SdkId.SDK_ID_DOTNET_CONFIDENCE: return "SDK_ID_DOTNET_CONFIDENCE";
|
|
105
|
-
case SdkId.SDK_ID_GO_LOCAL_PROVIDER: return "SDK_ID_GO_LOCAL_PROVIDER";
|
|
106
|
-
case SdkId.SDK_ID_JAVA_LOCAL_PROVIDER: return "SDK_ID_JAVA_LOCAL_PROVIDER";
|
|
107
|
-
case SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER: return "SDK_ID_JS_LOCAL_SERVER_PROVIDER";
|
|
108
|
-
case SdkId.UNRECOGNIZED:
|
|
19
|
+
case NullValue.NULL_VALUE: return "NULL_VALUE";
|
|
20
|
+
case NullValue.UNRECOGNIZED:
|
|
109
21
|
default: return "UNRECOGNIZED";
|
|
110
22
|
}
|
|
111
23
|
}
|
|
112
|
-
function
|
|
113
|
-
return {
|
|
114
|
-
id: void 0,
|
|
115
|
-
customId: void 0,
|
|
116
|
-
version: ""
|
|
117
|
-
};
|
|
24
|
+
function createBaseStruct() {
|
|
25
|
+
return { fields: {} };
|
|
118
26
|
}
|
|
119
|
-
const
|
|
27
|
+
const Struct = {
|
|
120
28
|
encode(message, writer = new BinaryWriter()) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
29
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
30
|
+
if (value !== void 0) Struct_FieldsEntry.encode({
|
|
31
|
+
key,
|
|
32
|
+
value
|
|
33
|
+
}, writer.uint32(10).fork()).join();
|
|
34
|
+
});
|
|
124
35
|
return writer;
|
|
125
36
|
},
|
|
126
37
|
decode(input, length) {
|
|
127
38
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
128
39
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
129
|
-
const message =
|
|
40
|
+
const message = createBaseStruct();
|
|
130
41
|
while (reader.pos < end) {
|
|
131
42
|
const tag = reader.uint32();
|
|
132
43
|
switch (tag >>> 3) {
|
|
133
|
-
case 1:
|
|
134
|
-
if (tag !==
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
case 2:
|
|
138
|
-
if (tag !== 18) break;
|
|
139
|
-
message.customId = reader.string();
|
|
140
|
-
continue;
|
|
141
|
-
case 3:
|
|
142
|
-
if (tag !== 26) break;
|
|
143
|
-
message.version = reader.string();
|
|
44
|
+
case 1: {
|
|
45
|
+
if (tag !== 10) break;
|
|
46
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
47
|
+
if (entry1.value !== void 0) message.fields[entry1.key] = entry1.value;
|
|
144
48
|
continue;
|
|
49
|
+
}
|
|
145
50
|
}
|
|
146
51
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
147
52
|
reader.skip(tag & 7);
|
|
@@ -149,59 +54,72 @@ const Sdk = {
|
|
|
149
54
|
return message;
|
|
150
55
|
},
|
|
151
56
|
fromJSON(object) {
|
|
152
|
-
return {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
};
|
|
57
|
+
return { fields: isObject$2(object.fields) ? Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
58
|
+
acc[key] = value;
|
|
59
|
+
return acc;
|
|
60
|
+
}, {}) : {} };
|
|
157
61
|
},
|
|
158
62
|
toJSON(message) {
|
|
159
63
|
const obj = {};
|
|
160
|
-
if (message.
|
|
161
|
-
|
|
162
|
-
|
|
64
|
+
if (message.fields) {
|
|
65
|
+
const entries = Object.entries(message.fields);
|
|
66
|
+
if (entries.length > 0) {
|
|
67
|
+
obj.fields = {};
|
|
68
|
+
entries.forEach(([k, v]) => {
|
|
69
|
+
obj.fields[k] = v;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
163
73
|
return obj;
|
|
164
74
|
},
|
|
165
75
|
create(base) {
|
|
166
|
-
return
|
|
76
|
+
return Struct.fromPartial(base ?? {});
|
|
167
77
|
},
|
|
168
78
|
fromPartial(object) {
|
|
169
|
-
const message =
|
|
170
|
-
message.
|
|
171
|
-
|
|
172
|
-
|
|
79
|
+
const message = createBaseStruct();
|
|
80
|
+
message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
81
|
+
if (value !== void 0) acc[key] = value;
|
|
82
|
+
return acc;
|
|
83
|
+
}, {});
|
|
173
84
|
return message;
|
|
85
|
+
},
|
|
86
|
+
wrap(object) {
|
|
87
|
+
const struct = createBaseStruct();
|
|
88
|
+
if (object !== void 0) for (const key of Object.keys(object)) struct.fields[key] = object[key];
|
|
89
|
+
return struct;
|
|
90
|
+
},
|
|
91
|
+
unwrap(message) {
|
|
92
|
+
const object = {};
|
|
93
|
+
if (message.fields) for (const key of Object.keys(message.fields)) object[key] = message.fields[key];
|
|
94
|
+
return object;
|
|
174
95
|
}
|
|
175
96
|
};
|
|
176
|
-
function
|
|
177
|
-
return value !== null && value !== void 0;
|
|
178
|
-
}
|
|
179
|
-
function createBaseTimestamp() {
|
|
97
|
+
function createBaseStruct_FieldsEntry() {
|
|
180
98
|
return {
|
|
181
|
-
|
|
182
|
-
|
|
99
|
+
key: "",
|
|
100
|
+
value: void 0
|
|
183
101
|
};
|
|
184
102
|
}
|
|
185
|
-
const
|
|
103
|
+
const Struct_FieldsEntry = {
|
|
186
104
|
encode(message, writer = new BinaryWriter()) {
|
|
187
|
-
if (message.
|
|
188
|
-
if (message.
|
|
105
|
+
if (message.key !== "") writer.uint32(10).string(message.key);
|
|
106
|
+
if (message.value !== void 0) Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
189
107
|
return writer;
|
|
190
108
|
},
|
|
191
109
|
decode(input, length) {
|
|
192
110
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
193
111
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
194
|
-
const message =
|
|
112
|
+
const message = createBaseStruct_FieldsEntry();
|
|
195
113
|
while (reader.pos < end) {
|
|
196
114
|
const tag = reader.uint32();
|
|
197
115
|
switch (tag >>> 3) {
|
|
198
116
|
case 1:
|
|
199
|
-
if (tag !==
|
|
200
|
-
message.
|
|
117
|
+
if (tag !== 10) break;
|
|
118
|
+
message.key = reader.string();
|
|
201
119
|
continue;
|
|
202
120
|
case 2:
|
|
203
|
-
if (tag !==
|
|
204
|
-
message.
|
|
121
|
+
if (tag !== 18) break;
|
|
122
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
205
123
|
continue;
|
|
206
124
|
}
|
|
207
125
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -211,124 +129,76 @@ const Timestamp = {
|
|
|
211
129
|
},
|
|
212
130
|
fromJSON(object) {
|
|
213
131
|
return {
|
|
214
|
-
|
|
215
|
-
|
|
132
|
+
key: isSet$6(object.key) ? globalThis.String(object.key) : "",
|
|
133
|
+
value: isSet$6(object?.value) ? object.value : void 0
|
|
216
134
|
};
|
|
217
135
|
},
|
|
218
136
|
toJSON(message) {
|
|
219
137
|
const obj = {};
|
|
220
|
-
if (message.
|
|
221
|
-
if (message.
|
|
138
|
+
if (message.key !== "") obj.key = message.key;
|
|
139
|
+
if (message.value !== void 0) obj.value = message.value;
|
|
222
140
|
return obj;
|
|
223
141
|
},
|
|
224
142
|
create(base) {
|
|
225
|
-
return
|
|
143
|
+
return Struct_FieldsEntry.fromPartial(base ?? {});
|
|
226
144
|
},
|
|
227
145
|
fromPartial(object) {
|
|
228
|
-
const message =
|
|
229
|
-
message.
|
|
230
|
-
message.
|
|
146
|
+
const message = createBaseStruct_FieldsEntry();
|
|
147
|
+
message.key = object.key ?? "";
|
|
148
|
+
message.value = object.value ?? void 0;
|
|
231
149
|
return message;
|
|
232
150
|
}
|
|
233
151
|
};
|
|
234
|
-
function
|
|
235
|
-
const num = globalThis.Number(int64.toString());
|
|
236
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
237
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
238
|
-
return num;
|
|
239
|
-
}
|
|
240
|
-
function isSet$1(value) {
|
|
241
|
-
return value !== null && value !== void 0;
|
|
242
|
-
}
|
|
243
|
-
let ResolveReason = /* @__PURE__ */ function(ResolveReason$1) {
|
|
244
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_UNSPECIFIED"] = 0] = "RESOLVE_REASON_UNSPECIFIED";
|
|
245
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_MATCH"] = 1] = "RESOLVE_REASON_MATCH";
|
|
246
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_NO_SEGMENT_MATCH"] = 2] = "RESOLVE_REASON_NO_SEGMENT_MATCH";
|
|
247
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_NO_TREATMENT_MATCH"] = 3] = "RESOLVE_REASON_NO_TREATMENT_MATCH";
|
|
248
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_FLAG_ARCHIVED"] = 4] = "RESOLVE_REASON_FLAG_ARCHIVED";
|
|
249
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_TARGETING_KEY_ERROR"] = 5] = "RESOLVE_REASON_TARGETING_KEY_ERROR";
|
|
250
|
-
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_ERROR"] = 6] = "RESOLVE_REASON_ERROR";
|
|
251
|
-
ResolveReason$1[ResolveReason$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
252
|
-
return ResolveReason$1;
|
|
253
|
-
}({});
|
|
254
|
-
function resolveReasonFromJSON(object) {
|
|
255
|
-
switch (object) {
|
|
256
|
-
case 0:
|
|
257
|
-
case "RESOLVE_REASON_UNSPECIFIED": return ResolveReason.RESOLVE_REASON_UNSPECIFIED;
|
|
258
|
-
case 1:
|
|
259
|
-
case "RESOLVE_REASON_MATCH": return ResolveReason.RESOLVE_REASON_MATCH;
|
|
260
|
-
case 2:
|
|
261
|
-
case "RESOLVE_REASON_NO_SEGMENT_MATCH": return ResolveReason.RESOLVE_REASON_NO_SEGMENT_MATCH;
|
|
262
|
-
case 3:
|
|
263
|
-
case "RESOLVE_REASON_NO_TREATMENT_MATCH": return ResolveReason.RESOLVE_REASON_NO_TREATMENT_MATCH;
|
|
264
|
-
case 4:
|
|
265
|
-
case "RESOLVE_REASON_FLAG_ARCHIVED": return ResolveReason.RESOLVE_REASON_FLAG_ARCHIVED;
|
|
266
|
-
case 5:
|
|
267
|
-
case "RESOLVE_REASON_TARGETING_KEY_ERROR": return ResolveReason.RESOLVE_REASON_TARGETING_KEY_ERROR;
|
|
268
|
-
case 6:
|
|
269
|
-
case "RESOLVE_REASON_ERROR": return ResolveReason.RESOLVE_REASON_ERROR;
|
|
270
|
-
case -1:
|
|
271
|
-
case "UNRECOGNIZED":
|
|
272
|
-
default: return ResolveReason.UNRECOGNIZED;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function resolveReasonToJSON(object) {
|
|
276
|
-
switch (object) {
|
|
277
|
-
case ResolveReason.RESOLVE_REASON_UNSPECIFIED: return "RESOLVE_REASON_UNSPECIFIED";
|
|
278
|
-
case ResolveReason.RESOLVE_REASON_MATCH: return "RESOLVE_REASON_MATCH";
|
|
279
|
-
case ResolveReason.RESOLVE_REASON_NO_SEGMENT_MATCH: return "RESOLVE_REASON_NO_SEGMENT_MATCH";
|
|
280
|
-
case ResolveReason.RESOLVE_REASON_NO_TREATMENT_MATCH: return "RESOLVE_REASON_NO_TREATMENT_MATCH";
|
|
281
|
-
case ResolveReason.RESOLVE_REASON_FLAG_ARCHIVED: return "RESOLVE_REASON_FLAG_ARCHIVED";
|
|
282
|
-
case ResolveReason.RESOLVE_REASON_TARGETING_KEY_ERROR: return "RESOLVE_REASON_TARGETING_KEY_ERROR";
|
|
283
|
-
case ResolveReason.RESOLVE_REASON_ERROR: return "RESOLVE_REASON_ERROR";
|
|
284
|
-
case ResolveReason.UNRECOGNIZED:
|
|
285
|
-
default: return "UNRECOGNIZED";
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
function createBaseResolveFlagsRequest() {
|
|
152
|
+
function createBaseValue() {
|
|
289
153
|
return {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
154
|
+
nullValue: void 0,
|
|
155
|
+
numberValue: void 0,
|
|
156
|
+
stringValue: void 0,
|
|
157
|
+
boolValue: void 0,
|
|
158
|
+
structValue: void 0,
|
|
159
|
+
listValue: void 0
|
|
295
160
|
};
|
|
296
161
|
}
|
|
297
|
-
const
|
|
162
|
+
const Value = {
|
|
298
163
|
encode(message, writer = new BinaryWriter()) {
|
|
299
|
-
|
|
300
|
-
if (message.
|
|
301
|
-
if (message.
|
|
302
|
-
if (message.
|
|
303
|
-
if (message.
|
|
164
|
+
if (message.nullValue !== void 0) writer.uint32(8).int32(message.nullValue);
|
|
165
|
+
if (message.numberValue !== void 0) writer.uint32(17).double(message.numberValue);
|
|
166
|
+
if (message.stringValue !== void 0) writer.uint32(26).string(message.stringValue);
|
|
167
|
+
if (message.boolValue !== void 0) writer.uint32(32).bool(message.boolValue);
|
|
168
|
+
if (message.structValue !== void 0) Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
|
|
169
|
+
if (message.listValue !== void 0) ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
|
|
304
170
|
return writer;
|
|
305
171
|
},
|
|
306
172
|
decode(input, length) {
|
|
307
173
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
308
174
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
309
|
-
const message =
|
|
175
|
+
const message = createBaseValue();
|
|
310
176
|
while (reader.pos < end) {
|
|
311
177
|
const tag = reader.uint32();
|
|
312
178
|
switch (tag >>> 3) {
|
|
313
179
|
case 1:
|
|
314
|
-
if (tag !==
|
|
315
|
-
message.
|
|
180
|
+
if (tag !== 8) break;
|
|
181
|
+
message.nullValue = reader.int32();
|
|
316
182
|
continue;
|
|
317
183
|
case 2:
|
|
318
|
-
if (tag !==
|
|
319
|
-
message.
|
|
184
|
+
if (tag !== 17) break;
|
|
185
|
+
message.numberValue = reader.double();
|
|
320
186
|
continue;
|
|
321
187
|
case 3:
|
|
322
188
|
if (tag !== 26) break;
|
|
323
|
-
message.
|
|
189
|
+
message.stringValue = reader.string();
|
|
324
190
|
continue;
|
|
325
191
|
case 4:
|
|
326
192
|
if (tag !== 32) break;
|
|
327
|
-
message.
|
|
193
|
+
message.boolValue = reader.bool();
|
|
328
194
|
continue;
|
|
329
195
|
case 5:
|
|
330
196
|
if (tag !== 42) break;
|
|
331
|
-
message.
|
|
197
|
+
message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
198
|
+
continue;
|
|
199
|
+
case 6:
|
|
200
|
+
if (tag !== 50) break;
|
|
201
|
+
message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
332
202
|
continue;
|
|
333
203
|
}
|
|
334
204
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -338,67 +208,75 @@ const ResolveFlagsRequest = {
|
|
|
338
208
|
},
|
|
339
209
|
fromJSON(object) {
|
|
340
210
|
return {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
211
|
+
nullValue: isSet$6(object.nullValue) ? nullValueFromJSON(object.nullValue) : void 0,
|
|
212
|
+
numberValue: isSet$6(object.numberValue) ? globalThis.Number(object.numberValue) : void 0,
|
|
213
|
+
stringValue: isSet$6(object.stringValue) ? globalThis.String(object.stringValue) : void 0,
|
|
214
|
+
boolValue: isSet$6(object.boolValue) ? globalThis.Boolean(object.boolValue) : void 0,
|
|
215
|
+
structValue: isObject$2(object.structValue) ? object.structValue : void 0,
|
|
216
|
+
listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : void 0
|
|
346
217
|
};
|
|
347
218
|
},
|
|
348
219
|
toJSON(message) {
|
|
349
220
|
const obj = {};
|
|
350
|
-
if (message.
|
|
351
|
-
if (message.
|
|
352
|
-
if (message.
|
|
353
|
-
if (message.
|
|
354
|
-
if (message.
|
|
221
|
+
if (message.nullValue !== void 0) obj.nullValue = nullValueToJSON(message.nullValue);
|
|
222
|
+
if (message.numberValue !== void 0) obj.numberValue = message.numberValue;
|
|
223
|
+
if (message.stringValue !== void 0) obj.stringValue = message.stringValue;
|
|
224
|
+
if (message.boolValue !== void 0) obj.boolValue = message.boolValue;
|
|
225
|
+
if (message.structValue !== void 0) obj.structValue = message.structValue;
|
|
226
|
+
if (message.listValue !== void 0) obj.listValue = message.listValue;
|
|
355
227
|
return obj;
|
|
356
228
|
},
|
|
357
229
|
create(base) {
|
|
358
|
-
return
|
|
230
|
+
return Value.fromPartial(base ?? {});
|
|
359
231
|
},
|
|
360
232
|
fromPartial(object) {
|
|
361
|
-
const message =
|
|
362
|
-
message.
|
|
363
|
-
message.
|
|
364
|
-
message.
|
|
365
|
-
message.
|
|
366
|
-
message.
|
|
233
|
+
const message = createBaseValue();
|
|
234
|
+
message.nullValue = object.nullValue ?? void 0;
|
|
235
|
+
message.numberValue = object.numberValue ?? void 0;
|
|
236
|
+
message.stringValue = object.stringValue ?? void 0;
|
|
237
|
+
message.boolValue = object.boolValue ?? void 0;
|
|
238
|
+
message.structValue = object.structValue ?? void 0;
|
|
239
|
+
message.listValue = object.listValue ?? void 0;
|
|
367
240
|
return message;
|
|
241
|
+
},
|
|
242
|
+
wrap(value) {
|
|
243
|
+
const result = createBaseValue();
|
|
244
|
+
if (value === null) result.nullValue = NullValue.NULL_VALUE;
|
|
245
|
+
else if (typeof value === "boolean") result.boolValue = value;
|
|
246
|
+
else if (typeof value === "number") result.numberValue = value;
|
|
247
|
+
else if (typeof value === "string") result.stringValue = value;
|
|
248
|
+
else if (globalThis.Array.isArray(value)) result.listValue = value;
|
|
249
|
+
else if (typeof value === "object") result.structValue = value;
|
|
250
|
+
else if (typeof value !== "undefined") throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
251
|
+
return result;
|
|
252
|
+
},
|
|
253
|
+
unwrap(message) {
|
|
254
|
+
if (message.stringValue !== void 0) return message.stringValue;
|
|
255
|
+
else if (message?.numberValue !== void 0) return message.numberValue;
|
|
256
|
+
else if (message?.boolValue !== void 0) return message.boolValue;
|
|
257
|
+
else if (message?.structValue !== void 0) return message.structValue;
|
|
258
|
+
else if (message?.listValue !== void 0) return message.listValue;
|
|
259
|
+
else if (message?.nullValue !== void 0) return null;
|
|
368
260
|
}
|
|
369
261
|
};
|
|
370
|
-
function
|
|
371
|
-
return {
|
|
372
|
-
resolvedFlags: [],
|
|
373
|
-
resolveToken: new Uint8Array(0),
|
|
374
|
-
resolveId: ""
|
|
375
|
-
};
|
|
262
|
+
function createBaseListValue() {
|
|
263
|
+
return { values: [] };
|
|
376
264
|
}
|
|
377
|
-
const
|
|
265
|
+
const ListValue = {
|
|
378
266
|
encode(message, writer = new BinaryWriter()) {
|
|
379
|
-
for (const v of message.
|
|
380
|
-
if (message.resolveToken.length !== 0) writer.uint32(18).bytes(message.resolveToken);
|
|
381
|
-
if (message.resolveId !== "") writer.uint32(26).string(message.resolveId);
|
|
267
|
+
for (const v of message.values) Value.encode(Value.wrap(v), writer.uint32(10).fork()).join();
|
|
382
268
|
return writer;
|
|
383
269
|
},
|
|
384
270
|
decode(input, length) {
|
|
385
271
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
386
272
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
387
|
-
const message =
|
|
273
|
+
const message = createBaseListValue();
|
|
388
274
|
while (reader.pos < end) {
|
|
389
275
|
const tag = reader.uint32();
|
|
390
276
|
switch (tag >>> 3) {
|
|
391
277
|
case 1:
|
|
392
278
|
if (tag !== 10) break;
|
|
393
|
-
message.
|
|
394
|
-
continue;
|
|
395
|
-
case 2:
|
|
396
|
-
if (tag !== 18) break;
|
|
397
|
-
message.resolveToken = reader.bytes();
|
|
398
|
-
continue;
|
|
399
|
-
case 3:
|
|
400
|
-
if (tag !== 26) break;
|
|
401
|
-
message.resolveId = reader.string();
|
|
279
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
402
280
|
continue;
|
|
403
281
|
}
|
|
404
282
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -407,68 +285,63 @@ const ResolveFlagsResponse = {
|
|
|
407
285
|
return message;
|
|
408
286
|
},
|
|
409
287
|
fromJSON(object) {
|
|
410
|
-
return {
|
|
411
|
-
resolvedFlags: globalThis.Array.isArray(object?.resolvedFlags) ? object.resolvedFlags.map((e) => ResolvedFlag.fromJSON(e)) : [],
|
|
412
|
-
resolveToken: isSet(object.resolveToken) ? bytesFromBase64(object.resolveToken) : new Uint8Array(0),
|
|
413
|
-
resolveId: isSet(object.resolveId) ? globalThis.String(object.resolveId) : ""
|
|
414
|
-
};
|
|
288
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
415
289
|
},
|
|
416
290
|
toJSON(message) {
|
|
417
291
|
const obj = {};
|
|
418
|
-
if (message.
|
|
419
|
-
if (message.resolveToken.length !== 0) obj.resolveToken = base64FromBytes(message.resolveToken);
|
|
420
|
-
if (message.resolveId !== "") obj.resolveId = message.resolveId;
|
|
292
|
+
if (message.values?.length) obj.values = message.values;
|
|
421
293
|
return obj;
|
|
422
294
|
},
|
|
423
295
|
create(base) {
|
|
424
|
-
return
|
|
296
|
+
return ListValue.fromPartial(base ?? {});
|
|
425
297
|
},
|
|
426
298
|
fromPartial(object) {
|
|
427
|
-
const message =
|
|
428
|
-
message.
|
|
429
|
-
message.resolveToken = object.resolveToken ?? new Uint8Array(0);
|
|
430
|
-
message.resolveId = object.resolveId ?? "";
|
|
299
|
+
const message = createBaseListValue();
|
|
300
|
+
message.values = object.values?.map((e) => e) || [];
|
|
431
301
|
return message;
|
|
302
|
+
},
|
|
303
|
+
wrap(array) {
|
|
304
|
+
const result = createBaseListValue();
|
|
305
|
+
result.values = array ?? [];
|
|
306
|
+
return result;
|
|
307
|
+
},
|
|
308
|
+
unwrap(message) {
|
|
309
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) return message.values;
|
|
310
|
+
else return message;
|
|
432
311
|
}
|
|
433
312
|
};
|
|
434
|
-
function
|
|
313
|
+
function isObject$2(value) {
|
|
314
|
+
return typeof value === "object" && value !== null;
|
|
315
|
+
}
|
|
316
|
+
function isSet$6(value) {
|
|
317
|
+
return value !== null && value !== void 0;
|
|
318
|
+
}
|
|
319
|
+
function createBaseTimestamp() {
|
|
435
320
|
return {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
value: void 0,
|
|
439
|
-
reason: 0
|
|
321
|
+
seconds: 0,
|
|
322
|
+
nanos: 0
|
|
440
323
|
};
|
|
441
324
|
}
|
|
442
|
-
const
|
|
325
|
+
const Timestamp = {
|
|
443
326
|
encode(message, writer = new BinaryWriter()) {
|
|
444
|
-
if (message.
|
|
445
|
-
if (message.
|
|
446
|
-
if (message.value !== void 0) Struct.encode(Struct.wrap(message.value), writer.uint32(26).fork()).join();
|
|
447
|
-
if (message.reason !== 0) writer.uint32(40).int32(message.reason);
|
|
327
|
+
if (message.seconds !== 0) writer.uint32(8).int64(message.seconds);
|
|
328
|
+
if (message.nanos !== 0) writer.uint32(16).int32(message.nanos);
|
|
448
329
|
return writer;
|
|
449
330
|
},
|
|
450
331
|
decode(input, length) {
|
|
451
332
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
452
333
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
453
|
-
const message =
|
|
334
|
+
const message = createBaseTimestamp();
|
|
454
335
|
while (reader.pos < end) {
|
|
455
336
|
const tag = reader.uint32();
|
|
456
337
|
switch (tag >>> 3) {
|
|
457
338
|
case 1:
|
|
458
|
-
if (tag !==
|
|
459
|
-
message.
|
|
339
|
+
if (tag !== 8) break;
|
|
340
|
+
message.seconds = longToNumber(reader.int64());
|
|
460
341
|
continue;
|
|
461
342
|
case 2:
|
|
462
|
-
if (tag !==
|
|
463
|
-
message.
|
|
464
|
-
continue;
|
|
465
|
-
case 3:
|
|
466
|
-
if (tag !== 26) break;
|
|
467
|
-
message.value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
468
|
-
continue;
|
|
469
|
-
case 5:
|
|
470
|
-
if (tag !== 40) break;
|
|
471
|
-
message.reason = reader.int32();
|
|
343
|
+
if (tag !== 16) break;
|
|
344
|
+
message.nanos = reader.int32();
|
|
472
345
|
continue;
|
|
473
346
|
}
|
|
474
347
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -478,143 +351,85 @@ const ResolvedFlag = {
|
|
|
478
351
|
},
|
|
479
352
|
fromJSON(object) {
|
|
480
353
|
return {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
value: isObject(object.value) ? object.value : void 0,
|
|
484
|
-
reason: isSet(object.reason) ? resolveReasonFromJSON(object.reason) : 0
|
|
354
|
+
seconds: isSet$5(object.seconds) ? globalThis.Number(object.seconds) : 0,
|
|
355
|
+
nanos: isSet$5(object.nanos) ? globalThis.Number(object.nanos) : 0
|
|
485
356
|
};
|
|
486
357
|
},
|
|
487
358
|
toJSON(message) {
|
|
488
359
|
const obj = {};
|
|
489
|
-
if (message.
|
|
490
|
-
if (message.
|
|
491
|
-
if (message.value !== void 0) obj.value = message.value;
|
|
492
|
-
if (message.reason !== 0) obj.reason = resolveReasonToJSON(message.reason);
|
|
360
|
+
if (message.seconds !== 0) obj.seconds = Math.round(message.seconds);
|
|
361
|
+
if (message.nanos !== 0) obj.nanos = Math.round(message.nanos);
|
|
493
362
|
return obj;
|
|
494
363
|
},
|
|
495
364
|
create(base) {
|
|
496
|
-
return
|
|
365
|
+
return Timestamp.fromPartial(base ?? {});
|
|
497
366
|
},
|
|
498
367
|
fromPartial(object) {
|
|
499
|
-
const message =
|
|
500
|
-
message.
|
|
501
|
-
message.
|
|
502
|
-
message.value = object.value ?? void 0;
|
|
503
|
-
message.reason = object.reason ?? 0;
|
|
368
|
+
const message = createBaseTimestamp();
|
|
369
|
+
message.seconds = object.seconds ?? 0;
|
|
370
|
+
message.nanos = object.nanos ?? 0;
|
|
504
371
|
return message;
|
|
505
372
|
}
|
|
506
373
|
};
|
|
507
|
-
function
|
|
374
|
+
function longToNumber(int64) {
|
|
375
|
+
const num = globalThis.Number(int64.toString());
|
|
376
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
377
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
378
|
+
return num;
|
|
379
|
+
}
|
|
380
|
+
function isSet$5(value) {
|
|
381
|
+
return value !== null && value !== void 0;
|
|
382
|
+
}
|
|
383
|
+
function createBaseFlagSchema() {
|
|
508
384
|
return {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
385
|
+
structSchema: void 0,
|
|
386
|
+
listSchema: void 0,
|
|
387
|
+
intSchema: void 0,
|
|
388
|
+
doubleSchema: void 0,
|
|
389
|
+
stringSchema: void 0,
|
|
390
|
+
boolSchema: void 0
|
|
512
391
|
};
|
|
513
392
|
}
|
|
514
|
-
const
|
|
393
|
+
const FlagSchema = {
|
|
515
394
|
encode(message, writer = new BinaryWriter()) {
|
|
516
|
-
if (message.
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
});
|
|
523
|
-
if (message.failFastOnSticky !== false) writer.uint32(24).bool(message.failFastOnSticky);
|
|
395
|
+
if (message.structSchema !== void 0) FlagSchema_StructFlagSchema.encode(message.structSchema, writer.uint32(10).fork()).join();
|
|
396
|
+
if (message.listSchema !== void 0) FlagSchema_ListFlagSchema.encode(message.listSchema, writer.uint32(18).fork()).join();
|
|
397
|
+
if (message.intSchema !== void 0) FlagSchema_IntFlagSchema.encode(message.intSchema, writer.uint32(26).fork()).join();
|
|
398
|
+
if (message.doubleSchema !== void 0) FlagSchema_DoubleFlagSchema.encode(message.doubleSchema, writer.uint32(34).fork()).join();
|
|
399
|
+
if (message.stringSchema !== void 0) FlagSchema_StringFlagSchema.encode(message.stringSchema, writer.uint32(42).fork()).join();
|
|
400
|
+
if (message.boolSchema !== void 0) FlagSchema_BoolFlagSchema.encode(message.boolSchema, writer.uint32(50).fork()).join();
|
|
524
401
|
return writer;
|
|
525
402
|
},
|
|
526
403
|
decode(input, length) {
|
|
527
404
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
528
405
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
529
|
-
const message =
|
|
406
|
+
const message = createBaseFlagSchema();
|
|
530
407
|
while (reader.pos < end) {
|
|
531
408
|
const tag = reader.uint32();
|
|
532
409
|
switch (tag >>> 3) {
|
|
533
410
|
case 1:
|
|
534
411
|
if (tag !== 10) break;
|
|
535
|
-
message.
|
|
412
|
+
message.structSchema = FlagSchema_StructFlagSchema.decode(reader, reader.uint32());
|
|
536
413
|
continue;
|
|
537
|
-
case 2:
|
|
414
|
+
case 2:
|
|
538
415
|
if (tag !== 18) break;
|
|
539
|
-
|
|
540
|
-
if (entry2.value !== void 0) message.materializationsPerUnit[entry2.key] = entry2.value;
|
|
416
|
+
message.listSchema = FlagSchema_ListFlagSchema.decode(reader, reader.uint32());
|
|
541
417
|
continue;
|
|
542
|
-
}
|
|
543
418
|
case 3:
|
|
544
|
-
if (tag !==
|
|
545
|
-
message.
|
|
419
|
+
if (tag !== 26) break;
|
|
420
|
+
message.intSchema = FlagSchema_IntFlagSchema.decode(reader, reader.uint32());
|
|
546
421
|
continue;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
return message;
|
|
552
|
-
},
|
|
553
|
-
fromJSON(object) {
|
|
554
|
-
return {
|
|
555
|
-
resolveRequest: isSet(object.resolveRequest) ? ResolveFlagsRequest.fromJSON(object.resolveRequest) : void 0,
|
|
556
|
-
materializationsPerUnit: isObject(object.materializationsPerUnit) ? Object.entries(object.materializationsPerUnit).reduce((acc, [key, value]) => {
|
|
557
|
-
acc[key] = MaterializationMap.fromJSON(value);
|
|
558
|
-
return acc;
|
|
559
|
-
}, {}) : {},
|
|
560
|
-
failFastOnSticky: isSet(object.failFastOnSticky) ? globalThis.Boolean(object.failFastOnSticky) : false
|
|
561
|
-
};
|
|
562
|
-
},
|
|
563
|
-
toJSON(message) {
|
|
564
|
-
const obj = {};
|
|
565
|
-
if (message.resolveRequest !== void 0) obj.resolveRequest = ResolveFlagsRequest.toJSON(message.resolveRequest);
|
|
566
|
-
if (message.materializationsPerUnit) {
|
|
567
|
-
const entries = Object.entries(message.materializationsPerUnit);
|
|
568
|
-
if (entries.length > 0) {
|
|
569
|
-
obj.materializationsPerUnit = {};
|
|
570
|
-
entries.forEach(([k, v]) => {
|
|
571
|
-
obj.materializationsPerUnit[k] = MaterializationMap.toJSON(v);
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
if (message.failFastOnSticky !== false) obj.failFastOnSticky = message.failFastOnSticky;
|
|
576
|
-
return obj;
|
|
577
|
-
},
|
|
578
|
-
create(base) {
|
|
579
|
-
return ResolveWithStickyRequest.fromPartial(base ?? {});
|
|
580
|
-
},
|
|
581
|
-
fromPartial(object) {
|
|
582
|
-
const message = createBaseResolveWithStickyRequest();
|
|
583
|
-
message.resolveRequest = object.resolveRequest !== void 0 && object.resolveRequest !== null ? ResolveFlagsRequest.fromPartial(object.resolveRequest) : void 0;
|
|
584
|
-
message.materializationsPerUnit = Object.entries(object.materializationsPerUnit ?? {}).reduce((acc, [key, value]) => {
|
|
585
|
-
if (value !== void 0) acc[key] = MaterializationMap.fromPartial(value);
|
|
586
|
-
return acc;
|
|
587
|
-
}, {});
|
|
588
|
-
message.failFastOnSticky = object.failFastOnSticky ?? false;
|
|
589
|
-
return message;
|
|
590
|
-
}
|
|
591
|
-
};
|
|
592
|
-
function createBaseResolveWithStickyRequest_MaterializationsPerUnitEntry() {
|
|
593
|
-
return {
|
|
594
|
-
key: "",
|
|
595
|
-
value: void 0
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
const ResolveWithStickyRequest_MaterializationsPerUnitEntry = {
|
|
599
|
-
encode(message, writer = new BinaryWriter()) {
|
|
600
|
-
if (message.key !== "") writer.uint32(10).string(message.key);
|
|
601
|
-
if (message.value !== void 0) MaterializationMap.encode(message.value, writer.uint32(18).fork()).join();
|
|
602
|
-
return writer;
|
|
603
|
-
},
|
|
604
|
-
decode(input, length) {
|
|
605
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
606
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
607
|
-
const message = createBaseResolveWithStickyRequest_MaterializationsPerUnitEntry();
|
|
608
|
-
while (reader.pos < end) {
|
|
609
|
-
const tag = reader.uint32();
|
|
610
|
-
switch (tag >>> 3) {
|
|
611
|
-
case 1:
|
|
612
|
-
if (tag !== 10) break;
|
|
613
|
-
message.key = reader.string();
|
|
422
|
+
case 4:
|
|
423
|
+
if (tag !== 34) break;
|
|
424
|
+
message.doubleSchema = FlagSchema_DoubleFlagSchema.decode(reader, reader.uint32());
|
|
614
425
|
continue;
|
|
615
|
-
case
|
|
616
|
-
if (tag !==
|
|
617
|
-
message.
|
|
426
|
+
case 5:
|
|
427
|
+
if (tag !== 42) break;
|
|
428
|
+
message.stringSchema = FlagSchema_StringFlagSchema.decode(reader, reader.uint32());
|
|
429
|
+
continue;
|
|
430
|
+
case 6:
|
|
431
|
+
if (tag !== 50) break;
|
|
432
|
+
message.boolSchema = FlagSchema_BoolFlagSchema.decode(reader, reader.uint32());
|
|
618
433
|
continue;
|
|
619
434
|
}
|
|
620
435
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -624,33 +439,45 @@ const ResolveWithStickyRequest_MaterializationsPerUnitEntry = {
|
|
|
624
439
|
},
|
|
625
440
|
fromJSON(object) {
|
|
626
441
|
return {
|
|
627
|
-
|
|
628
|
-
|
|
442
|
+
structSchema: isSet$4(object.structSchema) ? FlagSchema_StructFlagSchema.fromJSON(object.structSchema) : void 0,
|
|
443
|
+
listSchema: isSet$4(object.listSchema) ? FlagSchema_ListFlagSchema.fromJSON(object.listSchema) : void 0,
|
|
444
|
+
intSchema: isSet$4(object.intSchema) ? FlagSchema_IntFlagSchema.fromJSON(object.intSchema) : void 0,
|
|
445
|
+
doubleSchema: isSet$4(object.doubleSchema) ? FlagSchema_DoubleFlagSchema.fromJSON(object.doubleSchema) : void 0,
|
|
446
|
+
stringSchema: isSet$4(object.stringSchema) ? FlagSchema_StringFlagSchema.fromJSON(object.stringSchema) : void 0,
|
|
447
|
+
boolSchema: isSet$4(object.boolSchema) ? FlagSchema_BoolFlagSchema.fromJSON(object.boolSchema) : void 0
|
|
629
448
|
};
|
|
630
449
|
},
|
|
631
450
|
toJSON(message) {
|
|
632
451
|
const obj = {};
|
|
633
|
-
if (message.
|
|
634
|
-
if (message.
|
|
452
|
+
if (message.structSchema !== void 0) obj.structSchema = FlagSchema_StructFlagSchema.toJSON(message.structSchema);
|
|
453
|
+
if (message.listSchema !== void 0) obj.listSchema = FlagSchema_ListFlagSchema.toJSON(message.listSchema);
|
|
454
|
+
if (message.intSchema !== void 0) obj.intSchema = FlagSchema_IntFlagSchema.toJSON(message.intSchema);
|
|
455
|
+
if (message.doubleSchema !== void 0) obj.doubleSchema = FlagSchema_DoubleFlagSchema.toJSON(message.doubleSchema);
|
|
456
|
+
if (message.stringSchema !== void 0) obj.stringSchema = FlagSchema_StringFlagSchema.toJSON(message.stringSchema);
|
|
457
|
+
if (message.boolSchema !== void 0) obj.boolSchema = FlagSchema_BoolFlagSchema.toJSON(message.boolSchema);
|
|
635
458
|
return obj;
|
|
636
459
|
},
|
|
637
460
|
create(base) {
|
|
638
|
-
return
|
|
461
|
+
return FlagSchema.fromPartial(base ?? {});
|
|
639
462
|
},
|
|
640
463
|
fromPartial(object) {
|
|
641
|
-
const message =
|
|
642
|
-
message.
|
|
643
|
-
message.
|
|
464
|
+
const message = createBaseFlagSchema();
|
|
465
|
+
message.structSchema = object.structSchema !== void 0 && object.structSchema !== null ? FlagSchema_StructFlagSchema.fromPartial(object.structSchema) : void 0;
|
|
466
|
+
message.listSchema = object.listSchema !== void 0 && object.listSchema !== null ? FlagSchema_ListFlagSchema.fromPartial(object.listSchema) : void 0;
|
|
467
|
+
message.intSchema = object.intSchema !== void 0 && object.intSchema !== null ? FlagSchema_IntFlagSchema.fromPartial(object.intSchema) : void 0;
|
|
468
|
+
message.doubleSchema = object.doubleSchema !== void 0 && object.doubleSchema !== null ? FlagSchema_DoubleFlagSchema.fromPartial(object.doubleSchema) : void 0;
|
|
469
|
+
message.stringSchema = object.stringSchema !== void 0 && object.stringSchema !== null ? FlagSchema_StringFlagSchema.fromPartial(object.stringSchema) : void 0;
|
|
470
|
+
message.boolSchema = object.boolSchema !== void 0 && object.boolSchema !== null ? FlagSchema_BoolFlagSchema.fromPartial(object.boolSchema) : void 0;
|
|
644
471
|
return message;
|
|
645
472
|
}
|
|
646
473
|
};
|
|
647
|
-
function
|
|
648
|
-
return {
|
|
474
|
+
function createBaseFlagSchema_StructFlagSchema() {
|
|
475
|
+
return { schema: {} };
|
|
649
476
|
}
|
|
650
|
-
const
|
|
477
|
+
const FlagSchema_StructFlagSchema = {
|
|
651
478
|
encode(message, writer = new BinaryWriter()) {
|
|
652
|
-
Object.entries(message.
|
|
653
|
-
|
|
479
|
+
Object.entries(message.schema).forEach(([key, value]) => {
|
|
480
|
+
FlagSchema_StructFlagSchema_SchemaEntry.encode({
|
|
654
481
|
key,
|
|
655
482
|
value
|
|
656
483
|
}, writer.uint32(10).fork()).join();
|
|
@@ -660,14 +487,14 @@ const MaterializationMap = {
|
|
|
660
487
|
decode(input, length) {
|
|
661
488
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
662
489
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
663
|
-
const message =
|
|
490
|
+
const message = createBaseFlagSchema_StructFlagSchema();
|
|
664
491
|
while (reader.pos < end) {
|
|
665
492
|
const tag = reader.uint32();
|
|
666
493
|
switch (tag >>> 3) {
|
|
667
494
|
case 1: {
|
|
668
495
|
if (tag !== 10) break;
|
|
669
|
-
const entry1 =
|
|
670
|
-
if (entry1.value !== void 0) message.
|
|
496
|
+
const entry1 = FlagSchema_StructFlagSchema_SchemaEntry.decode(reader, reader.uint32());
|
|
497
|
+
if (entry1.value !== void 0) message.schema[entry1.key] = entry1.value;
|
|
671
498
|
continue;
|
|
672
499
|
}
|
|
673
500
|
}
|
|
@@ -677,52 +504,52 @@ const MaterializationMap = {
|
|
|
677
504
|
return message;
|
|
678
505
|
},
|
|
679
506
|
fromJSON(object) {
|
|
680
|
-
return {
|
|
681
|
-
acc[key] =
|
|
507
|
+
return { schema: isObject$1(object.schema) ? Object.entries(object.schema).reduce((acc, [key, value]) => {
|
|
508
|
+
acc[key] = FlagSchema.fromJSON(value);
|
|
682
509
|
return acc;
|
|
683
510
|
}, {}) : {} };
|
|
684
511
|
},
|
|
685
512
|
toJSON(message) {
|
|
686
513
|
const obj = {};
|
|
687
|
-
if (message.
|
|
688
|
-
const entries = Object.entries(message.
|
|
514
|
+
if (message.schema) {
|
|
515
|
+
const entries = Object.entries(message.schema);
|
|
689
516
|
if (entries.length > 0) {
|
|
690
|
-
obj.
|
|
517
|
+
obj.schema = {};
|
|
691
518
|
entries.forEach(([k, v]) => {
|
|
692
|
-
obj.
|
|
519
|
+
obj.schema[k] = FlagSchema.toJSON(v);
|
|
693
520
|
});
|
|
694
521
|
}
|
|
695
522
|
}
|
|
696
523
|
return obj;
|
|
697
524
|
},
|
|
698
525
|
create(base) {
|
|
699
|
-
return
|
|
526
|
+
return FlagSchema_StructFlagSchema.fromPartial(base ?? {});
|
|
700
527
|
},
|
|
701
528
|
fromPartial(object) {
|
|
702
|
-
const message =
|
|
703
|
-
message.
|
|
704
|
-
if (value !== void 0) acc[key] =
|
|
529
|
+
const message = createBaseFlagSchema_StructFlagSchema();
|
|
530
|
+
message.schema = Object.entries(object.schema ?? {}).reduce((acc, [key, value]) => {
|
|
531
|
+
if (value !== void 0) acc[key] = FlagSchema.fromPartial(value);
|
|
705
532
|
return acc;
|
|
706
533
|
}, {});
|
|
707
534
|
return message;
|
|
708
535
|
}
|
|
709
536
|
};
|
|
710
|
-
function
|
|
537
|
+
function createBaseFlagSchema_StructFlagSchema_SchemaEntry() {
|
|
711
538
|
return {
|
|
712
539
|
key: "",
|
|
713
540
|
value: void 0
|
|
714
541
|
};
|
|
715
542
|
}
|
|
716
|
-
const
|
|
543
|
+
const FlagSchema_StructFlagSchema_SchemaEntry = {
|
|
717
544
|
encode(message, writer = new BinaryWriter()) {
|
|
718
545
|
if (message.key !== "") writer.uint32(10).string(message.key);
|
|
719
|
-
if (message.value !== void 0)
|
|
546
|
+
if (message.value !== void 0) FlagSchema.encode(message.value, writer.uint32(18).fork()).join();
|
|
720
547
|
return writer;
|
|
721
548
|
},
|
|
722
549
|
decode(input, length) {
|
|
723
550
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
724
551
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
725
|
-
const message =
|
|
552
|
+
const message = createBaseFlagSchema_StructFlagSchema_SchemaEntry();
|
|
726
553
|
while (reader.pos < end) {
|
|
727
554
|
const tag = reader.uint32();
|
|
728
555
|
switch (tag >>> 3) {
|
|
@@ -732,7 +559,7 @@ const MaterializationMap_InfoMapEntry = {
|
|
|
732
559
|
continue;
|
|
733
560
|
case 2:
|
|
734
561
|
if (tag !== 18) break;
|
|
735
|
-
message.value =
|
|
562
|
+
message.value = FlagSchema.decode(reader, reader.uint32());
|
|
736
563
|
continue;
|
|
737
564
|
}
|
|
738
565
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -742,285 +569,172 @@ const MaterializationMap_InfoMapEntry = {
|
|
|
742
569
|
},
|
|
743
570
|
fromJSON(object) {
|
|
744
571
|
return {
|
|
745
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
746
|
-
value: isSet(object.value) ?
|
|
572
|
+
key: isSet$4(object.key) ? globalThis.String(object.key) : "",
|
|
573
|
+
value: isSet$4(object.value) ? FlagSchema.fromJSON(object.value) : void 0
|
|
747
574
|
};
|
|
748
575
|
},
|
|
749
576
|
toJSON(message) {
|
|
750
577
|
const obj = {};
|
|
751
578
|
if (message.key !== "") obj.key = message.key;
|
|
752
|
-
if (message.value !== void 0) obj.value =
|
|
579
|
+
if (message.value !== void 0) obj.value = FlagSchema.toJSON(message.value);
|
|
753
580
|
return obj;
|
|
754
581
|
},
|
|
755
582
|
create(base) {
|
|
756
|
-
return
|
|
583
|
+
return FlagSchema_StructFlagSchema_SchemaEntry.fromPartial(base ?? {});
|
|
757
584
|
},
|
|
758
585
|
fromPartial(object) {
|
|
759
|
-
const message =
|
|
586
|
+
const message = createBaseFlagSchema_StructFlagSchema_SchemaEntry();
|
|
760
587
|
message.key = object.key ?? "";
|
|
761
|
-
message.value = object.value !== void 0 && object.value !== null ?
|
|
588
|
+
message.value = object.value !== void 0 && object.value !== null ? FlagSchema.fromPartial(object.value) : void 0;
|
|
762
589
|
return message;
|
|
763
590
|
}
|
|
764
591
|
};
|
|
765
|
-
function
|
|
766
|
-
return {
|
|
767
|
-
unitInInfo: false,
|
|
768
|
-
ruleToVariant: {}
|
|
769
|
-
};
|
|
592
|
+
function createBaseFlagSchema_DoubleFlagSchema() {
|
|
593
|
+
return {};
|
|
770
594
|
}
|
|
771
|
-
const
|
|
772
|
-
encode(
|
|
773
|
-
if (message.unitInInfo !== false) writer.uint32(8).bool(message.unitInInfo);
|
|
774
|
-
Object.entries(message.ruleToVariant).forEach(([key, value]) => {
|
|
775
|
-
MaterializationInfo_RuleToVariantEntry.encode({
|
|
776
|
-
key,
|
|
777
|
-
value
|
|
778
|
-
}, writer.uint32(18).fork()).join();
|
|
779
|
-
});
|
|
595
|
+
const FlagSchema_DoubleFlagSchema = {
|
|
596
|
+
encode(_, writer = new BinaryWriter()) {
|
|
780
597
|
return writer;
|
|
781
598
|
},
|
|
782
599
|
decode(input, length) {
|
|
783
600
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
784
601
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
785
|
-
const message =
|
|
602
|
+
const message = createBaseFlagSchema_DoubleFlagSchema();
|
|
786
603
|
while (reader.pos < end) {
|
|
787
604
|
const tag = reader.uint32();
|
|
788
|
-
switch (tag >>> 3) {
|
|
789
|
-
case 1:
|
|
790
|
-
if (tag !== 8) break;
|
|
791
|
-
message.unitInInfo = reader.bool();
|
|
792
|
-
continue;
|
|
793
|
-
case 2: {
|
|
794
|
-
if (tag !== 18) break;
|
|
795
|
-
const entry2 = MaterializationInfo_RuleToVariantEntry.decode(reader, reader.uint32());
|
|
796
|
-
if (entry2.value !== void 0) message.ruleToVariant[entry2.key] = entry2.value;
|
|
797
|
-
continue;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
605
|
+
switch (tag >>> 3) {}
|
|
800
606
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
801
607
|
reader.skip(tag & 7);
|
|
802
608
|
}
|
|
803
609
|
return message;
|
|
804
610
|
},
|
|
805
|
-
fromJSON(
|
|
806
|
-
return {
|
|
807
|
-
unitInInfo: isSet(object.unitInInfo) ? globalThis.Boolean(object.unitInInfo) : false,
|
|
808
|
-
ruleToVariant: isObject(object.ruleToVariant) ? Object.entries(object.ruleToVariant).reduce((acc, [key, value]) => {
|
|
809
|
-
acc[key] = String(value);
|
|
810
|
-
return acc;
|
|
811
|
-
}, {}) : {}
|
|
812
|
-
};
|
|
611
|
+
fromJSON(_) {
|
|
612
|
+
return {};
|
|
813
613
|
},
|
|
814
|
-
toJSON(
|
|
815
|
-
|
|
816
|
-
if (message.unitInInfo !== false) obj.unitInInfo = message.unitInInfo;
|
|
817
|
-
if (message.ruleToVariant) {
|
|
818
|
-
const entries = Object.entries(message.ruleToVariant);
|
|
819
|
-
if (entries.length > 0) {
|
|
820
|
-
obj.ruleToVariant = {};
|
|
821
|
-
entries.forEach(([k, v]) => {
|
|
822
|
-
obj.ruleToVariant[k] = v;
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
return obj;
|
|
614
|
+
toJSON(_) {
|
|
615
|
+
return {};
|
|
827
616
|
},
|
|
828
617
|
create(base) {
|
|
829
|
-
return
|
|
618
|
+
return FlagSchema_DoubleFlagSchema.fromPartial(base ?? {});
|
|
830
619
|
},
|
|
831
|
-
fromPartial(
|
|
832
|
-
|
|
833
|
-
message.unitInInfo = object.unitInInfo ?? false;
|
|
834
|
-
message.ruleToVariant = Object.entries(object.ruleToVariant ?? {}).reduce((acc, [key, value]) => {
|
|
835
|
-
if (value !== void 0) acc[key] = globalThis.String(value);
|
|
836
|
-
return acc;
|
|
837
|
-
}, {});
|
|
838
|
-
return message;
|
|
620
|
+
fromPartial(_) {
|
|
621
|
+
return createBaseFlagSchema_DoubleFlagSchema();
|
|
839
622
|
}
|
|
840
623
|
};
|
|
841
|
-
function
|
|
842
|
-
return {
|
|
843
|
-
key: "",
|
|
844
|
-
value: ""
|
|
845
|
-
};
|
|
624
|
+
function createBaseFlagSchema_IntFlagSchema() {
|
|
625
|
+
return {};
|
|
846
626
|
}
|
|
847
|
-
const
|
|
848
|
-
encode(
|
|
849
|
-
if (message.key !== "") writer.uint32(10).string(message.key);
|
|
850
|
-
if (message.value !== "") writer.uint32(18).string(message.value);
|
|
627
|
+
const FlagSchema_IntFlagSchema = {
|
|
628
|
+
encode(_, writer = new BinaryWriter()) {
|
|
851
629
|
return writer;
|
|
852
630
|
},
|
|
853
631
|
decode(input, length) {
|
|
854
632
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
855
633
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
856
|
-
const message =
|
|
634
|
+
const message = createBaseFlagSchema_IntFlagSchema();
|
|
857
635
|
while (reader.pos < end) {
|
|
858
636
|
const tag = reader.uint32();
|
|
859
|
-
switch (tag >>> 3) {
|
|
860
|
-
case 1:
|
|
861
|
-
if (tag !== 10) break;
|
|
862
|
-
message.key = reader.string();
|
|
863
|
-
continue;
|
|
864
|
-
case 2:
|
|
865
|
-
if (tag !== 18) break;
|
|
866
|
-
message.value = reader.string();
|
|
867
|
-
continue;
|
|
868
|
-
}
|
|
637
|
+
switch (tag >>> 3) {}
|
|
869
638
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
870
639
|
reader.skip(tag & 7);
|
|
871
640
|
}
|
|
872
641
|
return message;
|
|
873
642
|
},
|
|
874
|
-
fromJSON(
|
|
875
|
-
return {
|
|
876
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
877
|
-
value: isSet(object.value) ? globalThis.String(object.value) : ""
|
|
878
|
-
};
|
|
643
|
+
fromJSON(_) {
|
|
644
|
+
return {};
|
|
879
645
|
},
|
|
880
|
-
toJSON(
|
|
881
|
-
|
|
882
|
-
if (message.key !== "") obj.key = message.key;
|
|
883
|
-
if (message.value !== "") obj.value = message.value;
|
|
884
|
-
return obj;
|
|
646
|
+
toJSON(_) {
|
|
647
|
+
return {};
|
|
885
648
|
},
|
|
886
649
|
create(base) {
|
|
887
|
-
return
|
|
650
|
+
return FlagSchema_IntFlagSchema.fromPartial(base ?? {});
|
|
888
651
|
},
|
|
889
|
-
fromPartial(
|
|
890
|
-
|
|
891
|
-
message.key = object.key ?? "";
|
|
892
|
-
message.value = object.value ?? "";
|
|
893
|
-
return message;
|
|
652
|
+
fromPartial(_) {
|
|
653
|
+
return createBaseFlagSchema_IntFlagSchema();
|
|
894
654
|
}
|
|
895
655
|
};
|
|
896
|
-
function
|
|
897
|
-
return {
|
|
898
|
-
success: void 0,
|
|
899
|
-
missingMaterializations: void 0
|
|
900
|
-
};
|
|
656
|
+
function createBaseFlagSchema_StringFlagSchema() {
|
|
657
|
+
return {};
|
|
901
658
|
}
|
|
902
|
-
const
|
|
903
|
-
encode(
|
|
904
|
-
if (message.success !== void 0) ResolveWithStickyResponse_Success.encode(message.success, writer.uint32(10).fork()).join();
|
|
905
|
-
if (message.missingMaterializations !== void 0) ResolveWithStickyResponse_MissingMaterializations.encode(message.missingMaterializations, writer.uint32(18).fork()).join();
|
|
659
|
+
const FlagSchema_StringFlagSchema = {
|
|
660
|
+
encode(_, writer = new BinaryWriter()) {
|
|
906
661
|
return writer;
|
|
907
662
|
},
|
|
908
663
|
decode(input, length) {
|
|
909
664
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
910
665
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
911
|
-
const message =
|
|
666
|
+
const message = createBaseFlagSchema_StringFlagSchema();
|
|
912
667
|
while (reader.pos < end) {
|
|
913
668
|
const tag = reader.uint32();
|
|
914
|
-
switch (tag >>> 3) {
|
|
915
|
-
case 1:
|
|
916
|
-
if (tag !== 10) break;
|
|
917
|
-
message.success = ResolveWithStickyResponse_Success.decode(reader, reader.uint32());
|
|
918
|
-
continue;
|
|
919
|
-
case 2:
|
|
920
|
-
if (tag !== 18) break;
|
|
921
|
-
message.missingMaterializations = ResolveWithStickyResponse_MissingMaterializations.decode(reader, reader.uint32());
|
|
922
|
-
continue;
|
|
923
|
-
}
|
|
669
|
+
switch (tag >>> 3) {}
|
|
924
670
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
925
671
|
reader.skip(tag & 7);
|
|
926
672
|
}
|
|
927
673
|
return message;
|
|
928
674
|
},
|
|
929
|
-
fromJSON(
|
|
930
|
-
return {
|
|
931
|
-
success: isSet(object.success) ? ResolveWithStickyResponse_Success.fromJSON(object.success) : void 0,
|
|
932
|
-
missingMaterializations: isSet(object.missingMaterializations) ? ResolveWithStickyResponse_MissingMaterializations.fromJSON(object.missingMaterializations) : void 0
|
|
933
|
-
};
|
|
675
|
+
fromJSON(_) {
|
|
676
|
+
return {};
|
|
934
677
|
},
|
|
935
|
-
toJSON(
|
|
936
|
-
|
|
937
|
-
if (message.success !== void 0) obj.success = ResolveWithStickyResponse_Success.toJSON(message.success);
|
|
938
|
-
if (message.missingMaterializations !== void 0) obj.missingMaterializations = ResolveWithStickyResponse_MissingMaterializations.toJSON(message.missingMaterializations);
|
|
939
|
-
return obj;
|
|
678
|
+
toJSON(_) {
|
|
679
|
+
return {};
|
|
940
680
|
},
|
|
941
681
|
create(base) {
|
|
942
|
-
return
|
|
682
|
+
return FlagSchema_StringFlagSchema.fromPartial(base ?? {});
|
|
943
683
|
},
|
|
944
|
-
fromPartial(
|
|
945
|
-
|
|
946
|
-
message.success = object.success !== void 0 && object.success !== null ? ResolveWithStickyResponse_Success.fromPartial(object.success) : void 0;
|
|
947
|
-
message.missingMaterializations = object.missingMaterializations !== void 0 && object.missingMaterializations !== null ? ResolveWithStickyResponse_MissingMaterializations.fromPartial(object.missingMaterializations) : void 0;
|
|
948
|
-
return message;
|
|
684
|
+
fromPartial(_) {
|
|
685
|
+
return createBaseFlagSchema_StringFlagSchema();
|
|
949
686
|
}
|
|
950
687
|
};
|
|
951
|
-
function
|
|
952
|
-
return {
|
|
953
|
-
response: void 0,
|
|
954
|
-
updates: []
|
|
955
|
-
};
|
|
688
|
+
function createBaseFlagSchema_BoolFlagSchema() {
|
|
689
|
+
return {};
|
|
956
690
|
}
|
|
957
|
-
const
|
|
958
|
-
encode(
|
|
959
|
-
if (message.response !== void 0) ResolveFlagsResponse.encode(message.response, writer.uint32(10).fork()).join();
|
|
960
|
-
for (const v of message.updates) ResolveWithStickyResponse_MaterializationUpdate.encode(v, writer.uint32(18).fork()).join();
|
|
691
|
+
const FlagSchema_BoolFlagSchema = {
|
|
692
|
+
encode(_, writer = new BinaryWriter()) {
|
|
961
693
|
return writer;
|
|
962
694
|
},
|
|
963
695
|
decode(input, length) {
|
|
964
696
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
965
697
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
966
|
-
const message =
|
|
698
|
+
const message = createBaseFlagSchema_BoolFlagSchema();
|
|
967
699
|
while (reader.pos < end) {
|
|
968
700
|
const tag = reader.uint32();
|
|
969
|
-
switch (tag >>> 3) {
|
|
970
|
-
case 1:
|
|
971
|
-
if (tag !== 10) break;
|
|
972
|
-
message.response = ResolveFlagsResponse.decode(reader, reader.uint32());
|
|
973
|
-
continue;
|
|
974
|
-
case 2:
|
|
975
|
-
if (tag !== 18) break;
|
|
976
|
-
message.updates.push(ResolveWithStickyResponse_MaterializationUpdate.decode(reader, reader.uint32()));
|
|
977
|
-
continue;
|
|
978
|
-
}
|
|
701
|
+
switch (tag >>> 3) {}
|
|
979
702
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
980
703
|
reader.skip(tag & 7);
|
|
981
704
|
}
|
|
982
705
|
return message;
|
|
983
706
|
},
|
|
984
|
-
fromJSON(
|
|
985
|
-
return {
|
|
986
|
-
response: isSet(object.response) ? ResolveFlagsResponse.fromJSON(object.response) : void 0,
|
|
987
|
-
updates: globalThis.Array.isArray(object?.updates) ? object.updates.map((e) => ResolveWithStickyResponse_MaterializationUpdate.fromJSON(e)) : []
|
|
988
|
-
};
|
|
707
|
+
fromJSON(_) {
|
|
708
|
+
return {};
|
|
989
709
|
},
|
|
990
|
-
toJSON(
|
|
991
|
-
|
|
992
|
-
if (message.response !== void 0) obj.response = ResolveFlagsResponse.toJSON(message.response);
|
|
993
|
-
if (message.updates?.length) obj.updates = message.updates.map((e) => ResolveWithStickyResponse_MaterializationUpdate.toJSON(e));
|
|
994
|
-
return obj;
|
|
710
|
+
toJSON(_) {
|
|
711
|
+
return {};
|
|
995
712
|
},
|
|
996
713
|
create(base) {
|
|
997
|
-
return
|
|
714
|
+
return FlagSchema_BoolFlagSchema.fromPartial(base ?? {});
|
|
998
715
|
},
|
|
999
|
-
fromPartial(
|
|
1000
|
-
|
|
1001
|
-
message.response = object.response !== void 0 && object.response !== null ? ResolveFlagsResponse.fromPartial(object.response) : void 0;
|
|
1002
|
-
message.updates = object.updates?.map((e) => ResolveWithStickyResponse_MaterializationUpdate.fromPartial(e)) || [];
|
|
1003
|
-
return message;
|
|
716
|
+
fromPartial(_) {
|
|
717
|
+
return createBaseFlagSchema_BoolFlagSchema();
|
|
1004
718
|
}
|
|
1005
719
|
};
|
|
1006
|
-
function
|
|
1007
|
-
return {
|
|
720
|
+
function createBaseFlagSchema_ListFlagSchema() {
|
|
721
|
+
return { elementSchema: void 0 };
|
|
1008
722
|
}
|
|
1009
|
-
const
|
|
723
|
+
const FlagSchema_ListFlagSchema = {
|
|
1010
724
|
encode(message, writer = new BinaryWriter()) {
|
|
1011
|
-
|
|
725
|
+
if (message.elementSchema !== void 0) FlagSchema.encode(message.elementSchema, writer.uint32(10).fork()).join();
|
|
1012
726
|
return writer;
|
|
1013
727
|
},
|
|
1014
728
|
decode(input, length) {
|
|
1015
729
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1016
730
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1017
|
-
const message =
|
|
731
|
+
const message = createBaseFlagSchema_ListFlagSchema();
|
|
1018
732
|
while (reader.pos < end) {
|
|
1019
733
|
const tag = reader.uint32();
|
|
1020
734
|
switch (tag >>> 3) {
|
|
1021
735
|
case 1:
|
|
1022
736
|
if (tag !== 10) break;
|
|
1023
|
-
message.
|
|
737
|
+
message.elementSchema = FlagSchema.decode(reader, reader.uint32());
|
|
1024
738
|
continue;
|
|
1025
739
|
}
|
|
1026
740
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -1029,54 +743,214 @@ const ResolveWithStickyResponse_MissingMaterializations = {
|
|
|
1029
743
|
return message;
|
|
1030
744
|
},
|
|
1031
745
|
fromJSON(object) {
|
|
1032
|
-
return {
|
|
746
|
+
return { elementSchema: isSet$4(object.elementSchema) ? FlagSchema.fromJSON(object.elementSchema) : void 0 };
|
|
1033
747
|
},
|
|
1034
748
|
toJSON(message) {
|
|
1035
749
|
const obj = {};
|
|
1036
|
-
if (message.
|
|
750
|
+
if (message.elementSchema !== void 0) obj.elementSchema = FlagSchema.toJSON(message.elementSchema);
|
|
1037
751
|
return obj;
|
|
1038
752
|
},
|
|
1039
753
|
create(base) {
|
|
1040
|
-
return
|
|
754
|
+
return FlagSchema_ListFlagSchema.fromPartial(base ?? {});
|
|
1041
755
|
},
|
|
1042
756
|
fromPartial(object) {
|
|
1043
|
-
const message =
|
|
1044
|
-
message.
|
|
757
|
+
const message = createBaseFlagSchema_ListFlagSchema();
|
|
758
|
+
message.elementSchema = object.elementSchema !== void 0 && object.elementSchema !== null ? FlagSchema.fromPartial(object.elementSchema) : void 0;
|
|
1045
759
|
return message;
|
|
1046
760
|
}
|
|
1047
761
|
};
|
|
1048
|
-
function
|
|
762
|
+
function isObject$1(value) {
|
|
763
|
+
return typeof value === "object" && value !== null;
|
|
764
|
+
}
|
|
765
|
+
function isSet$4(value) {
|
|
766
|
+
return value !== null && value !== void 0;
|
|
767
|
+
}
|
|
768
|
+
let ResolveReason = /* @__PURE__ */ function(ResolveReason$1) {
|
|
769
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_UNSPECIFIED"] = 0] = "RESOLVE_REASON_UNSPECIFIED";
|
|
770
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_MATCH"] = 1] = "RESOLVE_REASON_MATCH";
|
|
771
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_NO_SEGMENT_MATCH"] = 2] = "RESOLVE_REASON_NO_SEGMENT_MATCH";
|
|
772
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_NO_TREATMENT_MATCH"] = 3] = "RESOLVE_REASON_NO_TREATMENT_MATCH";
|
|
773
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_FLAG_ARCHIVED"] = 4] = "RESOLVE_REASON_FLAG_ARCHIVED";
|
|
774
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_TARGETING_KEY_ERROR"] = 5] = "RESOLVE_REASON_TARGETING_KEY_ERROR";
|
|
775
|
+
ResolveReason$1[ResolveReason$1["RESOLVE_REASON_ERROR"] = 6] = "RESOLVE_REASON_ERROR";
|
|
776
|
+
ResolveReason$1[ResolveReason$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
777
|
+
return ResolveReason$1;
|
|
778
|
+
}({});
|
|
779
|
+
function resolveReasonFromJSON(object) {
|
|
780
|
+
switch (object) {
|
|
781
|
+
case 0:
|
|
782
|
+
case "RESOLVE_REASON_UNSPECIFIED": return ResolveReason.RESOLVE_REASON_UNSPECIFIED;
|
|
783
|
+
case 1:
|
|
784
|
+
case "RESOLVE_REASON_MATCH": return ResolveReason.RESOLVE_REASON_MATCH;
|
|
785
|
+
case 2:
|
|
786
|
+
case "RESOLVE_REASON_NO_SEGMENT_MATCH": return ResolveReason.RESOLVE_REASON_NO_SEGMENT_MATCH;
|
|
787
|
+
case 3:
|
|
788
|
+
case "RESOLVE_REASON_NO_TREATMENT_MATCH": return ResolveReason.RESOLVE_REASON_NO_TREATMENT_MATCH;
|
|
789
|
+
case 4:
|
|
790
|
+
case "RESOLVE_REASON_FLAG_ARCHIVED": return ResolveReason.RESOLVE_REASON_FLAG_ARCHIVED;
|
|
791
|
+
case 5:
|
|
792
|
+
case "RESOLVE_REASON_TARGETING_KEY_ERROR": return ResolveReason.RESOLVE_REASON_TARGETING_KEY_ERROR;
|
|
793
|
+
case 6:
|
|
794
|
+
case "RESOLVE_REASON_ERROR": return ResolveReason.RESOLVE_REASON_ERROR;
|
|
795
|
+
case -1:
|
|
796
|
+
case "UNRECOGNIZED":
|
|
797
|
+
default: return ResolveReason.UNRECOGNIZED;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
function resolveReasonToJSON(object) {
|
|
801
|
+
switch (object) {
|
|
802
|
+
case ResolveReason.RESOLVE_REASON_UNSPECIFIED: return "RESOLVE_REASON_UNSPECIFIED";
|
|
803
|
+
case ResolveReason.RESOLVE_REASON_MATCH: return "RESOLVE_REASON_MATCH";
|
|
804
|
+
case ResolveReason.RESOLVE_REASON_NO_SEGMENT_MATCH: return "RESOLVE_REASON_NO_SEGMENT_MATCH";
|
|
805
|
+
case ResolveReason.RESOLVE_REASON_NO_TREATMENT_MATCH: return "RESOLVE_REASON_NO_TREATMENT_MATCH";
|
|
806
|
+
case ResolveReason.RESOLVE_REASON_FLAG_ARCHIVED: return "RESOLVE_REASON_FLAG_ARCHIVED";
|
|
807
|
+
case ResolveReason.RESOLVE_REASON_TARGETING_KEY_ERROR: return "RESOLVE_REASON_TARGETING_KEY_ERROR";
|
|
808
|
+
case ResolveReason.RESOLVE_REASON_ERROR: return "RESOLVE_REASON_ERROR";
|
|
809
|
+
case ResolveReason.UNRECOGNIZED:
|
|
810
|
+
default: return "UNRECOGNIZED";
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
let SdkId = /* @__PURE__ */ function(SdkId$1) {
|
|
814
|
+
SdkId$1[SdkId$1["SDK_ID_UNSPECIFIED"] = 0] = "SDK_ID_UNSPECIFIED";
|
|
815
|
+
SdkId$1[SdkId$1["SDK_ID_JAVA_PROVIDER"] = 1] = "SDK_ID_JAVA_PROVIDER";
|
|
816
|
+
SdkId$1[SdkId$1["SDK_ID_KOTLIN_PROVIDER"] = 2] = "SDK_ID_KOTLIN_PROVIDER";
|
|
817
|
+
SdkId$1[SdkId$1["SDK_ID_SWIFT_PROVIDER"] = 3] = "SDK_ID_SWIFT_PROVIDER";
|
|
818
|
+
SdkId$1[SdkId$1["SDK_ID_JS_WEB_PROVIDER"] = 4] = "SDK_ID_JS_WEB_PROVIDER";
|
|
819
|
+
SdkId$1[SdkId$1["SDK_ID_JS_SERVER_PROVIDER"] = 5] = "SDK_ID_JS_SERVER_PROVIDER";
|
|
820
|
+
SdkId$1[SdkId$1["SDK_ID_PYTHON_PROVIDER"] = 6] = "SDK_ID_PYTHON_PROVIDER";
|
|
821
|
+
SdkId$1[SdkId$1["SDK_ID_GO_PROVIDER"] = 7] = "SDK_ID_GO_PROVIDER";
|
|
822
|
+
SdkId$1[SdkId$1["SDK_ID_RUBY_PROVIDER"] = 8] = "SDK_ID_RUBY_PROVIDER";
|
|
823
|
+
SdkId$1[SdkId$1["SDK_ID_RUST_PROVIDER"] = 9] = "SDK_ID_RUST_PROVIDER";
|
|
824
|
+
SdkId$1[SdkId$1["SDK_ID_JAVA_CONFIDENCE"] = 10] = "SDK_ID_JAVA_CONFIDENCE";
|
|
825
|
+
SdkId$1[SdkId$1["SDK_ID_KOTLIN_CONFIDENCE"] = 11] = "SDK_ID_KOTLIN_CONFIDENCE";
|
|
826
|
+
SdkId$1[SdkId$1["SDK_ID_SWIFT_CONFIDENCE"] = 12] = "SDK_ID_SWIFT_CONFIDENCE";
|
|
827
|
+
SdkId$1[SdkId$1["SDK_ID_JS_CONFIDENCE"] = 13] = "SDK_ID_JS_CONFIDENCE";
|
|
828
|
+
SdkId$1[SdkId$1["SDK_ID_PYTHON_CONFIDENCE"] = 14] = "SDK_ID_PYTHON_CONFIDENCE";
|
|
829
|
+
SdkId$1[SdkId$1["SDK_ID_GO_CONFIDENCE"] = 15] = "SDK_ID_GO_CONFIDENCE";
|
|
830
|
+
SdkId$1[SdkId$1["SDK_ID_RUST_CONFIDENCE"] = 16] = "SDK_ID_RUST_CONFIDENCE";
|
|
831
|
+
SdkId$1[SdkId$1["SDK_ID_FLUTTER_IOS_CONFIDENCE"] = 17] = "SDK_ID_FLUTTER_IOS_CONFIDENCE";
|
|
832
|
+
SdkId$1[SdkId$1["SDK_ID_FLUTTER_ANDROID_CONFIDENCE"] = 18] = "SDK_ID_FLUTTER_ANDROID_CONFIDENCE";
|
|
833
|
+
SdkId$1[SdkId$1["SDK_ID_DOTNET_CONFIDENCE"] = 19] = "SDK_ID_DOTNET_CONFIDENCE";
|
|
834
|
+
SdkId$1[SdkId$1["SDK_ID_GO_LOCAL_PROVIDER"] = 20] = "SDK_ID_GO_LOCAL_PROVIDER";
|
|
835
|
+
SdkId$1[SdkId$1["SDK_ID_JAVA_LOCAL_PROVIDER"] = 21] = "SDK_ID_JAVA_LOCAL_PROVIDER";
|
|
836
|
+
SdkId$1[SdkId$1["SDK_ID_JS_LOCAL_SERVER_PROVIDER"] = 22] = "SDK_ID_JS_LOCAL_SERVER_PROVIDER";
|
|
837
|
+
SdkId$1[SdkId$1["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
838
|
+
return SdkId$1;
|
|
839
|
+
}({});
|
|
840
|
+
function sdkIdFromJSON(object) {
|
|
841
|
+
switch (object) {
|
|
842
|
+
case 0:
|
|
843
|
+
case "SDK_ID_UNSPECIFIED": return SdkId.SDK_ID_UNSPECIFIED;
|
|
844
|
+
case 1:
|
|
845
|
+
case "SDK_ID_JAVA_PROVIDER": return SdkId.SDK_ID_JAVA_PROVIDER;
|
|
846
|
+
case 2:
|
|
847
|
+
case "SDK_ID_KOTLIN_PROVIDER": return SdkId.SDK_ID_KOTLIN_PROVIDER;
|
|
848
|
+
case 3:
|
|
849
|
+
case "SDK_ID_SWIFT_PROVIDER": return SdkId.SDK_ID_SWIFT_PROVIDER;
|
|
850
|
+
case 4:
|
|
851
|
+
case "SDK_ID_JS_WEB_PROVIDER": return SdkId.SDK_ID_JS_WEB_PROVIDER;
|
|
852
|
+
case 5:
|
|
853
|
+
case "SDK_ID_JS_SERVER_PROVIDER": return SdkId.SDK_ID_JS_SERVER_PROVIDER;
|
|
854
|
+
case 6:
|
|
855
|
+
case "SDK_ID_PYTHON_PROVIDER": return SdkId.SDK_ID_PYTHON_PROVIDER;
|
|
856
|
+
case 7:
|
|
857
|
+
case "SDK_ID_GO_PROVIDER": return SdkId.SDK_ID_GO_PROVIDER;
|
|
858
|
+
case 8:
|
|
859
|
+
case "SDK_ID_RUBY_PROVIDER": return SdkId.SDK_ID_RUBY_PROVIDER;
|
|
860
|
+
case 9:
|
|
861
|
+
case "SDK_ID_RUST_PROVIDER": return SdkId.SDK_ID_RUST_PROVIDER;
|
|
862
|
+
case 10:
|
|
863
|
+
case "SDK_ID_JAVA_CONFIDENCE": return SdkId.SDK_ID_JAVA_CONFIDENCE;
|
|
864
|
+
case 11:
|
|
865
|
+
case "SDK_ID_KOTLIN_CONFIDENCE": return SdkId.SDK_ID_KOTLIN_CONFIDENCE;
|
|
866
|
+
case 12:
|
|
867
|
+
case "SDK_ID_SWIFT_CONFIDENCE": return SdkId.SDK_ID_SWIFT_CONFIDENCE;
|
|
868
|
+
case 13:
|
|
869
|
+
case "SDK_ID_JS_CONFIDENCE": return SdkId.SDK_ID_JS_CONFIDENCE;
|
|
870
|
+
case 14:
|
|
871
|
+
case "SDK_ID_PYTHON_CONFIDENCE": return SdkId.SDK_ID_PYTHON_CONFIDENCE;
|
|
872
|
+
case 15:
|
|
873
|
+
case "SDK_ID_GO_CONFIDENCE": return SdkId.SDK_ID_GO_CONFIDENCE;
|
|
874
|
+
case 16:
|
|
875
|
+
case "SDK_ID_RUST_CONFIDENCE": return SdkId.SDK_ID_RUST_CONFIDENCE;
|
|
876
|
+
case 17:
|
|
877
|
+
case "SDK_ID_FLUTTER_IOS_CONFIDENCE": return SdkId.SDK_ID_FLUTTER_IOS_CONFIDENCE;
|
|
878
|
+
case 18:
|
|
879
|
+
case "SDK_ID_FLUTTER_ANDROID_CONFIDENCE": return SdkId.SDK_ID_FLUTTER_ANDROID_CONFIDENCE;
|
|
880
|
+
case 19:
|
|
881
|
+
case "SDK_ID_DOTNET_CONFIDENCE": return SdkId.SDK_ID_DOTNET_CONFIDENCE;
|
|
882
|
+
case 20:
|
|
883
|
+
case "SDK_ID_GO_LOCAL_PROVIDER": return SdkId.SDK_ID_GO_LOCAL_PROVIDER;
|
|
884
|
+
case 21:
|
|
885
|
+
case "SDK_ID_JAVA_LOCAL_PROVIDER": return SdkId.SDK_ID_JAVA_LOCAL_PROVIDER;
|
|
886
|
+
case 22:
|
|
887
|
+
case "SDK_ID_JS_LOCAL_SERVER_PROVIDER": return SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER;
|
|
888
|
+
case -1:
|
|
889
|
+
case "UNRECOGNIZED":
|
|
890
|
+
default: return SdkId.UNRECOGNIZED;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
function sdkIdToJSON(object) {
|
|
894
|
+
switch (object) {
|
|
895
|
+
case SdkId.SDK_ID_UNSPECIFIED: return "SDK_ID_UNSPECIFIED";
|
|
896
|
+
case SdkId.SDK_ID_JAVA_PROVIDER: return "SDK_ID_JAVA_PROVIDER";
|
|
897
|
+
case SdkId.SDK_ID_KOTLIN_PROVIDER: return "SDK_ID_KOTLIN_PROVIDER";
|
|
898
|
+
case SdkId.SDK_ID_SWIFT_PROVIDER: return "SDK_ID_SWIFT_PROVIDER";
|
|
899
|
+
case SdkId.SDK_ID_JS_WEB_PROVIDER: return "SDK_ID_JS_WEB_PROVIDER";
|
|
900
|
+
case SdkId.SDK_ID_JS_SERVER_PROVIDER: return "SDK_ID_JS_SERVER_PROVIDER";
|
|
901
|
+
case SdkId.SDK_ID_PYTHON_PROVIDER: return "SDK_ID_PYTHON_PROVIDER";
|
|
902
|
+
case SdkId.SDK_ID_GO_PROVIDER: return "SDK_ID_GO_PROVIDER";
|
|
903
|
+
case SdkId.SDK_ID_RUBY_PROVIDER: return "SDK_ID_RUBY_PROVIDER";
|
|
904
|
+
case SdkId.SDK_ID_RUST_PROVIDER: return "SDK_ID_RUST_PROVIDER";
|
|
905
|
+
case SdkId.SDK_ID_JAVA_CONFIDENCE: return "SDK_ID_JAVA_CONFIDENCE";
|
|
906
|
+
case SdkId.SDK_ID_KOTLIN_CONFIDENCE: return "SDK_ID_KOTLIN_CONFIDENCE";
|
|
907
|
+
case SdkId.SDK_ID_SWIFT_CONFIDENCE: return "SDK_ID_SWIFT_CONFIDENCE";
|
|
908
|
+
case SdkId.SDK_ID_JS_CONFIDENCE: return "SDK_ID_JS_CONFIDENCE";
|
|
909
|
+
case SdkId.SDK_ID_PYTHON_CONFIDENCE: return "SDK_ID_PYTHON_CONFIDENCE";
|
|
910
|
+
case SdkId.SDK_ID_GO_CONFIDENCE: return "SDK_ID_GO_CONFIDENCE";
|
|
911
|
+
case SdkId.SDK_ID_RUST_CONFIDENCE: return "SDK_ID_RUST_CONFIDENCE";
|
|
912
|
+
case SdkId.SDK_ID_FLUTTER_IOS_CONFIDENCE: return "SDK_ID_FLUTTER_IOS_CONFIDENCE";
|
|
913
|
+
case SdkId.SDK_ID_FLUTTER_ANDROID_CONFIDENCE: return "SDK_ID_FLUTTER_ANDROID_CONFIDENCE";
|
|
914
|
+
case SdkId.SDK_ID_DOTNET_CONFIDENCE: return "SDK_ID_DOTNET_CONFIDENCE";
|
|
915
|
+
case SdkId.SDK_ID_GO_LOCAL_PROVIDER: return "SDK_ID_GO_LOCAL_PROVIDER";
|
|
916
|
+
case SdkId.SDK_ID_JAVA_LOCAL_PROVIDER: return "SDK_ID_JAVA_LOCAL_PROVIDER";
|
|
917
|
+
case SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER: return "SDK_ID_JS_LOCAL_SERVER_PROVIDER";
|
|
918
|
+
case SdkId.UNRECOGNIZED:
|
|
919
|
+
default: return "UNRECOGNIZED";
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function createBaseSdk() {
|
|
1049
923
|
return {
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
924
|
+
id: void 0,
|
|
925
|
+
customId: void 0,
|
|
926
|
+
version: ""
|
|
1053
927
|
};
|
|
1054
928
|
}
|
|
1055
|
-
const
|
|
929
|
+
const Sdk = {
|
|
1056
930
|
encode(message, writer = new BinaryWriter()) {
|
|
1057
|
-
if (message.
|
|
1058
|
-
if (message.
|
|
1059
|
-
if (message.
|
|
931
|
+
if (message.id !== void 0) writer.uint32(8).int32(message.id);
|
|
932
|
+
if (message.customId !== void 0) writer.uint32(18).string(message.customId);
|
|
933
|
+
if (message.version !== "") writer.uint32(26).string(message.version);
|
|
1060
934
|
return writer;
|
|
1061
935
|
},
|
|
1062
936
|
decode(input, length) {
|
|
1063
937
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1064
938
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1065
|
-
const message =
|
|
939
|
+
const message = createBaseSdk();
|
|
1066
940
|
while (reader.pos < end) {
|
|
1067
941
|
const tag = reader.uint32();
|
|
1068
942
|
switch (tag >>> 3) {
|
|
1069
943
|
case 1:
|
|
1070
|
-
if (tag !==
|
|
1071
|
-
message.
|
|
944
|
+
if (tag !== 8) break;
|
|
945
|
+
message.id = reader.int32();
|
|
1072
946
|
continue;
|
|
1073
947
|
case 2:
|
|
1074
948
|
if (tag !== 18) break;
|
|
1075
|
-
message.
|
|
949
|
+
message.customId = reader.string();
|
|
1076
950
|
continue;
|
|
1077
951
|
case 3:
|
|
1078
952
|
if (tag !== 26) break;
|
|
1079
|
-
message.
|
|
953
|
+
message.version = reader.string();
|
|
1080
954
|
continue;
|
|
1081
955
|
}
|
|
1082
956
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
@@ -1086,68 +960,223 @@ const ResolveWithStickyResponse_MissingMaterializationItem = {
|
|
|
1086
960
|
},
|
|
1087
961
|
fromJSON(object) {
|
|
1088
962
|
return {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
963
|
+
id: isSet$3(object.id) ? sdkIdFromJSON(object.id) : void 0,
|
|
964
|
+
customId: isSet$3(object.customId) ? globalThis.String(object.customId) : void 0,
|
|
965
|
+
version: isSet$3(object.version) ? globalThis.String(object.version) : ""
|
|
1092
966
|
};
|
|
1093
967
|
},
|
|
1094
968
|
toJSON(message) {
|
|
1095
969
|
const obj = {};
|
|
1096
|
-
if (message.
|
|
1097
|
-
if (message.
|
|
1098
|
-
if (message.
|
|
970
|
+
if (message.id !== void 0) obj.id = sdkIdToJSON(message.id);
|
|
971
|
+
if (message.customId !== void 0) obj.customId = message.customId;
|
|
972
|
+
if (message.version !== "") obj.version = message.version;
|
|
1099
973
|
return obj;
|
|
1100
974
|
},
|
|
1101
975
|
create(base) {
|
|
1102
|
-
return
|
|
976
|
+
return Sdk.fromPartial(base ?? {});
|
|
1103
977
|
},
|
|
1104
978
|
fromPartial(object) {
|
|
1105
|
-
const message =
|
|
1106
|
-
message.
|
|
1107
|
-
message.
|
|
1108
|
-
message.
|
|
979
|
+
const message = createBaseSdk();
|
|
980
|
+
message.id = object.id ?? void 0;
|
|
981
|
+
message.customId = object.customId ?? void 0;
|
|
982
|
+
message.version = object.version ?? "";
|
|
1109
983
|
return message;
|
|
1110
984
|
}
|
|
1111
985
|
};
|
|
1112
|
-
function
|
|
986
|
+
function isSet$3(value) {
|
|
987
|
+
return value !== null && value !== void 0;
|
|
988
|
+
}
|
|
989
|
+
function createBaseResolveFlagsRequest() {
|
|
1113
990
|
return {
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
991
|
+
flags: [],
|
|
992
|
+
evaluationContext: void 0,
|
|
993
|
+
clientSecret: "",
|
|
994
|
+
apply: false,
|
|
995
|
+
sdk: void 0
|
|
1118
996
|
};
|
|
1119
997
|
}
|
|
1120
|
-
const
|
|
998
|
+
const ResolveFlagsRequest = {
|
|
1121
999
|
encode(message, writer = new BinaryWriter()) {
|
|
1122
|
-
|
|
1123
|
-
if (message.
|
|
1124
|
-
if (message.
|
|
1125
|
-
if (message.
|
|
1000
|
+
for (const v of message.flags) writer.uint32(10).string(v);
|
|
1001
|
+
if (message.evaluationContext !== void 0) Struct.encode(Struct.wrap(message.evaluationContext), writer.uint32(18).fork()).join();
|
|
1002
|
+
if (message.clientSecret !== "") writer.uint32(26).string(message.clientSecret);
|
|
1003
|
+
if (message.apply !== false) writer.uint32(32).bool(message.apply);
|
|
1004
|
+
if (message.sdk !== void 0) Sdk.encode(message.sdk, writer.uint32(42).fork()).join();
|
|
1126
1005
|
return writer;
|
|
1127
1006
|
},
|
|
1128
1007
|
decode(input, length) {
|
|
1129
1008
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1130
1009
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1131
|
-
const message =
|
|
1010
|
+
const message = createBaseResolveFlagsRequest();
|
|
1132
1011
|
while (reader.pos < end) {
|
|
1133
1012
|
const tag = reader.uint32();
|
|
1134
1013
|
switch (tag >>> 3) {
|
|
1135
1014
|
case 1:
|
|
1136
1015
|
if (tag !== 10) break;
|
|
1137
|
-
message.
|
|
1016
|
+
message.flags.push(reader.string());
|
|
1138
1017
|
continue;
|
|
1139
1018
|
case 2:
|
|
1140
1019
|
if (tag !== 18) break;
|
|
1141
|
-
message.
|
|
1020
|
+
message.evaluationContext = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1142
1021
|
continue;
|
|
1143
1022
|
case 3:
|
|
1144
1023
|
if (tag !== 26) break;
|
|
1145
|
-
message.
|
|
1024
|
+
message.clientSecret = reader.string();
|
|
1146
1025
|
continue;
|
|
1147
1026
|
case 4:
|
|
1148
|
-
if (tag !==
|
|
1027
|
+
if (tag !== 32) break;
|
|
1028
|
+
message.apply = reader.bool();
|
|
1029
|
+
continue;
|
|
1030
|
+
case 5:
|
|
1031
|
+
if (tag !== 42) break;
|
|
1032
|
+
message.sdk = Sdk.decode(reader, reader.uint32());
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1036
|
+
reader.skip(tag & 7);
|
|
1037
|
+
}
|
|
1038
|
+
return message;
|
|
1039
|
+
},
|
|
1040
|
+
fromJSON(object) {
|
|
1041
|
+
return {
|
|
1042
|
+
flags: globalThis.Array.isArray(object?.flags) ? object.flags.map((e) => globalThis.String(e)) : [],
|
|
1043
|
+
evaluationContext: isObject(object.evaluationContext) ? object.evaluationContext : void 0,
|
|
1044
|
+
clientSecret: isSet$2(object.clientSecret) ? globalThis.String(object.clientSecret) : "",
|
|
1045
|
+
apply: isSet$2(object.apply) ? globalThis.Boolean(object.apply) : false,
|
|
1046
|
+
sdk: isSet$2(object.sdk) ? Sdk.fromJSON(object.sdk) : void 0
|
|
1047
|
+
};
|
|
1048
|
+
},
|
|
1049
|
+
toJSON(message) {
|
|
1050
|
+
const obj = {};
|
|
1051
|
+
if (message.flags?.length) obj.flags = message.flags;
|
|
1052
|
+
if (message.evaluationContext !== void 0) obj.evaluationContext = message.evaluationContext;
|
|
1053
|
+
if (message.clientSecret !== "") obj.clientSecret = message.clientSecret;
|
|
1054
|
+
if (message.apply !== false) obj.apply = message.apply;
|
|
1055
|
+
if (message.sdk !== void 0) obj.sdk = Sdk.toJSON(message.sdk);
|
|
1056
|
+
return obj;
|
|
1057
|
+
},
|
|
1058
|
+
create(base) {
|
|
1059
|
+
return ResolveFlagsRequest.fromPartial(base ?? {});
|
|
1060
|
+
},
|
|
1061
|
+
fromPartial(object) {
|
|
1062
|
+
const message = createBaseResolveFlagsRequest();
|
|
1063
|
+
message.flags = object.flags?.map((e) => e) || [];
|
|
1064
|
+
message.evaluationContext = object.evaluationContext ?? void 0;
|
|
1065
|
+
message.clientSecret = object.clientSecret ?? "";
|
|
1066
|
+
message.apply = object.apply ?? false;
|
|
1067
|
+
message.sdk = object.sdk !== void 0 && object.sdk !== null ? Sdk.fromPartial(object.sdk) : void 0;
|
|
1068
|
+
return message;
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
function createBaseResolveFlagsResponse() {
|
|
1072
|
+
return {
|
|
1073
|
+
resolvedFlags: [],
|
|
1074
|
+
resolveToken: new Uint8Array(0),
|
|
1075
|
+
resolveId: ""
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
const ResolveFlagsResponse = {
|
|
1079
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1080
|
+
for (const v of message.resolvedFlags) ResolvedFlag.encode(v, writer.uint32(10).fork()).join();
|
|
1081
|
+
if (message.resolveToken.length !== 0) writer.uint32(18).bytes(message.resolveToken);
|
|
1082
|
+
if (message.resolveId !== "") writer.uint32(26).string(message.resolveId);
|
|
1083
|
+
return writer;
|
|
1084
|
+
},
|
|
1085
|
+
decode(input, length) {
|
|
1086
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1087
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1088
|
+
const message = createBaseResolveFlagsResponse();
|
|
1089
|
+
while (reader.pos < end) {
|
|
1090
|
+
const tag = reader.uint32();
|
|
1091
|
+
switch (tag >>> 3) {
|
|
1092
|
+
case 1:
|
|
1093
|
+
if (tag !== 10) break;
|
|
1094
|
+
message.resolvedFlags.push(ResolvedFlag.decode(reader, reader.uint32()));
|
|
1095
|
+
continue;
|
|
1096
|
+
case 2:
|
|
1097
|
+
if (tag !== 18) break;
|
|
1098
|
+
message.resolveToken = reader.bytes();
|
|
1099
|
+
continue;
|
|
1100
|
+
case 3:
|
|
1101
|
+
if (tag !== 26) break;
|
|
1102
|
+
message.resolveId = reader.string();
|
|
1103
|
+
continue;
|
|
1104
|
+
}
|
|
1105
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1106
|
+
reader.skip(tag & 7);
|
|
1107
|
+
}
|
|
1108
|
+
return message;
|
|
1109
|
+
},
|
|
1110
|
+
fromJSON(object) {
|
|
1111
|
+
return {
|
|
1112
|
+
resolvedFlags: globalThis.Array.isArray(object?.resolvedFlags) ? object.resolvedFlags.map((e) => ResolvedFlag.fromJSON(e)) : [],
|
|
1113
|
+
resolveToken: isSet$2(object.resolveToken) ? bytesFromBase64(object.resolveToken) : new Uint8Array(0),
|
|
1114
|
+
resolveId: isSet$2(object.resolveId) ? globalThis.String(object.resolveId) : ""
|
|
1115
|
+
};
|
|
1116
|
+
},
|
|
1117
|
+
toJSON(message) {
|
|
1118
|
+
const obj = {};
|
|
1119
|
+
if (message.resolvedFlags?.length) obj.resolvedFlags = message.resolvedFlags.map((e) => ResolvedFlag.toJSON(e));
|
|
1120
|
+
if (message.resolveToken.length !== 0) obj.resolveToken = base64FromBytes(message.resolveToken);
|
|
1121
|
+
if (message.resolveId !== "") obj.resolveId = message.resolveId;
|
|
1122
|
+
return obj;
|
|
1123
|
+
},
|
|
1124
|
+
create(base) {
|
|
1125
|
+
return ResolveFlagsResponse.fromPartial(base ?? {});
|
|
1126
|
+
},
|
|
1127
|
+
fromPartial(object) {
|
|
1128
|
+
const message = createBaseResolveFlagsResponse();
|
|
1129
|
+
message.resolvedFlags = object.resolvedFlags?.map((e) => ResolvedFlag.fromPartial(e)) || [];
|
|
1130
|
+
message.resolveToken = object.resolveToken ?? new Uint8Array(0);
|
|
1131
|
+
message.resolveId = object.resolveId ?? "";
|
|
1132
|
+
return message;
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
function createBaseResolvedFlag() {
|
|
1136
|
+
return {
|
|
1137
|
+
flag: "",
|
|
1138
|
+
variant: "",
|
|
1139
|
+
value: void 0,
|
|
1140
|
+
flagSchema: void 0,
|
|
1141
|
+
reason: 0
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
const ResolvedFlag = {
|
|
1145
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1146
|
+
if (message.flag !== "") writer.uint32(10).string(message.flag);
|
|
1147
|
+
if (message.variant !== "") writer.uint32(18).string(message.variant);
|
|
1148
|
+
if (message.value !== void 0) Struct.encode(Struct.wrap(message.value), writer.uint32(26).fork()).join();
|
|
1149
|
+
if (message.flagSchema !== void 0) FlagSchema_StructFlagSchema.encode(message.flagSchema, writer.uint32(34).fork()).join();
|
|
1150
|
+
if (message.reason !== 0) writer.uint32(40).int32(message.reason);
|
|
1151
|
+
return writer;
|
|
1152
|
+
},
|
|
1153
|
+
decode(input, length) {
|
|
1154
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1155
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1156
|
+
const message = createBaseResolvedFlag();
|
|
1157
|
+
while (reader.pos < end) {
|
|
1158
|
+
const tag = reader.uint32();
|
|
1159
|
+
switch (tag >>> 3) {
|
|
1160
|
+
case 1:
|
|
1161
|
+
if (tag !== 10) break;
|
|
1162
|
+
message.flag = reader.string();
|
|
1163
|
+
continue;
|
|
1164
|
+
case 2:
|
|
1165
|
+
if (tag !== 18) break;
|
|
1149
1166
|
message.variant = reader.string();
|
|
1150
1167
|
continue;
|
|
1168
|
+
case 3:
|
|
1169
|
+
if (tag !== 26) break;
|
|
1170
|
+
message.value = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1171
|
+
continue;
|
|
1172
|
+
case 4:
|
|
1173
|
+
if (tag !== 34) break;
|
|
1174
|
+
message.flagSchema = FlagSchema_StructFlagSchema.decode(reader, reader.uint32());
|
|
1175
|
+
continue;
|
|
1176
|
+
case 5:
|
|
1177
|
+
if (tag !== 40) break;
|
|
1178
|
+
message.reason = reader.int32();
|
|
1179
|
+
continue;
|
|
1151
1180
|
}
|
|
1152
1181
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
1153
1182
|
reader.skip(tag & 7);
|
|
@@ -1156,29 +1185,32 @@ const ResolveWithStickyResponse_MaterializationUpdate = {
|
|
|
1156
1185
|
},
|
|
1157
1186
|
fromJSON(object) {
|
|
1158
1187
|
return {
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1188
|
+
flag: isSet$2(object.flag) ? globalThis.String(object.flag) : "",
|
|
1189
|
+
variant: isSet$2(object.variant) ? globalThis.String(object.variant) : "",
|
|
1190
|
+
value: isObject(object.value) ? object.value : void 0,
|
|
1191
|
+
flagSchema: isSet$2(object.flagSchema) ? FlagSchema_StructFlagSchema.fromJSON(object.flagSchema) : void 0,
|
|
1192
|
+
reason: isSet$2(object.reason) ? resolveReasonFromJSON(object.reason) : 0
|
|
1163
1193
|
};
|
|
1164
1194
|
},
|
|
1165
1195
|
toJSON(message) {
|
|
1166
1196
|
const obj = {};
|
|
1167
|
-
if (message.
|
|
1168
|
-
if (message.writeMaterialization !== "") obj.writeMaterialization = message.writeMaterialization;
|
|
1169
|
-
if (message.rule !== "") obj.rule = message.rule;
|
|
1197
|
+
if (message.flag !== "") obj.flag = message.flag;
|
|
1170
1198
|
if (message.variant !== "") obj.variant = message.variant;
|
|
1199
|
+
if (message.value !== void 0) obj.value = message.value;
|
|
1200
|
+
if (message.flagSchema !== void 0) obj.flagSchema = FlagSchema_StructFlagSchema.toJSON(message.flagSchema);
|
|
1201
|
+
if (message.reason !== 0) obj.reason = resolveReasonToJSON(message.reason);
|
|
1171
1202
|
return obj;
|
|
1172
1203
|
},
|
|
1173
1204
|
create(base) {
|
|
1174
|
-
return
|
|
1205
|
+
return ResolvedFlag.fromPartial(base ?? {});
|
|
1175
1206
|
},
|
|
1176
1207
|
fromPartial(object) {
|
|
1177
|
-
const message =
|
|
1178
|
-
message.
|
|
1179
|
-
message.writeMaterialization = object.writeMaterialization ?? "";
|
|
1180
|
-
message.rule = object.rule ?? "";
|
|
1208
|
+
const message = createBaseResolvedFlag();
|
|
1209
|
+
message.flag = object.flag ?? "";
|
|
1181
1210
|
message.variant = object.variant ?? "";
|
|
1211
|
+
message.value = object.value ?? void 0;
|
|
1212
|
+
message.flagSchema = object.flagSchema !== void 0 && object.flagSchema !== null ? FlagSchema_StructFlagSchema.fromPartial(object.flagSchema) : void 0;
|
|
1213
|
+
message.reason = object.reason ?? 0;
|
|
1182
1214
|
return message;
|
|
1183
1215
|
}
|
|
1184
1216
|
};
|
|
@@ -1204,10 +1236,10 @@ function base64FromBytes(arr) {
|
|
|
1204
1236
|
function isObject(value) {
|
|
1205
1237
|
return typeof value === "object" && value !== null;
|
|
1206
1238
|
}
|
|
1207
|
-
function isSet(value) {
|
|
1239
|
+
function isSet$2(value) {
|
|
1208
1240
|
return value !== null && value !== void 0;
|
|
1209
1241
|
}
|
|
1210
|
-
const VERSION = "0.
|
|
1242
|
+
const VERSION = "0.5.0";
|
|
1211
1243
|
const NOOP_LOG_FN = Object.assign(() => {}, { enabled: false });
|
|
1212
1244
|
const debugBackend = loadDebug();
|
|
1213
1245
|
const logger$2 = new class LoggerImpl {
|
|
@@ -1252,6 +1284,7 @@ async function loadDebug() {
|
|
|
1252
1284
|
}
|
|
1253
1285
|
}
|
|
1254
1286
|
let TimeUnit = /* @__PURE__ */ function(TimeUnit$1) {
|
|
1287
|
+
TimeUnit$1[TimeUnit$1["MILLISECOND"] = 1] = "MILLISECOND";
|
|
1255
1288
|
TimeUnit$1[TimeUnit$1["SECOND"] = 1e3] = "SECOND";
|
|
1256
1289
|
TimeUnit$1[TimeUnit$1["MINUTE"] = 6e4] = "MINUTE";
|
|
1257
1290
|
TimeUnit$1[TimeUnit$1["HOUR"] = 36e5] = "HOUR";
|
|
@@ -1331,6 +1364,12 @@ function promiseSignal(signal) {
|
|
|
1331
1364
|
}, { once: true });
|
|
1332
1365
|
});
|
|
1333
1366
|
}
|
|
1367
|
+
function hasKey(obj, key) {
|
|
1368
|
+
return key in obj;
|
|
1369
|
+
}
|
|
1370
|
+
function castStringToEnum(value) {
|
|
1371
|
+
return value;
|
|
1372
|
+
}
|
|
1334
1373
|
const logger$3 = logger$2.getLogger("fetch");
|
|
1335
1374
|
let Fetch;
|
|
1336
1375
|
(function(_Fetch) {
|
|
@@ -1464,46 +1503,665 @@ function withRouter(routes) {
|
|
|
1464
1503
|
logger$3.info("withRouter no route matched %s, falling through", url);
|
|
1465
1504
|
return next(url, init);
|
|
1466
1505
|
}
|
|
1467
|
-
return match[1](url, init);
|
|
1468
|
-
};
|
|
1469
|
-
};
|
|
1506
|
+
return match[1](url, init);
|
|
1507
|
+
};
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
function withResponse(factory) {
|
|
1511
|
+
return (_next) => factory;
|
|
1512
|
+
}
|
|
1513
|
+
const fetchLogger = logger$3;
|
|
1514
|
+
function withLogging(logger$4 = fetchLogger) {
|
|
1515
|
+
return (next) => async (url, init) => {
|
|
1516
|
+
const start = Date.now();
|
|
1517
|
+
const resp = await next(url, init);
|
|
1518
|
+
const duration = Date.now() - start;
|
|
1519
|
+
logger$4.info("%s %s (%i) %dms", (init?.method ?? "get").toUpperCase(), url.split("?", 1)[0], resp.status, duration);
|
|
1520
|
+
return resp;
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
async function bodyRepeater(body) {
|
|
1524
|
+
if (body instanceof ReadableStream) {
|
|
1525
|
+
const blob = await new Response(body).blob();
|
|
1526
|
+
return () => blob.stream();
|
|
1527
|
+
}
|
|
1528
|
+
return () => body;
|
|
1529
|
+
}
|
|
1530
|
+
function parseRetryAfter(retryAfterValue, min = 0, max = Number.MAX_SAFE_INTEGER) {
|
|
1531
|
+
if (retryAfterValue) {
|
|
1532
|
+
let delay = Number(retryAfterValue) * 1e3;
|
|
1533
|
+
if (Number.isNaN(delay)) delay = Date.parse(retryAfterValue) - Date.now();
|
|
1534
|
+
if (Number.isFinite(delay) && delay > 0) return Math.max(min, Math.min(delay, max));
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
function timeoutSignal$1(delay, signal) {
|
|
1538
|
+
const ac = new AbortController();
|
|
1539
|
+
portableSetTimeout(() => ac.abort(/* @__PURE__ */ new Error(`Operation timed out after ${delay}ms`)), delay);
|
|
1540
|
+
return signal ? AbortSignal.any([signal, ac.signal]) : ac.signal;
|
|
1541
|
+
}
|
|
1542
|
+
async function sha256Hex(input) {
|
|
1543
|
+
const data = new TextEncoder().encode(input);
|
|
1544
|
+
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
|
|
1545
|
+
return Array.from(new Uint8Array(hashBuffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1546
|
+
}
|
|
1547
|
+
function createBaseWriteOperationsRequest() {
|
|
1548
|
+
return { storeVariantOp: [] };
|
|
1549
|
+
}
|
|
1550
|
+
const WriteOperationsRequest = {
|
|
1551
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1552
|
+
for (const v of message.storeVariantOp) VariantData.encode(v, writer.uint32(10).fork()).join();
|
|
1553
|
+
return writer;
|
|
1554
|
+
},
|
|
1555
|
+
decode(input, length) {
|
|
1556
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1557
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1558
|
+
const message = createBaseWriteOperationsRequest();
|
|
1559
|
+
while (reader.pos < end) {
|
|
1560
|
+
const tag = reader.uint32();
|
|
1561
|
+
switch (tag >>> 3) {
|
|
1562
|
+
case 1:
|
|
1563
|
+
if (tag !== 10) break;
|
|
1564
|
+
message.storeVariantOp.push(VariantData.decode(reader, reader.uint32()));
|
|
1565
|
+
continue;
|
|
1566
|
+
}
|
|
1567
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1568
|
+
reader.skip(tag & 7);
|
|
1569
|
+
}
|
|
1570
|
+
return message;
|
|
1571
|
+
},
|
|
1572
|
+
fromJSON(object) {
|
|
1573
|
+
return { storeVariantOp: globalThis.Array.isArray(object?.storeVariantOp) ? object.storeVariantOp.map((e) => VariantData.fromJSON(e)) : [] };
|
|
1574
|
+
},
|
|
1575
|
+
toJSON(message) {
|
|
1576
|
+
const obj = {};
|
|
1577
|
+
if (message.storeVariantOp?.length) obj.storeVariantOp = message.storeVariantOp.map((e) => VariantData.toJSON(e));
|
|
1578
|
+
return obj;
|
|
1579
|
+
},
|
|
1580
|
+
create(base) {
|
|
1581
|
+
return WriteOperationsRequest.fromPartial(base ?? {});
|
|
1582
|
+
},
|
|
1583
|
+
fromPartial(object) {
|
|
1584
|
+
const message = createBaseWriteOperationsRequest();
|
|
1585
|
+
message.storeVariantOp = object.storeVariantOp?.map((e) => VariantData.fromPartial(e)) || [];
|
|
1586
|
+
return message;
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
function createBaseVariantReadOp() {
|
|
1590
|
+
return {
|
|
1591
|
+
unit: "",
|
|
1592
|
+
materialization: "",
|
|
1593
|
+
rule: ""
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
const VariantReadOp = {
|
|
1597
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1598
|
+
if (message.unit !== "") writer.uint32(10).string(message.unit);
|
|
1599
|
+
if (message.materialization !== "") writer.uint32(18).string(message.materialization);
|
|
1600
|
+
if (message.rule !== "") writer.uint32(26).string(message.rule);
|
|
1601
|
+
return writer;
|
|
1602
|
+
},
|
|
1603
|
+
decode(input, length) {
|
|
1604
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1605
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1606
|
+
const message = createBaseVariantReadOp();
|
|
1607
|
+
while (reader.pos < end) {
|
|
1608
|
+
const tag = reader.uint32();
|
|
1609
|
+
switch (tag >>> 3) {
|
|
1610
|
+
case 1:
|
|
1611
|
+
if (tag !== 10) break;
|
|
1612
|
+
message.unit = reader.string();
|
|
1613
|
+
continue;
|
|
1614
|
+
case 2:
|
|
1615
|
+
if (tag !== 18) break;
|
|
1616
|
+
message.materialization = reader.string();
|
|
1617
|
+
continue;
|
|
1618
|
+
case 3:
|
|
1619
|
+
if (tag !== 26) break;
|
|
1620
|
+
message.rule = reader.string();
|
|
1621
|
+
continue;
|
|
1622
|
+
}
|
|
1623
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1624
|
+
reader.skip(tag & 7);
|
|
1625
|
+
}
|
|
1626
|
+
return message;
|
|
1627
|
+
},
|
|
1628
|
+
fromJSON(object) {
|
|
1629
|
+
return {
|
|
1630
|
+
unit: isSet$1(object.unit) ? globalThis.String(object.unit) : "",
|
|
1631
|
+
materialization: isSet$1(object.materialization) ? globalThis.String(object.materialization) : "",
|
|
1632
|
+
rule: isSet$1(object.rule) ? globalThis.String(object.rule) : ""
|
|
1633
|
+
};
|
|
1634
|
+
},
|
|
1635
|
+
toJSON(message) {
|
|
1636
|
+
const obj = {};
|
|
1637
|
+
if (message.unit !== "") obj.unit = message.unit;
|
|
1638
|
+
if (message.materialization !== "") obj.materialization = message.materialization;
|
|
1639
|
+
if (message.rule !== "") obj.rule = message.rule;
|
|
1640
|
+
return obj;
|
|
1641
|
+
},
|
|
1642
|
+
create(base) {
|
|
1643
|
+
return VariantReadOp.fromPartial(base ?? {});
|
|
1644
|
+
},
|
|
1645
|
+
fromPartial(object) {
|
|
1646
|
+
const message = createBaseVariantReadOp();
|
|
1647
|
+
message.unit = object.unit ?? "";
|
|
1648
|
+
message.materialization = object.materialization ?? "";
|
|
1649
|
+
message.rule = object.rule ?? "";
|
|
1650
|
+
return message;
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
function createBaseInclusionReadOp() {
|
|
1654
|
+
return {
|
|
1655
|
+
unit: "",
|
|
1656
|
+
materialization: ""
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
const InclusionReadOp = {
|
|
1660
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1661
|
+
if (message.unit !== "") writer.uint32(10).string(message.unit);
|
|
1662
|
+
if (message.materialization !== "") writer.uint32(18).string(message.materialization);
|
|
1663
|
+
return writer;
|
|
1664
|
+
},
|
|
1665
|
+
decode(input, length) {
|
|
1666
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1667
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1668
|
+
const message = createBaseInclusionReadOp();
|
|
1669
|
+
while (reader.pos < end) {
|
|
1670
|
+
const tag = reader.uint32();
|
|
1671
|
+
switch (tag >>> 3) {
|
|
1672
|
+
case 1:
|
|
1673
|
+
if (tag !== 10) break;
|
|
1674
|
+
message.unit = reader.string();
|
|
1675
|
+
continue;
|
|
1676
|
+
case 2:
|
|
1677
|
+
if (tag !== 18) break;
|
|
1678
|
+
message.materialization = reader.string();
|
|
1679
|
+
continue;
|
|
1680
|
+
}
|
|
1681
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1682
|
+
reader.skip(tag & 7);
|
|
1683
|
+
}
|
|
1684
|
+
return message;
|
|
1685
|
+
},
|
|
1686
|
+
fromJSON(object) {
|
|
1687
|
+
return {
|
|
1688
|
+
unit: isSet$1(object.unit) ? globalThis.String(object.unit) : "",
|
|
1689
|
+
materialization: isSet$1(object.materialization) ? globalThis.String(object.materialization) : ""
|
|
1690
|
+
};
|
|
1691
|
+
},
|
|
1692
|
+
toJSON(message) {
|
|
1693
|
+
const obj = {};
|
|
1694
|
+
if (message.unit !== "") obj.unit = message.unit;
|
|
1695
|
+
if (message.materialization !== "") obj.materialization = message.materialization;
|
|
1696
|
+
return obj;
|
|
1697
|
+
},
|
|
1698
|
+
create(base) {
|
|
1699
|
+
return InclusionReadOp.fromPartial(base ?? {});
|
|
1700
|
+
},
|
|
1701
|
+
fromPartial(object) {
|
|
1702
|
+
const message = createBaseInclusionReadOp();
|
|
1703
|
+
message.unit = object.unit ?? "";
|
|
1704
|
+
message.materialization = object.materialization ?? "";
|
|
1705
|
+
return message;
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
function createBaseReadOp() {
|
|
1709
|
+
return {
|
|
1710
|
+
variantReadOp: void 0,
|
|
1711
|
+
inclusionReadOp: void 0
|
|
1712
|
+
};
|
|
1713
|
+
}
|
|
1714
|
+
const ReadOp = {
|
|
1715
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1716
|
+
if (message.variantReadOp !== void 0) VariantReadOp.encode(message.variantReadOp, writer.uint32(10).fork()).join();
|
|
1717
|
+
if (message.inclusionReadOp !== void 0) InclusionReadOp.encode(message.inclusionReadOp, writer.uint32(18).fork()).join();
|
|
1718
|
+
return writer;
|
|
1719
|
+
},
|
|
1720
|
+
decode(input, length) {
|
|
1721
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1722
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1723
|
+
const message = createBaseReadOp();
|
|
1724
|
+
while (reader.pos < end) {
|
|
1725
|
+
const tag = reader.uint32();
|
|
1726
|
+
switch (tag >>> 3) {
|
|
1727
|
+
case 1:
|
|
1728
|
+
if (tag !== 10) break;
|
|
1729
|
+
message.variantReadOp = VariantReadOp.decode(reader, reader.uint32());
|
|
1730
|
+
continue;
|
|
1731
|
+
case 2:
|
|
1732
|
+
if (tag !== 18) break;
|
|
1733
|
+
message.inclusionReadOp = InclusionReadOp.decode(reader, reader.uint32());
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1737
|
+
reader.skip(tag & 7);
|
|
1738
|
+
}
|
|
1739
|
+
return message;
|
|
1740
|
+
},
|
|
1741
|
+
fromJSON(object) {
|
|
1742
|
+
return {
|
|
1743
|
+
variantReadOp: isSet$1(object.variantReadOp) ? VariantReadOp.fromJSON(object.variantReadOp) : void 0,
|
|
1744
|
+
inclusionReadOp: isSet$1(object.inclusionReadOp) ? InclusionReadOp.fromJSON(object.inclusionReadOp) : void 0
|
|
1745
|
+
};
|
|
1746
|
+
},
|
|
1747
|
+
toJSON(message) {
|
|
1748
|
+
const obj = {};
|
|
1749
|
+
if (message.variantReadOp !== void 0) obj.variantReadOp = VariantReadOp.toJSON(message.variantReadOp);
|
|
1750
|
+
if (message.inclusionReadOp !== void 0) obj.inclusionReadOp = InclusionReadOp.toJSON(message.inclusionReadOp);
|
|
1751
|
+
return obj;
|
|
1752
|
+
},
|
|
1753
|
+
create(base) {
|
|
1754
|
+
return ReadOp.fromPartial(base ?? {});
|
|
1755
|
+
},
|
|
1756
|
+
fromPartial(object) {
|
|
1757
|
+
const message = createBaseReadOp();
|
|
1758
|
+
message.variantReadOp = object.variantReadOp !== void 0 && object.variantReadOp !== null ? VariantReadOp.fromPartial(object.variantReadOp) : void 0;
|
|
1759
|
+
message.inclusionReadOp = object.inclusionReadOp !== void 0 && object.inclusionReadOp !== null ? InclusionReadOp.fromPartial(object.inclusionReadOp) : void 0;
|
|
1760
|
+
return message;
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
function createBaseReadOperationsRequest() {
|
|
1764
|
+
return { ops: [] };
|
|
1765
|
+
}
|
|
1766
|
+
const ReadOperationsRequest = {
|
|
1767
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1768
|
+
for (const v of message.ops) ReadOp.encode(v, writer.uint32(26).fork()).join();
|
|
1769
|
+
return writer;
|
|
1770
|
+
},
|
|
1771
|
+
decode(input, length) {
|
|
1772
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1773
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1774
|
+
const message = createBaseReadOperationsRequest();
|
|
1775
|
+
while (reader.pos < end) {
|
|
1776
|
+
const tag = reader.uint32();
|
|
1777
|
+
switch (tag >>> 3) {
|
|
1778
|
+
case 3:
|
|
1779
|
+
if (tag !== 26) break;
|
|
1780
|
+
message.ops.push(ReadOp.decode(reader, reader.uint32()));
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1783
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1784
|
+
reader.skip(tag & 7);
|
|
1785
|
+
}
|
|
1786
|
+
return message;
|
|
1787
|
+
},
|
|
1788
|
+
fromJSON(object) {
|
|
1789
|
+
return { ops: globalThis.Array.isArray(object?.ops) ? object.ops.map((e) => ReadOp.fromJSON(e)) : [] };
|
|
1790
|
+
},
|
|
1791
|
+
toJSON(message) {
|
|
1792
|
+
const obj = {};
|
|
1793
|
+
if (message.ops?.length) obj.ops = message.ops.map((e) => ReadOp.toJSON(e));
|
|
1794
|
+
return obj;
|
|
1795
|
+
},
|
|
1796
|
+
create(base) {
|
|
1797
|
+
return ReadOperationsRequest.fromPartial(base ?? {});
|
|
1798
|
+
},
|
|
1799
|
+
fromPartial(object) {
|
|
1800
|
+
const message = createBaseReadOperationsRequest();
|
|
1801
|
+
message.ops = object.ops?.map((e) => ReadOp.fromPartial(e)) || [];
|
|
1802
|
+
return message;
|
|
1803
|
+
}
|
|
1804
|
+
};
|
|
1805
|
+
function createBaseVariantData() {
|
|
1806
|
+
return {
|
|
1807
|
+
unit: "",
|
|
1808
|
+
materialization: "",
|
|
1809
|
+
rule: "",
|
|
1810
|
+
variant: ""
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
const VariantData = {
|
|
1814
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1815
|
+
if (message.unit !== "") writer.uint32(10).string(message.unit);
|
|
1816
|
+
if (message.materialization !== "") writer.uint32(18).string(message.materialization);
|
|
1817
|
+
if (message.rule !== "") writer.uint32(26).string(message.rule);
|
|
1818
|
+
if (message.variant !== "") writer.uint32(34).string(message.variant);
|
|
1819
|
+
return writer;
|
|
1820
|
+
},
|
|
1821
|
+
decode(input, length) {
|
|
1822
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1823
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1824
|
+
const message = createBaseVariantData();
|
|
1825
|
+
while (reader.pos < end) {
|
|
1826
|
+
const tag = reader.uint32();
|
|
1827
|
+
switch (tag >>> 3) {
|
|
1828
|
+
case 1:
|
|
1829
|
+
if (tag !== 10) break;
|
|
1830
|
+
message.unit = reader.string();
|
|
1831
|
+
continue;
|
|
1832
|
+
case 2:
|
|
1833
|
+
if (tag !== 18) break;
|
|
1834
|
+
message.materialization = reader.string();
|
|
1835
|
+
continue;
|
|
1836
|
+
case 3:
|
|
1837
|
+
if (tag !== 26) break;
|
|
1838
|
+
message.rule = reader.string();
|
|
1839
|
+
continue;
|
|
1840
|
+
case 4:
|
|
1841
|
+
if (tag !== 34) break;
|
|
1842
|
+
message.variant = reader.string();
|
|
1843
|
+
continue;
|
|
1844
|
+
}
|
|
1845
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1846
|
+
reader.skip(tag & 7);
|
|
1847
|
+
}
|
|
1848
|
+
return message;
|
|
1849
|
+
},
|
|
1850
|
+
fromJSON(object) {
|
|
1851
|
+
return {
|
|
1852
|
+
unit: isSet$1(object.unit) ? globalThis.String(object.unit) : "",
|
|
1853
|
+
materialization: isSet$1(object.materialization) ? globalThis.String(object.materialization) : "",
|
|
1854
|
+
rule: isSet$1(object.rule) ? globalThis.String(object.rule) : "",
|
|
1855
|
+
variant: isSet$1(object.variant) ? globalThis.String(object.variant) : ""
|
|
1856
|
+
};
|
|
1857
|
+
},
|
|
1858
|
+
toJSON(message) {
|
|
1859
|
+
const obj = {};
|
|
1860
|
+
if (message.unit !== "") obj.unit = message.unit;
|
|
1861
|
+
if (message.materialization !== "") obj.materialization = message.materialization;
|
|
1862
|
+
if (message.rule !== "") obj.rule = message.rule;
|
|
1863
|
+
if (message.variant !== "") obj.variant = message.variant;
|
|
1864
|
+
return obj;
|
|
1865
|
+
},
|
|
1866
|
+
create(base) {
|
|
1867
|
+
return VariantData.fromPartial(base ?? {});
|
|
1868
|
+
},
|
|
1869
|
+
fromPartial(object) {
|
|
1870
|
+
const message = createBaseVariantData();
|
|
1871
|
+
message.unit = object.unit ?? "";
|
|
1872
|
+
message.materialization = object.materialization ?? "";
|
|
1873
|
+
message.rule = object.rule ?? "";
|
|
1874
|
+
message.variant = object.variant ?? "";
|
|
1875
|
+
return message;
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
function createBaseInclusionData() {
|
|
1879
|
+
return {
|
|
1880
|
+
unit: "",
|
|
1881
|
+
materialization: "",
|
|
1882
|
+
isIncluded: false
|
|
1883
|
+
};
|
|
1884
|
+
}
|
|
1885
|
+
const InclusionData = {
|
|
1886
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1887
|
+
if (message.unit !== "") writer.uint32(10).string(message.unit);
|
|
1888
|
+
if (message.materialization !== "") writer.uint32(18).string(message.materialization);
|
|
1889
|
+
if (message.isIncluded !== false) writer.uint32(24).bool(message.isIncluded);
|
|
1890
|
+
return writer;
|
|
1891
|
+
},
|
|
1892
|
+
decode(input, length) {
|
|
1893
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1894
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1895
|
+
const message = createBaseInclusionData();
|
|
1896
|
+
while (reader.pos < end) {
|
|
1897
|
+
const tag = reader.uint32();
|
|
1898
|
+
switch (tag >>> 3) {
|
|
1899
|
+
case 1:
|
|
1900
|
+
if (tag !== 10) break;
|
|
1901
|
+
message.unit = reader.string();
|
|
1902
|
+
continue;
|
|
1903
|
+
case 2:
|
|
1904
|
+
if (tag !== 18) break;
|
|
1905
|
+
message.materialization = reader.string();
|
|
1906
|
+
continue;
|
|
1907
|
+
case 3:
|
|
1908
|
+
if (tag !== 24) break;
|
|
1909
|
+
message.isIncluded = reader.bool();
|
|
1910
|
+
continue;
|
|
1911
|
+
}
|
|
1912
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1913
|
+
reader.skip(tag & 7);
|
|
1914
|
+
}
|
|
1915
|
+
return message;
|
|
1916
|
+
},
|
|
1917
|
+
fromJSON(object) {
|
|
1918
|
+
return {
|
|
1919
|
+
unit: isSet$1(object.unit) ? globalThis.String(object.unit) : "",
|
|
1920
|
+
materialization: isSet$1(object.materialization) ? globalThis.String(object.materialization) : "",
|
|
1921
|
+
isIncluded: isSet$1(object.isIncluded) ? globalThis.Boolean(object.isIncluded) : false
|
|
1922
|
+
};
|
|
1923
|
+
},
|
|
1924
|
+
toJSON(message) {
|
|
1925
|
+
const obj = {};
|
|
1926
|
+
if (message.unit !== "") obj.unit = message.unit;
|
|
1927
|
+
if (message.materialization !== "") obj.materialization = message.materialization;
|
|
1928
|
+
if (message.isIncluded !== false) obj.isIncluded = message.isIncluded;
|
|
1929
|
+
return obj;
|
|
1930
|
+
},
|
|
1931
|
+
create(base) {
|
|
1932
|
+
return InclusionData.fromPartial(base ?? {});
|
|
1933
|
+
},
|
|
1934
|
+
fromPartial(object) {
|
|
1935
|
+
const message = createBaseInclusionData();
|
|
1936
|
+
message.unit = object.unit ?? "";
|
|
1937
|
+
message.materialization = object.materialization ?? "";
|
|
1938
|
+
message.isIncluded = object.isIncluded ?? false;
|
|
1939
|
+
return message;
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
function createBaseReadResult() {
|
|
1943
|
+
return {
|
|
1944
|
+
variantResult: void 0,
|
|
1945
|
+
inclusionResult: void 0
|
|
1946
|
+
};
|
|
1947
|
+
}
|
|
1948
|
+
const ReadResult = {
|
|
1949
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1950
|
+
if (message.variantResult !== void 0) VariantData.encode(message.variantResult, writer.uint32(10).fork()).join();
|
|
1951
|
+
if (message.inclusionResult !== void 0) InclusionData.encode(message.inclusionResult, writer.uint32(18).fork()).join();
|
|
1952
|
+
return writer;
|
|
1953
|
+
},
|
|
1954
|
+
decode(input, length) {
|
|
1955
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1956
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1957
|
+
const message = createBaseReadResult();
|
|
1958
|
+
while (reader.pos < end) {
|
|
1959
|
+
const tag = reader.uint32();
|
|
1960
|
+
switch (tag >>> 3) {
|
|
1961
|
+
case 1:
|
|
1962
|
+
if (tag !== 10) break;
|
|
1963
|
+
message.variantResult = VariantData.decode(reader, reader.uint32());
|
|
1964
|
+
continue;
|
|
1965
|
+
case 2:
|
|
1966
|
+
if (tag !== 18) break;
|
|
1967
|
+
message.inclusionResult = InclusionData.decode(reader, reader.uint32());
|
|
1968
|
+
continue;
|
|
1969
|
+
}
|
|
1970
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1971
|
+
reader.skip(tag & 7);
|
|
1972
|
+
}
|
|
1973
|
+
return message;
|
|
1974
|
+
},
|
|
1975
|
+
fromJSON(object) {
|
|
1976
|
+
return {
|
|
1977
|
+
variantResult: isSet$1(object.variantResult) ? VariantData.fromJSON(object.variantResult) : void 0,
|
|
1978
|
+
inclusionResult: isSet$1(object.inclusionResult) ? InclusionData.fromJSON(object.inclusionResult) : void 0
|
|
1979
|
+
};
|
|
1980
|
+
},
|
|
1981
|
+
toJSON(message) {
|
|
1982
|
+
const obj = {};
|
|
1983
|
+
if (message.variantResult !== void 0) obj.variantResult = VariantData.toJSON(message.variantResult);
|
|
1984
|
+
if (message.inclusionResult !== void 0) obj.inclusionResult = InclusionData.toJSON(message.inclusionResult);
|
|
1985
|
+
return obj;
|
|
1986
|
+
},
|
|
1987
|
+
create(base) {
|
|
1988
|
+
return ReadResult.fromPartial(base ?? {});
|
|
1989
|
+
},
|
|
1990
|
+
fromPartial(object) {
|
|
1991
|
+
const message = createBaseReadResult();
|
|
1992
|
+
message.variantResult = object.variantResult !== void 0 && object.variantResult !== null ? VariantData.fromPartial(object.variantResult) : void 0;
|
|
1993
|
+
message.inclusionResult = object.inclusionResult !== void 0 && object.inclusionResult !== null ? InclusionData.fromPartial(object.inclusionResult) : void 0;
|
|
1994
|
+
return message;
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
function createBaseReadOperationsResult() {
|
|
1998
|
+
return { results: [] };
|
|
1999
|
+
}
|
|
2000
|
+
const ReadOperationsResult = {
|
|
2001
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2002
|
+
for (const v of message.results) ReadResult.encode(v, writer.uint32(10).fork()).join();
|
|
2003
|
+
return writer;
|
|
2004
|
+
},
|
|
2005
|
+
decode(input, length) {
|
|
2006
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2007
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
2008
|
+
const message = createBaseReadOperationsResult();
|
|
2009
|
+
while (reader.pos < end) {
|
|
2010
|
+
const tag = reader.uint32();
|
|
2011
|
+
switch (tag >>> 3) {
|
|
2012
|
+
case 1:
|
|
2013
|
+
if (tag !== 10) break;
|
|
2014
|
+
message.results.push(ReadResult.decode(reader, reader.uint32()));
|
|
2015
|
+
continue;
|
|
2016
|
+
}
|
|
2017
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
2018
|
+
reader.skip(tag & 7);
|
|
2019
|
+
}
|
|
2020
|
+
return message;
|
|
2021
|
+
},
|
|
2022
|
+
fromJSON(object) {
|
|
2023
|
+
return { results: globalThis.Array.isArray(object?.results) ? object.results.map((e) => ReadResult.fromJSON(e)) : [] };
|
|
2024
|
+
},
|
|
2025
|
+
toJSON(message) {
|
|
2026
|
+
const obj = {};
|
|
2027
|
+
if (message.results?.length) obj.results = message.results.map((e) => ReadResult.toJSON(e));
|
|
2028
|
+
return obj;
|
|
2029
|
+
},
|
|
2030
|
+
create(base) {
|
|
2031
|
+
return ReadOperationsResult.fromPartial(base ?? {});
|
|
2032
|
+
},
|
|
2033
|
+
fromPartial(object) {
|
|
2034
|
+
const message = createBaseReadOperationsResult();
|
|
2035
|
+
message.results = object.results?.map((e) => ReadResult.fromPartial(e)) || [];
|
|
2036
|
+
return message;
|
|
2037
|
+
}
|
|
2038
|
+
};
|
|
2039
|
+
function isSet$1(value) {
|
|
2040
|
+
return value !== null && value !== void 0;
|
|
1470
2041
|
}
|
|
1471
|
-
|
|
1472
|
-
|
|
2042
|
+
var ConfidenceRemoteMaterializationStore = class {
|
|
2043
|
+
constructor(flagClientSecret, fetch$1 = globalThis.fetch, signal) {
|
|
2044
|
+
this.flagClientSecret = flagClientSecret;
|
|
2045
|
+
this.fetch = fetch$1;
|
|
2046
|
+
this.signal = signal;
|
|
2047
|
+
}
|
|
2048
|
+
async readMaterializations(readOps) {
|
|
2049
|
+
const response = await this.fetch("https://resolver.confidence.dev/v1/materialization:readMaterializedOperations", {
|
|
2050
|
+
method: "post",
|
|
2051
|
+
signal: this.signal,
|
|
2052
|
+
headers: {
|
|
2053
|
+
"Content-Type": "application/x-protobuf",
|
|
2054
|
+
Authorization: `ClientSecret ${this.flagClientSecret}`
|
|
2055
|
+
},
|
|
2056
|
+
body: ReadOperationsRequest.encode(readOpsToProto(readOps)).finish()
|
|
2057
|
+
});
|
|
2058
|
+
if (!response.ok) throw new Error(`Failed to read materializations: ${response.status} ${response.statusText}`);
|
|
2059
|
+
return readResultFromProto(ReadOperationsResult.decode(new Uint8Array(await response.arrayBuffer())));
|
|
2060
|
+
}
|
|
2061
|
+
async writeMaterializations(writeOps) {
|
|
2062
|
+
const response = await this.fetch("https://resolver.confidence.dev/v1/materialization:writeMaterializedOperations", {
|
|
2063
|
+
method: "post",
|
|
2064
|
+
signal: this.signal,
|
|
2065
|
+
headers: {
|
|
2066
|
+
"Content-Type": "application/x-protobuf",
|
|
2067
|
+
Authorization: `ClientSecret ${this.flagClientSecret}`
|
|
2068
|
+
},
|
|
2069
|
+
body: WriteOperationsRequest.encode(writeOpsToProto(writeOps)).finish()
|
|
2070
|
+
});
|
|
2071
|
+
if (!response.ok) throw new Error(`Failed to write materializations: ${response.status} ${response.statusText}`);
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
function readOpsToProto(readOps) {
|
|
2075
|
+
return { ops: readOps.flatMap((readOp) => {
|
|
2076
|
+
switch (readOp.op) {
|
|
2077
|
+
case "inclusion": return [ReadOp.create({ inclusionReadOp: {
|
|
2078
|
+
unit: readOp.unit,
|
|
2079
|
+
materialization: readOp.materialization
|
|
2080
|
+
} })];
|
|
2081
|
+
case "variant": return [ReadOp.create({ variantReadOp: {
|
|
2082
|
+
unit: readOp.unit,
|
|
2083
|
+
materialization: readOp.materialization,
|
|
2084
|
+
rule: readOp.rule
|
|
2085
|
+
} })];
|
|
2086
|
+
}
|
|
2087
|
+
return [];
|
|
2088
|
+
}) };
|
|
1473
2089
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
2090
|
+
function readOpsFromProto(readOpReq) {
|
|
2091
|
+
return readOpReq.ops.flatMap(({ variantReadOp, inclusionReadOp }) => {
|
|
2092
|
+
if (variantReadOp) return [{
|
|
2093
|
+
op: "variant",
|
|
2094
|
+
unit: variantReadOp.unit,
|
|
2095
|
+
materialization: variantReadOp.materialization,
|
|
2096
|
+
rule: variantReadOp.rule
|
|
2097
|
+
}];
|
|
2098
|
+
if (inclusionReadOp) return [{
|
|
2099
|
+
op: "inclusion",
|
|
2100
|
+
unit: inclusionReadOp.unit,
|
|
2101
|
+
materialization: inclusionReadOp.materialization
|
|
2102
|
+
}];
|
|
2103
|
+
return [];
|
|
2104
|
+
});
|
|
1483
2105
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
2106
|
+
function readResultFromProto(result) {
|
|
2107
|
+
return result.results.flatMap(({ inclusionResult, variantResult }) => {
|
|
2108
|
+
if (inclusionResult) return [{
|
|
2109
|
+
op: "inclusion",
|
|
2110
|
+
unit: inclusionResult.unit,
|
|
2111
|
+
materialization: inclusionResult.materialization,
|
|
2112
|
+
included: inclusionResult.isIncluded
|
|
2113
|
+
}];
|
|
2114
|
+
if (variantResult) return [{
|
|
2115
|
+
op: "variant",
|
|
2116
|
+
unit: variantResult.unit,
|
|
2117
|
+
materialization: variantResult.materialization,
|
|
2118
|
+
rule: variantResult.rule,
|
|
2119
|
+
variant: variantResult.variant
|
|
2120
|
+
}];
|
|
2121
|
+
return [];
|
|
2122
|
+
});
|
|
1490
2123
|
}
|
|
1491
|
-
function
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
2124
|
+
function readResultToProto(readResults) {
|
|
2125
|
+
return { results: readResults.flatMap((readResult) => {
|
|
2126
|
+
switch (readResult.op) {
|
|
2127
|
+
case "inclusion": return [{ inclusionResult: {
|
|
2128
|
+
unit: readResult.unit,
|
|
2129
|
+
materialization: readResult.materialization,
|
|
2130
|
+
isIncluded: readResult.included
|
|
2131
|
+
} }];
|
|
2132
|
+
case "variant": return [{ variantResult: {
|
|
2133
|
+
unit: readResult.unit,
|
|
2134
|
+
materialization: readResult.materialization,
|
|
2135
|
+
rule: readResult.rule,
|
|
2136
|
+
variant: readResult.variant ?? ""
|
|
2137
|
+
} }];
|
|
2138
|
+
}
|
|
2139
|
+
return [];
|
|
2140
|
+
}) };
|
|
1497
2141
|
}
|
|
1498
|
-
function
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
2142
|
+
function writeOpsToProto(writeOps) {
|
|
2143
|
+
return { storeVariantOp: writeOps.flatMap((writeOp) => {
|
|
2144
|
+
switch (writeOp.op) {
|
|
2145
|
+
case "variant": return [{
|
|
2146
|
+
unit: writeOp.unit,
|
|
2147
|
+
materialization: writeOp.materialization,
|
|
2148
|
+
rule: writeOp.rule,
|
|
2149
|
+
variant: writeOp.variant
|
|
2150
|
+
}];
|
|
2151
|
+
}
|
|
2152
|
+
return [];
|
|
2153
|
+
}) };
|
|
1502
2154
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
2155
|
+
function writeOpsFromProto(writeOpsReq) {
|
|
2156
|
+
return writeOpsReq.storeVariantOp.map((variantData) => {
|
|
2157
|
+
return {
|
|
2158
|
+
op: "variant",
|
|
2159
|
+
unit: variantData.unit,
|
|
2160
|
+
materialization: variantData.materialization,
|
|
2161
|
+
rule: variantData.rule,
|
|
2162
|
+
variant: variantData.variant
|
|
2163
|
+
};
|
|
2164
|
+
});
|
|
1507
2165
|
}
|
|
1508
2166
|
const logger$1 = getLogger("provider");
|
|
1509
2167
|
const DEFAULT_STATE_INTERVAL = 3e4;
|
|
@@ -1514,6 +2172,7 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1514
2172
|
main = new AbortController();
|
|
1515
2173
|
fetch;
|
|
1516
2174
|
flushInterval;
|
|
2175
|
+
materializationStore;
|
|
1517
2176
|
stateEtag = null;
|
|
1518
2177
|
constructor(resolver$1, options) {
|
|
1519
2178
|
this.resolver = resolver$1;
|
|
@@ -1526,10 +2185,14 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1526
2185
|
maxInterval: DEFAULT_STATE_INTERVAL
|
|
1527
2186
|
}), withStallTimeout(500)],
|
|
1528
2187
|
"https://resolver.confidence.dev/*": [withRouter({
|
|
1529
|
-
"*/v1/
|
|
2188
|
+
"*/v1/materialization:readMaterializedOperations": [withRetry({
|
|
2189
|
+
maxAttempts: 3,
|
|
2190
|
+
baseInterval: 100
|
|
2191
|
+
}), withTimeout(.5 * TimeUnit.SECOND)],
|
|
2192
|
+
"*/v1/materialization:writeMaterializedOperations": [withRetry({
|
|
1530
2193
|
maxAttempts: 3,
|
|
1531
2194
|
baseInterval: 100
|
|
1532
|
-
}), withTimeout(
|
|
2195
|
+
}), withTimeout(.5 * TimeUnit.SECOND)],
|
|
1533
2196
|
"*/v1/clientFlagLogs:write": [withRetry({
|
|
1534
2197
|
maxAttempts: 3,
|
|
1535
2198
|
baseInterval: 500
|
|
@@ -1539,6 +2202,9 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1539
2202
|
throw new Error(`Unknown route ${url}`);
|
|
1540
2203
|
})]
|
|
1541
2204
|
}), withLogging()], options.fetch ?? fetch);
|
|
2205
|
+
if (options.materializationStore) if (options.materializationStore === "CONFIDENCE_REMOTE_STORE") this.materializationStore = new ConfidenceRemoteMaterializationStore(options.flagClientSecret, this.fetch, this.main.signal);
|
|
2206
|
+
else this.materializationStore = options.materializationStore;
|
|
2207
|
+
else this.materializationStore = null;
|
|
1542
2208
|
}
|
|
1543
2209
|
async initialize(context) {
|
|
1544
2210
|
const signal = this.main.signal;
|
|
@@ -1561,51 +2227,56 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1561
2227
|
this.main.abort();
|
|
1562
2228
|
}
|
|
1563
2229
|
async evaluate(flagKey, defaultValue, context) {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
2230
|
+
try {
|
|
2231
|
+
const [flagName, ...path] = flagKey.split(".");
|
|
2232
|
+
const stickyRequest = {
|
|
2233
|
+
resolveRequest: {
|
|
2234
|
+
flags: [`flags/${flagName}`],
|
|
2235
|
+
evaluationContext: ConfidenceServerProviderLocal.convertEvaluationContext(context),
|
|
2236
|
+
apply: true,
|
|
2237
|
+
clientSecret: this.options.flagClientSecret,
|
|
2238
|
+
sdk: {
|
|
2239
|
+
id: SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER,
|
|
2240
|
+
version: VERSION
|
|
2241
|
+
}
|
|
2242
|
+
},
|
|
2243
|
+
materializations: [],
|
|
2244
|
+
failFastOnSticky: false,
|
|
2245
|
+
notProcessSticky: false
|
|
2246
|
+
};
|
|
2247
|
+
const response = await this.resolveWithSticky(stickyRequest);
|
|
2248
|
+
return this.extractValue(response.resolvedFlags[0], flagName, path, defaultValue);
|
|
2249
|
+
} catch (e) {
|
|
2250
|
+
logger$1.warn(`Flag evaluation for '${flagKey}' failed`, e);
|
|
2251
|
+
return {
|
|
2252
|
+
value: defaultValue,
|
|
2253
|
+
reason: "ERROR",
|
|
2254
|
+
errorCode: castStringToEnum("GENERAL"),
|
|
2255
|
+
errorMessage: String(e)
|
|
2256
|
+
};
|
|
2257
|
+
} finally {
|
|
1587
2258
|
this.flushAssigned();
|
|
1588
|
-
const { response: flagsResponse } = response.success;
|
|
1589
|
-
return flagsResponse;
|
|
1590
2259
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
2260
|
+
}
|
|
2261
|
+
async resolveWithSticky(stickyRequest) {
|
|
2262
|
+
let stickyResponse = this.resolver.resolveWithSticky(stickyRequest);
|
|
2263
|
+
if (stickyResponse.readOpsRequest) {
|
|
2264
|
+
const { results: materializations } = await this.readMaterializations(stickyResponse.readOpsRequest);
|
|
2265
|
+
stickyResponse = this.resolver.resolveWithSticky({
|
|
2266
|
+
...stickyRequest,
|
|
2267
|
+
materializations
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
if (!stickyResponse.success) throw new Error("Missing materializations");
|
|
2271
|
+
const { materializationUpdates: storeVariantOp, response: resolveResponse } = stickyResponse.success;
|
|
2272
|
+
if (storeVariantOp.length) this.writeMaterializations({ storeVariantOp });
|
|
2273
|
+
return ResolveFlagsResponse.create(resolveResponse);
|
|
1603
2274
|
}
|
|
1604
2275
|
extractValue(flag, flagName, path, defaultValue) {
|
|
1605
2276
|
if (!flag) return {
|
|
1606
2277
|
value: defaultValue,
|
|
1607
2278
|
reason: "ERROR",
|
|
1608
|
-
errorCode: "FLAG_NOT_FOUND"
|
|
2279
|
+
errorCode: castStringToEnum("FLAG_NOT_FOUND")
|
|
1609
2280
|
};
|
|
1610
2281
|
if (flag.reason !== ResolveReason.RESOLVE_REASON_MATCH) return {
|
|
1611
2282
|
value: defaultValue,
|
|
@@ -1616,14 +2287,14 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1616
2287
|
if (typeof value !== "object" || value === null || !hasKey(value, step)) return {
|
|
1617
2288
|
value: defaultValue,
|
|
1618
2289
|
reason: "ERROR",
|
|
1619
|
-
errorCode: "TYPE_MISMATCH"
|
|
2290
|
+
errorCode: castStringToEnum("TYPE_MISMATCH")
|
|
1620
2291
|
};
|
|
1621
2292
|
value = value[step];
|
|
1622
2293
|
}
|
|
1623
2294
|
if (!isAssignableTo(value, defaultValue)) return {
|
|
1624
2295
|
value: defaultValue,
|
|
1625
2296
|
reason: "ERROR",
|
|
1626
|
-
errorCode: "TYPE_MISMATCH"
|
|
2297
|
+
errorCode: castStringToEnum("TYPE_MISMATCH")
|
|
1627
2298
|
};
|
|
1628
2299
|
return {
|
|
1629
2300
|
value,
|
|
@@ -1643,7 +2314,7 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1643
2314
|
if (!resp.ok) throw new Error(`Failed to fetch state: ${resp.status} ${resp.statusText}`);
|
|
1644
2315
|
this.stateEtag = resp.headers.get("etag");
|
|
1645
2316
|
const bytes = new Uint8Array(await resp.arrayBuffer());
|
|
1646
|
-
const { SetResolverStateRequest: SetResolverStateRequest$1 } = await import("./messages-
|
|
2317
|
+
const { SetResolverStateRequest: SetResolverStateRequest$1 } = await import("./messages-BjOGSPNo.js");
|
|
1647
2318
|
this.resolver.setResolverState(SetResolverStateRequest$1.decode(bytes));
|
|
1648
2319
|
}
|
|
1649
2320
|
async flush(signal) {
|
|
@@ -1671,6 +2342,24 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1671
2342
|
throw err;
|
|
1672
2343
|
}
|
|
1673
2344
|
}
|
|
2345
|
+
async readMaterializations(readOpsReq) {
|
|
2346
|
+
const materializationStore = this.materializationStore;
|
|
2347
|
+
if (materializationStore && typeof materializationStore.readMaterializations === "function") {
|
|
2348
|
+
const result = await materializationStore.readMaterializations(readOpsFromProto(readOpsReq));
|
|
2349
|
+
return readResultToProto(result);
|
|
2350
|
+
}
|
|
2351
|
+
throw new Error("Read materialization not supported");
|
|
2352
|
+
}
|
|
2353
|
+
writeMaterializations(writeOpsRequest) {
|
|
2354
|
+
const materializationStore = this.materializationStore;
|
|
2355
|
+
if (materializationStore && typeof materializationStore.writeMaterializations === "function") {
|
|
2356
|
+
materializationStore.writeMaterializations(writeOpsFromProto(writeOpsRequest)).catch((e) => {
|
|
2357
|
+
logger$1.warn("Failed to write materialization", e);
|
|
2358
|
+
});
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
throw new Error("Write materialization not supported");
|
|
2362
|
+
}
|
|
1674
2363
|
static convertReason(reason) {
|
|
1675
2364
|
switch (reason) {
|
|
1676
2365
|
case ResolveReason.RESOLVE_REASON_ERROR: return "ERROR";
|
|
@@ -1701,9 +2390,6 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
1701
2390
|
return Promise.resolve(this.evaluate(flagKey, defaultValue, context));
|
|
1702
2391
|
}
|
|
1703
2392
|
};
|
|
1704
|
-
function hasKey(obj, key) {
|
|
1705
|
-
return key in obj;
|
|
1706
|
-
}
|
|
1707
2393
|
function isAssignableTo(value, schema) {
|
|
1708
2394
|
if (typeof schema !== typeof value) return false;
|
|
1709
2395
|
if (typeof value === "object" && typeof schema === "object") {
|
|
@@ -1720,6 +2406,192 @@ function isAssignableTo(value, schema) {
|
|
|
1720
2406
|
}
|
|
1721
2407
|
return true;
|
|
1722
2408
|
}
|
|
2409
|
+
function createBaseResolveWithStickyRequest() {
|
|
2410
|
+
return {
|
|
2411
|
+
resolveRequest: void 0,
|
|
2412
|
+
failFastOnSticky: false,
|
|
2413
|
+
notProcessSticky: false,
|
|
2414
|
+
materializations: []
|
|
2415
|
+
};
|
|
2416
|
+
}
|
|
2417
|
+
const ResolveWithStickyRequest = {
|
|
2418
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2419
|
+
if (message.resolveRequest !== void 0) ResolveFlagsRequest.encode(message.resolveRequest, writer.uint32(10).fork()).join();
|
|
2420
|
+
if (message.failFastOnSticky !== false) writer.uint32(24).bool(message.failFastOnSticky);
|
|
2421
|
+
if (message.notProcessSticky !== false) writer.uint32(32).bool(message.notProcessSticky);
|
|
2422
|
+
for (const v of message.materializations) ReadResult.encode(v, writer.uint32(42).fork()).join();
|
|
2423
|
+
return writer;
|
|
2424
|
+
},
|
|
2425
|
+
decode(input, length) {
|
|
2426
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2427
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
2428
|
+
const message = createBaseResolveWithStickyRequest();
|
|
2429
|
+
while (reader.pos < end) {
|
|
2430
|
+
const tag = reader.uint32();
|
|
2431
|
+
switch (tag >>> 3) {
|
|
2432
|
+
case 1:
|
|
2433
|
+
if (tag !== 10) break;
|
|
2434
|
+
message.resolveRequest = ResolveFlagsRequest.decode(reader, reader.uint32());
|
|
2435
|
+
continue;
|
|
2436
|
+
case 3:
|
|
2437
|
+
if (tag !== 24) break;
|
|
2438
|
+
message.failFastOnSticky = reader.bool();
|
|
2439
|
+
continue;
|
|
2440
|
+
case 4:
|
|
2441
|
+
if (tag !== 32) break;
|
|
2442
|
+
message.notProcessSticky = reader.bool();
|
|
2443
|
+
continue;
|
|
2444
|
+
case 5:
|
|
2445
|
+
if (tag !== 42) break;
|
|
2446
|
+
message.materializations.push(ReadResult.decode(reader, reader.uint32()));
|
|
2447
|
+
continue;
|
|
2448
|
+
}
|
|
2449
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
2450
|
+
reader.skip(tag & 7);
|
|
2451
|
+
}
|
|
2452
|
+
return message;
|
|
2453
|
+
},
|
|
2454
|
+
fromJSON(object) {
|
|
2455
|
+
return {
|
|
2456
|
+
resolveRequest: isSet(object.resolveRequest) ? ResolveFlagsRequest.fromJSON(object.resolveRequest) : void 0,
|
|
2457
|
+
failFastOnSticky: isSet(object.failFastOnSticky) ? globalThis.Boolean(object.failFastOnSticky) : false,
|
|
2458
|
+
notProcessSticky: isSet(object.notProcessSticky) ? globalThis.Boolean(object.notProcessSticky) : false,
|
|
2459
|
+
materializations: globalThis.Array.isArray(object?.materializations) ? object.materializations.map((e) => ReadResult.fromJSON(e)) : []
|
|
2460
|
+
};
|
|
2461
|
+
},
|
|
2462
|
+
toJSON(message) {
|
|
2463
|
+
const obj = {};
|
|
2464
|
+
if (message.resolveRequest !== void 0) obj.resolveRequest = ResolveFlagsRequest.toJSON(message.resolveRequest);
|
|
2465
|
+
if (message.failFastOnSticky !== false) obj.failFastOnSticky = message.failFastOnSticky;
|
|
2466
|
+
if (message.notProcessSticky !== false) obj.notProcessSticky = message.notProcessSticky;
|
|
2467
|
+
if (message.materializations?.length) obj.materializations = message.materializations.map((e) => ReadResult.toJSON(e));
|
|
2468
|
+
return obj;
|
|
2469
|
+
},
|
|
2470
|
+
create(base) {
|
|
2471
|
+
return ResolveWithStickyRequest.fromPartial(base ?? {});
|
|
2472
|
+
},
|
|
2473
|
+
fromPartial(object) {
|
|
2474
|
+
const message = createBaseResolveWithStickyRequest();
|
|
2475
|
+
message.resolveRequest = object.resolveRequest !== void 0 && object.resolveRequest !== null ? ResolveFlagsRequest.fromPartial(object.resolveRequest) : void 0;
|
|
2476
|
+
message.failFastOnSticky = object.failFastOnSticky ?? false;
|
|
2477
|
+
message.notProcessSticky = object.notProcessSticky ?? false;
|
|
2478
|
+
message.materializations = object.materializations?.map((e) => ReadResult.fromPartial(e)) || [];
|
|
2479
|
+
return message;
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
function createBaseResolveWithStickyResponse() {
|
|
2483
|
+
return {
|
|
2484
|
+
success: void 0,
|
|
2485
|
+
readOpsRequest: void 0
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
const ResolveWithStickyResponse = {
|
|
2489
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2490
|
+
if (message.success !== void 0) ResolveWithStickyResponse_Success.encode(message.success, writer.uint32(10).fork()).join();
|
|
2491
|
+
if (message.readOpsRequest !== void 0) ReadOperationsRequest.encode(message.readOpsRequest, writer.uint32(26).fork()).join();
|
|
2492
|
+
return writer;
|
|
2493
|
+
},
|
|
2494
|
+
decode(input, length) {
|
|
2495
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2496
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
2497
|
+
const message = createBaseResolveWithStickyResponse();
|
|
2498
|
+
while (reader.pos < end) {
|
|
2499
|
+
const tag = reader.uint32();
|
|
2500
|
+
switch (tag >>> 3) {
|
|
2501
|
+
case 1:
|
|
2502
|
+
if (tag !== 10) break;
|
|
2503
|
+
message.success = ResolveWithStickyResponse_Success.decode(reader, reader.uint32());
|
|
2504
|
+
continue;
|
|
2505
|
+
case 3:
|
|
2506
|
+
if (tag !== 26) break;
|
|
2507
|
+
message.readOpsRequest = ReadOperationsRequest.decode(reader, reader.uint32());
|
|
2508
|
+
continue;
|
|
2509
|
+
}
|
|
2510
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
2511
|
+
reader.skip(tag & 7);
|
|
2512
|
+
}
|
|
2513
|
+
return message;
|
|
2514
|
+
},
|
|
2515
|
+
fromJSON(object) {
|
|
2516
|
+
return {
|
|
2517
|
+
success: isSet(object.success) ? ResolveWithStickyResponse_Success.fromJSON(object.success) : void 0,
|
|
2518
|
+
readOpsRequest: isSet(object.readOpsRequest) ? ReadOperationsRequest.fromJSON(object.readOpsRequest) : void 0
|
|
2519
|
+
};
|
|
2520
|
+
},
|
|
2521
|
+
toJSON(message) {
|
|
2522
|
+
const obj = {};
|
|
2523
|
+
if (message.success !== void 0) obj.success = ResolveWithStickyResponse_Success.toJSON(message.success);
|
|
2524
|
+
if (message.readOpsRequest !== void 0) obj.readOpsRequest = ReadOperationsRequest.toJSON(message.readOpsRequest);
|
|
2525
|
+
return obj;
|
|
2526
|
+
},
|
|
2527
|
+
create(base) {
|
|
2528
|
+
return ResolveWithStickyResponse.fromPartial(base ?? {});
|
|
2529
|
+
},
|
|
2530
|
+
fromPartial(object) {
|
|
2531
|
+
const message = createBaseResolveWithStickyResponse();
|
|
2532
|
+
message.success = object.success !== void 0 && object.success !== null ? ResolveWithStickyResponse_Success.fromPartial(object.success) : void 0;
|
|
2533
|
+
message.readOpsRequest = object.readOpsRequest !== void 0 && object.readOpsRequest !== null ? ReadOperationsRequest.fromPartial(object.readOpsRequest) : void 0;
|
|
2534
|
+
return message;
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
function createBaseResolveWithStickyResponse_Success() {
|
|
2538
|
+
return {
|
|
2539
|
+
response: void 0,
|
|
2540
|
+
materializationUpdates: []
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
const ResolveWithStickyResponse_Success = {
|
|
2544
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2545
|
+
if (message.response !== void 0) ResolveFlagsResponse.encode(message.response, writer.uint32(10).fork()).join();
|
|
2546
|
+
for (const v of message.materializationUpdates) VariantData.encode(v, writer.uint32(26).fork()).join();
|
|
2547
|
+
return writer;
|
|
2548
|
+
},
|
|
2549
|
+
decode(input, length) {
|
|
2550
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2551
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
2552
|
+
const message = createBaseResolveWithStickyResponse_Success();
|
|
2553
|
+
while (reader.pos < end) {
|
|
2554
|
+
const tag = reader.uint32();
|
|
2555
|
+
switch (tag >>> 3) {
|
|
2556
|
+
case 1:
|
|
2557
|
+
if (tag !== 10) break;
|
|
2558
|
+
message.response = ResolveFlagsResponse.decode(reader, reader.uint32());
|
|
2559
|
+
continue;
|
|
2560
|
+
case 3:
|
|
2561
|
+
if (tag !== 26) break;
|
|
2562
|
+
message.materializationUpdates.push(VariantData.decode(reader, reader.uint32()));
|
|
2563
|
+
continue;
|
|
2564
|
+
}
|
|
2565
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
2566
|
+
reader.skip(tag & 7);
|
|
2567
|
+
}
|
|
2568
|
+
return message;
|
|
2569
|
+
},
|
|
2570
|
+
fromJSON(object) {
|
|
2571
|
+
return {
|
|
2572
|
+
response: isSet(object.response) ? ResolveFlagsResponse.fromJSON(object.response) : void 0,
|
|
2573
|
+
materializationUpdates: globalThis.Array.isArray(object?.materializationUpdates) ? object.materializationUpdates.map((e) => VariantData.fromJSON(e)) : []
|
|
2574
|
+
};
|
|
2575
|
+
},
|
|
2576
|
+
toJSON(message) {
|
|
2577
|
+
const obj = {};
|
|
2578
|
+
if (message.response !== void 0) obj.response = ResolveFlagsResponse.toJSON(message.response);
|
|
2579
|
+
if (message.materializationUpdates?.length) obj.materializationUpdates = message.materializationUpdates.map((e) => VariantData.toJSON(e));
|
|
2580
|
+
return obj;
|
|
2581
|
+
},
|
|
2582
|
+
create(base) {
|
|
2583
|
+
return ResolveWithStickyResponse_Success.fromPartial(base ?? {});
|
|
2584
|
+
},
|
|
2585
|
+
fromPartial(object) {
|
|
2586
|
+
const message = createBaseResolveWithStickyResponse_Success();
|
|
2587
|
+
message.response = object.response !== void 0 && object.response !== null ? ResolveFlagsResponse.fromPartial(object.response) : void 0;
|
|
2588
|
+
message.materializationUpdates = object.materializationUpdates?.map((e) => VariantData.fromPartial(e)) || [];
|
|
2589
|
+
return message;
|
|
2590
|
+
}
|
|
2591
|
+
};
|
|
2592
|
+
function isSet(value) {
|
|
2593
|
+
return value !== null && value !== void 0;
|
|
2594
|
+
}
|
|
1723
2595
|
const logger = getLogger("wasm-resolver");
|
|
1724
2596
|
const EXPORT_FN_NAMES = [
|
|
1725
2597
|
"wasm_msg_alloc",
|