@sparkvault/sdk-js 14.2.0 → 14.2.2
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 +66 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +140 -26
- package/dist/index.mjs +66 -13
- package/dist/index.mjs.map +1 -1
- package/dist/notify/index.d.ts +6 -3
- package/dist/notify/types.d.ts +8 -2
- package/dist/products/index.d.ts +1 -1
- package/dist/products/notify/index.d.ts +31 -4
- package/dist/products/notify/types.d.ts +96 -18
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/notify/index.d.ts
CHANGED
|
@@ -113,9 +113,12 @@ export declare class NotifyModule {
|
|
|
113
113
|
* End-to-end enable ceremony: feature-detect, fetch the VAPID key, ensure
|
|
114
114
|
* Notification permission, subscribe via the caller's service worker, and
|
|
115
115
|
* register the subscription with the server. Returns a typed status instead
|
|
116
|
-
* of throwing on the expected declines
|
|
117
|
-
*
|
|
118
|
-
*
|
|
116
|
+
* of throwing on the expected declines so a host can branch on the outcome:
|
|
117
|
+
* unsupported, not configured, `permission_denied` (the person blocked
|
|
118
|
+
* notifications for the site, now or before, so only the browser's site
|
|
119
|
+
* settings can allow them) and `permission_dismissed` (the person closed the
|
|
120
|
+
* prompt without answering: the site still asks, so enabling again shows the
|
|
121
|
+
* prompt again). Call it from a user gesture (permission prompts require one).
|
|
119
122
|
*
|
|
120
123
|
* A subscription the browser holds for the current key is kept
|
|
121
124
|
* (`already_subscribed`); one made for a previous key can never deliver
|
package/dist/notify/types.d.ts
CHANGED
|
@@ -177,8 +177,14 @@ export interface UnsubscribeWebPushResponse {
|
|
|
177
177
|
success: boolean;
|
|
178
178
|
deleted: boolean;
|
|
179
179
|
}
|
|
180
|
-
/**
|
|
181
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Terminal outcomes of the end-to-end subscribeWebPush ceremony.
|
|
182
|
+
* `permission_denied`: notifications are blocked for the site (the person
|
|
183
|
+
* chose Block, now or before), so only the browser's site settings can allow
|
|
184
|
+
* them. `permission_dismissed`: the person closed the permission prompt
|
|
185
|
+
* without answering, so the site still asks and calling again prompts again.
|
|
186
|
+
*/
|
|
187
|
+
export type SubscribeWebPushStatus = 'subscribed' | 'already_subscribed' | 'not_supported' | 'not_configured' | 'permission_denied' | 'permission_dismissed';
|
|
182
188
|
export interface SubscribeWebPushOptions {
|
|
183
189
|
/**
|
|
184
190
|
* The caller's service-worker registration (the app owns the worker file and
|
package/dist/products/index.d.ts
CHANGED
|
@@ -34,4 +34,4 @@ export type * from './help-desk/types';
|
|
|
34
34
|
export type * from './help-desk/form-types';
|
|
35
35
|
export type { HelpDeskMountFormOptions, HelpDeskOpenFormOptions } from './help-desk';
|
|
36
36
|
export type { SignInOptions, SignInResult, VerifyOptions, AttachOptions, VerifyResult, TokenClaims, } from './identity';
|
|
37
|
-
export type { NotifyChannel, NotifyDeliveryMode, NotifyVerificationLevel, NotifyInteraction, NotifyPresetCategory, NotifyCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyPreset, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifyIngotRef, NotifySendPolicy, NotifyEscalation, CreateNotifySendOptions, NotifySendResult, NotifyInboxView, NotifyInboxMarkState, NotifyInboxBulkMarkState, NotifyInboxRow, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, NotifySendStatusRecipient, NotifyRecipientState, NotifySuppressionReason, NotifySendStatusCounts, NotifySendState, NotifySendSummary, ListNotifySendsOptions, ListNotifySendsResponse, NotifyRecallMode, RecallNotifySendOptions, RecallNotifySendResponse, NotifyReceipt, NotifyReportableVerificationLevel, NotifyReceiptEventType, NotifySendReceipt, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigHistory, NotifyConfigSecurity, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigPatch, NotifyConfigOverrides, NotifyConfigResponse, NotifyDestinationKind, NotifyDestinationState, NotifyDestinationSkipReason, NotifyDestinationFailureReason, NotifyDestinationReason, NotifySendStatusDestination, NotifySendSummaryDestination, NotifyWebhookDestination, NotifyWebhookDestinationRead, NotifySlackDestination, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyConfigDestinations, NotifyConfigDestinationsPatch, } from './notify';
|
|
37
|
+
export type { NotifyChannel, NotifyDeliveryMode, NotifyVerificationLevel, NotifyInteraction, NotifyPresetCategory, NotifyCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyPreset, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifyIngotRef, NotifySendPolicy, NotifyEscalation, CreateNotifySendOptions, NotifySendResult, NotifyInboxView, NotifyInboxMarkState, NotifyInboxBulkMarkState, NotifyInboxRow, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, NotifySendStatusRecipient, NotifyRecipientState, NotifySuppressionReason, NotifySendStatusCounts, NotifySendState, NotifySendSummary, ListNotifySendsOptions, ListNotifySendsResponse, NotifyRecallMode, RecallNotifySendOptions, RecallNotifySendResponse, NotifyReceipt, NotifyReportableVerificationLevel, NotifyReceiptEventType, NotifySendReceipt, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigHistory, NotifyConfigSecurity, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigPatch, NotifyConfigOverrides, NotifyConfigResponse, NotifyDestinationKind, NotifyDestinationState, NotifyDestinationSkipReason, NotifyDestinationFailureReason, NotifyDestinationReason, NotifyDestinationTransportReason, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifySendStatusDestination, NotifySendSummaryDestination, NotifyWebhookDestination, NotifyWebhookDestinationRead, NotifySlackDestination, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyConfigDestinations, NotifyConfigDestinationsPatch, } from './notify';
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* and metadata.
|
|
22
22
|
*/
|
|
23
23
|
import { HttpClient } from '../../http';
|
|
24
|
-
import type { CreateNotifySendOptions, NotifySendResult, NotifyPreset, NotifyPresetName, NotifyPresetSendOptions, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, ListNotifySendsOptions, ListNotifySendsResponse, RecallNotifySendOptions, RecallNotifySendResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfigPatch, NotifyConfigResponse } from './types';
|
|
24
|
+
import type { CreateNotifySendOptions, NotifySendResult, NotifyPreset, NotifyPresetName, NotifyPresetSendOptions, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, ListNotifySendsOptions, ListNotifySendsResponse, RecallNotifySendOptions, RecallNotifySendResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfigPatch, NotifyConfigResponse, NotifyDestinationKind, NotifyDestinationTestResult } from './types';
|
|
25
25
|
/**
|
|
26
26
|
* The five secure-by-default preset bundles: the server's own table, in this
|
|
27
27
|
* SDK's camelCase shape.
|
|
@@ -68,7 +68,9 @@ export declare class NotifyProductModule {
|
|
|
68
68
|
* someone goes out from your organization's own sender (`getEmailSender`) and
|
|
69
69
|
* is admitted against your hourly share of sending capacity. Each refusal is
|
|
70
70
|
* a thrown `SparkVaultError` whose `serviceCode` names it, made before
|
|
71
|
-
* anything is sealed, charged or stored
|
|
71
|
+
* anything is sealed, charged or stored; a send that fails while it seals
|
|
72
|
+
* gives its admitted recipients back, so its retry is admitted in the same
|
|
73
|
+
* hour:
|
|
72
74
|
*
|
|
73
75
|
* | Status | `serviceCode` | `details` | Next |
|
|
74
76
|
* | --- | --- | --- | --- |
|
|
@@ -324,7 +326,8 @@ export declare class NotifyProductModule {
|
|
|
324
326
|
* `events.webhook_url_host` and `events.secret_set`, never the values. A
|
|
325
327
|
* `webhook_url` on another host or port needs a new `secret` in the same
|
|
326
328
|
* patch (400 `VALIDATION_ERROR` naming `events.secret`), so a secret never
|
|
327
|
-
* follows its URL to a different host.
|
|
329
|
+
* follows its URL to a different host. `events: null` removes the webhook,
|
|
330
|
+
* URL and secret together.
|
|
328
331
|
*
|
|
329
332
|
* The `email` section selects a domain of your own for your Notify email to go
|
|
330
333
|
* out from. `security`, `events` and `email` are an org admin's to change: a
|
|
@@ -347,6 +350,30 @@ export declare class NotifyProductModule {
|
|
|
347
350
|
* });
|
|
348
351
|
*/
|
|
349
352
|
updateConfig(patch: NotifyConfigPatch): Promise<NotifyConfigResponse>;
|
|
353
|
+
/**
|
|
354
|
+
* Post one test message to your destination of `kind` (a webhook, a Slack
|
|
355
|
+
* channel or a Teams workflow) and learn what became of it, without a send:
|
|
356
|
+
* nothing reaches a recipient, no send is stored and nothing is metered, and
|
|
357
|
+
* the test never appears in send history. The post shows the title "Test
|
|
358
|
+
* post from SparkVault Notify" under your organization's name, through the
|
|
359
|
+
* sender a send's post takes. A webhook receives a body signed like any
|
|
360
|
+
* other, typed `notify.destination.test`, naming no send, with a
|
|
361
|
+
* `delivery_id` of its own. The post is made once and never tried again,
|
|
362
|
+
* so a fault a send's post would retry reads `failed`.
|
|
363
|
+
*
|
|
364
|
+
* An org admin's call, on an account that holds Notify: anyone else is
|
|
365
|
+
* refused 403 `FORBIDDEN` (`details: { sections: ['destinations'],
|
|
366
|
+
* required_role: 'admin' }`), an account without Notify 403
|
|
367
|
+
* `NOTIFY_SUBSCRIPTION_REQUIRED`. A kind with no destination saved is 404
|
|
368
|
+
* `NOT_FOUND`, an organization name a send would be refused under is 409
|
|
369
|
+
* (`NOTIFY_SENDER_NAME_REQUIRED` or `NOTIFY_SENDER_NAME_RESERVED`), and each
|
|
370
|
+
* kind takes 20 tests an hour (429 `RATE_LIMIT_EXCEEDED`).
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* const { state, reason } = await sv.products.notify.testDestination('webhook');
|
|
374
|
+
* if (state !== 'delivered') console.warn(`Test post ${state}: ${reason}`);
|
|
375
|
+
*/
|
|
376
|
+
testDestination(kind: NotifyDestinationKind): Promise<NotifyDestinationTestResult>;
|
|
350
377
|
/**
|
|
351
378
|
* Who your organization's Notify email is from, as the API answers it
|
|
352
379
|
* (verbatim snake_case): `"{organization name}" <from_address>`, with a
|
|
@@ -387,4 +414,4 @@ export declare class NotifyProductModule {
|
|
|
387
414
|
} | null;
|
|
388
415
|
}>;
|
|
389
416
|
}
|
|
390
|
-
export type { NotifyChannel, NotifyDeliveryMode, NotifyVerificationLevel, NotifyInteraction, NotifyPresetCategory, NotifyCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyPreset, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifyIngotRef, NotifySendPolicy, NotifyEscalation, CreateNotifySendOptions, NotifySendResult, NotifyInboxView, NotifyInboxMarkState, NotifyInboxBulkMarkState, NotifyInboxRow, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, NotifySendStatusRecipient, NotifyRecipientState, NotifySuppressionReason, NotifySendStatusCounts, NotifySendState, NotifySendSummary, ListNotifySendsOptions, ListNotifySendsResponse, NotifyRecallMode, RecallNotifySendOptions, RecallNotifySendResponse, NotifyReceipt, NotifyReportableVerificationLevel, NotifyReceiptEventType, NotifySendReceipt, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigHistory, NotifyConfigSecurity, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigPatch, NotifyConfigOverrides, NotifyConfigResponse, NotifyDestinationKind, NotifyDestinationState, NotifyDestinationSkipReason, NotifyDestinationFailureReason, NotifyDestinationReason, NotifySendStatusDestination, NotifySendSummaryDestination, NotifyWebhookDestination, NotifyWebhookDestinationRead, NotifySlackDestination, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyConfigDestinations, NotifyConfigDestinationsPatch, } from './types';
|
|
417
|
+
export type { NotifyChannel, NotifyDeliveryMode, NotifyVerificationLevel, NotifyInteraction, NotifyPresetCategory, NotifyCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyPreset, NotifyRecipient, NotifyRecipientRef, NotifySendContent, NotifyIngotRef, NotifySendPolicy, NotifyEscalation, CreateNotifySendOptions, NotifySendResult, NotifyInboxView, NotifyInboxMarkState, NotifyInboxBulkMarkState, NotifyInboxRow, ListNotifyInboxOptions, ListNotifyInboxResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, NotifySendStatus, NotifySendStatusRecipient, NotifyRecipientState, NotifySuppressionReason, NotifySendStatusCounts, NotifySendState, NotifySendSummary, ListNotifySendsOptions, ListNotifySendsResponse, NotifyRecallMode, RecallNotifySendOptions, RecallNotifySendResponse, NotifyReceipt, NotifyReportableVerificationLevel, NotifyReceiptEventType, NotifySendReceipt, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, NotifySendReceiptsResponse, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigHistory, NotifyConfigSecurity, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigPatch, NotifyConfigOverrides, NotifyConfigResponse, NotifyDestinationKind, NotifyDestinationState, NotifyDestinationSkipReason, NotifyDestinationFailureReason, NotifyDestinationReason, NotifyDestinationTransportReason, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifySendStatusDestination, NotifySendSummaryDestination, NotifyWebhookDestination, NotifyWebhookDestinationRead, NotifySlackDestination, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyConfigDestinations, NotifyConfigDestinationsPatch, } from './types';
|
|
@@ -84,6 +84,37 @@ export type NotifyDestinationFailureReason = 'possibly_delivered' | 'attempts_ex
|
|
|
84
84
|
* (`rejected_restricted_action`).
|
|
85
85
|
*/
|
|
86
86
|
export type NotifyDestinationReason = NotifyDestinationSkipReason | NotifyDestinationFailureReason | `status_${number}` | `rejected_${string}`;
|
|
87
|
+
/**
|
|
88
|
+
* Why a test post reached no answer that settles it, a fault a send's post
|
|
89
|
+
* would be tried again on: the receiver could not be reached (`network`) or
|
|
90
|
+
* did not answer in time (`timeout`), the Teams workflow's request could not
|
|
91
|
+
* be sent at all (`unsent`), or too little of the post's time was left to
|
|
92
|
+
* start it (`deadline_reached`).
|
|
93
|
+
*/
|
|
94
|
+
export type NotifyDestinationTransportReason = 'network' | 'timeout' | 'unsent' | 'deadline_reached';
|
|
95
|
+
/**
|
|
96
|
+
* The `reason` beside a test post's `skipped` or `failed`
|
|
97
|
+
* (`testDestination`): a skip reason a send status reports, or, beside
|
|
98
|
+
* `failed`, `possibly_delivered` (the post was sent and its answer was lost),
|
|
99
|
+
* a transport fault, a status a retry can clear (`status_503`), or the Slack
|
|
100
|
+
* app's own: Slack limited the call (`slack_rate_limited`), another worker was
|
|
101
|
+
* renewing the app's token (`slack_token_refresh_in_progress`), Slack could
|
|
102
|
+
* not be reached (`slack_unavailable`), or the installation could not be read
|
|
103
|
+
* (`installation_unavailable`).
|
|
104
|
+
*/
|
|
105
|
+
export type NotifyDestinationTestReason = NotifyDestinationSkipReason | 'possibly_delivered' | NotifyDestinationTransportReason | 'slack_rate_limited' | 'slack_token_refresh_in_progress' | 'slack_unavailable' | 'installation_unavailable' | `status_${number}` | `rejected_${string}`;
|
|
106
|
+
/**
|
|
107
|
+
* What became of a test post to one of your destinations, in a send status's
|
|
108
|
+
* words. A test post is made once and never tried again, so a fault a send's
|
|
109
|
+
* post would retry reads `failed`. No send is stored and nothing is metered.
|
|
110
|
+
*/
|
|
111
|
+
export interface NotifyDestinationTestResult {
|
|
112
|
+
kind: NotifyDestinationKind;
|
|
113
|
+
/** `delivered` once the destination accepted it; `skipped` when nothing was posted; `failed` when no answer settled it. */
|
|
114
|
+
state: 'delivered' | 'skipped' | 'failed';
|
|
115
|
+
/** Null when delivered. */
|
|
116
|
+
reason: NotifyDestinationTestReason | null;
|
|
117
|
+
}
|
|
87
118
|
/**
|
|
88
119
|
* How a send's content reaches the recipient.
|
|
89
120
|
* - `sealed` (default): content is sealed into a Spark behind a single-use
|
|
@@ -139,6 +170,9 @@ export type NotifyPresetName = 'alert' | 'secureMessage' | 'conversation' | 'app
|
|
|
139
170
|
* proves to open it. A bare string is an email address or one of those
|
|
140
171
|
* SparkVault ids: a bare address is also the address its recipient proves,
|
|
141
172
|
* while a bare id keys the person's inbox row and carries no address to verify.
|
|
173
|
+
* An `id` that is an email address, with no `email` beside it, is that address:
|
|
174
|
+
* `{ id: 'pat@example.com' }`, `'pat@example.com'` and
|
|
175
|
+
* `{ email: 'pat@example.com' }` are one recipient, emailed and verified alike.
|
|
142
176
|
*
|
|
143
177
|
* The recipient's key is its `id`, else its `email`, trimmed, with an email
|
|
144
178
|
* address lowercased the way Identity stores it: it names their row in your
|
|
@@ -157,11 +191,15 @@ export type NotifyPresetName = 'alert' | 'secureMessage' | 'conversation' | 'app
|
|
|
157
191
|
* bare number, `{ phone }`, or an `id` that is an E.164 number); on a sealed
|
|
158
192
|
* send, one whose only handle is a phone (`{ id, phone }`); and, on a sealed
|
|
159
193
|
* send at the default `identifier` level or at `passkey`, one with no address
|
|
160
|
-
* to verify (a bare id, or an `id` alone
|
|
161
|
-
* `verificationLevel: 'none'`.
|
|
194
|
+
* to verify (a bare id, or an `id` alone that is no email address): give it
|
|
195
|
+
* `{ id, email }`, or send at `verificationLevel: 'none'`.
|
|
162
196
|
*/
|
|
163
197
|
export interface NotifyRecipientRef {
|
|
164
|
-
/**
|
|
198
|
+
/**
|
|
199
|
+
* At most 256 bytes of UTF-8 with no control characters: it keys the
|
|
200
|
+
* recipient's inbox. One that is an email address, with no `email` beside
|
|
201
|
+
* it, is also the address the recipient is emailed at and verified against.
|
|
202
|
+
*/
|
|
165
203
|
id?: string;
|
|
166
204
|
/**
|
|
167
205
|
* The address the email channel delivers to. A recipient with no `id` is keyed
|
|
@@ -178,6 +216,11 @@ export interface NotifyRecipientRef {
|
|
|
178
216
|
export type NotifyRecipient = string | NotifyRecipientRef;
|
|
179
217
|
/** Content to seal into a fresh Spark, one per recipient. */
|
|
180
218
|
export interface NotifySendContent {
|
|
219
|
+
/**
|
|
220
|
+
* Sealed as written. A plaintext send's has its text-direction control
|
|
221
|
+
* characters (U+202A to U+202E, U+2066 to U+2069) removed, so it shows in
|
|
222
|
+
* the order it is written.
|
|
223
|
+
*/
|
|
181
224
|
payload: string;
|
|
182
225
|
/** Defaults to `text/plain`. A plaintext send accepts only `text/plain` or `text/html`. */
|
|
183
226
|
contentType?: string;
|
|
@@ -256,9 +299,13 @@ export interface CreateNotifySendOptions {
|
|
|
256
299
|
* `idempotent: true`. Generated (`ntsnd_*`) when absent. A replay must repeat
|
|
257
300
|
* what the recipient meets (the delivery mode, the content or ingot, the
|
|
258
301
|
* recipients and their handles, title, category, instructions, policy,
|
|
259
|
-
* channels and
|
|
260
|
-
* (`serviceCode` `VALIDATION_ERROR`), and the stored send stands. `type` and
|
|
261
|
-
* `historyTtlDays` are not compared: the stored send keeps its own.
|
|
302
|
+
* channels, escalation and destinations): one that differs in any of them is
|
|
303
|
+
* refused 400 (`serviceCode` `VALIDATION_ERROR`), and the stored send stands. `type` and
|
|
304
|
+
* `historyTtlDays` are not compared: the stored send keeps its own. The send
|
|
305
|
+
* stores the title, instructions and a plaintext payload without their
|
|
306
|
+
* text-direction control characters (U+202A to U+202E, U+2066 to U+2069) and
|
|
307
|
+
* compares a replay's the same way, so one that differs only by them is the
|
|
308
|
+
* same send.
|
|
262
309
|
*/
|
|
263
310
|
sendId?: string;
|
|
264
311
|
/** 1-500 recipients. An ingot send accepts exactly one. */
|
|
@@ -279,9 +326,10 @@ export interface CreateNotifySendOptions {
|
|
|
279
326
|
channels?: Array<'in_app' | 'email' | 'push' | 'web_push'>;
|
|
280
327
|
escalation?: NotifyEscalation;
|
|
281
328
|
/**
|
|
282
|
-
* Channel-agnostic display title (rides the email subject).
|
|
283
|
-
* characters
|
|
284
|
-
*
|
|
329
|
+
* Channel-agnostic display title (rides the email subject). Its text-direction
|
|
330
|
+
* control characters (U+202A to U+202E, U+2066 to U+2069) are removed, and it
|
|
331
|
+
* is cut to 200 characters, never rejected for its length. A title that reads
|
|
332
|
+
* as SparkVault is refused 400 with
|
|
285
333
|
* `details: { field: 'title', reason: 'reserved_name' }`: the notification goes
|
|
286
334
|
* out in your organization's name.
|
|
287
335
|
*/
|
|
@@ -301,7 +349,8 @@ export interface CreateNotifySendOptions {
|
|
|
301
349
|
*/
|
|
302
350
|
type?: string;
|
|
303
351
|
/**
|
|
304
|
-
* NON-SECRET display text (≤500 chars
|
|
352
|
+
* NON-SECRET display text (≤500 chars once its text-direction control
|
|
353
|
+
* characters are removed) shown alongside a sealed send, such as
|
|
305
354
|
* "verify with your passkey to open". It is never the sealed content.
|
|
306
355
|
*/
|
|
307
356
|
instructions?: string;
|
|
@@ -311,6 +360,13 @@ export interface CreateNotifySendOptions {
|
|
|
311
360
|
* range is refused 400. A plaintext send is capped at 7.
|
|
312
361
|
*/
|
|
313
362
|
historyTtlDays?: number;
|
|
363
|
+
/**
|
|
364
|
+
* `false` keeps this one send out of the organization's destinations (its
|
|
365
|
+
* webhook, Slack channel and Teams workflow): none is posted to, and the
|
|
366
|
+
* send's status reports `destinations: []`. Omitted or `true`, the send is
|
|
367
|
+
* posted to every destination that routes its category.
|
|
368
|
+
*/
|
|
369
|
+
destinations?: boolean;
|
|
314
370
|
}
|
|
315
371
|
/**
|
|
316
372
|
* Options for a preset helper (`sendAlert`, `sendSecureMessage`, …): the one
|
|
@@ -541,11 +597,13 @@ export interface NotifySendStatusRecipient {
|
|
|
541
597
|
/**
|
|
542
598
|
* For a `deferred` step, why it waits: the platform's per-second rate or
|
|
543
599
|
* its hourly email lane, your account's hourly email share, the provider
|
|
544
|
-
* refusing for its rate, the provider's sending paused,
|
|
545
|
-
* own mail domain the email goes out from not verified for sending
|
|
546
|
-
*
|
|
600
|
+
* refusing for its rate, the provider's sending paused, the platform's
|
|
601
|
+
* own mail domain the email goes out from not verified for sending, or
|
|
602
|
+
* your organization's own sending domain not verified for sending (the
|
|
603
|
+
* step waits while the domain is checked again). Null on every other
|
|
604
|
+
* outcome.
|
|
547
605
|
*/
|
|
548
|
-
reason: 'platform_rate' | 'platform_hourly' | 'account_hourly' | 'provider_throttled' | 'sending_paused' | 'sender_identity_unverified' | null;
|
|
606
|
+
reason: 'platform_rate' | 'platform_hourly' | 'account_hourly' | 'provider_throttled' | 'sending_paused' | 'sender_identity_unverified' | 'sending_domain_unverified' | null;
|
|
549
607
|
}>>;
|
|
550
608
|
/**
|
|
551
609
|
* At least one channel accepted the notification for this recipient. A
|
|
@@ -652,6 +710,19 @@ export interface NotifySendStatus {
|
|
|
652
710
|
title: string | null;
|
|
653
711
|
category: string | null;
|
|
654
712
|
type: string | null;
|
|
713
|
+
/**
|
|
714
|
+
* How the send carries its message. Only a `sealed` send minted a link per
|
|
715
|
+
* recipient, so only a sealed send can be recalled (`recallSend`); a
|
|
716
|
+
* `plaintext` one delivered its body inline.
|
|
717
|
+
*/
|
|
718
|
+
delivery: NotifyDeliveryMode;
|
|
719
|
+
/**
|
|
720
|
+
* Epoch seconds of a whole-audience recall; null when there was none. A
|
|
721
|
+
* targeted recall of named recipients never sets it; a named recipient reads
|
|
722
|
+
* `recalled` in their `state` unless their row records something recall does
|
|
723
|
+
* not undo (one a channel already reached stays `delivered`).
|
|
724
|
+
*/
|
|
725
|
+
recalled_at: number | null;
|
|
655
726
|
recipients: NotifySendStatusRecipient[];
|
|
656
727
|
counts: NotifySendStatusCounts;
|
|
657
728
|
/**
|
|
@@ -970,7 +1041,13 @@ export interface NotifyConfigSecurity {
|
|
|
970
1041
|
* what it changes, but a `webhook_url` on another host or port than the
|
|
971
1042
|
* stored one needs a new `secret` in the same patch (400 `VALIDATION_ERROR`
|
|
972
1043
|
* naming `events.secret`, `details.missing: ['secret']`): a secret never
|
|
973
|
-
* follows its URL to a different host.
|
|
1044
|
+
* follows its URL to a different host. A patch of `events: null` removes the
|
|
1045
|
+
* webhook, URL and secret together, and no event is sent from then on; a
|
|
1046
|
+
* `null` for either field alone is refused 400.
|
|
1047
|
+
*
|
|
1048
|
+
* Each event is POSTed as JSON with a `User-Agent` that begins `SparkVault/`,
|
|
1049
|
+
* so an edge in front of the receiver that refuses a request without one lets
|
|
1050
|
+
* it through.
|
|
974
1051
|
*
|
|
975
1052
|
* Delivery is BEST EFFORT — one retry, then the event is dropped. Polling
|
|
976
1053
|
* (`listSends`, `getSendStatus`, `listReceipts`) remains the source of truth;
|
|
@@ -1002,7 +1079,8 @@ export interface NotifyConfigEventsRead {
|
|
|
1002
1079
|
/**
|
|
1003
1080
|
* Your own HTTPS endpoint as a destination. Each routed send is POSTed to `url`
|
|
1004
1081
|
* once as JSON, signed like the event webhook (the hex HMAC-SHA256 of the raw
|
|
1005
|
-
* body under `secret`, in `X-SparkVault-Signature`)
|
|
1082
|
+
* body under `secret`, in `X-SparkVault-Signature`) and, like it, with a
|
|
1083
|
+
* `User-Agent` that begins `SparkVault/`; a post that may not have
|
|
1006
1084
|
* landed is tried again with the same `delivery_id`, so drop a repeat you
|
|
1007
1085
|
* already received. A redirect is never followed.
|
|
1008
1086
|
*/
|
|
@@ -1128,8 +1206,8 @@ export interface NotifyConfigPatch {
|
|
|
1128
1206
|
history?: NotifyConfigHistory;
|
|
1129
1207
|
/** Admin only. */
|
|
1130
1208
|
security?: NotifyConfigSecurity;
|
|
1131
|
-
/** Admin only. */
|
|
1132
|
-
events?: NotifyConfigEvents;
|
|
1209
|
+
/** Admin only. `null` removes the event webhook. */
|
|
1210
|
+
events?: NotifyConfigEvents | null;
|
|
1133
1211
|
/**
|
|
1134
1212
|
* Admin only. `sending_domain`: one of the organization's own domains, its
|
|
1135
1213
|
* ownership verified and its email sending ready, to send from as
|