@productcraft/notify 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -16,6 +16,215 @@ var APIResource = class {
16
16
  this._b = bound;
17
17
  }
18
18
  };
19
+ var ApprovalsResource = class extends APIResource {
20
+ /**
21
+ * Cancel an approval request
22
+ *
23
+ * Withdraws a pending request: approvers see it as cancelled, nothing more is sent, and `approval.resolved` fires with `status: cancelled`. Takes no Idempotency-Key: cancelling twice is a 409 the second time.
24
+ *
25
+ * Credential: `bearer`.
26
+ *
27
+ * @param approvalId - The approval request id.
28
+ * @param options - Per-request options.
29
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
30
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
31
+ * @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
32
+ * @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: it was already answered, expired or cancelled.
33
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
34
+ * @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel
35
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-cancel
36
+ * @example
37
+ * ```ts
38
+ * const approval = await notify.approvals.cancel("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
39
+ * ```
40
+ */
41
+ cancel(approvalId, options) {
42
+ return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel", pathParams: { approval_id: approvalId } }, options);
43
+ }
44
+ /**
45
+ * Request an approval
46
+ *
47
+ * Asks one or more people a yes/no question on the type's channels and records the first answer. In the inbox the item gets Approve and Reject buttons (or render it with `<NotifyApproval/>`); emails and pushes carry a signed link per approver (`approval.url`, `approval.approve_url`, `approval.reject_url`) to a hosted page that needs no sign-in. The answer arrives as the signed `approval.resolved` webhook and on `GET /approvals/{approval_id}`. Nobody answered by `expires_at`: the type's `timeout_outcome` applies (default `expired`). Pass `wait_seconds` (up to 15) to wait for the answer in this call. The type must have `approval` set; its notifications can only be sent here. An `Idempotency-Key` is required: the same key and body return the same request (200), a different body is a 409.
48
+ *
49
+ * Credential: `bearer`.
50
+ *
51
+ * @param params - `Notify.ApprovalCreateParams`.
52
+ * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
53
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED: `IDEMPOTENCY_KEY_REQUIRED`; `VALIDATION_ERROR`: a field is invalid.
54
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
55
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
56
+ * @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
57
+ * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
58
+ * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, NOT_AN_APPROVAL_TYPE, NOTIFICATION_TYPE_ARCHIVED, RECIPIENT_NOT_FOUND: `NOT_AN_APPROVAL_TYPE`: the type has no `approval`; `NOTIFICATION_TYPE_ARCHIVED`; `RECIPIENT_NOT_FOUND`: an approver is not a recipient (`details.missing`).
59
+ * @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over the workspace send limit; see `Retry-After`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
60
+ * @see POST /v1/workspaces/{workspace_id}/approvals
61
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals
62
+ * @example
63
+ * ```ts
64
+ * const approval = await notify.approvals.create({
65
+ * approvers: ["user_123"],
66
+ * title: "Deploy api v2.14 to production?",
67
+ * type: "deploy.approval",
68
+ * });
69
+ * ```
70
+ */
71
+ create(params, options) {
72
+ return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals", body: params, idempotent: true }, options);
73
+ }
74
+ /**
75
+ * List approval requests
76
+ *
77
+ * Newest first; filter by `status` and `type`. Pass `next_cursor` as `cursor` until `has_more` is false.
78
+ *
79
+ * Credential: `bearer`.
80
+ *
81
+ * @param params - `Notify.ApprovalListParams`.
82
+ * @param options - Per-request options.
83
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor.
84
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
85
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
86
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
87
+ * @see GET /v1/workspaces/{workspace_id}/approvals
88
+ * @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals
89
+ * @example
90
+ * ```ts
91
+ * for await (const approval of notify.approvals.list()) {
92
+ * console.log(approval);
93
+ * }
94
+ * const page = await notify.approvals.list({}, { timeout: 5_000 });
95
+ * ```
96
+ */
97
+ list(params, options) {
98
+ return this._client.list({ method: "GET", path: "/v1/workspaces/{workspace_id}/approvals", query: params }, options);
99
+ }
100
+ /**
101
+ * Record an approver's answer
102
+ *
103
+ * For answers you collected yourself (your own UI, a phone call): records `approve` or `reject` for one of the approvers, exactly as if they had pressed the button (`decided_via: api`). Never give this to the agent that made the request: it is how a human's answer gets in, so it is not an MCP tool.
104
+ *
105
+ * Credential: `bearer`.
106
+ *
107
+ * @param approvalId - The approval request id.
108
+ * @param params - `Notify.ApprovalRecordDecisionParams`.
109
+ * @param options - Per-request options.
110
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
111
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
112
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
113
+ * @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND, RECIPIENT_NOT_FOUND: `APPROVAL_NOT_FOUND`, or `RECIPIENT_NOT_FOUND`: no recipient with that external id.
114
+ * @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
115
+ * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, NOT_AN_APPROVER, APPROVAL_REASON_REQUIRED: `NOT_AN_APPROVER`: that recipient was not asked; `APPROVAL_REASON_REQUIRED`: the type needs a reason.
116
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
117
+ * @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/decision
118
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-decision
119
+ * @example
120
+ * ```ts
121
+ * const approval = await notify.approvals.recordDecision("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { approver: "user_123", decision: "approve" });
122
+ * ```
123
+ */
124
+ recordDecision(approvalId, params, options) {
125
+ return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}/decision", pathParams: { approval_id: approvalId }, body: params }, options);
126
+ }
127
+ /**
128
+ * Get an approval request
129
+ *
130
+ * Its status, the answer (who, when, why, from where) and its trail. With `wait_seconds` (up to 15) a pending request is long-polled: the call returns as soon as someone answers, or after that many seconds.
131
+ *
132
+ * Credential: `bearer`.
133
+ *
134
+ * @param approvalId - The approval request id.
135
+ * @param params - `Notify.ApprovalRetrieveParams`.
136
+ * @param options - Per-request options.
137
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `wait_seconds` out of range.
138
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
139
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
140
+ * @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
141
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
142
+ * @see GET /v1/workspaces/{workspace_id}/approvals/{approval_id}
143
+ * @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals-approval-id
144
+ * @example
145
+ * ```ts
146
+ * const approvalDetail = await notify.approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
147
+ * ```
148
+ */
149
+ retrieve(approvalId, params, options) {
150
+ return this._client.request({ method: "GET", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}", pathParams: { approval_id: approvalId }, query: params }, options);
151
+ }
152
+ };
153
+ var BatchesResource = class extends APIResource {
154
+ /**
155
+ * Close a batch now
156
+ *
157
+ * Sends an open batch now instead of at its window end or digest time: one message per batched channel, rendered with everything collected so far. Preferences, quiet hours, the recipient budgets and the type throttle apply as for any send. Useful to test a digest template without waiting for the morning.
158
+ *
159
+ * Credential: `bearer`.
160
+ *
161
+ * @param batchId - The batch id (from a delivery's `batch_id`, or the list).
162
+ * @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
163
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
164
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
165
+ * @throws {NotFoundError} 404 NOT_FOUND, BATCH_NOT_FOUND: `BATCH_NOT_FOUND`: no batch with this id in this workspace.
166
+ * @throws {ConflictError} 409 CONFLICT, BATCH_NOT_OPEN, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `BATCH_NOT_OPEN`: the batch already closed, or is closing right now. `IDEMPOTENCY_KEY_REUSE`: the key was used for another request. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
167
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
168
+ * @see POST /v1/workspaces/{workspace_id}/batches/{batch_id}/flush
169
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-batches-batch-id-flush
170
+ * @example
171
+ * ```ts
172
+ * const flushBatch = await notify.batches.flush("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
173
+ * ```
174
+ */
175
+ flush(batchId, options) {
176
+ return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/batches/{batch_id}/flush", pathParams: { batch_id: batchId }, idempotent: true }, options);
177
+ }
178
+ /**
179
+ * List batches
180
+ *
181
+ * Batches of notification types with `batch` (a window or a digest), newest first: one per recipient and key value while collecting (`open`), then `flushed` once its one message went out. Filter by `recipient`, `type` and `state`. Pass `next_cursor` as `cursor` until `has_more` is false.
182
+ *
183
+ * Credential: `bearer`.
184
+ *
185
+ * @param params - `Notify.BatchListParams`.
186
+ * @param options - Per-request options.
187
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor.
188
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
189
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
190
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
191
+ * @see GET /v1/workspaces/{workspace_id}/batches
192
+ * @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-batches
193
+ * @example
194
+ * ```ts
195
+ * for await (const batch of notify.batches.list()) {
196
+ * console.log(batch);
197
+ * }
198
+ * const page = await notify.batches.list({}, { timeout: 5_000 });
199
+ * ```
200
+ */
201
+ list(params, options) {
202
+ return this._client.list({ method: "GET", path: "/v1/workspaces/{workspace_id}/batches", query: params }, options);
203
+ }
204
+ /**
205
+ * Get a batch
206
+ *
207
+ * The notifications collected in it, its deliveries (while open, `scheduled: batched`; after it closes, one carrier per channel with its outcome, the rest `skipped: batched_into`), and the `batch` data templates got.
208
+ *
209
+ * Credential: `bearer`.
210
+ *
211
+ * @param batchId - The batch id (from a delivery's `batch_id`, or the list).
212
+ * @param options - Per-request options.
213
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
214
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks the action, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
215
+ * @throws {NotFoundError} 404 NOT_FOUND, BATCH_NOT_FOUND: `BATCH_NOT_FOUND`: no batch with this id in this workspace.
216
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
217
+ * @see GET /v1/workspaces/{workspace_id}/batches/{batch_id}
218
+ * @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-batches-batch-id
219
+ * @example
220
+ * ```ts
221
+ * const batchDetail = await notify.batches.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
222
+ * ```
223
+ */
224
+ retrieve(batchId, options) {
225
+ return this._client.request({ method: "GET", path: "/v1/workspaces/{workspace_id}/batches/{batch_id}", pathParams: { batch_id: batchId } }, options);
226
+ }
227
+ };
19
228
  var CategoriesResource = class extends APIResource {
20
229
  /**
21
230
  * Create a category
@@ -734,7 +943,9 @@ var NotificationTypesResource = class extends APIResource {
734
943
  * @see https://productcraft.co/docs/notify/api-reference#patch-v1-workspaces-workspace-id-notification-types-type-id
735
944
  * @example
736
945
  * ```ts
737
- * const notificationType = await notify.notificationTypes.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { category_key: "billing" });
946
+ * const notificationType = await notify.notificationTypes.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
947
+ * approval: { default_expires_in_seconds: 86400, reason: "optional", timeout_outcome: "expired" },
948
+ * });
738
949
  * ```
739
950
  */
740
951
  update(typeId, params, options) {
@@ -875,7 +1086,7 @@ var NotificationsResource = class extends APIResource {
875
1086
  * @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
876
1087
  * @throws {ConflictError} 409 CONFLICT, IDEMPOTENCY_KEY_REUSE, IDEMPOTENCY_IN_PROGRESS: `IDEMPOTENCY_KEY_REUSE`: the key was used with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key).
877
1088
  * @throws {APIError} 413 PAYLOAD_TOO_LARGE, DATA_TOO_LARGE: `DATA_TOO_LARGE`: `data` is over 16 KB.
878
- * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RECIPIENT_NOT_FOUND, NOTIFICATION_TYPE_ARCHIVED, TEMPLATE_MISSING, SEND_AT_OUT_OF_RANGE, UNSAFE_URL, VALIDATION_ERROR: `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing.
1089
+ * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, RECIPIENT_NOT_FOUND, NOTIFICATION_TYPE_ARCHIVED, TEMPLATE_MISSING, SEND_AT_OUT_OF_RANGE, BATCHED_TYPE_NOT_SCHEDULABLE, APPROVAL_TYPE_SEND_REFUSED, UNSAFE_URL, VALIDATION_ERROR: `RECIPIENT_NOT_FOUND`: no recipient can be notified (`details.skipped` lists why); `NOTIFICATION_TYPE_ARCHIVED`; `TEMPLATE_MISSING`: no template for any requested channel; `SEND_AT_OUT_OF_RANGE`; `BATCHED_TYPE_NOT_SCHEDULABLE`: the type batches (send it now); `APPROVAL_TYPE_SEND_REFUSED`: an approval type, sent with `POST /approvals`; `UNSAFE_URL`; `VALIDATION_ERROR`: a channel outside the type's routing.
879
1090
  * @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 3,000 recipients a minute in this workspace; see `Retry-After`. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
880
1091
  * @see POST /v1/workspaces/{workspace_id}/notifications
881
1092
  * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-notifications
@@ -1137,6 +1348,32 @@ var RecipientsResource = class extends APIResource {
1137
1348
  bulkIdentify(params, options) {
1138
1349
  return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/recipients/bulk", body: params, idempotent: true }, options);
1139
1350
  }
1351
+ /**
1352
+ * Create a hosted preference page link
1353
+ *
1354
+ * Returns a signed link to a page, hosted by Notify in your workspace's branding (`branding` in settings), where this recipient switches each category on or off per channel, sets quiet hours and a time zone, or unsubscribes from everything except critical types. It needs no sign-in, so it works from any email, also for people who never open your app. The link is valid for 365 days. Changes are recorded in the recipient's consent history with source `hosted_page`. Each call returns a fresh link and changes nothing, so it takes no `Idempotency-Key`.
1355
+ *
1356
+ * Credential: `bearer`.
1357
+ *
1358
+ * @param externalId - Your user id for the recipient (URL-encoded): 1-255 of `A-Z a-z 0-9 . _ : @ | -`.
1359
+ * @param params - `Notify.RecipientCreatePreferenceLinkParams`.
1360
+ * @param options - Per-request options.
1361
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `category_key` is malformed.
1362
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID: Missing, expired, revoked or invalid bearer token (`UNAUTHORIZED`): send a workspace API key or a console session as `Authorization: Bearer <token>`. A recipient token is refused here with `RECIPIENT_TOKEN_INVALID`: it works only on the client API (`/v1/client/…`).
1363
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, SERVICE_NOT_ENABLED: The caller lacks `notify.recipient.write`, or the workspace has not enabled Notify (`SERVICE_NOT_ENABLED`). Also `FORBIDDEN` when the credential belongs to another workspace than the URL names, or the URL uses the workspace slug instead of its id (a UUID).
1364
+ * @throws {NotFoundError} 404 NOT_FOUND, RECIPIENT_NOT_FOUND: `RECIPIENT_NOT_FOUND`: no recipient with this external id in this workspace.
1365
+ * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, CATEGORY_NOT_FOUND: `CATEGORY_NOT_FOUND`: no category with this key.
1366
+ * @throws {RateLimitError} 429 RATE_LIMITED: More than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
1367
+ * @see POST /v1/workspaces/{workspace_id}/recipients/{external_id}/preference-link
1368
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-recipients-external-id-preference-link
1369
+ * @example
1370
+ * ```ts
1371
+ * const preferenceLink = await notify.recipients.createPreferenceLink("user_123", { category_key: "product-updates" });
1372
+ * ```
1373
+ */
1374
+ createPreferenceLink(externalId, params, options) {
1375
+ return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/recipients/{external_id}/preference-link", pathParams: { external_id: externalId }, body: params }, options);
1376
+ }
1140
1377
  /**
1141
1378
  * Erase a recipient (GDPR)
1142
1379
  *
@@ -1372,7 +1609,14 @@ var SettingsResource = class extends APIResource {
1372
1609
  * @see https://productcraft.co/docs/notify/api-reference#patch-v1-workspaces-workspace-id-settings
1373
1610
  * @example
1374
1611
  * ```ts
1375
- * const notifySettings = await notify.settings.update({ client_origins: ["https://app.example.com", "https://www.example.com"] });
1612
+ * const notifySettings = await notify.settings.update({
1613
+ * branding: {
1614
+ * accent_color: "#4f46e5",
1615
+ * logo_url: "https://acme.example/logo.png",
1616
+ * name: "Acme",
1617
+ * privacy_url: "https://acme.example/privacy",
1618
+ * },
1619
+ * });
1376
1620
  * ```
1377
1621
  */
1378
1622
  update(params, options) {
@@ -1741,6 +1985,8 @@ var WebhooksResource = class extends APIResource {
1741
1985
  }
1742
1986
  };
1743
1987
  var NotifyResources = class extends APIResource {
1988
+ #approvals;
1989
+ #batches;
1744
1990
  #categories;
1745
1991
  #channels;
1746
1992
  #deliveries;
@@ -1753,6 +1999,12 @@ var NotifyResources = class extends APIResource {
1753
1999
  #setupStatus;
1754
2000
  #stats;
1755
2001
  #webhooks;
2002
+ get approvals() {
2003
+ return this.#approvals ??= new ApprovalsResource(this._client, this._b);
2004
+ }
2005
+ get batches() {
2006
+ return this.#batches ??= new BatchesResource(this._client, this._b);
2007
+ }
1756
2008
  get categories() {
1757
2009
  return this.#categories ??= new CategoriesResource(this._client, this._b);
1758
2010
  }
@@ -1790,6 +2042,60 @@ var NotifyResources = class extends APIResource {
1790
2042
  return this.#webhooks ??= new WebhooksResource(this._client, this._b);
1791
2043
  }
1792
2044
  };
2045
+ var ClientApprovalsResource = class extends APIResource {
2046
+ /**
2047
+ * Answer an approval request
2048
+ *
2049
+ * Approve or reject, with an optional reason (required when the type says so). The first answer of any approver decides; the requester gets the signed `approval.resolved` webhook. Answering again, or after the request expired, is a 409.
2050
+ *
2051
+ * Credential: `recipient_token`.
2052
+ * - `recipient_token`: A recipient token minted by your backend with `POST /v1/workspaces/{workspace_id}/recipient-tokens`. Only the client API (`/v1/client/…`) accepts it.
2053
+ *
2054
+ * @param approvalId - Id of the approval.
2055
+ * @param params - `Notify.MeApprovalDecideParams`.
2056
+ * @param options - Per-request options.
2057
+ * @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `decision` must be `approve` or `reject`.
2058
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID, RECIPIENT_TOKEN_EXPIRED: `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one).
2059
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, RECIPIENT_TOKEN_SCOPE, ORIGIN_NOT_ALLOWED, SERVICE_NOT_ENABLED: `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:write` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace.
2060
+ * @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
2061
+ * @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
2062
+ * @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, APPROVAL_REASON_REQUIRED: `APPROVAL_REASON_REQUIRED`: a reason is required.
2063
+ * @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
2064
+ * @see POST /v1/client/approvals/{approval_id}/decision
2065
+ * @see https://productcraft.co/docs/notify/api-reference#post-v1-client-approvals-approval-id-decision
2066
+ * @example
2067
+ * ```ts
2068
+ * const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.decide("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { decision: "approve" });
2069
+ * ```
2070
+ */
2071
+ decide(approvalId, params, options) {
2072
+ return this._client.request({ method: "POST", path: "/v1/client/approvals/{approval_id}/decision", pathParams: { approval_id: approvalId }, body: params }, options);
2073
+ }
2074
+ /**
2075
+ * Get an approval request
2076
+ *
2077
+ * One request the recipient was asked to answer: the question, who asked, its status and, once decided, who answered and why.
2078
+ *
2079
+ * Credential: `recipient_token`.
2080
+ * - `recipient_token`: A recipient token minted by your backend with `POST /v1/workspaces/{workspace_id}/recipient-tokens`. Only the client API (`/v1/client/…`) accepts it.
2081
+ *
2082
+ * @param approvalId - Id of the approval.
2083
+ * @param options - Per-request options.
2084
+ * @throws {AuthenticationError} 401 UNAUTHORIZED, RECIPIENT_TOKEN_INVALID, RECIPIENT_TOKEN_EXPIRED: `RECIPIENT_TOKEN_INVALID`: no recipient token, a malformed or forged one, an API key, or a revoked token (mint a new one); `RECIPIENT_TOKEN_EXPIRED`: the token expired (mint a new one).
2085
+ * @throws {PermissionDeniedError} 403 FORBIDDEN, RECIPIENT_TOKEN_SCOPE, ORIGIN_NOT_ALLOWED, SERVICE_NOT_ENABLED: `RECIPIENT_TOKEN_SCOPE`: the token lacks the `inbox:read` scope; `ORIGIN_NOT_ALLOWED`: the browser origin is not in the workspace client origins; `SERVICE_NOT_ENABLED`: Notify is turned off for the workspace.
2086
+ * @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
2087
+ * @throws {RateLimitError} 429 RATE_LIMITED: `RATE_LIMITED`: over 60 client calls per minute for this recipient; `Retry-After` gives the seconds to wait. Per-IP limit: more than 20 requests per second or 600 per minute from this client IP (`RATE_LIMITED`); wait `Retry-After` seconds.
2088
+ * @see GET /v1/client/approvals/{approval_id}
2089
+ * @see https://productcraft.co/docs/notify/api-reference#get-v1-client-approvals-approval-id
2090
+ * @example
2091
+ * ```ts
2092
+ * const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
2093
+ * ```
2094
+ */
2095
+ retrieve(approvalId, options) {
2096
+ return this._client.request({ method: "GET", path: "/v1/client/approvals/{approval_id}", pathParams: { approval_id: approvalId } }, options);
2097
+ }
2098
+ };
1793
2099
  var ClientDevicesResource = class extends APIResource {
1794
2100
  /**
1795
2101
  * Remove this device
@@ -2017,10 +2323,14 @@ var ClientWebpushResource = class extends APIResource {
2017
2323
  }
2018
2324
  };
2019
2325
  var NotifyClient = class extends APIResource {
2326
+ #approvals;
2020
2327
  #devices;
2021
2328
  #inbox;
2022
2329
  #preferences;
2023
2330
  #webpush;
2331
+ get approvals() {
2332
+ return this.#approvals ??= new ClientApprovalsResource(this._client, this._b);
2333
+ }
2024
2334
  get devices() {
2025
2335
  return this.#devices ??= new ClientDevicesResource(this._client, this._b);
2026
2336
  }
@@ -2054,16 +2364,30 @@ var DeviceState = { values: ["active", "invalid", "pruned"] };
2054
2364
  var InboxItemStatusFilter = { values: ["active", "archived", "all"] };
2055
2365
  var InboxMarkAction = { values: ["seen", "read", "unread", "archived", "unarchived"] };
2056
2366
  var NotificationStatus = { values: ["scheduled", "accepted", "planned", "cancelled"] };
2057
- var NotifyChannel = { values: ["inbox", "email", "push", "webpush"] };
2058
- var NotifyDeliveryReason = { values: ["suppressed_preference", "default_off", "unsubscribed_all", "held_quiet_hours", "scheduled_send", "no_device", "no_address", "email_invalid", "email_complained", "email_paused", "email_budget", "email_backlog_full", "channel_not_configured", "channel_restricted", "type_archived", "credential_invalid", "template_missing", "rate_limited", "throttled", "read_in_inbox", "awaiting_unread", "actor_excluded", "recipient_not_found", "recipient_erased", "mail_suppressed", "mail_refused", "pruned", "payload_too_large", "credential_error", "circuit_open", "expired", "cancelled", "provider_error"] };
2367
+ var NotifyApprovalDecidedVia = { values: ["inbox", "hosted_page", "api", "timeout"] };
2368
+ var NotifyApprovalDecision = { values: ["approve", "reject"] };
2369
+ var NotifyApprovalOutcome = { values: ["approved", "rejected", "expired", "cancelled"] };
2370
+ var NotifyApprovalOutcomeVia = { values: ["inbox", "hosted_page", "api", "timeout"] };
2371
+ var NotifyApprovalReasonPolicy = { values: ["optional", "required_on_reject", "required"] };
2372
+ var NotifyApprovalRequesterKind = { values: ["agent", "service", "user"] };
2373
+ var NotifyApprovalRequesterViewKind = { values: ["agent", "service", "user", "api_key"] };
2374
+ var NotifyApprovalStatus = { values: ["pending", "approved", "rejected", "expired", "cancelled"] };
2375
+ var NotifyApprovalTimeoutOutcome = { values: ["expired", "approved", "rejected"] };
2376
+ var NotifyBatchInboxMode = { values: ["collapse", "each"] };
2377
+ var NotifyBatchMode = { values: ["window", "digest"] };
2378
+ var NotifyBatchState = { values: ["open", "flushed", "cancelled"] };
2379
+ var NotifyChannel = { values: ["inbox", "email", "push", "webpush", "webhook"] };
2380
+ var NotifyDeliveryReason = { values: ["suppressed_preference", "default_off", "unsubscribed_all", "held_quiet_hours", "scheduled_send", "no_device", "no_address", "email_invalid", "email_complained", "email_paused", "email_budget", "email_backlog_full", "channel_not_configured", "channel_restricted", "type_archived", "credential_invalid", "template_missing", "rate_limited", "throttled", "read_in_inbox", "awaiting_unread", "batched", "batched_into", "actor_excluded", "recipient_not_found", "recipient_erased", "mail_suppressed", "mail_refused", "pruned", "payload_too_large", "credential_error", "circuit_open", "expired", "cancelled", "provider_error"] };
2381
+ var NotifyDigestFrequency = { values: ["daily", "weekly"] };
2059
2382
  var NotifyEmailPauseReason = { values: ["complaints", "bounces"] };
2060
2383
  var NotifyQuietHoursSource = { values: ["recipient", "workspace"] };
2061
2384
  var NotifyRecipientDeletionCause = { values: ["api", "auth_user_deleted"] };
2062
2385
  var NotifyStatsChannel = { values: ["inbox", "email", "push", "webpush"] };
2063
- var NotifyWebhookChannel = { values: ["inbox", "email", "push", "webpush"] };
2386
+ var NotifyWebhookChannel = { values: ["inbox", "email", "push", "webpush", "webhook"] };
2064
2387
  var NotifyWebhookCredentialProvider = { values: ["apns", "fcm", "vapid"] };
2065
2388
  var NotifyWebhookDeliveryState = { values: ["sent", "delivered", "failed", "bounced", "skipped", "pruned"] };
2066
2389
  var NotifyWebhookDeviceChannel = { values: ["apns", "fcm", "webpush"] };
2390
+ var NotifyWeekday = { values: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] };
2067
2391
  var PlanDecision = { values: ["deliver", "schedule", "skip"] };
2068
2392
  var PreferenceChannel = { values: ["inbox", "email", "push", "webpush", "*"] };
2069
2393
  var PreferenceScope = { values: ["all", "category", "type"] };
@@ -2076,10 +2400,10 @@ var WebhookAttemptTrigger = { values: ["automatic", "replay", "test"] };
2076
2400
  var WebhookEndpointDisabledReason = { values: ["manual", "failing"] };
2077
2401
  var WebhookEndpointStatus = { values: ["enabled", "disabled", "auto_disabled"] };
2078
2402
  var WebhookEventStatus = { values: ["pending", "delivered", "failed", "not_sent"] };
2079
- var WebhookEventType = { values: ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted"] };
2403
+ var WebhookEventType = { values: ["notification.accepted", "delivery.sent", "delivery.delivered", "delivery.failed", "delivery.bounced", "delivery.skipped", "inbox_item.read", "inbox_item.archived", "inbox_item.interacted", "device.pruned", "device.moved", "credential.invalid", "email.auto_paused", "recipient.deleted", "notification.webhook", "approval.resolved"] };
2080
2404
 
2081
2405
  // src/_generated/client.ts
2082
- var VERSION = "0.2.0" ;
2406
+ var VERSION = "0.4.0" ;
2083
2407
  exports.default = class Notify extends NotifyResources {
2084
2408
  /** The options this client was built with, for the token scopes' own clients. Never enumerable. */
2085
2409
  #options;
@@ -2131,8 +2455,21 @@ exports.default = class Notify extends NotifyResources {
2131
2455
  Notify2.InboxItemStatusFilter = InboxItemStatusFilter;
2132
2456
  Notify2.InboxMarkAction = InboxMarkAction;
2133
2457
  Notify2.NotificationStatus = NotificationStatus;
2458
+ Notify2.NotifyApprovalDecidedVia = NotifyApprovalDecidedVia;
2459
+ Notify2.NotifyApprovalDecision = NotifyApprovalDecision;
2460
+ Notify2.NotifyApprovalOutcome = NotifyApprovalOutcome;
2461
+ Notify2.NotifyApprovalOutcomeVia = NotifyApprovalOutcomeVia;
2462
+ Notify2.NotifyApprovalReasonPolicy = NotifyApprovalReasonPolicy;
2463
+ Notify2.NotifyApprovalRequesterKind = NotifyApprovalRequesterKind;
2464
+ Notify2.NotifyApprovalRequesterViewKind = NotifyApprovalRequesterViewKind;
2465
+ Notify2.NotifyApprovalStatus = NotifyApprovalStatus;
2466
+ Notify2.NotifyApprovalTimeoutOutcome = NotifyApprovalTimeoutOutcome;
2467
+ Notify2.NotifyBatchInboxMode = NotifyBatchInboxMode;
2468
+ Notify2.NotifyBatchMode = NotifyBatchMode;
2469
+ Notify2.NotifyBatchState = NotifyBatchState;
2134
2470
  Notify2.NotifyChannel = NotifyChannel;
2135
2471
  Notify2.NotifyDeliveryReason = NotifyDeliveryReason;
2472
+ Notify2.NotifyDigestFrequency = NotifyDigestFrequency;
2136
2473
  Notify2.NotifyEmailPauseReason = NotifyEmailPauseReason;
2137
2474
  Notify2.NotifyQuietHoursSource = NotifyQuietHoursSource;
2138
2475
  Notify2.NotifyRecipientDeletionCause = NotifyRecipientDeletionCause;
@@ -2141,6 +2478,7 @@ exports.default = class Notify extends NotifyResources {
2141
2478
  Notify2.NotifyWebhookCredentialProvider = NotifyWebhookCredentialProvider;
2142
2479
  Notify2.NotifyWebhookDeliveryState = NotifyWebhookDeliveryState;
2143
2480
  Notify2.NotifyWebhookDeviceChannel = NotifyWebhookDeviceChannel;
2481
+ Notify2.NotifyWeekday = NotifyWeekday;
2144
2482
  Notify2.PlanDecision = PlanDecision;
2145
2483
  Notify2.PreferenceChannel = PreferenceChannel;
2146
2484
  Notify2.PreferenceScope = PreferenceScope;
@@ -2155,7 +2493,7 @@ exports.default = class Notify extends NotifyResources {
2155
2493
  Notify2.WebhookEventStatus = WebhookEventStatus;
2156
2494
  Notify2.WebhookEventType = WebhookEventType;
2157
2495
  })(exports.default || (exports.default = {}));
2158
- var NotifyErrorCode = { values: ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "NOTIFICATION_TYPE_NOT_FOUND", "NOTIFICATION_TYPE_ARCHIVED", "RECIPIENT_NOT_FOUND", "TOO_MANY_RECIPIENTS", "DATA_TOO_LARGE", "TEMPLATE_MISSING", "TEMPLATE_INVALID", "CHANNEL_NOT_CONFIGURED", "CREDENTIAL_INVALID", "CREDENTIAL_NOT_FOUND", "CREDENTIAL_MISMATCH", "DEVICE_TOKEN_INVALID", "WEBPUSH_ENDPOINT_NOT_ALLOWED", "RECIPIENT_TOKEN_INVALID", "RECIPIENT_TOKEN_EXPIRED", "RECIPIENT_TOKEN_SCOPE", "ORIGIN_NOT_ALLOWED", "STREAM_LIMIT", "LIMIT_EXCEEDED", "SEND_AT_OUT_OF_RANGE", "UNSAFE_URL", "AUTH_USER_ALREADY_LINKED", "DEVICE_NOT_FOUND", "CATEGORY_NOT_FOUND", "CATEGORY_KEY_TAKEN", "CATEGORY_IN_USE", "NOTIFICATION_TYPE_KEY_TAKEN", "TEMPLATE_NOT_FOUND", "TEMPLATE_VERSION_NOT_FOUND", "PREFERENCE_LOCKED", "NOTIFICATION_NOT_FOUND", "DELIVERY_NOT_FOUND", "CONFIRMATION_REQUIRED", "INBOX_ITEM_NOT_FOUND", "RECIPIENT_ERASED", "DEVICE_MOVE_LIMIT"] };
2496
+ var NotifyErrorCode = { values: ["BAD_REQUEST", "VALIDATION_ERROR", "UNAUTHORIZED", "PAYMENT_REQUIRED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "GONE", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "UNPROCESSABLE_ENTITY", "PRECONDITION_REQUIRED", "RATE_LIMITED", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "BAD_GATEWAY", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT", "SERVICE_NOT_ENABLED", "INVALID_CREDENTIALS", "SESSION_REVOKED", "MCP_NOT_PERMITTED", "MCP_WORKSPACE_MISMATCH", "PAK_NOT_PERMITTED", "ACTIONS_NOT_GRANTABLE", "IDEMPOTENCY_KEY_REUSE", "IDEMPOTENCY_KEY_REQUIRED", "IDEMPOTENCY_IN_PROGRESS", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED", "WEBHOOK_EVENT_NOT_FOUND", "WEBHOOK_EVENT_TYPE_UNKNOWN", "NOTIFICATION_TYPE_NOT_FOUND", "NOTIFICATION_TYPE_ARCHIVED", "RECIPIENT_NOT_FOUND", "TOO_MANY_RECIPIENTS", "DATA_TOO_LARGE", "TEMPLATE_MISSING", "TEMPLATE_INVALID", "CHANNEL_NOT_CONFIGURED", "CREDENTIAL_INVALID", "CREDENTIAL_NOT_FOUND", "CREDENTIAL_MISMATCH", "DEVICE_TOKEN_INVALID", "WEBPUSH_ENDPOINT_NOT_ALLOWED", "RECIPIENT_TOKEN_INVALID", "RECIPIENT_TOKEN_EXPIRED", "RECIPIENT_TOKEN_SCOPE", "ORIGIN_NOT_ALLOWED", "STREAM_LIMIT", "LIMIT_EXCEEDED", "BATCHED_TYPE_NOT_SCHEDULABLE", "APPROVAL_NOT_FOUND", "APPROVAL_NOT_PENDING", "APPROVAL_REASON_REQUIRED", "APPROVAL_TYPE_SEND_REFUSED", "NOT_AN_APPROVAL_TYPE", "NOT_AN_APPROVER", "BATCH_NOT_FOUND", "BATCH_NOT_OPEN", "SEND_AT_OUT_OF_RANGE", "UNSAFE_URL", "AUTH_USER_ALREADY_LINKED", "DEVICE_NOT_FOUND", "CATEGORY_NOT_FOUND", "CATEGORY_KEY_TAKEN", "CATEGORY_IN_USE", "NOTIFICATION_TYPE_KEY_TAKEN", "TEMPLATE_NOT_FOUND", "TEMPLATE_VERSION_NOT_FOUND", "PREFERENCE_LOCKED", "NOTIFICATION_NOT_FOUND", "DELIVERY_NOT_FOUND", "CONFIRMATION_REQUIRED", "INBOX_ITEM_NOT_FOUND", "RECIPIENT_ERASED", "DEVICE_MOVE_LIMIT"] };
2159
2497
 
2160
2498
  Object.defineProperty(exports, "APIConnectionError", {
2161
2499
  enumerable: true,