@crowdedkingdomstudios/crowdyjs 2.0.0 → 2.1.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/README.md +433 -6
- package/dist/auth-state.d.ts +21 -0
- package/dist/auth-state.d.ts.map +1 -0
- package/dist/auth-state.js +30 -0
- package/dist/client.d.ts +27 -21
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +27 -196
- package/dist/crowdy-client.d.ts +44 -24
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +42 -81
- package/dist/domains/actors.d.ts +22 -0
- package/dist/domains/actors.d.ts.map +1 -0
- package/dist/domains/actors.js +42 -0
- package/dist/domains/appAccess.d.ts +23 -0
- package/dist/domains/appAccess.d.ts.map +1 -0
- package/dist/domains/appAccess.js +42 -0
- package/dist/domains/apps.d.ts +27 -0
- package/dist/domains/apps.d.ts.map +1 -0
- package/dist/domains/apps.js +49 -0
- package/dist/domains/auth.d.ts +32 -0
- package/dist/domains/auth.d.ts.map +1 -0
- package/dist/domains/auth.js +70 -0
- package/dist/domains/billing.d.ts +17 -0
- package/dist/domains/billing.d.ts.map +1 -0
- package/dist/domains/billing.js +31 -0
- package/dist/domains/chunks.d.ts +20 -0
- package/dist/domains/chunks.d.ts.map +1 -0
- package/dist/domains/chunks.js +40 -0
- package/dist/domains/organizations.d.ts +33 -0
- package/dist/domains/organizations.d.ts.map +1 -0
- package/dist/domains/organizations.js +90 -0
- package/dist/domains/payments.d.ts +20 -0
- package/dist/domains/payments.d.ts.map +1 -0
- package/dist/domains/payments.js +28 -0
- package/dist/domains/quotas.d.ts +20 -0
- package/dist/domains/quotas.d.ts.map +1 -0
- package/dist/domains/quotas.js +34 -0
- package/dist/domains/serverStatus.d.ts +21 -0
- package/dist/domains/serverStatus.d.ts.map +1 -0
- package/dist/domains/serverStatus.js +32 -0
- package/dist/domains/state.d.ts +16 -0
- package/dist/domains/state.d.ts.map +1 -0
- package/dist/domains/state.js +27 -0
- package/dist/domains/teleport.d.ts +13 -0
- package/dist/domains/teleport.d.ts.map +1 -0
- package/dist/domains/teleport.js +15 -0
- package/dist/domains/udp.d.ts +32 -0
- package/dist/domains/udp.d.ts.map +1 -0
- package/dist/domains/udp.js +55 -0
- package/dist/domains/users.d.ts +24 -0
- package/dist/domains/users.d.ts.map +1 -0
- package/dist/domains/users.js +53 -0
- package/dist/domains/voxels.d.ts +17 -0
- package/dist/domains/voxels.d.ts.map +1 -0
- package/dist/domains/voxels.js +31 -0
- package/dist/generated/graphql.d.ts +3571 -0
- package/dist/generated/graphql.d.ts.map +1 -0
- package/dist/generated/graphql.js +181 -0
- package/dist/index.d.ts +33 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -1
- package/dist/subscriptions.d.ts +36 -18
- package/dist/subscriptions.d.ts.map +1 -1
- package/dist/subscriptions.js +95 -181
- package/package.json +20 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type TeleportRequestMutation, type TeleportRequestMutationVariables } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* Teleport API.
|
|
5
|
+
*
|
|
6
|
+
* Exposed as `client.teleport`.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TeleportAPI {
|
|
9
|
+
private gql;
|
|
10
|
+
constructor(gql: GraphQLClient);
|
|
11
|
+
request(input: TeleportRequestMutationVariables['input']): Promise<TeleportRequestMutation['teleportRequest']>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=teleport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teleport.d.ts","sourceRoot":"","sources":["../../src/domains/teleport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACtC,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEhC,OAAO,CACX,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;CAIvD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TeleportRequestDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* Teleport API.
|
|
4
|
+
*
|
|
5
|
+
* Exposed as `client.teleport`.
|
|
6
|
+
*/
|
|
7
|
+
export class TeleportAPI {
|
|
8
|
+
constructor(gql) {
|
|
9
|
+
this.gql = gql;
|
|
10
|
+
}
|
|
11
|
+
async request(input) {
|
|
12
|
+
const data = await this.gql.request(TeleportRequestDocument, { input });
|
|
13
|
+
return data.teleportRequest;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import type { SubscriptionManager, UdpNotificationHandlers } from '../subscriptions.js';
|
|
3
|
+
import { type ConnectUdpProxyMutation, type UdpProxyConnectionStatusQuery, type SendActorUpdateMutationVariables, type SendVoxelUpdateMutationVariables, type SendAudioPacketMutationVariables, type SendTextPacketMutationVariables, type SendClientEventMutationVariables } from '../generated/graphql.js';
|
|
4
|
+
import type { UnsubscribeFn } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* UDP proxy access for browser-style clients that can't open raw UDP
|
|
7
|
+
* sockets. Exposed as `client.udp`. All send mutations go over the same
|
|
8
|
+
* GraphQL HTTP endpoint and are forwarded to the assigned game server by
|
|
9
|
+
* the API's UDP proxy module. Notifications come back over a single shared
|
|
10
|
+
* WebSocket subscription managed by `SubscriptionManager`.
|
|
11
|
+
*/
|
|
12
|
+
export declare class UdpAPI {
|
|
13
|
+
private gql;
|
|
14
|
+
private subs;
|
|
15
|
+
constructor(gql: GraphQLClient, subs: SubscriptionManager);
|
|
16
|
+
connect(): Promise<ConnectUdpProxyMutation['connectUdpProxy']>;
|
|
17
|
+
disconnect(): Promise<boolean>;
|
|
18
|
+
connectionStatus(): Promise<UdpProxyConnectionStatusQuery['udpProxyConnectionStatus']>;
|
|
19
|
+
sendActorUpdate(input: SendActorUpdateMutationVariables['input']): Promise<boolean>;
|
|
20
|
+
sendVoxelUpdate(input: SendVoxelUpdateMutationVariables['input']): Promise<boolean>;
|
|
21
|
+
sendAudioPacket(input: SendAudioPacketMutationVariables['input']): Promise<boolean>;
|
|
22
|
+
sendTextPacket(input: SendTextPacketMutationVariables['input']): Promise<boolean>;
|
|
23
|
+
sendClientEvent(input: SendClientEventMutationVariables['input']): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to udpNotifications. Pass any combination of typename
|
|
26
|
+
* handlers; the returned function detaches all of them. The first
|
|
27
|
+
* subscriber opens the shared WebSocket; the last one to leave closes
|
|
28
|
+
* it.
|
|
29
|
+
*/
|
|
30
|
+
subscribe(handlers: UdpNotificationHandlers): UnsubscribeFn;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=udp.d.ts.map
|
|
@@ -0,0 +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,EACtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,MAAM;IAEf,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,IAAI;gBADJ,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,mBAAmB;IAG7B,OAAO,IAAI,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAK9D,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAK9B,gBAAgB,IAAI,OAAO,CAC/B,6BAA6B,CAAC,0BAA0B,CAAC,CAC1D;IAQK,eAAe,CACnB,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,OAAO,CAAC;IAKb,eAAe,CACnB,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,OAAO,CAAC;IAKb,eAAe,CACnB,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,OAAO,CAAC;IAKb,cAAc,CAClB,KAAK,EAAE,+BAA+B,CAAC,OAAO,CAAC,GAC9C,OAAO,CAAC,OAAO,CAAC;IAKb,eAAe,CACnB,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,OAAO,CAAC;IAKnB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,uBAAuB,GAAG,aAAa;CAG5D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ConnectUdpProxyDocument, DisconnectUdpProxyDocument, UdpProxyConnectionStatusDocument, SendActorUpdateDocument, SendVoxelUpdateDocument, SendAudioPacketDocument, SendTextPacketDocument, SendClientEventDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* UDP proxy access for browser-style clients that can't open raw UDP
|
|
4
|
+
* sockets. Exposed as `client.udp`. All send mutations go over the same
|
|
5
|
+
* GraphQL HTTP endpoint and are forwarded to the assigned game server by
|
|
6
|
+
* the API's UDP proxy module. Notifications come back over a single shared
|
|
7
|
+
* WebSocket subscription managed by `SubscriptionManager`.
|
|
8
|
+
*/
|
|
9
|
+
export class UdpAPI {
|
|
10
|
+
constructor(gql, subs) {
|
|
11
|
+
this.gql = gql;
|
|
12
|
+
this.subs = subs;
|
|
13
|
+
}
|
|
14
|
+
async connect() {
|
|
15
|
+
const data = await this.gql.request(ConnectUdpProxyDocument, undefined);
|
|
16
|
+
return data.connectUdpProxy;
|
|
17
|
+
}
|
|
18
|
+
async disconnect() {
|
|
19
|
+
const data = await this.gql.request(DisconnectUdpProxyDocument, undefined);
|
|
20
|
+
return data.disconnectUdpProxy;
|
|
21
|
+
}
|
|
22
|
+
async connectionStatus() {
|
|
23
|
+
const data = await this.gql.request(UdpProxyConnectionStatusDocument, undefined);
|
|
24
|
+
return data.udpProxyConnectionStatus;
|
|
25
|
+
}
|
|
26
|
+
async sendActorUpdate(input) {
|
|
27
|
+
const data = await this.gql.request(SendActorUpdateDocument, { input });
|
|
28
|
+
return data.sendActorUpdate;
|
|
29
|
+
}
|
|
30
|
+
async sendVoxelUpdate(input) {
|
|
31
|
+
const data = await this.gql.request(SendVoxelUpdateDocument, { input });
|
|
32
|
+
return data.sendVoxelUpdate;
|
|
33
|
+
}
|
|
34
|
+
async sendAudioPacket(input) {
|
|
35
|
+
const data = await this.gql.request(SendAudioPacketDocument, { input });
|
|
36
|
+
return data.sendAudioPacket;
|
|
37
|
+
}
|
|
38
|
+
async sendTextPacket(input) {
|
|
39
|
+
const data = await this.gql.request(SendTextPacketDocument, { input });
|
|
40
|
+
return data.sendTextPacket;
|
|
41
|
+
}
|
|
42
|
+
async sendClientEvent(input) {
|
|
43
|
+
const data = await this.gql.request(SendClientEventDocument, { input });
|
|
44
|
+
return data.sendClientEvent;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Subscribe to udpNotifications. Pass any combination of typename
|
|
48
|
+
* handlers; the returned function detaches all of them. The first
|
|
49
|
+
* subscriber opens the shared WebSocket; the last one to leave closes
|
|
50
|
+
* it.
|
|
51
|
+
*/
|
|
52
|
+
subscribe(handlers) {
|
|
53
|
+
return this.subs.subscribe(handlers);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type MeQuery, type UserQuery, type UserQueryVariables, type UsersPaginatedQuery, type UsersPaginatedQueryVariables, type UpdateGamertagMutation, type UpdateGamertagMutationVariables, type UpdateUserStateMutation, type UpdateUserStateMutationVariables, type SetSuperAdminMutation, type SetSuperAdminMutationVariables, type SetEarlyAccessOverrideMutation, type SetEarlyAccessOverrideMutationVariables, type UpdateUserTypeMutation, type UpdateUserTypeMutationVariables, type ForceLogoutUserMutationVariables } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* User profile / directory queries and mutations. Exposed as `client.users`.
|
|
5
|
+
*
|
|
6
|
+
* The legacy `list` / `byGamertag` / `byEmail` triple has been collapsed
|
|
7
|
+
* into a single super-admin-gated `searchPaginated` (server-side
|
|
8
|
+
* `usersPaginated`).
|
|
9
|
+
*/
|
|
10
|
+
export declare class UsersAPI {
|
|
11
|
+
private gql;
|
|
12
|
+
constructor(gql: GraphQLClient);
|
|
13
|
+
me(): Promise<MeQuery['me']>;
|
|
14
|
+
byId(id: UserQueryVariables['id']): Promise<UserQuery['user']>;
|
|
15
|
+
searchPaginated(args?: UsersPaginatedQueryVariables): Promise<UsersPaginatedQuery['usersPaginated']>;
|
|
16
|
+
updateGamertag(input: UpdateGamertagMutationVariables['input']): Promise<UpdateGamertagMutation['updateGamertag']>;
|
|
17
|
+
updateUserState(input: UpdateUserStateMutationVariables['input']): Promise<UpdateUserStateMutation['updateUserState']>;
|
|
18
|
+
setSuperAdmin(args: SetSuperAdminMutationVariables): Promise<SetSuperAdminMutation['setSuperAdmin']>;
|
|
19
|
+
setEarlyAccessOverride(args: SetEarlyAccessOverrideMutationVariables): Promise<SetEarlyAccessOverrideMutation['setEarlyAccessOverride']>;
|
|
20
|
+
updateUserType(args: UpdateUserTypeMutationVariables): Promise<UpdateUserTypeMutation['updateUserType']>;
|
|
21
|
+
forceLogoutUser(userId: ForceLogoutUserMutationVariables['userId']): Promise<boolean>;
|
|
22
|
+
deleteMyAccount(): Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EAEpC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAE5C,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EAEpC,KAAK,gCAAgC,EAEtC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEhC,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAK5B,IAAI,CAAC,EAAE,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAK9D,eAAe,CACnB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAK3C,cAAc,CAClB,KAAK,EAAE,+BAA+B,CAAC,OAAO,CAAC,GAC9C,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAK9C,eAAe,CACnB,KAAK,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAC/C,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAKhD,aAAa,CACjB,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAK5C,sBAAsB,CAC1B,IAAI,EAAE,uCAAuC,GAC5C,OAAO,CAAC,8BAA8B,CAAC,wBAAwB,CAAC,CAAC;IAK9D,cAAc,CAClB,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAK9C,eAAe,CACnB,MAAM,EAAE,gCAAgC,CAAC,QAAQ,CAAC,GACjD,OAAO,CAAC,OAAO,CAAC;IAKb,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAI1C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { MeDocument, UserDocument, UsersPaginatedDocument, UpdateGamertagDocument, UpdateUserStateDocument, SetSuperAdminDocument, SetEarlyAccessOverrideDocument, UpdateUserTypeDocument, ForceLogoutUserDocument, DeleteMyAccountDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* User profile / directory queries and mutations. Exposed as `client.users`.
|
|
4
|
+
*
|
|
5
|
+
* The legacy `list` / `byGamertag` / `byEmail` triple has been collapsed
|
|
6
|
+
* into a single super-admin-gated `searchPaginated` (server-side
|
|
7
|
+
* `usersPaginated`).
|
|
8
|
+
*/
|
|
9
|
+
export class UsersAPI {
|
|
10
|
+
constructor(gql) {
|
|
11
|
+
this.gql = gql;
|
|
12
|
+
}
|
|
13
|
+
async me() {
|
|
14
|
+
const data = await this.gql.request(MeDocument, undefined);
|
|
15
|
+
return data.me;
|
|
16
|
+
}
|
|
17
|
+
async byId(id) {
|
|
18
|
+
const data = await this.gql.request(UserDocument, { id });
|
|
19
|
+
return data.user;
|
|
20
|
+
}
|
|
21
|
+
async searchPaginated(args = {}) {
|
|
22
|
+
const data = await this.gql.request(UsersPaginatedDocument, args);
|
|
23
|
+
return data.usersPaginated;
|
|
24
|
+
}
|
|
25
|
+
async updateGamertag(input) {
|
|
26
|
+
const data = await this.gql.request(UpdateGamertagDocument, { input });
|
|
27
|
+
return data.updateGamertag;
|
|
28
|
+
}
|
|
29
|
+
async updateUserState(input) {
|
|
30
|
+
const data = await this.gql.request(UpdateUserStateDocument, { input });
|
|
31
|
+
return data.updateUserState;
|
|
32
|
+
}
|
|
33
|
+
async setSuperAdmin(args) {
|
|
34
|
+
const data = await this.gql.request(SetSuperAdminDocument, args);
|
|
35
|
+
return data.setSuperAdmin;
|
|
36
|
+
}
|
|
37
|
+
async setEarlyAccessOverride(args) {
|
|
38
|
+
const data = await this.gql.request(SetEarlyAccessOverrideDocument, args);
|
|
39
|
+
return data.setEarlyAccessOverride;
|
|
40
|
+
}
|
|
41
|
+
async updateUserType(args) {
|
|
42
|
+
const data = await this.gql.request(UpdateUserTypeDocument, args);
|
|
43
|
+
return data.updateUserType;
|
|
44
|
+
}
|
|
45
|
+
async forceLogoutUser(userId) {
|
|
46
|
+
const data = await this.gql.request(ForceLogoutUserDocument, { userId });
|
|
47
|
+
return data.forceLogoutUser;
|
|
48
|
+
}
|
|
49
|
+
async deleteMyAccount() {
|
|
50
|
+
const data = await this.gql.request(DeleteMyAccountDocument, undefined);
|
|
51
|
+
return data.deleteMyAccount;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type ListVoxelsQuery, type ListVoxelsQueryVariables, type ListVoxelUpdatesByDistanceQuery, type ListVoxelUpdatesByDistanceQueryVariables, type UpdateVoxelMutation, type UpdateVoxelMutationVariables, type VoxelUpdateHistoryQuery, type VoxelUpdateHistoryQueryVariables, type RollbackVoxelUpdatesMutation, type RollbackVoxelUpdatesMutationVariables } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* Voxel queries and mutations: list, history, rollback, single-voxel update.
|
|
5
|
+
*
|
|
6
|
+
* Exposed as `client.voxels`.
|
|
7
|
+
*/
|
|
8
|
+
export declare class VoxelsAPI {
|
|
9
|
+
private gql;
|
|
10
|
+
constructor(gql: GraphQLClient);
|
|
11
|
+
list(input: ListVoxelsQueryVariables['input']): Promise<ListVoxelsQuery['listVoxels']>;
|
|
12
|
+
listByDistance(input: ListVoxelUpdatesByDistanceQueryVariables['input']): Promise<ListVoxelUpdatesByDistanceQuery['listVoxelUpdatesByDistance']>;
|
|
13
|
+
update(input: UpdateVoxelMutationVariables['input']): Promise<UpdateVoxelMutation['updateVoxel']>;
|
|
14
|
+
history(args: VoxelUpdateHistoryQueryVariables): Promise<VoxelUpdateHistoryQuery['voxelUpdateHistory']>;
|
|
15
|
+
rollback(input: RollbackVoxelUpdatesMutationVariables['input']): Promise<RollbackVoxelUpdatesMutation['rollbackVoxelUpdates']>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=voxels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voxels.d.ts","sourceRoot":"","sources":["../../src/domains/voxels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAE7B,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC3C,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEhC,IAAI,CACR,KAAK,EAAE,wBAAwB,CAAC,OAAO,CAAC,GACvC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAKnC,cAAc,CAClB,KAAK,EAAE,wCAAwC,CAAC,OAAO,CAAC,GACvD,OAAO,CAAC,+BAA+B,CAAC,4BAA4B,CAAC,CAAC;IAKnE,MAAM,CACV,KAAK,EAAE,4BAA4B,CAAC,OAAO,CAAC,GAC3C,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAKxC,OAAO,CACX,IAAI,EAAE,gCAAgC,GACrC,OAAO,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;IAKnD,QAAQ,CACZ,KAAK,EAAE,qCAAqC,CAAC,OAAO,CAAC,GACpD,OAAO,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;CAIjE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ListVoxelsDocument, ListVoxelUpdatesByDistanceDocument, UpdateVoxelDocument, VoxelUpdateHistoryDocument, RollbackVoxelUpdatesDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* Voxel queries and mutations: list, history, rollback, single-voxel update.
|
|
4
|
+
*
|
|
5
|
+
* Exposed as `client.voxels`.
|
|
6
|
+
*/
|
|
7
|
+
export class VoxelsAPI {
|
|
8
|
+
constructor(gql) {
|
|
9
|
+
this.gql = gql;
|
|
10
|
+
}
|
|
11
|
+
async list(input) {
|
|
12
|
+
const data = await this.gql.request(ListVoxelsDocument, { input });
|
|
13
|
+
return data.listVoxels;
|
|
14
|
+
}
|
|
15
|
+
async listByDistance(input) {
|
|
16
|
+
const data = await this.gql.request(ListVoxelUpdatesByDistanceDocument, { input });
|
|
17
|
+
return data.listVoxelUpdatesByDistance;
|
|
18
|
+
}
|
|
19
|
+
async update(input) {
|
|
20
|
+
const data = await this.gql.request(UpdateVoxelDocument, { input });
|
|
21
|
+
return data.updateVoxel;
|
|
22
|
+
}
|
|
23
|
+
async history(args) {
|
|
24
|
+
const data = await this.gql.request(VoxelUpdateHistoryDocument, args);
|
|
25
|
+
return data.voxelUpdateHistory;
|
|
26
|
+
}
|
|
27
|
+
async rollback(input) {
|
|
28
|
+
const data = await this.gql.request(RollbackVoxelUpdatesDocument, { input });
|
|
29
|
+
return data.rollbackVoxelUpdates;
|
|
30
|
+
}
|
|
31
|
+
}
|