@playdrop/playdrop-cli 0.11.9 → 0.12.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.
Files changed (72) hide show
  1. package/config/client-meta.json +1 -1
  2. package/dist/apps/build.js +2 -3
  3. package/dist/apps/index.d.ts +4 -5
  4. package/dist/apps/index.js +14 -16
  5. package/dist/apps/loadCheck.d.ts +76 -0
  6. package/dist/apps/loadCheck.js +874 -0
  7. package/dist/apps/upload.d.ts +3 -2
  8. package/dist/apps/upload.js +110 -6
  9. package/dist/catalogue-utils.d.ts +1 -0
  10. package/dist/catalogue-utils.js +1 -0
  11. package/dist/catalogue.d.ts +2 -0
  12. package/dist/catalogue.js +17 -0
  13. package/dist/commands/build.js +4 -1
  14. package/dist/commands/captureListing.d.ts +30 -1
  15. package/dist/commands/captureListing.js +305 -120
  16. package/dist/commands/check.d.ts +8 -0
  17. package/dist/commands/check.js +188 -0
  18. package/dist/commands/review.d.ts +20 -0
  19. package/dist/commands/review.js +112 -0
  20. package/dist/commands/upload-content.d.ts +1 -1
  21. package/dist/commands/upload.d.ts +2 -1
  22. package/dist/commands/upload.js +9 -52
  23. package/dist/commands/validate.js +0 -155
  24. package/dist/commands/worker/runtime.d.ts +1 -0
  25. package/dist/commands/worker/runtime.js +43 -3
  26. package/dist/commands/worker.d.ts +1 -1
  27. package/dist/commands/worker.js +22 -44
  28. package/dist/index.js +33 -49
  29. package/dist/playwright.d.ts +5 -0
  30. package/dist/playwright.js +60 -1
  31. package/node_modules/@playdrop/api-client/dist/client.d.ts +4 -2
  32. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  33. package/node_modules/@playdrop/api-client/dist/client.js +0 -10
  34. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +2 -1
  35. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  36. package/node_modules/@playdrop/api-client/dist/domains/apps.js +11 -0
  37. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +3 -1
  38. package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
  39. package/node_modules/@playdrop/api-client/dist/domains/auth.js +22 -0
  40. package/node_modules/@playdrop/api-client/dist/index.d.ts +4 -3
  41. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  42. package/node_modules/@playdrop/api-client/dist/index.js +10 -5
  43. package/node_modules/@playdrop/config/client-meta.json +1 -1
  44. package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +8 -0
  45. package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -0
  46. package/node_modules/@playdrop/config/dist/src/client-meta.js +51 -0
  47. package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
  48. package/node_modules/@playdrop/config/dist/src/deployment.js +2 -32
  49. package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
  50. package/node_modules/@playdrop/config/dist/src/index.js +2 -28
  51. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +0 -1
  52. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
  53. package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +21 -5
  54. package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +8 -0
  55. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  56. package/node_modules/@playdrop/types/dist/api.d.ts +19 -14
  57. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  58. package/node_modules/@playdrop/types/dist/api.js +5 -10
  59. package/node_modules/@playdrop/types/dist/version.d.ts +14 -0
  60. package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/apps/launchCheck.d.ts +0 -39
  63. package/dist/apps/launchCheck.js +0 -414
  64. package/dist/captureRuntime.d.ts +0 -73
  65. package/dist/captureRuntime.js +0 -1021
  66. package/dist/commands/capture.d.ts +0 -14
  67. package/dist/commands/capture.js +0 -548
  68. package/dist/commands/captureRemote.d.ts +0 -17
  69. package/dist/commands/captureRemote.js +0 -394
  70. package/node_modules/@playdrop/types/dist/entity.d.ts +0 -31
  71. package/node_modules/@playdrop/types/dist/entity.d.ts.map +0 -1
  72. package/node_modules/@playdrop/types/dist/entity.js +0 -67
