@guidelytech/guide-runtime 0.9.0 → 0.11.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/capture.cjs +183 -34
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.js +9 -14
- package/dist/capture.js.map +1 -1
- package/dist/chunk-GUH2PQJ7.js +462 -0
- package/dist/chunk-GUH2PQJ7.js.map +1 -0
- package/dist/chunk-H3CROHPR.js +585 -0
- package/dist/chunk-H3CROHPR.js.map +1 -0
- package/dist/chunk-VJSQM23R.js +359 -0
- package/dist/chunk-VJSQM23R.js.map +1 -0
- package/dist/chunk-VQJ7MZ2K.js +463 -0
- package/dist/chunk-VQJ7MZ2K.js.map +1 -0
- package/dist/index.cjs +501 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -9
- package/dist/index.d.ts +70 -9
- package/dist/index.js +150 -25
- package/dist/index.js.map +1 -1
- package/dist/messenger.cjs +1171 -167
- package/dist/messenger.cjs.map +1 -1
- package/dist/messenger.d.cts +55 -5
- package/dist/messenger.d.ts +55 -5
- package/dist/messenger.js +1029 -96
- package/dist/messenger.js.map +1 -1
- package/package.json +2 -2
package/dist/messenger.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessengerConversation, ConversationMessagesResponse, MessengerMessage, SdkArticlesResponse, ResourceCenterArticle, SdkHowTosResponse, SdkHowTo, MessengerPageContent, FileComplaintResponse, MessengerConfig, ResourceCenterConfig } from '@guidelytech/shared';
|
|
1
|
+
import { FeedbackPriority, FeedbackStatus, PublicFeedbackList, PublicFeedbackRequestDetail, PublicFeedbackRequest, FeedbackUpdatesResponse, MessengerConversation, ConversationMessagesResponse, MessengerMessage, SdkArticlesResponse, ResourceCenterArticle, SdkHowTosResponse, SdkHowTo, MessengerPageContent, FileComplaintResponse, MessengerConfig, ResourceCenterConfig, RuleGroup } from '@guidelytech/shared';
|
|
2
2
|
import { H as HelpGuideRef } from './help-view-B4oPbhpO.cjs';
|
|
3
3
|
|
|
4
4
|
/** What the messenger sends to file a complaint (the transport adds the visitor and page). */
|
|
@@ -15,6 +15,48 @@ interface ComplaintInput {
|
|
|
15
15
|
} | null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
type IdeaSort = "top" | "new" | "trending";
|
|
19
|
+
type IdeaFilter = "open" | "all" | "mine" | "following";
|
|
20
|
+
/** What the Ideas tab asks for (the transport adds the visitor). */
|
|
21
|
+
interface IdeaListQuery {
|
|
22
|
+
q?: string;
|
|
23
|
+
sort: IdeaSort;
|
|
24
|
+
filter: IdeaFilter;
|
|
25
|
+
status?: FeedbackStatus;
|
|
26
|
+
productArea?: string;
|
|
27
|
+
page: number;
|
|
28
|
+
}
|
|
29
|
+
/** A new idea (the transport adds the visitor and the page). */
|
|
30
|
+
interface IdeaInput {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
productArea?: string | null;
|
|
34
|
+
priority: FeedbackPriority;
|
|
35
|
+
/** Suggested from this Scout conversation (Scout offered it). */
|
|
36
|
+
conversationId?: string | null;
|
|
37
|
+
}
|
|
38
|
+
interface IdeaVoteInput {
|
|
39
|
+
priority: FeedbackPriority;
|
|
40
|
+
note?: string;
|
|
41
|
+
conversationId?: string | null;
|
|
42
|
+
}
|
|
43
|
+
/** Server access for the Ideas tab. Every method is optional: transports before Ideas lack them. */
|
|
44
|
+
interface IdeasApi {
|
|
45
|
+
listIdeas?(query: IdeaListQuery): Promise<PublicFeedbackList>;
|
|
46
|
+
/** Reads one idea with its comments (and counts the view). */
|
|
47
|
+
getIdea?(id: string): Promise<PublicFeedbackRequestDetail>;
|
|
48
|
+
submitIdea?(input: IdeaInput): Promise<PublicFeedbackRequestDetail>;
|
|
49
|
+
voteIdea?(id: string, vote: IdeaVoteInput): Promise<PublicFeedbackRequest>;
|
|
50
|
+
unvoteIdea?(id: string): Promise<PublicFeedbackRequest>;
|
|
51
|
+
followIdea?(id: string, follow: boolean): Promise<PublicFeedbackRequest>;
|
|
52
|
+
commentIdea?(id: string, body: string): Promise<PublicFeedbackRequestDetail>;
|
|
53
|
+
similarIdeas?(title: string): Promise<PublicFeedbackRequest[]>;
|
|
54
|
+
ideaUpdates?(): Promise<FeedbackUpdatesResponse>;
|
|
55
|
+
markIdeaUpdatesRead?(ids?: string[]): Promise<FeedbackUpdatesResponse>;
|
|
56
|
+
/** A short-lived link into the hosted feedback portal. */
|
|
57
|
+
ideaPortalLink?(): Promise<string>;
|
|
58
|
+
}
|
|
59
|
+
|
|
18
60
|
/** Callbacks the transport invokes while a message is sent and Scout replies. */
|
|
19
61
|
interface MessengerStreamHandlers {
|
|
20
62
|
/** A new conversation was created (first message only). */
|
|
@@ -24,8 +66,9 @@ interface MessengerStreamHandlers {
|
|
|
24
66
|
onDone(message: MessengerMessage | null, conversation: MessengerConversation): void;
|
|
25
67
|
onError(message: string): void;
|
|
26
68
|
}
|
|
27
|
-
|
|
28
|
-
|
|
69
|
+
|
|
70
|
+
/** Server access for the messenger; implemented by sdk-core over the public SDK API. The Ideas methods ({@link IdeasApi}) are optional. */
|
|
71
|
+
interface MessengerApi extends IdeasApi {
|
|
29
72
|
listConversations(): Promise<MessengerConversation[]>;
|
|
30
73
|
loadMessages(conversationId: string, since?: string | null): Promise<ConversationMessagesResponse>;
|
|
31
74
|
start(text: string, handlers: MessengerStreamHandlers): Promise<void>;
|
|
@@ -43,7 +86,7 @@ interface MessengerApi {
|
|
|
43
86
|
/** Files a complaint (transports before complaints lack it; the messenger then hides the form). */
|
|
44
87
|
fileComplaint?(input: ComplaintInput): Promise<FileComplaintResponse>;
|
|
45
88
|
}
|
|
46
|
-
type MessengerTab = "home" | "messages" | "help" | "news";
|
|
89
|
+
type MessengerTab = "home" | "messages" | "help" | "ideas" | "news";
|
|
47
90
|
/** A guide the visitor started and didn't finish. */
|
|
48
91
|
interface MessengerResumeGuide {
|
|
49
92
|
id: string;
|
|
@@ -71,6 +114,9 @@ interface MessengerNewsItem {
|
|
|
71
114
|
imageUrl: string | null;
|
|
72
115
|
publishedAt: string;
|
|
73
116
|
unread: boolean;
|
|
117
|
+
/** Resource-center "What's new" entries: open this help article, or this link, instead of starting a guide. */
|
|
118
|
+
articleId?: string | null;
|
|
119
|
+
url?: string | null;
|
|
74
120
|
}
|
|
75
121
|
/** What the SDK knows about the visitor right now, read each time the messenger renders. */
|
|
76
122
|
interface MessengerVisitor {
|
|
@@ -108,6 +154,8 @@ interface MessengerOptions {
|
|
|
108
154
|
name?: string | null;
|
|
109
155
|
};
|
|
110
156
|
onResumeGuide?: (guideId: string, stepId: string) => void;
|
|
157
|
+
/** Evaluates a resource-center section's targeting for the current visitor (absent = every section shows). */
|
|
158
|
+
evaluate?: (rules: RuleGroup) => boolean;
|
|
111
159
|
/** The visitor saw these announcements (News tab opened). */
|
|
112
160
|
onNewsSeen?: (ids: string[]) => void;
|
|
113
161
|
hideLauncher?: boolean;
|
|
@@ -128,6 +176,8 @@ interface MessengerWidget {
|
|
|
128
176
|
openArticle(id: string): void;
|
|
129
177
|
/** Opens the complaint form, optionally with a category picked (when the project takes complaints). */
|
|
130
178
|
openComplaint(categoryId?: string): void;
|
|
179
|
+
/** Opens the Ideas tab, or one idea (when the project turned Ideas on). */
|
|
180
|
+
openIdeas(requestId?: string): void;
|
|
131
181
|
/** Re-reads the visitor (page changed, progress made) and re-renders what is showing. */
|
|
132
182
|
refresh(): void;
|
|
133
183
|
destroy(): void;
|
|
@@ -138,4 +188,4 @@ declare function relativeTime(iso: string, now?: number): string;
|
|
|
138
188
|
/** Intercom-style messenger: launcher + panel with Home, Messages (chat with Scout / the team) and Help tabs. */
|
|
139
189
|
declare function renderMessenger(options: MessengerOptions): MessengerWidget;
|
|
140
190
|
|
|
141
|
-
export { type MessengerApi, type MessengerChecklistProgress, type MessengerNewsItem, type MessengerOptions, type MessengerResumeGuide, type MessengerStreamHandlers, type MessengerTab, type MessengerVisitor, type MessengerWidget, personalGreeting, relativeTime, renderMessenger };
|
|
191
|
+
export { type IdeaInput, type IdeaListQuery, type IdeaVoteInput, type IdeasApi, type MessengerApi, type MessengerChecklistProgress, type MessengerNewsItem, type MessengerOptions, type MessengerResumeGuide, type MessengerStreamHandlers, type MessengerTab, type MessengerVisitor, type MessengerWidget, personalGreeting, relativeTime, renderMessenger };
|
package/dist/messenger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MessengerConversation, ConversationMessagesResponse, MessengerMessage, SdkArticlesResponse, ResourceCenterArticle, SdkHowTosResponse, SdkHowTo, MessengerPageContent, FileComplaintResponse, MessengerConfig, ResourceCenterConfig } from '@guidelytech/shared';
|
|
1
|
+
import { FeedbackPriority, FeedbackStatus, PublicFeedbackList, PublicFeedbackRequestDetail, PublicFeedbackRequest, FeedbackUpdatesResponse, MessengerConversation, ConversationMessagesResponse, MessengerMessage, SdkArticlesResponse, ResourceCenterArticle, SdkHowTosResponse, SdkHowTo, MessengerPageContent, FileComplaintResponse, MessengerConfig, ResourceCenterConfig, RuleGroup } from '@guidelytech/shared';
|
|
2
2
|
import { H as HelpGuideRef } from './help-view-B4oPbhpO.js';
|
|
3
3
|
|
|
4
4
|
/** What the messenger sends to file a complaint (the transport adds the visitor and page). */
|
|
@@ -15,6 +15,48 @@ interface ComplaintInput {
|
|
|
15
15
|
} | null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
type IdeaSort = "top" | "new" | "trending";
|
|
19
|
+
type IdeaFilter = "open" | "all" | "mine" | "following";
|
|
20
|
+
/** What the Ideas tab asks for (the transport adds the visitor). */
|
|
21
|
+
interface IdeaListQuery {
|
|
22
|
+
q?: string;
|
|
23
|
+
sort: IdeaSort;
|
|
24
|
+
filter: IdeaFilter;
|
|
25
|
+
status?: FeedbackStatus;
|
|
26
|
+
productArea?: string;
|
|
27
|
+
page: number;
|
|
28
|
+
}
|
|
29
|
+
/** A new idea (the transport adds the visitor and the page). */
|
|
30
|
+
interface IdeaInput {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
productArea?: string | null;
|
|
34
|
+
priority: FeedbackPriority;
|
|
35
|
+
/** Suggested from this Scout conversation (Scout offered it). */
|
|
36
|
+
conversationId?: string | null;
|
|
37
|
+
}
|
|
38
|
+
interface IdeaVoteInput {
|
|
39
|
+
priority: FeedbackPriority;
|
|
40
|
+
note?: string;
|
|
41
|
+
conversationId?: string | null;
|
|
42
|
+
}
|
|
43
|
+
/** Server access for the Ideas tab. Every method is optional: transports before Ideas lack them. */
|
|
44
|
+
interface IdeasApi {
|
|
45
|
+
listIdeas?(query: IdeaListQuery): Promise<PublicFeedbackList>;
|
|
46
|
+
/** Reads one idea with its comments (and counts the view). */
|
|
47
|
+
getIdea?(id: string): Promise<PublicFeedbackRequestDetail>;
|
|
48
|
+
submitIdea?(input: IdeaInput): Promise<PublicFeedbackRequestDetail>;
|
|
49
|
+
voteIdea?(id: string, vote: IdeaVoteInput): Promise<PublicFeedbackRequest>;
|
|
50
|
+
unvoteIdea?(id: string): Promise<PublicFeedbackRequest>;
|
|
51
|
+
followIdea?(id: string, follow: boolean): Promise<PublicFeedbackRequest>;
|
|
52
|
+
commentIdea?(id: string, body: string): Promise<PublicFeedbackRequestDetail>;
|
|
53
|
+
similarIdeas?(title: string): Promise<PublicFeedbackRequest[]>;
|
|
54
|
+
ideaUpdates?(): Promise<FeedbackUpdatesResponse>;
|
|
55
|
+
markIdeaUpdatesRead?(ids?: string[]): Promise<FeedbackUpdatesResponse>;
|
|
56
|
+
/** A short-lived link into the hosted feedback portal. */
|
|
57
|
+
ideaPortalLink?(): Promise<string>;
|
|
58
|
+
}
|
|
59
|
+
|
|
18
60
|
/** Callbacks the transport invokes while a message is sent and Scout replies. */
|
|
19
61
|
interface MessengerStreamHandlers {
|
|
20
62
|
/** A new conversation was created (first message only). */
|
|
@@ -24,8 +66,9 @@ interface MessengerStreamHandlers {
|
|
|
24
66
|
onDone(message: MessengerMessage | null, conversation: MessengerConversation): void;
|
|
25
67
|
onError(message: string): void;
|
|
26
68
|
}
|
|
27
|
-
|
|
28
|
-
|
|
69
|
+
|
|
70
|
+
/** Server access for the messenger; implemented by sdk-core over the public SDK API. The Ideas methods ({@link IdeasApi}) are optional. */
|
|
71
|
+
interface MessengerApi extends IdeasApi {
|
|
29
72
|
listConversations(): Promise<MessengerConversation[]>;
|
|
30
73
|
loadMessages(conversationId: string, since?: string | null): Promise<ConversationMessagesResponse>;
|
|
31
74
|
start(text: string, handlers: MessengerStreamHandlers): Promise<void>;
|
|
@@ -43,7 +86,7 @@ interface MessengerApi {
|
|
|
43
86
|
/** Files a complaint (transports before complaints lack it; the messenger then hides the form). */
|
|
44
87
|
fileComplaint?(input: ComplaintInput): Promise<FileComplaintResponse>;
|
|
45
88
|
}
|
|
46
|
-
type MessengerTab = "home" | "messages" | "help" | "news";
|
|
89
|
+
type MessengerTab = "home" | "messages" | "help" | "ideas" | "news";
|
|
47
90
|
/** A guide the visitor started and didn't finish. */
|
|
48
91
|
interface MessengerResumeGuide {
|
|
49
92
|
id: string;
|
|
@@ -71,6 +114,9 @@ interface MessengerNewsItem {
|
|
|
71
114
|
imageUrl: string | null;
|
|
72
115
|
publishedAt: string;
|
|
73
116
|
unread: boolean;
|
|
117
|
+
/** Resource-center "What's new" entries: open this help article, or this link, instead of starting a guide. */
|
|
118
|
+
articleId?: string | null;
|
|
119
|
+
url?: string | null;
|
|
74
120
|
}
|
|
75
121
|
/** What the SDK knows about the visitor right now, read each time the messenger renders. */
|
|
76
122
|
interface MessengerVisitor {
|
|
@@ -108,6 +154,8 @@ interface MessengerOptions {
|
|
|
108
154
|
name?: string | null;
|
|
109
155
|
};
|
|
110
156
|
onResumeGuide?: (guideId: string, stepId: string) => void;
|
|
157
|
+
/** Evaluates a resource-center section's targeting for the current visitor (absent = every section shows). */
|
|
158
|
+
evaluate?: (rules: RuleGroup) => boolean;
|
|
111
159
|
/** The visitor saw these announcements (News tab opened). */
|
|
112
160
|
onNewsSeen?: (ids: string[]) => void;
|
|
113
161
|
hideLauncher?: boolean;
|
|
@@ -128,6 +176,8 @@ interface MessengerWidget {
|
|
|
128
176
|
openArticle(id: string): void;
|
|
129
177
|
/** Opens the complaint form, optionally with a category picked (when the project takes complaints). */
|
|
130
178
|
openComplaint(categoryId?: string): void;
|
|
179
|
+
/** Opens the Ideas tab, or one idea (when the project turned Ideas on). */
|
|
180
|
+
openIdeas(requestId?: string): void;
|
|
131
181
|
/** Re-reads the visitor (page changed, progress made) and re-renders what is showing. */
|
|
132
182
|
refresh(): void;
|
|
133
183
|
destroy(): void;
|
|
@@ -138,4 +188,4 @@ declare function relativeTime(iso: string, now?: number): string;
|
|
|
138
188
|
/** Intercom-style messenger: launcher + panel with Home, Messages (chat with Scout / the team) and Help tabs. */
|
|
139
189
|
declare function renderMessenger(options: MessengerOptions): MessengerWidget;
|
|
140
190
|
|
|
141
|
-
export { type MessengerApi, type MessengerChecklistProgress, type MessengerNewsItem, type MessengerOptions, type MessengerResumeGuide, type MessengerStreamHandlers, type MessengerTab, type MessengerVisitor, type MessengerWidget, personalGreeting, relativeTime, renderMessenger };
|
|
191
|
+
export { type IdeaInput, type IdeaListQuery, type IdeaVoteInput, type IdeasApi, type MessengerApi, type MessengerChecklistProgress, type MessengerNewsItem, type MessengerOptions, type MessengerResumeGuide, type MessengerStreamHandlers, type MessengerTab, type MessengerVisitor, type MessengerWidget, personalGreeting, relativeTime, renderMessenger };
|