agentmail 0.0.73 → 0.0.74

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.
Files changed (132) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/apiKeys/client/Client.js +52 -62
  4. package/dist/cjs/api/resources/domains/client/Client.d.ts +19 -7
  5. package/dist/cjs/api/resources/domains/client/Client.js +129 -76
  6. package/dist/cjs/api/resources/domains/types/Domain.d.ts +0 -1
  7. package/dist/cjs/api/resources/drafts/client/Client.d.ts +2 -1
  8. package/dist/cjs/api/resources/drafts/client/Client.js +70 -83
  9. package/dist/cjs/api/resources/drafts/types/CreateDraftRequest.d.ts +1 -0
  10. package/dist/cjs/api/resources/drafts/types/Draft.d.ts +1 -0
  11. package/dist/cjs/api/resources/drafts/types/DraftClientId.d.ts +7 -0
  12. package/dist/cjs/api/resources/drafts/types/DraftClientId.js +5 -0
  13. package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.d.ts +14 -0
  14. package/dist/cjs/api/resources/drafts/types/UpdateDraftRequest.js +5 -0
  15. package/dist/cjs/api/resources/drafts/types/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/drafts/types/index.js +2 -0
  17. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +2 -1
  18. package/dist/cjs/api/resources/inboxes/client/Client.js +52 -62
  19. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +26 -2
  20. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +161 -84
  21. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +2 -1
  22. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +70 -83
  23. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.d.ts +2 -1
  24. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +70 -83
  25. package/dist/cjs/api/resources/pods/client/Client.d.ts +2 -1
  26. package/dist/cjs/api/resources/pods/client/Client.js +52 -62
  27. package/dist/cjs/api/resources/pods/resources/domains/client/Client.d.ts +2 -1
  28. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +70 -83
  29. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.d.ts +2 -1
  30. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +70 -83
  31. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.d.ts +2 -1
  32. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +70 -83
  33. package/dist/cjs/api/resources/pods/resources/threads/client/Client.d.ts +2 -1
  34. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +70 -83
  35. package/dist/cjs/api/resources/threads/client/Client.d.ts +2 -1
  36. package/dist/cjs/api/resources/threads/client/Client.js +70 -83
  37. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +2 -1
  38. package/dist/cjs/api/resources/webhooks/client/Client.js +52 -62
  39. package/dist/cjs/core/index.d.ts +0 -2
  40. package/dist/cjs/core/index.js +0 -2
  41. package/dist/cjs/serialization/resources/domains/types/Domain.d.ts +0 -2
  42. package/dist/cjs/serialization/resources/domains/types/Domain.js +0 -2
  43. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +2 -0
  44. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +2 -0
  45. package/dist/cjs/serialization/resources/drafts/types/Draft.d.ts +2 -0
  46. package/dist/cjs/serialization/resources/drafts/types/Draft.js +2 -0
  47. package/dist/cjs/serialization/resources/drafts/types/DraftClientId.d.ts +10 -0
  48. package/dist/cjs/serialization/resources/drafts/types/DraftClientId.js +41 -0
  49. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.d.ts +27 -0
  50. package/dist/cjs/serialization/resources/drafts/types/UpdateDraftRequest.js +58 -0
  51. package/dist/cjs/serialization/resources/drafts/types/index.d.ts +2 -0
  52. package/dist/cjs/serialization/resources/drafts/types/index.js +2 -0
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/Client.mjs +2 -2
  56. package/dist/esm/api/resources/apiKeys/client/Client.d.mts +2 -1
  57. package/dist/esm/api/resources/apiKeys/client/Client.mjs +52 -62
  58. package/dist/esm/api/resources/domains/client/Client.d.mts +19 -7
  59. package/dist/esm/api/resources/domains/client/Client.mjs +129 -76
  60. package/dist/esm/api/resources/domains/types/Domain.d.mts +0 -1
  61. package/dist/esm/api/resources/drafts/client/Client.d.mts +2 -1
  62. package/dist/esm/api/resources/drafts/client/Client.mjs +70 -83
  63. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +1 -0
  64. package/dist/esm/api/resources/drafts/types/Draft.d.mts +1 -0
  65. package/dist/esm/api/resources/drafts/types/DraftClientId.d.mts +7 -0
  66. package/dist/esm/api/resources/drafts/types/DraftClientId.mjs +4 -0
  67. package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.d.mts +14 -0
  68. package/dist/esm/api/resources/drafts/types/UpdateDraftRequest.mjs +4 -0
  69. package/dist/esm/api/resources/drafts/types/index.d.mts +2 -0
  70. package/dist/esm/api/resources/drafts/types/index.mjs +2 -0
  71. package/dist/esm/api/resources/inboxes/client/Client.d.mts +2 -1
  72. package/dist/esm/api/resources/inboxes/client/Client.mjs +52 -62
  73. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +26 -2
  74. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +161 -84
  75. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +2 -1
  76. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +70 -83
  77. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.d.mts +2 -1
  78. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +70 -83
  79. package/dist/esm/api/resources/pods/client/Client.d.mts +2 -1
  80. package/dist/esm/api/resources/pods/client/Client.mjs +52 -62
  81. package/dist/esm/api/resources/pods/resources/domains/client/Client.d.mts +2 -1
  82. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +70 -83
  83. package/dist/esm/api/resources/pods/resources/drafts/client/Client.d.mts +2 -1
  84. package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +70 -83
  85. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.d.mts +2 -1
  86. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +70 -83
  87. package/dist/esm/api/resources/pods/resources/threads/client/Client.d.mts +2 -1
  88. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +70 -83
  89. package/dist/esm/api/resources/threads/client/Client.d.mts +2 -1
  90. package/dist/esm/api/resources/threads/client/Client.mjs +70 -83
  91. package/dist/esm/api/resources/webhooks/client/Client.d.mts +2 -1
  92. package/dist/esm/api/resources/webhooks/client/Client.mjs +52 -62
  93. package/dist/esm/core/index.d.mts +0 -2
  94. package/dist/esm/core/index.mjs +0 -2
  95. package/dist/esm/serialization/resources/domains/types/Domain.d.mts +0 -2
  96. package/dist/esm/serialization/resources/domains/types/Domain.mjs +0 -2
  97. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +2 -0
  98. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +2 -0
  99. package/dist/esm/serialization/resources/drafts/types/Draft.d.mts +2 -0
  100. package/dist/esm/serialization/resources/drafts/types/Draft.mjs +2 -0
  101. package/dist/esm/serialization/resources/drafts/types/DraftClientId.d.mts +10 -0
  102. package/dist/esm/serialization/resources/drafts/types/DraftClientId.mjs +5 -0
  103. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.d.mts +27 -0
  104. package/dist/esm/serialization/resources/drafts/types/UpdateDraftRequest.mjs +22 -0
  105. package/dist/esm/serialization/resources/drafts/types/index.d.mts +2 -0
  106. package/dist/esm/serialization/resources/drafts/types/index.mjs +2 -0
  107. package/dist/esm/version.d.mts +1 -1
  108. package/dist/esm/version.mjs +1 -1
  109. package/dist/llms-full.txt +4855 -371
  110. package/dist/llms.txt +19 -2
  111. package/package.json +1 -1
  112. package/reference.md +156 -160
  113. package/dist/cjs/core/pagination/Page.d.ts +0 -32
  114. package/dist/cjs/core/pagination/Page.js +0 -100
  115. package/dist/cjs/core/pagination/Pageable.d.ts +0 -14
  116. package/dist/cjs/core/pagination/Pageable.js +0 -10
  117. package/dist/cjs/core/pagination/index.d.ts +0 -2
  118. package/dist/cjs/core/pagination/index.js +0 -7
  119. package/dist/cjs/core/utils/index.d.ts +0 -1
  120. package/dist/cjs/core/utils/index.js +0 -5
  121. package/dist/cjs/core/utils/setObjectProperty.d.ts +0 -11
  122. package/dist/cjs/core/utils/setObjectProperty.js +0 -42
  123. package/dist/esm/core/pagination/Page.d.mts +0 -32
  124. package/dist/esm/core/pagination/Page.mjs +0 -96
  125. package/dist/esm/core/pagination/Pageable.d.mts +0 -14
  126. package/dist/esm/core/pagination/Pageable.mjs +0 -6
  127. package/dist/esm/core/pagination/index.d.mts +0 -2
  128. package/dist/esm/core/pagination/index.mjs +0 -2
  129. package/dist/esm/core/utils/index.d.mts +0 -1
  130. package/dist/esm/core/utils/index.mjs +0 -1
  131. package/dist/esm/core/utils/setObjectProperty.d.mts +0 -11
  132. package/dist/esm/core/utils/setObjectProperty.mjs +0 -39