@@ -1,394 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildCaptureRemoteCommandArgs = buildCaptureRemoteCommandArgs;
4
- exports.captureRemote = captureRemote;
5
- const promises_1 = require("node:fs/promises");
6
- const node_path_1 = require("node:path");
7
- const types_1 = require("@playdrop/types");
8
- const commandContext_1 = require("../commandContext");
9
- const http_1 = require("../http");
10
- const messages_1 = require("../messages");
11
- const devShared_1 = require("./devShared");
12
- const captureRuntime_1 = require("../captureRuntime");
13
- const MOBILE_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1';
14
- const SURFACE_CONTEXT_OPTIONS = {
15
- desktop: {
16
- viewport: { width: 1280, height: 720 },
17
- deviceScaleFactor: 1,
18
- isMobile: false,
19
- hasTouch: false,
20
- },
21
- 'mobile-landscape': {
22
- viewport: { width: 896, height: 414 },
23
- deviceScaleFactor: 2,
24
- isMobile: true,
25
- hasTouch: true,
26
- userAgent: MOBILE_USER_AGENT,
27
- },
28
- 'mobile-portrait': {
29
- viewport: { width: 414, height: 896 },
30
- deviceScaleFactor: 2,
31
- isMobile: true,
32
- hasTouch: true,
33
- userAgent: MOBILE_USER_AGENT,
34
- },
35
- };
36
- function readUnsupportedPlaydropCaptureMessage(targetUrl) {
37
- let parsed;
38
- try {
39
- parsed = new URL(targetUrl);
40
- }
41
- catch {
42
- return null;
43
- }
44
- const hostname = parsed.hostname.toLowerCase();
45
- const isPlaydropHost = hostname === 'www.playdrop.ai'
46
- || hostname === 'playdrop.ai'
47
- || hostname === 'localhost'
48
- || hostname === '127.0.0.1';
49
- if (!isPlaydropHost) {
50
- return null;
51
- }
52
- const pathname = parsed.pathname.replace(/\/+$/, '') || '/';
53
- const matchesCreatorAppRoute = /^\/(?:_auth\/)?creators\/[^/]+\/apps\/[^/]+\/[^/]+(?:\/.*)?$/i.test(pathname);
54
- if (!matchesCreatorAppRoute || pathname.endsWith('/play')) {
55
- return null;
56
- }
57
- return `Only Playdrop /play URLs are supported for remote capture. Use ${parsed.origin}${pathname}/play instead.`;
58
- }
59
- function parseTimeout(raw) {
60
- if (raw === undefined) {
61
- return 10;
62
- }
63
- const parsed = typeof raw === 'number' ? raw : Number.parseFloat(String(raw));
64
- if (!Number.isFinite(parsed) || parsed <= 0 || parsed > 600) {
65
- throw new Error('invalid_timeout');
66
- }
67
- return parsed;
68
- }
69
- function parseSettle(raw) {
70
- if (raw === undefined) {
71
- return 1;
72
- }
73
- const parsed = typeof raw === 'number' ? raw : Number.parseFloat(String(raw));
74
- if (!Number.isFinite(parsed) || parsed < 0 || parsed > 600) {
75
- throw new Error('invalid_settle');
76
- }
77
- return parsed;
78
- }
79
- function parseViewport(raw) {
80
- const value = raw?.trim();
81
- if (!value) {
82
- return null;
83
- }
84
- const match = /^(\d{2,5})x(\d{2,5})$/i.exec(value);
85
- if (!match) {
86
- throw new Error('invalid_viewport');
87
- }
88
- const width = Number.parseInt(match[1], 10);
89
- const height = Number.parseInt(match[2], 10);
90
- if (width < 320 || width > 4096 || height < 320 || height > 4096) {
91
- throw new Error('invalid_viewport');
92
- }
93
- return { width, height };
94
- }
95
- function parseSurface(raw) {
96
- const normalized = raw?.trim().toLowerCase();
97
- if (!normalized) {
98
- return null;
99
- }
100
- if (normalized === 'desktop' || normalized === 'mobile-landscape' || normalized === 'mobile-portrait') {
101
- return normalized;
102
- }
103
- throw new Error('invalid_surface');
104
- }
105
- function parseFpsSampleMs(raw) {
106
- if (raw === undefined) {
107
- return null;
108
- }
109
- const parsed = typeof raw === 'number' ? raw : Number.parseFloat(String(raw));
110
- if (!Number.isInteger(parsed) || parsed < 100 || parsed > 60000) {
111
- throw new Error('invalid_fps_sample_ms');
112
- }
113
- return parsed;
114
- }
115
- function normalizeCaptureAction(raw, index) {
116
- if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
117
- throw new Error(`invalid_action:${index}`);
118
- }
119
- const action = raw;
120
- const type = typeof action.type === 'string' ? action.type.trim() : '';
121
- if (type === 'click') {
122
- const x = typeof action.x === 'number' ? action.x : Number.NaN;
123
- const y = typeof action.y === 'number' ? action.y : Number.NaN;
124
- const button = typeof action.button === 'string' ? action.button.trim() : undefined;
125
- if (!Number.isFinite(x) || !Number.isFinite(y) || x < 0 || y < 0) {
126
- throw new Error(`invalid_action:${index}:click_coordinates`);
127
- }
128
- if (button !== undefined && button !== 'left' && button !== 'right' && button !== 'middle') {
129
- throw new Error(`invalid_action:${index}:click_button`);
130
- }
131
- return button ? { type: 'click', x, y, button } : { type: 'click', x, y };
132
- }
133
- if (type === 'press') {
134
- const key = typeof action.key === 'string' ? action.key.trim() : '';
135
- if (!key) {
136
- throw new Error(`invalid_action:${index}:press_key`);
137
- }
138
- return { type: 'press', key };
139
- }
140
- if (type === 'wait') {
141
- const ms = typeof action.ms === 'number' ? action.ms : Number.NaN;
142
- if (!Number.isInteger(ms) || ms < 0 || ms > 60000) {
143
- throw new Error(`invalid_action:${index}:wait_ms`);
144
- }
145
- return { type: 'wait', ms };
146
- }
147
- throw new Error(`invalid_action:${index}:type`);
148
- }
149
- async function readCaptureActions(actionsPath) {
150
- if (!actionsPath) {
151
- return null;
152
- }
153
- let parsed;
154
- try {
155
- parsed = JSON.parse(await (0, promises_1.readFile)(actionsPath, 'utf8'));
156
- }
157
- catch (error) {
158
- throw new Error(`invalid_actions_file:${error instanceof Error ? error.message : String(error)}`);
159
- }
160
- if (!Array.isArray(parsed)) {
161
- throw new Error('invalid_actions_file:expected_array');
162
- }
163
- if (parsed.length > 100) {
164
- throw new Error('invalid_actions_file:too_many_actions');
165
- }
166
- return parsed.map((entry, index) => normalizeCaptureAction(entry, index));
167
- }
168
- function assertValidUrl(value, errorCode) {
169
- try {
170
- new URL(value);
171
- }
172
- catch {
173
- throw new Error(errorCode);
174
- }
175
- }
176
- function parseCredentialPair(options) {
177
- const username = options.username?.trim() || '';
178
- const password = options.password || '';
179
- if ((username && !password) || (!username && password)) {
180
- throw new Error('invalid_credentials_pair');
181
- }
182
- return { username, password };
183
- }
184
- function pushOptionalArg(args, flag, value) {
185
- if (!value?.trim()) {
186
- return;
187
- }
188
- args.push(flag, value.trim());
189
- }
190
- function buildCaptureRemoteCommandArgs(url, options = {}) {
191
- const trimmedUrl = typeof url === 'string' ? url.trim() : '';
192
- if (!trimmedUrl) {
193
- return null;
194
- }
195
- const { username, password } = parseCredentialPair(options);
196
- const args = ['--url', trimmedUrl];
197
- if (options.timeout !== undefined) {
198
- args.push('--timeout', String(parseTimeout(options.timeout)));
199
- }
200
- if (options.settle !== undefined) {
201
- args.push('--settle', String(parseSettle(options.settle)));
202
- }
203
- pushOptionalArg(args, '--screenshot', options.screenshot);
204
- pushOptionalArg(args, '--log', options.log);
205
- pushOptionalArg(args, '--expected-url', options.expectedUrl);
206
- pushOptionalArg(args, '--actions', options.actions);
207
- pushOptionalArg(args, '--viewport', options.viewport);
208
- pushOptionalArg(args, '--surface', options.surface);
209
- if (options.fpsSampleMs !== undefined) {
210
- args.push('--fps-sample-ms', String(parseFpsSampleMs(options.fpsSampleMs)));
211
- }
212
- if (username) {
213
- args.push('--username', username, '--password', password);
214
- }
215
- pushOptionalArg(args, '--login-url', options.loginUrl);
216
- return args;
217
- }
218
- function parseOptions(url, options = {}) {
219
- const trimmedUrl = typeof url === 'string' ? url.trim() : '';
220
- if (!trimmedUrl) {
221
- throw new Error('missing_url');
222
- }
223
- assertValidUrl(trimmedUrl, 'invalid_url');
224
- const expectedUrl = options.expectedUrl?.trim() || null;
225
- if (expectedUrl) {
226
- assertValidUrl(expectedUrl, 'invalid_expected_url');
227
- }
228
- const unsupportedPlaydropCaptureMessage = readUnsupportedPlaydropCaptureMessage(trimmedUrl);
229
- if (unsupportedPlaydropCaptureMessage) {
230
- throw new Error(`unsupported_playdrop_capture_target:${unsupportedPlaydropCaptureMessage}`);
231
- }
232
- const { username, password } = parseCredentialPair(options);
233
- return {
234
- targetUrl: trimmedUrl,
235
- expectedUrl,
236
- timeoutSeconds: parseTimeout(options.timeout),
237
- settleSeconds: parseSettle(options.settle),
238
- screenshotPath: (0, node_path_1.resolve)(process.cwd(), options.screenshot?.trim() || 'output/playwright/capture-url.png'),
239
- logPath: options.log?.trim() ? (0, node_path_1.resolve)(process.cwd(), options.log.trim()) : null,
240
- actionsPath: options.actions?.trim() ? (0, node_path_1.resolve)(process.cwd(), options.actions.trim()) : null,
241
- viewport: parseViewport(options.viewport),
242
- surface: parseSurface(options.surface),
243
- fpsSampleMs: parseFpsSampleMs(options.fpsSampleMs),
244
- login: username
245
- ? {
246
- username,
247
- password,
248
- loginUrl: options.loginUrl?.trim() || null,
249
- }
250
- : null,
251
- };
252
- }
253
- async function captureRemote(url, options = {}) {
254
- let parsed;
255
- try {
256
- parsed = parseOptions(url, options);
257
- }
258
- catch (error) {
259
- if (error instanceof Error && error.message.startsWith('unsupported_playdrop_capture_target:')) {
260
- const detail = error.message.slice('unsupported_playdrop_capture_target:'.length).trim();
261
- (0, messages_1.printErrorWithHelp)(detail, [], { command: 'project capture remote' });
262
- process.exitCode = 1;
263
- return;
264
- }
265
- if (error instanceof Error && error.message === 'invalid_expected_url') {
266
- (0, messages_1.printErrorWithHelp)('The --expected-url value must be a valid URL.', [], { command: 'project capture remote' });
267
- process.exitCode = 1;
268
- return;
269
- }
270
- if (error instanceof Error && error.message === 'invalid_timeout') {
271
- (0, messages_1.printErrorWithHelp)('The --timeout value must be a number between 0 and 600 seconds.', [], { command: 'project capture remote' });
272
- process.exitCode = 1;
273
- return;
274
- }
275
- if (error instanceof Error && error.message === 'invalid_settle') {
276
- (0, messages_1.printErrorWithHelp)('The --settle value must be a number between 0 and 600 seconds.', [], { command: 'project capture remote' });
277
- process.exitCode = 1;
278
- return;
279
- }
280
- if (error instanceof Error && error.message === 'invalid_viewport') {
281
- (0, messages_1.printErrorWithHelp)('The --viewport value must be WIDTHxHEIGHT with each side between 320 and 4096 pixels.', [], { command: 'project capture remote' });
282
- process.exitCode = 1;
283
- return;
284
- }
285
- if (error instanceof Error && error.message === 'invalid_surface') {
286
- (0, messages_1.printErrorWithHelp)('The --surface value must be desktop, mobile-landscape, or mobile-portrait.', [], { command: 'project capture remote' });
287
- process.exitCode = 1;
288
- return;
289
- }
290
- if (error instanceof Error && error.message === 'invalid_fps_sample_ms') {
291
- (0, messages_1.printErrorWithHelp)('The --fps-sample-ms value must be an integer between 100 and 60000 milliseconds.', [], { command: 'project capture remote' });
292
- process.exitCode = 1;
293
- return;
294
- }
295
- if (error instanceof Error && error.message === 'invalid_credentials_pair') {
296
- (0, messages_1.printErrorWithHelp)('Use --username and --password together.', [], { command: 'project capture remote' });
297
- process.exitCode = 1;
298
- return;
299
- }
300
- if (error instanceof Error && error.message === 'invalid_url') {
301
- (0, messages_1.printErrorWithHelp)('A valid URL is required.', ['Example: playdrop project capture remote https://www.playdrop.ai/creators/playdrop/apps/game/hangingout/play'], { command: 'project capture remote' });
302
- process.exitCode = 1;
303
- return;
304
- }
305
- (0, messages_1.printErrorWithHelp)('A URL is required.', ['Example: playdrop project capture remote https://www.playdrop.ai/creators/playdrop/apps/game/hangingout/play'], { command: 'project capture remote' });
306
- process.exitCode = 1;
307
- return;
308
- }
309
- let actions = null;
310
- try {
311
- actions = await readCaptureActions(parsed.actionsPath);
312
- }
313
- catch (error) {
314
- (0, messages_1.printErrorWithHelp)(error instanceof Error ? error.message : String(error), [], { command: 'project capture remote' });
315
- process.exitCode = 1;
316
- return;
317
- }
318
- await (0, commandContext_1.withEnvironment)('project capture remote', 'Capturing remote app logs', async ({ client, token }) => {
319
- let currentUser = null;
320
- try {
321
- currentUser = await (0, devShared_1.fetchDevUser)(client);
322
- }
323
- catch (error) {
324
- if (error instanceof http_1.CLIUnsupportedClientError) {
325
- return;
326
- }
327
- if (error instanceof types_1.UnsupportedClientError) {
328
- (0, http_1.handleUnsupportedError)(error, 'Authentication');
329
- process.exitCode = 1;
330
- return;
331
- }
332
- if (error instanceof types_1.ApiError) {
333
- (0, messages_1.printErrorWithHelp)(`Could not fetch your account (status ${error.status}).`, [
334
- 'Run "playdrop auth login" to refresh your session and ensure the API is reachable.',
335
- 'Use "playdrop auth whoami" afterwards to confirm your status.',
336
- ], { command: 'project capture remote' });
337
- process.exitCode = 1;
338
- return;
339
- }
340
- if ((0, devShared_1.isNetworkError)(error)) {
341
- (0, messages_1.printNetworkIssue)('Could not reach the Playdrop API to resolve your account.', 'project capture remote');
342
- process.exitCode = 1;
343
- return;
344
- }
345
- throw error;
346
- }
347
- console.log(`[capture] Launching Playwright against ${parsed.targetUrl}`);
348
- try {
349
- const result = await (0, captureRuntime_1.runCapture)({
350
- targetUrl: parsed.targetUrl,
351
- expectedUrl: parsed.expectedUrl ?? parsed.targetUrl,
352
- timeoutMs: Math.round(parsed.timeoutSeconds * 1000),
353
- settleAfterReadyMs: Math.round(parsed.settleSeconds * 1000),
354
- minimumLogLevel: 'info',
355
- screenshotPath: parsed.screenshotPath,
356
- logPath: parsed.logPath,
357
- token: parsed.login ? undefined : token,
358
- user: parsed.login ? undefined : currentUser,
359
- login: parsed.login,
360
- actions: actions ?? undefined,
361
- contextOptions: parsed.surface
362
- ? { ...SURFACE_CONTEXT_OPTIONS[parsed.surface], ...(parsed.viewport ? { viewport: parsed.viewport } : {}) }
363
- : parsed.viewport
364
- ? { viewport: parsed.viewport }
365
- : undefined,
366
- frameRateSampleMs: parsed.fpsSampleMs ?? undefined,
367
- });
368
- if (result.errorCount > 0) {
369
- console.error(`[capture] Completed with ${result.errorCount} error(s) after timeout=${parsed.timeoutSeconds}s settle=${parsed.settleSeconds}s.`);
370
- process.exitCode = 1;
371
- }
372
- else {
373
- console.log(`[capture] Completed without console errors after timeout=${parsed.timeoutSeconds}s settle=${parsed.settleSeconds}s.`);
374
- }
375
- }
376
- catch (error) {
377
- if (error instanceof http_1.CLIUnsupportedClientError) {
378
- return;
379
- }
380
- if (error instanceof types_1.UnsupportedClientError) {
381
- (0, http_1.handleUnsupportedError)(error, 'Capture');
382
- process.exitCode = 1;
383
- return;
384
- }
385
- if (error instanceof Error && error.stack) {
386
- console.error(error.stack);
387
- }
388
- else {
389
- console.error(error instanceof Error ? error.message : String(error));
390
- }
391
- process.exitCode = 1;
392
- }
393
- });
394
- }
@@ -1,31 +0,0 @@
1
- export declare const ENTITY_TYPE_VALUES: readonly ["AVATAR", "HUMANOID", "CREATURE", "BLOCK"];
2
- export type EntityType = (typeof ENTITY_TYPE_VALUES)[number];
3
- export declare const AVATAR_VISIBILITY_VALUES: readonly ["DEFAULT", "SHOP", "HIDDEN"];
4
- export type AvatarVisibility = (typeof AVATAR_VISIBILITY_VALUES)[number];
5
- export interface EntityMetadataBase {
6
- id: number;
7
- name: string;
8
- displayName: string;
9
- description: string;
10
- creatorId: number;
11
- creatorUsername: string;
12
- createdAt: string;
13
- updatedAt: string;
14
- meshUrl: string;
15
- previewUrl: string;
16
- boxelUrl: string;
17
- meshSizeBytes?: number | null;
18
- previewSizeBytes?: number | null;
19
- definitionSizeBytes?: number | null;
20
- type: EntityType;
21
- priceCredits?: number | null;
22
- avatarVisibility?: AvatarVisibility | null;
23
- }
24
- export type EntityMetadata = EntityMetadataBase;
25
- export type CreatureMetadata = EntityMetadata;
26
- export type HumanoidMetadata = CreatureMetadata;
27
- export type AvatarMetadata = HumanoidMetadata;
28
- export type BlockMetadata = EntityMetadata;
29
- export declare function isEntityType(value: unknown): value is EntityType;
30
- export declare function isEntityMetadata(value: unknown): value is EntityMetadata;
31
- //# sourceMappingURL=entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../src/entity.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,sDAAuD,CAAC;AACvF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,wBAAwB,wCAAyC,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAM3C,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAKhE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CA+CxE"}
@@ -1,67 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var entity_exports = {};
19
- __export(entity_exports, {
20
- AVATAR_VISIBILITY_VALUES: () => AVATAR_VISIBILITY_VALUES,
21
- ENTITY_TYPE_VALUES: () => ENTITY_TYPE_VALUES,
22
- isEntityMetadata: () => isEntityMetadata,
23
- isEntityType: () => isEntityType
24
- });
25
- module.exports = __toCommonJS(entity_exports);
26
- const ENTITY_TYPE_VALUES = ["AVATAR", "HUMANOID", "CREATURE", "BLOCK"];
27
- const AVATAR_VISIBILITY_VALUES = ["DEFAULT", "SHOP", "HIDDEN"];
28
- function isNullableNumber(value) {
29
- return value === null || value === void 0 || typeof value === "number" && Number.isFinite(value);
30
- }
31
- function isEntityType(value) {
32
- if (typeof value !== "string") {
33
- return false;
34
- }
35
- return ENTITY_TYPE_VALUES.includes(value);
36
- }
37
- function isEntityMetadata(value) {
38
- if (typeof value !== "object" || value === null) {
39
- return false;
40
- }
41
- const metadata = value;
42
- const id = metadata["id"];
43
- const name = metadata["name"];
44
- const displayName = metadata["displayName"];
45
- const description = metadata["description"];
46
- const creatorId = metadata["creatorId"];
47
- const creatorUsername = metadata["creatorUsername"];
48
- const createdAt = metadata["createdAt"];
49
- const updatedAt = metadata["updatedAt"];
50
- const meshUrl = metadata["meshUrl"];
51
- const previewUrl = metadata["previewUrl"];
52
- const boxelUrl = metadata["boxelUrl"];
53
- const meshSizeBytes = metadata["meshSizeBytes"];
54
- const previewSizeBytes = metadata["previewSizeBytes"];
55
- const definitionSizeBytes = metadata["definitionSizeBytes"];
56
- const type = metadata["type"];
57
- const priceCredits = metadata["priceCredits"];
58
- const avatarVisibility = metadata["avatarVisibility"];
59
- return typeof id === "number" && Number.isInteger(id) && typeof name === "string" && name.length > 0 && typeof displayName === "string" && typeof description === "string" && typeof creatorId === "number" && Number.isInteger(creatorId) && typeof creatorUsername === "string" && typeof createdAt === "string" && typeof updatedAt === "string" && typeof meshUrl === "string" && typeof previewUrl === "string" && typeof boxelUrl === "string" && isNullableNumber(meshSizeBytes) && isNullableNumber(previewSizeBytes) && isNullableNumber(definitionSizeBytes) && isEntityType(type) && (priceCredits === void 0 || priceCredits === null || typeof priceCredits === "number") && (avatarVisibility === void 0 || avatarVisibility === null || typeof avatarVisibility === "string" && AVATAR_VISIBILITY_VALUES.includes(avatarVisibility));
60
- }
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- AVATAR_VISIBILITY_VALUES,
64
- ENTITY_TYPE_VALUES,
65
- isEntityMetadata,
66
- isEntityType
67
- });