@fonoster/identity-client 0.21.0 → 0.22.8
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.d.ts +39 -0
- package/dist/index.js +19 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export interface Workspace {
|
|
|
39
39
|
accessKeyId: string;
|
|
40
40
|
createdAt?: number;
|
|
41
41
|
updatedAt?: number;
|
|
42
|
+
/** The workspace owner's own profile (never a WorkspaceMember row). */
|
|
43
|
+
owner?: {
|
|
44
|
+
ref: string;
|
|
45
|
+
name: string;
|
|
46
|
+
email: string;
|
|
47
|
+
};
|
|
42
48
|
}
|
|
43
49
|
export interface WorkspaceMember {
|
|
44
50
|
ref: string;
|
|
@@ -55,6 +61,26 @@ export interface InviteMemberRequest {
|
|
|
55
61
|
role: string;
|
|
56
62
|
name?: string;
|
|
57
63
|
}
|
|
64
|
+
/** A workspace API key as returned by list (never carries the secret). */
|
|
65
|
+
export interface ApiKey {
|
|
66
|
+
ref: string;
|
|
67
|
+
accessKeyId: string;
|
|
68
|
+
role: string;
|
|
69
|
+
expiresAt?: number;
|
|
70
|
+
createdAt?: number;
|
|
71
|
+
updatedAt?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface CreateApiKeyRequest {
|
|
74
|
+
role: string;
|
|
75
|
+
/** Optional expiry as epoch milliseconds; omit for a non-expiring key. */
|
|
76
|
+
expiresAt?: number;
|
|
77
|
+
}
|
|
78
|
+
/** Create/regenerate response — the only time the secret is returned. */
|
|
79
|
+
export interface ApiKeyCredentials {
|
|
80
|
+
ref: string;
|
|
81
|
+
accessKeyId: string;
|
|
82
|
+
accessKeySecret: string;
|
|
83
|
+
}
|
|
58
84
|
/** Channel a verification code is sent over. */
|
|
59
85
|
export type ContactType = "EMAIL" | "PHONE";
|
|
60
86
|
/** OAuth2 providers Identity can exchange an authorization code for. */
|
|
@@ -136,6 +162,19 @@ export declare class IdentityClient {
|
|
|
136
162
|
resendWorkspaceMembershipInvitation(userRef: string, accessKeyId: string, token: string): Promise<{
|
|
137
163
|
userRef: string;
|
|
138
164
|
}>;
|
|
165
|
+
/** List the active workspace's API keys (secrets are never returned). */
|
|
166
|
+
listApiKeys(accessKeyId: string, token: string): Promise<{
|
|
167
|
+
items: ApiKey[];
|
|
168
|
+
nextPageToken?: string;
|
|
169
|
+
}>;
|
|
170
|
+
/** Create an API key; the response carries the secret (shown once). */
|
|
171
|
+
createApiKey(request: CreateApiKeyRequest, accessKeyId: string, token: string): Promise<ApiKeyCredentials>;
|
|
172
|
+
/** Rotate a key's secret in place; the new secret is returned (shown once). */
|
|
173
|
+
regenerateApiKey(ref: string, accessKeyId: string, token: string): Promise<ApiKeyCredentials>;
|
|
174
|
+
/** Permanently delete a key (this is the revocation mechanism). */
|
|
175
|
+
deleteApiKey(ref: string, accessKeyId: string, token: string): Promise<{
|
|
176
|
+
ref: string;
|
|
177
|
+
}>;
|
|
139
178
|
getUser(ref: string, token: string): Promise<User>;
|
|
140
179
|
updateUser(request: UpdateUserRequest, token: string): Promise<{
|
|
141
180
|
ref: string;
|
package/dist/index.js
CHANGED
|
@@ -179,6 +179,25 @@ class IdentityClient {
|
|
|
179
179
|
resendWorkspaceMembershipInvitation(userRef, accessKeyId, token) {
|
|
180
180
|
return this.unary("resendWorkspaceMembershipInvitation", { userRef }, { token, accessKeyId });
|
|
181
181
|
}
|
|
182
|
+
// --- Workspace API keys ---
|
|
183
|
+
// Workspace-scoped credentials for unattended, server-to-server integrations.
|
|
184
|
+
// The active workspace is taken from the accessKeyId metadata, as with members.
|
|
185
|
+
/** List the active workspace's API keys (secrets are never returned). */
|
|
186
|
+
listApiKeys(accessKeyId, token) {
|
|
187
|
+
return this.unary("listApiKeys", {}, { token, accessKeyId });
|
|
188
|
+
}
|
|
189
|
+
/** Create an API key; the response carries the secret (shown once). */
|
|
190
|
+
createApiKey(request, accessKeyId, token) {
|
|
191
|
+
return this.unary("createApiKey", request, { token, accessKeyId });
|
|
192
|
+
}
|
|
193
|
+
/** Rotate a key's secret in place; the new secret is returned (shown once). */
|
|
194
|
+
regenerateApiKey(ref, accessKeyId, token) {
|
|
195
|
+
return this.unary("regenerateApiKey", { ref }, { token, accessKeyId });
|
|
196
|
+
}
|
|
197
|
+
/** Permanently delete a key (this is the revocation mechanism). */
|
|
198
|
+
deleteApiKey(ref, accessKeyId, token) {
|
|
199
|
+
return this.unary("deleteApiKey", { ref }, { token, accessKeyId });
|
|
200
|
+
}
|
|
182
201
|
getUser(ref, token) {
|
|
183
202
|
return this.unary("getUser", { ref }, { token });
|
|
184
203
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/identity-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.8",
|
|
4
4
|
"description": "Lightweight client for the Fonoster Identity gRPC service",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "fa13af2c65427fb2c82d376db25d0cc0c2ab14ee"
|
|
32
32
|
}
|