@playdrop/playdrop-cli 0.6.4 → 0.6.5

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 (53) hide show
  1. package/config/client-meta.json +4 -4
  2. package/dist/commands/create.js +17 -3
  3. package/node_modules/@playdrop/config/client-meta.json +4 -4
  4. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  5. package/package.json +1 -1
  6. package/node_modules/@playdrop/boxel-core/dist/test/entity-utils.test.d.ts +0 -1
  7. package/node_modules/@playdrop/boxel-core/dist/test/entity-utils.test.js +0 -92
  8. package/node_modules/@playdrop/boxel-core/dist/test/entity-utils.test.js.map +0 -1
  9. package/node_modules/@playdrop/boxel-core/dist/test/greedy-mesher.test.d.ts +0 -1
  10. package/node_modules/@playdrop/boxel-core/dist/test/greedy-mesher.test.js +0 -48
  11. package/node_modules/@playdrop/boxel-core/dist/test/greedy-mesher.test.js.map +0 -1
  12. package/node_modules/@playdrop/boxel-core/dist/test/humanoid/humanoid-builders.test.d.ts +0 -1
  13. package/node_modules/@playdrop/boxel-core/dist/test/humanoid/humanoid-builders.test.js +0 -270
  14. package/node_modules/@playdrop/boxel-core/dist/test/humanoid/humanoid-builders.test.js.map +0 -1
  15. package/node_modules/@playdrop/boxel-core/dist/test/index.test.d.ts +0 -1
  16. package/node_modules/@playdrop/boxel-core/dist/test/index.test.js +0 -48
  17. package/node_modules/@playdrop/boxel-core/dist/test/index.test.js.map +0 -1
  18. package/node_modules/@playdrop/boxel-core/dist/test/layer-mode.test.d.ts +0 -1
  19. package/node_modules/@playdrop/boxel-core/dist/test/layer-mode.test.js +0 -67
  20. package/node_modules/@playdrop/boxel-core/dist/test/layer-mode.test.js.map +0 -1
  21. package/node_modules/@playdrop/boxel-core/dist/test/materials.test.d.ts +0 -1
  22. package/node_modules/@playdrop/boxel-core/dist/test/materials.test.js +0 -55
  23. package/node_modules/@playdrop/boxel-core/dist/test/materials.test.js.map +0 -1
  24. package/node_modules/@playdrop/boxel-core/dist/test/palette-tools.test.d.ts +0 -1
  25. package/node_modules/@playdrop/boxel-core/dist/test/palette-tools.test.js +0 -124
  26. package/node_modules/@playdrop/boxel-core/dist/test/palette-tools.test.js.map +0 -1
  27. package/node_modules/@playdrop/boxel-core/dist/test/serialization.test.d.ts +0 -1
  28. package/node_modules/@playdrop/boxel-core/dist/test/serialization.test.js +0 -35
  29. package/node_modules/@playdrop/boxel-core/dist/test/serialization.test.js.map +0 -1
  30. package/node_modules/@playdrop/boxel-core/dist/test/textures.test.d.ts +0 -1
  31. package/node_modules/@playdrop/boxel-core/dist/test/textures.test.js +0 -120
  32. package/node_modules/@playdrop/boxel-core/dist/test/textures.test.js.map +0 -1
  33. package/node_modules/@playdrop/boxel-core/dist/test/types.test.d.ts +0 -1
  34. package/node_modules/@playdrop/boxel-core/dist/test/types.test.js +0 -32
  35. package/node_modules/@playdrop/boxel-core/dist/test/types.test.js.map +0 -1
  36. package/node_modules/@playdrop/boxel-core/dist/test/upscale.test.d.ts +0 -1
  37. package/node_modules/@playdrop/boxel-core/dist/test/upscale.test.js +0 -100
  38. package/node_modules/@playdrop/boxel-core/dist/test/upscale.test.js.map +0 -1
  39. package/node_modules/@playdrop/boxel-core/dist/test/validation.test.d.ts +0 -1
  40. package/node_modules/@playdrop/boxel-core/dist/test/validation.test.js +0 -61
  41. package/node_modules/@playdrop/boxel-core/dist/test/validation.test.js.map +0 -1
  42. package/node_modules/@playdrop/boxel-core/dist/test/voxels.test.d.ts +0 -1
  43. package/node_modules/@playdrop/boxel-core/dist/test/voxels.test.js +0 -51
  44. package/node_modules/@playdrop/boxel-core/dist/test/voxels.test.js.map +0 -1
  45. package/node_modules/@playdrop/config/dist/src/creator-docs.d.ts +0 -24
  46. package/node_modules/@playdrop/config/dist/src/creator-docs.d.ts.map +0 -1
  47. package/node_modules/@playdrop/config/dist/src/creator-docs.js +0 -253
  48. package/node_modules/@playdrop/config/dist/src/creator-faq.d.ts +0 -17
  49. package/node_modules/@playdrop/config/dist/src/creator-faq.d.ts.map +0 -1
  50. package/node_modules/@playdrop/config/dist/src/creator-faq.js +0 -141
  51. package/node_modules/@playdrop/config/dist/test/creator-docs.test.d.ts +0 -2
  52. package/node_modules/@playdrop/config/dist/test/creator-docs.test.d.ts.map +0 -1
  53. package/node_modules/@playdrop/config/dist/test/creator-docs.test.js +0 -36
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.4",
2
+ "version": "0.6.5",
3
3
  "build": 1,
