@openfeature/flagd-provider 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +59 -1793
- package/index.js +38 -1772
- package/package.json +5 -11
- package/{index.d.ts → src/index.d.ts} +0 -0
- package/{lib → src/lib}/configuration.d.ts +1 -1
- package/{lib → src/lib}/flagd-provider.d.ts +0 -0
- package/{lib → src/lib}/service/grpc/service.d.ts +0 -0
- package/{lib → src/lib}/service/service.d.ts +0 -0
- package/{proto → src/proto}/ts/google/protobuf/struct.d.ts +0 -0
- package/{proto → src/proto}/ts/schema/v1/schema.client.d.ts +9 -5
- package/{proto → src/proto}/ts/schema/v1/schema.d.ts +96 -0
- package/proto/ts/google/protobuf/empty.d.ts +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfeature/flagd-provider",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi",
|
|
@@ -11,16 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"module": "./index.js",
|
|
13
13
|
"main": "./index.cjs",
|
|
14
|
-
"types": "./index.d.ts",
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"types": "./index.d.ts",
|
|
18
|
-
"import": "./index.js",
|
|
19
|
-
"require": "./index.cjs"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
14
|
+
"types": "./src/index.d.ts",
|
|
22
15
|
"dependencies": {
|
|
23
|
-
"@protobuf-ts/grpc-transport": "2.
|
|
24
|
-
"@
|
|
16
|
+
"@protobuf-ts/grpc-transport": "2.8.2",
|
|
17
|
+
"@protobuf-ts/runtime-rpc": "2.8.2",
|
|
18
|
+
"@grpc/grpc-js": "1.8.0"
|
|
25
19
|
}
|
|
26
20
|
}
|
|
File without changes
|
|
@@ -24,7 +24,7 @@ export interface Config {
|
|
|
24
24
|
*/
|
|
25
25
|
socketPath?: string;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type FlagdProviderOptions = Partial<Config>;
|
|
28
28
|
export declare function getConfig(options?: FlagdProviderOptions): {
|
|
29
29
|
host: string;
|
|
30
30
|
port: number;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
2
2
|
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
3
3
|
import type { EventStreamResponse } from "./schema";
|
|
4
|
-
import type {
|
|
4
|
+
import type { EventStreamRequest } from "./schema";
|
|
5
5
|
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
|
6
6
|
import type { ResolveObjectResponse } from "./schema";
|
|
7
7
|
import type { ResolveObjectRequest } from "./schema";
|
|
@@ -16,6 +16,8 @@ import type { ResolveBooleanRequest } from "./schema";
|
|
|
16
16
|
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
17
17
|
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
|
18
18
|
/**
|
|
19
|
+
* Service defines the exposed rpcs of flagd
|
|
20
|
+
*
|
|
19
21
|
* @generated from protobuf service schema.v1.Service
|
|
20
22
|
*/
|
|
21
23
|
export interface IServiceClient {
|
|
@@ -40,11 +42,13 @@ export interface IServiceClient {
|
|
|
40
42
|
*/
|
|
41
43
|
resolveObject(input: ResolveObjectRequest, options?: RpcOptions): UnaryCall<ResolveObjectRequest, ResolveObjectResponse>;
|
|
42
44
|
/**
|
|
43
|
-
* @generated from protobuf rpc: EventStream(
|
|
45
|
+
* @generated from protobuf rpc: EventStream(schema.v1.EventStreamRequest) returns (stream schema.v1.EventStreamResponse);
|
|
44
46
|
*/
|
|
45
|
-
eventStream(input:
|
|
47
|
+
eventStream(input: EventStreamRequest, options?: RpcOptions): ServerStreamingCall<EventStreamRequest, EventStreamResponse>;
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
50
|
+
* Service defines the exposed rpcs of flagd
|
|
51
|
+
*
|
|
48
52
|
* @generated from protobuf service schema.v1.Service
|
|
49
53
|
*/
|
|
50
54
|
export declare class ServiceClient implements IServiceClient, ServiceInfo {
|
|
@@ -76,7 +80,7 @@ export declare class ServiceClient implements IServiceClient, ServiceInfo {
|
|
|
76
80
|
*/
|
|
77
81
|
resolveObject(input: ResolveObjectRequest, options?: RpcOptions): UnaryCall<ResolveObjectRequest, ResolveObjectResponse>;
|
|
78
82
|
/**
|
|
79
|
-
* @generated from protobuf rpc: EventStream(
|
|
83
|
+
* @generated from protobuf rpc: EventStream(schema.v1.EventStreamRequest) returns (stream schema.v1.EventStreamResponse);
|
|
80
84
|
*/
|
|
81
|
-
eventStream(input:
|
|
85
|
+
eventStream(input: EventStreamRequest, options?: RpcOptions): ServerStreamingCall<EventStreamRequest, EventStreamResponse>;
|
|
82
86
|
}
|
|
@@ -7,168 +7,254 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
|
7
7
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
8
8
|
import { Struct } from "../../google/protobuf/struct";
|
|
9
9
|
/**
|
|
10
|
+
* Request body for boolean flag evaluation, used by the ResolveBoolean rpc.
|
|
11
|
+
*
|
|
10
12
|
* @generated from protobuf message schema.v1.ResolveBooleanRequest
|
|
11
13
|
*/
|
|
12
14
|
export interface ResolveBooleanRequest {
|
|
13
15
|
/**
|
|
16
|
+
* Flag key of the requested flag.
|
|
17
|
+
*
|
|
14
18
|
* @generated from protobuf field: string flag_key = 1;
|
|
15
19
|
*/
|
|
16
20
|
flagKey: string;
|
|
17
21
|
/**
|
|
22
|
+
* Object structure describing the EvaluationContext used in the flag evaluation, see https://docs.openfeature.dev/docs/reference/concepts/evaluation-context
|
|
23
|
+
*
|
|
18
24
|
* @generated from protobuf field: google.protobuf.Struct context = 2;
|
|
19
25
|
*/
|
|
20
26
|
context?: Struct;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
29
|
+
* Response body for boolean flag evaluation. used by the ResolveBoolean rpc.
|
|
30
|
+
*
|
|
23
31
|
* @generated from protobuf message schema.v1.ResolveBooleanResponse
|
|
24
32
|
*/
|
|
25
33
|
export interface ResolveBooleanResponse {
|
|
26
34
|
/**
|
|
35
|
+
* The response value of the boolean flag evaluation, will be unset in the case of error.
|
|
36
|
+
*
|
|
27
37
|
* @generated from protobuf field: bool value = 1;
|
|
28
38
|
*/
|
|
29
39
|
value: boolean;
|
|
30
40
|
/**
|
|
41
|
+
* The reason for the given return value, see https://docs.openfeature.dev/docs/specification/types#resolution-details
|
|
42
|
+
*
|
|
31
43
|
* @generated from protobuf field: string reason = 2;
|
|
32
44
|
*/
|
|
33
45
|
reason: string;
|
|
34
46
|
/**
|
|
47
|
+
* The variant name of the returned flag value.
|
|
48
|
+
*
|
|
35
49
|
* @generated from protobuf field: string variant = 3;
|
|
36
50
|
*/
|
|
37
51
|
variant: string;
|
|
38
52
|
}
|
|
39
53
|
/**
|
|
54
|
+
* Request body for string flag evaluation, used by the ResolveString rpc.
|
|
55
|
+
*
|
|
40
56
|
* @generated from protobuf message schema.v1.ResolveStringRequest
|
|
41
57
|
*/
|
|
42
58
|
export interface ResolveStringRequest {
|
|
43
59
|
/**
|
|
60
|
+
* Flag key of the requested flag.
|
|
61
|
+
*
|
|
44
62
|
* @generated from protobuf field: string flag_key = 1;
|
|
45
63
|
*/
|
|
46
64
|
flagKey: string;
|
|
47
65
|
/**
|
|
66
|
+
* Object structure describing the EvaluationContext used in the flag evaluation, see https://docs.openfeature.dev/docs/reference/concepts/evaluation-context
|
|
67
|
+
*
|
|
48
68
|
* @generated from protobuf field: google.protobuf.Struct context = 2;
|
|
49
69
|
*/
|
|
50
70
|
context?: Struct;
|
|
51
71
|
}
|
|
52
72
|
/**
|
|
73
|
+
* Response body for string flag evaluation. used by the ResolveString rpc.
|
|
74
|
+
*
|
|
53
75
|
* @generated from protobuf message schema.v1.ResolveStringResponse
|
|
54
76
|
*/
|
|
55
77
|
export interface ResolveStringResponse {
|
|
56
78
|
/**
|
|
79
|
+
* The response value of the string flag evaluation, will be unset in the case of error.
|
|
80
|
+
*
|
|
57
81
|
* @generated from protobuf field: string value = 1;
|
|
58
82
|
*/
|
|
59
83
|
value: string;
|
|
60
84
|
/**
|
|
85
|
+
* The reason for the given return value, see https://docs.openfeature.dev/docs/specification/types#resolution-details
|
|
86
|
+
*
|
|
61
87
|
* @generated from protobuf field: string reason = 2;
|
|
62
88
|
*/
|
|
63
89
|
reason: string;
|
|
64
90
|
/**
|
|
91
|
+
* The variant name of the returned flag value.
|
|
92
|
+
*
|
|
65
93
|
* @generated from protobuf field: string variant = 3;
|
|
66
94
|
*/
|
|
67
95
|
variant: string;
|
|
68
96
|
}
|
|
69
97
|
/**
|
|
98
|
+
* Request body for float flag evaluation, used by the ResolveFloat rpc.
|
|
99
|
+
*
|
|
70
100
|
* @generated from protobuf message schema.v1.ResolveFloatRequest
|
|
71
101
|
*/
|
|
72
102
|
export interface ResolveFloatRequest {
|
|
73
103
|
/**
|
|
104
|
+
* Flag key of the requested flag.
|
|
105
|
+
*
|
|
74
106
|
* @generated from protobuf field: string flag_key = 1;
|
|
75
107
|
*/
|
|
76
108
|
flagKey: string;
|
|
77
109
|
/**
|
|
110
|
+
* Object structure describing the EvaluationContext used in the flag evaluation, see https://docs.openfeature.dev/docs/reference/concepts/evaluation-context
|
|
111
|
+
*
|
|
78
112
|
* @generated from protobuf field: google.protobuf.Struct context = 2;
|
|
79
113
|
*/
|
|
80
114
|
context?: Struct;
|
|
81
115
|
}
|
|
82
116
|
/**
|
|
117
|
+
* Response body for float flag evaluation. used by the ResolveFloat rpc.
|
|
118
|
+
*
|
|
83
119
|
* @generated from protobuf message schema.v1.ResolveFloatResponse
|
|
84
120
|
*/
|
|
85
121
|
export interface ResolveFloatResponse {
|
|
86
122
|
/**
|
|
123
|
+
* The response value of the float flag evaluation, will be empty in the case of error.
|
|
124
|
+
*
|
|
87
125
|
* @generated from protobuf field: double value = 1;
|
|
88
126
|
*/
|
|
89
127
|
value: number;
|
|
90
128
|
/**
|
|
129
|
+
* The reason for the given return value, see https://docs.openfeature.dev/docs/specification/types#resolution-details
|
|
130
|
+
*
|
|
91
131
|
* @generated from protobuf field: string reason = 2;
|
|
92
132
|
*/
|
|
93
133
|
reason: string;
|
|
94
134
|
/**
|
|
135
|
+
* The variant name of the returned flag value.
|
|
136
|
+
*
|
|
95
137
|
* @generated from protobuf field: string variant = 3;
|
|
96
138
|
*/
|
|
97
139
|
variant: string;
|
|
98
140
|
}
|
|
99
141
|
/**
|
|
142
|
+
* Request body for int flag evaluation, used by the ResolveInt rpc.
|
|
143
|
+
*
|
|
100
144
|
* @generated from protobuf message schema.v1.ResolveIntRequest
|
|
101
145
|
*/
|
|
102
146
|
export interface ResolveIntRequest {
|
|
103
147
|
/**
|
|
148
|
+
* Flag key of the requested flag.
|
|
149
|
+
*
|
|
104
150
|
* @generated from protobuf field: string flag_key = 1;
|
|
105
151
|
*/
|
|
106
152
|
flagKey: string;
|
|
107
153
|
/**
|
|
154
|
+
* Object structure describing the EvaluationContext used in the flag evaluation, see https://docs.openfeature.dev/docs/reference/concepts/evaluation-context
|
|
155
|
+
*
|
|
108
156
|
* @generated from protobuf field: google.protobuf.Struct context = 2;
|
|
109
157
|
*/
|
|
110
158
|
context?: Struct;
|
|
111
159
|
}
|
|
112
160
|
/**
|
|
161
|
+
* Response body for int flag evaluation. used by the ResolveInt rpc.
|
|
162
|
+
*
|
|
113
163
|
* @generated from protobuf message schema.v1.ResolveIntResponse
|
|
114
164
|
*/
|
|
115
165
|
export interface ResolveIntResponse {
|
|
116
166
|
/**
|
|
167
|
+
* The response value of the int flag evaluation, will be unset in the case of error.
|
|
168
|
+
*
|
|
117
169
|
* @generated from protobuf field: int64 value = 1;
|
|
118
170
|
*/
|
|
119
171
|
value: string;
|
|
120
172
|
/**
|
|
173
|
+
* The reason for the given return value, see https://docs.openfeature.dev/docs/specification/types#resolution-details
|
|
174
|
+
*
|
|
121
175
|
* @generated from protobuf field: string reason = 2;
|
|
122
176
|
*/
|
|
123
177
|
reason: string;
|
|
124
178
|
/**
|
|
179
|
+
* The variant name of the returned flag value.
|
|
180
|
+
*
|
|
125
181
|
* @generated from protobuf field: string variant = 3;
|
|
126
182
|
*/
|
|
127
183
|
variant: string;
|
|
128
184
|
}
|
|
129
185
|
/**
|
|
186
|
+
* Request body for object flag evaluation, used by the ResolveObject rpc.
|
|
187
|
+
*
|
|
130
188
|
* @generated from protobuf message schema.v1.ResolveObjectRequest
|
|
131
189
|
*/
|
|
132
190
|
export interface ResolveObjectRequest {
|
|
133
191
|
/**
|
|
192
|
+
* Flag key of the requested flag.
|
|
193
|
+
*
|
|
134
194
|
* @generated from protobuf field: string flag_key = 1;
|
|
135
195
|
*/
|
|
136
196
|
flagKey: string;
|
|
137
197
|
/**
|
|
198
|
+
* Object structure describing the EvaluationContext used in the flag evaluation, see https://docs.openfeature.dev/docs/reference/concepts/evaluation-context
|
|
199
|
+
*
|
|
138
200
|
* @generated from protobuf field: google.protobuf.Struct context = 2;
|
|
139
201
|
*/
|
|
140
202
|
context?: Struct;
|
|
141
203
|
}
|
|
142
204
|
/**
|
|
205
|
+
* Response body for object flag evaluation. used by the ResolveObject rpc.
|
|
206
|
+
*
|
|
143
207
|
* @generated from protobuf message schema.v1.ResolveObjectResponse
|
|
144
208
|
*/
|
|
145
209
|
export interface ResolveObjectResponse {
|
|
146
210
|
/**
|
|
211
|
+
* The response value of the object flag evaluation, will be unset in the case of error.
|
|
212
|
+
*
|
|
213
|
+
* NOTE: This structure will need to be decoded from google/protobuf/struct.proto before it is returned to the SDK
|
|
214
|
+
*
|
|
147
215
|
* @generated from protobuf field: google.protobuf.Struct value = 1;
|
|
148
216
|
*/
|
|
149
217
|
value?: Struct;
|
|
150
218
|
/**
|
|
219
|
+
* The reason for the given return value, see https://docs.openfeature.dev/docs/specification/types#resolution-details
|
|
220
|
+
*
|
|
151
221
|
* @generated from protobuf field: string reason = 2;
|
|
152
222
|
*/
|
|
153
223
|
reason: string;
|
|
154
224
|
/**
|
|
225
|
+
* The variant name of the returned flag value.
|
|
226
|
+
*
|
|
155
227
|
* @generated from protobuf field: string variant = 3;
|
|
156
228
|
*/
|
|
157
229
|
variant: string;
|
|
158
230
|
}
|
|
159
231
|
/**
|
|
232
|
+
* Response body for the EventStream stream response
|
|
233
|
+
*
|
|
160
234
|
* @generated from protobuf message schema.v1.EventStreamResponse
|
|
161
235
|
*/
|
|
162
236
|
export interface EventStreamResponse {
|
|
163
237
|
/**
|
|
238
|
+
* String key indicating the type of event that is being received, for example, provider_ready or configuration_change
|
|
239
|
+
*
|
|
164
240
|
* @generated from protobuf field: string type = 1;
|
|
165
241
|
*/
|
|
166
242
|
type: string;
|
|
167
243
|
/**
|
|
244
|
+
* Object structure for use when sending relevant metadata to provide context to the event.
|
|
245
|
+
* Can be left unset when it is not required.
|
|
246
|
+
*
|
|
168
247
|
* @generated from protobuf field: google.protobuf.Struct data = 2;
|
|
169
248
|
*/
|
|
170
249
|
data?: Struct;
|
|
171
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Empty stream request body
|
|
253
|
+
*
|
|
254
|
+
* @generated from protobuf message schema.v1.EventStreamRequest
|
|
255
|
+
*/
|
|
256
|
+
export interface EventStreamRequest {
|
|
257
|
+
}
|
|
172
258
|
declare class ResolveBooleanRequest$Type extends MessageType<ResolveBooleanRequest> {
|
|
173
259
|
constructor();
|
|
174
260
|
create(value?: PartialMessage<ResolveBooleanRequest>): ResolveBooleanRequest;
|
|
@@ -279,6 +365,16 @@ declare class EventStreamResponse$Type extends MessageType<EventStreamResponse>
|
|
|
279
365
|
* @generated MessageType for protobuf message schema.v1.EventStreamResponse
|
|
280
366
|
*/
|
|
281
367
|
export declare const EventStreamResponse: EventStreamResponse$Type;
|
|
368
|
+
declare class EventStreamRequest$Type extends MessageType<EventStreamRequest> {
|
|
369
|
+
constructor();
|
|
370
|
+
create(value?: PartialMessage<EventStreamRequest>): EventStreamRequest;
|
|
371
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventStreamRequest): EventStreamRequest;
|
|
372
|
+
internalBinaryWrite(message: EventStreamRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* @generated MessageType for protobuf message schema.v1.EventStreamRequest
|
|
376
|
+
*/
|
|
377
|
+
export declare const EventStreamRequest: EventStreamRequest$Type;
|
|
282
378
|
/**
|
|
283
379
|
* @generated ServiceType for protobuf service schema.v1.Service
|
|
284
380
|
*/
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
2
|
-
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
3
|
-
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
4
|
-
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
5
|
-
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
6
|
-
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
|
-
/**
|
|
8
|
-
* A generic empty message that you can re-use to avoid defining duplicated
|
|
9
|
-
* empty messages in your APIs. A typical example is to use it as the request
|
|
10
|
-
* or the response type of an API method. For instance:
|
|
11
|
-
*
|
|
12
|
-
* service Foo {
|
|
13
|
-
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
14
|
-
* }
|
|
15
|
-
*
|
|
16
|
-
* The JSON representation for `Empty` is empty JSON object `{}`.
|
|
17
|
-
*
|
|
18
|
-
* @generated from protobuf message google.protobuf.Empty
|
|
19
|
-
*/
|
|
20
|
-
export interface Empty {
|
|
21
|
-
}
|
|
22
|
-
declare class Empty$Type extends MessageType<Empty> {
|
|
23
|
-
constructor();
|
|
24
|
-
create(value?: PartialMessage<Empty>): Empty;
|
|
25
|
-
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty;
|
|
26
|
-
internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @generated MessageType for protobuf message google.protobuf.Empty
|
|
30
|
-
*/
|
|
31
|
-
export declare const Empty: Empty$Type;
|
|
32
|
-
export {};
|