@meltingspot/core 0.1.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/LICENSE +28 -0
- package/README.md +42 -0
- package/api/meltingSpotApi.d.ts +57 -0
- package/index.d.ts +51 -0
- package/index.mjs +6134 -0
- package/index.umd.js +33 -0
- package/logger.d.ts +8 -0
- package/package.json +22 -0
- package/playbookEditor/index.d.ts +9 -0
- package/services/api/analytics/analytics.api.input.d.ts +6 -0
- package/services/api/analytics/analytics.api.service.d.ts +9 -0
- package/services/api/playbook/playbook.api.input.d.ts +68 -0
- package/services/api/playbook/playbook.api.output.d.ts +44 -0
- package/services/api/playbook/playbook.api.service.d.ts +22 -0
- package/services/api/spot/spot.api.output.d.ts +8 -0
- package/services/api/spot/spot.api.service.d.ts +11 -0
- package/services/api/spotMember/spotMember.api.output.d.ts +18 -0
- package/services/api/spotMember/spotMember.api.service.d.ts +12 -0
- package/services/api/spotMemberAuth/spotMemberAuth.api.output.d.ts +3 -0
- package/services/api/spotMemberAuth/spotMemberAuth.api.service.d.ts +11 -0
- package/services/auth.service.d.ts +49 -0
- package/services/configuration.service.d.ts +20 -0
- package/services/http.service.d.ts +33 -0
- package/services/routeChangeDetector.service.d.ts +29 -0
- package/services/sso.service.d.ts +8 -0
- package/services/storage.service.d.ts +11 -0
- package/types/authTokens.d.ts +4 -0
- package/types/conversation/conversation.d.ts +16 -0
- package/types/conversation/conversationMessage.d.ts +12 -0
- package/types/conversation/conversationSseEvent.d.ts +44 -0
- package/types/conversation/conversationStreamResponse.d.ts +9 -0
- package/types/conversation/createConversationResponse.d.ts +8 -0
- package/types/conversation/getConversationMessagesResponse.d.ts +25 -0
- package/types/conversation/index.d.ts +11 -0
- package/types/conversation/listConversationsResponse.d.ts +9 -0
- package/types/conversation/meltyWidgetAction.d.ts +12 -0
- package/types/conversation/proactiveCheckResponse.d.ts +12 -0
- package/types/conversation/renderableWidgetAction.d.ts +15 -0
- package/types/conversation/triggerType.d.ts +17 -0
- package/types/index.d.ts +12 -0
- package/types/injectable.d.ts +3 -0
- package/types/integrationSchema/beacon.d.ts +112 -0
- package/types/integrationSchema/index.d.ts +3 -0
- package/types/integrationSchema/integrationSchema.d.ts +19 -0
- package/types/integrationSchema/touchPoint.d.ts +89 -0
- package/types/learningPathContentType.d.ts +6 -0
- package/types/live/index.d.ts +2 -0
- package/types/live/liveBuiltInType.d.ts +4 -0
- package/types/live/liveStatus.d.ts +5 -0
- package/types/maybe.d.ts +2 -0
- package/types/meltyIntent/index.d.ts +3 -0
- package/types/meltyIntent/intentUserState.d.ts +7 -0
- package/types/meltyIntent/lastActionState.d.ts +5 -0
- package/types/meltyIntent/meltyIntentUserStateList.d.ts +11 -0
- package/types/nullable.d.ts +1 -0
- package/types/simplifiedRichText.d.ts +39 -0
- package/types/themeMode.d.ts +1 -0
- package/types/widget/index.d.ts +3 -0
- package/types/widget/metadata/abstractWidgetContentMetadata.d.ts +6 -0
- package/types/widget/metadata/channelWidgetContentMetadata.d.ts +11 -0
- package/types/widget/metadata/collectionWidgetContentMetadata.d.ts +12 -0
- package/types/widget/metadata/courseWidgetContentMetadata.d.ts +13 -0
- package/types/widget/metadata/documentLinkWidgetContentMetadata.d.ts +12 -0
- package/types/widget/metadata/documentPageWidgetContentMetadata.d.ts +12 -0
- package/types/widget/metadata/forumWidgetContentMetadata.d.ts +11 -0
- package/types/widget/metadata/index.d.ts +23 -0
- package/types/widget/metadata/learningPathWidgetContentMetadata.d.ts +16 -0
- package/types/widget/metadata/liveWidgetContentMetadata.d.ts +15 -0
- package/types/widget/metadata/richTextWidgetContentMetadata.d.ts +7 -0
- package/types/widget/metadata/topicWidgetContentMetadata.d.ts +14 -0
- package/types/widget/playbook/index.d.ts +8 -0
- package/types/widget/playbook/playbook.d.ts +8 -0
- package/types/widget/playbook/playbookHotspot.d.ts +12 -0
- package/types/widget/playbook/playbookHotspotLocation.d.ts +4 -0
- package/types/widget/playbook/playbookIntent.d.ts +12 -0
- package/types/widget/playbook/playbookIntentStatus.d.ts +5 -0
- package/types/widget/playbook/playbookIntentWidgetMode.d.ts +4 -0
- package/types/widget/playbook/playbookMatchingRules.d.ts +23 -0
- package/types/widget/playbook/playbookPage.d.ts +10 -0
- package/types/widget/spotWidgetContentType.d.ts +13 -0
- package/utils/date/date.d.ts +7 -0
- package/utils/date/formatDate.d.ts +16 -0
- package/utils/date/formatters/formatToDate.d.ts +2 -0
- package/utils/date/formatters/formatToDateTime.d.ts +2 -0
- package/utils/date/formatters/formatToExtraShortDate.d.ts +3 -0
- package/utils/date/formatters/formatToInlineExtraShortDate.d.ts +3 -0
- package/utils/date/formatters/formatToInlineShortDate.d.ts +3 -0
- package/utils/date/formatters/formatToLongDate.d.ts +3 -0
- package/utils/date/formatters/formatToLongDateTime.d.ts +3 -0
- package/utils/date/formatters/formatToShortDate.d.ts +2 -0
- package/utils/date/formatters/formatToShortTime.d.ts +3 -0
- package/utils/date/formatters/formatToSimpleDate.d.ts +2 -0
- package/utils/date/formatters/formatToSimpleDateTime.d.ts +2 -0
- package/utils/date/formatters/formatToTime.d.ts +2 -0
- package/utils/date/types.d.ts +3 -0
- package/utils/format.d.ts +6 -0
- package/utils/index.d.ts +16 -0
- package/utils/logger.d.ts +15 -0
- package/utils/playbook/testUrlMatching.d.ts +2 -0
- package/utils/playbookEditor/bridge.d.ts +22 -0
- package/utils/playbookEditor/lifecycle.d.ts +52 -0
- package/utils/string/sanitizeUrl.d.ts +1 -0
- package/utils/string/trim.d.ts +2 -0
- package/utils/ui/createDialog.d.ts +1 -0
- package/utils/ui/createIframe.d.ts +9 -0
- package/utils/ui/getHTMLElement.d.ts +5 -0
- package/utils/ui/isTouchDevice.d.ts +6 -0
- package/utm/flattenUtmParameters.d.ts +3 -0
- package/utm/index.d.ts +3 -0
- package/utm/parseUtmParameters.d.ts +2 -0
- package/utm/utmParameters.d.ts +7 -0
package/types/maybe.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Nullable } from '../nullable';
|
|
2
|
+
import { LastActionState } from './lastActionState';
|
|
3
|
+
export interface MeltyIntentUserStateEntry {
|
|
4
|
+
intentId: string;
|
|
5
|
+
lastActionAt: Nullable<number>;
|
|
6
|
+
lastActionState: Nullable<LastActionState>;
|
|
7
|
+
completionStatus: Nullable<boolean>;
|
|
8
|
+
}
|
|
9
|
+
export interface MeltyIntentUserStateListResponse {
|
|
10
|
+
entries: MeltyIntentUserStateEntry[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Nullable<T> = T | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const ATTRIBUTE_LINK = "a";
|
|
2
|
+
export declare const ATTRIBUTE_MENTION_INPUT = "mention_input";
|
|
3
|
+
export declare const ATTRIBUTE_MENTION = "mention";
|
|
4
|
+
export declare const ATTRIBUTE_VARIABLE = "var";
|
|
5
|
+
export declare const ATTRIBUTE_PARAGRAPH = "p";
|
|
6
|
+
export declare const ATTRIBUTE_H1 = "h1";
|
|
7
|
+
export declare const ATTRIBUTE_H2 = "h2";
|
|
8
|
+
export declare const ATTRIBUTE_H3 = "h3";
|
|
9
|
+
export declare const ATTRIBUTE_BLOCKQUOTE = "blockquote";
|
|
10
|
+
export declare const ATTRIBUTE_LAYOUT = "layout";
|
|
11
|
+
export declare const ATTRIBUTE_LAYOUT_COLUMN = "layout-column";
|
|
12
|
+
export declare const ATTRIBUTE_UL = "ul";
|
|
13
|
+
export declare const ATTRIBUTE_OL = "ol";
|
|
14
|
+
export declare const ATTRIBUTE_LIC = "lic";
|
|
15
|
+
export declare const ATTRIBUTE_LI = "li";
|
|
16
|
+
export declare const ATTRIBUTE_IMAGE = "img";
|
|
17
|
+
export declare const ATTRIBUTE_IFRAMELY = "iframely";
|
|
18
|
+
export declare const ATTRIBUTE_CODE_BLOCK = "code_block";
|
|
19
|
+
export declare const ATTRIBUTE_CODE_LINE = "code_line";
|
|
20
|
+
export interface SimplifiedRichText {
|
|
21
|
+
text: string;
|
|
22
|
+
bold?: boolean;
|
|
23
|
+
italic?: boolean;
|
|
24
|
+
underline?: boolean;
|
|
25
|
+
strikethrough?: boolean;
|
|
26
|
+
code?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SimplifiedElementNode {
|
|
29
|
+
type: string;
|
|
30
|
+
children?: SimplifiedRichTextNode[];
|
|
31
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
32
|
+
url?: string;
|
|
33
|
+
target?: string;
|
|
34
|
+
value?: string;
|
|
35
|
+
firstName?: string;
|
|
36
|
+
lastName?: string;
|
|
37
|
+
}
|
|
38
|
+
export type SimplifiedRichTextNode = SimplifiedElementNode | SimplifiedRichText;
|
|
39
|
+
export type SimplifiedRichTextData = SimplifiedElementNode[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ThemeMode = 'auto' | 'system' | 'light' | 'dark';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface ChannelWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Channel;
|
|
6
|
+
title: string;
|
|
7
|
+
emoji: Nullable<string>;
|
|
8
|
+
messagesCount: number;
|
|
9
|
+
description: string;
|
|
10
|
+
link: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface CollectionWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Collection;
|
|
6
|
+
title: string;
|
|
7
|
+
emoji: Nullable<string>;
|
|
8
|
+
pagesCount: number;
|
|
9
|
+
linksCount: number;
|
|
10
|
+
description: string;
|
|
11
|
+
link: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface CourseWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Course;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
cover: Nullable<string>;
|
|
9
|
+
completionRate: Nullable<number>;
|
|
10
|
+
link: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
stepsCount: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface DocumentLinkWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Link;
|
|
6
|
+
title: string;
|
|
7
|
+
cover: Nullable<string>;
|
|
8
|
+
collectionEmoji: Nullable<string>;
|
|
9
|
+
collectionTitle: string;
|
|
10
|
+
collectionId: string;
|
|
11
|
+
link: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface DocumentPageWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Page;
|
|
6
|
+
title: string;
|
|
7
|
+
cover: Nullable<string>;
|
|
8
|
+
collectionEmoji: Nullable<string>;
|
|
9
|
+
collectionTitle: string;
|
|
10
|
+
collectionId: string;
|
|
11
|
+
link: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface ForumWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Forum;
|
|
6
|
+
title: string;
|
|
7
|
+
emoji: Nullable<string>;
|
|
8
|
+
description: string;
|
|
9
|
+
topicsCount: number;
|
|
10
|
+
link: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChannelWidgetContentMetadata } from './channelWidgetContentMetadata';
|
|
2
|
+
import { CollectionWidgetContentMetadata } from './collectionWidgetContentMetadata';
|
|
3
|
+
import { CourseWidgetContentMetadata } from './courseWidgetContentMetadata';
|
|
4
|
+
import { DocumentLinkWidgetContentMetadata } from './documentLinkWidgetContentMetadata';
|
|
5
|
+
import { DocumentPageWidgetContentMetadata } from './documentPageWidgetContentMetadata';
|
|
6
|
+
import { ForumWidgetContentMetadata } from './forumWidgetContentMetadata';
|
|
7
|
+
import { LearningPathWidgetContentMetadata } from './learningPathWidgetContentMetadata';
|
|
8
|
+
import { LiveWidgetContentMetadata } from './liveWidgetContentMetadata';
|
|
9
|
+
import { RichTextWidgetContentMetadata } from './richTextWidgetContentMetadata';
|
|
10
|
+
import { TopicWidgetContentMetadata } from './topicWidgetContentMetadata';
|
|
11
|
+
export type WidgetContentMetadata = ChannelWidgetContentMetadata | CollectionWidgetContentMetadata | CourseWidgetContentMetadata | DocumentLinkWidgetContentMetadata | DocumentPageWidgetContentMetadata | ForumWidgetContentMetadata | LearningPathWidgetContentMetadata | LiveWidgetContentMetadata | RichTextWidgetContentMetadata | TopicWidgetContentMetadata;
|
|
12
|
+
export type NonRichTextWidgetContentMetadata = Exclude<WidgetContentMetadata, RichTextWidgetContentMetadata>;
|
|
13
|
+
export * from './abstractWidgetContentMetadata';
|
|
14
|
+
export * from './channelWidgetContentMetadata';
|
|
15
|
+
export * from './collectionWidgetContentMetadata';
|
|
16
|
+
export * from './courseWidgetContentMetadata';
|
|
17
|
+
export * from './documentLinkWidgetContentMetadata';
|
|
18
|
+
export * from './documentPageWidgetContentMetadata';
|
|
19
|
+
export * from './forumWidgetContentMetadata';
|
|
20
|
+
export * from './learningPathWidgetContentMetadata';
|
|
21
|
+
export * from './liveWidgetContentMetadata';
|
|
22
|
+
export * from './richTextWidgetContentMetadata';
|
|
23
|
+
export * from './topicWidgetContentMetadata';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LearningPathContentType } from '../../learningPathContentType';
|
|
2
|
+
import { Nullable } from '../../nullable';
|
|
3
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
4
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
5
|
+
export interface LearningPathContentSummary {
|
|
6
|
+
type: LearningPathContentType;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LearningPathWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
10
|
+
type: SpotWidgetContentType.LearningPath;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
completionRate: Nullable<number>;
|
|
14
|
+
contents: LearningPathContentSummary[];
|
|
15
|
+
link: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LiveBuiltInType, LiveStatus } from '../../live';
|
|
2
|
+
import { Nullable } from '../../nullable';
|
|
3
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
4
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
5
|
+
export interface LiveWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
6
|
+
type: SpotWidgetContentType.Live;
|
|
7
|
+
title: string;
|
|
8
|
+
cover: Nullable<string>;
|
|
9
|
+
startDate: number;
|
|
10
|
+
endDate: number;
|
|
11
|
+
liveType: Nullable<LiveBuiltInType>;
|
|
12
|
+
status: LiveStatus;
|
|
13
|
+
messagesCount: number;
|
|
14
|
+
link: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SimplifiedRichTextData } from '../../simplifiedRichText';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface RichTextWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.RichText;
|
|
6
|
+
content: SimplifiedRichTextData;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { SpotWidgetContentType } from '../spotWidgetContentType';
|
|
3
|
+
import { AbstractWidgetContentMetadata } from './abstractWidgetContentMetadata';
|
|
4
|
+
export interface TopicWidgetContentMetadata extends AbstractWidgetContentMetadata {
|
|
5
|
+
type: SpotWidgetContentType.Topic;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
forumEmoji: Nullable<string>;
|
|
9
|
+
forumTitle: string;
|
|
10
|
+
forumId: string;
|
|
11
|
+
score: number;
|
|
12
|
+
answersCount: number;
|
|
13
|
+
link: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './playbook';
|
|
2
|
+
export * from './playbookHotspot';
|
|
3
|
+
export * from './playbookHotspotLocation';
|
|
4
|
+
export * from './playbookIntent';
|
|
5
|
+
export * from './playbookIntentStatus';
|
|
6
|
+
export * from './playbookIntentWidgetMode';
|
|
7
|
+
export * from './playbookMatchingRules';
|
|
8
|
+
export * from './playbookPage';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { PlaybookHotspotLocation } from './playbookHotspotLocation';
|
|
3
|
+
export interface PlaybookHotspot {
|
|
4
|
+
id: string;
|
|
5
|
+
pageId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
location: PlaybookHotspotLocation;
|
|
8
|
+
cssSelector: Nullable<string>;
|
|
9
|
+
strictness: Nullable<number>;
|
|
10
|
+
highlighted: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { PlaybookIntentStatus } from './playbookIntentStatus';
|
|
3
|
+
export interface PlaybookIntent {
|
|
4
|
+
id: string;
|
|
5
|
+
hotspotId: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: PlaybookIntentStatus;
|
|
8
|
+
widgetId: Nullable<string>;
|
|
9
|
+
order: number;
|
|
10
|
+
spotMemberId: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare enum PlaybookPageMatchingOperator {
|
|
2
|
+
Contains = "Contains",
|
|
3
|
+
DoesntContain = "DoesntContain",
|
|
4
|
+
DoesntEndWith = "DoesntEndWith",
|
|
5
|
+
DoesntEqual = "DoesntEqual",
|
|
6
|
+
DoesntStartWith = "DoesntStartWith",
|
|
7
|
+
EndsWith = "EndsWith",
|
|
8
|
+
Equals = "Equals",
|
|
9
|
+
MatchesRegex = "MatchesRegex",
|
|
10
|
+
StartsWith = "StartsWith"
|
|
11
|
+
}
|
|
12
|
+
export interface PlaybookMatchingRule {
|
|
13
|
+
operator: PlaybookPageMatchingOperator;
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PlaybookMatchingRuleBlock {
|
|
17
|
+
ruleOperator: 'AND' | 'OR';
|
|
18
|
+
rules: PlaybookMatchingRule[];
|
|
19
|
+
}
|
|
20
|
+
export interface PlaybookMatchingRulesData {
|
|
21
|
+
blockOperator: 'AND' | 'OR';
|
|
22
|
+
blocks: PlaybookMatchingRuleBlock[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Nullable } from '../../nullable';
|
|
2
|
+
import { PlaybookMatchingRulesData } from './playbookMatchingRules';
|
|
3
|
+
export interface PlaybookPage {
|
|
4
|
+
id: string;
|
|
5
|
+
playbookId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
sampleUrl: string;
|
|
8
|
+
matchingRules: Nullable<PlaybookMatchingRulesData>;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum SpotWidgetContentType {
|
|
2
|
+
Channel = "Channel",
|
|
3
|
+
Collection = "Collection",
|
|
4
|
+
Course = "Course",
|
|
5
|
+
Forum = "Forum",
|
|
6
|
+
Link = "Link",
|
|
7
|
+
Live = "Live",
|
|
8
|
+
LearningPath = "LearningPath",
|
|
9
|
+
Page = "Page",
|
|
10
|
+
RichText = "RichText",// Not yet supported on concrete widgets but only from lists of content
|
|
11
|
+
Topic = "Topic"
|
|
12
|
+
}
|
|
13
|
+
export declare function isSpotWidgetContentType(value: any): value is SpotWidgetContentType;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CustomDate, DateLang } from './types';
|
|
2
|
+
export declare enum DateFormat {
|
|
3
|
+
SimpleDate = "SimpleDate",// 02/01/2023
|
|
4
|
+
SimpleDateTime = "SimpleDateTime",// 02/01/2023 1:01 AM
|
|
5
|
+
ExtraShortDate = "ExtraShortDate",// Feb 1
|
|
6
|
+
InlineExtraShortDate = "InlineExtraShortDate",// Feb 1st
|
|
7
|
+
ShortDate = "ShortDate",// Feb 1, 2023
|
|
8
|
+
InlineShortDate = "InlineShortDate",// Feb 1st, 2023
|
|
9
|
+
Date = "Date",// February 1, 2023
|
|
10
|
+
LongDate = "LongDate",// Wednesday, February 1st
|
|
11
|
+
LongDateTime = "LongDateTime",// Wednesday, February 1 at 1:01 AM
|
|
12
|
+
ShortTime = "ShortTime",// 1:01
|
|
13
|
+
Time = "Time",// 1:01 AM
|
|
14
|
+
DateTime = "DateTime"
|
|
15
|
+
}
|
|
16
|
+
export declare const formatDate: (date: CustomDate, dateFormat: DateFormat, dateLang?: DateLang | string, timezone?: string) => string;
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './string/trim';
|
|
2
|
+
export * from './string/sanitizeUrl';
|
|
3
|
+
export * from './ui/getHTMLElement';
|
|
4
|
+
export * from './ui/createDialog';
|
|
5
|
+
export * from './ui/createIframe';
|
|
6
|
+
export * from './ui/isTouchDevice';
|
|
7
|
+
export * from './date/date';
|
|
8
|
+
export * from './date/formatDate';
|
|
9
|
+
export * from './date/types';
|
|
10
|
+
export * from './playbook/testUrlMatching';
|
|
11
|
+
export { PLAYBOOK_EDITOR_ACTIVE_EVENT, isPlaybookEditorActive, } from './playbookEditor/bridge';
|
|
12
|
+
export type { PlaybookEditorActiveEventDetail } from './playbookEditor/bridge';
|
|
13
|
+
export { PlaybookEditorAwareLifecycle } from './playbookEditor/lifecycle';
|
|
14
|
+
export type { PlaybookEditorAwareCallbacks } from './playbookEditor/lifecycle';
|
|
15
|
+
export * from './format';
|
|
16
|
+
export * from './logger';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LoggerOptions {
|
|
2
|
+
appName?: string;
|
|
3
|
+
appVersion?: string;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class Logger {
|
|
7
|
+
debug: boolean;
|
|
8
|
+
readonly appName?: string;
|
|
9
|
+
readonly appVersion?: string;
|
|
10
|
+
constructor(options?: LoggerOptions);
|
|
11
|
+
log(message: string, ...context: unknown[]): void;
|
|
12
|
+
warn(message: string, ...context: unknown[]): void;
|
|
13
|
+
error(message: string, ...context: unknown[]): void;
|
|
14
|
+
private print;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight bridge that lets the playbook-editor Chrome extension signal
|
|
3
|
+
* its active/edit state to any Coach SDK instance running on the host page.
|
|
4
|
+
*
|
|
5
|
+
* The state is stored as a data attribute on `<html>` and changes are
|
|
6
|
+
* broadcast as a `CustomEvent` on `document`. Both channels rely on the
|
|
7
|
+
* shared DOM, which is the only state visible across the extension's
|
|
8
|
+
* isolated content-script world and the host page's main world. A regular
|
|
9
|
+
* `window` global would not propagate between the two.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PLAYBOOK_EDITOR_ACTIVE_EVENT = "meltingspot:playbook-editor:active-changed";
|
|
12
|
+
export interface PlaybookEditorActiveEventDetail {
|
|
13
|
+
active: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Read the current playbook-editor active flag. */
|
|
16
|
+
export declare const isPlaybookEditorActive: () => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Set the playbook-editor active flag and broadcast the change. Idempotent —
|
|
19
|
+
* emits the event only when the value actually flips, so SDK listeners don't
|
|
20
|
+
* churn on repeated set calls.
|
|
21
|
+
*/
|
|
22
|
+
export declare const setPlaybookEditorActive: (active: boolean) => void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface PlaybookEditorAwareCallbacks<TOptions> {
|
|
2
|
+
/** Called when the playbook editor enters edit mode. */
|
|
3
|
+
onEditorActive: () => Promise<void> | void;
|
|
4
|
+
/**
|
|
5
|
+
* Called when the playbook editor exits edit mode, with the start options
|
|
6
|
+
* cached via `cacheOptions`. Not called if no options have been cached.
|
|
7
|
+
*/
|
|
8
|
+
onEditorInactive: (cachedOptions: TOptions) => Promise<void> | void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Tracks the playbook-editor active signal on behalf of a SDK whose lifecycle
|
|
12
|
+
* should pause/resume in sync with the playbook-editor extension.
|
|
13
|
+
*
|
|
14
|
+
* Reads the state from the shared DOM rather than the CustomEvent detail —
|
|
15
|
+
* some browsers strip detail when an event crosses the extension's isolated
|
|
16
|
+
* content-script world to the host page's main world.
|
|
17
|
+
*/
|
|
18
|
+
export declare class PlaybookEditorAwareLifecycle<TOptions> {
|
|
19
|
+
private listener;
|
|
20
|
+
private lastOptions;
|
|
21
|
+
private chain;
|
|
22
|
+
/**
|
|
23
|
+
* Chain a lifecycle action onto the per-SDK serialization queue. Concurrent
|
|
24
|
+
* callers (host start/stop + bridge-driven pause/resume) each get their own
|
|
25
|
+
* slot, run in arrival order, and one action's rejection does not poison
|
|
26
|
+
* the queue for the next — the chain absorbs errors so subsequent callers
|
|
27
|
+
* always run, while the returned promise propagates the action's outcome
|
|
28
|
+
* back to its caller.
|
|
29
|
+
*/
|
|
30
|
+
enqueue(action: () => Promise<void>): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a bridge listener is currently attached. Useful for queued actions
|
|
33
|
+
* that need to bail when the host has called `unbind()` mid-flight (e.g. an
|
|
34
|
+
* editor-inactive resume that was enqueued just before an explicit stop).
|
|
35
|
+
*/
|
|
36
|
+
get isBound(): boolean;
|
|
37
|
+
/** Subscribe to the bridge event. Idempotent — subsequent calls are no-ops. */
|
|
38
|
+
bind(callbacks: PlaybookEditorAwareCallbacks<TOptions>): void;
|
|
39
|
+
/** Stash options so the listener can resume the SDK after edit mode exits. */
|
|
40
|
+
cacheOptions(options: TOptions): void;
|
|
41
|
+
/**
|
|
42
|
+
* Drop the cached options so the listener does not auto-resume the SDK on
|
|
43
|
+
* the next signal. Call from explicit stop paths.
|
|
44
|
+
*/
|
|
45
|
+
clearOptions(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Detach the bridge listener. Called from explicit stop paths so the SDK
|
|
48
|
+
* does not retain a long-lived listener after the host shuts it down. Also
|
|
49
|
+
* useful for tests.
|
|
50
|
+
*/
|
|
51
|
+
unbind(): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sanitizeUrl(endpoint: string, baseUrl: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createDialog: (rootDocument: Document) => HTMLDialogElement;
|