@@ -30,100 +30,87 @@ export class Threads {
30
30
  * @example
31
31
  * await client.threads.list()
32
32
  */
33
- list() {
33
+ list(request = {}, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
35
+ }
36
+ __list() {
34
37
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
35
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
36
- var _a, _b, _c;
37
- const { limit, pageToken, labels, before, after, ascending } = request;
38
- const _queryParams = {};
39
- if (limit != null) {
40
- _queryParams["limit"] = limit.toString();
41
- }
42
- if (pageToken != null) {
43
- _queryParams["page_token"] = pageToken;
44
- }
45
- if (labels != null) {
46
- _queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, {
47
- unrecognizedObjectKeys: "strip",
48
- omitUndefined: true,
49
- }));
50
- }
51
- if (before != null) {
52
- _queryParams["before"] = before.toISOString();
53
- }
54
- if (after != null) {
55
- _queryParams["after"] = after.toISOString();
56
- }
57
- if (ascending != null) {
58
- _queryParams["ascending"] = ascending.toString();
59
- }
60
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
61
- const _response = yield core.fetcher({
62
- 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.Production).http, "/v0/threads"),
63
- method: "GET",
64
- headers: _headers,
65
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
66
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
67
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
68
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
69
- });
70
- if (_response.ok) {
71
- return {
72
- data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
38
+ var _a, _b, _c;
39
+ const { limit, pageToken, labels, before, after, ascending } = request;
40
+ const _queryParams = {};
41
+ if (limit != null) {
42
+ _queryParams["limit"] = limit.toString();
43
+ }
44
+ if (pageToken != null) {
45
+ _queryParams["page_token"] = pageToken;
46
+ }
47
+ if (labels != null) {
48
+ _queryParams["labels"] = toJson(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
49
+ }
50
+ if (before != null) {
51
+ _queryParams["before"] = before.toISOString();
52
+ }
53
+ if (after != null) {
54
+ _queryParams["after"] = after.toISOString();
55
+ }
56
+ if (ascending != null) {
57
+ _queryParams["ascending"] = ascending.toString();
58
+ }
59
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
60
+ const _response = yield core.fetcher({
61
+ 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.Production).http, "/v0/threads"),
62
+ method: "GET",
63
+ headers: _headers,
64
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
65
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
66
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
67
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
68
+ });
69
+ if (_response.ok) {
70
+ return {
71
+ data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
72
+ unrecognizedObjectKeys: "passthrough",
73
+ allowUnrecognizedUnionMembers: true,
74
+ allowUnrecognizedEnumValues: true,
75
+ skipValidation: true,
76
+ breadcrumbsPrefix: ["response"],
77
+ }),
78
+ rawResponse: _response.rawResponse,
79
+ };
80
+ }
81
+ if (_response.error.reason === "status-code") {
82
+ switch (_response.error.statusCode) {
83
+ case 404:
84
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
73
85
  unrecognizedObjectKeys: "passthrough",
74
86
  allowUnrecognizedUnionMembers: true,
75
87
  allowUnrecognizedEnumValues: true,
76
88
  skipValidation: true,
77
89
  breadcrumbsPrefix: ["response"],
78
- }),
79
- rawResponse: _response.rawResponse,
80
- };
81
- }
82
- if (_response.error.reason === "status-code") {
83
- switch (_response.error.statusCode) {
84
- case 404:
85
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
86
- unrecognizedObjectKeys: "passthrough",
87
- allowUnrecognizedUnionMembers: true,
88
- allowUnrecognizedEnumValues: true,
89
- skipValidation: true,
90
- breadcrumbsPrefix: ["response"],
91
- }), _response.rawResponse);
92
- default:
93
- throw new errors.AgentMailError({
94
- statusCode: _response.error.statusCode,
95
- body: _response.error.body,
96
- rawResponse: _response.rawResponse,
97
- });
98
- }
99
- }
100
- switch (_response.error.reason) {
101
- case "non-json":
90
+ }), _response.rawResponse);
91
+ default:
102
92
  throw new errors.AgentMailError({
103
93
  statusCode: _response.error.statusCode,
104
- body: _response.error.rawBody,
105
- rawResponse: _response.rawResponse,
106
- });
107
- case "timeout":
108
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
109
- case "unknown":
110
- throw new errors.AgentMailError({
111
- message: _response.error.errorMessage,
94
+ body: _response.error.body,
112
95
  rawResponse: _response.rawResponse,
113
96
  });
