@sparkvault/sdk-js 15.6.0 → 15.7.1
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/errors.d.ts +12 -1
- package/dist/index.cjs +4063 -4041
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +36 -7
- package/dist/index.mjs +4062 -4042
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/desk-id.d.ts +1 -1
- package/dist/products/help-desk/support-analytics-types.d.ts +2 -1
- package/dist/products/help-desk/support-analytics.d.ts +0 -1
- package/dist/products/help-desk/support-view.d.ts +0 -3
- package/dist/products/notify/project-types.d.ts +23 -5
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The original desk uses its account ID; additional desks have their own ID. */
|
|
2
|
-
export
|
|
2
|
+
export { isHelpDeskId as validHelpDeskId } from '@sparkvault/app-sdk/help-desk-contract';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Privacy-preserving, optional assistance telemetry. No issue text or identity belongs in this contract. */
|
|
2
|
+
import type { ApiPath } from '../../request-path';
|
|
2
3
|
export type SupportContactReason = 'no_results' | 'none_match' | 'article_not_answered';
|
|
3
4
|
export type SupportAttemptStart = {
|
|
4
5
|
availability: 'available';
|
|
@@ -23,7 +24,7 @@ export interface SupportAttempt {
|
|
|
23
24
|
export interface SupportAnalyticsOptions {
|
|
24
25
|
deskId: string;
|
|
25
26
|
/** The caller supplies the same approved-origin/access-grant transport used by KB reads. */
|
|
26
|
-
post<T>(path:
|
|
27
|
+
post<T>(path: ApiPath, body: Record<string, unknown>): Promise<T>;
|
|
27
28
|
}
|
|
28
29
|
export interface SupportAnalytics {
|
|
29
30
|
start(options: SupportAttemptStart): Promise<SupportAttempt | null>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Optional telemetry runs behind the journey; failed analytics never interrupts support. */
|
|
2
1
|
import type { SupportAnalytics, SupportAnalyticsOptions, SupportAttempt, SupportAttemptStart, SupportContactReason, SupportTicketContext } from './support-analytics-types';
|
|
3
2
|
export declare function createSupportAnalytics({ deskId, post }: SupportAnalyticsOptions): SupportAnalytics;
|
|
4
3
|
export type { SupportAnalytics, SupportAnalyticsOptions, SupportAttempt, SupportAttemptStart, SupportContactReason, SupportTicketContext };
|
|
@@ -29,7 +29,6 @@ export interface SupportViewState {
|
|
|
29
29
|
email?: string;
|
|
30
30
|
message?: string;
|
|
31
31
|
};
|
|
32
|
-
returnToWebsiteAccount?: boolean;
|
|
33
32
|
}
|
|
34
33
|
export interface SupportViewActions {
|
|
35
34
|
onIssueChange: (value: string) => void;
|
|
@@ -43,7 +42,6 @@ export interface SupportViewActions {
|
|
|
43
42
|
onRetry?: () => void;
|
|
44
43
|
onUnlock?: (password?: string) => void;
|
|
45
44
|
onUnlockTicketAccess?: (password?: string) => void;
|
|
46
|
-
onUseWebsiteAccount?: () => void;
|
|
47
45
|
onRestart?: () => void;
|
|
48
46
|
onCancelIdentity?: () => void;
|
|
49
47
|
onBrowserBack?: () => void;
|
|
@@ -86,7 +84,6 @@ export declare class SupportView {
|
|
|
86
84
|
private readonly articleError;
|
|
87
85
|
private readonly articleRetry;
|
|
88
86
|
private readonly articleFooter;
|
|
89
|
-
private readonly accountReturn;
|
|
90
87
|
private readonly contactTitle;
|
|
91
88
|
private readonly contactStatus;
|
|
92
89
|
private readonly contactError;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/** Named Notify projects owned and billed by one company account. */
|
|
2
2
|
export type NotifyProjectStatus = 'draft' | 'active' | 'read_only' | 'archived';
|
|
3
3
|
export interface NotifyProjectBilling {
|
|
4
|
+
/** Present on the flat subscription backed by the company's shared wallet. */
|
|
5
|
+
billing_model?: 'usage_credits';
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
included_monthly_credits?: number;
|
|
8
|
+
renewal_included_monthly_credits?: number;
|
|
4
9
|
subscription_item_id?: string | null;
|
|
5
10
|
subscription_id?: string | null;
|
|
6
11
|
status: 'draft' | 'active' | 'past_due' | 'read_only';
|
|
12
|
+
/** Historical tier allowance. The credit model's compatibility value is not a usage ceiling. */
|
|
7
13
|
notifications_cap: number;
|
|
8
14
|
/** Allowance selected for the next period when a downgrade is scheduled. */
|
|
9
15
|
renewal_notifications_cap?: number;
|
|
@@ -51,12 +57,24 @@ export interface UpdateNotifyProjectOptions {
|
|
|
51
57
|
description?: string;
|
|
52
58
|
sender_name?: string | null;
|
|
53
59
|
}
|
|
54
|
-
export
|
|
55
|
-
|
|
60
|
+
export type PreviewNotifyProjectSubscriptionOptions =
|
|
61
|
+
/** New project: one flat monthly plan with credits shared across the company. */
|
|
62
|
+
{
|
|
63
|
+
billingModel: 'usage_credits';
|
|
64
|
+
notificationsPerMonth?: never;
|
|
56
65
|
}
|
|
66
|
+
/** Existing legacy project: retain its published notification tier. */
|
|
67
|
+
| {
|
|
68
|
+
billingModel?: undefined;
|
|
69
|
+
notificationsPerMonth: number;
|
|
70
|
+
};
|
|
57
71
|
export interface NotifyProjectSubscriptionPreview {
|
|
58
72
|
project_id: string;
|
|
59
|
-
|
|
73
|
+
/** Present for the flat shared-credit plan; absent for historical tier plans. */
|
|
74
|
+
billing_model?: 'usage_credits';
|
|
75
|
+
included_monthly_credits?: number;
|
|
76
|
+
/** Present only when reviewing a historical tier plan. */
|
|
77
|
+
notifications_per_month?: number;
|
|
60
78
|
/** Exact decimal USD amounts, as strings; repeat the quote without float conversion. */
|
|
61
79
|
monthly_usd: string;
|
|
62
80
|
amount_due_now_usd: string;
|
|
@@ -65,11 +83,11 @@ export interface NotifyProjectSubscriptionPreview {
|
|
|
65
83
|
effective_at: number | null;
|
|
66
84
|
checkout_required: boolean;
|
|
67
85
|
}
|
|
68
|
-
export
|
|
86
|
+
export type SubscribeNotifyProjectOptions = PreviewNotifyProjectSubscriptionOptions & {
|
|
69
87
|
/** Repeat the reviewed quote; a changed price is refused rather than charged. */
|
|
70
88
|
quotedAmountDueNowUsd: string;
|
|
71
89
|
prorationDate: number;
|
|
72
|
-
}
|
|
90
|
+
};
|
|
73
91
|
export interface NotifyProjectSubscriptionResponse {
|
|
74
92
|
project: NotifyProject;
|
|
75
93
|
/** Present when the company's first subscription needs hosted payment setup. */
|