@fonoster/identity-client 0.21.0 → 0.22.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/index.d.ts CHANGED
@@ -55,6 +55,26 @@ export interface InviteMemberRequest {
55
55
  role: string;
56
56
  name?: string;
57
57
  }
58
+ /** A workspace API key as returned by list (never carries the secret). */
59
+ export interface ApiKey {
60
+ ref: string;
61
+ accessKeyId: string;
62
+ role: string;
63
+ expiresAt?: number;
64
+ createdAt?: number;
65
+ updatedAt?: number;
66
+ }
67
+ export interface CreateApiKeyRequest {
68
+ role: string;
69
+ /** Optional expiry as epoch milliseconds; omit for a non-expiring key. */
70
+ expiresAt?: number;
71
+ }
72
+ /** Create/regenerate response — the only time the secret is returned. */
73
+ export interface ApiKeyCredentials {
74
+ ref: string;
75
+ accessKeyId: string;
76
+ accessKeySecret: string;
77
+ }
58
78
  /** Channel a verification code is sent over. */
59
79
  export type ContactType = "EMAIL" | "PHONE";
60
80
  /** OAuth2 providers Identity can exchange an authorization code for. */
@@ -136,6 +156,19 @@ export declare class IdentityClient {
136
156
  resendWorkspaceMembershipInvitation(userRef: string, accessKeyId: string, token: string): Promise<{
137
157
  userRef: string;
138
158
  }>;
159
+ /** List the active workspace's API keys (secrets are never returned). */
160
+ listApiKeys(accessKeyId: string, token: string): Promise<{
161
+ items: ApiKey[];
162
+ nextPageToken?: string;
163
+ }>;
164
+ /** Create an API key; the response carries the secret (shown once). */
165
+ createApiKey(request: CreateApiKeyRequest, accessKeyId: string, token: string): Promise<ApiKeyCredentials>;
166
+ /** Rotate a key's secret in place; the new secret is returned (shown once). */
167
+ regenerateApiKey(ref: string, accessKeyId: string, token: string): Promise<ApiKeyCredentials>;
168
+ /** Permanently delete a key (this is the revocation mechanism). */
169
+ deleteApiKey(ref: string, accessKeyId: string, token: string): Promise<{
170
+ ref: string;
171
+ }>;
139
172
  getUser(ref: string, token: string): Promise<User>;
140
173
  updateUser(request: UpdateUserRequest, token: string): Promise<{
141
174
  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.21.0",
3
+ "version": "0.22.0",
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": "34139b12d44bb6c59eb5cc9f1083fbcfaa61b76e"
31
+ "gitHead": "6095b02e5744b17ddc65f48ff1eb6cb54b8de48f"
32
32
  }