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