@xeonr/console-shell 0.3.0 → 0.3.1
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/devMock.d.ts +41 -0
- package/dist/devMock.d.ts.map +1 -0
- package/dist/devMock.js +173 -0
- package/dist/devMock.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Invitation, Me, Product, SearchResult } from "./types.ts";
|
|
2
|
+
/** The subset of node:http this needs, declared structurally so the package takes no @types/node dependency. */
|
|
3
|
+
interface MockRequest {
|
|
4
|
+
url?: string | undefined;
|
|
5
|
+
method?: string | undefined;
|
|
6
|
+
on(event: "data", cb: (chunk: unknown) => void): void;
|
|
7
|
+
on(event: "end", cb: () => void): void;
|
|
8
|
+
}
|
|
9
|
+
interface MockResponse {
|
|
10
|
+
statusCode: number;
|
|
11
|
+
setHeader(name: string, value: string): void;
|
|
12
|
+
end(body?: string): void;
|
|
13
|
+
}
|
|
14
|
+
export interface ConsoleMockFixtures {
|
|
15
|
+
me: Me;
|
|
16
|
+
products: Product[];
|
|
17
|
+
invitations?: Invitation[] | undefined;
|
|
18
|
+
search?: ((query: string, team: string | null) => SearchResult[]) | undefined;
|
|
19
|
+
/** Seed for the console context; writes mutate it for the life of the process. */
|
|
20
|
+
context?: {
|
|
21
|
+
activeTeam?: string | null;
|
|
22
|
+
pinnedProducts?: string[] | null;
|
|
23
|
+
theme?: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns a handler that answers the console service and reports whether it
|
|
28
|
+
* did, so a mock server can fall through to its own routes:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const console = consoleMockHandler({ me: ME, products: CONSOLE_PRODUCTS });
|
|
32
|
+
* if (console(req, res)) return;
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* Connect's unary JSON protocol is a plain POST of the request message to
|
|
36
|
+
* `/<package>.<Service>/<Method>` answering with the response message, so no
|
|
37
|
+
* Connect runtime is needed on this side.
|
|
38
|
+
*/
|
|
39
|
+
export declare function consoleMockHandler(fx: ConsoleMockFixtures): (req: MockRequest, res: MockResponse) => boolean;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=devMock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMock.d.ts","sourceRoot":"","sources":["../src/devMock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAaxE,gHAAgH;AAChH,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACtD,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACxC;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;IAC9E,kFAAkF;IAClF,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CACxG;AAiBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,mBAAmB,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,KAAK,OAAO,CA0J5G"}
|
package/dist/devMock.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const PREFIX = "/xeonr.console.v1.ConsoleProductService/";
|
|
2
|
+
const STATUS_ENUM = {
|
|
3
|
+
live: "PRODUCT_STATUS_LIVE",
|
|
4
|
+
preview: "PRODUCT_STATUS_PREVIEW",
|
|
5
|
+
coming_soon: "PRODUCT_STATUS_COMING_SOON",
|
|
6
|
+
};
|
|
7
|
+
const KIND_ENUM = {
|
|
8
|
+
entity: "SEARCH_RESULT_KIND_ENTITY",
|
|
9
|
+
action: "SEARCH_RESULT_KIND_ACTION",
|
|
10
|
+
team: "SEARCH_RESULT_KIND_TEAM",
|
|
11
|
+
navigation: "SEARCH_RESULT_KIND_NAVIGATION",
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Returns a handler that answers the console service and reports whether it
|
|
15
|
+
* did, so a mock server can fall through to its own routes:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const console = consoleMockHandler({ me: ME, products: CONSOLE_PRODUCTS });
|
|
19
|
+
* if (console(req, res)) return;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Connect's unary JSON protocol is a plain POST of the request message to
|
|
23
|
+
* `/<package>.<Service>/<Method>` answering with the response message, so no
|
|
24
|
+
* Connect runtime is needed on this side.
|
|
25
|
+
*/
|
|
26
|
+
export function consoleMockHandler(fx) {
|
|
27
|
+
const ctx = {
|
|
28
|
+
activeTeam: fx.context?.activeTeam ?? fx.me.teams[0]?.id ?? "",
|
|
29
|
+
// Null until something is written, so the registry's pinned-by-default set
|
|
30
|
+
// applies — the same tri-state the real service carries.
|
|
31
|
+
pinnedProducts: fx.context?.pinnedProducts ?? null,
|
|
32
|
+
theme: fx.context?.theme ?? "system",
|
|
33
|
+
};
|
|
34
|
+
const send = (res, body) => {
|
|
35
|
+
res.statusCode = 200;
|
|
36
|
+
res.setHeader("content-type", "application/json");
|
|
37
|
+
res.end(JSON.stringify(body));
|
|
38
|
+
};
|
|
39
|
+
const contextMessage = () => ({
|
|
40
|
+
activeTeam: ctx.activeTeam,
|
|
41
|
+
...(ctx.pinnedProducts === null ? {} : { pinnedProducts: { keys: ctx.pinnedProducts } }),
|
|
42
|
+
theme: ctx.theme,
|
|
43
|
+
});
|
|
44
|
+
const team = (t) => ({
|
|
45
|
+
id: t.id,
|
|
46
|
+
slug: t.slug,
|
|
47
|
+
name: t.name,
|
|
48
|
+
avatarUrl: t.avatarUrl ?? "",
|
|
49
|
+
role: t.role === "owner" ? "TEAM_ROLE_OWNER" : "TEAM_ROLE_MEMBER",
|
|
50
|
+
roles: t.roles,
|
|
51
|
+
entitled: t.entitled ?? true,
|
|
52
|
+
canEnable: t.canEnable ?? false,
|
|
53
|
+
});
|
|
54
|
+
return (req, res) => {
|
|
55
|
+
const url = (req.url ?? "").split("?")[0] ?? "";
|
|
56
|
+
if (!url.startsWith(PREFIX))
|
|
57
|
+
return false;
|
|
58
|
+
const method = url.slice(PREFIX.length);
|
|
59
|
+
const withBody = (run) => {
|
|
60
|
+
let raw = "";
|
|
61
|
+
req.on("data", (c) => {
|
|
62
|
+
raw += String(c);
|
|
63
|
+
});
|
|
64
|
+
req.on("end", () => {
|
|
65
|
+
let parsed = {};
|
|
66
|
+
try {
|
|
67
|
+
parsed = JSON.parse(raw || "{}");
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
/* an unparseable body is an empty request, same as the real one treats it */
|
|
71
|
+
}
|
|
72
|
+
run(parsed);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
switch (method) {
|
|
76
|
+
case "GetMe":
|
|
77
|
+
send(res, {
|
|
78
|
+
subject: fx.me.subject,
|
|
79
|
+
displayName: fx.me.displayName,
|
|
80
|
+
email: fx.me.email,
|
|
81
|
+
avatarUrl: fx.me.avatarUrl ?? "",
|
|
82
|
+
teams: fx.me.teams.map(team),
|
|
83
|
+
teamsVersion: String(fx.me.teamsVersion),
|
|
84
|
+
isOrgAdmin: fx.me.isOrgAdmin,
|
|
85
|
+
warnings: fx.me.warnings ?? [],
|
|
86
|
+
});
|
|
87
|
+
return true;
|
|
88
|
+
case "ListProducts":
|
|
89
|
+
send(res, {
|
|
90
|
+
products: fx.products.map((p) => ({
|
|
91
|
+
key: p.key,
|
|
92
|
+
name: p.name,
|
|
93
|
+
origin: p.origin,
|
|
94
|
+
icon: p.icon,
|
|
95
|
+
colour: p.colour,
|
|
96
|
+
category: p.category,
|
|
97
|
+
blurb: p.blurb,
|
|
98
|
+
status: STATUS_ENUM[p.status] ?? "PRODUCT_STATUS_LIVE",
|
|
99
|
+
scopes: p.scopes,
|
|
100
|
+
pinnedByDefault: p.pinnedByDefault,
|
|
101
|
+
enabled: p.enabled,
|
|
102
|
+
canEnable: p.canEnable,
|
|
103
|
+
docsUrl: p.docsUrl ?? "",
|
|
104
|
+
supportUrl: p.supportUrl ?? "",
|
|
105
|
+
})),
|
|
106
|
+
});
|
|
107
|
+
return true;
|
|
108
|
+
case "GetContext":
|
|
109
|
+
send(res, { context: contextMessage() });
|
|
110
|
+
return true;
|
|
111
|
+
case "UpdateContext":
|
|
112
|
+
withBody((body) => {
|
|
113
|
+
const patch = (body["context"] ?? {});
|
|
114
|
+
const paths = body["paths"] ?? [];
|
|
115
|
+
const touched = (p) => paths.length === 0 || paths.includes(p);
|
|
116
|
+
if (touched("active_team"))
|
|
117
|
+
ctx.activeTeam = String(patch["activeTeam"] ?? "");
|
|
118
|
+
if (touched("pinned_products")) {
|
|
119
|
+
const pins = patch["pinnedProducts"];
|
|
120
|
+
ctx.pinnedProducts = pins ? (pins.keys ?? []) : null;
|
|
121
|
+
}
|
|
122
|
+
if (touched("theme"))
|
|
123
|
+
ctx.theme = String(patch["theme"] ?? "system") || "system";
|
|
124
|
+
send(res, { context: contextMessage() });
|
|
125
|
+
});
|
|
126
|
+
return true;
|
|
127
|
+
case "ListInvitations":
|
|
128
|
+
send(res, {
|
|
129
|
+
invitations: (fx.invitations ?? []).map((i) => ({
|
|
130
|
+
id: i.id,
|
|
131
|
+
team: { id: i.team.id, slug: i.team.slug, name: i.team.name, avatarUrl: i.team.avatarUrl ?? "", roles: [] },
|
|
132
|
+
invitedBy: i.invitedBy,
|
|
133
|
+
role: i.role === "owner" ? "TEAM_ROLE_OWNER" : "TEAM_ROLE_MEMBER",
|
|
134
|
+
expiresAt: i.expiresAt,
|
|
135
|
+
})),
|
|
136
|
+
});
|
|
137
|
+
return true;
|
|
138
|
+
case "CreateProductBinding":
|
|
139
|
+
withBody((body) => {
|
|
140
|
+
const key = String(body["product"] ?? "");
|
|
141
|
+
const p = fx.products.find((x) => x.key === key);
|
|
142
|
+
if (p)
|
|
143
|
+
p.enabled = true;
|
|
144
|
+
send(res, {});
|
|
145
|
+
});
|
|
146
|
+
return true;
|
|
147
|
+
case "Search":
|
|
148
|
+
withBody((body) => {
|
|
149
|
+
const hits = fx.search ? fx.search(String(body["query"] ?? ""), body["team"] || null) : [];
|
|
150
|
+
send(res, {
|
|
151
|
+
results: hits.map((h) => ({
|
|
152
|
+
product: h.product,
|
|
153
|
+
kind: KIND_ENUM[h.kind] ?? "SEARCH_RESULT_KIND_ENTITY",
|
|
154
|
+
title: h.title,
|
|
155
|
+
subtitle: h.subtitle ?? "",
|
|
156
|
+
href: h.href,
|
|
157
|
+
icon: h.icon ?? "",
|
|
158
|
+
internal: h.internal ?? false,
|
|
159
|
+
})),
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
return true;
|
|
163
|
+
default:
|
|
164
|
+
// An unknown method is Unimplemented rather than a 404, so the client
|
|
165
|
+
// reports it as the RPC failure it is.
|
|
166
|
+
res.statusCode = 501;
|
|
167
|
+
res.setHeader("content-type", "application/json");
|
|
168
|
+
res.end(JSON.stringify({ code: "unimplemented", message: `no mock for ${method}` }));
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=devMock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMock.js","sourceRoot":"","sources":["../src/devMock.ts"],"names":[],"mappings":"AAoCA,MAAM,MAAM,GAAG,0CAA0C,CAAC;AAE1D,MAAM,WAAW,GAA2B;IAC1C,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,wBAAwB;IACjC,WAAW,EAAE,4BAA4B;CAC1C,CAAC;AAEF,MAAM,SAAS,GAA2B;IACxC,MAAM,EAAE,2BAA2B;IACnC,MAAM,EAAE,2BAA2B;IACnC,IAAI,EAAE,yBAAyB;IAC/B,UAAU,EAAE,+BAA+B;CAC5C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAuB;IACxD,MAAM,GAAG,GAAG;QACV,UAAU,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE;QAC9D,2EAA2E;QAC3E,yDAAyD;QACzD,cAAc,EAAE,EAAE,CAAC,OAAO,EAAE,cAAc,IAAI,IAAI;QAClD,KAAK,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,QAAQ;KACqC,CAAC;IAE5E,MAAM,IAAI,GAAG,CAAC,GAAiB,EAAE,IAAa,EAAE,EAAE;QAChD,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;QACrB,GAAG,CAAC,SAAS,CAAC,cAAc,EA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,CAAC,CAAC;qBACJ,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC;YAEd;gBACE,sEAAsE;gBACtE,uCAAuC;gBACvC,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;gBACrB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;gBAClD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;gBACrF,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeonr/console-shell",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "The Xeonr Cloud Console chrome: product rail, team switcher, section sidebar, top bar, ⌘K and the All-products launcher, plus the console context hooks every product console mounts.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./dev": {
|
|
14
|
+
"types": "./dist/devMock.d.ts",
|
|
15
|
+
"import": "./dist/devMock.js"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"files": [
|