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
@@ -66,100 +66,87 @@ class Threads {
66
66
  * @example
67
67
  * await client.threads.list()
68
68
  */
69
- list() {
69
+ list(request = {}, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
71
+ }
72
+ __list() {
70
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
71
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
72
- var _a, _b, _c;
73
- const { limit, pageToken, labels, before, after, ascending } = request;
74
- const _queryParams = {};
75
- if (limit != null) {
76
- _queryParams["limit"] = limit.toString();
77
- }
78
- if (pageToken != null) {
79
- _queryParams["page_token"] = pageToken;
80
- }
81
- if (labels != null) {
82
- _queryParams["labels"] = (0, json_js_1.toJson)(serializers.Labels.jsonOrThrow(labels, {
83
- unrecognizedObjectKeys: "strip",
84
- omitUndefined: true,
85
- }));
86
- }
87
- if (before != null) {
88
- _queryParams["before"] = before.toISOString();
89
- }
90
- if (after != null) {
91
- _queryParams["after"] = after.toISOString();
92
- }
93
- if (ascending != null) {
94
- _queryParams["ascending"] = ascending.toString();
95
- }
96
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
97
- const _response = yield core.fetcher({
98
- 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"),
99
- method: "GET",
100
- headers: _headers,
101
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
102
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
103
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
104
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
105
- });
106
- if (_response.ok) {
107
- return {
108
- data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
74
+ var _a, _b, _c;
75
+ const { limit, pageToken, labels, before, after, ascending } = request;
76
+ const _queryParams = {};
77
+ if (limit != null) {
78
+ _queryParams["limit"] = limit.toString();
79
+ }
80
+ if (pageToken != null) {
81
+ _queryParams["page_token"] = pageToken;
82
+ }
83
+ if (labels != null) {
84
+ _queryParams["labels"] = (0, json_js_1.toJson)(serializers.Labels.jsonOrThrow(labels, { unrecognizedObjectKeys: "strip", omitUndefined: true }));
85
+ }
86
+ if (before != null) {
87
+ _queryParams["before"] = before.toISOString();
88
+ }
89
+ if (after != null) {
90
+ _queryParams["after"] = after.toISOString();
91
+ }
92
+ if (ascending != null) {
93
+ _queryParams["ascending"] = ascending.toString();
94
+ }
95
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
96
+ const _response = yield core.fetcher({
97
+ 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"),
98
+ method: "GET",
99
+ headers: _headers,
100
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
101
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
102
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
103
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
104
+ });
105
+ if (_response.ok) {
106
+ return {
107
+ data: serializers.ListThreadsResponse.parseOrThrow(_response.body, {
108
+ unrecognizedObjectKeys: "passthrough",
109
+ allowUnrecognizedUnionMembers: true,
110
+ allowUnrecognizedEnumValues: true,
111
+ skipValidation: true,
112
+ breadcrumbsPrefix: ["response"],
113
+ }),
114
+ rawResponse: _response.rawResponse,
115
+ };
116
+ }
117
+ if (_response.error.reason === "status-code") {
118
+ switch (_response.error.statusCode) {
119
+ case 404:
120
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
109
121
  unrecognizedObjectKeys: "passthrough",
110
122
  allowUnrecognizedUnionMembers: true,
111
123
  allowUnrecognizedEnumValues: true,
112
124
  skipValidation: true,
113
125
  breadcrumbsPrefix: ["response"],
114
- }),
115
- rawResponse: _response.rawResponse,
116
- };
117
- }
118
- if (_response.error.reason === "status-code") {
119
- switch (_response.error.statusCode) {
120
- case 404:
121
- throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
122
- unrecognizedObjectKeys: "passthrough",
123
- allowUnrecognizedUnionMembers: true,
124
- allowUnrecognizedEnumValues: true,
125
- skipValidation: true,
126
- breadcrumbsPrefix: ["response"],
127
- }), _response.rawResponse);
128
- default:
129
- throw new errors.AgentMailError({
130
- statusCode: _response.error.statusCode,
131
- body: _response.error.body,
132
- rawResponse: _response.rawResponse,
133
- });
134
- }
135
- }
136
- switch (_response.error.reason) {
137
- case "non-json":
126
+ }), _response.rawResponse);
127
+ default:
138
128
  throw new errors.AgentMailError({
139
129
  statusCode: _response.error.statusCode,
140
- body: _response.error.rawBody,
141
- rawResponse: _response.rawResponse,
142
- });
143
- case "timeout":
144
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
145
- case "unknown":
146
- throw new errors.AgentMailError({
147
- message: _response.error.errorMessage,
130
+ body: _response.error.body,
148
131
  rawResponse: _response.rawResponse,
149
132
  });
