@streamlayer/react 1.1.3 → 1.1.5
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/lib/app/advertisement.d.ts +2 -0
- package/lib/app/app.d.ts +0 -1
- package/lib/app/masters.d.ts +0 -1
- package/lib/app/provider.d.ts +0 -1
- package/lib/app/useStreamLayerApp.d.ts +0 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/index2.js +37 -37
- package/lib/cjs/masters2.js +2 -2
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +14 -14
- package/lib/dist/cjs/masters.js +75 -75
- package/lib/dist/es/masters.js +14935 -14661
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +237 -202
- package/lib/es/app.js +323 -311
- package/lib/es/index2.js +2050 -2046
- package/lib/es/masters2.js +11 -11
- package/lib/es/points.js +3 -3
- package/lib/es/useStreamLayerApp2.js +3592 -3329
- package/lib/style.css +1 -1
- package/package.json +28 -28
- package/lib/dist/index.d.ts +0 -2208
package/lib/dist/index.d.ts
DELETED
|
@@ -1,2208 +0,0 @@
|
|
|
1
|
-
declare module "../../sdk-web-types/src/sl-types" {
|
|
2
|
-
import { PlainMessage } from '@bufbuild/protobuf';
|
|
3
|
-
import type { StreamSettings as SLStreamSettings, SdkOverlay, Advertising, OrganizationSettings as SLOrganizationSettings } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
4
|
-
import type { GameSettings as IGameSettings } from '@streamlayer/sl-eslib/sdkSettings/game/common/game_common_pb';
|
|
5
|
-
import type { ClientSettings } from '@streamlayer/sl-eslib/sdkSettings/client/client_pb';
|
|
6
|
-
import type { User as ProtoUser } from '@streamlayer/sl-eslib/users/users_common_pb';
|
|
7
|
-
export { QuestionType, QuestionStatus, QuestionImages, ImagePosition, SilenceSetting, QuestionOptions, PromotionType, PromotionWallet, PromotionLogoMode, CtaIconMode, } from '@streamlayer/sl-eslib/interactive/interactive.common_pb';
|
|
8
|
-
import type { PickHistory as IPickHistory, InsightHistory as IInsightHistory, TweetHistory as ITweetHistory, FeedItem as IFeedItem, FeedItemAttributes as IFeedItemAttributes, InstantView as IInstantView, PromotionHistory as IPromotionHistory } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
9
|
-
export { PickHistoryStatus } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
10
|
-
import type { LeaderboardItem as ILeaderboardItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
11
|
-
import type { ExtendedQuestionAnswer as IExtendedQuestionAnswer, Question as IQuestion, ExtendedQuestion as IExtendedQuestion, QuestionOptions_PromotionOptions } from '@streamlayer/sl-eslib/interactive/interactive.common_pb';
|
|
12
|
-
export type PickHistory = PlainMessage<IPickHistory>;
|
|
13
|
-
export type ExtendedQuestionAnswer = PlainMessage<IExtendedQuestionAnswer>;
|
|
14
|
-
export type InsightHistory = PlainMessage<IInsightHistory>;
|
|
15
|
-
export type TweetHistory = PlainMessage<ITweetHistory>;
|
|
16
|
-
export type OrganizationSettings = SLOrganizationSettings;
|
|
17
|
-
export type OrganizationAdvertising = Advertising;
|
|
18
|
-
export type FeatureConfig = SdkOverlay;
|
|
19
|
-
export type StreamSettings = SLStreamSettings;
|
|
20
|
-
export type User = {
|
|
21
|
-
data: ProtoUser | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type UserSettings = ClientSettings;
|
|
24
|
-
export type LeaderboardItem = ILeaderboardItem;
|
|
25
|
-
export type FeedItem = PlainMessage<IFeedItem>;
|
|
26
|
-
export type FeedItemAttributes = PlainMessage<IFeedItemAttributes>;
|
|
27
|
-
export type InstantView = PlainMessage<IInstantView>;
|
|
28
|
-
export type GameSettings = PlainMessage<IGameSettings>;
|
|
29
|
-
export type Question = PlainMessage<IQuestion>;
|
|
30
|
-
export type ExtendedQuestion = PlainMessage<IExtendedQuestion>;
|
|
31
|
-
export type PromotionHistory = PlainMessage<IPromotionHistory>;
|
|
32
|
-
export type PromotionOptions = PlainMessage<QuestionOptions_PromotionOptions>;
|
|
33
|
-
export { SdkOverlayType as FeatureType, SdkOverlaySettings, GamesOverlaySettings, } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
34
|
-
export { InvitationFrom } from '@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb';
|
|
35
|
-
}
|
|
36
|
-
declare module "../../sdk-web-types/src/index" {
|
|
37
|
-
export * from "../../sdk-web-types/src/sl-types";
|
|
38
|
-
}
|
|
39
|
-
declare module "../../sdk-web-logger/src/index" {
|
|
40
|
-
import { pino, ChildLoggerOptions } from 'pino';
|
|
41
|
-
export const createLogger: (name: string, options?: ChildLoggerOptions) => pino.Logger<never>;
|
|
42
|
-
export type Logger = ReturnType<typeof createLogger>;
|
|
43
|
-
}
|
|
44
|
-
declare module "../../sdk-web-interfaces/src/event-bus/index" {
|
|
45
|
-
import { InvitationFrom, QuestionType } from '@streamlayer/sdk-web-types';
|
|
46
|
-
const EventBusActions: {
|
|
47
|
-
notification: {
|
|
48
|
-
received: string;
|
|
49
|
-
opened: string;
|
|
50
|
-
rendered: string;
|
|
51
|
-
closed: string;
|
|
52
|
-
};
|
|
53
|
-
invitation: {
|
|
54
|
-
accepted: string;
|
|
55
|
-
sent: string;
|
|
56
|
-
};
|
|
57
|
-
interactions: {
|
|
58
|
-
tap: string;
|
|
59
|
-
scroll: string;
|
|
60
|
-
};
|
|
61
|
-
poll: {
|
|
62
|
-
voted: string;
|
|
63
|
-
navigated: string;
|
|
64
|
-
opened: string;
|
|
65
|
-
received: string;
|
|
66
|
-
onboardingPassed: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export type EventBusActionPayload = {
|
|
70
|
-
notification: {
|
|
71
|
-
eventId?: string;
|
|
72
|
-
questionId?: string;
|
|
73
|
-
questionType?: QuestionType;
|
|
74
|
-
};
|
|
75
|
-
invitation: {
|
|
76
|
-
from?: InvitationFrom;
|
|
77
|
-
};
|
|
78
|
-
interactions: unknown;
|
|
79
|
-
poll: {
|
|
80
|
-
questionId?: string;
|
|
81
|
-
questionType?: QuestionType;
|
|
82
|
-
questionOpenedFrom?: 'list' | 'notification';
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
type EventBusActionsKeys = keyof typeof EventBusActions;
|
|
86
|
-
type EventBusActions<T> = T extends EventBusActionsKeys ? keyof (typeof EventBusActions)[T] : never;
|
|
87
|
-
export type EventBusData<T extends EventBusActionsKeys = EventBusActionsKeys> = {
|
|
88
|
-
type: T;
|
|
89
|
-
action: EventBusActions<T>;
|
|
90
|
-
payload: EventBusActionPayload[T];
|
|
91
|
-
};
|
|
92
|
-
export class EventBusEvent<T extends EventBusActionsKeys = EventBusActionsKeys> extends Event {
|
|
93
|
-
slEventBus?: EventBusData<T>;
|
|
94
|
-
constructor(name: string, payload?: EventBusData<T>);
|
|
95
|
-
}
|
|
96
|
-
export class EventBus {
|
|
97
|
-
private name;
|
|
98
|
-
private listeners;
|
|
99
|
-
constructor(name?: string);
|
|
100
|
-
emit: <K extends EventBusActionsKeys = "notification" | "invitation" | "interactions" | "poll">(type: K, payload: Omit<EventBusData<K>, "type">) => void;
|
|
101
|
-
listen<T extends EventBusActionsKeys>(listener: (event: EventBusEvent<T>) => void): () => void;
|
|
102
|
-
off<T extends EventBusActionsKeys>(listener: (event: EventBusEvent<T>) => void): void;
|
|
103
|
-
destroy: () => void;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
declare module "../../sdk-web-interfaces/src/auth" {
|
|
107
|
-
export abstract class AbstractAuthenticationProvider {
|
|
108
|
-
abstract login(...args: unknown[]): Promise<unknown>;
|
|
109
|
-
abstract logout(): void;
|
|
110
|
-
abstract me(): Promise<unknown>;
|
|
111
|
-
abstract isAuthenticated(): Promise<unknown>;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
declare module "../../sdk-web-interfaces/src/store/abstract" {
|
|
115
|
-
import { type AnyStore } from 'nanostores';
|
|
116
|
-
global {
|
|
117
|
-
interface Window {
|
|
118
|
-
slStore: any;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* An abstract store is a wrapper for third-party stores,
|
|
123
|
-
* providing developers with a consistent interface inspired
|
|
124
|
-
* by the "nanostore" pattern. This simplifies
|
|
125
|
-
* interactions with different storage systems.
|
|
126
|
-
*/
|
|
127
|
-
export abstract class AbstractStore<T extends AnyStore> {
|
|
128
|
-
/**
|
|
129
|
-
* store instance (nanostores)
|
|
130
|
-
*/
|
|
131
|
-
protected readonly store: T;
|
|
132
|
-
protected readonly name: string;
|
|
133
|
-
constructor(store: T, name: string);
|
|
134
|
-
/**
|
|
135
|
-
* return store instance
|
|
136
|
-
*/
|
|
137
|
-
getStore(): T;
|
|
138
|
-
/**
|
|
139
|
-
* get all store values
|
|
140
|
-
*/
|
|
141
|
-
abstract getValues(): unknown;
|
|
142
|
-
/**
|
|
143
|
-
* get store value by key
|
|
144
|
-
*/
|
|
145
|
-
abstract getValue(...args: unknown[]): unknown;
|
|
146
|
-
/**
|
|
147
|
-
* subscribe directly to store changes
|
|
148
|
-
*/
|
|
149
|
-
abstract subscribe(...args: unknown[]): void;
|
|
150
|
-
/**
|
|
151
|
-
* unsubscribe directly to store change
|
|
152
|
-
*/
|
|
153
|
-
abstract unsubscribe(): void;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Merge multiple stores into a single instance using a single
|
|
157
|
-
* subscribe handler, leveraging the `useStore` method from `@nanostores/react` for React subscriptions.
|
|
158
|
-
*/
|
|
159
|
-
export const mergeStores: <T extends Record<string, AbstractStore<AnyStore>>, K = { [Index in keyof T]: ReturnType<T[Index]["getStore"]>["value"]; }>(stores: T) => import("nanostores").ReadableAtom<K>;
|
|
160
|
-
}
|
|
161
|
-
declare module "../../sdk-web-interfaces/src/store/map" {
|
|
162
|
-
import { type MapStoreKeys, type MapStore as NMapStore } from 'nanostores';
|
|
163
|
-
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
164
|
-
/**
|
|
165
|
-
* Wrapper for nanostores MapStore
|
|
166
|
-
*/
|
|
167
|
-
export class MapStore<StoreInterface extends object, StoreInstance extends NMapStore<StoreInterface> = NMapStore<StoreInterface>> extends AbstractStore<StoreInstance> {
|
|
168
|
-
getValues: () => StoreInterface;
|
|
169
|
-
getValue: (key: MapStoreKeys<StoreInstance>) => StoreInterface[MapStoreKeys<StoreInstance>];
|
|
170
|
-
setValue: <Key extends MapStoreKeys<StoreInstance>>(path: Key, value: StoreInterface[Key]) => void;
|
|
171
|
-
subscribe: StoreInstance['subscribe'];
|
|
172
|
-
unsubscribe: () => void;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* create map store from nanostores
|
|
176
|
-
*/
|
|
177
|
-
export const createMapStore: <Data extends object>(initialData: Data) => NMapStore<Data>;
|
|
178
|
-
export type MapStoreListeners<StoreInstance extends NMapStore<StoreInterface>, StoreInterface extends object> = {
|
|
179
|
-
[T in MapStoreKeys<StoreInstance>]: (value: StoreInterface[T]) => void;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
declare module "../../sdk-web-interfaces/src/feature" {
|
|
183
|
-
import { FeatureConfig as SdkOverlay, SdkOverlaySettings } from '@streamlayer/sdk-web-types';
|
|
184
|
-
import { PlainMessage } from '@bufbuild/protobuf';
|
|
185
|
-
import { WritableAtom } from 'nanostores';
|
|
186
|
-
import { MapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
187
|
-
type FeatureListener = {
|
|
188
|
-
name: string;
|
|
189
|
-
enabled: boolean;
|
|
190
|
-
onEvent: (...args: unknown[]) => void;
|
|
191
|
-
};
|
|
192
|
-
export type FeatureProps = PlainMessage<SdkOverlay>;
|
|
193
|
-
export enum FeatureSource {
|
|
194
|
-
ORGANIZATION = "ORGANIZATION",
|
|
195
|
-
STREAM = "STREAM"
|
|
196
|
-
}
|
|
197
|
-
type FeatureConfig = Omit<FeatureProps, 'settings'>;
|
|
198
|
-
type FeatureSettings = Exclude<PlainMessage<SdkOverlaySettings>['overlaySettings'], {
|
|
199
|
-
case: 'inplay';
|
|
200
|
-
} | {
|
|
201
|
-
case: 'getstream';
|
|
202
|
-
} | {
|
|
203
|
-
case: undefined;
|
|
204
|
-
}>;
|
|
205
|
-
export enum FeatureStatus {
|
|
206
|
-
Ready = "ready",
|
|
207
|
-
Suspended = "suspended"
|
|
208
|
-
}
|
|
209
|
-
export class AbstractFeature<K extends FeatureSettings['case'] | undefined, C extends FeatureSettings['value'] = FeatureSettings['value']> {
|
|
210
|
-
status: WritableAtom<FeatureStatus>;
|
|
211
|
-
source: FeatureSource;
|
|
212
|
-
protected config: MapStore<FeatureConfig>;
|
|
213
|
-
protected settings: MapStore<C>;
|
|
214
|
-
protected listeners: Set<FeatureListener>;
|
|
215
|
-
protected settingsKey: K;
|
|
216
|
-
constructor({ settings, ...config }: FeatureProps, source: FeatureSource);
|
|
217
|
-
get featureConfig(): import("nanostores").MapStore<FeatureConfig>;
|
|
218
|
-
get featureSettings(): import("nanostores").MapStore<C>;
|
|
219
|
-
registerEventListener(listener: FeatureListener): void;
|
|
220
|
-
enable: () => void;
|
|
221
|
-
disable: () => void;
|
|
222
|
-
setFeatureConfig: ({ settings, ...config }: FeatureProps) => void;
|
|
223
|
-
update: (config: FeatureProps, source: FeatureSource) => void;
|
|
224
|
-
protected fireEvent(event: unknown): void;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
declare module "../../sdk-web-interfaces/src/store/single" {
|
|
228
|
-
import { type StoreValue, type WritableAtom } from 'nanostores';
|
|
229
|
-
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
230
|
-
/**
|
|
231
|
-
* Wrapper for nanostores WritableAtom
|
|
232
|
-
*/
|
|
233
|
-
export class SingleStore<StoreValue, StoreInstance extends WritableAtom<StoreValue | undefined> = WritableAtom<StoreValue | undefined>> extends AbstractStore<StoreInstance> {
|
|
234
|
-
getValue: () => StoreInstance["value"];
|
|
235
|
-
getValues(): unknown;
|
|
236
|
-
setValue: (value?: StoreValue) => void;
|
|
237
|
-
subscribe: (listener: Parameters<StoreInstance["subscribe"]>[0]) => () => void;
|
|
238
|
-
unsubscribe: () => void;
|
|
239
|
-
listen(listener: Parameters<StoreInstance['subscribe']>[0]): () => void;
|
|
240
|
-
get(): StoreValue | undefined;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* create atom store from nanostores
|
|
244
|
-
*/
|
|
245
|
-
export const createSingleStore: <T>(initialData: T) => WritableAtom<T>;
|
|
246
|
-
export const createComputedStore: <Value, T extends WritableAtom = WritableAtom<any>>(store: T, mutator: (value: StoreValue<T>) => Value) => import("nanostores").ReadableAtom<Value>;
|
|
247
|
-
}
|
|
248
|
-
declare module "../../sdk-web-interfaces/src/store/api" {
|
|
249
|
-
import type { FetcherStore, FetcherValue } from '@nanostores/query';
|
|
250
|
-
import { WritableAtom } from 'nanostores';
|
|
251
|
-
import { AbstractStore } from "../../sdk-web-interfaces/src/store/abstract";
|
|
252
|
-
/**
|
|
253
|
-
* Wrapper for @nanostores/query FetcherStore
|
|
254
|
-
*/
|
|
255
|
-
export class ApiStore<StoreValue, StoreInstance extends FetcherStore<StoreValue, any> = FetcherStore<StoreValue, any>> extends AbstractStore<StoreInstance> {
|
|
256
|
-
private readonly atomStore;
|
|
257
|
-
constructor(store: StoreInstance, name: string, atomPicker?: (val: FetcherValue<StoreValue, unknown>, prevVal?: string) => string | undefined);
|
|
258
|
-
getAtomStore: () => WritableAtom<string | undefined>;
|
|
259
|
-
getValue: () => Promise<StoreValue | undefined>;
|
|
260
|
-
getValues: () => FetcherValue<StoreValue, any>;
|
|
261
|
-
setValue: (value?: StoreInstance["value"]) => void;
|
|
262
|
-
subscribe: StoreInstance['subscribe'];
|
|
263
|
-
unsubscribe: () => never;
|
|
264
|
-
invalidate: () => void;
|
|
265
|
-
listen: (cb: Parameters<StoreInstance["listen"]>[0]) => () => void;
|
|
266
|
-
get(): void;
|
|
267
|
-
key: () => string | undefined;
|
|
268
|
-
off: () => void;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
declare module "../../sdk-web-interfaces/src/index" {
|
|
272
|
-
import { FeatureType } from '@streamlayer/sdk-web-types';
|
|
273
|
-
import { EventBus, EventBusEvent, EventBusData, EventBusActionPayload } from "../../sdk-web-interfaces/src/event-bus/index";
|
|
274
|
-
export { AbstractAuthenticationProvider } from "../../sdk-web-interfaces/src/auth";
|
|
275
|
-
export { AbstractFeature, FeatureSource, type FeatureProps, FeatureStatus } from "../../sdk-web-interfaces/src/feature";
|
|
276
|
-
export { MapStore, createMapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
277
|
-
export type { MapStoreListeners } from "../../sdk-web-interfaces/src/store/map";
|
|
278
|
-
export { SingleStore, createSingleStore, createComputedStore } from "../../sdk-web-interfaces/src/store/single";
|
|
279
|
-
export { AbstractStore, mergeStores } from "../../sdk-web-interfaces/src/store/abstract";
|
|
280
|
-
export { ApiStore } from "../../sdk-web-interfaces/src/store/api";
|
|
281
|
-
export type CancelMountCb = () => void;
|
|
282
|
-
export type OnMountCb = () => CancelMountCb;
|
|
283
|
-
export interface StreamLayerSDK {
|
|
284
|
-
onMount: (opts: {
|
|
285
|
-
name: string;
|
|
286
|
-
clear?: boolean;
|
|
287
|
-
}, cb: OnMountCb) => void;
|
|
288
|
-
closeFeature: (destroy?: boolean) => void;
|
|
289
|
-
openFeature: (featureType: FeatureType) => void;
|
|
290
|
-
}
|
|
291
|
-
export interface StreamLayerContext {
|
|
292
|
-
sdk: StreamLayerSDK;
|
|
293
|
-
}
|
|
294
|
-
type DoneFn = Function;
|
|
295
|
-
export type StreamLayerPlugin = (instance: StreamLayerContext, opts: unknown, done: DoneFn) => void;
|
|
296
|
-
export const eventBus: EventBus;
|
|
297
|
-
export type { EventBusEvent, EventBusData, EventBusActionPayload };
|
|
298
|
-
}
|
|
299
|
-
declare module "../../sdk-web-storage/src/isQuotaExceededError" {
|
|
300
|
-
export function isQuotaExceededError(err: unknown): boolean;
|
|
301
|
-
}
|
|
302
|
-
declare module "../../sdk-web-storage/src/index" {
|
|
303
|
-
import { isQuotaExceededError } from "../../sdk-web-storage/src/isQuotaExceededError";
|
|
304
|
-
export { isQuotaExceededError };
|
|
305
|
-
export type ArrayWithMinTwoItems = [string, string, ...string[]];
|
|
306
|
-
export class Storage {
|
|
307
|
-
private delimiter;
|
|
308
|
-
private prefix;
|
|
309
|
-
private storage;
|
|
310
|
-
constructor(prefix?: string, storage?: globalThis.Storage);
|
|
311
|
-
clear: () => void;
|
|
312
|
-
protected generateKey: (keyParts: string[]) => string;
|
|
313
|
-
protected write: (keyParts_0: string, keyParts_1: string, ...keyParts_2: string[]) => void;
|
|
314
|
-
protected read: (...keyParts: string[]) => string | undefined;
|
|
315
|
-
protected remove: (...keyParts: string[]) => void;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
declare module "../../sdk-web-api/src/utils/devtools" {
|
|
319
|
-
export const __GRPC_DEVTOOLS_EXTENSION__: any;
|
|
320
|
-
}
|
|
321
|
-
declare module "../../sdk-web-api/src/grpc/retry" {
|
|
322
|
-
import { type Interceptor } from '@connectrpc/connect';
|
|
323
|
-
/**
|
|
324
|
-
* Retry interceptor
|
|
325
|
-
*
|
|
326
|
-
* This interceptor is used to retry requests in case of network errors.
|
|
327
|
-
* Retries are performed according to the exponential backoff algorithm.
|
|
328
|
-
* Allowing retries for the following error codes:
|
|
329
|
-
* [
|
|
330
|
-
* Code.Unknown,
|
|
331
|
-
* Code.Internal,
|
|
332
|
-
* Code.DeadlineExceeded,
|
|
333
|
-
* Code.ResourceExhausted,
|
|
334
|
-
* Code.FailedPrecondition,
|
|
335
|
-
* Code.Unavailable,
|
|
336
|
-
* Code.DataLoss,
|
|
337
|
-
* ]
|
|
338
|
-
*
|
|
339
|
-
* Retry params:
|
|
340
|
-
* - retryAttempts: number of attempts to retry the request, 0 means no retries
|
|
341
|
-
* - retryDelay: max delay between retries in milliseconds
|
|
342
|
-
*
|
|
343
|
-
* Example:
|
|
344
|
-
* ```ts
|
|
345
|
-
const { client, createRequestOptions, queryKey } = transport.createPromiseClient(Leaderboard, {
|
|
346
|
-
method: 'summary',
|
|
347
|
-
params: [$eventId, $userId],
|
|
348
|
-
})
|
|
349
|
-
|
|
350
|
-
return transport.nanoquery.createFetcherStore(queryKey, {
|
|
351
|
-
fetcher: async (_, __, eventId, userId) => {
|
|
352
|
-
const contextValues = createRequestOptions({
|
|
353
|
-
retryAttempts: 5,
|
|
354
|
-
retryDelay: 10000,
|
|
355
|
-
})
|
|
356
|
-
|
|
357
|
-
const res = await client.summary(
|
|
358
|
-
{
|
|
359
|
-
eventId: eventId as unknown as bigint,
|
|
360
|
-
userId: userId as string,
|
|
361
|
-
},
|
|
362
|
-
{ contextValues }
|
|
363
|
-
)
|
|
364
|
-
|
|
365
|
-
return res.data?.attributes
|
|
366
|
-
},
|
|
367
|
-
})
|
|
368
|
-
* ```
|
|
369
|
-
*/
|
|
370
|
-
export const retry: Interceptor;
|
|
371
|
-
}
|
|
372
|
-
declare module "../../sdk-web-api/src/grpc/transport" {
|
|
373
|
-
import { MapStore } from '@streamlayer/sdk-web-interfaces';
|
|
374
|
-
import { createRouterTransport, ConnectRouter, Interceptor, PromiseClient, UnaryRequest, StreamRequest } from '@connectrpc/connect';
|
|
375
|
-
import type { ServiceType, Message, PlainMessage } from '@bufbuild/protobuf';
|
|
376
|
-
import { createGrpcWebTransport } from '@connectrpc/connect-web';
|
|
377
|
-
import { type KeyInput, nanoquery } from '@nanostores/query';
|
|
378
|
-
import { Atom } from 'nanostores';
|
|
379
|
-
import { ServerStreamSubscription, type ServerStreamSubscriptionOptions } from "../../sdk-web-api/src/grpc/subscription";
|
|
380
|
-
type KnownHeaders = {
|
|
381
|
-
authorization?: string;
|
|
382
|
-
sdk?: string;
|
|
383
|
-
'sl-device-id': string;
|
|
384
|
-
'sl-device-os': string;
|
|
385
|
-
'sl-user-id'?: string;
|
|
386
|
-
} & Record<string, string>;
|
|
387
|
-
export type GrpcTransport = Transport['transport'];
|
|
388
|
-
type ReservedHeaders = 'sdk' | 'authorization';
|
|
389
|
-
type ExcludeReservedHeaders<T> = ReservedHeaders extends T ? never : T extends ReservedHeaders ? never : T;
|
|
390
|
-
global {
|
|
391
|
-
interface Window {
|
|
392
|
-
__GRPC_DEVTOOLS_EXTENSION__?: () => import('@connectrpc/connect').Interceptor;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
type NanoqueryReturnType = ReturnType<typeof nanoquery>;
|
|
396
|
-
type NanoqueryObjectType = {
|
|
397
|
-
createFetcherStore: NanoqueryReturnType[0];
|
|
398
|
-
createMutatorStore: NanoqueryReturnType[1];
|
|
399
|
-
utils: NanoqueryReturnType[2];
|
|
400
|
-
};
|
|
401
|
-
export const RequestOptionsKeys: {
|
|
402
|
-
retryAttempts: import("@connectrpc/connect").ContextKey<number>;
|
|
403
|
-
retryDelay: import("@connectrpc/connect").ContextKey<number>;
|
|
404
|
-
};
|
|
405
|
-
type RequestOptionsKey = keyof typeof RequestOptionsKeys;
|
|
406
|
-
type RequestOptions = Partial<Record<RequestOptionsKey, (typeof RequestOptionsKeys)[RequestOptionsKey]['defaultValue']>>;
|
|
407
|
-
/**
|
|
408
|
-
* transport wrapper, initialize grpc transport, store headers and connect interceptors
|
|
409
|
-
*/
|
|
410
|
-
export class Transport {
|
|
411
|
-
toJsonOptions: {
|
|
412
|
-
emitDefaultValues: boolean;
|
|
413
|
-
enumAsInteger: boolean;
|
|
414
|
-
useProtoFieldName: boolean;
|
|
415
|
-
};
|
|
416
|
-
readonly transport: ReturnType<typeof createGrpcWebTransport>;
|
|
417
|
-
readonly streamTransport: ReturnType<typeof createGrpcWebTransport>;
|
|
418
|
-
nanoquery: NanoqueryObjectType;
|
|
419
|
-
readonly host: string;
|
|
420
|
-
readonly $headers: MapStore<KnownHeaders>;
|
|
421
|
-
protected interceptors: Interceptor[];
|
|
422
|
-
private clients;
|
|
423
|
-
private streamClients;
|
|
424
|
-
private subscriptions;
|
|
425
|
-
private opts?;
|
|
426
|
-
constructor(host: string, opts?: {
|
|
427
|
-
dedupeTime?: number;
|
|
428
|
-
refetchInterval?: number;
|
|
429
|
-
retryable?: boolean;
|
|
430
|
-
});
|
|
431
|
-
addSubscription: <T extends ServiceType, Req extends Message<Req>, Res extends Message<Res>>(method: ServerStreamSubscription<T, Req, Res>["method"], params: Atom<PlainMessage<Req>> | PlainMessage<Req>, options: ServerStreamSubscriptionOptions) => ServerStreamSubscription<ServiceType, Message<import("@bufbuild/protobuf").AnyMessage>, Message<import("@bufbuild/protobuf").AnyMessage>, never, never> | ServerStreamSubscription<T, Req, Res, keyof { [P in keyof PromiseClient<T> as T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? P : never]: T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? PromiseClient<T>[P] : never; }, { [P in keyof PromiseClient<T> as T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? P : never]: T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? PromiseClient<T>[P] : never; }[keyof { [P in keyof PromiseClient<T> as T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? P : never]: T["methods"][P] extends import("@bufbuild/protobuf").MethodInfoServerStreaming<any, any> ? PromiseClient<T>[P] : never; }]>;
|
|
432
|
-
removeSubscription: (subscription: ServerStreamSubscription<ServiceType, Message, Message>) => void;
|
|
433
|
-
disconnect: () => void;
|
|
434
|
-
registerInterceptor: (interceptor: Interceptor) => void;
|
|
435
|
-
removeInterceptor: (interceptor: Interceptor) => void;
|
|
436
|
-
getClient: <T extends ServiceType>(service: T) => PromiseClient<T>;
|
|
437
|
-
getStreamClient: <T extends ServiceType>(service: T) => PromiseClient<T>;
|
|
438
|
-
createPromiseClient: <T extends ServiceType>(service: T, { params, method }: {
|
|
439
|
-
params?: KeyInput;
|
|
440
|
-
method: keyof T["methods"];
|
|
441
|
-
}) => {
|
|
442
|
-
client: PromiseClient<T>;
|
|
443
|
-
createRequestOptions: (options: RequestOptions) => import("@connectrpc/connect").ContextValues;
|
|
444
|
-
queryKey: ((string | number | true) | import("nanostores").ReadableAtom<(string | number | true) | (false | void | null | undefined)> | import("@nanostores/query").FetcherStore<any, any>)[];
|
|
445
|
-
queryKeyStr: string;
|
|
446
|
-
};
|
|
447
|
-
createStreamClient: <T extends ServiceType>(service: T) => {
|
|
448
|
-
client: PromiseClient<T>;
|
|
449
|
-
};
|
|
450
|
-
setSdkKey: (sdkKey: string) => void;
|
|
451
|
-
setAuth: (token: string, userId: string) => void;
|
|
452
|
-
setHeader: <T extends keyof KnownHeaders = string>(name: ExcludeReservedHeaders<T>, value: string) => void;
|
|
453
|
-
getHeader: (name: keyof KnownHeaders) => string;
|
|
454
|
-
getHeaders: () => KnownHeaders;
|
|
455
|
-
initInterceptors: () => void;
|
|
456
|
-
}
|
|
457
|
-
export class MockTransport extends Transport {
|
|
458
|
-
transport: ReturnType<typeof createRouterTransport>;
|
|
459
|
-
calls: Array<UnaryRequest | StreamRequest>;
|
|
460
|
-
constructor(transport: (router: ConnectRouter) => void);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
declare module "../../sdk-web-api/src/grpc/subscription" {
|
|
464
|
-
import { PromiseClient } from '@connectrpc/connect';
|
|
465
|
-
import { Atom } from 'nanostores';
|
|
466
|
-
import type { ServiceType, Message, PlainMessage, MethodInfoServerStreaming } from '@bufbuild/protobuf';
|
|
467
|
-
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
468
|
-
type StreamPromiseClient<T extends ServiceType> = {
|
|
469
|
-
[P in keyof PromiseClient<T> as T['methods'][P] extends MethodInfoServerStreaming<any, any> ? P : never]: T['methods'][P] extends MethodInfoServerStreaming<any, any> ? PromiseClient<T>[P] : never;
|
|
470
|
-
};
|
|
471
|
-
type StreamMethods<T extends ServiceType> = {
|
|
472
|
-
[P in keyof StreamPromiseClient<T>]: P;
|
|
473
|
-
};
|
|
474
|
-
export type StreamMethod<T extends ServiceType> = StreamMethods<T>[keyof StreamMethods<T>] extends keyof StreamPromiseClient<T> ? StreamMethods<T>[keyof StreamMethods<T>] : never;
|
|
475
|
-
enum ServerStreamSubscriptionStatus {
|
|
476
|
-
Init = "init",
|
|
477
|
-
Ready = "ready",
|
|
478
|
-
Connecting = "connecting",
|
|
479
|
-
Connected = "connected",
|
|
480
|
-
Disconnected = "disconnected",
|
|
481
|
-
Failed = "failed",
|
|
482
|
-
Reconnect = "reconnect",
|
|
483
|
-
Reconnecting = "reconnecting"
|
|
484
|
-
}
|
|
485
|
-
export type ServerStreamSubscriptionOptions = {
|
|
486
|
-
name: string;
|
|
487
|
-
withStore?: boolean;
|
|
488
|
-
reconnectDelay?: number;
|
|
489
|
-
reconnectMaxDelay?: number;
|
|
490
|
-
reconnectMaxAttempts?: number;
|
|
491
|
-
};
|
|
492
|
-
export class ServerStreamSubscription<T extends ServiceType, Request extends Message<Request>, Response extends Message<Response>, M extends keyof StreamMethods<T> = keyof StreamMethods<T>, Method extends StreamPromiseClient<T>[M] = StreamPromiseClient<T>[M]> {
|
|
493
|
-
params: Atom<PlainMessage<Request>> | PlainMessage<Request>;
|
|
494
|
-
private streamCancel?;
|
|
495
|
-
private method;
|
|
496
|
-
private options;
|
|
497
|
-
private headers;
|
|
498
|
-
private listeners;
|
|
499
|
-
private state;
|
|
500
|
-
private store?;
|
|
501
|
-
private paramsListener?;
|
|
502
|
-
private reconnectTimeout?;
|
|
503
|
-
private attempt;
|
|
504
|
-
constructor(headers: Transport['$headers'], method: Method, params: Atom<PlainMessage<Request>> | PlainMessage<Request>, options: ServerStreamSubscriptionOptions);
|
|
505
|
-
updateState: (status: ServerStreamSubscriptionStatus) => void;
|
|
506
|
-
addStateLog: (msg: string) => void;
|
|
507
|
-
addListener: (name: string, listener: (response: Response) => void) => (() => void);
|
|
508
|
-
removeListener: (name: string) => void;
|
|
509
|
-
connect: () => void;
|
|
510
|
-
disconnect: () => void;
|
|
511
|
-
/**
|
|
512
|
-
* Reconnect after delay, if not already reconnecting, otherwise do nothing
|
|
513
|
-
*/
|
|
514
|
-
reconnect: () => void;
|
|
515
|
-
getStore: () => import("nanostores").WritableAtom<Response | null | undefined> | undefined;
|
|
516
|
-
private onData;
|
|
517
|
-
/**
|
|
518
|
-
* Disconnect if error is not instance of ConnectError or stream is Canceled,
|
|
519
|
-
* Reconnect in other cases
|
|
520
|
-
* Do nothing if error is undefined
|
|
521
|
-
*/
|
|
522
|
-
private onStreamError;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
declare module "../../sdk-web-api/src/grpc/queries/event" {
|
|
526
|
-
import { ReadableAtom } from 'nanostores';
|
|
527
|
-
import type { StreamSettings } from '@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb';
|
|
528
|
-
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
529
|
-
export const $retrieveEventId: ($providerStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<string | undefined, any>;
|
|
530
|
-
export const $streamSettings: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<StreamSettings | undefined, any>;
|
|
531
|
-
}
|
|
532
|
-
declare module "../../sdk-web-api/src/grpc/queries/user" {
|
|
533
|
-
import { ReadableAtom } from 'nanostores';
|
|
534
|
-
import type { BypassAuthRequest } from '@streamlayer/sl-eslib/users/users_pb';
|
|
535
|
-
import { PlainMessage } from '@bufbuild/protobuf';
|
|
536
|
-
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
537
|
-
export const $user: ($userToken: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<{
|
|
538
|
-
data: import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined;
|
|
539
|
-
}, any>;
|
|
540
|
-
export const bypassLogin: (transport: Transport) => ({ userKey, schema, init, inviterKey }: PlainMessage<BypassAuthRequest>) => Promise<import("@streamlayer/sl-eslib/users/users_pb").BypassAuthResponse>;
|
|
541
|
-
export const bypassAuth: (transport: Transport, params: {
|
|
542
|
-
userKey?: string;
|
|
543
|
-
schema?: string;
|
|
544
|
-
init?: boolean;
|
|
545
|
-
}) => Promise<import("@streamlayer/sl-eslib/users/users_pb").BypassAuthResponse>;
|
|
546
|
-
export const $userSettings: ($userToken: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>;
|
|
547
|
-
export const register: (transport: Transport, phone: string) => Promise<import("@streamlayer/sl-eslib/users/users_pb").RegisterResponse>;
|
|
548
|
-
}
|
|
549
|
-
declare module "../../sdk-web-api/src/grpc/queries/organization" {
|
|
550
|
-
import { ReadableAtom } from 'nanostores';
|
|
551
|
-
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
552
|
-
export { $user } from "../../sdk-web-api/src/grpc/queries/user";
|
|
553
|
-
export const $organizationSettings: ($enabled: ReadableAtom<"on" | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<{
|
|
554
|
-
id: string;
|
|
555
|
-
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
556
|
-
buttonIcon?: string | undefined;
|
|
557
|
-
tinodeHost?: string | undefined;
|
|
558
|
-
audience?: string | undefined;
|
|
559
|
-
name?: string | undefined;
|
|
560
|
-
provider?: string | undefined;
|
|
561
|
-
primaryColor?: string | undefined;
|
|
562
|
-
secondaryColor?: string | undefined;
|
|
563
|
-
moderationPrimaryColor?: string | undefined;
|
|
564
|
-
linkShareIcon?: string | undefined;
|
|
565
|
-
linkShareText?: string | undefined;
|
|
566
|
-
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
567
|
-
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
568
|
-
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
569
|
-
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
570
|
-
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
571
|
-
} | undefined, any>;
|
|
572
|
-
export const $organizationAdvertising: ($enabled: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>;
|
|
573
|
-
}
|
|
574
|
-
declare module "../../sdk-web-api/src/grpc/queries/index" {
|
|
575
|
-
export * from "../../sdk-web-api/src/grpc/queries/event";
|
|
576
|
-
export * from "../../sdk-web-api/src/grpc/queries/organization";
|
|
577
|
-
export * from "../../sdk-web-api/src/grpc/queries/user";
|
|
578
|
-
}
|
|
579
|
-
declare module "../../sdk-web-api/src/index" {
|
|
580
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
581
|
-
import { FetcherStore } from '@nanostores/query';
|
|
582
|
-
export type { ServerStreamSubscriptionOptions } from "../../sdk-web-api/src/grpc/subscription";
|
|
583
|
-
export { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
584
|
-
import { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
585
|
-
export type { GrpcTransport } from "../../sdk-web-api/src/grpc/transport";
|
|
586
|
-
export * as queries from "../../sdk-web-api/src/grpc/queries/index";
|
|
587
|
-
export type GetApiResponseType<T extends (...args: any[]) => FetcherStore> = ReturnType<ReturnType<T>['get']>['data'];
|
|
588
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
589
|
-
interface StreamLayerSDK {
|
|
590
|
-
host: string;
|
|
591
|
-
}
|
|
592
|
-
interface StreamLayerContext {
|
|
593
|
-
transport: Transport;
|
|
594
|
-
analyticsTransport: Transport;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
export const transport: (instance: StreamLayerContext, opts: {
|
|
598
|
-
sdkKey: string;
|
|
599
|
-
host: string;
|
|
600
|
-
analyticsHost: string;
|
|
601
|
-
version?: string;
|
|
602
|
-
}, done: () => void) => void;
|
|
603
|
-
}
|
|
604
|
-
declare module "../../sdk-web-core/src/storage" {
|
|
605
|
-
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
606
|
-
export class UserStorage extends Storage {
|
|
607
|
-
constructor();
|
|
608
|
-
setSchema: (value: string) => void;
|
|
609
|
-
getSchema: () => string | undefined;
|
|
610
|
-
setToken: (value: string) => void;
|
|
611
|
-
getToken: () => string | undefined;
|
|
612
|
-
setExternalToken: (value: string) => void;
|
|
613
|
-
getExternalToken: () => string | undefined;
|
|
614
|
-
removeToken: () => void;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
declare module "../../sdk-web-core/src/store/init" {
|
|
618
|
-
import { SingleStore, ApiStore } from '@streamlayer/sdk-web-interfaces';
|
|
619
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
620
|
-
import { User } from '@streamlayer/sdk-web-types';
|
|
621
|
-
export enum CoreStatus {
|
|
622
|
-
DISABLED = "disabled",
|
|
623
|
-
INITIALIZATION = "initialization",
|
|
624
|
-
READY = "ready",
|
|
625
|
-
FAILED = "failed",
|
|
626
|
-
SUSPENDED = "suspended"
|
|
627
|
-
}
|
|
628
|
-
export const initializeStore: (transport: Transport) => {
|
|
629
|
-
readonly enabled: SingleStore<unknown, import("nanostores").WritableAtom<"on" | undefined>>;
|
|
630
|
-
readonly status: SingleStore<unknown, import("nanostores").WritableAtom<CoreStatus>>;
|
|
631
|
-
readonly providerStreamId: SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
632
|
-
readonly slStreamId: ApiStore<string | undefined, import("@nanostores/query").FetcherStore<string | undefined, any>>;
|
|
633
|
-
readonly streamSettings: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, any>>;
|
|
634
|
-
readonly user: ApiStore<User, import("@nanostores/query").FetcherStore<User, any>>;
|
|
635
|
-
readonly userKey: SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
636
|
-
readonly userToken: SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
637
|
-
readonly userSettings: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>>;
|
|
638
|
-
readonly organizationSettings: ApiStore<{
|
|
639
|
-
id: string;
|
|
640
|
-
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
641
|
-
buttonIcon?: string | undefined;
|
|
642
|
-
tinodeHost?: string | undefined;
|
|
643
|
-
audience?: string | undefined;
|
|
644
|
-
name?: string | undefined;
|
|
645
|
-
provider?: string | undefined;
|
|
646
|
-
primaryColor?: string | undefined;
|
|
647
|
-
secondaryColor?: string | undefined;
|
|
648
|
-
moderationPrimaryColor?: string | undefined;
|
|
649
|
-
linkShareIcon?: string | undefined;
|
|
650
|
-
linkShareText?: string | undefined;
|
|
651
|
-
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
652
|
-
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
653
|
-
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
654
|
-
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
655
|
-
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
656
|
-
} | undefined, import("@nanostores/query").FetcherStore<{
|
|
657
|
-
id: string;
|
|
658
|
-
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
659
|
-
buttonIcon?: string | undefined;
|
|
660
|
-
tinodeHost?: string | undefined;
|
|
661
|
-
audience?: string | undefined;
|
|
662
|
-
name?: string | undefined;
|
|
663
|
-
provider?: string | undefined;
|
|
664
|
-
primaryColor?: string | undefined;
|
|
665
|
-
secondaryColor?: string | undefined;
|
|
666
|
-
moderationPrimaryColor?: string | undefined;
|
|
667
|
-
linkShareIcon?: string | undefined;
|
|
668
|
-
linkShareText?: string | undefined;
|
|
669
|
-
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
670
|
-
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
671
|
-
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
672
|
-
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
673
|
-
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
674
|
-
} | undefined, any>>;
|
|
675
|
-
readonly organizationAdvertising: ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>>;
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
declare module "../../sdk-web-core/src/store/store" {
|
|
679
|
-
import type { OrganizationAdvertising, StreamSettings, OrganizationSettings, User, UserSettings } from '@streamlayer/sdk-web-types';
|
|
680
|
-
import { AbstractStore } from '@streamlayer/sdk-web-interfaces';
|
|
681
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
682
|
-
import { ReadableAtom } from 'nanostores';
|
|
683
|
-
import { FetcherValue } from '@nanostores/query';
|
|
684
|
-
import { initializeStore, CoreStatus } from "../../sdk-web-core/src/store/init";
|
|
685
|
-
export { CoreStatus };
|
|
686
|
-
export interface CoreStoreInterface {
|
|
687
|
-
enabled?: 'on';
|
|
688
|
-
status: string;
|
|
689
|
-
userKey?: string;
|
|
690
|
-
userToken?: string;
|
|
691
|
-
organizationSettings?: OrganizationSettings & {
|
|
692
|
-
id: string;
|
|
693
|
-
};
|
|
694
|
-
organizationAdvertising?: OrganizationAdvertising;
|
|
695
|
-
streamSettings?: StreamSettings;
|
|
696
|
-
user?: User;
|
|
697
|
-
userSettings?: UserSettings;
|
|
698
|
-
providerStreamId?: string;
|
|
699
|
-
slStreamId?: string;
|
|
700
|
-
}
|
|
701
|
-
export type StoreObj = ReturnType<typeof initializeStore>;
|
|
702
|
-
export type CoreStores = {
|
|
703
|
-
[Index in keyof StoreObj]: ReturnType<StoreObj[Index]['getStore']>;
|
|
704
|
-
};
|
|
705
|
-
export type CoreStoresValues = {
|
|
706
|
-
[Index in keyof StoreObj]: ReturnType<StoreObj[Index]['getStore']>['value'];
|
|
707
|
-
};
|
|
708
|
-
export type CoreStoreInstance = ReadableAtom<CoreStoresValues>;
|
|
709
|
-
/**
|
|
710
|
-
* @description `CoreStore` is a store that contains all the necessary data for the SDK to work.
|
|
711
|
-
* `CoreStore` is a singleton and is created when the SDK is initialized. It includes the following stores:
|
|
712
|
-
* - `enabled` - the status of the SDK. The SDK is enabled when the `on` value is set.
|
|
713
|
-
* - `status` - the status of the SDK. Can be one of the following values: `disabled`, `initialization`, `ready`, `failed`, `suspended`.
|
|
714
|
-
* - `userKey` - the user key provided by the host.
|
|
715
|
-
* - `userToken` - the user token received from the StreamLayer after login.
|
|
716
|
-
* - `organizationSettings` - the organization settings.
|
|
717
|
-
* - `organizationAdvertising` - the organization advertising.
|
|
718
|
-
* - `streamSettings` - the stream settings.
|
|
719
|
-
* - `user` - the user data.
|
|
720
|
-
* - `userSettings` - the user settings.
|
|
721
|
-
* - `providerStreamId` - the event id provided by the host.
|
|
722
|
-
* - `slStreamId` - the event id received from the StreamLayer, resolved by the `providerStreamId`.
|
|
723
|
-
*/
|
|
724
|
-
export class CoreStore extends AbstractStore<CoreStoreInstance> {
|
|
725
|
-
private stores;
|
|
726
|
-
constructor(transport: Transport);
|
|
727
|
-
getValue(): unknown;
|
|
728
|
-
getValues(): {
|
|
729
|
-
readonly enabled: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").WritableAtom<"on" | undefined>>;
|
|
730
|
-
readonly status: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").WritableAtom<CoreStatus>>;
|
|
731
|
-
readonly providerStreamId: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
732
|
-
readonly slStreamId: import("@streamlayer/sdk-web-interfaces").ApiStore<string | undefined, import("@nanostores/query").FetcherStore<string | undefined, any>>;
|
|
733
|
-
readonly streamSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").StreamSettings | undefined, any>>;
|
|
734
|
-
readonly user: import("@streamlayer/sdk-web-interfaces").ApiStore<User, import("@nanostores/query").FetcherStore<User, any>>;
|
|
735
|
-
readonly userKey: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
736
|
-
readonly userToken: import("@streamlayer/sdk-web-interfaces").SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
737
|
-
readonly userSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/client/client_pb").ClientSettings | undefined, any>>;
|
|
738
|
-
readonly organizationSettings: import("@streamlayer/sdk-web-interfaces").ApiStore<{
|
|
739
|
-
id: string;
|
|
740
|
-
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
741
|
-
buttonIcon?: string | undefined;
|
|
742
|
-
tinodeHost?: string | undefined;
|
|
743
|
-
audience?: string | undefined;
|
|
744
|
-
name?: string | undefined;
|
|
745
|
-
provider?: string | undefined;
|
|
746
|
-
primaryColor?: string | undefined;
|
|
747
|
-
secondaryColor?: string | undefined;
|
|
748
|
-
moderationPrimaryColor?: string | undefined;
|
|
749
|
-
linkShareIcon?: string | undefined;
|
|
750
|
-
linkShareText?: string | undefined;
|
|
751
|
-
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
752
|
-
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
753
|
-
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
754
|
-
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
755
|
-
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
756
|
-
} | undefined, import("@nanostores/query").FetcherStore<{
|
|
757
|
-
id: string;
|
|
758
|
-
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
759
|
-
buttonIcon?: string | undefined;
|
|
760
|
-
tinodeHost?: string | undefined;
|
|
761
|
-
audience?: string | undefined;
|
|
762
|
-
name?: string | undefined;
|
|
763
|
-
provider?: string | undefined;
|
|
764
|
-
primaryColor?: string | undefined;
|
|
765
|
-
secondaryColor?: string | undefined;
|
|
766
|
-
moderationPrimaryColor?: string | undefined;
|
|
767
|
-
linkShareIcon?: string | undefined;
|
|
768
|
-
linkShareText?: string | undefined;
|
|
769
|
-
brandDefaults?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").BrandDefaults;
|
|
770
|
-
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK;
|
|
771
|
-
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient;
|
|
772
|
-
publicName?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").PublicName | undefined;
|
|
773
|
-
analyticsVersion?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").AnalyticsVersion | undefined;
|
|
774
|
-
} | undefined, any>>;
|
|
775
|
-
readonly organizationAdvertising: import("@streamlayer/sdk-web-interfaces").ApiStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").Advertising | undefined, any>>;
|
|
776
|
-
};
|
|
777
|
-
setValue(): void;
|
|
778
|
-
subscribe: (subscribes: Partial<StoreListeners>) => void;
|
|
779
|
-
unsubscribe: () => void;
|
|
780
|
-
}
|
|
781
|
-
export type StoreListeners = {
|
|
782
|
-
[Index in keyof StoreObj]: (params: FetcherValue<CoreStoreInterface[Index]>) => void;
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
declare module "../../sdk-web-core/src/deepLink/index" {
|
|
786
|
-
import { MapStore, StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
787
|
-
type DeepLinkContextData = {
|
|
788
|
-
handled?: boolean;
|
|
789
|
-
parsed?: boolean;
|
|
790
|
-
used?: boolean;
|
|
791
|
-
data?: DeepLinkUrlParams;
|
|
792
|
-
};
|
|
793
|
-
export type DeepLinkCallback = (deepLinkData: DeepLinkContextData['data']) => void;
|
|
794
|
-
export interface DeepLinkContext {
|
|
795
|
-
$store: DeepLinkContextStore;
|
|
796
|
-
getDeepLinkData: () => Pick<DeepLinkContextData, 'data' | 'used'>;
|
|
797
|
-
deepLinkUsed: (inviterId: string) => void;
|
|
798
|
-
onDeepLinkHandlers: Set<DeepLinkCallback>;
|
|
799
|
-
}
|
|
800
|
-
export type DeepLinkContextStore = MapStore<DeepLinkContextData>;
|
|
801
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
802
|
-
interface StreamLayerContext {
|
|
803
|
-
deepLink: DeepLinkContext;
|
|
804
|
-
}
|
|
805
|
-
interface StreamLayerSDK {
|
|
806
|
-
addDeepLinkHandler: (cb: DeepLinkCallback) => void;
|
|
807
|
-
removeDeepLinkHandler: (cb: DeepLinkCallback) => void;
|
|
808
|
-
getInviter: () => string | undefined;
|
|
809
|
-
inviteDisplayed: () => void;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
export const DEEP_LINK_PREFIX = "sldl";
|
|
813
|
-
export const DEEP_LINK_USER_ID = "sldl_uid";
|
|
814
|
-
export const DEEP_LINK_EVENT_ID = "sldl_eid";
|
|
815
|
-
export const DEEP_LINK_EXTERNAL_EVENT_ID = "sldl_e_eid";
|
|
816
|
-
export type DeepLinkUrlParams = {
|
|
817
|
-
[DEEP_LINK_USER_ID]?: string;
|
|
818
|
-
[DEEP_LINK_EVENT_ID]?: string;
|
|
819
|
-
[DEEP_LINK_EXTERNAL_EVENT_ID]?: string;
|
|
820
|
-
};
|
|
821
|
-
/**
|
|
822
|
-
* Bypass authorization, used for login with external token.
|
|
823
|
-
* Automatically login user if SDK initialized and READY.
|
|
824
|
-
*/
|
|
825
|
-
export const deepLink: (instance: StreamLayerContext, opts: {
|
|
826
|
-
onDeepLinkHandled?: DeepLinkCallback;
|
|
827
|
-
}, done: () => void) => void;
|
|
828
|
-
}
|
|
829
|
-
declare module "../../sdk-web-core/src/auth/bypass/index" {
|
|
830
|
-
import { AbstractAuthenticationProvider } from '@streamlayer/sdk-web-interfaces';
|
|
831
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
832
|
-
import { CoreStore } from "../../sdk-web-core/src/store/store";
|
|
833
|
-
import { DeepLinkContext } from "../../sdk-web-core/src/deepLink/index";
|
|
834
|
-
/**
|
|
835
|
-
* An authorization service manages user access by providing login, logout,
|
|
836
|
-
* authentication checks, and the ability to revoke access.
|
|
837
|
-
* Subscribed to $userStore and automatically updates the auth header for the Transport.
|
|
838
|
-
*/
|
|
839
|
-
export class BypassAuth extends AbstractAuthenticationProvider {
|
|
840
|
-
private readonly $coreStore;
|
|
841
|
-
private readonly deepLink;
|
|
842
|
-
private readonly transport;
|
|
843
|
-
private readonly bypassLogin;
|
|
844
|
-
constructor(store: CoreStore, transport: Transport, deepLink: DeepLinkContext);
|
|
845
|
-
me: () => Promise<import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined>;
|
|
846
|
-
/**
|
|
847
|
-
* Login user by token and schema.
|
|
848
|
-
* On success, save the user and update the token to the Transport, UserStore and cache.
|
|
849
|
-
* @param schema - schema created by the host app and provided to the StreamLayer SDK.
|
|
850
|
-
* @param userKey - user token received from the host app.
|
|
851
|
-
*/
|
|
852
|
-
login: (schema: string, userKey: string) => Promise<string>;
|
|
853
|
-
isAuthenticated: () => Promise<import("@streamlayer/sl-eslib/users/users_common_pb").User | undefined>;
|
|
854
|
-
/**
|
|
855
|
-
* Logout user. Clears the all user data from the store.
|
|
856
|
-
*/
|
|
857
|
-
logout: () => void;
|
|
858
|
-
/**
|
|
859
|
-
* Soft logout, only clears the StreamLayer user data from the store.
|
|
860
|
-
* Does not clear the external token. And automatically tries to re-login by external token.
|
|
861
|
-
*/
|
|
862
|
-
softLogout: () => void;
|
|
863
|
-
/**
|
|
864
|
-
* Try to re-login.
|
|
865
|
-
* - If the user has an token, then try to login by it, by calling the me() method.
|
|
866
|
-
* - If the user has an external token, then try to login by it, by calling the login() method. On failure, logout.
|
|
867
|
-
* -
|
|
868
|
-
* - If no one of the above is true, then logout.
|
|
869
|
-
*/
|
|
870
|
-
reLogin: () => Promise<void> | undefined;
|
|
871
|
-
/**
|
|
872
|
-
* Write token to the Transport and UserStore
|
|
873
|
-
*/
|
|
874
|
-
private saveUser;
|
|
875
|
-
/**
|
|
876
|
-
* Add interceptor to the Transport to handle 401 and 403 errors.
|
|
877
|
-
* If the user is logged in (auth header is set), then make a soft logout.
|
|
878
|
-
*/
|
|
879
|
-
private connect;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
declare module "../../sdk-web-core/src/auth/index" {
|
|
883
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
884
|
-
import { CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
885
|
-
import { UserStorage } from "../../sdk-web-core/src/storage";
|
|
886
|
-
import { BypassAuth } from "../../sdk-web-core/src/auth/bypass/index";
|
|
887
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
888
|
-
interface StreamLayerSDK {
|
|
889
|
-
authorizationBypass: (schema: string, userKey: string) => Promise<void>;
|
|
890
|
-
logout: () => void;
|
|
891
|
-
getUserStore: () => CoreStores['user'];
|
|
892
|
-
userId: StoreObj['user']['getAtomStore'];
|
|
893
|
-
isUserAuthorized: BypassAuth['isAuthenticated'];
|
|
894
|
-
}
|
|
895
|
-
interface StreamLayerContext {
|
|
896
|
-
auth: BypassAuth;
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
export const storage: UserStorage;
|
|
900
|
-
/**
|
|
901
|
-
* Bypass authorization, used for login with external token.
|
|
902
|
-
* Automatically login user if SDK initialized and READY.
|
|
903
|
-
*/
|
|
904
|
-
export const bypass: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
905
|
-
}
|
|
906
|
-
declare module "../../sdk-web-core/src/store/index" {
|
|
907
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
908
|
-
import { CoreStore, CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
909
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
910
|
-
interface StreamLayerSDK {
|
|
911
|
-
sdkStore: CoreStores;
|
|
912
|
-
enabled: CoreStores['enabled'];
|
|
913
|
-
status: CoreStores['status'];
|
|
914
|
-
organizationStore: () => CoreStores['organizationSettings'];
|
|
915
|
-
streamStore: () => CoreStores['streamSettings'];
|
|
916
|
-
}
|
|
917
|
-
interface ContextConfig {
|
|
918
|
-
skipOrganizationSettings?: boolean;
|
|
919
|
-
}
|
|
920
|
-
interface StreamLayerContext {
|
|
921
|
-
contextConfig?: ContextConfig;
|
|
922
|
-
}
|
|
923
|
-
interface StreamLayerContext {
|
|
924
|
-
store: CoreStore;
|
|
925
|
-
stores: StoreObj;
|
|
926
|
-
storeSubscribe: () => void;
|
|
927
|
-
storeUnsubscribe: () => void;
|
|
928
|
-
contextConfig?: ContextConfig;
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
/**
|
|
932
|
-
* store plugin, connect store to sdk
|
|
933
|
-
*/
|
|
934
|
-
export const store: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
935
|
-
}
|
|
936
|
-
declare module "../../sdk-web-core/src/videoPlayer/index" {
|
|
937
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
938
|
-
export type VideoPlayerData = {
|
|
939
|
-
muted: boolean;
|
|
940
|
-
};
|
|
941
|
-
export type VideoPlayerCallback = (videoPlayerData: VideoPlayerData) => void;
|
|
942
|
-
export interface VideoPlayerContext {
|
|
943
|
-
controllers: Set<VideoPlayerCallback>;
|
|
944
|
-
}
|
|
945
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
946
|
-
interface StreamLayerContext {
|
|
947
|
-
videoPlayer: VideoPlayerContext;
|
|
948
|
-
}
|
|
949
|
-
interface StreamLayerSDK {
|
|
950
|
-
addVideoPlayerController: (cb: VideoPlayerCallback) => void;
|
|
951
|
-
removeVideoPlayerController: (cb: VideoPlayerCallback) => void;
|
|
952
|
-
controlVideoPlayer: VideoPlayerCallback;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
export const videoPlayer: (instance: StreamLayerContext, opts: {
|
|
956
|
-
videoPlayerController?: VideoPlayerCallback;
|
|
957
|
-
}, done: () => void) => void;
|
|
958
|
-
}
|
|
959
|
-
declare module "../../sdk-web-core/src/index" {
|
|
960
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
961
|
-
export { bypass, storage } from "../../sdk-web-core/src/auth/index";
|
|
962
|
-
export { store } from "../../sdk-web-core/src/store/index";
|
|
963
|
-
export { deepLink, type DeepLinkUrlParams, type DeepLinkCallback, type DeepLinkContext, DEEP_LINK_PREFIX, DEEP_LINK_USER_ID, DEEP_LINK_EVENT_ID, DEEP_LINK_EXTERNAL_EVENT_ID, } from "../../sdk-web-core/src/deepLink/index";
|
|
964
|
-
export { videoPlayer, type VideoPlayerCallback } from "../../sdk-web-core/src/videoPlayer/index";
|
|
965
|
-
import "../../sdk-web-core/src/store/index";
|
|
966
|
-
import "../../sdk-web-core/src/auth/index";
|
|
967
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
968
|
-
interface StreamLayerSDK {
|
|
969
|
-
initializeApp: (contextConfig?: ContextConfig) => Promise<{
|
|
970
|
-
enabled?: boolean;
|
|
971
|
-
err?: string;
|
|
972
|
-
}>;
|
|
973
|
-
disableApp: () => void;
|
|
974
|
-
createEventSession: (providerStreamId: string) => void;
|
|
975
|
-
}
|
|
976
|
-
interface StreamLayerContext {
|
|
977
|
-
ready: () => void;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* The main application instance is the core of a application. It includes:
|
|
982
|
-
* Store: Manages data storage.
|
|
983
|
-
* Public Methods: Provides a way to interact with the application.
|
|
984
|
-
* Connect Features: Handles communication between components through store.
|
|
985
|
-
* Connect Transport: Handles communication with api.
|
|
986
|
-
* Dependency Injection: Incorporates other necessary instances.
|
|
987
|
-
* Error Handling: Manages errors and logs them.
|
|
988
|
-
* Security: Implements authentication and authorization.
|
|
989
|
-
*/
|
|
990
|
-
export const core: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
991
|
-
}
|
|
992
|
-
declare module "../../react-ui/src/index" {
|
|
993
|
-
export { App } from 'app/app';
|
|
994
|
-
export { StreamLayerThemeProvider } from 'ui/theme';
|
|
995
|
-
}
|
|
996
|
-
declare module "../../sdk-web-notifications/src/queue/index" {
|
|
997
|
-
import { SingleStore, createComputedStore } from '@streamlayer/sdk-web-interfaces';
|
|
998
|
-
import { Notification } from "../../sdk-web-notifications/src/index";
|
|
999
|
-
export type NotificationsQueueOptions = {
|
|
1000
|
-
concurrency: number;
|
|
1001
|
-
animationDelay: number;
|
|
1002
|
-
};
|
|
1003
|
-
export type NotificationsList = ReturnType<typeof createComputedStore<Notification[]>>;
|
|
1004
|
-
export class NotificationsQueue {
|
|
1005
|
-
notificationsList: ReturnType<SingleStore<Map<Notification['id'], Notification>>['getStore']>;
|
|
1006
|
-
private store;
|
|
1007
|
-
private timeouts;
|
|
1008
|
-
private waitingQueue;
|
|
1009
|
-
private activeQueue;
|
|
1010
|
-
private options;
|
|
1011
|
-
private logger;
|
|
1012
|
-
constructor(options: NotificationsQueueOptions);
|
|
1013
|
-
addToQueue: (notification: Notification) => void;
|
|
1014
|
-
tickWaitingQueue: () => void;
|
|
1015
|
-
tickActiveQueue: (notificationId: string) => void;
|
|
1016
|
-
closeNotification: (notificationId: string, { animateHiding }?: {
|
|
1017
|
-
animateHiding?: boolean | undefined;
|
|
1018
|
-
}) => Notification | undefined;
|
|
1019
|
-
drain: () => void;
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
declare module "../../sdk-web-notifications/src/storage" {
|
|
1023
|
-
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
1024
|
-
export class NotificationStorage extends Storage {
|
|
1025
|
-
constructor();
|
|
1026
|
-
setOpened: (notificationId: string) => void;
|
|
1027
|
-
isOpened: (notificationId: string) => string | undefined;
|
|
1028
|
-
clearNotification: () => void;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
declare module "../../sdk-web-notifications/src/notifications" {
|
|
1032
|
-
import { InstantView, QuestionType, GameSettings, TweetHistory } from '@streamlayer/sdk-web-types';
|
|
1033
|
-
import { NotificationsQueue, NotificationsQueueOptions } from "../../sdk-web-notifications/src/queue/index";
|
|
1034
|
-
export type NotificationData = {
|
|
1035
|
-
questionId: string;
|
|
1036
|
-
questionType: QuestionType;
|
|
1037
|
-
question?: {
|
|
1038
|
-
title: string;
|
|
1039
|
-
votedAnswer?: {
|
|
1040
|
-
title?: string;
|
|
1041
|
-
points?: number;
|
|
1042
|
-
};
|
|
1043
|
-
predictionResult?: boolean;
|
|
1044
|
-
correct?: boolean;
|
|
1045
|
-
correctAnswerTitle?: string;
|
|
1046
|
-
questionTitle?: string;
|
|
1047
|
-
};
|
|
1048
|
-
insight?: InstantView;
|
|
1049
|
-
onboarding?: GameSettings & {
|
|
1050
|
-
instantOpen?: boolean;
|
|
1051
|
-
};
|
|
1052
|
-
tweet?: {
|
|
1053
|
-
title: string;
|
|
1054
|
-
image: string;
|
|
1055
|
-
body: string;
|
|
1056
|
-
account: string;
|
|
1057
|
-
accountVerified: boolean;
|
|
1058
|
-
tweet: TweetHistory['tweet'] | undefined;
|
|
1059
|
-
tweetId: string;
|
|
1060
|
-
};
|
|
1061
|
-
};
|
|
1062
|
-
export enum NotificationType {
|
|
1063
|
-
ONBOARDING = 1,
|
|
1064
|
-
QUESTION = 2,
|
|
1065
|
-
QUESTION_RESOLVED = 3
|
|
1066
|
-
}
|
|
1067
|
-
export type Notification<M extends Record<string, Function> = never> = {
|
|
1068
|
-
autoHideDuration: number;
|
|
1069
|
-
delay?: number;
|
|
1070
|
-
hiding?: boolean;
|
|
1071
|
-
type: NotificationType;
|
|
1072
|
-
action?: (...args: unknown[]) => void;
|
|
1073
|
-
close?: (...args: unknown[]) => void;
|
|
1074
|
-
methods?: M;
|
|
1075
|
-
emitEvent?: boolean;
|
|
1076
|
-
data: NotificationData;
|
|
1077
|
-
id: string;
|
|
1078
|
-
persistent?: boolean;
|
|
1079
|
-
};
|
|
1080
|
-
export type NotificationCloseOptions = {
|
|
1081
|
-
markAsViewed?: boolean;
|
|
1082
|
-
animateHiding?: boolean;
|
|
1083
|
-
};
|
|
1084
|
-
/**
|
|
1085
|
-
* @description app notifications (inapp)
|
|
1086
|
-
*/
|
|
1087
|
-
export class Notifications {
|
|
1088
|
-
queue: NotificationsQueue;
|
|
1089
|
-
private storage;
|
|
1090
|
-
constructor(options?: Partial<NotificationsQueueOptions>);
|
|
1091
|
-
add: (notification: Notification) => void;
|
|
1092
|
-
close: (notificationId: string, { markAsViewed, animateHiding }?: NotificationCloseOptions) => void;
|
|
1093
|
-
getActiveNotification: () => Notification | null;
|
|
1094
|
-
getQueueStore: () => import("nanostores").WritableAtom<Map<string, Notification> | undefined>;
|
|
1095
|
-
markAsViewed: (notificationId: string) => void;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
declare module "../../sdk-web-notifications/src/index" {
|
|
1099
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1100
|
-
import { Notifications } from "../../sdk-web-notifications/src/notifications";
|
|
1101
|
-
export { type Notification, type NotificationData, NotificationType, Notifications } from "../../sdk-web-notifications/src/notifications";
|
|
1102
|
-
export { type NotificationsList } from "../../sdk-web-notifications/src/queue/index";
|
|
1103
|
-
export type NotificationsStore = ReturnType<Notifications['getQueueStore']>;
|
|
1104
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
1105
|
-
interface StreamLayerContext {
|
|
1106
|
-
notifications: Notifications;
|
|
1107
|
-
addNotification: Notifications['add'];
|
|
1108
|
-
}
|
|
1109
|
-
interface StreamLayerSDK {
|
|
1110
|
-
getNotificationsStore: Notifications['getQueueStore'];
|
|
1111
|
-
getActiveNotification: Notifications['getActiveNotification'];
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
/**
|
|
1115
|
-
* notifications plugin, connect notifications to sdk
|
|
1116
|
-
*/
|
|
1117
|
-
export const notifications: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
1118
|
-
}
|
|
1119
|
-
declare module "../../feature-gamification/src/queries/leaderboard" {
|
|
1120
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1121
|
-
import { ReadableAtom } from 'nanostores';
|
|
1122
|
-
import { ListRequest, SummaryRequest } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
1123
|
-
import { PartialMessage } from '@bufbuild/protobuf';
|
|
1124
|
-
export { LeaderboardItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
1125
|
-
export const $userSummary: ($eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb").LeaderboardSummaryItem | undefined, any>;
|
|
1126
|
-
export const $leaderboardList: ($eventId: ReadableAtom<string | undefined>, _: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb").ListResponse_ListResponseData[], any>;
|
|
1127
|
-
export const createLeaderboardListFetch: (transport: Transport) => (params: PartialMessage<ListRequest>) => Promise<import("@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb").ListResponse>;
|
|
1128
|
-
export const createUserSummaryFetch: (transport: Transport) => (params: PartialMessage<SummaryRequest>) => Promise<import("@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb").SummaryResponse>;
|
|
1129
|
-
}
|
|
1130
|
-
declare module "../../feature-gamification/src/queries/friends" {
|
|
1131
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1132
|
-
import { ReadableAtom } from 'nanostores';
|
|
1133
|
-
export const $friends: ($userId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/users/users_pb").GetFriendsResponse_FriendData[], any>;
|
|
1134
|
-
}
|
|
1135
|
-
declare module "../../feature-gamification/src/queries/moderation" {
|
|
1136
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1137
|
-
import { ReadableAtom } from 'nanostores';
|
|
1138
|
-
export const $moderation: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InteractiveFeed | undefined, any>;
|
|
1139
|
-
}
|
|
1140
|
-
declare module "../../feature-gamification/src/queries/index" {
|
|
1141
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1142
|
-
import { ReadableAtom } from 'nanostores';
|
|
1143
|
-
import type { SubscriptionRequest, SubscriptionResponse, VotingSubscriptionRequest, VotingSubscriptionResponse, QuestionSubscriptionRequest, QuestionSubscriptionResponse } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
1144
|
-
import { InteractiveAllowed } from "../../feature-gamification/src/background";
|
|
1145
|
-
export const $activeQuestion: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedQuestion | undefined, any>;
|
|
1146
|
-
export const feedSubscription: ($slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<import("@bufbuild/protobuf").ServiceType, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, never, never> | import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<{
|
|
1147
|
-
readonly typeName: "streamlayer.interactive.feed.Feed";
|
|
1148
|
-
readonly methods: {
|
|
1149
|
-
readonly get: {
|
|
1150
|
-
readonly name: "Get";
|
|
1151
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetRequest;
|
|
1152
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetResponse;
|
|
1153
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1154
|
-
};
|
|
1155
|
-
readonly subscription: {
|
|
1156
|
-
readonly name: "Subscription";
|
|
1157
|
-
readonly I: typeof SubscriptionRequest;
|
|
1158
|
-
readonly O: typeof SubscriptionResponse;
|
|
1159
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1160
|
-
};
|
|
1161
|
-
readonly votingSubscription: {
|
|
1162
|
-
readonly name: "VotingSubscription";
|
|
1163
|
-
readonly I: typeof VotingSubscriptionRequest;
|
|
1164
|
-
readonly O: typeof VotingSubscriptionResponse;
|
|
1165
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1166
|
-
};
|
|
1167
|
-
readonly questionSubscription: {
|
|
1168
|
-
readonly name: "QuestionSubscription";
|
|
1169
|
-
readonly I: typeof QuestionSubscriptionRequest;
|
|
1170
|
-
readonly O: typeof QuestionSubscriptionResponse;
|
|
1171
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1172
|
-
};
|
|
1173
|
-
readonly questionByUser: {
|
|
1174
|
-
readonly name: "QuestionByUser";
|
|
1175
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserRequest;
|
|
1176
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserResponse;
|
|
1177
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1178
|
-
};
|
|
1179
|
-
readonly syncQuestion: {
|
|
1180
|
-
readonly name: "SyncQuestion";
|
|
1181
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionRequest;
|
|
1182
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionResponse;
|
|
1183
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1184
|
-
};
|
|
1185
|
-
readonly getQuestion: {
|
|
1186
|
-
readonly name: "GetQuestion";
|
|
1187
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionRequest;
|
|
1188
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionResponse;
|
|
1189
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1190
|
-
};
|
|
1191
|
-
readonly questionDetail: {
|
|
1192
|
-
readonly name: "QuestionDetail";
|
|
1193
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailRequest;
|
|
1194
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailResponse;
|
|
1195
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1196
|
-
};
|
|
1197
|
-
readonly submitAnswer: {
|
|
1198
|
-
readonly name: "SubmitAnswer";
|
|
1199
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerRequest;
|
|
1200
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerResponse;
|
|
1201
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1202
|
-
};
|
|
1203
|
-
readonly submitInplay: {
|
|
1204
|
-
readonly name: "SubmitInplay";
|
|
1205
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayRequest;
|
|
1206
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayResponse;
|
|
1207
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1208
|
-
};
|
|
1209
|
-
readonly skipQuestion: {
|
|
1210
|
-
readonly name: "SkipQuestion";
|
|
1211
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionRequest;
|
|
1212
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionResponse;
|
|
1213
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1214
|
-
};
|
|
1215
|
-
readonly pickHistory: {
|
|
1216
|
-
readonly name: "PickHistory";
|
|
1217
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryRequest;
|
|
1218
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryResponse;
|
|
1219
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1220
|
-
};
|
|
1221
|
-
readonly insightHistory: {
|
|
1222
|
-
readonly name: "InsightHistory";
|
|
1223
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryRequest;
|
|
1224
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryResponse;
|
|
1225
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1226
|
-
};
|
|
1227
|
-
readonly tweetHistory: {
|
|
1228
|
-
readonly name: "TweetHistory";
|
|
1229
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryRequest;
|
|
1230
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryResponse;
|
|
1231
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1232
|
-
};
|
|
1233
|
-
readonly promotionHistory: {
|
|
1234
|
-
readonly name: "PromotionHistory";
|
|
1235
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryRequest;
|
|
1236
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryResponse;
|
|
1237
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1238
|
-
};
|
|
1239
|
-
readonly list: {
|
|
1240
|
-
readonly name: "List";
|
|
1241
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListRequest;
|
|
1242
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListResponse;
|
|
1243
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1244
|
-
};
|
|
1245
|
-
readonly feedSubscription: {
|
|
1246
|
-
readonly name: "FeedSubscription";
|
|
1247
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest;
|
|
1248
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse;
|
|
1249
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1250
|
-
};
|
|
1251
|
-
};
|
|
1252
|
-
}, SubscriptionRequest, SubscriptionResponse, "subscription" | "votingSubscription" | "questionSubscription" | "feedSubscription", ((request: import("@bufbuild/protobuf").PartialMessage<SubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<SubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<VotingSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<VotingSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<QuestionSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<QuestionSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse>)>;
|
|
1253
|
-
export const votingSubscription: (params: {
|
|
1254
|
-
questionId: string;
|
|
1255
|
-
feedId: string;
|
|
1256
|
-
}, transport: Transport) => import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<import("@bufbuild/protobuf").ServiceType, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, never, never> | import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<{
|
|
1257
|
-
readonly typeName: "streamlayer.interactive.feed.Feed";
|
|
1258
|
-
readonly methods: {
|
|
1259
|
-
readonly get: {
|
|
1260
|
-
readonly name: "Get";
|
|
1261
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetRequest;
|
|
1262
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetResponse;
|
|
1263
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1264
|
-
};
|
|
1265
|
-
readonly subscription: {
|
|
1266
|
-
readonly name: "Subscription";
|
|
1267
|
-
readonly I: typeof SubscriptionRequest;
|
|
1268
|
-
readonly O: typeof SubscriptionResponse;
|
|
1269
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1270
|
-
};
|
|
1271
|
-
readonly votingSubscription: {
|
|
1272
|
-
readonly name: "VotingSubscription";
|
|
1273
|
-
readonly I: typeof VotingSubscriptionRequest;
|
|
1274
|
-
readonly O: typeof VotingSubscriptionResponse;
|
|
1275
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1276
|
-
};
|
|
1277
|
-
readonly questionSubscription: {
|
|
1278
|
-
readonly name: "QuestionSubscription";
|
|
1279
|
-
readonly I: typeof QuestionSubscriptionRequest;
|
|
1280
|
-
readonly O: typeof QuestionSubscriptionResponse;
|
|
1281
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1282
|
-
};
|
|
1283
|
-
readonly questionByUser: {
|
|
1284
|
-
readonly name: "QuestionByUser";
|
|
1285
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserRequest;
|
|
1286
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserResponse;
|
|
1287
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1288
|
-
};
|
|
1289
|
-
readonly syncQuestion: {
|
|
1290
|
-
readonly name: "SyncQuestion";
|
|
1291
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionRequest;
|
|
1292
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionResponse;
|
|
1293
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1294
|
-
};
|
|
1295
|
-
readonly getQuestion: {
|
|
1296
|
-
readonly name: "GetQuestion";
|
|
1297
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionRequest;
|
|
1298
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionResponse;
|
|
1299
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1300
|
-
};
|
|
1301
|
-
readonly questionDetail: {
|
|
1302
|
-
readonly name: "QuestionDetail";
|
|
1303
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailRequest;
|
|
1304
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailResponse;
|
|
1305
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1306
|
-
};
|
|
1307
|
-
readonly submitAnswer: {
|
|
1308
|
-
readonly name: "SubmitAnswer";
|
|
1309
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerRequest;
|
|
1310
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerResponse;
|
|
1311
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1312
|
-
};
|
|
1313
|
-
readonly submitInplay: {
|
|
1314
|
-
readonly name: "SubmitInplay";
|
|
1315
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayRequest;
|
|
1316
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayResponse;
|
|
1317
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1318
|
-
};
|
|
1319
|
-
readonly skipQuestion: {
|
|
1320
|
-
readonly name: "SkipQuestion";
|
|
1321
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionRequest;
|
|
1322
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionResponse;
|
|
1323
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1324
|
-
};
|
|
1325
|
-
readonly pickHistory: {
|
|
1326
|
-
readonly name: "PickHistory";
|
|
1327
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryRequest;
|
|
1328
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryResponse;
|
|
1329
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1330
|
-
};
|
|
1331
|
-
readonly insightHistory: {
|
|
1332
|
-
readonly name: "InsightHistory";
|
|
1333
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryRequest;
|
|
1334
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryResponse;
|
|
1335
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1336
|
-
};
|
|
1337
|
-
readonly tweetHistory: {
|
|
1338
|
-
readonly name: "TweetHistory";
|
|
1339
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryRequest;
|
|
1340
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryResponse;
|
|
1341
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1342
|
-
};
|
|
1343
|
-
readonly promotionHistory: {
|
|
1344
|
-
readonly name: "PromotionHistory";
|
|
1345
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryRequest;
|
|
1346
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryResponse;
|
|
1347
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1348
|
-
};
|
|
1349
|
-
readonly list: {
|
|
1350
|
-
readonly name: "List";
|
|
1351
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListRequest;
|
|
1352
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListResponse;
|
|
1353
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1354
|
-
};
|
|
1355
|
-
readonly feedSubscription: {
|
|
1356
|
-
readonly name: "FeedSubscription";
|
|
1357
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest;
|
|
1358
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse;
|
|
1359
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1360
|
-
};
|
|
1361
|
-
};
|
|
1362
|
-
}, VotingSubscriptionRequest, VotingSubscriptionResponse, "subscription" | "votingSubscription" | "questionSubscription" | "feedSubscription", ((request: import("@bufbuild/protobuf").PartialMessage<SubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<SubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<VotingSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<VotingSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<QuestionSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<QuestionSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse>)>;
|
|
1363
|
-
export const questionSubscription: (questionId: string, transport: Transport) => import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<import("@bufbuild/protobuf").ServiceType, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, import("@bufbuild/protobuf").Message<import("@bufbuild/protobuf").AnyMessage>, never, never> | import("../../../sdk-web-api/src/grpc/subscription").ServerStreamSubscription<{
|
|
1364
|
-
readonly typeName: "streamlayer.interactive.feed.Feed";
|
|
1365
|
-
readonly methods: {
|
|
1366
|
-
readonly get: {
|
|
1367
|
-
readonly name: "Get";
|
|
1368
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetRequest;
|
|
1369
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetResponse;
|
|
1370
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1371
|
-
};
|
|
1372
|
-
readonly subscription: {
|
|
1373
|
-
readonly name: "Subscription";
|
|
1374
|
-
readonly I: typeof SubscriptionRequest;
|
|
1375
|
-
readonly O: typeof SubscriptionResponse;
|
|
1376
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1377
|
-
};
|
|
1378
|
-
readonly votingSubscription: {
|
|
1379
|
-
readonly name: "VotingSubscription";
|
|
1380
|
-
readonly I: typeof VotingSubscriptionRequest;
|
|
1381
|
-
readonly O: typeof VotingSubscriptionResponse;
|
|
1382
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1383
|
-
};
|
|
1384
|
-
readonly questionSubscription: {
|
|
1385
|
-
readonly name: "QuestionSubscription";
|
|
1386
|
-
readonly I: typeof QuestionSubscriptionRequest;
|
|
1387
|
-
readonly O: typeof QuestionSubscriptionResponse;
|
|
1388
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1389
|
-
};
|
|
1390
|
-
readonly questionByUser: {
|
|
1391
|
-
readonly name: "QuestionByUser";
|
|
1392
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserRequest;
|
|
1393
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionByUserResponse;
|
|
1394
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1395
|
-
};
|
|
1396
|
-
readonly syncQuestion: {
|
|
1397
|
-
readonly name: "SyncQuestion";
|
|
1398
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionRequest;
|
|
1399
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SyncQuestionResponse;
|
|
1400
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1401
|
-
};
|
|
1402
|
-
readonly getQuestion: {
|
|
1403
|
-
readonly name: "GetQuestion";
|
|
1404
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionRequest;
|
|
1405
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").GetQuestionResponse;
|
|
1406
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1407
|
-
};
|
|
1408
|
-
readonly questionDetail: {
|
|
1409
|
-
readonly name: "QuestionDetail";
|
|
1410
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailRequest;
|
|
1411
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").QuestionDetailResponse;
|
|
1412
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1413
|
-
};
|
|
1414
|
-
readonly submitAnswer: {
|
|
1415
|
-
readonly name: "SubmitAnswer";
|
|
1416
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerRequest;
|
|
1417
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerResponse;
|
|
1418
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1419
|
-
};
|
|
1420
|
-
readonly submitInplay: {
|
|
1421
|
-
readonly name: "SubmitInplay";
|
|
1422
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayRequest;
|
|
1423
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayResponse;
|
|
1424
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1425
|
-
};
|
|
1426
|
-
readonly skipQuestion: {
|
|
1427
|
-
readonly name: "SkipQuestion";
|
|
1428
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionRequest;
|
|
1429
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionResponse;
|
|
1430
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1431
|
-
};
|
|
1432
|
-
readonly pickHistory: {
|
|
1433
|
-
readonly name: "PickHistory";
|
|
1434
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryRequest;
|
|
1435
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistoryResponse;
|
|
1436
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1437
|
-
};
|
|
1438
|
-
readonly insightHistory: {
|
|
1439
|
-
readonly name: "InsightHistory";
|
|
1440
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryRequest;
|
|
1441
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistoryResponse;
|
|
1442
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1443
|
-
};
|
|
1444
|
-
readonly tweetHistory: {
|
|
1445
|
-
readonly name: "TweetHistory";
|
|
1446
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryRequest;
|
|
1447
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").TweetHistoryResponse;
|
|
1448
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1449
|
-
};
|
|
1450
|
-
readonly promotionHistory: {
|
|
1451
|
-
readonly name: "PromotionHistory";
|
|
1452
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryRequest;
|
|
1453
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PromotionHistoryResponse;
|
|
1454
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1455
|
-
};
|
|
1456
|
-
readonly list: {
|
|
1457
|
-
readonly name: "List";
|
|
1458
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListRequest;
|
|
1459
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedListResponse;
|
|
1460
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
1461
|
-
};
|
|
1462
|
-
readonly feedSubscription: {
|
|
1463
|
-
readonly name: "FeedSubscription";
|
|
1464
|
-
readonly I: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest;
|
|
1465
|
-
readonly O: typeof import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse;
|
|
1466
|
-
readonly kind: import("@bufbuild/protobuf").MethodKind.ServerStreaming;
|
|
1467
|
-
};
|
|
1468
|
-
};
|
|
1469
|
-
}, QuestionSubscriptionRequest, QuestionSubscriptionResponse, "subscription" | "votingSubscription" | "questionSubscription" | "feedSubscription", ((request: import("@bufbuild/protobuf").PartialMessage<SubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<SubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<VotingSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<VotingSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<QuestionSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<QuestionSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions) => AsyncIterable<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse>)>;
|
|
1470
|
-
export const getQuestionByUser: (questionId: string, transport: Transport) => Promise<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").ExtendedQuestion | undefined>;
|
|
1471
|
-
export const getQuestionDetail: (questionId: string, transport: Transport) => Promise<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").Question | undefined>;
|
|
1472
|
-
export const $questionByUser: ($questionId: ReadableAtom<string | undefined> | string, transport: Transport) => import("@nanostores/query").FetcherStore<import("@bufbuild/protobuf").PlainMessage<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").ExtendedQuestion>, any>;
|
|
1473
|
-
export const getPromotionDetail: (promoId: string, transport: Transport) => Promise<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").QuestionOptions_PromotionOptions | undefined>;
|
|
1474
|
-
export const $pickHistory: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<(import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").PickHistory | undefined)[], any>;
|
|
1475
|
-
export const $feedList: ($slStreamId: ReadableAtom<string | undefined>, $interactiveAllowed: ReadableAtom<InteractiveAllowed>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedItem[], any>;
|
|
1476
|
-
export { $userSummary, $leaderboardList } from "../../feature-gamification/src/queries/leaderboard";
|
|
1477
|
-
export { $friends } from "../../feature-gamification/src/queries/friends";
|
|
1478
|
-
export { $moderation } from "../../feature-gamification/src/queries/moderation";
|
|
1479
|
-
}
|
|
1480
|
-
declare module "../../feature-gamification/src/detail" {
|
|
1481
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1482
|
-
import { FeedItem, ExtendedQuestion } from '@streamlayer/sdk-web-types';
|
|
1483
|
-
import { ReadableAtom } from 'nanostores';
|
|
1484
|
-
import { type GamificationBackground } from "../../feature-gamification/src/background";
|
|
1485
|
-
export const detail: (transport: Transport, $openedQuestionId: ReadableAtom<{
|
|
1486
|
-
questionId: string;
|
|
1487
|
-
question?: FeedItem & {
|
|
1488
|
-
openedFrom?: "list" | "notification";
|
|
1489
|
-
};
|
|
1490
|
-
} | undefined>, $feedList: ReturnType<GamificationBackground["feedList"]["getStore"]>) => {
|
|
1491
|
-
$store: ReadableAtom<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedItem | (import("@bufbuild/protobuf").PlainMessage<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedItem> & {
|
|
1492
|
-
openedFrom?: "list" | "notification";
|
|
1493
|
-
}) | undefined>;
|
|
1494
|
-
$extendedStore: import("@nanostores/query").FetcherStore<import("@bufbuild/protobuf").PlainMessage<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").ExtendedQuestion>, any>;
|
|
1495
|
-
updateExtendedQuestion: (question: ExtendedQuestion | undefined) => void;
|
|
1496
|
-
};
|
|
1497
|
-
}
|
|
1498
|
-
declare module "../../feature-gamification/src/advertisement/storage" {
|
|
1499
|
-
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
1500
|
-
export class AdvertisementStorage extends Storage {
|
|
1501
|
-
constructor();
|
|
1502
|
-
setShowed: (advertId: string) => void;
|
|
1503
|
-
isShowed: (advertId: string) => string | undefined;
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
declare module "../../feature-gamification/src/advertisement/queue" {
|
|
1507
|
-
import { SingleStore, createComputedStore } from '@streamlayer/sdk-web-interfaces';
|
|
1508
|
-
import { Advertisement } from "../../feature-gamification/src/advertisement/index";
|
|
1509
|
-
export type AdvertisementsQueueOptions = {
|
|
1510
|
-
concurrency: number;
|
|
1511
|
-
animationDelay: number;
|
|
1512
|
-
};
|
|
1513
|
-
export type AdvertisementsList = ReturnType<typeof createComputedStore<Advertisement[]>>;
|
|
1514
|
-
export class AdvertisementsQueue {
|
|
1515
|
-
advertisementList: ReturnType<SingleStore<Map<Advertisement['id'], Advertisement>>['getStore']>;
|
|
1516
|
-
private store;
|
|
1517
|
-
private timeouts;
|
|
1518
|
-
private waitingQueue;
|
|
1519
|
-
private activeQueue;
|
|
1520
|
-
private options;
|
|
1521
|
-
private logger;
|
|
1522
|
-
constructor(options: AdvertisementsQueueOptions);
|
|
1523
|
-
addToQueue: (advertisement: Advertisement) => void;
|
|
1524
|
-
tickWaitingQueue: () => void;
|
|
1525
|
-
tickActiveQueue: (advertisementId: string) => void;
|
|
1526
|
-
closeAdvertisement: (advertisementId: string, { animateHiding }?: {
|
|
1527
|
-
animateHiding?: boolean | undefined;
|
|
1528
|
-
}) => Advertisement | undefined;
|
|
1529
|
-
drain: () => void;
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
declare module "../../feature-gamification/src/advertisement/index" {
|
|
1533
|
-
import { createMapStore } from '@streamlayer/sdk-web-interfaces';
|
|
1534
|
-
import { PromotionOptions } from '@streamlayer/sdk-web-types';
|
|
1535
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1536
|
-
import { type GamificationBackground } from "../../feature-gamification/src/background";
|
|
1537
|
-
type AdvertisementData = {
|
|
1538
|
-
loading?: boolean;
|
|
1539
|
-
error?: unknown;
|
|
1540
|
-
data?: PromotionOptions;
|
|
1541
|
-
};
|
|
1542
|
-
export type Advertisement = {
|
|
1543
|
-
autoHideDuration: number;
|
|
1544
|
-
delay?: number;
|
|
1545
|
-
hiding?: boolean;
|
|
1546
|
-
action?: (...args: unknown[]) => void;
|
|
1547
|
-
close?: (...args: unknown[]) => void;
|
|
1548
|
-
data: ReturnType<typeof createMapStore<AdvertisementData>>;
|
|
1549
|
-
promise: () => Promise<void>;
|
|
1550
|
-
id: string;
|
|
1551
|
-
};
|
|
1552
|
-
/**
|
|
1553
|
-
* @name Advertisement
|
|
1554
|
-
* @description advertisement functionality, show, hide
|
|
1555
|
-
* - show: show advertisement by id, if it was not showed before
|
|
1556
|
-
* - hide: hide advertisement by id
|
|
1557
|
-
* - markAsViewed: mark advertisement as viewed, called when UI is requested to show advertisement
|
|
1558
|
-
* - getActiveAdvertisement: request active advertisement from queue by UI
|
|
1559
|
-
*
|
|
1560
|
-
* On mount:
|
|
1561
|
-
* - we subscribe to $feedList, and show last advertisement from list
|
|
1562
|
-
* - we subscribe to $feedSubscription, and show advertisement on activate
|
|
1563
|
-
*/
|
|
1564
|
-
export const advertisement: ($feedList: GamificationBackground["feedList"], $feedSubscription: GamificationBackground["feedSubscription"], transport: Transport) => {
|
|
1565
|
-
hide: (notificationId: string) => void;
|
|
1566
|
-
show: (advertisementId: string, skipCheck?: boolean) => void;
|
|
1567
|
-
$list: import("nanostores").WritableAtom<Map<string, Advertisement> | undefined>;
|
|
1568
|
-
getActiveAdvertisement: () => Advertisement | null;
|
|
1569
|
-
};
|
|
1570
|
-
}
|
|
1571
|
-
declare module "../../feature-gamification/src/background" {
|
|
1572
|
-
import { ApiStore, type StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1573
|
-
import type { GetApiResponseType } from '@streamlayer/sdk-web-api';
|
|
1574
|
-
import { FeedItem } from '@streamlayer/sdk-web-types';
|
|
1575
|
-
import '@streamlayer/sdk-web-core/store';
|
|
1576
|
-
import { ReadableAtom, WritableAtom } from 'nanostores';
|
|
1577
|
-
import * as queries from "../../feature-gamification/src/queries/index";
|
|
1578
|
-
import { detail } from "../../feature-gamification/src/detail";
|
|
1579
|
-
import { advertisement } from "../../feature-gamification/src/advertisement/index";
|
|
1580
|
-
export enum InteractiveAllowed {
|
|
1581
|
-
ALLOWED = "allowed",
|
|
1582
|
-
DISALLOWED = "disallowed"
|
|
1583
|
-
}
|
|
1584
|
-
/**
|
|
1585
|
-
* Background class for Gamification feature
|
|
1586
|
-
*/
|
|
1587
|
-
export class GamificationBackground {
|
|
1588
|
-
/** sl event id */
|
|
1589
|
-
slStreamId: ReadableAtom<string | undefined>;
|
|
1590
|
-
/** organization id */
|
|
1591
|
-
organizationId: ReadableAtom<string | undefined>;
|
|
1592
|
-
/** current user id */
|
|
1593
|
-
userId: ReadableAtom<string | undefined>;
|
|
1594
|
-
/**
|
|
1595
|
-
* flag to allow interactive questions (polls, trivia, predictions)
|
|
1596
|
-
* controlled by opt-in and onboarding flags
|
|
1597
|
-
*/
|
|
1598
|
-
interactiveAllowed: WritableAtom<InteractiveAllowed>;
|
|
1599
|
-
/** opened question, using to download statistics */
|
|
1600
|
-
openedQuestionId: WritableAtom<{
|
|
1601
|
-
questionId: string;
|
|
1602
|
-
question?: FeedItem & {
|
|
1603
|
-
openedFrom?: 'list' | 'notification';
|
|
1604
|
-
};
|
|
1605
|
-
} | undefined>;
|
|
1606
|
-
/** opened question statistics */
|
|
1607
|
-
openedQuestion: ReturnType<typeof detail>;
|
|
1608
|
-
/** last active question in feed */
|
|
1609
|
-
activeQuestionId: ReturnType<typeof queries.$activeQuestion>;
|
|
1610
|
-
feedList: ApiStore<GetApiResponseType<typeof queries.$feedList>>;
|
|
1611
|
-
/** moderation id */
|
|
1612
|
-
moderationId: ReadableAtom<string | undefined>;
|
|
1613
|
-
/** moderation */
|
|
1614
|
-
moderation: ApiStore<GetApiResponseType<typeof queries.$moderation>>;
|
|
1615
|
-
/** feed subscription to receive new active question, update last active question */
|
|
1616
|
-
feedSubscription: ReturnType<typeof queries.feedSubscription>;
|
|
1617
|
-
/** subscription to opened question (vote percentage) */
|
|
1618
|
-
questionSubscription?: ReturnType<typeof queries.questionSubscription>;
|
|
1619
|
-
advertisement: ReturnType<typeof advertisement>;
|
|
1620
|
-
private notifications;
|
|
1621
|
-
private log;
|
|
1622
|
-
private transport;
|
|
1623
|
-
private cancels;
|
|
1624
|
-
constructor(instance: StreamLayerContext);
|
|
1625
|
-
/**
|
|
1626
|
-
* Get id for notifications and link with current session
|
|
1627
|
-
* @param opts.prefix - id prefix (onboarding, question, tweet, ...etc)
|
|
1628
|
-
* @param opts.userId - current user id, if not presented get from sdk automatically
|
|
1629
|
-
* @param opts.eventId - current event id, if not presented get from sdk automatically
|
|
1630
|
-
* @param opts.organizationId - current organization id, if not presented get from sdk automatically
|
|
1631
|
-
* @param opts.entity - entity id (question id, tweet id, ...etc)
|
|
1632
|
-
*/
|
|
1633
|
-
getCurrentSessionId: (opts: {
|
|
1634
|
-
prefix?: string;
|
|
1635
|
-
userId?: string;
|
|
1636
|
-
eventId?: string;
|
|
1637
|
-
organizationId?: string;
|
|
1638
|
-
entity?: string;
|
|
1639
|
-
}) => string;
|
|
1640
|
-
disconnect: () => void;
|
|
1641
|
-
/**
|
|
1642
|
-
* Open question and mark notification for this question as viewed
|
|
1643
|
-
*/
|
|
1644
|
-
openQuestion: (questionId: string, question?: FeedItem & {
|
|
1645
|
-
openedFrom?: "list" | "notification";
|
|
1646
|
-
}) => void;
|
|
1647
|
-
/**
|
|
1648
|
-
* Close question and mark notification for this question as viewed
|
|
1649
|
-
*/
|
|
1650
|
-
closeQuestion: (questionId?: string) => void;
|
|
1651
|
-
}
|
|
1652
|
-
}
|
|
1653
|
-
declare module "../../feature-gamification/src/constants" {
|
|
1654
|
-
export enum ERROR {
|
|
1655
|
-
UNKNOWN = "unknown",
|
|
1656
|
-
ALREADY_VOTED = "already_voted"
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
declare module "../../feature-gamification/src/queries/actions" {
|
|
1660
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1661
|
-
export const submitAnswer: (transport: Transport, data: {
|
|
1662
|
-
questionId: string;
|
|
1663
|
-
answerId: string;
|
|
1664
|
-
}) => Promise<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitAnswerResponse>;
|
|
1665
|
-
export const submitInplay: (transport: Transport, eventId: string) => Promise<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SubmitInplayResponse>;
|
|
1666
|
-
export const skipQuestion: (transport: Transport, questionId: string) => Promise<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionResponse>;
|
|
1667
|
-
}
|
|
1668
|
-
declare module "../../feature-gamification/src/onboarding" {
|
|
1669
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
1670
|
-
import { type Notifications } from '@streamlayer/sdk-web-notifications';
|
|
1671
|
-
import { GamificationBackground } from "../../feature-gamification/src/background";
|
|
1672
|
-
import { Gamification } from "../../feature-gamification/src/index";
|
|
1673
|
-
/**
|
|
1674
|
-
* Required: in-app should be displayed and questions not available
|
|
1675
|
-
* Optional: in-app should be displayed but questions are available
|
|
1676
|
-
* Completed: user completed onboarding, cached in browser. Linked by eventId, organizationId and userId
|
|
1677
|
-
* Disabled: no in-app but questions are available
|
|
1678
|
-
* Unavailable: no in-app and questions not available [behavior is discussed]
|
|
1679
|
-
*/
|
|
1680
|
-
export enum OnboardingStatus {
|
|
1681
|
-
Unset = "unset",
|
|
1682
|
-
Required = "required",
|
|
1683
|
-
Optional = "optional",
|
|
1684
|
-
Completed = "completed",
|
|
1685
|
-
Disabled = "disabled",
|
|
1686
|
-
Unavailable = "unavailable"
|
|
1687
|
-
}
|
|
1688
|
-
export const onboarding: (service: Gamification, background: GamificationBackground, transport: Transport, notifications: Notifications) => {
|
|
1689
|
-
$store: import("nanostores").WritableAtom<OnboardingStatus>;
|
|
1690
|
-
submitInplay: () => Promise<void>;
|
|
1691
|
-
};
|
|
1692
|
-
}
|
|
1693
|
-
declare module "../../feature-gamification/src/storage" {
|
|
1694
|
-
import { Storage } from '@streamlayer/sdk-web-storage';
|
|
1695
|
-
import { OnboardingStatus } from "../../feature-gamification/src/onboarding";
|
|
1696
|
-
type UserProps = {
|
|
1697
|
-
userId: string;
|
|
1698
|
-
eventId: string;
|
|
1699
|
-
organizationId: string;
|
|
1700
|
-
};
|
|
1701
|
-
export class GamificationStorage extends Storage {
|
|
1702
|
-
private sessionStorage;
|
|
1703
|
-
constructor();
|
|
1704
|
-
saveOnboardingStatus: ({ userId, eventId, organizationId }: UserProps, status: OnboardingStatus) => void;
|
|
1705
|
-
getOnboardingStatus: ({ userId, eventId, organizationId }: UserProps) => string | undefined;
|
|
1706
|
-
setOnboardingInstantOpen: ({ userId, eventId, organizationId }: UserProps) => void;
|
|
1707
|
-
getOnboardingInstantOpen: ({ userId, eventId, organizationId }: UserProps) => string | undefined;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
declare module "../../feature-gamification/src/leaderboard" {
|
|
1711
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1712
|
-
import { ReadableAtom } from 'nanostores';
|
|
1713
|
-
import { type LeaderboardItem } from "../../feature-gamification/src/queries/leaderboard";
|
|
1714
|
-
import { Gamification } from "../../feature-gamification/src/index";
|
|
1715
|
-
type LeaderboardOptions = {
|
|
1716
|
-
pageSize?: number;
|
|
1717
|
-
};
|
|
1718
|
-
type LeaderboardStore = {
|
|
1719
|
-
data: Array<LeaderboardItem & {
|
|
1720
|
-
summaryLoaded?: boolean;
|
|
1721
|
-
}>;
|
|
1722
|
-
loading?: boolean;
|
|
1723
|
-
key: number;
|
|
1724
|
-
hasMore: boolean;
|
|
1725
|
-
error?: string;
|
|
1726
|
-
};
|
|
1727
|
-
export const leaderboard: (transport: Transport, $eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, $friends: Gamification["friends"], options?: LeaderboardOptions) => {
|
|
1728
|
-
$store: import("nanostores").MapStore<LeaderboardStore>;
|
|
1729
|
-
fetchMore: (page?: number) => void;
|
|
1730
|
-
invalidate: () => void;
|
|
1731
|
-
};
|
|
1732
|
-
}
|
|
1733
|
-
declare module "../../feature-gamification/src/queries/deepLink" {
|
|
1734
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1735
|
-
import { ReadableAtom } from 'nanostores';
|
|
1736
|
-
import { DeepLink } from '@streamlayer/sl-eslib/sdkSettings/client/client_pb';
|
|
1737
|
-
type EventId = ReadableAtom<string | undefined>;
|
|
1738
|
-
type ExternalEventId = ReadableAtom<string | undefined>;
|
|
1739
|
-
export const $deepLink: (transport: Transport, params: [EventId, ExternalEventId]) => import("@nanostores/query").FetcherStore<DeepLink | undefined, any>;
|
|
1740
|
-
export const generateShortLink: (transport: Transport, { web, mobile }: {
|
|
1741
|
-
web: string;
|
|
1742
|
-
mobile: string;
|
|
1743
|
-
}) => Promise<import("@streamlayer/sl-eslib/shortLinks/linksClient_pb").GenerateResponse>;
|
|
1744
|
-
}
|
|
1745
|
-
declare module "../../feature-gamification/src/deepLink" {
|
|
1746
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1747
|
-
import { ReadableAtom } from 'nanostores';
|
|
1748
|
-
type DeepLinkData = {
|
|
1749
|
-
data?: string;
|
|
1750
|
-
loading?: boolean;
|
|
1751
|
-
error?: string;
|
|
1752
|
-
};
|
|
1753
|
-
export const deepLink: (transport: Transport, $eventId: ReadableAtom<string | undefined>, $externalEventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>) => {
|
|
1754
|
-
$store: import("nanostores").MapStore<DeepLinkData>;
|
|
1755
|
-
fetch: typeof fetch;
|
|
1756
|
-
};
|
|
1757
|
-
}
|
|
1758
|
-
declare module "../../feature-gamification/src/userSummary" {
|
|
1759
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1760
|
-
import { ReadableAtom } from 'nanostores';
|
|
1761
|
-
import { LeaderboardSummaryItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
1762
|
-
import { Gamification } from "../../feature-gamification/src/index";
|
|
1763
|
-
export const summary: ($eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, $friends: Gamification["friends"], transport: Transport) => {
|
|
1764
|
-
$store: import("nanostores").MapStore<LeaderboardSummaryItem | undefined>;
|
|
1765
|
-
invalidate: () => void;
|
|
1766
|
-
};
|
|
1767
|
-
}
|
|
1768
|
-
declare module "../../feature-gamification/src/friendSummary" {
|
|
1769
|
-
import type { Transport } from '@streamlayer/sdk-web-api';
|
|
1770
|
-
import { ReadableAtom } from 'nanostores';
|
|
1771
|
-
import { LeaderboardItem } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
1772
|
-
import { Gamification } from "../../feature-gamification/src/index";
|
|
1773
|
-
export const friendSummary: ($eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, $friends: Gamification["friends"], friendId: string, transport: Transport) => Promise<LeaderboardItem | undefined>;
|
|
1774
|
-
}
|
|
1775
|
-
declare module "../../feature-gamification/src/gamification" {
|
|
1776
|
-
import { AbstractFeature, ApiStore, FeatureSource, type FeatureProps, type StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
1777
|
-
import { type GamesOverlaySettings, FeedItem } from '@streamlayer/sdk-web-types';
|
|
1778
|
-
import type { GetApiResponseType } from '@streamlayer/sdk-web-api';
|
|
1779
|
-
import '@streamlayer/sdk-web-core/store';
|
|
1780
|
-
import type { PlainMessage } from '@bufbuild/protobuf';
|
|
1781
|
-
import { WritableAtom } from 'nanostores';
|
|
1782
|
-
import * as queries from "../../feature-gamification/src/queries/index";
|
|
1783
|
-
import { leaderboard } from "../../feature-gamification/src/leaderboard";
|
|
1784
|
-
import { deepLink } from "../../feature-gamification/src/deepLink";
|
|
1785
|
-
import { OnboardingStatus } from "../../feature-gamification/src/onboarding";
|
|
1786
|
-
import { LeaderboardItem } from "../../feature-gamification/src/queries/leaderboard";
|
|
1787
|
-
import { GamificationBackground } from "../../feature-gamification/src/background";
|
|
1788
|
-
import { summary } from "../../feature-gamification/src/userSummary";
|
|
1789
|
-
/**
|
|
1790
|
-
* Gamification (Games) Overlay
|
|
1791
|
-
* Includes:
|
|
1792
|
-
* - questions list (pick history)
|
|
1793
|
-
* - active question (question from active queue, available from pick history and in-app)
|
|
1794
|
-
* - leaderboard (currently only global pinned leaderboard)
|
|
1795
|
-
* - user summary (current user summary)
|
|
1796
|
-
* - onboarding (welcome book)
|
|
1797
|
-
*/
|
|
1798
|
-
export class Gamification extends AbstractFeature<'games', PlainMessage<GamesOverlaySettings>> {
|
|
1799
|
-
/** user statistics (leaderboard panel) */
|
|
1800
|
-
userSummary: ReturnType<typeof summary>;
|
|
1801
|
-
/** feed list (pick history) */
|
|
1802
|
-
feedList: ApiStore<GetApiResponseType<typeof queries.$feedList>>;
|
|
1803
|
-
/** friends list */
|
|
1804
|
-
friends: ApiStore<GetApiResponseType<typeof queries.$friends>>;
|
|
1805
|
-
/** pinned leaderboard id */
|
|
1806
|
-
leaderboardId: WritableAtom<string | undefined>;
|
|
1807
|
-
/** leaderboard list */
|
|
1808
|
-
leaderboardList: ReturnType<typeof leaderboard>;
|
|
1809
|
-
deepLink: ReturnType<typeof deepLink>;
|
|
1810
|
-
/** onboarding status */
|
|
1811
|
-
onboardingStatus: {
|
|
1812
|
-
$store: WritableAtom<OnboardingStatus | undefined>;
|
|
1813
|
-
submitInplay: () => Promise<void>;
|
|
1814
|
-
};
|
|
1815
|
-
/** opened question */
|
|
1816
|
-
openedQuestion: GamificationBackground['openedQuestion'];
|
|
1817
|
-
/** current user id */
|
|
1818
|
-
currentUserId: GamificationBackground['userId'];
|
|
1819
|
-
/** pinned leaderboard id */
|
|
1820
|
-
openedUser: WritableAtom<LeaderboardItem | undefined>;
|
|
1821
|
-
closeFeature: () => void;
|
|
1822
|
-
openFeature: () => void;
|
|
1823
|
-
feedSubscription: GamificationBackground['feedSubscription'];
|
|
1824
|
-
activeQuestionId: GamificationBackground['activeQuestionId'];
|
|
1825
|
-
openedQuestionId: GamificationBackground['openedQuestionId'];
|
|
1826
|
-
advertisement: GamificationBackground['advertisement'];
|
|
1827
|
-
private notifications;
|
|
1828
|
-
private transport;
|
|
1829
|
-
/** gamification background class, handle subscriptions and notifications for closed overlay */
|
|
1830
|
-
private background;
|
|
1831
|
-
/** Browser cache */
|
|
1832
|
-
private storage;
|
|
1833
|
-
private submitAnswerTimeout;
|
|
1834
|
-
private cancels;
|
|
1835
|
-
constructor(config: FeatureProps, source: FeatureSource, instance: StreamLayerContext);
|
|
1836
|
-
get isInteractiveAllowed(): boolean;
|
|
1837
|
-
checkInteractiveFlag: () => void;
|
|
1838
|
-
connect: () => void;
|
|
1839
|
-
disconnect: () => void;
|
|
1840
|
-
submitAnswer: (questionId: string, answerId: string) => Promise<void>;
|
|
1841
|
-
openQuestion: (questionId?: string, question?: FeedItem & {
|
|
1842
|
-
openedFrom?: "list" | "notification";
|
|
1843
|
-
}) => void | (() => void);
|
|
1844
|
-
closeQuestion: (questionId?: string) => void;
|
|
1845
|
-
openUser: (friendId: string) => Promise<void>;
|
|
1846
|
-
closeUser: () => void;
|
|
1847
|
-
/**
|
|
1848
|
-
* Show in-app notification for active question
|
|
1849
|
-
* for interactive questions we show notification only if interactiveAllowed
|
|
1850
|
-
* for factoid and tweet questions we show notification always
|
|
1851
|
-
* skipping questions with inAppSilence === ON
|
|
1852
|
-
*/
|
|
1853
|
-
private showInApp;
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
declare module "../../feature-gamification/src/index" {
|
|
1857
|
-
export { GamificationBackground } from "../../feature-gamification/src/background";
|
|
1858
|
-
export { Gamification } from "../../feature-gamification/src/gamification";
|
|
1859
|
-
export { Advertisement } from "../../feature-gamification/src/advertisement/index";
|
|
1860
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
1861
|
-
interface StreamLayerContext {
|
|
1862
|
-
gamification: import("../../feature-gamification/src/background").GamificationBackground;
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
declare module "../../sdk-web-features/src/index" {
|
|
1867
|
-
import { FeatureType } from '@streamlayer/sdk-web-types';
|
|
1868
|
-
import { AbstractFeature, FeatureSource, FeatureProps, StreamLayerContext, SingleStore } from '@streamlayer/sdk-web-interfaces';
|
|
1869
|
-
import { Gamification } from '@streamlayer/feature-gamification';
|
|
1870
|
-
export type Features = Feature | Gamification;
|
|
1871
|
-
export const AvailableFeatures: {
|
|
1872
|
-
12: boolean;
|
|
1873
|
-
};
|
|
1874
|
-
export class Feature extends AbstractFeature<undefined> {
|
|
1875
|
-
constructor(overlay: FeatureProps, source: FeatureSource);
|
|
1876
|
-
}
|
|
1877
|
-
export const initFeature: (overlay: FeatureProps, source: FeatureSource, instance: StreamLayerContext) => Gamification | Feature;
|
|
1878
|
-
export { FeatureSource } from '@streamlayer/sdk-web-interfaces';
|
|
1879
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
1880
|
-
interface StreamLayerContext {
|
|
1881
|
-
features: Map<FeatureType, Features>;
|
|
1882
|
-
initFeature: (overlay: FeatureProps, source: FeatureSource) => void;
|
|
1883
|
-
updateFeature: (overlay: FeatureProps, source: FeatureSource) => void;
|
|
1884
|
-
destroyFeature: (overlay: FeatureProps) => void;
|
|
1885
|
-
reinitializeFeatures: () => Promise<void>;
|
|
1886
|
-
activeFeature: SingleStore<FeatureType>;
|
|
1887
|
-
}
|
|
1888
|
-
interface StreamLayerSDK {
|
|
1889
|
-
getFeatures: () => Map<FeatureType, Features>;
|
|
1890
|
-
getFeature: <T extends FeatureType = FeatureType>(featureType: T) => (T extends FeatureType.GAMES ? Gamification : Feature) | undefined;
|
|
1891
|
-
getActiveFeature: SingleStore<FeatureType>['getStore'];
|
|
1892
|
-
closeFeature: (destroy?: boolean) => void;
|
|
1893
|
-
featuresList: SingleStore<Set<FeatureType>>;
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
export const features: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
1897
|
-
}
|
|
1898
|
-
declare module "../../sdk-web-analytics/src/invitation" {
|
|
1899
|
-
import { InvitationFrom } from '@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb';
|
|
1900
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
1901
|
-
export class InvitationAnalytics {
|
|
1902
|
-
private analytics;
|
|
1903
|
-
constructor(analytics: Analytics);
|
|
1904
|
-
accepted: () => void;
|
|
1905
|
-
sent: ({ from }: {
|
|
1906
|
-
from?: InvitationFrom;
|
|
1907
|
-
}) => void;
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
declare module "../../sdk-web-analytics/src/interactions" {
|
|
1911
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
1912
|
-
export class InteractionsAnalytics {
|
|
1913
|
-
private analytics;
|
|
1914
|
-
constructor(analytics: Analytics);
|
|
1915
|
-
tap: () => void;
|
|
1916
|
-
scroll: () => void;
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
declare module "../../sdk-web-analytics/src/constants" {
|
|
1920
|
-
import { TopicType, Category } from '@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb';
|
|
1921
|
-
import { NotificationKind } from '@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb';
|
|
1922
|
-
export const AllowedCases: {
|
|
1923
|
-
games: string;
|
|
1924
|
-
notification: string;
|
|
1925
|
-
invitation: string;
|
|
1926
|
-
eventOpened: string;
|
|
1927
|
-
interactions: string;
|
|
1928
|
-
};
|
|
1929
|
-
export const TOPIC_TYPE_MAP: {
|
|
1930
|
-
0: TopicType;
|
|
1931
|
-
4: TopicType;
|
|
1932
|
-
1: TopicType;
|
|
1933
|
-
3: TopicType;
|
|
1934
|
-
6: TopicType;
|
|
1935
|
-
2: TopicType;
|
|
1936
|
-
5: TopicType;
|
|
1937
|
-
};
|
|
1938
|
-
export const QUESTION_NOTIFICATION_KIND_MAP: {
|
|
1939
|
-
0: NotificationKind;
|
|
1940
|
-
4: NotificationKind;
|
|
1941
|
-
1: NotificationKind;
|
|
1942
|
-
3: NotificationKind;
|
|
1943
|
-
6: NotificationKind;
|
|
1944
|
-
2: NotificationKind;
|
|
1945
|
-
5: NotificationKind;
|
|
1946
|
-
};
|
|
1947
|
-
export const CATEGORY_TYPE_MAP: {
|
|
1948
|
-
0: Category;
|
|
1949
|
-
1: Category;
|
|
1950
|
-
2: Category;
|
|
1951
|
-
3: Category;
|
|
1952
|
-
4: Category;
|
|
1953
|
-
5: Category;
|
|
1954
|
-
6: Category;
|
|
1955
|
-
7: Category;
|
|
1956
|
-
8: Category;
|
|
1957
|
-
9: Category;
|
|
1958
|
-
10: Category;
|
|
1959
|
-
11: Category;
|
|
1960
|
-
12: Category;
|
|
1961
|
-
13: Category;
|
|
1962
|
-
14: Category;
|
|
1963
|
-
15: Category;
|
|
1964
|
-
};
|
|
1965
|
-
}
|
|
1966
|
-
declare module "../../sdk-web-analytics/src/notifications" {
|
|
1967
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
1968
|
-
export class NotificationsAnalytics {
|
|
1969
|
-
private analytics;
|
|
1970
|
-
constructor(analytics: Analytics);
|
|
1971
|
-
private received;
|
|
1972
|
-
private opened;
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
declare module "../../sdk-web-analytics/src/polls" {
|
|
1976
|
-
import { QuestionType } from '@streamlayer/sdk-web-types';
|
|
1977
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
1978
|
-
/**
|
|
1979
|
-
* PollsAnalytics is a class that is used to send analytics events related to polls.
|
|
1980
|
-
* It is used to send events when a poll is received, opened, voted, onboarding passed, or navigated.
|
|
1981
|
-
*/
|
|
1982
|
-
export class PollsAnalytics {
|
|
1983
|
-
private analytics;
|
|
1984
|
-
constructor(analytics: Analytics);
|
|
1985
|
-
received: ({ questionId, questionType }: {
|
|
1986
|
-
questionId?: string;
|
|
1987
|
-
questionType?: QuestionType;
|
|
1988
|
-
}) => void;
|
|
1989
|
-
opened: ({ questionId, questionType, questionOpenedFrom, }: {
|
|
1990
|
-
questionId?: string;
|
|
1991
|
-
questionType?: QuestionType;
|
|
1992
|
-
questionOpenedFrom?: "list" | "notification";
|
|
1993
|
-
}) => void;
|
|
1994
|
-
voted: ({ questionId, questionType }: {
|
|
1995
|
-
questionId?: string;
|
|
1996
|
-
questionType?: QuestionType;
|
|
1997
|
-
}) => void;
|
|
1998
|
-
onboardingPassed: () => void;
|
|
1999
|
-
navigated: () => void;
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
declare module "../../sdk-web-analytics/src/heartbeat" {
|
|
2003
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
2004
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
2005
|
-
type IHeartbeat = {
|
|
2006
|
-
transport: Transport;
|
|
2007
|
-
$commonStore: Analytics['commonStore'];
|
|
2008
|
-
};
|
|
2009
|
-
export const heartbeat: ({ transport, $commonStore }: IHeartbeat) => {
|
|
2010
|
-
enable: () => void;
|
|
2011
|
-
disable: () => void;
|
|
2012
|
-
mount: () => void;
|
|
2013
|
-
unmount: () => void;
|
|
2014
|
-
};
|
|
2015
|
-
}
|
|
2016
|
-
declare module "../../sdk-web-analytics/src/analytics" {
|
|
2017
|
-
import { MapStore, StreamLayerContext, OnMountCb } from '@streamlayer/sdk-web-interfaces';
|
|
2018
|
-
import { Logger } from '@streamlayer/sdk-web-logger';
|
|
2019
|
-
import { GamesMessage, NotificationMessage, SendInvitationsMessage, EventOpenedMessage, SendInteractionsMessage, CommonData } from '@streamlayer/sl-eslib/analytics/v2/streaming/streaming_pb';
|
|
2020
|
-
import { PlainMessage } from '@bufbuild/protobuf';
|
|
2021
|
-
import { InvitationAnalytics } from "../../sdk-web-analytics/src/invitation";
|
|
2022
|
-
import { InteractionsAnalytics } from "../../sdk-web-analytics/src/interactions";
|
|
2023
|
-
import { NotificationsAnalytics } from "../../sdk-web-analytics/src/notifications";
|
|
2024
|
-
import { PollsAnalytics } from "../../sdk-web-analytics/src/polls";
|
|
2025
|
-
import { AllowedCases } from "../../sdk-web-analytics/src/constants";
|
|
2026
|
-
import '@streamlayer/sdk-web-features';
|
|
2027
|
-
type AnalyticsMessages = {
|
|
2028
|
-
games?: PlainMessage<GamesMessage>;
|
|
2029
|
-
notification?: PlainMessage<NotificationMessage>;
|
|
2030
|
-
invitation?: PlainMessage<SendInvitationsMessage>;
|
|
2031
|
-
eventOpened?: PlainMessage<EventOpenedMessage>;
|
|
2032
|
-
interactions?: PlainMessage<SendInteractionsMessage>;
|
|
2033
|
-
common: PlainMessage<CommonData>;
|
|
2034
|
-
};
|
|
2035
|
-
export const logger: Logger;
|
|
2036
|
-
/**
|
|
2037
|
-
* analytics events
|
|
2038
|
-
* 1. start (on start we should send heartbeats, generate session id)
|
|
2039
|
-
* 2. overlay open (on open we should update store, create overlay session id)
|
|
2040
|
-
* 3. overlay close (on close we should update store, remove overlay session id)
|
|
2041
|
-
* 4. switch event
|
|
2042
|
-
* 5. on update screen orientation
|
|
2043
|
-
* 6. on open question we should update topicId, topicType (???parentTopicId, ???topicSubType)
|
|
2044
|
-
* 7. on close question we should clear topicId, topicType
|
|
2045
|
-
*/
|
|
2046
|
-
export class Analytics {
|
|
2047
|
-
readonly commonStore: MapStore<AnalyticsMessages['common']>;
|
|
2048
|
-
readonly notifications: NotificationsAnalytics;
|
|
2049
|
-
readonly polls: PollsAnalytics;
|
|
2050
|
-
readonly invitation: InvitationAnalytics;
|
|
2051
|
-
readonly interactions: InteractionsAnalytics;
|
|
2052
|
-
private heartbeat;
|
|
2053
|
-
private analyticsClient;
|
|
2054
|
-
private listeners;
|
|
2055
|
-
private listenersCancels;
|
|
2056
|
-
private connected;
|
|
2057
|
-
constructor(instance: StreamLayerContext);
|
|
2058
|
-
connect: () => void;
|
|
2059
|
-
disconnect: () => void;
|
|
2060
|
-
write: <T extends keyof typeof AllowedCases = "notification" | "invitation" | "interactions" | "games" | "eventOpened">(key: T, value: AnalyticsMessages[T]) => void;
|
|
2061
|
-
writeCommon: <T extends keyof PlainMessage<CommonData> = "eventId" | "category" | "kind" | "screenOrientation" | "sessionId" | "overlaySessionId" | "topicId" | "topicType" | "parentTopicId" | "parentTopicType" | "participantsCount" | "routeMap" | "trackTimestamp" | "topicSubType" | "country">(key: T, value: PlainMessage<CommonData>[T]) => void;
|
|
2062
|
-
onConnect: (cb: OnMountCb) => void;
|
|
2063
|
-
private connectToSDK;
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
declare module "../../sdk-web-analytics/src/index" {
|
|
2067
|
-
import { type StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
2068
|
-
import type { DeepLinkContext } from '@streamlayer/sdk-web-core';
|
|
2069
|
-
import { Transport } from '@streamlayer/sdk-web-api';
|
|
2070
|
-
import { Analytics } from "../../sdk-web-analytics/src/analytics";
|
|
2071
|
-
module '@streamlayer/sdk-web-interfaces' {
|
|
2072
|
-
interface StreamLayerContext {
|
|
2073
|
-
analytics: Analytics;
|
|
2074
|
-
deepLink: DeepLinkContext;
|
|
2075
|
-
analyticsTransport: Transport;
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
export const analytics: (instance: StreamLayerContext, opts: unknown, done: Function) => void;
|
|
2079
|
-
}
|
|
2080
|
-
declare module "../../sdk-web/src/index" {
|
|
2081
|
-
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
2082
|
-
import { type DeepLinkCallback, type VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2083
|
-
import avvio from 'avvio';
|
|
2084
|
-
import './polyfills/raf';
|
|
2085
|
-
export type StreamLayerInstance = avvio.mixedInstance<StreamLayerContext>;
|
|
2086
|
-
export type StreamLayerPlugin = (instance: StreamLayerContext, opts: unknown, done: DoneFn) => void;
|
|
2087
|
-
type DoneFn = Function;
|
|
2088
|
-
export function StreamLayer(sdkKey: string, production?: boolean, autoEnable?: boolean, meta?: {
|
|
2089
|
-
version?: string;
|
|
2090
|
-
onDeepLinkHandled?: DeepLinkCallback;
|
|
2091
|
-
videoPlayerController?: VideoPlayerCallback;
|
|
2092
|
-
}): avvio.Avvio<StreamLayerContext>;
|
|
2093
|
-
}
|
|
2094
|
-
declare module "app/useStreamLayerApp" {
|
|
2095
|
-
import type { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2096
|
-
import type { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2097
|
-
global {
|
|
2098
|
-
interface Window {
|
|
2099
|
-
sl: unknown;
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
export const useStreamLayerApp: ({ sdkKey, plugins, production, autoEnable, onDeepLinkHandled, videoPlayerController, }: {
|
|
2103
|
-
sdkKey: string;
|
|
2104
|
-
plugins?: Set<StreamLayerPlugin>;
|
|
2105
|
-
production?: boolean;
|
|
2106
|
-
autoEnable?: boolean;
|
|
2107
|
-
onDeepLinkHandled?: DeepLinkCallback;
|
|
2108
|
-
videoPlayerController?: VideoPlayerCallback;
|
|
2109
|
-
}) => StreamLayerSDK | null;
|
|
2110
|
-
}
|
|
2111
|
-
declare module "app/provider" {
|
|
2112
|
-
import type { StreamLayerSDK, StreamLayerPlugin } from '@streamlayer/sdk-web-interfaces';
|
|
2113
|
-
import type { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2114
|
-
export type { DeepLinkCallback, VideoPlayerCallback } from '@streamlayer/sdk-web-core';
|
|
2115
|
-
export enum StreamLayerStatus {
|
|
2116
|
-
UNSET = 0,
|
|
2117
|
-
CONNECTED = 1,
|
|
2118
|
-
READY = 2
|
|
2119
|
-
}
|
|
2120
|
-
export const StreamLayerContext: import("react").Context<{
|
|
2121
|
-
status: StreamLayerStatus;
|
|
2122
|
-
sdk: StreamLayerSDK | null;
|
|
2123
|
-
}>;
|
|
2124
|
-
export type StreamLayerProps = {
|
|
2125
|
-
sdkKey: string;
|
|
2126
|
-
plugins?: Set<StreamLayerPlugin>;
|
|
2127
|
-
production?: boolean;
|
|
2128
|
-
autoEnable?: boolean;
|
|
2129
|
-
onDeepLinkHandled?: DeepLinkCallback;
|
|
2130
|
-
videoPlayerController?: VideoPlayerCallback;
|
|
2131
|
-
};
|
|
2132
|
-
export const StreamLayerProvider: React.FC<StreamLayerProps & {
|
|
2133
|
-
children: React.ReactNode;
|
|
2134
|
-
}>;
|
|
2135
|
-
}
|
|
2136
|
-
declare module "app/app" {
|
|
2137
|
-
import type { StreamLayerSDK } from '@streamlayer/sdk-web-interfaces';
|
|
2138
|
-
export const useStreamLayer: () => StreamLayerSDK | null;
|
|
2139
|
-
export const StreamLayerSDKReact: React.FC<{
|
|
2140
|
-
event: string;
|
|
2141
|
-
}>;
|
|
2142
|
-
}
|
|
2143
|
-
declare module "app/masters" {
|
|
2144
|
-
import { Component } from 'react';
|
|
2145
|
-
import { StreamLayerProps } from "app/provider";
|
|
2146
|
-
import '@streamlayer/react-ui/style.css';
|
|
2147
|
-
export const MastersStreamLayerProvider: React.FC<Omit<StreamLayerProps, 'autoEnable'> & {
|
|
2148
|
-
children: React.ReactNode;
|
|
2149
|
-
}>;
|
|
2150
|
-
type Overlays = {
|
|
2151
|
-
leaderboard: React.ReactNode;
|
|
2152
|
-
};
|
|
2153
|
-
type MastersAppChildrenProps = {
|
|
2154
|
-
activateEventWithId: (event: string) => void;
|
|
2155
|
-
deactivate: () => void;
|
|
2156
|
-
};
|
|
2157
|
-
type MastersAppProps = {
|
|
2158
|
-
overlays?: Overlays;
|
|
2159
|
-
children: (methods: MastersAppChildrenProps) => React.ReactNode;
|
|
2160
|
-
};
|
|
2161
|
-
export class MastersStreamLayerSDKReact extends Component<MastersAppProps, {
|
|
2162
|
-
hasError: boolean;
|
|
2163
|
-
}> {
|
|
2164
|
-
constructor(props: MastersAppProps);
|
|
2165
|
-
static getDerivedStateFromError(): {
|
|
2166
|
-
hasError: boolean;
|
|
2167
|
-
};
|
|
2168
|
-
componentDidCatch(error: any, info: any): void;
|
|
2169
|
-
render(): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
declare module "app/auth" {
|
|
2173
|
-
export const StreamLayerLogin: React.FC<{
|
|
2174
|
-
token: string;
|
|
2175
|
-
schema: string;
|
|
2176
|
-
}>;
|
|
2177
|
-
}
|
|
2178
|
-
/// <amd-module name="@streamlayer/react/masters" />
|
|
2179
|
-
declare module "@streamlayer/react/masters" {
|
|
2180
|
-
export * from "app/masters";
|
|
2181
|
-
export * from "app/auth";
|
|
2182
|
-
export { type DeepLinkCallback, type VideoPlayerCallback } from "app/provider";
|
|
2183
|
-
export const StreamLayerSDKPoints: () => import("react/jsx-runtime").JSX.Element | null;
|
|
2184
|
-
}
|
|
2185
|
-
declare module "index" {
|
|
2186
|
-
import '@streamlayer/sdk-web-api';
|
|
2187
|
-
import '@streamlayer/sdk-web-core';
|
|
2188
|
-
import '@streamlayer/sdk-web-types';
|
|
2189
|
-
import '@streamlayer/sdk-web-logger';
|
|
2190
|
-
import '@streamlayer/sdk-web-storage';
|
|
2191
|
-
import '@streamlayer/sdk-web-features';
|
|
2192
|
-
import '@streamlayer/sdk-web-interfaces';
|
|
2193
|
-
import '@streamlayer/sdk-web-notifications';
|
|
2194
|
-
import '@streamlayer/feature-gamification';
|
|
2195
|
-
export { StreamLayerProvider, type DeepLinkCallback, type VideoPlayerCallback } from "app/provider";
|
|
2196
|
-
export { StreamLayerSDKReact, useStreamLayer } from "app/app";
|
|
2197
|
-
}
|
|
2198
|
-
declare module "app/advertisement" {
|
|
2199
|
-
export type StreamLayerSDKAdvertisementProps = {
|
|
2200
|
-
event?: string;
|
|
2201
|
-
sidebar?: 'left' | 'right';
|
|
2202
|
-
banner?: 'top' | 'bottom';
|
|
2203
|
-
};
|
|
2204
|
-
export const StreamLayerSDKAdvertisement: React.FC<StreamLayerSDKAdvertisementProps>;
|
|
2205
|
-
}
|
|
2206
|
-
declare module "app/points" {
|
|
2207
|
-
export const StreamLayerSDKPoints: () => import("react/jsx-runtime").JSX.Element | null;
|
|
2208
|
-
}
|