@flaghoist/server 0.1.2 → 0.1.3
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/dist/index.cjs +4 -3
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -393,7 +393,7 @@ var openApiDocument = {
|
|
|
393
393
|
value: { type: "boolean" },
|
|
394
394
|
reason: {
|
|
395
395
|
type: "string",
|
|
396
|
-
enum: ["
|
|
396
|
+
enum: ["STATIC", "TARGETING_MATCH", "SPLIT", "DEFAULT"]
|
|
397
397
|
},
|
|
398
398
|
variant: { type: "string" }
|
|
399
399
|
}
|
|
@@ -535,6 +535,7 @@ function createFlagServer(config) {
|
|
|
535
535
|
const cfg = resolve(c.env);
|
|
536
536
|
return cfg.dashboard ? c.html(cfg.dashboard) : c.text("Dashboard not configured", 404);
|
|
537
537
|
});
|
|
538
|
+
const wireReason = (reason) => reason === "DISABLED" ? "STATIC" : reason;
|
|
538
539
|
app.post("/ofrep/v1/evaluate/flags", async (c) => {
|
|
539
540
|
const cfg = resolve(c.env);
|
|
540
541
|
const auth = await cfg.auth.read(c.req.raw.headers);
|
|
@@ -554,7 +555,7 @@ function createFlagServer(config) {
|
|
|
554
555
|
return {
|
|
555
556
|
key: flag.key,
|
|
556
557
|
value: result.value,
|
|
557
|
-
reason: result.reason,
|
|
558
|
+
reason: wireReason(result.reason),
|
|
558
559
|
variant: result.value ? "on" : "off"
|
|
559
560
|
};
|
|
560
561
|
})
|
|
@@ -586,7 +587,7 @@ function createFlagServer(config) {
|
|
|
586
587
|
return c.json({
|
|
587
588
|
key,
|
|
588
589
|
value: result.value,
|
|
589
|
-
reason: result.reason,
|
|
590
|
+
reason: wireReason(result.reason),
|
|
590
591
|
variant: result.value ? "on" : "off"
|
|
591
592
|
});
|
|
592
593
|
});
|
package/dist/index.js
CHANGED
|
@@ -365,7 +365,7 @@ var openApiDocument = {
|
|
|
365
365
|
value: { type: "boolean" },
|
|
366
366
|
reason: {
|
|
367
367
|
type: "string",
|
|
368
|
-
enum: ["
|
|
368
|
+
enum: ["STATIC", "TARGETING_MATCH", "SPLIT", "DEFAULT"]
|
|
369
369
|
},
|
|
370
370
|
variant: { type: "string" }
|
|
371
371
|
}
|
|
@@ -507,6 +507,7 @@ function createFlagServer(config) {
|
|
|
507
507
|
const cfg = resolve(c.env);
|
|
508
508
|
return cfg.dashboard ? c.html(cfg.dashboard) : c.text("Dashboard not configured", 404);
|
|
509
509
|
});
|
|
510
|
+
const wireReason = (reason) => reason === "DISABLED" ? "STATIC" : reason;
|
|
510
511
|
app.post("/ofrep/v1/evaluate/flags", async (c) => {
|
|
511
512
|
const cfg = resolve(c.env);
|
|
512
513
|
const auth = await cfg.auth.read(c.req.raw.headers);
|
|
@@ -526,7 +527,7 @@ function createFlagServer(config) {
|
|
|
526
527
|
return {
|
|
527
528
|
key: flag.key,
|
|
528
529
|
value: result.value,
|
|
529
|
-
reason: result.reason,
|
|
530
|
+
reason: wireReason(result.reason),
|
|
530
531
|
variant: result.value ? "on" : "off"
|
|
531
532
|
};
|
|
532
533
|
})
|
|
@@ -558,7 +559,7 @@ function createFlagServer(config) {
|
|
|
558
559
|
return c.json({
|
|
559
560
|
key,
|
|
560
561
|
value: result.value,
|
|
561
|
-
reason: result.reason,
|
|
562
|
+
reason: wireReason(result.reason),
|
|
562
563
|
variant: result.value ? "on" : "off"
|
|
563
564
|
});
|
|
564
565
|
});
|