4
4
  "platforms": {
5
5
  "ios": {
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "clients": {
28
28
  "web": {
29
- "minimumVersion": "0.6.4",
29
+ "minimumVersion": "0.6.5",
30
30
  "minimumBuild": 1
31
31
  },
32
32
  "admin": {
33
- "minimumVersion": "0.6.4",
33
+ "minimumVersion": "0.6.5",
34
34
  "minimumBuild": 1
35
35
  },
36
36
  "apple": {
@@ -46,7 +46,7 @@
46
46
  "minimumBuild": 1
47
47
  },
48
48
  "cli": {
49
- "minimumVersion": "0.6.4"
49
+ "minimumVersion": "0.6.5"
50
50
  }
51
51
  }
52
52
  }
@@ -19,11 +19,25 @@ const init_1 = require("./init");
19
19
  const app_1 = require("@playdrop/types/app");
20
20
  const catalogue_utils_1 = require("../catalogue-utils");
21
21
  const catalogue_1 = require("../catalogue");
22
+ const clientInfo_1 = require("../clientInfo");
22
23
  const CATALOGUE_FILENAME = 'catalogue.json';
23
24
  const LEGACY_CATALOGUE_VERSION_KEY = ['schema', 'Version'].join('');
24
25
  const ALLOWED_CATALOGUE_TOP_LEVEL_KEYS = new Set(['apps', 'assetSpecs', 'assets', 'assetPacks']);
25
- async function downloadArchive(url) {
26
- const response = await fetch(url);
26
+ function buildArchiveDownloadHeaders(url, apiBase, token) {
27
+ const targetUrl = new URL(url, apiBase);
28
+ const apiOrigin = new URL(apiBase).origin;
29
+ if (targetUrl.origin !== apiOrigin) {
30
+ return undefined;
31
+ }
32
+ const headers = new Headers((0, clientInfo_1.createClientHeaders)());
33
+ if (token.trim().length > 0) {
34
+ headers.set('authorization', `Bearer ${token}`);
35
+ }
36
+ return headers;
37
+ }
38
+ async function downloadArchive(url, apiBase, token) {
39
+ const headers = buildArchiveDownloadHeaders(url, apiBase, token);
40
+ const response = await fetch(url, headers ? { headers } : undefined);
27
41
  if (!response.ok) {
28
42
  throw new Error(`Failed to download project archive (${response.status})`);
29
43
  }
@@ -1179,7 +1193,7 @@ async function create(name, options = {}) {
1179
1193
  try {
1180
1194
  const archiveBuffer = remixSourceTarget
1181
1195
  ? new Uint8Array(await (await client.downloadAppSource(remixSourceTarget.creator, remixSourceTarget.name, remixSourceTarget.version)).blob.arrayBuffer())
1182
- : await downloadArchive(resolveArchiveDownloadUrl(scaffold.archiveUrl, ctx.envConfig.apiBase));
1196
+ : await downloadArchive(resolveArchiveDownloadUrl(scaffold.archiveUrl, ctx.envConfig.apiBase), ctx.envConfig.apiBase, ctx.token);
1183
1197
  const extraction = extractProjectArchive(archiveBuffer, projectDir);
1184
1198
  const extractedCatalogue = (0, node_path_1.resolve)(projectDir, CATALOGUE_FILENAME);
1185
1199
  projectCataloguePath = (0, node_fs_1.existsSync)(extractedCatalogue) ? extractedCatalogue : null;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.4",
2
+ "version": "0.6.5",
3
3
  "build": 1,
4
4
  "platforms": {
5
5
  "ios": {
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "clients": {
28
28
  "web": {
29
- "minimumVersion": "0.6.4",
29
+ "minimumVersion": "0.6.5",
30
30
  "minimumBuild": 1
31
31
  },
32
32
  "admin": {
33
- "minimumVersion": "0.6.4",
33
+ "minimumVersion": "0.6.5",
34
34
  "minimumBuild": 1
35
35
  },
36
36
  "apple": {
@@ -46,7 +46,7 @@
46
46
  "minimumBuild": 1
47
47
  },
48
48
  "cli": {
49
- "minimumVersion": "0.6.4"
49
+ "minimumVersion": "0.6.5"
50
50
  }
51
51
  }
52
52
  }