114
97
  }
115
- }));
116
- const dataWithRawResponse = yield list(request).withRawResponse();
117
- return new core.Pageable({
118
- response: dataWithRawResponse.data,
119
- rawResponse: dataWithRawResponse.rawResponse,
120
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
121
- !(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
122
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.threads) !== null && _a !== void 0 ? _a : []; },
123
- loadPage: (response) => {
124
- return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
125
- },
126
- });
98
+ }
99
+ switch (_response.error.reason) {
100
+ case "non-json":
101
+ throw new errors.AgentMailError({
102
+ statusCode: _response.error.statusCode,
103
+ body: _response.error.rawBody,
104
+ rawResponse: _response.rawResponse,
105
+ });
106
+ case "timeout":
107
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
108
+ case "unknown":
109
+ throw new errors.AgentMailError({
110
+ message: _response.error.errorMessage,
111
+ rawResponse: _response.rawResponse,
112
+ });
113
+ }
127
114
  });
128
115
  }
129
116
  /**
@@ -36,7 +36,8 @@ export declare class Webhooks {
36
36
  * @example
37
37
  * await client.webhooks.list()
38
38
  */
39
- list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): Promise<core.Page<AgentMail.webhooks.Webhook>>;
39
+ list(request?: AgentMail.webhooks.ListWebhooksRequest, requestOptions?: Webhooks.RequestOptions): core.HttpResponsePromise<AgentMail.webhooks.ListWebhooksResponse>;
40
+ private __list;
40
41
  /**
41
42
  * @param {AgentMail.webhooks.WebhookId} webhookId
42
43
  * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
@@ -27,74 +27,64 @@ export class Webhooks {
27
27
  * @example
28
28
  * await client.webhooks.list()
29
29
  */
