@dcl/js-runtime 7.1.3-4479913205.commit-bfd9912 → 7.1.4-4482203432.commit-0b1885b

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/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "@dcl/js-runtime",
3
- "version": "7.1.3-4479913205.commit-bfd9912",
3
+ "version": "7.1.4-4482203432.commit-0b1885b",
4
4
  "description": "JavaScript runtime definitions for Decentraland environments",
5
5
  "scripts": {},
6
6
  "keywords": [],
7
7
  "author": "",
8
- "files": [
9
- "index.d.ts",
10
- "apis.d.ts",
11
- "tsconfig.json"
12
- ],
8
+ "files": [],
13
9
  "license": "Apache-2.0",
14
- "types": "./index.d.ts",
15
10
  "typings": "./index.d.ts",
16
11
  "publishConfig": {
17
12
  "access": "public"
18
13
  },
19
- "commit": "bfd9912fdae18508a527302eff308932f35e5549"
14
+ "commit": "0b1885bb15af60b75c8c853d517ea1898b6318f6"
20
15
  }
package/apis.d.ts DELETED
@@ -1,594 +0,0 @@
1
-
2
- /**
3
- * CommunicationsController
4
- */
5
- declare module "~system/CommunicationsController" {
6
-
7
- export interface RealSendRequest {
8
- message: string;
9
- }
10
- export interface RealSendResponse {
11
- }
12
-
13
- // Function declaration section
14
- export function send(body: RealSendRequest): Promise<RealSendResponse>;
15
-
16
- }
17
- /**
18
- * EngineApi
19
- */
20
- declare module "~system/EngineApi" {
21
-
22
- export enum QueryType {
23
- QT_INVALID_QUERY_TYPE = 0,
24
- QT_HIT_FIRST = 1,
25
- QT_HIT_ALL = 2,
26
- QT_HIT_FIRST_AVATAR = 3,
27
- QT_HIT_ALL_AVATARS = 4,
28
- UNRECOGNIZED = -1
29
- }
30
- export enum EAType {
31
- EAT_INVALID_EA_TYPE = 0,
32
- EAT_OPEN_EXTERNAL_URL = 1,
33
- EAT_OPEN_NFT_DIALOG = 2,
34
- EAT_CREATE_ENTITY = 3,
35
- EAT_REMOVE_ENTITY = 4,
36
- EAT_UPDATE_ENTITY_COMPONENT = 5,
37
- EAT_ATTACH_ENTITY_COMPONENT = 6,
38
- EAT_COMPONENT_REMOVED = 7,
39
- EAT_SET_ENTITY_PARENT = 8,
40
- EAT_QUERY = 9,
41
- EAT_COMPONENT_CREATED = 10,
42
- EAT_COMPONENT_DISPOSED = 11,
43
- EAT_COMPONENT_UPDATED = 12,
44
- EAT_INIT_MESSAGES_FINISHED = 13,
45
- UNRECOGNIZED = -1
46
- }
47
- /** Events */
48
- export enum EventDataType {
49
- EDT_GENERIC = 0,
50
- EDT_POSITION_CHANGED = 1,
51
- EDT_ROTATION_CHANGED = 2,
52
- UNRECOGNIZED = -1
53
- }
54
- export interface OpenExternalUrlBody {
55
- url: string;
56
- }
57
- export interface OpenNFTDialogBody {
58
- assetContractAddress: string;
59
- tokenId: string;
60
- comment?: string | undefined;
61
- }
62
- export interface CreateEntityBody {
63
- id: string;
64
- }
65
- export interface RemoveEntityBody {
66
- id: string;
67
- }
68
- export interface UpdateEntityComponentBody {
69
- entityId: string;
70
- classId: number;
71
- name: string;
72
- json: string;
73
- }
74
- export interface AttachEntityComponentBody {
75
- entityId: string;
76
- name: string;
77
- id: string;
78
- }
79
- export interface ComponentRemovedBody {
80
- entityId: string;
81
- name: string;
82
- }
83
- export interface SetEntityParentBody {
84
- entityId: string;
85
- parentId: string;
86
- }
87
- export interface QueryBody {
88
- queryId: QueryType;
89
- payload: string;
90
- }
91
- export interface ComponentCreatedBody {
92
- id: string;
93
- classId: number;
94
- name: string;
95
- }
96
- export interface ComponentDisposedBody {
97
- id: string;
98
- }
99
- export interface ComponentUpdatedBody {
100
- id: string;
101
- json: string;
102
- }
103
- export interface InitMessagesFinishedBody {
104
- }
105
- export interface Payload {
106
- openExternalUrl?: OpenExternalUrlBody | undefined;
107
- openNftDialog?: OpenNFTDialogBody | undefined;
108
- createEntity?: CreateEntityBody | undefined;
109
- removeEntity?: RemoveEntityBody | undefined;
110
- updateEntityComponent?: UpdateEntityComponentBody | undefined;
111
- attachEntityComponent?: AttachEntityComponentBody | undefined;
112
- componentRemoved?: ComponentRemovedBody | undefined;
113
- setEntityParent?: SetEntityParentBody | undefined;
114
- query?: QueryBody | undefined;
115
- componentCreated?: ComponentCreatedBody | undefined;
116
- componentDisposed?: ComponentDisposedBody | undefined;
117
- componentUpdated?: ComponentUpdatedBody | undefined;
118
- initMessagesFinished?: InitMessagesFinishedBody | undefined;
119
- }
120
- export interface EntityAction {
121
- type: EAType;
122
- tag?: string | undefined;
123
- payload: Payload | undefined;
124
- }
125
- export interface ManyEntityAction {
126
- actions: EntityAction[];
127
- }
128
- export interface SendBatchResponse {
129
- events: EventData[];
130
- }
131
- export interface UnsubscribeRequest {
132
- eventId: string;
133
- }
134
- export interface SubscribeRequest {
135
- eventId: string;
136
- }
137
- export interface SubscribeResponse {
138
- }
139
- export interface UnsubscribeResponse {
140
- }
141
- export interface GenericPayload {
142
- eventId: string;
143
- eventData: string;
144
- }
145
- export interface ReadOnlyVector3 {
146
- x: number;
147
- y: number;
148
- z: number;
149
- }
150
- export interface ReadOnlyQuaternion {
151
- x: number;
152
- y: number;
153
- z: number;
154
- w: number;
155
- }
156
- export interface PositionChangedPayload {
157
- position: ReadOnlyVector3 | undefined;
158
- cameraPosition: ReadOnlyVector3 | undefined;
159
- playerHeight: number;
160
- }
161
- export interface RotationChangedPayload {
162
- rotation: ReadOnlyVector3 | undefined;
163
- quaternion: ReadOnlyQuaternion | undefined;
164
- }
165
- export interface EventData {
166
- type: EventDataType;
167
- generic?: GenericPayload | undefined;
168
- positionChanged?: PositionChangedPayload | undefined;
169
- rotationChanged?: RotationChangedPayload | undefined;
170
- }
171
- export interface CrdtSendToRendererRequest {
172
- data: Uint8Array;
173
- }
174
- export interface CrdtSendToResponse {
175
- /** list of CRDT messages coming back from the renderer */
176
- data: Uint8Array[];
177
- }
178
- export interface CrdtGetStateRequest {
179
- }
180
- export interface CrdtGetStateResponse {
181
- /** returns true if the returned state has scene-created entities */
182
- hasEntities: boolean;
183
- /** static entities data (root entity, camera, etc) and scene-created entities */
184
- data: Uint8Array[];
185
- }
186
- /** deprecated */
187
- export interface CrdtMessageFromRendererRequest {
188
- }
189
- /** deprecated */
190
- export interface CrdtMessageFromRendererResponse {
191
- data: Uint8Array[];
192
- }
193
-
194
- // Function declaration section
195
- export function sendBatch(body: ManyEntityAction): Promise<SendBatchResponse>;
196
- export function subscribe(body: SubscribeRequest): Promise<SubscribeResponse>;
197
- export function unsubscribe(body: UnsubscribeRequest): Promise<UnsubscribeResponse>;
198
- export function crdtSendToRenderer(body: CrdtSendToRendererRequest): Promise<CrdtSendToResponse>;
199
- export function crdtGetState(body: CrdtSendToRendererRequest): Promise<CrdtGetStateResponse>;
200
- export function crdtGetMessageFromRenderer(body: CrdtMessageFromRendererRequest): Promise<CrdtMessageFromRendererResponse>;
201
-
202
- }
203
- /**
204
- * EnvironmentApi
205
- */
206
- declare module "~system/EnvironmentApi" {
207
-
208
- export interface ContentMapping {
209
- file: string;
210
- hash: string;
211
- }
212
-
213
- // Function declaration section
214
- export interface MinimalRunnableEntity {
215
- content: ContentMapping[];
216
- metadataJson: string;
217
- }
218
- export interface BootstrapDataResponse {
219
- id: string;
220
- baseUrl: string;
221
- entity: MinimalRunnableEntity | undefined;
222
- useFPSThrottling: boolean;
223
- }
224
- export interface PreviewModeResponse {
225
- isPreview: boolean;
226
- }
227
- export interface AreUnsafeRequestAllowedResponse {
228
- status: boolean;
229
- }
230
- export interface GetPlatformResponse {
231
- platform: string;
232
- }
233
- export interface EnvironmentRealm {
234
- domain: string;
235
- layer: string;
236
- room: string;
237
- serverName: string;
238
- displayName: string;
239
- protocol: string;
240
- }
241
- export interface GetCurrentRealmResponse {
242
- currentRealm?: EnvironmentRealm | undefined;
243
- }
244
- export interface GetExplorerConfigurationResponse {
245
- clientUri: string;
246
- configurations: {
247
- [key: string]: string;
248
- };
249
- }
250
- export interface GetExplorerConfigurationResponse_ConfigurationsEntry {
251
- key: string;
252
- value: string;
253
- }
254
- export interface GetDecentralandTimeResponse {
255
- seconds: number;
256
- }
257
- export interface GetBootstrapDataRequest {
258
- }
259
- export interface IsPreviewModeRequest {
260
- }
261
- export interface GetPlatformRequest {
262
- }
263
- export interface AreUnsafeRequestAllowedRequest {
264
- }
265
- export interface GetCurrentRealmRequest {
266
- }
267
- export interface GetExplorerConfigurationRequest {
268
- }
269
- export interface GetDecentralandTimeRequest {
270
- }
271
-
272
- // Function declaration section
273
- export function getBootstrapData(body: GetBootstrapDataRequest): Promise<BootstrapDataResponse>;
274
- export function isPreviewMode(body: IsPreviewModeRequest): Promise<PreviewModeResponse>;
275
- export function getPlatform(body: GetPlatformRequest): Promise<GetPlatformResponse>;
276
- export function areUnsafeRequestAllowed(body: AreUnsafeRequestAllowedRequest): Promise<AreUnsafeRequestAllowedResponse>;
277
- export function getCurrentRealm(body: GetCurrentRealmRequest): Promise<GetCurrentRealmResponse>;
278
- export function getExplorerConfiguration(body: GetExplorerConfigurationRequest): Promise<GetExplorerConfigurationResponse>;
279
- export function getDecentralandTime(body: GetDecentralandTimeRequest): Promise<GetDecentralandTimeResponse>;
280
-
281
- }
282
- /**
283
- * EthereumController
284
- */
285
- declare module "~system/EthereumController" {
286
-
287
- export interface RequirePaymentRequest {
288
- toAddress: string;
289
- amount: number;
290
- currency: string;
291
- }
292
- export interface RequirePaymentResponse {
293
- jsonAnyResponse: string;
294
- }
295
- export interface SignMessageRequest {
296
- message: {
297
- [key: string]: string;
298
- };
299
- }
300
- export interface SignMessageRequest_MessageEntry {
301
- key: string;
302
- value: string;
303
- }
304
- export interface SignMessageResponse {
305
- message: string;
306
- hexEncodedMessage: string;
307
- signature: string;
308
- }
309
- export interface ConvertMessageToObjectRequest {
310
- message: string;
311
- }
312
- export interface ConvertMessageToObjectResponse {
313
- dict: {
314
- [key: string]: string;
315
- };
316
- }
317
- export interface ConvertMessageToObjectResponse_DictEntry {
318
- key: string;
319
- value: string;
320
- }
321
- export interface SendAsyncRequest {
322
- id: number;
323
- method: string;
324
- jsonParams: string;
325
- }
326
- export interface SendAsyncResponse {
327
- jsonAnyResponse: string;
328
- }
329
- export interface GetUserAccountRequest {
330
- }
331
- export interface GetUserAccountResponse {
332
- address?: string | undefined;
333
- }
334
-
335
- // Function declaration section
336
- export function requirePayment(body: RequirePaymentRequest): Promise<RequirePaymentResponse>;
337
- export function signMessage(body: SignMessageRequest): Promise<SignMessageResponse>;
338
- export function convertMessageToObject(body: ConvertMessageToObjectRequest): Promise<ConvertMessageToObjectResponse>;
339
- export function sendAsync(body: SendAsyncRequest): Promise<SendAsyncResponse>;
340
- export function getUserAccount(body: GetUserAccountRequest): Promise<GetUserAccountResponse>;
341
-
342
- }
343
- /**
344
- * Players
345
- */
346
- declare module "~system/Players" {
347
-
348
- export interface Snapshots {
349
- face256: string;
350
- body: string;
351
- }
352
- export interface AvatarForUserData {
353
- bodyShape: string;
354
- skinColor: string;
355
- hairColor: string;
356
- eyeColor: string;
357
- wearables: string[];
358
- snapshots: Snapshots | undefined;
359
- }
360
- export interface UserData {
361
- displayName: string;
362
- publicKey?: string | undefined;
363
- hasConnectedWeb3: boolean;
364
- userId: string;
365
- version: number;
366
- avatar: AvatarForUserData | undefined;
367
- }
368
-
369
- // Function declaration section
370
- export interface Player {
371
- userId: string;
372
- }
373
- export interface PlayersGetUserDataResponse {
374
- data?: UserData | undefined;
375
- }
376
- export interface PlayerListResponse {
377
- players: Player[];
378
- }
379
- export interface GetPlayerDataRequest {
380
- userId: string;
381
- }
382
- export interface GetPlayersInSceneRequest {
383
- }
384
- export interface GetConnectedPlayersRequest {
385
- }
386
-
387
- // Function declaration section
388
- export function getPlayerData(body: GetPlayerDataRequest): Promise<PlayersGetUserDataResponse>;
389
- export function getPlayersInScene(body: GetPlayersInSceneRequest): Promise<PlayerListResponse>;
390
- export function getConnectedPlayers(body: GetConnectedPlayersRequest): Promise<PlayerListResponse>;
391
-
392
- }
393
- /**
394
- * RestrictedActions
395
- */
396
- declare module "~system/RestrictedActions" {
397
-
398
- export interface Vector3 {
399
- x: number;
400
- y: number;
401
- z: number;
402
- }
403
- export interface MovePlayerToResponse {
404
- }
405
- export interface MovePlayerToRequest {
406
- newRelativePosition: Vector3 | undefined;
407
- cameraTarget?: Vector3 | undefined;
408
- }
409
- export interface TeleportToRequest {
410
- worldPosition: Vector3 | undefined;
411
- cameraTarget?: Vector3 | undefined;
412
- }
413
- export interface TriggerEmoteResponse {
414
- }
415
- export interface TriggerEmoteRequest {
416
- predefinedEmote: string;
417
- }
418
- export interface ChangeRealmRequest {
419
- realm: string;
420
- message?: string | undefined;
421
- }
422
- export interface OpenExternalUrlRequest {
423
- url: string;
424
- }
425
- export interface OpenNftDialogRequest {
426
- urn: string;
427
- }
428
- export interface UnblockPointerRequest {
429
- }
430
- export interface CommsAdapterRequest {
431
- connectionString: string;
432
- }
433
- export interface SuccessResponse {
434
- success: boolean;
435
- }
436
-
437
- // Function declaration section
438
- export function movePlayerTo(body: MovePlayerToRequest): Promise<MovePlayerToResponse>;
439
- export function teleportTo(body: TeleportToRequest): Promise<MovePlayerToResponse>;
440
- export function triggerEmote(body: TriggerEmoteRequest): Promise<TriggerEmoteResponse>;
441
- export function changeRealm(body: ChangeRealmRequest): Promise<SuccessResponse>;
442
- export function openExternalUrl(body: OpenExternalUrlRequest): Promise<SuccessResponse>;
443
- export function openNftDialog(body: OpenNftDialogRequest): Promise<SuccessResponse>;
444
- export function setCommunicationsAdapter(body: CommsAdapterRequest): Promise<SuccessResponse>;
445
-
446
- }
447
- /**
448
- * Runtime
449
- */
450
- declare module "~system/Runtime" {
451
-
452
- export interface RealmInfo {
453
- baseUrl: string;
454
- realmName: string;
455
- networkId: number;
456
- commsAdapter: string;
457
- isPreview: boolean;
458
- }
459
- export interface GetRealmResponse {
460
- realmInfo?: RealmInfo | undefined;
461
- }
462
- export interface GetWorldTimeResponse {
463
- seconds: number;
464
- }
465
- export interface GetRealmRequest {
466
- }
467
- export interface GetWorldTimeRequest {
468
- }
469
-
470
- // Function declaration section
471
- export function getRealm(body: GetRealmRequest): Promise<GetRealmResponse>;
472
- export function getWorldTime(body: GetWorldTimeRequest): Promise<GetWorldTimeResponse>;
473
-
474
- }
475
- /**
476
- * Scene
477
- */
478
- declare module "~system/Scene" {
479
-
480
- export interface ContentMapping {
481
- file: string;
482
- hash: string;
483
- }
484
-
485
- // Function declaration section
486
- export interface GetSceneRequest {
487
- }
488
- export interface GetSceneResponse {
489
- cid: string;
490
- metadata: string;
491
- baseUrl: string;
492
- contents: ContentMapping[];
493
- }
494
-
495
- // Function declaration section
496
- export function getSceneInfo(body: GetSceneRequest): Promise<GetSceneResponse>;
497
-
498
- }
499
- /**
500
- * SignedFetch
501
- */
502
- declare module "~system/SignedFetch" {
503
-
504
- export interface FlatFetchInit {
505
- method?: string | undefined;
506
- body?: string | undefined;
507
- headers: {
508
- [key: string]: string;
509
- };
510
- }
511
- export interface FlatFetchInit_HeadersEntry {
512
- key: string;
513
- value: string;
514
- }
515
- export interface FlatFetchResponse {
516
- ok: boolean;
517
- status: number;
518
- statusText: string;
519
- headers: {
520
- [key: string]: string;
521
- };
522
- body: string;
523
- }
524
- export interface FlatFetchResponse_HeadersEntry {
525
- key: string;
526
- value: string;
527
- }
528
- export interface SignedFetchRequest {
529
- url: string;
530
- init?: FlatFetchInit | undefined;
531
- }
532
-
533
- // Function declaration section
534
- export function signedFetch(body: SignedFetchRequest): Promise<FlatFetchResponse>;
535
-
536
- }
537
- /**
538
- * UserActionModule
539
- */
540
- declare module "~system/UserActionModule" {
541
-
542
- export interface RequestTeleportRequest {
543
- destination: string;
544
- }
545
- export interface RequestTeleportResponse {
546
- }
547
-
548
- // Function declaration section
549
- export function requestTeleport(body: RequestTeleportRequest): Promise<RequestTeleportResponse>;
550
-
551
- }
552
- /**
553
- * UserIdentity
554
- */
555
- declare module "~system/UserIdentity" {
556
-
557
- export interface Snapshots {
558
- face256: string;
559
- body: string;
560
- }
561
- export interface AvatarForUserData {
562
- bodyShape: string;
563
- skinColor: string;
564
- hairColor: string;
565
- eyeColor: string;
566
- wearables: string[];
567
- snapshots: Snapshots | undefined;
568
- }
569
- export interface UserData {
570
- displayName: string;
571
- publicKey?: string | undefined;
572
- hasConnectedWeb3: boolean;
573
- userId: string;
574
- version: number;
575
- avatar: AvatarForUserData | undefined;
576
- }
577
-
578
- // Function declaration section
579
- export interface GetUserDataRequest {
580
- }
581
- export interface GetUserDataResponse {
582
- data?: UserData | undefined;
583
- }
584
- export interface GetUserPublicKeyRequest {
585
- }
586
- export interface GetUserPublicKeyResponse {
587
- address?: string | undefined;
588
- }
589
-
590
- // Function declaration section
591
- export function getUserPublicKey(body: GetUserPublicKeyRequest): Promise<GetUserPublicKeyResponse>;
592
- export function getUserData(body: GetUserDataRequest): Promise<GetUserDataResponse>;
593
-
594
- }
package/index.d.ts DELETED
@@ -1,90 +0,0 @@
1
- /// --- FETCH ---
2
- /// <reference path="./apis.d.ts" />
3
-
4
- type RequestRedirect = 'follow' | 'error' | 'manual'
5
- type ResponseType = 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
6
-
7
- interface RequestInit {
8
- // whatwg/fetch standard options
9
- body?: string
10
- headers?: { [index: string]: string }
11
- method?: string
12
- redirect?: RequestRedirect
13
-
14
- // custom DCL property
15
- timeout?: number
16
- }
17
-
18
- interface ReadOnlyHeaders {
19
- get(name: string): string | null
20
- has(name: string): boolean
21
- forEach(callbackfn: (value: string, key: string, parent: ReadOnlyHeaders) => void, thisArg?: any): void
22
- }
23
-
24
- interface Response {
25
- readonly headers: ReadOnlyHeaders
26
- readonly ok: boolean
27
- readonly redirected: boolean
28
- readonly status: number
29
- readonly statusText: string
30
- readonly type: ResponseType
31
- readonly url: string
32
-
33
- json(): Promise<any>
34
- text(): Promise<string>
35
- }
36
-
37
- declare function fetch(url: string, init?: RequestInit): Promise<Response>
38
-
39
- /// --- WebSocket ---
40
-
41
- interface Event {
42
- readonly type: string
43
- }
44
-
45
- interface MessageEvent extends Event {
46
- /**
47
- * Returns the data of the message.
48
- */
49
- readonly data: any
50
- }
51
-
52
- interface CloseEvent extends Event {
53
- readonly code: number
54
- readonly reason: string
55
- readonly wasClean: boolean
56
- }
57
-
58
- interface WebSocket {
59
- readonly bufferedAmount: number
60
- readonly extensions: string
61
- onclose: ((this: WebSocket, ev: CloseEvent) => any) | null
62
- onerror: ((this: WebSocket, ev: Event) => any) | null
63
- onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null
64
- onopen: ((this: WebSocket, ev: Event) => any) | null
65
- readonly protocol: string
66
- readonly readyState: number
67
- readonly url: string
68
- close(code?: number, reason?: string): void
69
- send(data: string): void
70
- readonly CLOSED: number
71
- readonly CLOSING: number
72
- readonly CONNECTING: number
73
- readonly OPEN: number
74
- }
75
-
76
- declare var WebSocket: {
77
- prototype: WebSocket
78
- new (url: string, protocols?: string | string[]): WebSocket
79
- readonly CLOSED: number
80
- readonly CLOSING: number
81
- readonly CONNECTING: number
82
- readonly OPEN: number
83
- }
84
-
85
- declare var console: {
86
- log(message?: any, ...optionalParams: any[]): void;
87
- error(message?: any, ...optionalParams: any[]): void;
88
- }
89
-
90
- declare const DEBUG: boolean
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2020",
4
- "module": "ESNext",
5
- "strict": true,
6
- "declarationDir": "dist",
7
- "outDir": "dist",
8
- "strictNullChecks": true,
9
- "inlineSourceMap": true,
10
- "inlineSources": true,
11
- "declaration": true,
12
- "stripInternal": true,
13
- "moduleResolution": "Node",
14
- "pretty": true,
15
- "forceConsistentCasingInFileNames": true,
16
- "allowSyntheticDefaultImports": true,
17
- "experimentalDecorators": true,
18
- "emitDecoratorMetadata": false,
19
- "downlevelIteration": true,
20
- "noUnusedLocals": true,
21
- "lib": ["ES2020"],
22
- "types": []
23
- }
24
- }