150
133
  }
151
- }));
152
- const dataWithRawResponse = yield list(request).withRawResponse();
153
- return new core.Pageable({
154
- response: dataWithRawResponse.data,
155
- rawResponse: dataWithRawResponse.rawResponse,
156
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
157
- !(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
158
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.threads) !== null && _a !== void 0 ? _a : []; },
159
- loadPage: (response) => {
160
- return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
161
- },
162
- });
134
+ }
135
+ switch (_response.error.reason) {
136
+ case "non-json":
137
+ throw new errors.AgentMailError({
138
+ statusCode: _response.error.statusCode,
139
+ body: _response.error.rawBody,
140
+ rawResponse: _response.rawResponse,
141
+ });
142
+ case "timeout":
143
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/threads.");
144
+ case "unknown":
145
+ throw new errors.AgentMailError({
146
+ message: _response.error.errorMessage,
147
+ rawResponse: _response.rawResponse,
148
+ });
149
+ }
163
150
  });
164
151
  }
165
152
  /**
@@ -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.
@@ -63,74 +63,64 @@ class Webhooks {
63
63
  * @example
64
64
  * await client.webhooks.list()
65
65
  */
66
- list() {
66
+ list(request = {}, requestOptions) {
67
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
68
+ }
69
+ __list() {
67
70
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
68
- const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
69
- var _a, _b, _c;
70
- const { limit, pageToken } = request;
71
- const _queryParams = {};
72
- if (limit != null) {
73
- _queryParams["limit"] = limit.toString();
74
- }
75
- if (pageToken != null) {
76
- _queryParams["page_token"] = pageToken;
77
- }
78
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
79
- const _response = yield core.fetcher({
80
- 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"),
81
- method: "GET",
82
- headers: _headers,
83
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
84
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
85
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
86
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
71
+ var _a, _b, _c;
72
+ const { limit, pageToken } = request;
73
+ const _queryParams = {};
74
+ if (limit != null) {
75
+ _queryParams["limit"] = limit.toString();
76
+ }
77
+ if (pageToken != null) {
78
+ _queryParams["page_token"] = pageToken;
79
+ }
80
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
+ const _response = yield core.fetcher({
82
+ 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"),
83
+ method: "GET",
84
+ headers: _headers,
85
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
86
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
87
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
88
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
+ });
90
+ if (_response.ok) {
91
+ return {
92
+ data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
93
+ unrecognizedObjectKeys: "passthrough",
94
+ allowUnrecognizedUnionMembers: true,
95
+ allowUnrecognizedEnumValues: true,
96
+ skipValidation: true,
97
+ breadcrumbsPrefix: ["response"],
98
+ }),
99
+ rawResponse: _response.rawResponse,
100
+ };
101
+ }
102
+ if (_response.error.reason === "status-code") {
103
+ throw new errors.AgentMailError({
104
+ statusCode: _response.error.statusCode,
105
+ body: _response.error.body,
106
+ rawResponse: _response.rawResponse,
87
107
  });
88
- if (_response.ok) {
89
- return {
90
- data: serializers.webhooks.ListWebhooksResponse.parseOrThrow(_response.body, {
91
- unrecognizedObjectKeys: "passthrough",
92
- allowUnrecognizedUnionMembers: true,
93
- allowUnrecognizedEnumValues: true,
94
- skipValidation: true,
95
- breadcrumbsPrefix: ["response"],
96
- }),
97
- rawResponse: _response.rawResponse,
98
- };
99
- }
100
- if (_response.error.reason === "status-code") {
108
+ }
109
+ switch (_response.error.reason) {
110
+ case "non-json":
101
111
  throw new errors.AgentMailError({
102
112
  statusCode: _response.error.statusCode,
103
- body: _response.error.body,
113
+ body: _response.error.rawBody,
104
114
  rawResponse: _response.rawResponse,
105
115
  });
106
- }
107
- switch (_response.error.reason) {
108
- case "non-json":
109
- throw new errors.AgentMailError({
110
- statusCode: _response.error.statusCode,
111
- body: _response.error.rawBody,
112
- rawResponse: _response.rawResponse,
113
- });
114
- case "timeout":
115
- throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
116
- case "unknown":
117
- throw new errors.AgentMailError({
118
- message: _response.error.errorMessage,
119
- rawResponse: _response.rawResponse,
120
- });
121
- }
122
- }));
123
- const dataWithRawResponse = yield list(request).withRawResponse();
124
- return new core.Pageable({
125
- response: dataWithRawResponse.data,
126
- rawResponse: dataWithRawResponse.rawResponse,
127
- hasNextPage: (response) => (response === null || response === void 0 ? void 0 : response.nextPageToken) != null &&
128
- !(typeof (response === null || response === void 0 ? void 0 : response.nextPageToken) === "string" && (response === null || response === void 0 ? void 0 : response.nextPageToken) === ""),
129
- getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.webhooks) !== null && _a !== void 0 ? _a : []; },
130
- loadPage: (response) => {
131
- return list(core.setObjectProperty(request, "pageToken", response === null || response === void 0 ? void 0 : response.nextPageToken));
132
- },
133
- });
116
+ case "timeout":
117
+ throw new errors.AgentMailTimeoutError("Timeout exceeded when calling GET /v0/webhooks.");
118
+ case "unknown":
119
+ throw new errors.AgentMailError({
120
+ message: _response.error.errorMessage,
121
+ rawResponse: _response.rawResponse,
122
+ });
123
+ }
134
124
  });
