@crvouga/mockingbird-runtime 0.6.0 → 0.7.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/dist/adapter-node.d.ts +31 -1
- package/dist/adapter-node.js +3 -3
- package/dist/authoring.d.ts +33 -1
- package/dist/authoring.js +2 -2
- package/dist/{chunk-SVG34QFE.js → chunk-BKXECY5O.js} +3 -3
- package/dist/{chunk-BK5KDNUE.js → chunk-CIJF35LX.js} +48 -26
- package/dist/{chunk-BK5KDNUE.js.map → chunk-CIJF35LX.js.map} +2 -2
- package/dist/{chunk-GAIPLMRY.js → chunk-MZMSHIAI.js} +223 -65
- package/dist/chunk-MZMSHIAI.js.map +7 -0
- package/dist/http-provider.js +3 -3
- package/dist/mqtt-broker/node.js +3 -3
- package/dist/mqtt-broker.d.ts +27 -1
- package/dist/mqtt-broker.js +3 -3
- package/dist/{server-SXO3PUBW.js → server-MIPFZS6D.js} +2 -2
- package/dist/{server-SXO3PUBW.js.map → server-MIPFZS6D.js.map} +2 -2
- package/dist/service/admin.js +1 -1
- package/dist/service.d.ts +34 -2
- package/dist/service.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-GAIPLMRY.js.map +0 -7
- /package/dist/{chunk-SVG34QFE.js.map → chunk-BKXECY5O.js.map} +0 -0
package/dist/http-provider.js
CHANGED
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
Collection,
|
|
20
20
|
bootSqlite
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CIJF35LX.js";
|
|
22
22
|
import {
|
|
23
23
|
clearNamespace
|
|
24
24
|
} from "./chunk-2KDYLZXC.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-MZMSHIAI.js";
|
|
26
26
|
import {
|
|
27
27
|
requestBaseUrl
|
|
28
28
|
} from "./chunk-U36J5GCB.js";
|
|
@@ -903,7 +903,7 @@ function parseCookies(header) {
|
|
|
903
903
|
|
|
904
904
|
// ../http/provider/dist/vendor/core/ui.js
|
|
905
905
|
async function renderProviderPage(page) {
|
|
906
|
-
const { renderProviderPage: render } = await import("./server-
|
|
906
|
+
const { renderProviderPage: render } = await import("./server-MIPFZS6D.js");
|
|
907
907
|
return render(page);
|
|
908
908
|
}
|
|
909
909
|
function renderCardPage(title, description, blocks, service) {
|
package/dist/mqtt-broker/node.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAX_VARIABLE_BYTE_INTEGER,
|
|
3
3
|
MQTT_WEBSOCKET_PATH
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-BKXECY5O.js";
|
|
5
|
+
import "../chunk-CIJF35LX.js";
|
|
6
6
|
import "../chunk-2KDYLZXC.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-MZMSHIAI.js";
|
|
8
8
|
import "../chunk-U36J5GCB.js";
|
|
9
9
|
import "../chunk-EQLY2YOA.js";
|
|
10
10
|
import "../chunk-HU6IOAFC.js";
|
package/dist/mqtt-broker.d.ts
CHANGED
|
@@ -28,6 +28,25 @@ type Clock = {
|
|
|
28
28
|
state(): ClockState;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
/** An admission quota applied on the namespace clock. */
|
|
32
|
+
type FaultLimit = {
|
|
33
|
+
requests: number;
|
|
34
|
+
per: Duration;
|
|
35
|
+
key?: "namespace" | "credential";
|
|
36
|
+
window?: "fixed" | "sliding";
|
|
37
|
+
};
|
|
38
|
+
type LimitState = {
|
|
39
|
+
used: number;
|
|
40
|
+
windowStart: number | null;
|
|
41
|
+
windowResetsAt: number | null;
|
|
42
|
+
};
|
|
43
|
+
type LimitBucket = {
|
|
44
|
+
start: number;
|
|
45
|
+
used: number;
|
|
46
|
+
} | {
|
|
47
|
+
arrivals: number[];
|
|
48
|
+
};
|
|
49
|
+
|
|
31
50
|
/**
|
|
32
51
|
* A deliberate failure injected in front of an operation.
|
|
33
52
|
*
|
|
@@ -71,6 +90,8 @@ type FaultRule = {
|
|
|
71
90
|
* rules added through `POST /__admin/faults` default to the calling namespace.
|
|
72
91
|
*/
|
|
73
92
|
namespace?: string;
|
|
93
|
+
/** Admit at most this many matching requests per window. */
|
|
94
|
+
limit?: FaultLimit;
|
|
74
95
|
/** Let this many matching requests through first. */
|
|
75
96
|
after?: number;
|
|
76
97
|
/** Then fault only every nth matching request: `3` faults the 3rd, 6th, 9th. */
|
|
@@ -175,13 +196,17 @@ type FaultCandidate = {
|
|
|
175
196
|
* `undefined` for a body that is missing or not JSON. It must leave the request readable.
|
|
176
197
|
*/
|
|
177
198
|
readJson?: () => Promise<unknown>;
|
|
199
|
+
/** The service-specific credential, if it has one. */
|
|
200
|
+
credential?: () => string | undefined;
|
|
178
201
|
/** The namespace clock, for `from` / `until`. Rules with a window are skipped without it. */
|
|
179
202
|
now?: number;
|
|
203
|
+
/** Read the clock again after asynchronous request matching. */
|
|
204
|
+
clockNow?: () => number;
|
|
180
205
|
/** How to spend a delay for this request. Default: the registry's own sleep. */
|
|
181
206
|
wait?: (ms: number) => Promise<void>;
|
|
182
207
|
};
|
|
183
208
|
/** A stored rule and how often it was consulted. */
|
|
184
|
-
type FaultListing = FaultRule & {
|
|
209
|
+
type FaultListing = FaultRule & Partial<LimitState> & {
|
|
185
210
|
/** Faults left before the rule retires. `null` when it has no `count`. */
|
|
186
211
|
remaining: number | null;
|
|
187
212
|
/** Times the rule faulted a request. */
|
|
@@ -197,6 +222,7 @@ type FaultSnapshot = {
|
|
|
197
222
|
*/
|
|
198
223
|
rules: (FaultListing & {
|
|
199
224
|
position?: number;
|
|
225
|
+
limitBuckets?: [string, LimitBucket][];
|
|
200
226
|
})[];
|
|
201
227
|
/** How many `fault_<n>` ids the namespace has handed out. */
|
|
202
228
|
nextId?: number;
|
package/dist/mqtt-broker.js
CHANGED
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
observeClock,
|
|
15
15
|
takeConnackFault,
|
|
16
16
|
webSocketNamespace
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BKXECY5O.js";
|
|
18
18
|
import {
|
|
19
19
|
Collection,
|
|
20
20
|
IdSequence
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CIJF35LX.js";
|
|
22
22
|
import "./chunk-2KDYLZXC.js";
|
|
23
23
|
import {
|
|
24
24
|
fromBase64,
|
|
25
25
|
toBase64
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MZMSHIAI.js";
|
|
27
27
|
import "./chunk-U36J5GCB.js";
|
|
28
28
|
import "./chunk-EQLY2YOA.js";
|
|
29
29
|
import "./chunk-HU6IOAFC.js";
|
|
@@ -13300,7 +13300,7 @@ function Zg({ children: e7, product: t, brandHref: r, nav: o, actions: a, footer
|
|
|
13300
13300
|
var go = P($e(), 1);
|
|
13301
13301
|
var y5 = { sm: "max-w-sm", md: "max-w-md", lg: "max-w-xl" };
|
|
13302
13302
|
function Qg({ title: e7, description: t, children: r, footer: o, product: a, notice: n, size: l = "md" }) {
|
|
13303
|
-
return (0, go.jsxs)("div", { className: "flex min-h-
|
|
13303
|
+
return (0, go.jsxs)("div", { className: "flex min-h-[var(--mb-app-height,100dvh)] flex-col items-center justify-center gap-6 bg-background px-4 py-10 text-foreground", "data-mockingbird-centered": true, children: [(0, go.jsx)(ud, { product: a }), (0, go.jsxs)(Oo, { className: `w-full ${y5[l]}`, children: [(0, go.jsxs)(Oo.Header, { children: [(0, go.jsx)(Oo.Title, { className: "text-lg font-semibold", render: (i) => (0, go.jsx)("h1", { ...i }), children: e7 }), t ? (0, go.jsx)(Oo.Description, { children: t }) : null] }), r ? (0, go.jsx)(Oo.Content, { className: "gap-3", children: r }) : null, o ? (0, go.jsx)(Oo.Footer, { className: "flex-wrap gap-2", children: o }) : null] }), n ? (0, go.jsx)("div", { className: `w-full ${y5[l]} text-center text-xs text-muted`, children: n }) : null] });
|
|
13304
13304
|
}
|
|
13305
13305
|
var xo = P($e(), 1);
|
|
13306
13306
|
var Jg = P(O(), 1);
|
|
@@ -16056,4 +16056,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
16056
16056
|
SOFTWARE.
|
|
16057
16057
|
|
|
16058
16058
|
*/
|
|
16059
|
-
//# sourceMappingURL=server-
|
|
16059
|
+
//# sourceMappingURL=server-MIPFZS6D.js.map
|