@crowdedkingdomstudios/crowdyjs 4.0.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/crowdy-client.d.ts +8 -0
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +6 -0
- package/dist/domains/apps.d.ts +13 -2
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +5 -2
- package/dist/domains/channels.d.ts +34 -0
- package/dist/domains/channels.d.ts.map +1 -0
- package/dist/domains/channels.js +94 -0
- package/dist/domains/gameModel.d.ts +40 -0
- package/dist/domains/gameModel.d.ts.map +1 -0
- package/dist/domains/gameModel.js +114 -0
- package/dist/domains/platform.d.ts +33 -0
- package/dist/domains/platform.d.ts.map +1 -0
- package/dist/domains/platform.js +39 -0
- package/dist/domains/udp.d.ts +9 -1
- package/dist/domains/udp.d.ts.map +1 -1
- package/dist/domains/udp.js +12 -1
- package/dist/generated/graphql.d.ts +1810 -31
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +68 -3
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/realtime.d.ts +3 -0
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +3 -0
- package/package.json +2 -3
package/dist/crowdy-client.d.ts
CHANGED
|
@@ -29,13 +29,16 @@ import { WorldClient } from './world.js';
|
|
|
29
29
|
import { AuthAPI } from './domains/auth.js';
|
|
30
30
|
import { UsersAPI } from './domains/users.js';
|
|
31
31
|
import { AppsAPI } from './domains/apps.js';
|
|
32
|
+
import { PlatformAPI } from './domains/platform.js';
|
|
32
33
|
import { ChunksAPI } from './domains/chunks.js';
|
|
33
34
|
import { VoxelsAPI } from './domains/voxels.js';
|
|
34
35
|
import { ActorsAPI } from './domains/actors.js';
|
|
35
36
|
import { TeleportAPI } from './domains/teleport.js';
|
|
36
37
|
import { StateAPI } from './domains/state.js';
|
|
37
38
|
import { ServerStatusAPI } from './domains/serverStatus.js';
|
|
39
|
+
import { ChannelsAPI } from './domains/channels.js';
|
|
38
40
|
import { UdpAPI } from './domains/udp.js';
|
|
41
|
+
import { GameModelAPI } from './domains/gameModel.js';
|
|
39
42
|
export interface CrowdyClientConfig {
|
|
40
43
|
/** game-api HTTP root (e.g. `https://dev-game-api.crowdedkingdoms.com`). */
|
|
41
44
|
httpUrl?: string;
|
|
@@ -77,13 +80,18 @@ export declare class CrowdyClient {
|
|
|
77
80
|
readonly auth: AuthAPI;
|
|
78
81
|
readonly users: UsersAPI;
|
|
79
82
|
readonly apps: AppsAPI;
|
|
83
|
+
/** Public platform discovery (shared game-api URL, free app quota). */
|
|
84
|
+
readonly platform: PlatformAPI;
|
|
80
85
|
readonly chunks: ChunksAPI;
|
|
81
86
|
readonly voxels: VoxelsAPI;
|
|
82
87
|
readonly actors: ActorsAPI;
|
|
83
88
|
readonly teleport: TeleportAPI;
|
|
84
89
|
readonly state: StateAPI;
|
|
85
90
|
readonly serverStatus: ServerStatusAPI;
|
|
91
|
+
readonly channels: ChannelsAPI;
|
|
86
92
|
readonly udp: UdpAPI;
|
|
93
|
+
/** Abstract game model: containers, properties, functions, sessions. */
|
|
94
|
+
readonly gameModel: GameModelAPI;
|
|
87
95
|
constructor(config?: CrowdyClientConfig);
|
|
88
96
|
/** Imperatively set the Bearer token (useful for SSO / token rehydrate). */
|
|
89
97
|
setToken(token: string | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crowdy-client.d.ts","sourceRoot":"","sources":["../src/crowdy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,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UsersAPI } from './domains/users.js';
|
|
29
29
|
import { AppsAPI } from './domains/apps.js';
|
|
30
|
+
import { PlatformAPI } from './domains/platform.js';
|
|
30
31
|
import { ChunksAPI } from './domains/chunks.js';
|
|
31
32
|
import { VoxelsAPI } from './domains/voxels.js';
|
|
32
33
|
import { ActorsAPI } from './domains/actors.js';
|
|
33
34
|
import { TeleportAPI } from './domains/teleport.js';
|
|
34
35
|
import { StateAPI } from './domains/state.js';
|
|
35
36
|
import { ServerStatusAPI } from './domains/serverStatus.js';
|
|
37
|
+
import { ChannelsAPI } from './domains/channels.js';
|
|
36
38
|
import { UdpAPI } from './domains/udp.js';
|
|
39
|
+
import { GameModelAPI } from './domains/gameModel.js';
|
|
37
40
|
export class CrowdyClient {
|
|
38
41
|
constructor(config = {}) {
|
|
39
42
|
this.session = new AuthState(config.tokenStore);
|
|
@@ -64,13 +67,16 @@ export class CrowdyClient {
|
|
|
64
67
|
this.auth = new AuthAPI(this.management, this.session);
|
|
65
68
|
this.users = new UsersAPI(this.management);
|
|
66
69
|
this.apps = new AppsAPI(this.management);
|
|
70
|
+
this.platform = new PlatformAPI(this.management);
|
|
67
71
|
this.chunks = new ChunksAPI(this.graphql);
|
|
68
72
|
this.voxels = new VoxelsAPI(this.graphql);
|
|
69
73
|
this.actors = new ActorsAPI(this.graphql);
|
|
70
74
|
this.teleport = new TeleportAPI(this.graphql);
|
|
71
75
|
this.state = new StateAPI(this.graphql);
|
|
72
76
|
this.serverStatus = new ServerStatusAPI(this.graphql);
|
|
77
|
+
this.channels = new ChannelsAPI(this.graphql);
|
|
73
78
|
this.udp = new UdpAPI(this.graphql, this.realtime);
|
|
79
|
+
this.gameModel = new GameModelAPI(this.graphql);
|
|
74
80
|
}
|
|
75
81
|
/** Imperatively set the Bearer token (useful for SSO / token rehydrate). */
|
|
76
82
|
setToken(token) {
|
package/dist/domains/apps.d.ts
CHANGED
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* await baseClient.auth.login({ email, password });
|
|
14
14
|
*
|
|
15
15
|
* const route = await baseClient.apps.routeFor(appId);
|
|
16
|
-
* if (route.
|
|
16
|
+
* if (route.gameApiUrl) {
|
|
17
|
+
* // Set for both dedicated (split-mode) AND shared-environment apps.
|
|
17
18
|
* const perAppClient = createCrowdyClient({
|
|
18
19
|
* managementUrl: 'https://api.example.com',
|
|
19
20
|
* httpUrl: route.gameApiUrl,
|
|
20
|
-
* wsUrl: route.gameApiUrl.replace(/^
|
|
21
|
+
* wsUrl: route.gameApiUrl.replace(/^http/, 'ws'),
|
|
21
22
|
* tokenStore: baseClient.session.tokenStore,
|
|
22
23
|
* });
|
|
23
24
|
* // drive gameplay through perAppClient
|
|
@@ -33,6 +34,16 @@ import { type AppQuery, type AppBySlugQuery, type MyAppsQuery } from '../generat
|
|
|
33
34
|
export interface AppRoute {
|
|
34
35
|
appId: string;
|
|
35
36
|
splitMode: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 'none' (draft), 'shared' (the shared game-api), or 'dedicated' (a
|
|
39
|
+
* per-tenant environment). Populated once the schema/codegen expose it.
|
|
40
|
+
*/
|
|
41
|
+
deploymentTarget: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* The game-api URL to route gameplay to. Set for BOTH dedicated (split-mode)
|
|
44
|
+
* and shared-environment apps. When non-null, build a game-api client
|
|
45
|
+
* against it; when null, fall back to the constructor `httpUrl`.
|
|
46
|
+
*/
|
|
36
47
|
gameApiUrl: string | null;
|
|
37
48
|
}
|
|
38
49
|
export declare class AppsAPI {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/domains/apps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/domains/apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAIL,KAAK,QAAQ,EAEb,KAAK,cAAc,EAEnB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAgBD,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,aAAa;IAEtD,gCAAgC;IAC1B,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAQlD,wDAAwD;IAClD,SAAS,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAQvC,kEAAkE;IAC5D,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAQ9C;;;;;OAKG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAWjD"}
|
package/dist/domains/apps.js
CHANGED
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* await baseClient.auth.login({ email, password });
|
|
14
14
|
*
|
|
15
15
|
* const route = await baseClient.apps.routeFor(appId);
|
|
16
|
-
* if (route.
|
|
16
|
+
* if (route.gameApiUrl) {
|
|
17
|
+
* // Set for both dedicated (split-mode) AND shared-environment apps.
|
|
17
18
|
* const perAppClient = createCrowdyClient({
|
|
18
19
|
* managementUrl: 'https://api.example.com',
|
|
19
20
|
* httpUrl: route.gameApiUrl,
|
|
20
|
-
* wsUrl: route.gameApiUrl.replace(/^
|
|
21
|
+
* wsUrl: route.gameApiUrl.replace(/^http/, 'ws'),
|
|
21
22
|
* tokenStore: baseClient.session.tokenStore,
|
|
22
23
|
* });
|
|
23
24
|
* // drive gameplay through perAppClient
|
|
@@ -33,6 +34,7 @@ function appRouteFromAppRow(row) {
|
|
|
33
34
|
return {
|
|
34
35
|
appId: r.appId,
|
|
35
36
|
splitMode: typeof r.splitMode === 'boolean' ? r.splitMode : false,
|
|
37
|
+
deploymentTarget: typeof r.deploymentTarget === 'string' ? r.deploymentTarget : null,
|
|
36
38
|
gameApiUrl: typeof r.gameApiUrl === 'string' && r.gameApiUrl ? r.gameApiUrl : null,
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -66,6 +68,7 @@ export class AppsAPI {
|
|
|
66
68
|
return (appRouteFromAppRow(row) ?? {
|
|
67
69
|
appId,
|
|
68
70
|
splitMode: false,
|
|
71
|
+
deploymentTarget: null,
|
|
69
72
|
gameApiUrl: null,
|
|
70
73
|
});
|
|
71
74
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type MyChannelsQuery, type MyChannelsQueryVariables, type ChannelsQuery, type ChannelsQueryVariables, type ChannelQuery, type ChannelQueryVariables, type ChannelMembersQuery, type ChannelMembersQueryVariables, type ChannelRolesQuery, type ChannelRolesQueryVariables, type ChannelPolicyQuery, type ChannelPolicyQueryVariables, type SetChannelPolicyMutation, type SetChannelPolicyMutationVariables, type CreateChannelMutation, type CreateChannelMutationVariables, type UpdateChannelMutation, type UpdateChannelMutationVariables, type DeleteChannelMutationVariables, type JoinChannelMutation, type JoinChannelMutationVariables, type RequestToJoinChannelMutation, type RequestToJoinChannelMutationVariables, type LeaveChannelMutationVariables, type AddChannelMemberMutation, type AddChannelMemberMutationVariables, type RemoveChannelMemberMutationVariables, type SetChannelMemberRolesMutation, type SetChannelMemberRolesMutationVariables, type CreateChannelRoleMutation, type CreateChannelRoleMutationVariables, type UpdateChannelRoleMutation, type UpdateChannelRoleMutationVariables, type DeleteChannelRoleMutationVariables } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* Channels: app-scoped player groups with role-gated messaging, built on the
|
|
5
|
+
* same generic groups subsystem as Teams (group_type='channel'). Channel
|
|
6
|
+
* CRUD/membership runs over the game-api GraphQL endpoint; publishing and
|
|
7
|
+
* receiving channel messages happens over the realtime UDP path (`client.udp`).
|
|
8
|
+
*
|
|
9
|
+
* Exposed as `client.channels`.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ChannelsAPI {
|
|
12
|
+
private gql;
|
|
13
|
+
constructor(gql: GraphQLClient);
|
|
14
|
+
mine(appId: MyChannelsQueryVariables['appId']): Promise<MyChannelsQuery['myChannels']>;
|
|
15
|
+
list(appId: ChannelsQueryVariables['appId']): Promise<ChannelsQuery['channels']>;
|
|
16
|
+
get(groupId: ChannelQueryVariables['groupId']): Promise<ChannelQuery['channel']>;
|
|
17
|
+
members(groupId: ChannelMembersQueryVariables['groupId']): Promise<ChannelMembersQuery['channelMembers']>;
|
|
18
|
+
roles(groupId: ChannelRolesQueryVariables['groupId']): Promise<ChannelRolesQuery['channelRoles']>;
|
|
19
|
+
policy(appId: ChannelPolicyQueryVariables['appId']): Promise<ChannelPolicyQuery['channelPolicy']>;
|
|
20
|
+
create(input: CreateChannelMutationVariables['input']): Promise<CreateChannelMutation['createChannel']>;
|
|
21
|
+
update(input: UpdateChannelMutationVariables['input']): Promise<UpdateChannelMutation['updateChannel']>;
|
|
22
|
+
remove(groupId: DeleteChannelMutationVariables['groupId']): Promise<boolean>;
|
|
23
|
+
setPolicy(input: SetChannelPolicyMutationVariables['input']): Promise<SetChannelPolicyMutation['setChannelPolicy']>;
|
|
24
|
+
join(groupId: JoinChannelMutationVariables['groupId']): Promise<JoinChannelMutation['joinChannel']>;
|
|
25
|
+
requestToJoin(groupId: RequestToJoinChannelMutationVariables['groupId']): Promise<RequestToJoinChannelMutation['requestToJoinChannel']>;
|
|
26
|
+
leave(groupId: LeaveChannelMutationVariables['groupId']): Promise<boolean>;
|
|
27
|
+
addMember(groupId: AddChannelMemberMutationVariables['groupId'], userId: AddChannelMemberMutationVariables['userId']): Promise<AddChannelMemberMutation['addChannelMember']>;
|
|
28
|
+
removeMember(groupId: RemoveChannelMemberMutationVariables['groupId'], userId: RemoveChannelMemberMutationVariables['userId']): Promise<boolean>;
|
|
29
|
+
setMemberRoles(input: SetChannelMemberRolesMutationVariables['input']): Promise<SetChannelMemberRolesMutation['setChannelMemberRoles']>;
|
|
30
|
+
createRole(input: CreateChannelRoleMutationVariables['input']): Promise<CreateChannelRoleMutation['createChannelRole']>;
|
|
31
|
+
updateRole(input: UpdateChannelRoleMutationVariables['input']): Promise<UpdateChannelRoleMutation['updateChannelRole']>;
|
|
32
|
+
deleteRole(groupRoleId: DeleteChannelRoleMutationVariables['groupRoleId']): Promise<boolean>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/domains/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAE7B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAE3B,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE1B,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAE/B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,8BAA8B,EAEnC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,6BAA6B,EAElC,KAAK,wBAAwB,EAC7B,K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esDocument, ChannelPolicyDocument, SetChannelPolicyDocument, CreateChannelDocument, UpdateChannelDocument, DeleteChannelDocument, JoinChannelDocument, RequestToJoinChannelDocument, LeaveChannelDocument, AddChannelMemberDocument, RemoveChannelMemberDocument, SetChannelMemberRolesDocument, CreateChannelRoleDocument, UpdateChannelRoleDocument, DeleteChannelRoleDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* Channels: app-scoped player groups with role-gated messaging, built on the
|
|
4
|
+
* same generic groups subsystem as Teams (group_type='channel'). Channel
|
|
5
|
+
* CRUD/membership runs over the game-api GraphQL endpoint; publishing and
|
|
6
|
+
* receiving channel messages happens over the realtime UDP path (`client.udp`).
|
|
7
|
+
*
|
|
8
|
+
* Exposed as `client.channels`.
|
|
9
|
+
*/
|
|
10
|
+
export class ChannelsAPI {
|
|
11
|
+
constructor(gql) {
|
|
12
|
+
this.gql = gql;
|
|
13
|
+
}
|
|
14
|
+
// -- Queries --------------------------------------------------------------
|
|
15
|
+
async mine(appId) {
|
|
16
|
+
const data = await this.gql.request(MyChannelsDocument, { appId });
|
|
17
|
+
return data.myChannels;
|
|
18
|
+
}
|
|
19
|
+
async list(appId) {
|
|
20
|
+
const data = await this.gql.request(ChannelsDocument, { appId });
|
|
21
|
+
return data.channels;
|
|
22
|
+
}
|
|
23
|
+
async get(groupId) {
|
|
24
|
+
const data = await this.gql.request(ChannelDocument, { groupId });
|
|
25
|
+
return data.channel;
|
|
26
|
+
}
|
|
27
|
+
async members(groupId) {
|
|
28
|
+
const data = await this.gql.request(ChannelMembersDocument, { groupId });
|
|
29
|
+
return data.channelMembers;
|
|
30
|
+
}
|
|
31
|
+
async roles(groupId) {
|
|
32
|
+
const data = await this.gql.request(ChannelRolesDocument, { groupId });
|
|
33
|
+
return data.channelRoles;
|
|
34
|
+
}
|
|
35
|
+
async policy(appId) {
|
|
36
|
+
const data = await this.gql.request(ChannelPolicyDocument, { appId });
|
|
37
|
+
return data.channelPolicy;
|
|
38
|
+
}
|
|
39
|
+
// -- Channel mutations ----------------------------------------------------
|
|
40
|
+
async create(input) {
|
|
41
|
+
const data = await this.gql.request(CreateChannelDocument, { input });
|
|
42
|
+
return data.createChannel;
|
|
43
|
+
}
|
|
44
|
+
async update(input) {
|
|
45
|
+
const data = await this.gql.request(UpdateChannelDocument, { input });
|
|
46
|
+
return data.updateChannel;
|
|
47
|
+
}
|
|
48
|
+
async remove(groupId) {
|
|
49
|
+
const data = await this.gql.request(DeleteChannelDocument, { groupId });
|
|
50
|
+
return data.deleteChannel;
|
|
51
|
+
}
|
|
52
|
+
async setPolicy(input) {
|
|
53
|
+
const data = await this.gql.request(SetChannelPolicyDocument, { input });
|
|
54
|
+
return data.setChannelPolicy;
|
|
55
|
+
}
|
|
56
|
+
// -- Membership mutations -------------------------------------------------
|
|
57
|
+
async join(groupId) {
|
|
58
|
+
const data = await this.gql.request(JoinChannelDocument, { groupId });
|
|
59
|
+
return data.joinChannel;
|
|
60
|
+
}
|
|
61
|
+
async requestToJoin(groupId) {
|
|
62
|
+
const data = await this.gql.request(RequestToJoinChannelDocument, { groupId });
|
|
63
|
+
return data.requestToJoinChannel;
|
|
64
|
+
}
|
|
65
|
+
async leave(groupId) {
|
|
66
|
+
const data = await this.gql.request(LeaveChannelDocument, { groupId });
|
|
67
|
+
return data.leaveChannel;
|
|
68
|
+
}
|
|
69
|
+
async addMember(groupId, userId) {
|
|
70
|
+
const data = await this.gql.request(AddChannelMemberDocument, { groupId, userId });
|
|
71
|
+
return data.addChannelMember;
|
|
72
|
+
}
|
|
73
|
+
async removeMember(groupId, userId) {
|
|
74
|
+
const data = await this.gql.request(RemoveChannelMemberDocument, { groupId, userId });
|
|
75
|
+
return data.removeChannelMember;
|
|
76
|
+
}
|
|
77
|
+
async setMemberRoles(input) {
|
|
78
|
+
const data = await this.gql.request(SetChannelMemberRolesDocument, { input });
|
|
79
|
+
return data.setChannelMemberRoles;
|
|
80
|
+
}
|
|
81
|
+
// -- Role mutations -------------------------------------------------------
|
|
82
|
+
async createRole(input) {
|
|
83
|
+
const data = await this.gql.request(CreateChannelRoleDocument, { input });
|
|
84
|
+
return data.createChannelRole;
|
|
85
|
+
}
|
|
86
|
+
async updateRole(input) {
|
|
87
|
+
const data = await this.gql.request(UpdateChannelRoleDocument, { input });
|
|
88
|
+
return data.updateChannelRole;
|
|
89
|
+
}
|
|
90
|
+
async deleteRole(groupRoleId) {
|
|
91
|
+
const data = await this.gql.request(DeleteChannelRoleDocument, { groupRoleId });
|
|
92
|
+
return data.deleteChannelRole;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutationVariables, type GameModelJoinSessionMutation, type GameModelJoinSessionMutationVariables, type GameModelSetSessionTurnMutation, type GameModelSetSessionTurnMutationVariables, type GameModelCreateContainerMutation, type GameModelCreateContainerMutationVariables, type GameModelSetPropertyMutation, type GameModelSetPropertyMutationVariables, type GameModelAddEdgeMutation, type GameModelAddEdgeMutationVariables, type GameModelInvokeMutation, type GameModelInvokeMutationVariables, type GameModelContainerQuery, type GameModelContainerQueryVariables, type GameModelContainersQuery, type GameModelContainersQueryVariables, type GameModelContainerStateQuery, type GameModelContainerStateQueryVariables, type GameModelTraverseQuery, type GameModelTraverseQueryVariables, type GameModelSessionQuery, type GameModelSessionQueryVariables, type GameModelSessionsQuery, type GameModelSessionsQueryVariables, type GameModelEventsQuery, type GameModelEventsQueryVariables, type GameModelSeedMutation, type GameModelSeedMutationVariables, type GameModelUpsertContainerTypeMutation, type GameModelUpsertContainerTypeMutationVariables, type GameModelUpsertPropertyDefMutation, type GameModelUpsertPropertyDefMutationVariables, type GameModelUpsertFunctionMutation, type GameModelUpsertFunctionMutationVariables, type GameModelDeleteFunctionMutation, type GameModelDeleteFunctionMutationVariables, type GameModelDefineFeatureMutation, type GameModelDefineFeatureMutationVariables, type GameModelGrantTierFeatureMutation, type GameModelGrantTierFeatureMutationVariables, type GameModelSetPolicyMutation, type GameModelSetPolicyMutationVariables, type GameModelTypeSchemaQuery, type GameModelTypeSchemaQueryVariables } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* Abstract game model sub-client (cks-game-api). Studios author the model
|
|
5
|
+
* (container types, property schemas, functions, tier features) and players
|
|
6
|
+
* query state + invoke functions at runtime.
|
|
7
|
+
*
|
|
8
|
+
* Arbitrary JSON values are passed/returned as JSON-encoded strings (the
|
|
9
|
+
* `*Json` fields); callers JSON.parse / JSON.stringify around them.
|
|
10
|
+
*
|
|
11
|
+
* Exposed as `client.gameModel`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class GameModelAPI {
|
|
14
|
+
private gql;
|
|
15
|
+
constructor(gql: GraphQLClient);
|
|
16
|
+
createSession(input: GameModelCreateSessionMutationVariables['input']): Promise<GameModelCreateSessionMutation['gameModelCreateSession']>;
|
|
17
|
+
joinSession(input: GameModelJoinSessionMutationVariables['input']): Promise<GameModelJoinSessionMutation['gameModelJoinSession']>;
|
|
18
|
+
setSessionTurn(input: GameModelSetSessionTurnMutationVariables['input']): Promise<GameModelSetSessionTurnMutation['gameModelSetSessionTurn']>;
|
|
19
|
+
createContainer(input: GameModelCreateContainerMutationVariables['input']): Promise<GameModelCreateContainerMutation['gameModelCreateContainer']>;
|
|
20
|
+
setProperty(input: GameModelSetPropertyMutationVariables['input']): Promise<GameModelSetPropertyMutation['gameModelSetProperty']>;
|
|
21
|
+
addEdge(input: GameModelAddEdgeMutationVariables['input']): Promise<GameModelAddEdgeMutation['gameModelAddEdge']>;
|
|
22
|
+
invoke(input: GameModelInvokeMutationVariables['input']): Promise<GameModelInvokeMutation['gameModelInvoke']>;
|
|
23
|
+
container(variables: GameModelContainerQueryVariables): Promise<GameModelContainerQuery['gameModelContainer']>;
|
|
24
|
+
containers(variables: GameModelContainersQueryVariables): Promise<GameModelContainersQuery['gameModelContainers']>;
|
|
25
|
+
containerState(variables: GameModelContainerStateQueryVariables): Promise<GameModelContainerStateQuery['gameModelContainerState']>;
|
|
26
|
+
traverse(variables: GameModelTraverseQueryVariables): Promise<GameModelTraverseQuery['gameModelTraverse']>;
|
|
27
|
+
session(variables: GameModelSessionQueryVariables): Promise<GameModelSessionQuery['gameModelSession']>;
|
|
28
|
+
sessions(variables: GameModelSessionsQueryVariables): Promise<GameModelSessionsQuery['gameModelSessions']>;
|
|
29
|
+
events(variables: GameModelEventsQueryVariables): Promise<GameModelEventsQuery['gameModelEvents']>;
|
|
30
|
+
seed(input: GameModelSeedMutationVariables['input']): Promise<GameModelSeedMutation['gameModelSeed']>;
|
|
31
|
+
upsertContainerType(input: GameModelUpsertContainerTypeMutationVariables['input']): Promise<GameModelUpsertContainerTypeMutation['gameModelUpsertContainerType']>;
|
|
32
|
+
upsertPropertyDef(input: GameModelUpsertPropertyDefMutationVariables['input']): Promise<GameModelUpsertPropertyDefMutation['gameModelUpsertPropertyDef']>;
|
|
33
|
+
upsertFunction(input: GameModelUpsertFunctionMutationVariables['input']): Promise<GameModelUpsertFunctionMutation['gameModelUpsertFunction']>;
|
|
34
|
+
deleteFunction(variables: GameModelDeleteFunctionMutationVariables): Promise<GameModelDeleteFunctionMutation['gameModelDeleteFunction']>;
|
|
35
|
+
defineFeature(input: GameModelDefineFeatureMutationVariables['input']): Promise<GameModelDefineFeatureMutation['gameModelDefineFeature']>;
|
|
36
|
+
grantTierFeature(input: GameModelGrantTierFeatureMutationVariables['input']): Promise<GameModelGrantTierFeatureMutation['gameModelGrantTierFeature']>;
|
|
37
|
+
setPolicy(input: GameModelSetPolicyMutationVariables['input']): Promise<GameModelSetPolicyMutation['gameModelSetPolicy']>;
|
|
38
|
+
typeSchema(variables: GameModelTypeSchemaQueryVariables): Promise<GameModelTypeSchemaQuery['gameModelTypeSchema']>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=gameModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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ModelCreateSessionDocument, GameModelJoinSessionDocument, GameModelSetSessionTurnDocument, GameModelCreateContainerDocument, GameModelSetPropertyDocument, GameModelAddEdgeDocument, GameModelInvokeDocument, GameModelContainerDocument, GameModelContainersDocument, GameModelContainerStateDocument, GameModelTraverseDocument, GameModelSessionDocument, GameModelSessionsDocument, GameModelEventsDocument,
|
|
4
|
+
// Studio authoring ops
|
|
5
|
+
GameModelSeedDocument, GameModelUpsertContainerTypeDocument, GameModelUpsertPropertyDefDocument, GameModelUpsertFunctionDocument, GameModelDeleteFunctionDocument, GameModelDefineFeatureDocument, GameModelGrantTierFeatureDocument, GameModelSetPolicyDocument, GameModelTypeSchemaDocument, } from '../generated/graphql.js';
|
|
6
|
+
/**
|
|
7
|
+
* Abstract game model sub-client (cks-game-api). Studios author the model
|
|
8
|
+
* (container types, property schemas, functions, tier features) and players
|
|
9
|
+
* query state + invoke functions at runtime.
|
|
10
|
+
*
|
|
11
|
+
* Arbitrary JSON values are passed/returned as JSON-encoded strings (the
|
|
12
|
+
* `*Json` fields); callers JSON.parse / JSON.stringify around them.
|
|
13
|
+
*
|
|
14
|
+
* Exposed as `client.gameModel`.
|
|
15
|
+
*/
|
|
16
|
+
export class GameModelAPI {
|
|
17
|
+
constructor(gql) {
|
|
18
|
+
this.gql = gql;
|
|
19
|
+
}
|
|
20
|
+
// -- Runtime (player) -------------------------------------------------------
|
|
21
|
+
async createSession(input) {
|
|
22
|
+
const data = await this.gql.request(GameModelCreateSessionDocument, { input });
|
|
23
|
+
return data.gameModelCreateSession;
|
|
24
|
+
}
|
|
25
|
+
async joinSession(input) {
|
|
26
|
+
const data = await this.gql.request(GameModelJoinSessionDocument, { input });
|
|
27
|
+
return data.gameModelJoinSession;
|
|
28
|
+
}
|
|
29
|
+
async setSessionTurn(input) {
|
|
30
|
+
const data = await this.gql.request(GameModelSetSessionTurnDocument, { input });
|
|
31
|
+
return data.gameModelSetSessionTurn;
|
|
32
|
+
}
|
|
33
|
+
async createContainer(input) {
|
|
34
|
+
const data = await this.gql.request(GameModelCreateContainerDocument, { input });
|
|
35
|
+
return data.gameModelCreateContainer;
|
|
36
|
+
}
|
|
37
|
+
async setProperty(input) {
|
|
38
|
+
const data = await this.gql.request(GameModelSetPropertyDocument, { input });
|
|
39
|
+
return data.gameModelSetProperty;
|
|
40
|
+
}
|
|
41
|
+
async addEdge(input) {
|
|
42
|
+
const data = await this.gql.request(GameModelAddEdgeDocument, { input });
|
|
43
|
+
return data.gameModelAddEdge;
|
|
44
|
+
}
|
|
45
|
+
async invoke(input) {
|
|
46
|
+
const data = await this.gql.request(GameModelInvokeDocument, { input });
|
|
47
|
+
return data.gameModelInvoke;
|
|
48
|
+
}
|
|
49
|
+
async container(variables) {
|
|
50
|
+
const data = await this.gql.request(GameModelContainerDocument, variables);
|
|
51
|
+
return data.gameModelContainer;
|
|
52
|
+
}
|
|
53
|
+
async containers(variables) {
|
|
54
|
+
const data = await this.gql.request(GameModelContainersDocument, variables);
|
|
55
|
+
return data.gameModelContainers;
|
|
56
|
+
}
|
|
57
|
+
async containerState(variables) {
|
|
58
|
+
const data = await this.gql.request(GameModelContainerStateDocument, variables);
|
|
59
|
+
return data.gameModelContainerState;
|
|
60
|
+
}
|
|
61
|
+
async traverse(variables) {
|
|
62
|
+
const data = await this.gql.request(GameModelTraverseDocument, variables);
|
|
63
|
+
return data.gameModelTraverse;
|
|
64
|
+
}
|
|
65
|
+
async session(variables) {
|
|
66
|
+
const data = await this.gql.request(GameModelSessionDocument, variables);
|
|
67
|
+
return data.gameModelSession;
|
|
68
|
+
}
|
|
69
|
+
async sessions(variables) {
|
|
70
|
+
const data = await this.gql.request(GameModelSessionsDocument, variables);
|
|
71
|
+
return data.gameModelSessions;
|
|
72
|
+
}
|
|
73
|
+
async events(variables) {
|
|
74
|
+
const data = await this.gql.request(GameModelEventsDocument, variables);
|
|
75
|
+
return data.gameModelEvents;
|
|
76
|
+
}
|
|
77
|
+
// -- Studio authoring -------------------------------------------------------
|
|
78
|
+
async seed(input) {
|
|
79
|
+
const data = await this.gql.request(GameModelSeedDocument, { input });
|
|
80
|
+
return data.gameModelSeed;
|
|
81
|
+
}
|
|
82
|
+
async upsertContainerType(input) {
|
|
83
|
+
const data = await this.gql.request(GameModelUpsertContainerTypeDocument, { input });
|
|
84
|
+
return data.gameModelUpsertContainerType;
|
|
85
|
+
}
|
|
86
|
+
async upsertPropertyDef(input) {
|
|
87
|
+
const data = await this.gql.request(GameModelUpsertPropertyDefDocument, { input });
|
|
88
|
+
return data.gameModelUpsertPropertyDef;
|
|
89
|
+
}
|
|
90
|
+
async upsertFunction(input) {
|
|
91
|
+
const data = await this.gql.request(GameModelUpsertFunctionDocument, { input });
|
|
92
|
+
return data.gameModelUpsertFunction;
|
|
93
|
+
}
|
|
94
|
+
async deleteFunction(variables) {
|
|
95
|
+
const data = await this.gql.request(GameModelDeleteFunctionDocument, variables);
|
|
96
|
+
return data.gameModelDeleteFunction;
|
|
97
|
+
}
|
|
98
|
+
async defineFeature(input) {
|
|
99
|
+
const data = await this.gql.request(GameModelDefineFeatureDocument, { input });
|
|
100
|
+
return data.gameModelDefineFeature;
|
|
101
|
+
}
|
|
102
|
+
async grantTierFeature(input) {
|
|
103
|
+
const data = await this.gql.request(GameModelGrantTierFeatureDocument, { input });
|
|
104
|
+
return data.gameModelGrantTierFeature;
|
|
105
|
+
}
|
|
106
|
+
async setPolicy(input) {
|
|
107
|
+
const data = await this.gql.request(GameModelSetPolicyDocument, { input });
|
|
108
|
+
return data.gameModelSetPolicy;
|
|
109
|
+
}
|
|
110
|
+
async typeSchema(variables) {
|
|
111
|
+
const data = await this.gql.request(GameModelTypeSchemaDocument, variables);
|
|
112
|
+
return data.gameModelTypeSchema;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform discovery sub-client. Targets `cks-management-api`. Lets a client
|
|
3
|
+
* find the shared game-api URL (for apps published to the shared environment)
|
|
4
|
+
* BEFORE it has a per-app endpoint, then build a game-api `CrowdyClient`
|
|
5
|
+
* against it.
|
|
6
|
+
*
|
|
7
|
+
* Typical pattern:
|
|
8
|
+
*
|
|
9
|
+
* const base = createCrowdyClient({ managementUrl: 'https://api.example.com' });
|
|
10
|
+
* const cfg = await base.platform.config();
|
|
11
|
+
* const gameClient = createCrowdyClient({
|
|
12
|
+
* managementUrl: 'https://api.example.com',
|
|
13
|
+
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
14
|
+
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
15
|
+
* tokenStore: base.session.tokenStore,
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
import type { GraphQLClient } from '../client.js';
|
|
19
|
+
export interface PlatformConfig {
|
|
20
|
+
/** Shared game-api HTTP/GraphQL root for shared-environment apps. */
|
|
21
|
+
sharedGameApiUrl: string | null;
|
|
22
|
+
/** Shared game-api WebSocket root (subscriptions / UDP proxy). */
|
|
23
|
+
sharedGameApiWsUrl: string | null;
|
|
24
|
+
/** Free shared app slots an org gets before a paid subscription. */
|
|
25
|
+
freeAppsPerOrg: number;
|
|
26
|
+
}
|
|
27
|
+
export declare class PlatformAPI {
|
|
28
|
+
private readonly management;
|
|
29
|
+
constructor(management: GraphQLClient);
|
|
30
|
+
/** Fetch public platform discovery (shared game-api URL, free app quota). */
|
|
31
|
+
config(): Promise<PlatformConfig>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,qEAAqE;IACrE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,aAAa;IAEtD,6EAA6E;IACvE,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;CAIxC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform discovery sub-client. Targets `cks-management-api`. Lets a client
|
|
3
|
+
* find the shared game-api URL (for apps published to the shared environment)
|
|
4
|
+
* BEFORE it has a per-app endpoint, then build a game-api `CrowdyClient`
|
|
5
|
+
* against it.
|
|
6
|
+
*
|
|
7
|
+
* Typical pattern:
|
|
8
|
+
*
|
|
9
|
+
* const base = createCrowdyClient({ managementUrl: 'https://api.example.com' });
|
|
10
|
+
* const cfg = await base.platform.config();
|
|
11
|
+
* const gameClient = createCrowdyClient({
|
|
12
|
+
* managementUrl: 'https://api.example.com',
|
|
13
|
+
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
14
|
+
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
15
|
+
* tokenStore: base.session.tokenStore,
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
import { parse } from 'graphql';
|
|
19
|
+
// Hand-written document so the SDK can discover the shared game-api URL even
|
|
20
|
+
// before codegen picks up the new schema (see src/operations/platform/).
|
|
21
|
+
const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
22
|
+
query PlatformConfig {
|
|
23
|
+
platformConfig {
|
|
24
|
+
sharedGameApiUrl
|
|
25
|
+
sharedGameApiWsUrl
|
|
26
|
+
freeAppsPerOrg
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`);
|
|
30
|
+
export class PlatformAPI {
|
|
31
|
+
constructor(management) {
|
|
32
|
+
this.management = management;
|
|
33
|
+
}
|
|
34
|
+
/** Fetch public platform discovery (shared game-api URL, free app quota). */
|
|
35
|
+
async config() {
|
|
36
|
+
const data = await this.management.request(PlatformConfigDocument, {});
|
|
37
|
+
return data.platformConfig;
|
|
38
|
+
}
|
|
39
|
+
}
|
package/dist/domains/udp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
2
|
import type { SubscriptionManager, UdpNotificationHandlers } from '../subscriptions.js';
|
|
3
|
-
import { type ConnectUdpProxyMutation, type UdpProxyConnectionStatusQuery, type SendActorUpdateMutationVariables, type SendVoxelUpdateMutationVariables, type SendAudioPacketMutationVariables, type SendTextPacketMutationVariables, type SendClientEventMutationVariables, type SendSingleActorMessageMutationVariables } from '../generated/graphql.js';
|
|
3
|
+
import { type ConnectUdpProxyMutation, type UdpProxyConnectionStatusQuery, type SendActorUpdateMutationVariables, type SendVoxelUpdateMutationVariables, type SendAudioPacketMutationVariables, type SendTextPacketMutationVariables, type SendClientEventMutationVariables, type SendSingleActorMessageMutationVariables, type SendChannelMessageMutationVariables } from '../generated/graphql.js';
|
|
4
4
|
import type { SpatialNotification } from '../realtime.js';
|
|
5
5
|
/**
|
|
6
6
|
* UDP proxy access for browser-style clients that can't open raw UDP
|
|
@@ -45,6 +45,14 @@ export declare class UdpAPI {
|
|
|
45
45
|
* `SingleActorMessageNotification` on its `udpNotifications` subscription.
|
|
46
46
|
*/
|
|
47
47
|
sendSingleActorMessage(input: SendSingleActorMessageMutationVariables['input']): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Publish a message to a channel. Delivered to every active member of the
|
|
50
|
+
* channel (regardless of location) as a `ChannelMessageNotification` on their
|
|
51
|
+
* `udpNotifications` subscription. Requires the channel `send_messages`
|
|
52
|
+
* permission; the server drops the message otherwise. Fire-and-forget: the
|
|
53
|
+
* sender receives no echo.
|
|
54
|
+
*/
|
|
55
|
+
sendChannelMessage(input: SendChannelMessageMutationVariables['input']): Promise<boolean>;
|
|
48
56
|
/**
|
|
49
57
|
* Subscribe to udpNotifications. Pass any combination of typename
|
|
50
58
|
* handlers; the returned function detaches all of them. The first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"udp.d.ts","sourceRoot":"","sources":["../../src/domains/udp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,6BAA6B,EAElC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,+BAA+B,EAEpC,KAAK,gCAAgC,EAErC,KAAK,uCAAuC,
|
|
1
|
+
{"version":3,"file":"udp.d.ts","sourceRoot":"","sources":["../../src/domains/udp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,6BAA6B,EAElC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EAErC,KAAK,+BAA+B,EAEpC,KAAK,gCAAgC,EAErC,KAAK,uCAAuC,EAE5C,KAAK,mCAAmC,EACzC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D;;;;;;GAMG;AACH,qBAAa,MAAM;IAIf,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;IAJd,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;gBAG3C,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,mBAAmB;IAG7B,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAK9D,UAAU,IAAI,OAAO,C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,CAAC,EAAE,MAAM,CAAA;KAAO,GACnC,OAAO,CAAC,mBAAmB,CAAC;IAO/B;;;;;;OAMG;IACG,sBAAsB,CAC1B,KAAK,EAAE,uCAAuC,CAAC,OAAO,CAAC,GACtD,OAAO,CAAC,OAAO,CAAC;IAOnB;;;;;;OAMG;IACG,kBAAkB,CACtB,KAAK,EAAE,mCAAmC,CAAC,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC;IAKnB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,uBAAuB,GAAG,MAAM,IAAI;IAIxD,OAAO,CAAC,YAAY;CAQrB"}
|
package/dist/domains/udp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectUdpProxyDocument, DisconnectUdpProxyDocument, UdpProxyConnectionStatusDocument, SendActorUpdateDocument, SendVoxelUpdateDocument, SendAudioPacketDocument, SendTextPacketDocument, SendClientEventDocument, SendSingleActorMessageDocument, } from '../generated/graphql.js';
|
|
1
|
+
import { ConnectUdpProxyDocument, DisconnectUdpProxyDocument, UdpProxyConnectionStatusDocument, SendActorUpdateDocument, SendVoxelUpdateDocument, SendAudioPacketDocument, SendTextPacketDocument, SendClientEventDocument, SendSingleActorMessageDocument, SendChannelMessageDocument, } from '../generated/graphql.js';
|
|
2
2
|
import { SequenceAllocator } from '../utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* UDP proxy access for browser-style clients that can't open raw UDP
|
|
@@ -88,6 +88,17 @@ export class UdpAPI {
|
|
|
88
88
|
});
|
|
89
89
|
return data.sendSingleActorMessage;
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Publish a message to a channel. Delivered to every active member of the
|
|
93
|
+
* channel (regardless of location) as a `ChannelMessageNotification` on their
|
|
94
|
+
* `udpNotifications` subscription. Requires the channel `send_messages`
|
|
95
|
+
* permission; the server drops the message otherwise. Fire-and-forget: the
|
|
96
|
+
* sender receives no echo.
|
|
97
|
+
*/
|
|
98
|
+
async sendChannelMessage(input) {
|
|
99
|
+
const data = await this.gql.request(SendChannelMessageDocument, { input });
|
|
100
|
+
return data.sendChannelMessage;
|
|
101
|
+
}
|
|
91
102
|
/**
|
|
92
103
|
* Subscribe to udpNotifications. Pass any combination of typename
|
|
93
104
|
* handlers; the returned function detaches all of them. The first
|