agentmail 0.5.15 → 0.5.17
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +94 -0
- package/dist/cjs/api/resources/apiKeys/client/Client.js +372 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/ListPublicKeysRequest.d.ts +10 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/RevokeAllAgentIdSignInKeysRequest.d.ts +10 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/types/ApiKeyPermissions.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/types/CreatePublicKeyRequest.d.ts +21 -0
- package/dist/cjs/api/resources/apiKeys/types/InboxPublicKeyScope.d.ts +7 -0
- package/dist/cjs/api/resources/apiKeys/types/InboxPublicKeyScope.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/ListPublicKeysResponse.d.ts +7 -0
- package/dist/cjs/api/resources/apiKeys/types/ListPublicKeysResponse.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/OrganizationPublicKeyScope.d.ts +4 -0
- package/dist/cjs/api/resources/apiKeys/types/OrganizationPublicKeyScope.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PodPublicKeyScope.d.ts +7 -0
- package/dist/cjs/api/resources/apiKeys/types/PodPublicKeyScope.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicJwk.d.ts +13 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicJwk.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicJwkCoordinate.d.ts +4 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicJwkCoordinate.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyCredential.d.ts +22 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyCredential.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyMaterial.d.ts +9 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyMaterial.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyScope.d.ts +16 -0
- package/dist/cjs/api/resources/apiKeys/types/PublicKeyScope.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.d.ts +8 -0
- package/dist/cjs/api/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/UpdatePublicKeyNameRequest.d.ts +7 -0
- package/dist/cjs/api/resources/apiKeys/types/UpdatePublicKeyNameRequest.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/index.d.ts +12 -0
- package/dist/cjs/api/resources/apiKeys/types/index.js +12 -0
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +2 -3
- package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +6 -11
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +2 -3
- package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +6 -11
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/threads/client/Client.d.ts +2 -3
- package/dist/cjs/api/resources/threads/client/Client.js +6 -11
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +0 -1
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.d.ts +1 -0
- package/dist/cjs/serialization/resources/apiKeys/types/ApiKeyPermissions.js +1 -0
- package/dist/cjs/serialization/resources/apiKeys/types/CreatePublicKeyRequest.d.ts +14 -0
- package/dist/cjs/serialization/resources/apiKeys/types/CreatePublicKeyRequest.js +46 -0
- package/dist/cjs/serialization/resources/apiKeys/types/InboxPublicKeyScope.d.ts +9 -0
- package/dist/cjs/serialization/resources/apiKeys/types/InboxPublicKeyScope.js +41 -0
- package/dist/cjs/serialization/resources/apiKeys/types/ListPublicKeysResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/apiKeys/types/ListPublicKeysResponse.js +46 -0
- package/dist/cjs/serialization/resources/apiKeys/types/OrganizationPublicKeyScope.d.ts +7 -0
- package/dist/cjs/serialization/resources/apiKeys/types/OrganizationPublicKeyScope.js +39 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PodPublicKeyScope.d.ts +9 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PodPublicKeyScope.js +41 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicJwk.d.ts +13 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicJwk.js +45 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicJwkCoordinate.d.ts +7 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicJwkCoordinate.js +39 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyCredential.d.ts +20 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyCredential.js +52 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyMaterial.d.ts +11 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyMaterial.js +43 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyScope.d.ts +19 -0
- package/dist/cjs/serialization/resources/apiKeys/types/PublicKeyScope.js +51 -0
- package/dist/cjs/serialization/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.d.ts +11 -0
- package/dist/cjs/serialization/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.js +43 -0
- package/dist/cjs/serialization/resources/apiKeys/types/UpdatePublicKeyNameRequest.d.ts +9 -0
- package/dist/cjs/serialization/resources/apiKeys/types/UpdatePublicKeyNameRequest.js +41 -0
- package/dist/cjs/serialization/resources/apiKeys/types/index.d.ts +12 -0
- package/dist/cjs/serialization/resources/apiKeys/types/index.js +12 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +94 -0
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +373 -1
- package/dist/esm/api/resources/apiKeys/client/requests/ListPublicKeysRequest.d.mts +10 -0
- package/dist/esm/api/resources/apiKeys/client/requests/RevokeAllAgentIdSignInKeysRequest.d.mts +10 -0
- package/dist/esm/api/resources/apiKeys/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/types/ApiKeyPermissions.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/types/CreatePublicKeyRequest.d.mts +21 -0
- package/dist/esm/api/resources/apiKeys/types/InboxPublicKeyScope.d.mts +7 -0
- package/dist/esm/api/resources/apiKeys/types/InboxPublicKeyScope.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/ListPublicKeysResponse.d.mts +7 -0
- package/dist/esm/api/resources/apiKeys/types/ListPublicKeysResponse.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/OrganizationPublicKeyScope.d.mts +4 -0
- package/dist/esm/api/resources/apiKeys/types/OrganizationPublicKeyScope.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PodPublicKeyScope.d.mts +7 -0
- package/dist/esm/api/resources/apiKeys/types/PodPublicKeyScope.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PublicJwk.d.mts +13 -0
- package/dist/esm/api/resources/apiKeys/types/PublicJwk.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PublicJwkCoordinate.d.mts +4 -0
- package/dist/esm/api/resources/apiKeys/types/PublicJwkCoordinate.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyCredential.d.mts +22 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyCredential.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyMaterial.d.mts +9 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyMaterial.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyScope.d.mts +16 -0
- package/dist/esm/api/resources/apiKeys/types/PublicKeyScope.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.d.mts +8 -0
- package/dist/esm/api/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/UpdatePublicKeyNameRequest.d.mts +7 -0
- package/dist/esm/api/resources/apiKeys/types/UpdatePublicKeyNameRequest.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/index.d.mts +12 -0
- package/dist/esm/api/resources/apiKeys/types/index.mjs +12 -0
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +2 -3
- package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +6 -11
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +2 -3
- package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +6 -11
- package/dist/esm/api/resources/pods/resources/threads/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/threads/client/Client.d.mts +2 -3
- package/dist/esm/api/resources/threads/client/Client.mjs +6 -11
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +0 -1
- package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.d.mts +1 -0
- package/dist/esm/serialization/resources/apiKeys/types/ApiKeyPermissions.mjs +1 -0
- package/dist/esm/serialization/resources/apiKeys/types/CreatePublicKeyRequest.d.mts +14 -0
- package/dist/esm/serialization/resources/apiKeys/types/CreatePublicKeyRequest.mjs +10 -0
- package/dist/esm/serialization/resources/apiKeys/types/InboxPublicKeyScope.d.mts +9 -0
- package/dist/esm/serialization/resources/apiKeys/types/InboxPublicKeyScope.mjs +5 -0
- package/dist/esm/serialization/resources/apiKeys/types/ListPublicKeysResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/apiKeys/types/ListPublicKeysResponse.mjs +10 -0
- package/dist/esm/serialization/resources/apiKeys/types/OrganizationPublicKeyScope.d.mts +7 -0
- package/dist/esm/serialization/resources/apiKeys/types/OrganizationPublicKeyScope.mjs +3 -0
- package/dist/esm/serialization/resources/apiKeys/types/PodPublicKeyScope.d.mts +9 -0
- package/dist/esm/serialization/resources/apiKeys/types/PodPublicKeyScope.mjs +5 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicJwk.d.mts +13 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicJwk.mjs +9 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicJwkCoordinate.d.mts +7 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicJwkCoordinate.mjs +3 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyCredential.d.mts +20 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyCredential.mjs +16 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyMaterial.d.mts +11 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyMaterial.mjs +7 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyScope.d.mts +19 -0
- package/dist/esm/serialization/resources/apiKeys/types/PublicKeyScope.mjs +15 -0
- package/dist/esm/serialization/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.d.mts +11 -0
- package/dist/esm/serialization/resources/apiKeys/types/RevokeAllAgentIdSignInKeysResponse.mjs +7 -0
- package/dist/esm/serialization/resources/apiKeys/types/UpdatePublicKeyNameRequest.d.mts +9 -0
- package/dist/esm/serialization/resources/apiKeys/types/UpdatePublicKeyNameRequest.mjs +5 -0
- package/dist/esm/serialization/resources/apiKeys/types/index.d.mts +12 -0
- package/dist/esm/serialization/resources/apiKeys/types/index.mjs +12 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms.txt +2 -4
- package/package.json +1 -1
- package/reference.md +356 -30
- package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
- package/dist/cjs/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
- package/dist/cjs/api/resources/threads/client/requests/DeleteThreadRequest.d.ts +0 -8
- package/dist/esm/api/resources/inboxes/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
- package/dist/esm/api/resources/pods/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
- package/dist/esm/api/resources/threads/client/requests/DeleteThreadRequest.d.mts +0 -8
- /package/dist/cjs/api/resources/{inboxes/resources/threads/client/requests/DeleteThreadRequest.js → apiKeys/client/requests/ListPublicKeysRequest.js} +0 -0
- /package/dist/cjs/api/resources/{pods/resources/threads/client/requests/DeleteThreadRequest.js → apiKeys/client/requests/RevokeAllAgentIdSignInKeysRequest.js} +0 -0
- /package/dist/cjs/api/resources/{threads/client/requests/DeleteThreadRequest.js → apiKeys/types/CreatePublicKeyRequest.js} +0 -0
- /package/dist/esm/api/resources/{inboxes/resources/threads/client/requests/DeleteThreadRequest.mjs → apiKeys/client/requests/ListPublicKeysRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{pods/resources/threads/client/requests/DeleteThreadRequest.mjs → apiKeys/client/requests/RevokeAllAgentIdSignInKeysRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{threads/client/requests/DeleteThreadRequest.mjs → apiKeys/types/CreatePublicKeyRequest.mjs} +0 -0
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
12
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../environments.mjs";
|
|
15
15
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -211,4 +211,376 @@ export class ApiKeysClient {
|
|
|
211
211
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/api-keys/{api_key_id}");
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* List only public-key credentials visible to the bearer caller's scope.
|
|
216
|
+
* Bearer credentials are never returned, even though both credential types
|
|
217
|
+
* share storage and pagination indexes. Requires `api_key_read`.
|
|
218
|
+
*
|
|
219
|
+
* @param {AgentMail.ListPublicKeysRequest} request
|
|
220
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* await client.apiKeys.listPublicKeys()
|
|
224
|
+
*/
|
|
225
|
+
listPublicKeys(request = {}, requestOptions) {
|
|
226
|
+
return core.HttpResponsePromise.fromPromise(this.__listPublicKeys(request, requestOptions));
|
|
227
|
+
}
|
|
228
|
+
__listPublicKeys() {
|
|
229
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
230
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
231
|
+
const { limit, pageToken, ascending } = request;
|
|
232
|
+
const _queryParams = {
|
|
233
|
+
limit,
|
|
234
|
+
page_token: pageToken,
|
|
235
|
+
ascending,
|
|
236
|
+
};
|
|
237
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
238
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
239
|
+
const _response = yield core.fetcher({
|
|
240
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
241
|
+
.http, "/v0/api-keys/public-keys"),
|
|
242
|
+
method: "GET",
|
|
243
|
+
headers: _headers,
|
|
244
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
245
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
246
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
247
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
248
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
249
|
+
logging: this._options.logging,
|
|
250
|
+
});
|
|
251
|
+
if (_response.ok) {
|
|
252
|
+
return {
|
|
253
|
+
data: serializers.ListPublicKeysResponse.parseOrThrow(_response.body, {
|
|
254
|
+
unrecognizedObjectKeys: "passthrough",
|
|
255
|
+
allowUnrecognizedUnionMembers: true,
|
|
256
|
+
allowUnrecognizedEnumValues: true,
|
|
257
|
+
skipValidation: true,
|
|
258
|
+
breadcrumbsPrefix: ["response"],
|
|
259
|
+
}),
|
|
260
|
+
rawResponse: _response.rawResponse,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (_response.error.reason === "status-code") {
|
|
264
|
+
throw new errors.AgentMailError({
|
|
265
|
+
statusCode: _response.error.statusCode,
|
|
266
|
+
body: _response.error.body,
|
|
267
|
+
rawResponse: _response.rawResponse,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/api-keys/public-keys");
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Register a public P-256 JWK using an existing AgentMail bearer API key
|
|
275
|
+
* with `api_key_create`. Re-registering the same JWK creates a new
|
|
276
|
+
* credential ID; it does not replace or recover an earlier credential.
|
|
277
|
+
* The private key must never be sent to AgentMail.
|
|
278
|
+
*
|
|
279
|
+
* @param {AgentMail.CreatePublicKeyRequest} request
|
|
280
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
281
|
+
*
|
|
282
|
+
* @throws {@link AgentMail.ValidationError}
|
|
283
|
+
* @throws {@link AgentMail.ConflictError}
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* await client.apiKeys.createPublicKey({
|
|
287
|
+
* publicKey: {
|
|
288
|
+
* kty: "EC",
|
|
289
|
+
* crv: "P-256",
|
|
290
|
+
* x: "blackcurrant...............................",
|
|
291
|
+
* y: "blackcurrant..............................."
|
|
292
|
+
* }
|
|
293
|
+
* })
|
|
294
|
+
*/
|
|
295
|
+
createPublicKey(request, requestOptions) {
|
|
296
|
+
return core.HttpResponsePromise.fromPromise(this.__createPublicKey(request, requestOptions));
|
|
297
|
+
}
|
|
298
|
+
__createPublicKey(request, requestOptions) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
301
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
302
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
303
|
+
const _response = yield core.fetcher({
|
|
304
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
305
|
+
.http, "/v0/api-keys/public-keys"),
|
|
306
|
+
method: "POST",
|
|
307
|
+
headers: _headers,
|
|
308
|
+
contentType: "application/json",
|
|
309
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
310
|
+
requestType: "json",
|
|
311
|
+
body: serializers.CreatePublicKeyRequest.jsonOrThrow(request, {
|
|
312
|
+
unrecognizedObjectKeys: "strip",
|
|
313
|
+
omitUndefined: true,
|
|
314
|
+
}),
|
|
315
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
316
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
317
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
318
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
319
|
+
logging: this._options.logging,
|
|
320
|
+
});
|
|
321
|
+
if (_response.ok) {
|
|
322
|
+
return {
|
|
323
|
+
data: serializers.PublicKeyCredential.parseOrThrow(_response.body, {
|
|
324
|
+
unrecognizedObjectKeys: "passthrough",
|
|
325
|
+
allowUnrecognizedUnionMembers: true,
|
|
326
|
+
allowUnrecognizedEnumValues: true,
|
|
327
|
+
skipValidation: true,
|
|
328
|
+
breadcrumbsPrefix: ["response"],
|
|
329
|
+
}),
|
|
330
|
+
rawResponse: _response.rawResponse,
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
if (_response.error.reason === "status-code") {
|
|
334
|
+
switch (_response.error.statusCode) {
|
|
335
|
+
case 400:
|
|
336
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
337
|
+
unrecognizedObjectKeys: "passthrough",
|
|
338
|
+
allowUnrecognizedUnionMembers: true,
|
|
339
|
+
allowUnrecognizedEnumValues: true,
|
|
340
|
+
skipValidation: true,
|
|
341
|
+
breadcrumbsPrefix: ["response"],
|
|
342
|
+
}), _response.rawResponse);
|
|
343
|
+
case 409:
|
|
344
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
345
|
+
unrecognizedObjectKeys: "passthrough",
|
|
346
|
+
allowUnrecognizedUnionMembers: true,
|
|
347
|
+
allowUnrecognizedEnumValues: true,
|
|
348
|
+
skipValidation: true,
|
|
349
|
+
breadcrumbsPrefix: ["response"],
|
|
350
|
+
}), _response.rawResponse);
|
|
351
|
+
default:
|
|
352
|
+
throw new errors.AgentMailError({
|
|
353
|
+
statusCode: _response.error.statusCode,
|
|
354
|
+
body: _response.error.body,
|
|
355
|
+
rawResponse: _response.rawResponse,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/api-keys/public-keys");
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Rename the credential. All security-relevant fields are immutable.
|
|
364
|
+
* Requires `api_key_update`.
|
|
365
|
+
*
|
|
366
|
+
* @param {string} api_key_id - Public-key credential ID returned by registration.
|
|
367
|
+
* @param {AgentMail.UpdatePublicKeyNameRequest} request
|
|
368
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
369
|
+
*
|
|
370
|
+
* @throws {@link AgentMail.ValidationError}
|
|
371
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* await client.apiKeys.updatePublicKeyName("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", {
|
|
375
|
+
* name: "x"
|
|
376
|
+
* })
|
|
377
|
+
*/
|
|
378
|
+
updatePublicKeyName(api_key_id, request, requestOptions) {
|
|
379
|
+
return core.HttpResponsePromise.fromPromise(this.__updatePublicKeyName(api_key_id, request, requestOptions));
|
|
380
|
+
}
|
|
381
|
+
__updatePublicKeyName(api_key_id, request, requestOptions) {
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
384
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
385
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
386
|
+
const _response = yield core.fetcher({
|
|
387
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
388
|
+
.http, `/v0/api-keys/public-keys/${core.url.encodePathParam(api_key_id)}`),
|
|
389
|
+
method: "PATCH",
|
|
390
|
+
headers: _headers,
|
|
391
|
+
contentType: "application/json",
|
|
392
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
393
|
+
requestType: "json",
|
|
394
|
+
body: serializers.UpdatePublicKeyNameRequest.jsonOrThrow(request, {
|
|
395
|
+
unrecognizedObjectKeys: "strip",
|
|
396
|
+
omitUndefined: true,
|
|
397
|
+
}),
|
|
398
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
399
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
400
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
401
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
402
|
+
logging: this._options.logging,
|
|
403
|
+
});
|
|
404
|
+
if (_response.ok) {
|
|
405
|
+
return {
|
|
406
|
+
data: serializers.PublicKeyCredential.parseOrThrow(_response.body, {
|
|
407
|
+
unrecognizedObjectKeys: "passthrough",
|
|
408
|
+
allowUnrecognizedUnionMembers: true,
|
|
409
|
+
allowUnrecognizedEnumValues: true,
|
|
410
|
+
skipValidation: true,
|
|
411
|
+
breadcrumbsPrefix: ["response"],
|
|
412
|
+
}),
|
|
413
|
+
rawResponse: _response.rawResponse,
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
if (_response.error.reason === "status-code") {
|
|
417
|
+
switch (_response.error.statusCode) {
|
|
418
|
+
case 400:
|
|
419
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
420
|
+
unrecognizedObjectKeys: "passthrough",
|
|
421
|
+
allowUnrecognizedUnionMembers: true,
|
|
422
|
+
allowUnrecognizedEnumValues: true,
|
|
423
|
+
skipValidation: true,
|
|
424
|
+
breadcrumbsPrefix: ["response"],
|
|
425
|
+
}), _response.rawResponse);
|
|
426
|
+
case 404:
|
|
427
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
428
|
+
unrecognizedObjectKeys: "passthrough",
|
|
429
|
+
allowUnrecognizedUnionMembers: true,
|
|
430
|
+
allowUnrecognizedEnumValues: true,
|
|
431
|
+
skipValidation: true,
|
|
432
|
+
breadcrumbsPrefix: ["response"],
|
|
433
|
+
}), _response.rawResponse);
|
|
434
|
+
default:
|
|
435
|
+
throw new errors.AgentMailError({
|
|
436
|
+
statusCode: _response.error.statusCode,
|
|
437
|
+
body: _response.error.body,
|
|
438
|
+
rawResponse: _response.rawResponse,
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/api-keys/public-keys/{api_key_id}");
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Permanently revoke one public-key credential. This hard-deletes the
|
|
447
|
+
* credential; repeating the request returns not found. Requires
|
|
448
|
+
* `api_key_delete`.
|
|
449
|
+
*
|
|
450
|
+
* @param {string} api_key_id - Public-key credential ID returned by registration.
|
|
451
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
452
|
+
*
|
|
453
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
* await client.apiKeys.revokePublicKey("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
|
|
457
|
+
*/
|
|
458
|
+
revokePublicKey(api_key_id, requestOptions) {
|
|
459
|
+
return core.HttpResponsePromise.fromPromise(this.__revokePublicKey(api_key_id, requestOptions));
|
|
460
|
+
}
|
|
461
|
+
__revokePublicKey(api_key_id, requestOptions) {
|
|
462
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
463
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
464
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
465
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
466
|
+
const _response = yield core.fetcher({
|
|
467
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
468
|
+
.http, `/v0/api-keys/public-keys/${core.url.encodePathParam(api_key_id)}`),
|
|
469
|
+
method: "DELETE",
|
|
470
|
+
headers: _headers,
|
|
471
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
472
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
473
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
474
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
475
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
476
|
+
logging: this._options.logging,
|
|
477
|
+
});
|
|
478
|
+
if (_response.ok) {
|
|
479
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
480
|
+
}
|
|
481
|
+
if (_response.error.reason === "status-code") {
|
|
482
|
+
switch (_response.error.statusCode) {
|
|
483
|
+
case 404:
|
|
484
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
485
|
+
unrecognizedObjectKeys: "passthrough",
|
|
486
|
+
allowUnrecognizedUnionMembers: true,
|
|
487
|
+
allowUnrecognizedEnumValues: true,
|
|
488
|
+
skipValidation: true,
|
|
489
|
+
breadcrumbsPrefix: ["response"],
|
|
490
|
+
}), _response.rawResponse);
|
|
491
|
+
default:
|
|
492
|
+
throw new errors.AgentMailError({
|
|
493
|
+
statusCode: _response.error.statusCode,
|
|
494
|
+
body: _response.error.body,
|
|
495
|
+
rawResponse: _response.rawResponse,
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v0/api-keys/public-keys/{api_key_id}");
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Invalidate every current public-key credential in the caller's
|
|
504
|
+
* organization by advancing its AgentID key generation. The caller must be
|
|
505
|
+
* organization-scoped and either have `api_key_delete` or, for a verified
|
|
506
|
+
* self-serve agent organization, use an unrestricted unmanaged bearer
|
|
507
|
+
* credential. No request body is accepted.
|
|
508
|
+
*
|
|
509
|
+
* `Idempotency-Key` is required and must be a UUID. Reusing the same UUID
|
|
510
|
+
* returns the original permanent receipt without advancing the generation
|
|
511
|
+
* again. A new UUID performs a new generation advance.
|
|
512
|
+
*
|
|
513
|
+
* @param {AgentMail.RevokeAllAgentIdSignInKeysRequest} request
|
|
514
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
515
|
+
*
|
|
516
|
+
* @throws {@link AgentMail.ValidationError}
|
|
517
|
+
* @throws {@link AgentMail.ConflictError}
|
|
518
|
+
*
|
|
519
|
+
* @example
|
|
520
|
+
* await client.apiKeys.revokeAllAgentIdSignInKeys({
|
|
521
|
+
* idempotencyKey: "Idempotency-Key"
|
|
522
|
+
* })
|
|
523
|
+
*/
|
|
524
|
+
revokeAllAgentIdSignInKeys(request, requestOptions) {
|
|
525
|
+
return core.HttpResponsePromise.fromPromise(this.__revokeAllAgentIdSignInKeys(request, requestOptions));
|
|
526
|
+
}
|
|
527
|
+
__revokeAllAgentIdSignInKeys(request, requestOptions) {
|
|
528
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
529
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
530
|
+
const { idempotencyKey } = request;
|
|
531
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
532
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
533
|
+
const _response = yield core.fetcher({
|
|
534
|
+
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
|
|
535
|
+
.http, "/v0/api-keys/public-keys/agentid-sign-in/revoke-all"),
|
|
536
|
+
method: "POST",
|
|
537
|
+
headers: _headers,
|
|
538
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
539
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
540
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
541
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
542
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
543
|
+
logging: this._options.logging,
|
|
544
|
+
});
|
|
545
|
+
if (_response.ok) {
|
|
546
|
+
return {
|
|
547
|
+
data: serializers.RevokeAllAgentIdSignInKeysResponse.parseOrThrow(_response.body, {
|
|
548
|
+
unrecognizedObjectKeys: "passthrough",
|
|
549
|
+
allowUnrecognizedUnionMembers: true,
|
|
550
|
+
allowUnrecognizedEnumValues: true,
|
|
551
|
+
skipValidation: true,
|
|
552
|
+
breadcrumbsPrefix: ["response"],
|
|
553
|
+
}),
|
|
554
|
+
rawResponse: _response.rawResponse,
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
if (_response.error.reason === "status-code") {
|
|
558
|
+
switch (_response.error.statusCode) {
|
|
559
|
+
case 400:
|
|
560
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
561
|
+
unrecognizedObjectKeys: "passthrough",
|
|
562
|
+
allowUnrecognizedUnionMembers: true,
|
|
563
|
+
allowUnrecognizedEnumValues: true,
|
|
564
|
+
skipValidation: true,
|
|
565
|
+
breadcrumbsPrefix: ["response"],
|
|
566
|
+
}), _response.rawResponse);
|
|
567
|
+
case 409:
|
|
568
|
+
throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
569
|
+
unrecognizedObjectKeys: "passthrough",
|
|
570
|
+
allowUnrecognizedUnionMembers: true,
|
|
571
|
+
allowUnrecognizedEnumValues: true,
|
|
572
|
+
skipValidation: true,
|
|
573
|
+
breadcrumbsPrefix: ["response"],
|
|
574
|
+
}), _response.rawResponse);
|
|
575
|
+
default:
|
|
576
|
+
throw new errors.AgentMailError({
|
|
577
|
+
statusCode: _response.error.statusCode,
|
|
578
|
+
body: _response.error.body,
|
|
579
|
+
rawResponse: _response.rawResponse,
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/api-keys/public-keys/agentid-sign-in/revoke-all");
|
|
584
|
+
});
|
|
585
|
+
}
|
|
214
586
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Register only a public P-256 JWK. Credential type, `api_key_id`, sign-in
|
|
4
|
+
* eligibility, permissions, and generation are server-owned and are not
|
|
5
|
+
* request properties.
|
|
6
|
+
*/
|
|
7
|
+
export interface CreatePublicKeyRequest {
|
|
8
|
+
publicKey: AgentMail.PublicJwk;
|
|
9
|
+
/** Defaults to `AgentID key {first eight fingerprint characters}`. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Omit to inherit the registering bearer key's exact scope. An explicit
|
|
13
|
+
* scope must be the caller's scope or a live descendant.
|
|
14
|
+
*/
|
|
15
|
+
scope?: AgentMail.PublicKeyScope;
|
|
16
|
+
/**
|
|
17
|
+
* Future absolute expiry. Omit to inherit the registering bearer key's
|
|
18
|
+
* expiry. A child credential cannot outlive its creator.
|
|
19
|
+
*/
|
|
20
|
+
expiresAt?: Date;
|
|
21
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
export interface ListPublicKeysResponse {
|
|
3
|
+
count: AgentMail.Count;
|
|
4
|
+
nextPageToken?: AgentMail.PageToken;
|
|
5
|
+
/** Public-key credentials only, ordered by creation time descending by default. */
|
|
6
|
+
publicKeys: AgentMail.PublicKeyCredential[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* A public P-256 JWK. The object accepts exactly `kty`, `crv`, `x`, and `y`.
|
|
4
|
+
* Private key material such as `d`, embedded key IDs, and all other members
|
|
5
|
+
* are rejected. The server also rejects coordinates that are not a point on
|
|
6
|
+
* P-256.
|
|
7
|
+
*/
|
|
8
|
+
export interface PublicJwk {
|
|
9
|
+
kty: "EC";
|
|
10
|
+
crv: "P-256";
|
|
11
|
+
x: AgentMail.PublicJwkCoordinate;
|
|
12
|
+
y: AgentMail.PublicJwkCoordinate;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* An AgentID sign-in credential. `type` and `api_key_id` are server-owned;
|
|
4
|
+
* use `api_key_id` as the JWS `kid`. This response never contains a bearer
|
|
5
|
+
* secret or private key.
|
|
6
|
+
*/
|
|
7
|
+
export interface PublicKeyCredential {
|
|
8
|
+
/** Server-generated credential ID. Store this value as the signing key's `kid`. */
|
|
9
|
+
apiKeyId: string;
|
|
10
|
+
/** Server-owned credential discriminator. Callers cannot select or update it. */
|
|
11
|
+
type: "public_key";
|
|
12
|
+
/** Human-readable credential name. */
|
|
13
|
+
name: AgentMail.Name;
|
|
14
|
+
publicKey: AgentMail.PublicKeyMaterial;
|
|
15
|
+
scope: AgentMail.PublicKeyScope;
|
|
16
|
+
/** Immutable absolute expiry. Omitted when the credential does not expire. */
|
|
17
|
+
expiresAt?: Date;
|
|
18
|
+
/** Present when organization-wide revoke-all invalidated this credential generation. */
|
|
19
|
+
revokedAt?: Date;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Registered public key material and its server-computed RFC 7638 thumbprint.
|
|
4
|
+
*/
|
|
5
|
+
export interface PublicKeyMaterial {
|
|
6
|
+
jwk: AgentMail.PublicJwk;
|
|
7
|
+
/** RFC 7638 SHA-256 JWK thumbprint encoded as unpadded base64url. */
|
|
8
|
+
fingerprint: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* The immutable scope in which a public-key credential can approve AgentID sign-in.
|
|
4
|
+
*/
|
|
5
|
+
export type PublicKeyScope = AgentMail.PublicKeyScope.Organization | AgentMail.PublicKeyScope.Pod | AgentMail.PublicKeyScope.Inbox;
|
|
6
|
+
export declare namespace PublicKeyScope {
|
|
7
|
+
interface Organization extends AgentMail.OrganizationPublicKeyScope {
|
|
8
|
+
type: "organization";
|
|
9
|
+
}
|
|
10
|
+
interface Pod extends AgentMail.PodPublicKeyScope {
|
|
11
|
+
type: "pod";
|
|
12
|
+
}
|
|
13
|
+
interface Inbox extends AgentMail.InboxPublicKeyScope {
|
|
14
|
+
type: "inbox";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -4,6 +4,18 @@ export * from "./ApiKeyPermissions.mjs";
|
|
|
4
4
|
export * from "./CreateApiKeyRequest.mjs";
|
|
5
5
|
export * from "./CreateApiKeyResponse.mjs";
|
|
6
6
|
export * from "./CreatedAt.mjs";
|
|
7
|
+
export * from "./CreatePublicKeyRequest.mjs";
|
|
8
|
+
export * from "./InboxPublicKeyScope.mjs";
|
|
7
9
|
export * from "./ListApiKeysResponse.mjs";
|
|
10
|
+
export * from "./ListPublicKeysResponse.mjs";
|
|
8
11
|
export * from "./Name.mjs";
|
|
12
|
+
export * from "./OrganizationPublicKeyScope.mjs";
|
|
13
|
+
export * from "./PodPublicKeyScope.mjs";
|
|
9
14
|
export * from "./Prefix.mjs";
|
|
15
|
+
export * from "./PublicJwk.mjs";
|
|
16
|
+
export * from "./PublicJwkCoordinate.mjs";
|
|
17
|
+
export * from "./PublicKeyCredential.mjs";
|
|
18
|
+
export * from "./PublicKeyMaterial.mjs";
|
|
19
|
+
export * from "./PublicKeyScope.mjs";
|
|
20
|
+
export * from "./RevokeAllAgentIdSignInKeysResponse.mjs";
|
|
21
|
+
export * from "./UpdatePublicKeyNameRequest.mjs";
|