@hadoku/platform-wire 0.1.109 → 0.1.111
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/tiers.d.ts +14 -0
- package/dist/tiers.js +18 -0
- package/package.json +6 -2
package/dist/tiers.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform tier ladder, complete, and its one ordering: the server's gates
|
|
3
|
+
* (`@hadoku/service-kernel/auth` re-exports both) and the page's (`game-ui`'s
|
|
4
|
+
* friends-only check) read the same list. Here, not in the kernel, because the
|
|
5
|
+
* browser needs it too and a published package cannot reach into another's src.
|
|
6
|
+
*
|
|
7
|
+
* `wife` sits above `service` and below `admin` deliberately: full reach across
|
|
8
|
+
* the apps, none of the credential-management surface. `guest` is an account a
|
|
9
|
+
* visitor made themselves (or the edge made on arrival): a passkey and a name,
|
|
10
|
+
* no key anyone handed out. `member` is a guest the operator has verified.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TIER_ORDER: readonly ["public", "guest", "member", "friend", "service", "wife", "admin"];
|
|
13
|
+
export type Tier = (typeof TIER_ORDER)[number];
|
|
14
|
+
export declare function rankOf(tier: string): number;
|
package/dist/tiers.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform tier ladder, complete, and its one ordering: the server's gates
|
|
3
|
+
* (`@hadoku/service-kernel/auth` re-exports both) and the page's (`game-ui`'s
|
|
4
|
+
* friends-only check) read the same list. Here, not in the kernel, because the
|
|
5
|
+
* browser needs it too and a published package cannot reach into another's src.
|
|
6
|
+
*
|
|
7
|
+
* `wife` sits above `service` and below `admin` deliberately: full reach across
|
|
8
|
+
* the apps, none of the credential-management surface. `guest` is an account a
|
|
9
|
+
* visitor made themselves (or the edge made on arrival): a passkey and a name,
|
|
10
|
+
* no key anyone handed out. `member` is a guest the operator has verified.
|
|
11
|
+
*/
|
|
12
|
+
export const TIER_ORDER = ['public', 'guest', 'member', 'friend', 'service', 'wife', 'admin'];
|
|
13
|
+
export function rankOf(tier) {
|
|
14
|
+
const i = TIER_ORDER.indexOf(tier);
|
|
15
|
+
// An unknown tier is not a high one. A future tier name this build has never
|
|
16
|
+
// heard of must not out-rank the floor by accident.
|
|
17
|
+
return i === -1 ? 0 : i;
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/platform-wire",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.111",
|
|
4
|
+
"gitHead": "c797d505b0379e058a03bf7d63668064af060ed5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The wire any game speaks: room ids, telemetry, presence, events and tables, the Discord relay, looks, the restart notice, secure random and a generic server envelope. Knows no game; a game's own part rides as a type parameter. MIT; imports only zod.",
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"./seats": {
|
|
50
50
|
"types": "./dist/seats.d.ts",
|
|
51
51
|
"import": "./dist/seats.js"
|
|
52
|
+
},
|
|
53
|
+
"./tiers": {
|
|
54
|
+
"types": "./dist/tiers.d.ts",
|
|
55
|
+
"import": "./dist/tiers.js"
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
"dependencies": {
|