@streamlayer/react 0.36.2 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/masters.d.ts +1 -1
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/gamification-feature.js +5 -1
- package/lib/cjs/index2.js +13 -3
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +34 -34
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useSdkFeature.js +1 -1
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/dist/cjs/gamification-feature.js +5 -1
- package/lib/dist/cjs/masters.js +76 -64
- package/lib/dist/es/gamification-feature.js +645 -595
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +24025 -21191
- package/lib/dist/index.d.ts +91 -61
- package/lib/dist/style.css +1 -1
- package/lib/es/app.js +5 -5
- package/lib/es/gamification-feature.js +716 -667
- package/lib/es/index2.js +64 -22
- package/lib/es/masters.js +4 -3
- package/lib/es/masters2.js +7553 -7392
- package/lib/es/points.js +21 -22
- package/lib/es/useSdkFeature.js +112 -97
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +14 -14
- package/lib/cjs/index3.js +0 -1
- package/lib/es/index3.js +0 -19
package/lib/dist/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ declare module "../../sdk-web-interfaces/src/store/map" {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
declare module "../../sdk-web-interfaces/src/feature" {
|
|
109
|
-
import { FeatureConfig as SdkOverlay, SdkOverlaySettings } from '../../sdk-web/src/index.ts
|
|
109
|
+
import { FeatureConfig as SdkOverlay, SdkOverlaySettings } from '../../sdk-web-types/src/index.ts';
|
|
110
110
|
import { PlainMessage } from '@bufbuild/protobuf';
|
|
111
111
|
import { WritableAtom } from 'nanostores';
|
|
112
112
|
import { MapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
@@ -183,7 +183,7 @@ declare module "../../sdk-web-interfaces/src/store/api" {
|
|
|
183
183
|
constructor(store: StoreInstance, name: string, atomPicker?: (val: FetcherValue<StoreValue, unknown>, prevVal?: string) => string | undefined);
|
|
184
184
|
getAtomStore: () => WritableAtom<string | undefined>;
|
|
185
185
|
getValue: () => Promise<StoreValue | undefined>;
|
|
186
|
-
getValues: () =>
|
|
186
|
+
getValues: () => FetcherValue<StoreValue, any>;
|
|
187
187
|
setValue: (value?: StoreInstance['value']) => void;
|
|
188
188
|
subscribe: StoreInstance['subscribe'];
|
|
189
189
|
unsubscribe: () => never;
|
|
@@ -195,7 +195,7 @@ declare module "../../sdk-web-interfaces/src/store/api" {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
declare module "../../sdk-web-interfaces/src/index" {
|
|
198
|
-
import { FeatureType } from '../../sdk-web/src/index.ts
|
|
198
|
+
import { FeatureType } from '../../sdk-web-types/src/index.ts';
|
|
199
199
|
export { AbstractAuthenticationProvider } from "../../sdk-web-interfaces/src/auth";
|
|
200
200
|
export { AbstractFeature, FeatureSource, type FeatureProps, FeatureStatus } from "../../sdk-web-interfaces/src/feature";
|
|
201
201
|
export { MapStore, createMapStore } from "../../sdk-web-interfaces/src/store/map";
|
|
@@ -254,6 +254,7 @@ declare module "../../sdk-web-api/src/grpc/transport" {
|
|
|
254
254
|
useProtoFieldName: boolean;
|
|
255
255
|
};
|
|
256
256
|
readonly transport: ReturnType<typeof createGrpcWebTransport>;
|
|
257
|
+
readonly streamTransport: ReturnType<typeof createGrpcWebTransport>;
|
|
257
258
|
readonly nanoquery: NanoqueryObjectType;
|
|
258
259
|
readonly host: string;
|
|
259
260
|
protected interceptors: Interceptor[];
|
|
@@ -268,6 +269,7 @@ declare module "../../sdk-web-api/src/grpc/transport" {
|
|
|
268
269
|
registerInterceptor: (interceptor: Interceptor) => void;
|
|
269
270
|
removeInterceptor: (interceptor: Interceptor) => void;
|
|
270
271
|
getClient: <T extends ServiceType>(service: T) => PromiseClient<T>;
|
|
272
|
+
getStreamClient: <T extends ServiceType>(service: T) => PromiseClient<T>;
|
|
271
273
|
createPromiseClient: <T extends ServiceType>(service: T, { params, method }: {
|
|
272
274
|
params?: KeyInput | undefined;
|
|
273
275
|
method: keyof T["methods"];
|
|
@@ -405,7 +407,7 @@ declare module "../../sdk-web-api/src/grpc/queries/index" {
|
|
|
405
407
|
export * from "../../sdk-web-api/src/grpc/queries/user";
|
|
406
408
|
}
|
|
407
409
|
declare module "../../sdk-web-api/src/index" {
|
|
408
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
410
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
409
411
|
import { FetcherStore } from '@nanostores/query';
|
|
410
412
|
export type { ServerStreamSubscriptionOptions } from "../../sdk-web-api/src/grpc/subscription";
|
|
411
413
|
export { Transport } from "../../sdk-web-api/src/grpc/transport";
|
|
@@ -440,7 +442,7 @@ declare module "../../sdk-web-storage/src/index" {
|
|
|
440
442
|
}
|
|
441
443
|
}
|
|
442
444
|
declare module "../../sdk-web-core/src/storage" {
|
|
443
|
-
import { Storage } from '../../sdk-web/src/index.ts
|
|
445
|
+
import { Storage } from '../../sdk-web-storage/src/index.ts';
|
|
444
446
|
export class UserStorage extends Storage {
|
|
445
447
|
constructor();
|
|
446
448
|
setSchema: (value: string) => void;
|
|
@@ -453,8 +455,8 @@ declare module "../../sdk-web-core/src/storage" {
|
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
457
|
declare module "../../sdk-web-core/src/store/init" {
|
|
456
|
-
import { SingleStore, ApiStore } from '../../sdk-web/src/index.ts
|
|
457
|
-
import { Transport } from '../../sdk-web/src/index.ts
|
|
458
|
+
import { SingleStore, ApiStore } from '../../sdk-web-interfaces/src/index.ts';
|
|
459
|
+
import { Transport } from '../../sdk-web-api/src/index.ts';
|
|
458
460
|
export enum CoreStatus {
|
|
459
461
|
DISABLED = "disabled",
|
|
460
462
|
INITIALIZATION = "initialization",
|
|
@@ -509,9 +511,9 @@ declare module "../../sdk-web-core/src/store/init" {
|
|
|
509
511
|
};
|
|
510
512
|
}
|
|
511
513
|
declare module "../../sdk-web-core/src/store/store" {
|
|
512
|
-
import type { OrganizationAdvertising, StreamSettings, OrganizationSettings, User, UserSettings } from '../../sdk-web/src/index.ts
|
|
513
|
-
import { AbstractStore } from '../../sdk-web/src/index.ts
|
|
514
|
-
import { Transport } from '../../sdk-web/src/index.ts
|
|
514
|
+
import type { OrganizationAdvertising, StreamSettings, OrganizationSettings, User, UserSettings } from '../../sdk-web-types/src/index.ts';
|
|
515
|
+
import { AbstractStore } from '../../sdk-web-interfaces/src/index.ts';
|
|
516
|
+
import { Transport } from '../../sdk-web-api/src/index.ts';
|
|
515
517
|
import { ReadableAtom } from 'nanostores';
|
|
516
518
|
import { FetcherValue } from '@nanostores/query';
|
|
517
519
|
import { initializeStore, CoreStatus } from "../../sdk-web-core/src/store/init";
|
|
@@ -559,16 +561,16 @@ declare module "../../sdk-web-core/src/store/store" {
|
|
|
559
561
|
constructor(transport: Transport);
|
|
560
562
|
getValue(): unknown;
|
|
561
563
|
getValues(): {
|
|
562
|
-
readonly enabled: import('../../sdk-web/src/index.ts
|
|
563
|
-
readonly status: import('../../sdk-web/src/index.ts
|
|
564
|
-
readonly providerStreamId: import('../../sdk-web/src/index.ts
|
|
565
|
-
readonly slStreamId: import('../../sdk-web/src/index.ts
|
|
566
|
-
readonly streamSettings: import('../../sdk-web/src/index.ts
|
|
567
|
-
readonly user: import('../../sdk-web/src/index.ts
|
|
568
|
-
readonly userKey: import('../../sdk-web/src/index.ts
|
|
569
|
-
readonly userToken: import('../../sdk-web/src/index.ts
|
|
570
|
-
readonly userSettings: import('../../sdk-web/src/index.ts
|
|
571
|
-
readonly organizationSettings: import('../../sdk-web/src/index.ts
|
|
564
|
+
readonly enabled: import('../../sdk-web-interfaces/src/index.ts').SingleStore<unknown, import("nanostores").WritableAtom<"on" | undefined>>;
|
|
565
|
+
readonly status: import('../../sdk-web-interfaces/src/index.ts').SingleStore<unknown, import("nanostores").WritableAtom<CoreStatus>>;
|
|
566
|
+
readonly providerStreamId: import('../../sdk-web-interfaces/src/index.ts').SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
567
|
+
readonly slStreamId: import('../../sdk-web-interfaces/src/index.ts').ApiStore<string | undefined, import("@nanostores/query").FetcherStore<string | undefined, any>>;
|
|
568
|
+
readonly streamSettings: import('../../sdk-web-interfaces/src/index.ts').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>>;
|
|
569
|
+
readonly user: import('../../sdk-web-interfaces/src/index.ts').ApiStore<import("@streamlayer/sl-eslib/users/users_pb").MeResponse | undefined, import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/users/users_pb").MeResponse | undefined, any>>;
|
|
570
|
+
readonly userKey: import('../../sdk-web-interfaces/src/index.ts').SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
571
|
+
readonly userToken: import('../../sdk-web-interfaces/src/index.ts').SingleStore<unknown, import("nanostores").WritableAtom<string | undefined>>;
|
|
572
|
+
readonly userSettings: import('../../sdk-web-interfaces/src/index.ts').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>>;
|
|
573
|
+
readonly organizationSettings: import('../../sdk-web-interfaces/src/index.ts').ApiStore<{
|
|
572
574
|
id: string;
|
|
573
575
|
overlays?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").SdkOverlay[] | undefined;
|
|
574
576
|
buttonIcon?: string | undefined;
|
|
@@ -601,7 +603,7 @@ declare module "../../sdk-web-core/src/store/store" {
|
|
|
601
603
|
pub?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").JWK | undefined;
|
|
602
604
|
getstream?: import("@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb").GetStreamSettingsClient | undefined;
|
|
603
605
|
} | undefined, any>>;
|
|
604
|
-
readonly organizationAdvertising: import('../../sdk-web/src/index.ts
|
|
606
|
+
readonly organizationAdvertising: import('../../sdk-web-interfaces/src/index.ts').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>>;
|
|
605
607
|
};
|
|
606
608
|
setValue(): void;
|
|
607
609
|
subscribe: (subscribes: Partial<StoreListeners>) => void;
|
|
@@ -612,8 +614,8 @@ declare module "../../sdk-web-core/src/store/store" {
|
|
|
612
614
|
};
|
|
613
615
|
}
|
|
614
616
|
declare module "../../sdk-web-core/src/auth/bypass/index" {
|
|
615
|
-
import { AbstractAuthenticationProvider } from '../../sdk-web/src/index.ts
|
|
616
|
-
import { Transport } from '../../sdk-web/src/index.ts
|
|
617
|
+
import { AbstractAuthenticationProvider } from '../../sdk-web-interfaces/src/index.ts';
|
|
618
|
+
import { Transport } from '../../sdk-web-api/src/index.ts';
|
|
617
619
|
import { CoreStore } from "../../sdk-web-core/src/store/store";
|
|
618
620
|
/**
|
|
619
621
|
* An authorization service manages user access by providing login, logout,
|
|
@@ -663,7 +665,7 @@ declare module "../../sdk-web-core/src/auth/bypass/index" {
|
|
|
663
665
|
}
|
|
664
666
|
}
|
|
665
667
|
declare module "../../sdk-web-core/src/auth/index" {
|
|
666
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
668
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
667
669
|
import { CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
668
670
|
import { UserStorage } from "../../sdk-web-core/src/storage";
|
|
669
671
|
import { BypassAuth } from "../../sdk-web-core/src/auth/bypass/index";
|
|
@@ -687,7 +689,7 @@ declare module "../../sdk-web-core/src/auth/index" {
|
|
|
687
689
|
export const bypass: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
688
690
|
}
|
|
689
691
|
declare module "../../sdk-web-core/src/store/index" {
|
|
690
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
692
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
691
693
|
import { CoreStore, CoreStores, StoreObj } from "../../sdk-web-core/src/store/store";
|
|
692
694
|
module '@streamlayer/sdk-web-interfaces' {
|
|
693
695
|
interface StreamLayerSDK {
|
|
@@ -717,7 +719,7 @@ declare module "../../sdk-web-core/src/store/index" {
|
|
|
717
719
|
export const store: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
718
720
|
}
|
|
719
721
|
declare module "../../sdk-web-core/src/index" {
|
|
720
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
722
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
721
723
|
export { bypass, storage } from "../../sdk-web-core/src/auth/index";
|
|
722
724
|
export { store } from "../../sdk-web-core/src/store/index";
|
|
723
725
|
import "../../sdk-web-core/src/store/index";
|
|
@@ -756,7 +758,7 @@ declare module "../../sdk-web-logger/src/index" {
|
|
|
756
758
|
export type Logger = ReturnType<typeof createLogger>;
|
|
757
759
|
}
|
|
758
760
|
declare module "../../sdk-web-notifications/src/queue/index" {
|
|
759
|
-
import { SingleStore, createComputedStore } from '../../sdk-web/src/index.ts
|
|
761
|
+
import { SingleStore, createComputedStore } from '../../sdk-web-interfaces/src/index.ts';
|
|
760
762
|
import { Notification } from "../../sdk-web-notifications/src/index";
|
|
761
763
|
export type NotificationsQueueOptions = {
|
|
762
764
|
concurrency: number;
|
|
@@ -780,7 +782,7 @@ declare module "../../sdk-web-notifications/src/queue/index" {
|
|
|
780
782
|
}
|
|
781
783
|
}
|
|
782
784
|
declare module "../../sdk-web-notifications/src/storage" {
|
|
783
|
-
import { Storage } from '../../sdk-web/src/index.ts
|
|
785
|
+
import { Storage } from '../../sdk-web-storage/src/index.ts';
|
|
784
786
|
export class NotificationStorage extends Storage {
|
|
785
787
|
constructor();
|
|
786
788
|
setOpened: (notificationId: string) => void;
|
|
@@ -789,7 +791,7 @@ declare module "../../sdk-web-notifications/src/storage" {
|
|
|
789
791
|
}
|
|
790
792
|
}
|
|
791
793
|
declare module "../../sdk-web-notifications/src/notifications" {
|
|
792
|
-
import { InstantView, QuestionType, GameSettings } from '../../sdk-web/src/index.ts
|
|
794
|
+
import { InstantView, QuestionType, GameSettings } from '../../sdk-web-types/src/index.ts';
|
|
793
795
|
import { NotificationsQueue, NotificationsQueueOptions } from "../../sdk-web-notifications/src/queue/index";
|
|
794
796
|
export type NotificationData = {
|
|
795
797
|
questionType: QuestionType;
|
|
@@ -847,7 +849,7 @@ declare module "../../sdk-web-notifications/src/notifications" {
|
|
|
847
849
|
}
|
|
848
850
|
}
|
|
849
851
|
declare module "../../sdk-web-notifications/src/index" {
|
|
850
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
852
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
851
853
|
import { Notifications } from "../../sdk-web-notifications/src/notifications";
|
|
852
854
|
export { type Notification, type NotificationData, NotificationType, Notifications } from "../../sdk-web-notifications/src/notifications";
|
|
853
855
|
export { type NotificationsList } from "../../sdk-web-notifications/src/queue/index";
|
|
@@ -867,7 +869,7 @@ declare module "../../sdk-web-notifications/src/index" {
|
|
|
867
869
|
export const notifications: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
868
870
|
}
|
|
869
871
|
declare module "../../feature-gamification/src/queries/leaderboard" {
|
|
870
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
872
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
871
873
|
import { ReadableAtom } from 'nanostores';
|
|
872
874
|
import { ListRequest } from '@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb';
|
|
873
875
|
import { PartialMessage } from '@bufbuild/protobuf';
|
|
@@ -876,15 +878,21 @@ declare module "../../feature-gamification/src/queries/leaderboard" {
|
|
|
876
878
|
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>;
|
|
877
879
|
export const createLeaderboardListFetch: (transport: Transport) => (params: PartialMessage<ListRequest>) => Promise<import("@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb").ListResponse>;
|
|
878
880
|
}
|
|
881
|
+
declare module "../../feature-gamification/src/queries/friends" {
|
|
882
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
883
|
+
import { ReadableAtom } from 'nanostores';
|
|
884
|
+
export const $friends: ($userId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/users/users_pb").GetFriendsResponse_FriendData[], any>;
|
|
885
|
+
}
|
|
879
886
|
declare module "../../feature-gamification/src/queries/moderation" {
|
|
880
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
887
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
881
888
|
import { ReadableAtom } from 'nanostores';
|
|
882
889
|
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>;
|
|
883
890
|
}
|
|
884
891
|
declare module "../../feature-gamification/src/queries/index" {
|
|
885
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
892
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
886
893
|
import { ReadableAtom } from 'nanostores';
|
|
887
894
|
import type { SubscriptionRequest, SubscriptionResponse, VotingSubscriptionRequest, VotingSubscriptionResponse, QuestionSubscriptionRequest, QuestionSubscriptionResponse } from '@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb';
|
|
895
|
+
import { InteractiveAllowed } from "../../feature-gamification/src/background";
|
|
888
896
|
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>;
|
|
889
897
|
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<{
|
|
890
898
|
readonly typeName: "streamlayer.interactive.feed.Feed";
|
|
@@ -1210,17 +1218,17 @@ declare module "../../feature-gamification/src/queries/index" {
|
|
|
1210
1218
|
};
|
|
1211
1219
|
};
|
|
1212
1220
|
}, QuestionSubscriptionRequest, QuestionSubscriptionResponse, "subscription" | "votingSubscription" | "questionSubscription" | "feedSubscription", ((request: import("@bufbuild/protobuf").PartialMessage<SubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions | undefined) => AsyncIterable<SubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<VotingSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions | undefined) => AsyncIterable<VotingSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<QuestionSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions | undefined) => AsyncIterable<QuestionSubscriptionResponse>) | ((request: import("@bufbuild/protobuf").PartialMessage<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionRequest>, options?: import("@connectrpc/connect").CallOptions | undefined) => AsyncIterable<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedSubscriptionResponse>)>;
|
|
1213
|
-
export const getQuestionByUser: (questionId: string, transport: Transport) => Promise<import('../../sdk-web/src/index.ts
|
|
1221
|
+
export const getQuestionByUser: (questionId: string, transport: Transport) => Promise<import('../../sdk-web-types/src/index.ts').ExtendedQuestion | undefined>;
|
|
1214
1222
|
export const getQuestionDetail: (questionId: string, transport: Transport) => Promise<import("@streamlayer/sl-eslib/interactive/interactive.common_pb").Question | undefined>;
|
|
1215
|
-
export const $questionByUser: ($questionId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import('../../sdk-web/src/index.ts
|
|
1223
|
+
export const $questionByUser: ($questionId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import('../../sdk-web-types/src/index.ts').ExtendedQuestion | undefined, any>;
|
|
1216
1224
|
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>;
|
|
1217
|
-
export const $feedList: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").FeedItem[], any>;
|
|
1218
|
-
export const $insightHistory: (slStreamId: ReadableAtom<string | undefined>, transport: Transport) => import("@nanostores/query").FetcherStore<(import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").InsightHistory | undefined)[] | undefined, any>;
|
|
1225
|
+
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>;
|
|
1219
1226
|
export { $userSummary, $leaderboardList } from "../../feature-gamification/src/queries/leaderboard";
|
|
1227
|
+
export { $friends } from "../../feature-gamification/src/queries/friends";
|
|
1220
1228
|
export { $moderation } from "../../feature-gamification/src/queries/moderation";
|
|
1221
1229
|
}
|
|
1222
1230
|
declare module "../../feature-gamification/src/detail" {
|
|
1223
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
1231
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1224
1232
|
import { ReadableAtom } from 'nanostores';
|
|
1225
1233
|
import { getQuestionByUser } from "../../feature-gamification/src/queries/index";
|
|
1226
1234
|
import { type GamificationBackground } from "../../feature-gamification/src/background";
|
|
@@ -1237,12 +1245,16 @@ declare module "../../feature-gamification/src/detail" {
|
|
|
1237
1245
|
};
|
|
1238
1246
|
}
|
|
1239
1247
|
declare module "../../feature-gamification/src/background" {
|
|
1240
|
-
import { ApiStore, type StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
1241
|
-
import type { GetApiResponseType } from '../../sdk-web/src/index.ts
|
|
1248
|
+
import { ApiStore, type StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
1249
|
+
import type { GetApiResponseType } from '../../sdk-web-api/src/index.ts';
|
|
1242
1250
|
import '@streamlayer/sdk-web-core/store';
|
|
1243
1251
|
import { ReadableAtom, WritableAtom } from 'nanostores';
|
|
1244
1252
|
import * as queries from "../../feature-gamification/src/queries/index";
|
|
1245
1253
|
import { detail } from "../../feature-gamification/src/detail";
|
|
1254
|
+
export enum InteractiveAllowed {
|
|
1255
|
+
ALLOWED = "allowed",
|
|
1256
|
+
DISALLOWED = "disallowed"
|
|
1257
|
+
}
|
|
1246
1258
|
/**
|
|
1247
1259
|
* Background class for Gamification feature
|
|
1248
1260
|
*/
|
|
@@ -1253,6 +1265,11 @@ declare module "../../feature-gamification/src/background" {
|
|
|
1253
1265
|
organizationId: ReadableAtom<string | undefined>;
|
|
1254
1266
|
/** current user id */
|
|
1255
1267
|
userId: ReadableAtom<string | undefined>;
|
|
1268
|
+
/**
|
|
1269
|
+
* flag to allow interactive questions (polls, trivia, predictions)
|
|
1270
|
+
* controlled by opt-in and onboarding flags
|
|
1271
|
+
*/
|
|
1272
|
+
interactiveAllowed: WritableAtom<InteractiveAllowed>;
|
|
1256
1273
|
/** opened question, using to download statistics */
|
|
1257
1274
|
openedQuestionId: WritableAtom<string | undefined>;
|
|
1258
1275
|
/** opened question statistics */
|
|
@@ -1298,7 +1315,7 @@ declare module "../../feature-gamification/src/background" {
|
|
|
1298
1315
|
}
|
|
1299
1316
|
}
|
|
1300
1317
|
declare module "../../feature-gamification/src/queries/actions" {
|
|
1301
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
1318
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1302
1319
|
export const submitAnswer: (transport: Transport, data: {
|
|
1303
1320
|
questionId: string;
|
|
1304
1321
|
answerId: string;
|
|
@@ -1307,8 +1324,8 @@ declare module "../../feature-gamification/src/queries/actions" {
|
|
|
1307
1324
|
export const skipQuestion: (transport: Transport, questionId: string) => Promise<import("@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb").SkipQuestionResponse>;
|
|
1308
1325
|
}
|
|
1309
1326
|
declare module "../../feature-gamification/src/onboarding" {
|
|
1310
|
-
import { Transport } from '../../sdk-web/src/index.ts
|
|
1311
|
-
import { type Notifications } from '../../sdk-web/src/index.ts
|
|
1327
|
+
import { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1328
|
+
import { type Notifications } from '../../sdk-web-notifications/src/index.ts';
|
|
1312
1329
|
import { GamificationBackground } from "../../feature-gamification/src/background";
|
|
1313
1330
|
import { Gamification } from "../../feature-gamification/src/index";
|
|
1314
1331
|
/**
|
|
@@ -1332,7 +1349,7 @@ declare module "../../feature-gamification/src/onboarding" {
|
|
|
1332
1349
|
};
|
|
1333
1350
|
}
|
|
1334
1351
|
declare module "../../feature-gamification/src/storage" {
|
|
1335
|
-
import { Storage } from '../../sdk-web/src/index.ts
|
|
1352
|
+
import { Storage } from '../../sdk-web-storage/src/index.ts';
|
|
1336
1353
|
import { OnboardingStatus } from "../../feature-gamification/src/onboarding";
|
|
1337
1354
|
type UserProps = {
|
|
1338
1355
|
userId: string;
|
|
@@ -1348,26 +1365,28 @@ declare module "../../feature-gamification/src/storage" {
|
|
|
1348
1365
|
}
|
|
1349
1366
|
}
|
|
1350
1367
|
declare module "../../feature-gamification/src/leaderboard" {
|
|
1351
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
1368
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1352
1369
|
import { ReadableAtom } from 'nanostores';
|
|
1353
1370
|
import { type LeaderboardItem } from "../../feature-gamification/src/queries/leaderboard";
|
|
1371
|
+
import { Gamification } from "../../feature-gamification/src/index";
|
|
1354
1372
|
type LeaderboardOptions = {
|
|
1355
1373
|
pageSize?: number;
|
|
1356
1374
|
};
|
|
1357
1375
|
type LeaderboardStore = {
|
|
1358
|
-
data
|
|
1376
|
+
data: LeaderboardItem[];
|
|
1359
1377
|
loading?: boolean;
|
|
1378
|
+
key: number;
|
|
1360
1379
|
hasMore: boolean;
|
|
1361
1380
|
error?: string;
|
|
1362
1381
|
};
|
|
1363
|
-
export const leaderboard: (transport: Transport, $eventId: ReadableAtom<string | undefined>, options?: LeaderboardOptions) => {
|
|
1382
|
+
export const leaderboard: (transport: Transport, $eventId: ReadableAtom<string | undefined>, $userId: ReadableAtom<string | undefined>, $friends: Gamification['friends'], options?: LeaderboardOptions) => {
|
|
1364
1383
|
$store: import("nanostores").MapStore<LeaderboardStore>;
|
|
1365
1384
|
fetchMore: (page?: number) => void;
|
|
1366
1385
|
invalidate: () => void;
|
|
1367
1386
|
};
|
|
1368
1387
|
}
|
|
1369
1388
|
declare module "../../feature-gamification/src/queries/deepLink" {
|
|
1370
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
1389
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1371
1390
|
import { ReadableAtom } from 'nanostores';
|
|
1372
1391
|
import { DeepLink } from '@streamlayer/sl-eslib/sdkSettings/client/client_pb';
|
|
1373
1392
|
type EventId = ReadableAtom<string | undefined>;
|
|
@@ -1378,7 +1397,7 @@ declare module "../../feature-gamification/src/queries/deepLink" {
|
|
|
1378
1397
|
}) => Promise<import("@streamlayer/sl-eslib/shortLinks/linksClient_pb").GenerateResponse>;
|
|
1379
1398
|
}
|
|
1380
1399
|
declare module "../../feature-gamification/src/deepLink" {
|
|
1381
|
-
import type { Transport } from '../../sdk-web/src/index.ts
|
|
1400
|
+
import type { Transport } from '../../sdk-web-api/src/index.ts';
|
|
1382
1401
|
import { ReadableAtom } from 'nanostores';
|
|
1383
1402
|
type DeepLinkData = {
|
|
1384
1403
|
data?: string;
|
|
@@ -1391,9 +1410,9 @@ declare module "../../feature-gamification/src/deepLink" {
|
|
|
1391
1410
|
};
|
|
1392
1411
|
}
|
|
1393
1412
|
declare module "../../feature-gamification/src/gamification" {
|
|
1394
|
-
import { AbstractFeature, ApiStore, FeatureSource, type FeatureProps, type StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
1395
|
-
import { type GamesOverlaySettings } from '../../sdk-web/src/index.ts
|
|
1396
|
-
import type { GetApiResponseType } from '../../sdk-web/src/index.ts
|
|
1413
|
+
import { AbstractFeature, ApiStore, FeatureSource, type FeatureProps, type StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
1414
|
+
import { type GamesOverlaySettings } from '../../sdk-web-types/src/index.ts';
|
|
1415
|
+
import type { GetApiResponseType } from '../../sdk-web-api/src/index.ts';
|
|
1397
1416
|
import '@streamlayer/sdk-web-core/store';
|
|
1398
1417
|
import type { PlainMessage } from '@bufbuild/protobuf';
|
|
1399
1418
|
import { WritableAtom } from 'nanostores';
|
|
@@ -1402,7 +1421,7 @@ declare module "../../feature-gamification/src/gamification" {
|
|
|
1402
1421
|
import { deepLink } from "../../feature-gamification/src/deepLink";
|
|
1403
1422
|
import { OnboardingStatus } from "../../feature-gamification/src/onboarding";
|
|
1404
1423
|
import { LeaderboardItem } from "../../feature-gamification/src/queries/leaderboard";
|
|
1405
|
-
import { GamificationBackground } from "../../feature-gamification/src/
|
|
1424
|
+
import { GamificationBackground } from "../../feature-gamification/src/background";
|
|
1406
1425
|
/**
|
|
1407
1426
|
* Gamification (Games) Overlay
|
|
1408
1427
|
* Includes:
|
|
@@ -1417,6 +1436,8 @@ declare module "../../feature-gamification/src/gamification" {
|
|
|
1417
1436
|
userSummary: ApiStore<GetApiResponseType<typeof queries.$userSummary>>;
|
|
1418
1437
|
/** feed list (pick history) */
|
|
1419
1438
|
feedList: ApiStore<GetApiResponseType<typeof queries.$feedList>>;
|
|
1439
|
+
/** friends list */
|
|
1440
|
+
friends: ApiStore<GetApiResponseType<typeof queries.$friends>>;
|
|
1420
1441
|
/** pinned leaderboard id */
|
|
1421
1442
|
leaderboardId: WritableAtom<string | undefined>;
|
|
1422
1443
|
/** leaderboard list */
|
|
@@ -1442,6 +1463,8 @@ declare module "../../feature-gamification/src/gamification" {
|
|
|
1442
1463
|
/** Browser cache */
|
|
1443
1464
|
private storage;
|
|
1444
1465
|
constructor(config: FeatureProps, source: FeatureSource, instance: StreamLayerContext);
|
|
1466
|
+
get isInteractiveAllowed(): boolean;
|
|
1467
|
+
checkInteractiveFlag: () => void;
|
|
1445
1468
|
connect: (transport: StreamLayerContext['transport']) => void;
|
|
1446
1469
|
disconnect: () => void;
|
|
1447
1470
|
submitAnswer: (questionId: string, answerId: string) => Promise<void>;
|
|
@@ -1450,6 +1473,13 @@ declare module "../../feature-gamification/src/gamification" {
|
|
|
1450
1473
|
closeQuestion: (questionId?: string) => void;
|
|
1451
1474
|
openUser: (userId: string) => void;
|
|
1452
1475
|
closeUser: () => void;
|
|
1476
|
+
/**
|
|
1477
|
+
* Show in-app notification for active question
|
|
1478
|
+
* for interactive questions we show notification only if interactiveAllowed
|
|
1479
|
+
* for factoid and tweet questions we show notification always
|
|
1480
|
+
* skipping questions with inAppSilence === ON
|
|
1481
|
+
*/
|
|
1482
|
+
private showInApp;
|
|
1453
1483
|
}
|
|
1454
1484
|
}
|
|
1455
1485
|
declare module "../../feature-gamification/src/index" {
|
|
@@ -1462,8 +1492,8 @@ declare module "../../feature-gamification/src/index" {
|
|
|
1462
1492
|
}
|
|
1463
1493
|
}
|
|
1464
1494
|
declare module "../../sdk-web-features/src/index" {
|
|
1465
|
-
import { FeatureType } from '../../sdk-web/src/index.ts
|
|
1466
|
-
import { AbstractFeature, FeatureSource, FeatureProps, StreamLayerContext, SingleStore } from '../../sdk-web/src/index.ts
|
|
1495
|
+
import { FeatureType } from '../../sdk-web-types/src/index.ts';
|
|
1496
|
+
import { AbstractFeature, FeatureSource, FeatureProps, StreamLayerContext, SingleStore } from '../../sdk-web-interfaces/src/index.ts';
|
|
1467
1497
|
import { Gamification } from '../../feature-gamification/src/index.ts';
|
|
1468
1498
|
export type Features = Feature | Gamification;
|
|
1469
1499
|
export const AvailableFeatures: {
|
|
@@ -1473,7 +1503,7 @@ declare module "../../sdk-web-features/src/index" {
|
|
|
1473
1503
|
constructor(overlay: FeatureProps, source: FeatureSource);
|
|
1474
1504
|
}
|
|
1475
1505
|
export const initFeature: (overlay: FeatureProps, source: FeatureSource, instance: StreamLayerContext) => Gamification | Feature;
|
|
1476
|
-
export { FeatureSource } from '../../sdk-web/src/index.ts
|
|
1506
|
+
export { FeatureSource } from '../../sdk-web-interfaces/src/index.ts';
|
|
1477
1507
|
module '@streamlayer/sdk-web-interfaces' {
|
|
1478
1508
|
interface StreamLayerContext {
|
|
1479
1509
|
features: Map<FeatureType, Features>;
|
|
@@ -1493,7 +1523,7 @@ declare module "../../sdk-web-features/src/index" {
|
|
|
1493
1523
|
export const features: (instance: StreamLayerContext, opts: unknown, done: () => void) => void;
|
|
1494
1524
|
}
|
|
1495
1525
|
declare module "../../sdk-web/src/index" {
|
|
1496
|
-
import { StreamLayerContext } from '../../sdk-web/src/index.ts
|
|
1526
|
+
import { StreamLayerContext } from '../../sdk-web-interfaces/src/index.ts';
|
|
1497
1527
|
import avvio from 'avvio';
|
|
1498
1528
|
export type StreamLayerInstance = avvio.mixedInstance<StreamLayerContext>;
|
|
1499
1529
|
export type StreamLayerPlugin = (instance: StreamLayerContext, opts: unknown, done: DoneFn) => void;
|
|
@@ -1503,7 +1533,7 @@ declare module "../../sdk-web/src/index" {
|
|
|
1503
1533
|
}): avvio.Avvio<StreamLayerContext>;
|
|
1504
1534
|
}
|
|
1505
1535
|
declare module "app/useStreamLayerApp" {
|
|
1506
|
-
import type { StreamLayerSDK, StreamLayerPlugin } from '../../sdk-web/src/index.ts
|
|
1536
|
+
import type { StreamLayerSDK, StreamLayerPlugin } from '../../sdk-web-interfaces/src/index.ts';
|
|
1507
1537
|
global {
|
|
1508
1538
|
interface Window {
|
|
1509
1539
|
sl: unknown;
|
|
@@ -1512,7 +1542,7 @@ declare module "app/useStreamLayerApp" {
|
|
|
1512
1542
|
export const useStreamLayerApp: (sdkKey: string, plugins?: Set<StreamLayerPlugin>, production?: boolean, autoEnable?: boolean) => StreamLayerSDK | null;
|
|
1513
1543
|
}
|
|
1514
1544
|
declare module "app/provider" {
|
|
1515
|
-
import type { StreamLayerSDK, StreamLayerPlugin } from '../../sdk-web/src/index.ts
|
|
1545
|
+
import type { StreamLayerSDK, StreamLayerPlugin } from '../../sdk-web-interfaces/src/index.ts';
|
|
1516
1546
|
export enum StreamLayerStatus {
|
|
1517
1547
|
UNSET = 0,
|
|
1518
1548
|
CONNECTED = 1,
|
|
@@ -1535,7 +1565,7 @@ declare module "app/provider" {
|
|
|
1535
1565
|
declare module "app/masters" {
|
|
1536
1566
|
import { StreamLayerProps } from "app/provider";
|
|
1537
1567
|
import '@streamlayer/react-ui/style.css';
|
|
1538
|
-
export const MastersStreamLayerProvider: React.FC<StreamLayerProps & {
|
|
1568
|
+
export const MastersStreamLayerProvider: React.FC<Omit<StreamLayerProps, 'autoEnable'> & {
|
|
1539
1569
|
children: React.ReactNode;
|
|
1540
1570
|
}>;
|
|
1541
1571
|
type Overlays = {
|
|
@@ -1552,7 +1582,7 @@ declare module "app/masters" {
|
|
|
1552
1582
|
export const MastersStreamLayerSDKReact: React.FC<MastersAppProps>;
|
|
1553
1583
|
}
|
|
1554
1584
|
declare module "app/app" {
|
|
1555
|
-
import type { StreamLayerSDK } from '../../sdk-web/src/index.ts
|
|
1585
|
+
import type { StreamLayerSDK } from '../../sdk-web-interfaces/src/index.ts';
|
|
1556
1586
|
export const useStreamLayer: () => StreamLayerSDK | null;
|
|
1557
1587
|
export const StreamLayerSDKReact: React.FC;
|
|
1558
1588
|
}
|