30
- list() {
30
+ list(request = {}, requestOptions) {
31
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
32
+ }
33
+ __list() {
31
34
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
32
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
33
- var _a, _b, _c;
34
- const { limit, pageToken } = request;
35
- const _queryParams = {};
36
- if (limit != null) {
37
- _queryParams["limit"] = limit.toString();
38
- }
39
- if (pageToken != null) {
40
- _queryParams["page_token"] = pageToken;
41
- }
42
- let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
43
- const _response = yield core.fetcher({
44
- 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.Production).http, "/v0/webhooks"),
45
- method: "GET",
46
- headers: _headers,
47
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
48
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
49
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
50
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
35
+ var _a, _b, _c;
36
+ const { limit, pageToken } = request;
37
+ const _queryParams = {};
38
+ if (limit != null) {
39
+ _queryParams["limit"] = limit.toString();
40
+ }
41
+ if (pageToken != null) {
42
+ _queryParams["page_token"] = pageToken;
43
+ }
44
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
45
+ const _response = yield core.fetcher({
46
+ 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.Production).http, "/v0/webhooks"),
47
+ method: "GET",
48
+ headers: _headers,
49
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
50
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
51
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
52
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
53
+ });
54
+ if (_response.ok) {
55
+ return {
56
+ data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
57
+ unrecognizedObjectKeys: "passthrough",
58
+ allowUnrecognizedUnionMembers: true,
59
+ allowUnrecognizedEnumValues: true,
60
+ skipValidation: true,
61
+ breadcrumbsPrefix: ["response"],
62
+ }),
63
+ rawResponse: _response.rawResponse,
64
+ };
65
+ }
66
+ if (_response.error.reason === "status-code") {
67
+ throw new errors.AgentMailError({
68
+ statusCode: _response.error.statusCode,
69
+ body: _response.error.body,
70
+ rawResponse: _response.rawResponse,
51
71
  });
52
- if (_response.ok) {
53
- return {
54
- data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
55
- unrecognizedObjectKeys: "passthrough",
56
- allowUnrecognizedUnionMembers: true,
57
- allowUnrecognizedEnumValues: true,
58
- skipValidation: true,
59
- breadcrumbsPrefix: ["response"],
60
- }),
61
- rawResponse: _response.rawResponse,
62
- };
63
- }
64
- if (_response.error.reason === "status-code") {
72
+ }
73
+ switch (_response.error.reason) {
74
+ case "non-json":
65
75
  throw new errors.AgentMailError({
66
76
  statusCode: _response.error.statusCode,
67
- body: _response.error.body,
77
+ body: _response.error.rawBody,
68
78
  rawResponse: _response.rawResponse,
69
79
  });
70
- }
71
- switch (_response.error.reason) {
72
- case "non-json":
73
- throw new errors.AgentMailError({
74
- statusCode: _response.error.statusCode,
75
- body: _response.error.rawBody,
76
- rawResponse: _response.rawResponse,
77
- });
78
- case "timeout":
79
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
80
- case "unknown":
81
- throw new errors.AgentMailError({
82
- message: _response.error.errorMessage,
83
- rawResponse: _response.rawResponse,
84
- });
85
- }
86
- }));
87
- const dataWithRawResponse = yield list(request).withRawResponse();
88
- return new core.Pageable({
89
- response: dataWithRawResponse.data,
90
- rawResponse: dataWithRawResponse.rawResponse,
91
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
92
- !(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
93
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.webhooks) !== null && _a !== void 0 ? _a : []; },
94
- loadPage: (response) => {
95
- return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
96
- },
97
- });
80
+ case "timeout":
81
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
82
+ case "unknown":
83
+ throw new errors.AgentMailError({
84
+ message: _response.error.errorMessage,
85
+ rawResponse: _response.rawResponse,
86
+ });
87
+ }
98
88
  });