135
125
  }
136
126
  /**
@@ -5,5 +5,3 @@ export * as serialization from "./schemas/index.js";
5
5
  export * from "./websocket/index.js";
6
6
  export * from "./auth/index.js";
7
7
  export * from "./base64.js";
8
- export * from "./utils/index.js";
9
- export * from "./pagination/index.js";
@@ -44,5 +44,3 @@ exports.serialization = __importStar(require("./schemas/index.js"));
44
44
  __exportStar(require("./websocket/index.js"), exports);
45
45
  __exportStar(require("./auth/index.js"), exports);
46
46
  __exportStar(require("./base64.js"), exports);
47
- __exportStar(require("./utils/index.js"), exports);
48
- __exportStar(require("./pagination/index.js"), exports);
@@ -5,7 +5,6 @@ import * as serializers from "../../../index.js";
5
5
  import * as AgentMail from "../../../../api/index.js";
6
6
  import * as core from "../../../../core/index.js";
7
7
  import { DomainId } from "./DomainId.js";
8
- import { DomainName } from "./DomainName.js";
9
8
  import { VerificationStatus } from "./VerificationStatus.js";
10
9
  import { FeedbackEnabled } from "./FeedbackEnabled.js";
11
10
  import { VerificationRecord } from "./VerificationRecord.js";
@@ -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[];
@@ -39,14 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Domain = void 0;
40
40
  const core = __importStar(require("../../../../core/index.js"));
41
41
  const DomainId_js_1 = require("./DomainId.js");
42
- const DomainName_js_1 = require("./DomainName.js");
43
42
  const VerificationStatus_js_1 = require("./VerificationStatus.js");
44
43
  const FeedbackEnabled_js_1 = require("./FeedbackEnabled.js");
45
44
  const VerificationRecord_js_1 = require("./VerificationRecord.js");
46
45
  const ClientId_js_1 = require("./ClientId.js");
47
46
  exports.Domain = core.serialization.object({
48
47
  domainId: core.serialization.property("domain_id", DomainId_js_1.DomainId),
49
- domain: DomainName_js_1.DomainName,
50
48
  status: VerificationStatus_js_1.VerificationStatus,
51
49
  feedbackEnabled: core.serialization.property("feedback_enabled", FeedbackEnabled_js_1.FeedbackEnabled),
52
50
  records: core.serialization.list(VerificationRecord_js_1.VerificationRecord),
@@ -14,6 +14,7 @@ import { DraftText } from "./DraftText.js";
14
14
  import { DraftHtml } from "./DraftHtml.js";
15
15
  import { DraftInReplyTo } from "./DraftInReplyTo.js";
16
16
  import { DraftSendAt } from "./DraftSendAt.js";
17
+ import { DraftClientId } from "./DraftClientId.js";
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
  }
@@ -48,6 +48,7 @@ const DraftText_js_1 = require("./DraftText.js");
48
48
  const DraftHtml_js_1 = require("./DraftHtml.js");
49
49
  const DraftInReplyTo_js_1 = require("./DraftInReplyTo.js");
50
50
  const DraftSendAt_js_1 = require("./DraftSendAt.js");
51
+ const DraftClientId_js_1 = require("./DraftClientId.js");
51
52
  exports.CreateDraftRequest = core.serialization.object({
52
53
  labels: DraftLabels_js_1.DraftLabels.optional(),
53
54
  replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
@@ -59,4 +60,5 @@ exports.CreateDraftRequest = core.serialization.object({
59
60
  html: DraftHtml_js_1.DraftHtml.optional(),
60
61
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo_js_1.DraftInReplyTo.optional()),
61
62
  sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
63
+ clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
62
64
  });
@@ -7,6 +7,7 @@ import * as core from "../../../../core/index.js";
7
7
  import { InboxId } from "../../inboxes/types/InboxId.js";
8
8
  import { ThreadId } from "../../threads/types/ThreadId.js";
9
9
  import { DraftId } from "./DraftId.js";
10
+ import { DraftClientId } from "./DraftClientId.js";
10
11
  import { DraftLabels } from "./DraftLabels.js";
11
12
  import { DraftReplyTo } from "./DraftReplyTo.js";
12
13
  import { DraftTo } from "./DraftTo.js";
@@ -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;
@@ -41,6 +41,7 @@ const core = __importStar(require("../../../../core/index.js"));
41
41
  const InboxId_js_1 = require("../../inboxes/types/InboxId.js");
42
42
  const ThreadId_js_1 = require("../../threads/types/ThreadId.js");
43
43
  const DraftId_js_1 = require("./DraftId.js");
44
+ const DraftClientId_js_1 = require("./DraftClientId.js");
44
45
  const DraftLabels_js_1 = require("./DraftLabels.js");
45
46
  const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
46
47
  const DraftTo_js_1 = require("./DraftTo.js");
@@ -59,6 +60,7 @@ exports.Draft = core.serialization.object({
59
60
  inboxId: core.serialization.property("inbox_id", InboxId_js_1.InboxId),
60
61
  threadId: core.serialization.property("thread_id", ThreadId_js_1.ThreadId),
61
62
  draftId: core.serialization.property("draft_id", DraftId_js_1.DraftId),
63
+ clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
62
64
  labels: DraftLabels_js_1.DraftLabels,
63
65
  replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
64
66
  to: DraftTo_js_1.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.js";
5
+ import * as AgentMail from "../../../../api/index.js";
6
+ import * as core from "../../../../core/index.js";
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,41 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.DraftClientId = void 0;
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ exports.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.js";
5
+ import * as AgentMail from "../../../../api/index.js";
6
+ import * as core from "../../../../core/index.js";
7
+ import { DraftReplyTo } from "./DraftReplyTo.js";
8
+ import { DraftTo } from "./DraftTo.js";
9
+ import { DraftCc } from "./DraftCc.js";
10
+ import { DraftBcc } from "./DraftBcc.js";
11
+ import { DraftSubject } from "./DraftSubject.js";
12
+ import { DraftText } from "./DraftText.js";
13
+ import { DraftHtml } from "./DraftHtml.js";
14
+ import { DraftSendAt } from "./DraftSendAt.js";
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,58 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.UpdateDraftRequest = void 0;
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const DraftReplyTo_js_1 = require("./DraftReplyTo.js");
42
+ const DraftTo_js_1 = require("./DraftTo.js");
43
+ const DraftCc_js_1 = require("./DraftCc.js");
44
+ const DraftBcc_js_1 = require("./DraftBcc.js");
45
+ const DraftSubject_js_1 = require("./DraftSubject.js");
46
+ const DraftText_js_1 = require("./DraftText.js");
47
+ const DraftHtml_js_1 = require("./DraftHtml.js");
48
+ const DraftSendAt_js_1 = require("./DraftSendAt.js");
49
+ exports.UpdateDraftRequest = core.serialization.object({
50
+ replyTo: core.serialization.property("reply_to", DraftReplyTo_js_1.DraftReplyTo.optional()),
51
+ to: DraftTo_js_1.DraftTo.optional(),
52
+ cc: DraftCc_js_1.DraftCc.optional(),
53
+ bcc: DraftBcc_js_1.DraftBcc.optional(),
54
+ subject: DraftSubject_js_1.DraftSubject.optional(),
55
+ text: DraftText_js_1.DraftText.optional(),
56
+ html: DraftHtml_js_1.DraftHtml.optional(),
57
+ sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
58
+ });
@@ -1,4 +1,5 @@
1
1
  export * from "./DraftId.js";
2
+ export * from "./DraftClientId.js";
2
3
  export * from "./DraftLabels.js";
3
4
  export * from "./DraftReplyTo.js";
4
5
  export * from "./DraftTo.js";
@@ -17,3 +18,4 @@ export * from "./DraftItem.js";
17
18
  export * from "./Draft.js";
18
19
  export * from "./ListDraftsResponse.js";
19
20
  export * from "./CreateDraftRequest.js";
21
+ export * from "./UpdateDraftRequest.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./DraftId.js"), exports);
18
+ __exportStar(require("./DraftClientId.js"), exports);
18
19
  __exportStar(require("./DraftLabels.js"), exports);
19
20
  __exportStar(require("./DraftReplyTo.js"), exports);
20
21
  __exportStar(require("./DraftTo.js"), exports);
@@ -33,3 +34,4 @@ __exportStar(require("./DraftItem.js"), exports);
33
34
  __exportStar(require("./Draft.js"), exports);
34
35
  __exportStar(require("./ListDraftsResponse.js"), exports);
35
36
  __exportStar(require("./CreateDraftRequest.js"), exports);
37
+ __exportStar(require("./UpdateDraftRequest.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.73";
1
+ export declare const SDK_VERSION = "0.0.74";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.73";
4
+ exports.SDK_VERSION = "0.0.74";
@@ -17,8 +17,8 @@ export class AgentMailClient {
17
17
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
18
18
  "X-Fern-Language": "JavaScript",
19
19
  "X-Fern-SDK-Name": "agentmail",
20
- "X-Fern-SDK-Version": "0.0.73",
21
- "User-Agent": "agentmail/0.0.73",
20
+ "X-Fern-SDK-Version": "0.0.74",
21
+ "User-Agent": "agentmail/0.0.74",
22
22
  "X-Fern-Runtime": core.RUNTIME.type,
23
23
  "X-Fern-Runtime-Version": core.RUNTIME.version,
24
24
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -36,7 +36,8 @@ export declare class ApiKeys {
36
36
  * @example
37
37
  * await client.apiKeys.list()
38
38
  */
39
- list(request?: AgentMail.ListApiKeysRequest, requestOptions?: ApiKeys.RequestOptions): Promise<core.Page<AgentMail.ApiKey>>;
39
+ list(request?: AgentMail.ListApiKeysRequest, requestOptions?: ApiKeys.RequestOptions): core.HttpResponsePromise<AgentMail.ListApiKeysResponse>;
40
+ private __list;
40
41
  /**
41
42
  * @param {AgentMail.CreateApiKeyRequest} request
42
43
  * @param {ApiKeys.RequestOptions} requestOptions - Request-specific configuration.