@atlaskit/collab-provider 8.8.1 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/analytics/analytics-helper.js +21 -12
- package/dist/cjs/channel.js +5 -3
- package/dist/cjs/document/document-service.js +1 -1
- package/dist/cjs/errors/error-code-mapper.js +9 -2
- package/dist/cjs/namespace/namespace-service.js +77 -0
- package/dist/cjs/participants/participants-helper.js +2 -0
- package/dist/cjs/participants/participants-service.js +94 -30
- package/dist/cjs/provider/index.js +91 -173
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/analytics-helper.js +21 -12
- package/dist/es2019/channel.js +5 -3
- package/dist/es2019/document/document-service.js +1 -1
- package/dist/es2019/errors/error-code-mapper.js +9 -2
- package/dist/es2019/namespace/namespace-service.js +48 -0
- package/dist/es2019/participants/participants-helper.js +2 -0
- package/dist/es2019/participants/participants-service.js +88 -30
- package/dist/es2019/provider/index.js +82 -145
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/analytics-helper.js +21 -12
- package/dist/esm/channel.js +5 -3
- package/dist/esm/document/document-service.js +1 -1
- package/dist/esm/errors/error-code-mapper.js +9 -2
- package/dist/esm/namespace/namespace-service.js +69 -0
- package/dist/esm/participants/participants-helper.js +2 -0
- package/dist/esm/participants/participants-service.js +94 -30
- package/dist/esm/provider/index.js +91 -173
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/channel.d.ts +1 -1
- package/dist/types/errors/error-types.d.ts +37 -37
- package/dist/types/feature-flags/types.d.ts +4 -4
- package/dist/types/helpers/const.d.ts +19 -19
- package/dist/types/helpers/utils.d.ts +2 -2
- package/dist/types/metadata/metadata-service.d.ts +1 -1
- package/dist/types/namespace/namespace-service.d.ts +14 -0
- package/dist/types/participants/participants-helper.d.ts +5 -7
- package/dist/types/participants/participants-service.d.ts +40 -16
- package/dist/types/provider/commit-step.d.ts +2 -2
- package/dist/types/provider/index.d.ts +21 -37
- package/dist/types/types.d.ts +28 -28
- package/dist/{types-ts4.0 → types-ts4.5}/channel.d.ts +1 -1
- package/dist/{types-ts4.0 → types-ts4.5}/errors/error-types.d.ts +37 -37
- package/dist/types-ts4.5/feature-flags/types.d.ts +13 -0
- package/dist/{types-ts4.0 → types-ts4.5}/helpers/const.d.ts +19 -19
- package/dist/{types-ts4.0 → types-ts4.5}/helpers/utils.d.ts +2 -2
- package/dist/{types-ts4.0 → types-ts4.5}/metadata/metadata-service.d.ts +1 -1
- package/dist/types-ts4.5/namespace/namespace-service.d.ts +14 -0
- package/dist/types-ts4.5/participants/participants-helper.d.ts +12 -0
- package/dist/types-ts4.5/participants/participants-service.d.ts +94 -0
- package/dist/{types-ts4.0 → types-ts4.5}/provider/commit-step.d.ts +2 -2
- package/dist/{types-ts4.0 → types-ts4.5}/provider/index.d.ts +21 -37
- package/dist/{types-ts4.0 → types-ts4.5}/types.d.ts +28 -28
- package/package.json +13 -5
- package/report.api.md +4 -2
- package/socket-io-provider/package.json +2 -2
- package/types/package.json +2 -2
- package/version-wrapper/package.json +2 -2
- package/dist/types-ts4.0/feature-flags/types.d.ts +0 -13
- package/dist/types-ts4.0/participants/participants-helper.d.ts +0 -14
- package/dist/types-ts4.0/participants/participants-service.d.ts +0 -70
- /package/dist/{types-ts4.0 → types-ts4.5}/analytics/analytics-helper.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/analytics/performance.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/analytics/ufo.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/config.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/connectivity/network.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/connectivity/reconnect-helper.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/connectivity/singleton.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/disconnected-reason-mapper.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/document/catchup.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/document/document-service.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/document/step-queue-state.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/emitter.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/errors/error-code-mapper.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/feature-flags/__test__/index.unit.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/feature-flags/index.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/index.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/participants/participants-state.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/participants/telepointers-helper.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/socket-io-provider.d.ts +0 -0
- /package/dist/{types-ts4.0 → types-ts4.5}/version-wrapper.d.ts +0 -0
package/types/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface NCSFeatureFlags {
|
|
2
|
-
testFF?: boolean;
|
|
3
|
-
}
|
|
4
|
-
export interface WithNCSFeatureFlags {
|
|
5
|
-
featureFlags?: NCSFeatureFlags;
|
|
6
|
-
}
|
|
7
|
-
export declare type RequiredNCSFeatureFlags = Record<keyof Required<NCSFeatureFlags>, boolean>;
|
|
8
|
-
export declare type NCSFeatureFlagsMap = Record<keyof Required<NCSFeatureFlags>, string>;
|
|
9
|
-
export declare const supportedProducts: readonly [
|
|
10
|
-
"confluence"
|
|
11
|
-
];
|
|
12
|
-
export declare type SupportedProduct = (typeof supportedProducts)[number];
|
|
13
|
-
export declare type ProductKeys = Record<SupportedProduct, NCSFeatureFlagsMap>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CollabEventPresenceData, CollabParticipant } from '@atlaskit/editor-common/collab';
|
|
2
|
-
import type { CollabEventTelepointerData, PresencePayload } from '../types';
|
|
3
|
-
export declare const PARTICIPANT_UPDATE_INTERVAL: number;
|
|
4
|
-
export declare type ProviderParticipant = CollabParticipant & {
|
|
5
|
-
userId: string;
|
|
6
|
-
clientId: number | string;
|
|
7
|
-
};
|
|
8
|
-
export declare type ParticipantsMap = Map<string, ProviderParticipant>;
|
|
9
|
-
export declare type PresenceEmit = (evt: 'presence', data: CollabEventPresenceData) => void;
|
|
10
|
-
export declare type TelepointerEmit = (evt: 'telepointer', data: CollabEventTelepointerData) => void;
|
|
11
|
-
export declare type GetUserType = ((userId: string) => Promise<Pick<ProviderParticipant, 'name' | 'avatar' | 'userId'>>) | undefined;
|
|
12
|
-
export declare const createParticipantFromPayload: (payload: PresencePayload & {
|
|
13
|
-
userId: string;
|
|
14
|
-
}, getUser: GetUserType) => Promise<ProviderParticipant>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { CollabEventPresenceData, CollabEventDisconnectedData } from '@atlaskit/editor-common/collab';
|
|
2
|
-
import AnalyticsHelper from '../analytics/analytics-helper';
|
|
3
|
-
import type { CollabEventTelepointerData, PresencePayload, StepJson, TelepointerPayload } from '../types';
|
|
4
|
-
import { GetUserType, TelepointerEmit } from './participants-helper';
|
|
5
|
-
import type { PresenceEmit } from './participants-helper';
|
|
6
|
-
import { ParticipantsState } from './participants-state';
|
|
7
|
-
export declare class ParticipantsService {
|
|
8
|
-
private participantsState;
|
|
9
|
-
private participantUpdateTimeout;
|
|
10
|
-
private analyticsHelper;
|
|
11
|
-
constructor(analyticsHelper: AnalyticsHelper | undefined, participantsState?: ParticipantsState);
|
|
12
|
-
/**
|
|
13
|
-
* Carries out 3 things: 1) enriches the participant with user data, 2) updates the participantsState, 3) emits the presence event
|
|
14
|
-
* @param payload Payload from incoming socket event
|
|
15
|
-
* @param getUser Function to get user data from confluence
|
|
16
|
-
* @param emit Function to execute emit from provider socket
|
|
17
|
-
* @returns Awaitable Promise, due to getUser
|
|
18
|
-
*/
|
|
19
|
-
updateParticipant: (payload: PresencePayload, getUser: GetUserType, emit: PresenceEmit) => Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Called when a participant leaves the session.
|
|
22
|
-
*
|
|
23
|
-
* We emit the `presence` event to update the active avatars in the editor.
|
|
24
|
-
*/
|
|
25
|
-
participantLeft: ({ sessionId }: PresencePayload, emit: PresenceEmit) => void;
|
|
26
|
-
disconnect: (reason: string, sessionId: string | undefined, emit: (evt: 'presence' | 'disconnected', data: CollabEventPresenceData | CollabEventDisconnectedData) => void) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Updates when users were last active
|
|
29
|
-
* @param userIds Users in most recent steps
|
|
30
|
-
*/
|
|
31
|
-
updateLastActive: (userIds?: string[]) => void;
|
|
32
|
-
/**
|
|
33
|
-
* Called on receiving steps, emits each step's telepointer
|
|
34
|
-
* @param steps Steps to extract telepointers from
|
|
35
|
-
* @param emit Provider emit function
|
|
36
|
-
*/
|
|
37
|
-
emitTelepointersFromSteps(steps: StepJson[], emit: TelepointerEmit): void;
|
|
38
|
-
/**
|
|
39
|
-
* Called when we receive a telepointer update from another
|
|
40
|
-
* participant.
|
|
41
|
-
*/
|
|
42
|
-
participantTelepointer: (payload: TelepointerPayload, thisSessionId: string | undefined, getUser: GetUserType, emit: (evt: 'telepointer' | 'presence', data: CollabEventTelepointerData | CollabEventPresenceData) => void) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Every 5 minutes (PARTICIPANT_UPDATE_INTERVAL), removes inactive participants and emits the update to other participants.
|
|
45
|
-
* Needs to be kicked off in the Provider.
|
|
46
|
-
* @param sessionId SessionId from provider's connection
|
|
47
|
-
* @param emit Function to execute emit from provider socket
|
|
48
|
-
*/
|
|
49
|
-
removeInactiveParticipants: (sessionId: string | undefined, emit: PresenceEmit) => void;
|
|
50
|
-
/**
|
|
51
|
-
* Keep list of participants up to date. Filter out inactive users etc.
|
|
52
|
-
*/
|
|
53
|
-
private filterInactive;
|
|
54
|
-
/**
|
|
55
|
-
* Wrapper function to emit with error handling and analytics
|
|
56
|
-
* @param data Data to emit
|
|
57
|
-
* @param emit Emit function from Provider
|
|
58
|
-
*/
|
|
59
|
-
private emitPresence;
|
|
60
|
-
/**
|
|
61
|
-
* Wrapper function to emit with error handling and analytics
|
|
62
|
-
* @param data Data to emit
|
|
63
|
-
* @param emit Emit function from Provider
|
|
64
|
-
*/
|
|
65
|
-
private emitTelepointer;
|
|
66
|
-
/**
|
|
67
|
-
* Used when the provider is disconnected or destroyed to prevent perpetual timers from continuously running
|
|
68
|
-
*/
|
|
69
|
-
clearTimers: () => void;
|
|
70
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|