99
89
  }
100
90
  /**
@@ -5,5 +5,3 @@ export * as serialization from "./schemas/index.mjs";
5
5
  export * from "./websocket/index.mjs";
6
6
  export * from "./auth/index.mjs";
7
7
  export * from "./base64.mjs";
8
- export * from "./utils/index.mjs";
9
- export * from "./pagination/index.mjs";
@@ -5,5 +5,3 @@ export * as serialization from "./schemas/index.mjs";
5
5
  export * from "./websocket/index.mjs";
6
6
  export * from "./auth/index.mjs";
7
7
  export * from "./base64.mjs";
8
- export * from "./utils/index.mjs";
9
- export * from "./pagination/index.mjs";
@@ -5,7 +5,6 @@ import * as serializers from "../../../index.mjs";
5
5
  import * as AgentMail from "../../../../api/index.mjs";
6
6
  import * as core from "../../../../core/index.mjs";
7
7
  import { DomainId } from "./DomainId.mjs";
8
- import { DomainName } from "./DomainName.mjs";
9
8
  import { VerificationStatus } from "./VerificationStatus.mjs";
10
9
  import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
11
10
  import { VerificationRecord } from "./VerificationRecord.mjs";
@@ -14,7 +13,6 @@ export declare const Domain: core.serialization.ObjectSchema<serializers.Domain.
14
13
  export declare namespace Domain {
15
14
  interface Raw {
16
15
  domain_id: DomainId.Raw;
17
- domain: DomainName.Raw;
18
16
  status: VerificationStatus.Raw;
19
17
  feedback_enabled: FeedbackEnabled.Raw;
20
18
  records: VerificationRecord.Raw[];
@@ -3,14 +3,12 @@
3
3
  */
4
4
  import * as core from "../../../../core/index.mjs";
5
5
  import { DomainId } from "./DomainId.mjs";
6
- import { DomainName } from "./DomainName.mjs";
7
6
  import { VerificationStatus } from "./VerificationStatus.mjs";
