@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/README.md +10 -7
- package/api.md +316 -4
- package/dist/index.cjs +347 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5531 -2852
- package/dist/index.d.ts +5531 -2852
- package/dist/index.js +347 -9
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +291 -0
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +291 -0
- package/dist/testing.js.map +1 -1
- package/manifest.json +167 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13,6 +13,215 @@ var APIResource = class {
|
|
|
13
13
|
this._b = bound;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
+
var ApprovalsResource = class extends APIResource {
|
|
17
|
+
/**
|
|
18
|
+
* Cancel an approval request
|
|
19
|
+
*
|
|
20
|
+
* 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.
|
|
21
|
+
*
|
|
22
|
+
* Credential: `bearer`.
|
|
23
|
+
*
|
|
24
|
+
* @param approvalId - The approval request id.
|
|
25
|
+
* @param options - Per-request options.
|
|
26
|
+
* @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/…`).
|
|
27
|
+
* @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).
|
|
28
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
|
|
29
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: it was already answered, expired or cancelled.
|
|
30
|
+
* @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.
|
|
31
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel
|
|
32
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-cancel
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const approval = await notify.approvals.cancel("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
cancel(approvalId, options) {
|
|
39
|
+
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}/cancel", pathParams: { approval_id: approvalId } }, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Request an approval
|
|
43
|
+
*
|
|
44
|
+
* 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.
|
|
45
|
+
*
|
|
46
|
+
* Credential: `bearer`.
|
|
47
|
+
*
|
|
48
|
+
* @param params - `Notify.ApprovalCreateParams`.
|
|
49
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
50
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED: `IDEMPOTENCY_KEY_REQUIRED`; `VALIDATION_ERROR`: a field is invalid.
|
|
51
|
+
* @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/…`).
|
|
52
|
+
* @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).
|
|
53
|
+
* @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
|
|
54
|
+
* @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).
|
|
55
|
+
* @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`).
|
|
56
|
+
* @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.
|
|
57
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals
|
|
58
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const approval = await notify.approvals.create({
|
|
62
|
+
* approvers: ["user_123"],
|
|
63
|
+
* title: "Deploy api v2.14 to production?",
|
|
64
|
+
* type: "deploy.approval",
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
create(params, options) {
|
|
69
|
+
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals", body: params, idempotent: true }, options);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* List approval requests
|
|
73
|
+
*
|
|
74
|
+
* Newest first; filter by `status` and `type`. Pass `next_cursor` as `cursor` until `has_more` is false.
|
|
75
|
+
*
|
|
76
|
+
* Credential: `bearer`.
|
|
77
|
+
*
|
|
78
|
+
* @param params - `Notify.ApprovalListParams`.
|
|
79
|
+
* @param options - Per-request options.
|
|
80
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor.
|
|
81
|
+
* @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/…`).
|
|
82
|
+
* @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).
|
|
83
|
+
* @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.
|
|
84
|
+
* @see GET /v1/workspaces/{workspace_id}/approvals
|
|
85
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* for await (const approval of notify.approvals.list()) {
|
|
89
|
+
* console.log(approval);
|
|
90
|
+
* }
|
|
91
|
+
* const page = await notify.approvals.list({}, { timeout: 5_000 });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
list(params, options) {
|
|
95
|
+
return this._client.list({ method: "GET", path: "/v1/workspaces/{workspace_id}/approvals", query: params }, options);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Record an approver's answer
|
|
99
|
+
*
|
|
100
|
+
* 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.
|
|
101
|
+
*
|
|
102
|
+
* Credential: `bearer`.
|
|
103
|
+
*
|
|
104
|
+
* @param approvalId - The approval request id.
|
|
105
|
+
* @param params - `Notify.ApprovalRecordDecisionParams`.
|
|
106
|
+
* @param options - Per-request options.
|
|
107
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: a field is invalid.
|
|
108
|
+
* @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/…`).
|
|
109
|
+
* @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).
|
|
110
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND, RECIPIENT_NOT_FOUND: `APPROVAL_NOT_FOUND`, or `RECIPIENT_NOT_FOUND`: no recipient with that external id.
|
|
111
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
|
|
112
|
+
* @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.
|
|
113
|
+
* @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.
|
|
114
|
+
* @see POST /v1/workspaces/{workspace_id}/approvals/{approval_id}/decision
|
|
115
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-approvals-approval-id-decision
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const approval = await notify.approvals.recordDecision("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { approver: "user_123", decision: "approve" });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
recordDecision(approvalId, params, options) {
|
|
122
|
+
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}/decision", pathParams: { approval_id: approvalId }, body: params }, options);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get an approval request
|
|
126
|
+
*
|
|
127
|
+
* 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.
|
|
128
|
+
*
|
|
129
|
+
* Credential: `bearer`.
|
|
130
|
+
*
|
|
131
|
+
* @param approvalId - The approval request id.
|
|
132
|
+
* @param params - `Notify.ApprovalRetrieveParams`.
|
|
133
|
+
* @param options - Per-request options.
|
|
134
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `wait_seconds` out of range.
|
|
135
|
+
* @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/…`).
|
|
136
|
+
* @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).
|
|
137
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no approval request with this id in this workspace.
|
|
138
|
+
* @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.
|
|
139
|
+
* @see GET /v1/workspaces/{workspace_id}/approvals/{approval_id}
|
|
140
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-approvals-approval-id
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* const approvalDetail = await notify.approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
retrieve(approvalId, params, options) {
|
|
147
|
+
return this._client.request({ method: "GET", path: "/v1/workspaces/{workspace_id}/approvals/{approval_id}", pathParams: { approval_id: approvalId }, query: params }, options);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var BatchesResource = class extends APIResource {
|
|
151
|
+
/**
|
|
152
|
+
* Close a batch now
|
|
153
|
+
*
|
|
154
|
+
* 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.
|
|
155
|
+
*
|
|
156
|
+
* Credential: `bearer`.
|
|
157
|
+
*
|
|
158
|
+
* @param batchId - The batch id (from a delivery's `batch_id`, or the list).
|
|
159
|
+
* @param options - Per-request options (an Idempotency-Key is sent automatically; override with `idempotencyKey`).
|
|
160
|
+
* @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/…`).
|
|
161
|
+
* @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).
|
|
162
|
+
* @throws {NotFoundError} 404 NOT_FOUND, BATCH_NOT_FOUND: `BATCH_NOT_FOUND`: no batch with this id in this workspace.
|
|
163
|
+
* @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).
|
|
164
|
+
* @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.
|
|
165
|
+
* @see POST /v1/workspaces/{workspace_id}/batches/{batch_id}/flush
|
|
166
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-batches-batch-id-flush
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* const flushBatch = await notify.batches.flush("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
flush(batchId, options) {
|
|
173
|
+
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/batches/{batch_id}/flush", pathParams: { batch_id: batchId }, idempotent: true }, options);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* List batches
|
|
177
|
+
*
|
|
178
|
+
* 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.
|
|
179
|
+
*
|
|
180
|
+
* Credential: `bearer`.
|
|
181
|
+
*
|
|
182
|
+
* @param params - `Notify.BatchListParams`.
|
|
183
|
+
* @param options - Per-request options.
|
|
184
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR` on a bad filter, or `BAD_REQUEST`: invalid cursor.
|
|
185
|
+
* @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/…`).
|
|
186
|
+
* @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).
|
|
187
|
+
* @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.
|
|
188
|
+
* @see GET /v1/workspaces/{workspace_id}/batches
|
|
189
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-batches
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* for await (const batch of notify.batches.list()) {
|
|
193
|
+
* console.log(batch);
|
|
194
|
+
* }
|
|
195
|
+
* const page = await notify.batches.list({}, { timeout: 5_000 });
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
list(params, options) {
|
|
199
|
+
return this._client.list({ method: "GET", path: "/v1/workspaces/{workspace_id}/batches", query: params }, options);
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Get a batch
|
|
203
|
+
*
|
|
204
|
+
* 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.
|
|
205
|
+
*
|
|
206
|
+
* Credential: `bearer`.
|
|
207
|
+
*
|
|
208
|
+
* @param batchId - The batch id (from a delivery's `batch_id`, or the list).
|
|
209
|
+
* @param options - Per-request options.
|
|
210
|
+
* @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/…`).
|
|
211
|
+
* @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).
|
|
212
|
+
* @throws {NotFoundError} 404 NOT_FOUND, BATCH_NOT_FOUND: `BATCH_NOT_FOUND`: no batch with this id in this workspace.
|
|
213
|
+
* @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.
|
|
214
|
+
* @see GET /v1/workspaces/{workspace_id}/batches/{batch_id}
|
|
215
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-workspaces-workspace-id-batches-batch-id
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* const batchDetail = await notify.batches.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
retrieve(batchId, options) {
|
|
222
|
+
return this._client.request({ method: "GET", path: "/v1/workspaces/{workspace_id}/batches/{batch_id}", pathParams: { batch_id: batchId } }, options);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
16
225
|
var CategoriesResource = class extends APIResource {
|
|
17
226
|
/**
|
|
18
227
|
* Create a category
|
|
@@ -731,7 +940,9 @@ var NotificationTypesResource = class extends APIResource {
|
|
|
731
940
|
* @see https://productcraft.co/docs/notify/api-reference#patch-v1-workspaces-workspace-id-notification-types-type-id
|
|
732
941
|
* @example
|
|
733
942
|
* ```ts
|
|
734
|
-
* const notificationType = await notify.notificationTypes.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
|
|
943
|
+
* const notificationType = await notify.notificationTypes.update("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", {
|
|
944
|
+
* approval: { default_expires_in_seconds: 86400, reason: "optional", timeout_outcome: "expired" },
|
|
945
|
+
* });
|
|
735
946
|
* ```
|
|
736
947
|
*/
|
|
737
948
|
update(typeId, params, options) {
|
|
@@ -872,7 +1083,7 @@ var NotificationsResource = class extends APIResource {
|
|
|
872
1083
|
* @throws {NotFoundError} 404 NOT_FOUND, NOTIFICATION_TYPE_NOT_FOUND: `NOTIFICATION_TYPE_NOT_FOUND`: no type with this key.
|
|
873
1084
|
* @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).
|
|
874
1085
|
* @throws {APIError} 413 PAYLOAD_TOO_LARGE, DATA_TOO_LARGE: `DATA_TOO_LARGE`: `data` is over 16 KB.
|
|
875
|
-
* @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.
|
|
1086
|
+
* @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.
|
|
876
1087
|
* @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.
|
|
877
1088
|
* @see POST /v1/workspaces/{workspace_id}/notifications
|
|
878
1089
|
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-notifications
|
|
@@ -1134,6 +1345,32 @@ var RecipientsResource = class extends APIResource {
|
|
|
1134
1345
|
bulkIdentify(params, options) {
|
|
1135
1346
|
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/recipients/bulk", body: params, idempotent: true }, options);
|
|
1136
1347
|
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Create a hosted preference page link
|
|
1350
|
+
*
|
|
1351
|
+
* 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`.
|
|
1352
|
+
*
|
|
1353
|
+
* Credential: `bearer`.
|
|
1354
|
+
*
|
|
1355
|
+
* @param externalId - Your user id for the recipient (URL-encoded): 1-255 of `A-Z a-z 0-9 . _ : @ | -`.
|
|
1356
|
+
* @param params - `Notify.RecipientCreatePreferenceLinkParams`.
|
|
1357
|
+
* @param options - Per-request options.
|
|
1358
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `category_key` is malformed.
|
|
1359
|
+
* @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/…`).
|
|
1360
|
+
* @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).
|
|
1361
|
+
* @throws {NotFoundError} 404 NOT_FOUND, RECIPIENT_NOT_FOUND: `RECIPIENT_NOT_FOUND`: no recipient with this external id in this workspace.
|
|
1362
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, CATEGORY_NOT_FOUND: `CATEGORY_NOT_FOUND`: no category with this key.
|
|
1363
|
+
* @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.
|
|
1364
|
+
* @see POST /v1/workspaces/{workspace_id}/recipients/{external_id}/preference-link
|
|
1365
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-workspaces-workspace-id-recipients-external-id-preference-link
|
|
1366
|
+
* @example
|
|
1367
|
+
* ```ts
|
|
1368
|
+
* const preferenceLink = await notify.recipients.createPreferenceLink("user_123", { category_key: "product-updates" });
|
|
1369
|
+
* ```
|
|
1370
|
+
*/
|
|
1371
|
+
createPreferenceLink(externalId, params, options) {
|
|
1372
|
+
return this._client.request({ method: "POST", path: "/v1/workspaces/{workspace_id}/recipients/{external_id}/preference-link", pathParams: { external_id: externalId }, body: params }, options);
|
|
1373
|
+
}
|
|
1137
1374
|
/**
|
|
1138
1375
|
* Erase a recipient (GDPR)
|
|
1139
1376
|
*
|
|
@@ -1369,7 +1606,14 @@ var SettingsResource = class extends APIResource {
|
|
|
1369
1606
|
* @see https://productcraft.co/docs/notify/api-reference#patch-v1-workspaces-workspace-id-settings
|
|
1370
1607
|
* @example
|
|
1371
1608
|
* ```ts
|
|
1372
|
-
* const notifySettings = await notify.settings.update({
|
|
1609
|
+
* const notifySettings = await notify.settings.update({
|
|
1610
|
+
* branding: {
|
|
1611
|
+
* accent_color: "#4f46e5",
|
|
1612
|
+
* logo_url: "https://acme.example/logo.png",
|
|
1613
|
+
* name: "Acme",
|
|
1614
|
+
* privacy_url: "https://acme.example/privacy",
|
|
1615
|
+
* },
|
|
1616
|
+
* });
|
|
1373
1617
|
* ```
|
|
1374
1618
|
*/
|
|
1375
1619
|
update(params, options) {
|
|
@@ -1738,6 +1982,8 @@ var WebhooksResource = class extends APIResource {
|
|
|
1738
1982
|
}
|
|
1739
1983
|
};
|
|
1740
1984
|
var NotifyResources = class extends APIResource {
|
|
1985
|
+
#approvals;
|
|
1986
|
+
#batches;
|
|
1741
1987
|
#categories;
|
|
1742
1988
|
#channels;
|
|
1743
1989
|
#deliveries;
|
|
@@ -1750,6 +1996,12 @@ var NotifyResources = class extends APIResource {
|
|
|
1750
1996
|
#setupStatus;
|
|
1751
1997
|
#stats;
|
|
1752
1998
|
#webhooks;
|
|
1999
|
+
get approvals() {
|
|
2000
|
+
return this.#approvals ??= new ApprovalsResource(this._client, this._b);
|
|
2001
|
+
}
|
|
2002
|
+
get batches() {
|
|
2003
|
+
return this.#batches ??= new BatchesResource(this._client, this._b);
|
|
2004
|
+
}
|
|
1753
2005
|
get categories() {
|
|
1754
2006
|
return this.#categories ??= new CategoriesResource(this._client, this._b);
|
|
1755
2007
|
}
|
|
@@ -1787,6 +2039,60 @@ var NotifyResources = class extends APIResource {
|
|
|
1787
2039
|
return this.#webhooks ??= new WebhooksResource(this._client, this._b);
|
|
1788
2040
|
}
|
|
1789
2041
|
};
|
|
2042
|
+
var ClientApprovalsResource = class extends APIResource {
|
|
2043
|
+
/**
|
|
2044
|
+
* Answer an approval request
|
|
2045
|
+
*
|
|
2046
|
+
* 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.
|
|
2047
|
+
*
|
|
2048
|
+
* Credential: `recipient_token`.
|
|
2049
|
+
* - `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.
|
|
2050
|
+
*
|
|
2051
|
+
* @param approvalId - Id of the approval.
|
|
2052
|
+
* @param params - `Notify.MeApprovalDecideParams`.
|
|
2053
|
+
* @param options - Per-request options.
|
|
2054
|
+
* @throws {BadRequestError} 400 BAD_REQUEST, VALIDATION_ERROR: `VALIDATION_ERROR`: `decision` must be `approve` or `reject`.
|
|
2055
|
+
* @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).
|
|
2056
|
+
* @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.
|
|
2057
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
|
|
2058
|
+
* @throws {ConflictError} 409 CONFLICT, APPROVAL_NOT_PENDING: `APPROVAL_NOT_PENDING`: already answered, expired or cancelled.
|
|
2059
|
+
* @throws {UnprocessableEntityError} 422 UNPROCESSABLE_ENTITY, APPROVAL_REASON_REQUIRED: `APPROVAL_REASON_REQUIRED`: a reason is required.
|
|
2060
|
+
* @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.
|
|
2061
|
+
* @see POST /v1/client/approvals/{approval_id}/decision
|
|
2062
|
+
* @see https://productcraft.co/docs/notify/api-reference#post-v1-client-approvals-approval-id-decision
|
|
2063
|
+
* @example
|
|
2064
|
+
* ```ts
|
|
2065
|
+
* const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.decide("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", { decision: "approve" });
|
|
2066
|
+
* ```
|
|
2067
|
+
*/
|
|
2068
|
+
decide(approvalId, params, options) {
|
|
2069
|
+
return this._client.request({ method: "POST", path: "/v1/client/approvals/{approval_id}/decision", pathParams: { approval_id: approvalId }, body: params }, options);
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Get an approval request
|
|
2073
|
+
*
|
|
2074
|
+
* One request the recipient was asked to answer: the question, who asked, its status and, once decided, who answered and why.
|
|
2075
|
+
*
|
|
2076
|
+
* Credential: `recipient_token`.
|
|
2077
|
+
* - `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.
|
|
2078
|
+
*
|
|
2079
|
+
* @param approvalId - Id of the approval.
|
|
2080
|
+
* @param options - Per-request options.
|
|
2081
|
+
* @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).
|
|
2082
|
+
* @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.
|
|
2083
|
+
* @throws {NotFoundError} 404 NOT_FOUND, APPROVAL_NOT_FOUND: `APPROVAL_NOT_FOUND`: no such request for this recipient.
|
|
2084
|
+
* @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.
|
|
2085
|
+
* @see GET /v1/client/approvals/{approval_id}
|
|
2086
|
+
* @see https://productcraft.co/docs/notify/api-reference#get-v1-client-approvals-approval-id
|
|
2087
|
+
* @example
|
|
2088
|
+
* ```ts
|
|
2089
|
+
* const approval = await notify.client({ token: "rt_example_recipient_token" }).approvals.retrieve("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f");
|
|
2090
|
+
* ```
|
|
2091
|
+
*/
|
|
2092
|
+
retrieve(approvalId, options) {
|
|
2093
|
+
return this._client.request({ method: "GET", path: "/v1/client/approvals/{approval_id}", pathParams: { approval_id: approvalId } }, options);
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
1790
2096
|
var ClientDevicesResource = class extends APIResource {
|
|
1791
2097
|
/**
|
|
1792
2098
|
* Remove this device
|
|
@@ -2014,10 +2320,14 @@ var ClientWebpushResource = class extends APIResource {
|
|
|
2014
2320
|
}
|
|
2015
2321
|
};
|
|
2016
2322
|
var NotifyClient = class extends APIResource {
|
|
2323
|
+
#approvals;
|
|
2017
2324
|
#devices;
|
|
2018
2325
|
#inbox;
|
|
2019
2326
|
#preferences;
|
|
2020
2327
|
#webpush;
|
|
2328
|
+
get approvals() {
|
|
2329
|
+
return this.#approvals ??= new ClientApprovalsResource(this._client, this._b);
|
|
2330
|
+
}
|
|
2021
2331
|
get devices() {
|
|
2022
2332
|
return this.#devices ??= new ClientDevicesResource(this._client, this._b);
|
|
2023
2333
|
}
|
|
@@ -2051,16 +2361,30 @@ var DeviceState = { values: ["active", "invalid", "pruned"] };
|
|
|
2051
2361
|
var InboxItemStatusFilter = { values: ["active", "archived", "all"] };
|
|
2052
2362
|
var InboxMarkAction = { values: ["seen", "read", "unread", "archived", "unarchived"] };
|
|
2053
2363
|
var NotificationStatus = { values: ["scheduled", "accepted", "planned", "cancelled"] };
|
|
2054
|
-
var
|
|
2055
|
-
var
|
|
2364
|
+
var NotifyApprovalDecidedVia = { values: ["inbox", "hosted_page", "api", "timeout"] };
|
|
2365
|
+
var NotifyApprovalDecision = { values: ["approve", "reject"] };
|
|
2366
|
+
var NotifyApprovalOutcome = { values: ["approved", "rejected", "expired", "cancelled"] };
|
|
2367
|
+
var NotifyApprovalOutcomeVia = { values: ["inbox", "hosted_page", "api", "timeout"] };
|
|
2368
|
+
var NotifyApprovalReasonPolicy = { values: ["optional", "required_on_reject", "required"] };
|
|
2369
|
+
var NotifyApprovalRequesterKind = { values: ["agent", "service", "user"] };
|
|
2370
|
+
var NotifyApprovalRequesterViewKind = { values: ["agent", "service", "user", "api_key"] };
|
|
2371
|
+
var NotifyApprovalStatus = { values: ["pending", "approved", "rejected", "expired", "cancelled"] };
|
|
2372
|
+
var NotifyApprovalTimeoutOutcome = { values: ["expired", "approved", "rejected"] };
|
|
2373
|
+
var NotifyBatchInboxMode = { values: ["collapse", "each"] };
|
|
2374
|
+
var NotifyBatchMode = { values: ["window", "digest"] };
|
|
2375
|
+
var NotifyBatchState = { values: ["open", "flushed", "cancelled"] };
|
|
2376
|
+
var NotifyChannel = { values: ["inbox", "email", "push", "webpush", "webhook"] };
|
|
2377
|
+
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"] };
|
|
2378
|
+
var NotifyDigestFrequency = { values: ["daily", "weekly"] };
|
|
2056
2379
|
var NotifyEmailPauseReason = { values: ["complaints", "bounces"] };
|
|
2057
2380
|
var NotifyQuietHoursSource = { values: ["recipient", "workspace"] };
|
|
2058
2381
|
var NotifyRecipientDeletionCause = { values: ["api", "auth_user_deleted"] };
|
|
2059
2382
|
var NotifyStatsChannel = { values: ["inbox", "email", "push", "webpush"] };
|
|
2060
|
-
var NotifyWebhookChannel = { values: ["inbox", "email", "push", "webpush"] };
|
|
2383
|
+
var NotifyWebhookChannel = { values: ["inbox", "email", "push", "webpush", "webhook"] };
|
|
2061
2384
|
var NotifyWebhookCredentialProvider = { values: ["apns", "fcm", "vapid"] };
|
|
2062
2385
|
var NotifyWebhookDeliveryState = { values: ["sent", "delivered", "failed", "bounced", "skipped", "pruned"] };
|
|
2063
2386
|
var NotifyWebhookDeviceChannel = { values: ["apns", "fcm", "webpush"] };
|
|
2387
|
+
var NotifyWeekday = { values: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] };
|
|
2064
2388
|
var PlanDecision = { values: ["deliver", "schedule", "skip"] };
|
|
2065
2389
|
var PreferenceChannel = { values: ["inbox", "email", "push", "webpush", "*"] };
|
|
2066
2390
|
var PreferenceScope = { values: ["all", "category", "type"] };
|
|
@@ -2073,10 +2397,10 @@ var WebhookAttemptTrigger = { values: ["automatic", "replay", "test"] };
|
|
|
2073
2397
|
var WebhookEndpointDisabledReason = { values: ["manual", "failing"] };
|
|
2074
2398
|
var WebhookEndpointStatus = { values: ["enabled", "disabled", "auto_disabled"] };
|
|
2075
2399
|
var WebhookEventStatus = { values: ["pending", "delivered", "failed", "not_sent"] };
|
|
2076
|
-
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"] };
|
|
2400
|
+
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"] };
|
|
2077
2401
|
|
|
2078
2402
|
// src/_generated/client.ts
|
|
2079
|
-
var VERSION = "0.
|
|
2403
|
+
var VERSION = "0.4.0" ;
|
|
2080
2404
|
var Notify = class extends NotifyResources {
|
|
2081
2405
|
/** The options this client was built with, for the token scopes' own clients. Never enumerable. */
|
|
2082
2406
|
#options;
|
|
@@ -2128,8 +2452,21 @@ var Notify = class extends NotifyResources {
|
|
|
2128
2452
|
Notify2.InboxItemStatusFilter = InboxItemStatusFilter;
|
|
2129
2453
|
Notify2.InboxMarkAction = InboxMarkAction;
|
|
2130
2454
|
Notify2.NotificationStatus = NotificationStatus;
|
|
2455
|
+
Notify2.NotifyApprovalDecidedVia = NotifyApprovalDecidedVia;
|
|
2456
|
+
Notify2.NotifyApprovalDecision = NotifyApprovalDecision;
|
|
2457
|
+
Notify2.NotifyApprovalOutcome = NotifyApprovalOutcome;
|
|
2458
|
+
Notify2.NotifyApprovalOutcomeVia = NotifyApprovalOutcomeVia;
|
|
2459
|
+
Notify2.NotifyApprovalReasonPolicy = NotifyApprovalReasonPolicy;
|
|
2460
|
+
Notify2.NotifyApprovalRequesterKind = NotifyApprovalRequesterKind;
|
|
2461
|
+
Notify2.NotifyApprovalRequesterViewKind = NotifyApprovalRequesterViewKind;
|
|
2462
|
+
Notify2.NotifyApprovalStatus = NotifyApprovalStatus;
|
|
2463
|
+
Notify2.NotifyApprovalTimeoutOutcome = NotifyApprovalTimeoutOutcome;
|
|
2464
|
+
Notify2.NotifyBatchInboxMode = NotifyBatchInboxMode;
|
|
2465
|
+
Notify2.NotifyBatchMode = NotifyBatchMode;
|
|
2466
|
+
Notify2.NotifyBatchState = NotifyBatchState;
|
|
2131
2467
|
Notify2.NotifyChannel = NotifyChannel;
|
|
2132
2468
|
Notify2.NotifyDeliveryReason = NotifyDeliveryReason;
|
|
2469
|
+
Notify2.NotifyDigestFrequency = NotifyDigestFrequency;
|
|
2133
2470
|
Notify2.NotifyEmailPauseReason = NotifyEmailPauseReason;
|
|
2134
2471
|
Notify2.NotifyQuietHoursSource = NotifyQuietHoursSource;
|
|
2135
2472
|
Notify2.NotifyRecipientDeletionCause = NotifyRecipientDeletionCause;
|
|
@@ -2138,6 +2475,7 @@ var Notify = class extends NotifyResources {
|
|
|
2138
2475
|
Notify2.NotifyWebhookCredentialProvider = NotifyWebhookCredentialProvider;
|
|
2139
2476
|
Notify2.NotifyWebhookDeliveryState = NotifyWebhookDeliveryState;
|
|
2140
2477
|
Notify2.NotifyWebhookDeviceChannel = NotifyWebhookDeviceChannel;
|
|
2478
|
+
Notify2.NotifyWeekday = NotifyWeekday;
|
|
2141
2479
|
Notify2.PlanDecision = PlanDecision;
|
|
2142
2480
|
Notify2.PreferenceChannel = PreferenceChannel;
|
|
2143
2481
|
Notify2.PreferenceScope = PreferenceScope;
|
|
@@ -2152,7 +2490,7 @@ var Notify = class extends NotifyResources {
|
|
|
2152
2490
|
Notify2.WebhookEventStatus = WebhookEventStatus;
|
|
2153
2491
|
Notify2.WebhookEventType = WebhookEventType;
|
|
2154
2492
|
})(Notify || (Notify = {}));
|
|
2155
|
-
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"] };
|
|
2493
|
+
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"] };
|
|
2156
2494
|
|
|
2157
2495
|
export { Notify, NotifyErrorCode, Notify as default };
|
|
2158
2496
|
//# sourceMappingURL=index.js.map
|