@hanzo/rooms 0.1.29 → 0.1.31
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/lib/org.d.ts +29 -22
- package/dist/lib/org.js +9 -12
- package/dist/lib/rooms.json +0 -3
- package/package.json +1 -1
package/dist/lib/org.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* delete the org DELETE /v1/iam/organizations/admin/<org>
|
|
6
6
|
* found a team org POST /v1/iam/organizations {owner: admin, name, displayName}
|
|
7
7
|
* business address GET|PUT /v1/settings/organization (cloud's per-org config)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* API keys GET|POST /v1/account/keys, DELETE /v1/account/keys/<id>
|
|
9
|
+
* (yours; every key of the org for an admin; a secret shown once)
|
|
10
10
|
* payment methods GET /v1/billing/methods
|
|
11
11
|
* invoices GET /v1/billing/invoices
|
|
12
12
|
*
|
|
@@ -59,30 +59,37 @@ export declare function readAddress(): Promise<Address>;
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function saveAddress(next: Address): Promise<Address>;
|
|
61
61
|
export type KeyType = 'secret' | 'publishable';
|
|
62
|
-
/**
|
|
63
|
-
|
|
62
|
+
/**
|
|
63
|
+
* One API key the reader may see: their own, or any key of an org they administer.
|
|
64
|
+
* Each is its own credential, so creating one never replaces another. A secret
|
|
65
|
+
* key's value is never listed; `key` carries it once, in the answer to a create.
|
|
66
|
+
*/
|
|
67
|
+
export interface ApiKey {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
64
70
|
type: KeyType;
|
|
71
|
+
/** The head of the credential, enough to tell which string it is. */
|
|
65
72
|
prefix?: string;
|
|
66
|
-
/** The whole value
|
|
73
|
+
/** The whole value: always for a publishable key, once for a new secret one. */
|
|
67
74
|
key?: string;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
name: string;
|
|
78
|
-
displayName?: string;
|
|
79
|
-
user?: string;
|
|
80
|
-
scope?: string;
|
|
81
|
-
state?: string;
|
|
82
|
-
createdTime?: string;
|
|
75
|
+
status: 'active' | 'expired' | 'revoked' | 'disabled';
|
|
76
|
+
/** Who the key speaks for, `<org>/<user>`. */
|
|
77
|
+
creator?: string;
|
|
78
|
+
created?: string;
|
|
79
|
+
expires?: string;
|
|
80
|
+
revoker?: string;
|
|
81
|
+
revoked?: string;
|
|
82
|
+
/** What the key may reach; empty reaches whatever its holder does. */
|
|
83
|
+
limit?: string[];
|
|
83
84
|
}
|
|
84
|
-
export declare function
|
|
85
|
-
|
|
85
|
+
export declare function keys(): Promise<ApiKey[]>;
|
|
86
|
+
/** Creates a new key beside the ones held, and answers it with its value — once. */
|
|
87
|
+
export declare function createKey(input: {
|
|
88
|
+
name?: string;
|
|
89
|
+
type: KeyType;
|
|
90
|
+
}): Promise<ApiKey>;
|
|
91
|
+
/** Revokes exactly one key. It stays listed as revoked; every other key keeps working. */
|
|
92
|
+
export declare const revokeKey: (id: string) => Promise<ApiKey>;
|
|
86
93
|
/** A card on file, as billing lists it. */
|
|
87
94
|
export interface Method {
|
|
88
95
|
id: string;
|
package/dist/lib/org.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* delete the org DELETE /v1/iam/organizations/admin/<org>
|
|
6
6
|
* found a team org POST /v1/iam/organizations {owner: admin, name, displayName}
|
|
7
7
|
* business address GET|PUT /v1/settings/organization (cloud's per-org config)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* API keys GET|POST /v1/account/keys, DELETE /v1/account/keys/<id>
|
|
9
|
+
* (yours; every key of the org for an admin; a secret shown once)
|
|
10
10
|
* payment methods GET /v1/billing/methods
|
|
11
11
|
* invoices GET /v1/billing/invoices
|
|
12
12
|
*
|
|
@@ -112,21 +112,18 @@ export async function saveAddress(next) {
|
|
|
112
112
|
const stored = await ask(PROFILE, { method: 'PUT', json: { config: { ...held, address: next } } });
|
|
113
113
|
return addressOf(stored.config);
|
|
114
114
|
}
|
|
115
|
-
export async function
|
|
115
|
+
export async function keys() {
|
|
116
116
|
return list((await ask('/v1/account/keys')).keys);
|
|
117
117
|
}
|
|
118
|
-
/**
|
|
119
|
-
export async function
|
|
120
|
-
const made = await ask('/v1/account/keys', { method: 'POST', json:
|
|
118
|
+
/** Creates a new key beside the ones held, and answers it with its value — once. */
|
|
119
|
+
export async function createKey(input) {
|
|
120
|
+
const made = await ask('/v1/account/keys', { method: 'POST', json: input });
|
|
121
121
|
if (!made?.key)
|
|
122
122
|
throw new Refusal(502, 'IAM answered without a key.');
|
|
123
|
-
return made
|
|
123
|
+
return made;
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
export
|
|
127
|
-
return list((await ask(`/v1/iam/keys?owner=${enc(org)}`)).keys);
|
|
128
|
-
}
|
|
129
|
-
export const revokeKey = (k) => ask(`/v1/iam/keys/${enc(k.owner)}/${enc(k.name)}`, { method: 'DELETE' });
|
|
125
|
+
/** Revokes exactly one key. It stays listed as revoked; every other key keeps working. */
|
|
126
|
+
export const revokeKey = (id) => ask(`/v1/account/keys/${enc(id)}`, { method: 'DELETE' });
|
|
130
127
|
export async function methods() {
|
|
131
128
|
const got = await ask('/v1/billing/methods');
|
|
132
129
|
return list(Array.isArray(got) ? got : got?.data);
|
package/dist/lib/rooms.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
-
"/beluga",
|
|
3
2
|
"/board",
|
|
4
3
|
"/bots",
|
|
5
4
|
"/cal",
|
|
6
5
|
"/chat",
|
|
7
6
|
"/chat/shared",
|
|
8
7
|
"/contacts",
|
|
9
|
-
"/dashboard",
|
|
10
8
|
"/dev",
|
|
11
9
|
"/drive",
|
|
12
10
|
"/home",
|
|
@@ -18,6 +16,5 @@
|
|
|
18
16
|
"/settings/organization/keys",
|
|
19
17
|
"/settings/organization/members",
|
|
20
18
|
"/settings/organization/usage",
|
|
21
|
-
"/vibe",
|
|
22
19
|
"/work"
|
|
23
20
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/rooms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|