@spotify-confidence/openfeature-server-provider-local 0.5.0 → 0.6.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.
@@ -1,208 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- function createBaseVoid() {
3
- return {};
4
- }
5
- const Void = {
6
- encode(_, writer = new BinaryWriter()) {
7
- return writer;
8
- },
9
- decode(input, length) {
10
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11
- const end = length === void 0 ? reader.len : reader.pos + length;
12
- const message = createBaseVoid();
13
- while (reader.pos < end) {
14
- const tag = reader.uint32();
15
- switch (tag >>> 3) {}
16
- if ((tag & 7) === 4 || tag === 0) break;
17
- reader.skip(tag & 7);
18
- }
19
- return message;
20
- },
21
- fromJSON(_) {
22
- return {};
23
- },
24
- toJSON(_) {
25
- return {};
26
- },
27
- create(base) {
28
- return Void.fromPartial(base ?? {});
29
- },
30
- fromPartial(_) {
31
- return createBaseVoid();
32
- }
33
- };
34
- function createBaseSetResolverStateRequest() {
35
- return {
36
- state: new Uint8Array(0),
37
- accountId: ""
38
- };
39
- }
40
- const SetResolverStateRequest = {
41
- encode(message, writer = new BinaryWriter()) {
42
- if (message.state.length !== 0) writer.uint32(10).bytes(message.state);
43
- if (message.accountId !== "") writer.uint32(18).string(message.accountId);
44
- return writer;
45
- },
46
- decode(input, length) {
47
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
48
- const end = length === void 0 ? reader.len : reader.pos + length;
49
- const message = createBaseSetResolverStateRequest();
50
- while (reader.pos < end) {
51
- const tag = reader.uint32();
52
- switch (tag >>> 3) {
53
- case 1:
54
- if (tag !== 10) break;
55
- message.state = reader.bytes();
56
- continue;
57
- case 2:
58
- if (tag !== 18) break;
59
- message.accountId = reader.string();
60
- continue;
61
- }
62
- if ((tag & 7) === 4 || tag === 0) break;
63
- reader.skip(tag & 7);
64
- }
65
- return message;
66
- },
67
- fromJSON(object) {
68
- return {
69
- state: isSet(object.state) ? bytesFromBase64(object.state) : new Uint8Array(0),
70
- accountId: isSet(object.accountId) ? globalThis.String(object.accountId) : ""
71
- };
72
- },
73
- toJSON(message) {
74
- const obj = {};
75
- if (message.state.length !== 0) obj.state = base64FromBytes(message.state);
76
- if (message.accountId !== "") obj.accountId = message.accountId;
77
- return obj;
78
- },
79
- create(base) {
80
- return SetResolverStateRequest.fromPartial(base ?? {});
81
- },
82
- fromPartial(object) {
83
- const message = createBaseSetResolverStateRequest();
84
- message.state = object.state ?? new Uint8Array(0);
85
- message.accountId = object.accountId ?? "";
86
- return message;
87
- }
88
- };
89
- function createBaseRequest() {
90
- return { data: new Uint8Array(0) };
91
- }
92
- const Request = {
93
- encode(message, writer = new BinaryWriter()) {
94
- if (message.data.length !== 0) writer.uint32(10).bytes(message.data);
95
- return writer;
96
- },
97
- decode(input, length) {
98
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
99
- const end = length === void 0 ? reader.len : reader.pos + length;
100
- const message = createBaseRequest();
101
- while (reader.pos < end) {
102
- const tag = reader.uint32();
103
- switch (tag >>> 3) {
104
- case 1:
105
- if (tag !== 10) break;
106
- message.data = reader.bytes();
107
- continue;
108
- }
109
- if ((tag & 7) === 4 || tag === 0) break;
110
- reader.skip(tag & 7);
111
- }
112
- return message;
113
- },
114
- fromJSON(object) {
115
- return { data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0) };
116
- },
117
- toJSON(message) {
118
- const obj = {};
119
- if (message.data.length !== 0) obj.data = base64FromBytes(message.data);
120
- return obj;
121
- },
122
- create(base) {
123
- return Request.fromPartial(base ?? {});
124
- },
125
- fromPartial(object) {
126
- const message = createBaseRequest();
127
- message.data = object.data ?? new Uint8Array(0);
128
- return message;
129
- }
130
- };
131
- function createBaseResponse() {
132
- return {
133
- data: void 0,
134
- error: void 0
135
- };
136
- }
137
- const Response = {
138
- encode(message, writer = new BinaryWriter()) {
139
- if (message.data !== void 0) writer.uint32(10).bytes(message.data);
140
- if (message.error !== void 0) writer.uint32(18).string(message.error);
141
- return writer;
142
- },
143
- decode(input, length) {
144
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
145
- const end = length === void 0 ? reader.len : reader.pos + length;
146
- const message = createBaseResponse();
147
- while (reader.pos < end) {
148
- const tag = reader.uint32();
149
- switch (tag >>> 3) {
150
- case 1:
151
- if (tag !== 10) break;
152
- message.data = reader.bytes();
153
- continue;
154
- case 2:
155
- if (tag !== 18) break;
156
- message.error = reader.string();
157
- continue;
158
- }
159
- if ((tag & 7) === 4 || tag === 0) break;
160
- reader.skip(tag & 7);
161
- }
162
- return message;
163
- },
164
- fromJSON(object) {
165
- return {
166
- data: isSet(object.data) ? bytesFromBase64(object.data) : void 0,
167
- error: isSet(object.error) ? globalThis.String(object.error) : void 0
168
- };
169
- },
170
- toJSON(message) {
171
- const obj = {};
172
- if (message.data !== void 0) obj.data = base64FromBytes(message.data);
173
- if (message.error !== void 0) obj.error = message.error;
174
- return obj;
175
- },
176
- create(base) {
177
- return Response.fromPartial(base ?? {});
178
- },
179
- fromPartial(object) {
180
- const message = createBaseResponse();
181
- message.data = object.data ?? void 0;
182
- message.error = object.error ?? void 0;
183
- return message;
184
- }
185
- };
186
- function bytesFromBase64(b64) {
187
- if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
188
- else {
189
- const bin = globalThis.atob(b64);
190
- const arr = new Uint8Array(bin.length);
191
- for (let i = 0; i < bin.length; ++i) arr[i] = bin.charCodeAt(i);
192
- return arr;
193
- }
194
- }
195
- function base64FromBytes(arr) {
196
- if (globalThis.Buffer) return globalThis.Buffer.from(arr).toString("base64");
197
- else {
198
- const bin = [];
199
- arr.forEach((byte) => {
200
- bin.push(globalThis.String.fromCharCode(byte));
201
- });
202
- return globalThis.btoa(bin.join(""));
203
- }
204
- }
205
- function isSet(value) {
206
- return value !== null && value !== void 0;
207
- }
208
- export { Request, Response, SetResolverStateRequest, Void };