8
7
  import { FeedbackEnabled } from "./FeedbackEnabled.mjs";
9
8
  import { VerificationRecord } from "./VerificationRecord.mjs";
10
9
  import { ClientId } from "./ClientId.mjs";
11
10
  export const Domain = core.serialization.object({
12
11
  domainId: core.serialization.property("domain_id", DomainId),
13
- domain: DomainName,
14
12
  status: VerificationStatus,
15
13
  feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled),
16
14
  records: core.serialization.list(VerificationRecord),
@@ -14,6 +14,7 @@ import { DraftText } from "./DraftText.mjs";
14
14
  import { DraftHtml } from "./DraftHtml.mjs";
15
15
  import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
16
16
  import { DraftSendAt } from "./DraftSendAt.mjs";
17
+ import { DraftClientId } from "./DraftClientId.mjs";
17
18
  export declare const CreateDraftRequest: core.serialization.ObjectSchema<serializers.CreateDraftRequest.Raw, AgentMail.CreateDraftRequest>;
18
19
  export declare namespace CreateDraftRequest {
19
20
  interface Raw {
@@ -27,5 +28,6 @@ export declare namespace CreateDraftRequest {
27
28
  html?: DraftHtml.Raw | null;
28
29
  in_reply_to?: DraftInReplyTo.Raw | null;
29
30
  send_at?: DraftSendAt.Raw | null;
31
+ client_id?: DraftClientId.Raw | null;
30
32
  }
31
33
  }
@@ -12,6 +12,7 @@ import { DraftText } from "./DraftText.mjs";
12
12
  import { DraftHtml } from "./DraftHtml.mjs";
13
13
  import { DraftInReplyTo } from "./DraftInReplyTo.mjs";
14
14
  import { DraftSendAt } from "./DraftSendAt.mjs";
15
+ import { DraftClientId } from "./DraftClientId.mjs";
15
16
  export const CreateDraftRequest = core.serialization.object({
16
17
  labels: DraftLabels.optional(),
17
18
  replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
@@ -23,4 +24,5 @@ export const CreateDraftRequest = core.serialization.object({
23
24
  html: DraftHtml.optional(),
24
25
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo.optional()),
25
26
  sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
27
+ clientId: core.serialization.property("client_id", DraftClientId.optional()),
26
28
  });
@@ -7,6 +7,7 @@ import * as core from "../../../../core/index.mjs";
7
7
  import { InboxId } from "../../inboxes/types/InboxId.mjs";
8
8
  import { ThreadId } from "../../threads/types/ThreadId.mjs";
9
9
  import { DraftId } from "./DraftId.mjs";
10
+ import { DraftClientId } from "./DraftClientId.mjs";
10
11
  import { DraftLabels } from "./DraftLabels.mjs";
11
12
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
12
13
  import { DraftTo } from "./DraftTo.mjs";
@@ -27,6 +28,7 @@ export declare namespace Draft {
27
28
  inbox_id: InboxId.Raw;
28
29
  thread_id: ThreadId.Raw;
29
30
  draft_id: DraftId.Raw;
31
+ client_id?: DraftClientId.Raw | null;
30
32
  labels: DraftLabels.Raw;
31
33
  reply_to?: DraftReplyTo.Raw | null;
32
34
  to?: DraftTo.Raw | null;
@@ -5,6 +5,7 @@ import * as core from "../../../../core/index.mjs";
5
5
  import { InboxId } from "../../inboxes/types/InboxId.mjs";
6
6
  import { ThreadId } from "../../threads/types/ThreadId.mjs";
7
7
  import { DraftId } from "./DraftId.mjs";
8
+ import { DraftClientId } from "./DraftClientId.mjs";
8
9
  import { DraftLabels } from "./DraftLabels.mjs";
9
10
  import { DraftReplyTo } from "./DraftReplyTo.mjs";
10
11
  import { DraftTo } from "./DraftTo.mjs";
@@ -23,6 +24,7 @@ export const Draft = core.serialization.object({
23
24
  inboxId: core.serialization.property("inbox_id", InboxId),
24
25
  threadId: core.serialization.property("thread_id", ThreadId),
25
26
  draftId: core.serialization.property("draft_id", DraftId),
27
+ clientId: core.serialization.property("client_id", DraftClientId.optional()),
26
28
  labels: DraftLabels,
27
29
  replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
28
30
  to: DraftTo.optional(),
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const DraftClientId: core.serialization.Schema<serializers.DraftClientId.Raw, AgentMail.DraftClientId>;
8
+ export declare namespace DraftClientId {
9
+ type Raw = string;
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ export const DraftClientId = core.serialization.string();
@@ -0,0 +1,27 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as AgentMail from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ import { DraftReplyTo } from "./DraftReplyTo.mjs";
8
+ import { DraftTo } from "./DraftTo.mjs";
9
+ import { DraftCc } from "./DraftCc.mjs";
10
+ import { DraftBcc } from "./DraftBcc.mjs";
11
+ import { DraftSubject } from "./DraftSubject.mjs";
12
+ import { DraftText } from "./DraftText.mjs";
13
+ import { DraftHtml } from "./DraftHtml.mjs";
14
+ import { DraftSendAt } from "./DraftSendAt.mjs";
15
+ export declare const UpdateDraftRequest: core.serialization.ObjectSchema<serializers.UpdateDraftRequest.Raw, AgentMail.UpdateDraftRequest>;
16
+ export declare namespace UpdateDraftRequest {
17
+ interface Raw {
18
+ reply_to?: DraftReplyTo.Raw | null;
19
+ to?: DraftTo.Raw | null;
20
+ cc?: DraftCc.Raw | null;
21
+ bcc?: DraftBcc.Raw | null;
22
+ subject?: DraftSubject.Raw | null;
23
+ text?: DraftText.Raw | null;
24
+ html?: DraftHtml.Raw | null;
25
+ send_at?: DraftSendAt.Raw | null;
26
+ }
27
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ import { DraftReplyTo } from "./DraftReplyTo.mjs";
6
+ import { DraftTo } from "./DraftTo.mjs";
7
+ import { DraftCc } from "./DraftCc.mjs";
8
+ import { DraftBcc } from "./DraftBcc.mjs";
9
+ import { DraftSubject } from "./DraftSubject.mjs";
10
+ import { DraftText } from "./DraftText.mjs";
11
+ import { DraftHtml } from "./DraftHtml.mjs";
12
+ import { DraftSendAt } from "./DraftSendAt.mjs";
13
+ export const UpdateDraftRequest = core.serialization.object({
14
+ replyTo: core.serialization.property("reply_to", DraftReplyTo.optional()),
15
+ to: DraftTo.optional(),
16
+ cc: DraftCc.optional(),
17
+ bcc: DraftBcc.optional(),
18
+ subject: DraftSubject.optional(),
19
+ text: DraftText.optional(),
20
+ html: DraftHtml.optional(),
21
+ sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
22
+ });
@@ -1,4 +1,5 @@
1
1
  export * from "./DraftId.mjs";
2
+ export * from "./DraftClientId.mjs";
2
3
  export * from "./DraftLabels.mjs";
3
4
  export * from "./DraftReplyTo.mjs";
4
5
  export * from "./DraftTo.mjs";
@@ -17,3 +18,4 @@ export * from "./DraftItem.mjs";
17
18
  export * from "./Draft.mjs";
18
19
  export * from "./ListDraftsResponse.mjs";
19
20
  export * from "./CreateDraftRequest.mjs";
21
+ export * from "./UpdateDraftRequest.mjs";
@@ -1,4 +1,5 @@
1
1
  export * from "./DraftId.mjs";
2
+ export * from "./DraftClientId.mjs";
2
3
  export * from "./DraftLabels.mjs";
3
4
  export * from "./DraftReplyTo.mjs";
4
5
  export * from "./DraftTo.mjs";
@@ -17,3 +18,4 @@ export * from "./DraftItem.mjs";
17
18
  export * from "./Draft.mjs";
18
19
  export * from "./ListDraftsResponse.mjs";
19
20
  export * from "./CreateDraftRequest.mjs";
21
+ export * from "./UpdateDraftRequest.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.73";
1
+ export declare const SDK_VERSION = "0.0.74";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.73";
1
+ export const SDK_VERSION = "0.0.74";