agentmail 0.5.18 → 0.5.19
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/inboxes/resources/webhooks/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/inboxes/resources/webhooks/client/Client.js +139 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/pods/resources/webhooks/client/Client.js +139 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +137 -0
- package/dist/cjs/api/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookHeadersRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookHeadersRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaderNamesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaderNamesResponse.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaders.d.ts +6 -0
- package/dist/cjs/api/resources/webhooks/types/WebhookHeaders.js +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +3 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.ts +2 -0
- package/dist/cjs/serialization/resources/webhooks/types/CreateInboxWebhookRequest.js +2 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.d.ts +11 -0
- package/dist/cjs/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.js +43 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.d.ts +9 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.js +41 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaders.d.ts +7 -0
- package/dist/cjs/serialization/resources/webhooks/types/WebhookHeaders.js +39 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.d.ts +3 -0
- package/dist/cjs/serialization/resources/webhooks/types/index.js +3 -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/inboxes/resources/webhooks/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/inboxes/resources/webhooks/client/Client.mjs +139 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/pods/resources/webhooks/client/Client.mjs +139 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +137 -0
- package/dist/esm/api/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookHeadersRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookHeadersRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaderNamesResponse.d.mts +4 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaderNamesResponse.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaders.d.mts +6 -0
- package/dist/esm/api/resources/webhooks/types/WebhookHeaders.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.d.mts +2 -0
- package/dist/esm/serialization/resources/webhooks/types/CreateInboxWebhookRequest.mjs +2 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.d.mts +11 -0
- package/dist/esm/serialization/resources/webhooks/types/UpdateWebhookHeadersRequest.mjs +7 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.d.mts +9 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaderNamesResponse.mjs +5 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaders.d.mts +7 -0
- package/dist/esm/serialization/resources/webhooks/types/WebhookHeaders.mjs +3 -0
- package/dist/esm/serialization/resources/webhooks/types/index.d.mts +3 -0
- package/dist/esm/serialization/resources/webhooks/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +440 -0
|
@@ -7,7 +7,10 @@ export * from "./ListWebhooksResponse.js";
|
|
|
7
7
|
export * from "./UpdateInboxWebhookRequest.js";
|
|
8
8
|
export * from "./UpdatePodWebhookRequest.js";
|
|
9
9
|
export * from "./UpdateWebhookEventTypes.js";
|
|
10
|
+
export * from "./UpdateWebhookHeadersRequest.js";
|
|
10
11
|
export * from "./UpdateWebhookRequest.js";
|
|
11
12
|
export * from "./Url.js";
|
|
12
13
|
export * from "./Webhook.js";
|
|
14
|
+
export * from "./WebhookHeaderNamesResponse.js";
|
|
15
|
+
export * from "./WebhookHeaders.js";
|
|
13
16
|
export * from "./WebhookId.js";
|
|
@@ -23,7 +23,10 @@ __exportStar(require("./ListWebhooksResponse.js"), exports);
|
|
|
23
23
|
__exportStar(require("./UpdateInboxWebhookRequest.js"), exports);
|
|
24
24
|
__exportStar(require("./UpdatePodWebhookRequest.js"), exports);
|
|
25
25
|
__exportStar(require("./UpdateWebhookEventTypes.js"), exports);
|
|
26
|
+
__exportStar(require("./UpdateWebhookHeadersRequest.js"), exports);
|
|
26
27
|
__exportStar(require("./UpdateWebhookRequest.js"), exports);
|
|
27
28
|
__exportStar(require("./Url.js"), exports);
|
|
28
29
|
__exportStar(require("./Webhook.js"), exports);
|
|
30
|
+
__exportStar(require("./WebhookHeaderNamesResponse.js"), exports);
|
|
31
|
+
__exportStar(require("./WebhookHeaders.js"), exports);
|
|
29
32
|
__exportStar(require("./WebhookId.js"), exports);
|
|
@@ -4,11 +4,13 @@ import type * as serializers from "../../../index.js";
|
|
|
4
4
|
import { ClientId } from "./ClientId.js";
|
|
5
5
|
import { CreateWebhookEventTypes } from "./CreateWebhookEventTypes.js";
|
|
6
6
|
import { Url } from "./Url.js";
|
|
7
|
+
import { WebhookHeaders } from "./WebhookHeaders.js";
|
|
7
8
|
export declare const CreateInboxWebhookRequest: core.serialization.ObjectSchema<serializers.webhooks.CreateInboxWebhookRequest.Raw, AgentMail.webhooks.CreateInboxWebhookRequest>;
|
|
8
9
|
export declare namespace CreateInboxWebhookRequest {
|
|
9
10
|
interface Raw {
|
|
10
11
|
url: Url.Raw;
|
|
11
12
|
event_types: CreateWebhookEventTypes.Raw;
|
|
12
13
|
client_id?: ClientId.Raw | null;
|
|
14
|
+
headers?: WebhookHeaders.Raw | null;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -39,8 +39,10 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
39
39
|
const ClientId_js_1 = require("./ClientId.js");
|
|
40
40
|
const CreateWebhookEventTypes_js_1 = require("./CreateWebhookEventTypes.js");
|
|
41
41
|
const Url_js_1 = require("./Url.js");
|
|
42
|
+
const WebhookHeaders_js_1 = require("./WebhookHeaders.js");
|
|
42
43
|
exports.CreateInboxWebhookRequest = core.serialization.object({
|
|
43
44
|
url: Url_js_1.Url,
|
|
44
45
|
eventTypes: core.serialization.property("event_types", CreateWebhookEventTypes_js_1.CreateWebhookEventTypes),
|
|
45
46
|
clientId: core.serialization.property("client_id", ClientId_js_1.ClientId.optional()),
|
|
47
|
+
headers: WebhookHeaders_js_1.WebhookHeaders.optional(),
|
|
46
48
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
import { WebhookHeaders } from "./WebhookHeaders.js";
|
|
5
|
+
export declare const UpdateWebhookHeadersRequest: core.serialization.ObjectSchema<serializers.webhooks.UpdateWebhookHeadersRequest.Raw, AgentMail.webhooks.UpdateWebhookHeadersRequest>;
|
|
6
|
+
export declare namespace UpdateWebhookHeadersRequest {
|
|
7
|
+
interface Raw {
|
|
8
|
+
headers?: WebhookHeaders.Raw | null;
|
|
9
|
+
remove_headers?: string[] | null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.UpdateWebhookHeadersRequest = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
const WebhookHeaders_js_1 = require("./WebhookHeaders.js");
|
|
40
|
+
exports.UpdateWebhookHeadersRequest = core.serialization.object({
|
|
41
|
+
headers: WebhookHeaders_js_1.WebhookHeaders.optional(),
|
|
42
|
+
removeHeaders: core.serialization.property("remove_headers", core.serialization.list(core.serialization.string()).optional()),
|
|
43
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
export declare const WebhookHeaderNamesResponse: core.serialization.ObjectSchema<serializers.webhooks.WebhookHeaderNamesResponse.Raw, AgentMail.webhooks.WebhookHeaderNamesResponse>;
|
|
5
|
+
export declare namespace WebhookHeaderNamesResponse {
|
|
6
|
+
interface Raw {
|
|
7
|
+
header_names: string[];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.WebhookHeaderNamesResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
exports.WebhookHeaderNamesResponse = core.serialization.object({
|
|
40
|
+
headerNames: core.serialization.property("header_names", core.serialization.list(core.serialization.string())),
|
|
41
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as AgentMail from "../../../../api/index.js";
|
|
2
|
+
import * as core from "../../../../core/index.js";
|
|
3
|
+
import type * as serializers from "../../../index.js";
|
|
4
|
+
export declare const WebhookHeaders: core.serialization.Schema<serializers.webhooks.WebhookHeaders.Raw, AgentMail.webhooks.WebhookHeaders>;
|
|
5
|
+
export declare namespace WebhookHeaders {
|
|
6
|
+
type Raw = Record<string, string>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.WebhookHeaders = void 0;
|
|
38
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
39
|
+
exports.WebhookHeaders = core.serialization.record(core.serialization.string(), core.serialization.string());
|
|
@@ -7,7 +7,10 @@ export * from "./ListWebhooksResponse.js";
|
|
|
7
7
|
export * from "./UpdateInboxWebhookRequest.js";
|
|
8
8
|
export * from "./UpdatePodWebhookRequest.js";
|
|
9
9
|
export * from "./UpdateWebhookEventTypes.js";
|
|
10
|
+
export * from "./UpdateWebhookHeadersRequest.js";
|
|
10
11
|
export * from "./UpdateWebhookRequest.js";
|
|
11
12
|
export * from "./Url.js";
|
|
12
13
|
export * from "./Webhook.js";
|
|
14
|
+
export * from "./WebhookHeaderNamesResponse.js";
|
|
15
|
+
export * from "./WebhookHeaders.js";
|
|
13
16
|
export * from "./WebhookId.js";
|
|
@@ -23,7 +23,10 @@ __exportStar(require("./ListWebhooksResponse.js"), exports);
|
|
|
23
23
|
__exportStar(require("./UpdateInboxWebhookRequest.js"), exports);
|
|
24
24
|
__exportStar(require("./UpdatePodWebhookRequest.js"), exports);
|
|
25
25
|
__exportStar(require("./UpdateWebhookEventTypes.js"), exports);
|
|
26
|
+
__exportStar(require("./UpdateWebhookHeadersRequest.js"), exports);
|
|
26
27
|
__exportStar(require("./UpdateWebhookRequest.js"), exports);
|
|
27
28
|
__exportStar(require("./Url.js"), exports);
|
|
28
29
|
__exportStar(require("./Webhook.js"), exports);
|
|
30
|
+
__exportStar(require("./WebhookHeaderNamesResponse.js"), exports);
|
|
31
|
+
__exportStar(require("./WebhookHeaders.js"), exports);
|
|
29
32
|
__exportStar(require("./WebhookId.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.5.
|
|
1
|
+
export declare const SDK_VERSION = "0.5.19";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.5.
|
|
10
|
-
"User-Agent": "agentmail/0.5.
|
|
9
|
+
"X-Fern-SDK-Version": "0.5.19",
|
|
10
|
+
"User-Agent": "agentmail/0.5.19",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -42,6 +42,21 @@ export declare class WebhooksClient {
|
|
|
42
42
|
*/
|
|
43
43
|
get(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
44
44
|
private __get;
|
|
45
|
+
/**
|
|
46
|
+
* List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.
|
|
47
|
+
* Header values are write-only and are never returned.
|
|
48
|
+
*
|
|
49
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
50
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
51
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.inboxes.webhooks.getHeaders("inbox_id", "webhook_id")
|
|
57
|
+
*/
|
|
58
|
+
getHeaders(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.WebhookHeaderNamesResponse>;
|
|
59
|
+
private __getHeaders;
|
|
45
60
|
/**
|
|
46
61
|
* Create a webhook scoped to this inbox.
|
|
47
62
|
*
|
|
@@ -83,6 +98,23 @@ export declare class WebhooksClient {
|
|
|
83
98
|
*/
|
|
84
99
|
update(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateInboxWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
85
100
|
private __update;
|
|
101
|
+
/**
|
|
102
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
103
|
+
* inbox-scoped webhook. Header values remain write-only.
|
|
104
|
+
*
|
|
105
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
106
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
107
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
108
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
111
|
+
* @throws {@link AgentMail.ValidationError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.inboxes.webhooks.updateHeaders("inbox_id", "webhook_id", {})
|
|
115
|
+
*/
|
|
116
|
+
updateHeaders(inbox_id: AgentMail.inboxes.InboxId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookHeadersRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
117
|
+
private __updateHeaders;
|
|
86
118
|
/**
|
|
87
119
|
* **CLI:**
|
|
88
120
|
* ```bash
|
|
@@ -149,6 +149,72 @@ export class WebhooksClient {
|
|
|
149
149
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}");
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.
|
|
154
|
+
* Header values are write-only and are never returned.
|
|
155
|
+
*
|
|
156
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
157
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
158
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
159
|
+
*
|
|
160
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* await client.inboxes.webhooks.getHeaders("inbox_id", "webhook_id")
|
|
164
|
+
*/
|
|
165
|
+
getHeaders(inbox_id, webhook_id, requestOptions) {
|
|
166
|
+
return core.HttpResponsePromise.fromPromise(this.__getHeaders(inbox_id, webhook_id, requestOptions));
|
|
167
|
+
}
|
|
168
|
+
__getHeaders(inbox_id, webhook_id, requestOptions) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
171
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
172
|
+
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);
|
|
173
|
+
const _response = yield core.fetcher({
|
|
174
|
+
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)
|
|
175
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
176
|
+
method: "GET",
|
|
177
|
+
headers: _headers,
|
|
178
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
179
|
+
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,
|
|
180
|
+
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,
|
|
181
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
182
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
183
|
+
logging: this._options.logging,
|
|
184
|
+
});
|
|
185
|
+
if (_response.ok) {
|
|
186
|
+
return {
|
|
187
|
+
data: serializers.webhooks.WebhookHeaderNamesResponse.parseOrThrow(_response.body, {
|
|
188
|
+
unrecognizedObjectKeys: "passthrough",
|
|
189
|
+
allowUnrecognizedUnionMembers: true,
|
|
190
|
+
allowUnrecognizedEnumValues: true,
|
|
191
|
+
skipValidation: true,
|
|
192
|
+
breadcrumbsPrefix: ["response"],
|
|
193
|
+
}),
|
|
194
|
+
rawResponse: _response.rawResponse,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (_response.error.reason === "status-code") {
|
|
198
|
+
switch (_response.error.statusCode) {
|
|
199
|
+
case 404:
|
|
200
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
201
|
+
unrecognizedObjectKeys: "passthrough",
|
|
202
|
+
allowUnrecognizedUnionMembers: true,
|
|
203
|
+
allowUnrecognizedEnumValues: true,
|
|
204
|
+
skipValidation: true,
|
|
205
|
+
breadcrumbsPrefix: ["response"],
|
|
206
|
+
}), _response.rawResponse);
|
|
207
|
+
default:
|
|
208
|
+
throw new errors.AgentMailError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers");
|
|
216
|
+
});
|
|
217
|
+
}
|
|
152
218
|
/**
|
|
153
219
|
* Create a webhook scoped to this inbox.
|
|
154
220
|
*
|
|
@@ -312,6 +378,79 @@ export class WebhooksClient {
|
|
|
312
378
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}");
|
|
313
379
|
});
|
|
314
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
383
|
+
* inbox-scoped webhook. Header values remain write-only.
|
|
384
|
+
*
|
|
385
|
+
* @param {AgentMail.inboxes.InboxId} inbox_id
|
|
386
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
387
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
388
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
389
|
+
*
|
|
390
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
391
|
+
* @throws {@link AgentMail.ValidationError}
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* await client.inboxes.webhooks.updateHeaders("inbox_id", "webhook_id", {})
|
|
395
|
+
*/
|
|
396
|
+
updateHeaders(inbox_id, webhook_id, request, requestOptions) {
|
|
397
|
+
return core.HttpResponsePromise.fromPromise(this.__updateHeaders(inbox_id, webhook_id, request, requestOptions));
|
|
398
|
+
}
|
|
399
|
+
__updateHeaders(inbox_id, webhook_id, request, requestOptions) {
|
|
400
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
402
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
403
|
+
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);
|
|
404
|
+
const _response = yield core.fetcher({
|
|
405
|
+
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)
|
|
406
|
+
.http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/webhooks/${core.url.encodePathParam(serializers.webhooks.WebhookId.jsonOrThrow(webhook_id, { omitUndefined: true }))}/headers`),
|
|
407
|
+
method: "PATCH",
|
|
408
|
+
headers: _headers,
|
|
409
|
+
contentType: "application/json",
|
|
410
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
411
|
+
requestType: "json",
|
|
412
|
+
body: serializers.webhooks.UpdateWebhookHeadersRequest.jsonOrThrow(request, {
|
|
413
|
+
unrecognizedObjectKeys: "strip",
|
|
414
|
+
omitUndefined: true,
|
|
415
|
+
}),
|
|
416
|
+
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,
|
|
417
|
+
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,
|
|
418
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
419
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
420
|
+
logging: this._options.logging,
|
|
421
|
+
});
|
|
422
|
+
if (_response.ok) {
|
|
423
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
424
|
+
}
|
|
425
|
+
if (_response.error.reason === "status-code") {
|
|
426
|
+
switch (_response.error.statusCode) {
|
|
427
|
+
case 404:
|
|
428
|
+
throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
429
|
+
unrecognizedObjectKeys: "passthrough",
|
|
430
|
+
allowUnrecognizedUnionMembers: true,
|
|
431
|
+
allowUnrecognizedEnumValues: true,
|
|
432
|
+
skipValidation: true,
|
|
433
|
+
breadcrumbsPrefix: ["response"],
|
|
434
|
+
}), _response.rawResponse);
|
|
435
|
+
case 400:
|
|
436
|
+
throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
437
|
+
unrecognizedObjectKeys: "passthrough",
|
|
438
|
+
allowUnrecognizedUnionMembers: true,
|
|
439
|
+
allowUnrecognizedEnumValues: true,
|
|
440
|
+
skipValidation: true,
|
|
441
|
+
breadcrumbsPrefix: ["response"],
|
|
442
|
+
}), _response.rawResponse);
|
|
443
|
+
default:
|
|
444
|
+
throw new errors.AgentMailError({
|
|
445
|
+
statusCode: _response.error.statusCode,
|
|
446
|
+
body: _response.error.body,
|
|
447
|
+
rawResponse: _response.rawResponse,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers");
|
|
452
|
+
});
|
|
453
|
+
}
|
|
315
454
|
/**
|
|
316
455
|
* **CLI:**
|
|
317
456
|
* ```bash
|
|
@@ -42,6 +42,21 @@ export declare class WebhooksClient {
|
|
|
42
42
|
*/
|
|
43
43
|
get(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
44
44
|
private __get;
|
|
45
|
+
/**
|
|
46
|
+
* List the names of custom HTTP headers included with deliveries to this pod-scoped webhook.
|
|
47
|
+
* Header values are write-only and are never returned.
|
|
48
|
+
*
|
|
49
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
50
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
51
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
52
|
+
*
|
|
53
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.pods.webhooks.getHeaders("pod_id", "webhook_id")
|
|
57
|
+
*/
|
|
58
|
+
getHeaders(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.WebhookHeaderNamesResponse>;
|
|
59
|
+
private __getHeaders;
|
|
45
60
|
/**
|
|
46
61
|
* Create a webhook scoped to this pod.
|
|
47
62
|
*
|
|
@@ -83,6 +98,23 @@ export declare class WebhooksClient {
|
|
|
83
98
|
*/
|
|
84
99
|
update(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdatePodWebhookRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.Webhook>;
|
|
85
100
|
private __update;
|
|
101
|
+
/**
|
|
102
|
+
* Atomically set, replace, or remove custom HTTP headers included with deliveries to this
|
|
103
|
+
* pod-scoped webhook. Header values remain write-only.
|
|
104
|
+
*
|
|
105
|
+
* @param {AgentMail.pods.PodId} pod_id
|
|
106
|
+
* @param {AgentMail.webhooks.WebhookId} webhook_id
|
|
107
|
+
* @param {AgentMail.webhooks.UpdateWebhookHeadersRequest} request
|
|
108
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
109
|
+
*
|
|
110
|
+
* @throws {@link AgentMail.NotFoundError}
|
|
111
|
+
* @throws {@link AgentMail.ValidationError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.pods.webhooks.updateHeaders("pod_id", "webhook_id", {})
|
|
115
|
+
*/
|
|
116
|
+
updateHeaders(pod_id: AgentMail.pods.PodId, webhook_id: AgentMail.webhooks.WebhookId, request: AgentMail.webhooks.UpdateWebhookHeadersRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
117
|
+
private __updateHeaders;
|
|
86
118
|
/**
|
|
87
119
|
* **CLI:**
|
|
88
120
|
* ```bash
|