@team-monolith/pxt-core 0.7.1 → 0.7.2

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/built/pxt.js CHANGED
@@ -98008,9 +98008,9 @@ var pxt;
98008
98008
  async function getAuthHeadersAsync(authToken) {
98009
98009
  var _a;
98010
98010
  const headers = {};
98011
- const token = pxt.cookie.getCookieToken();
98012
- if (token) {
98013
- headers["Authorization"] = `Bearer ${token}`;
98011
+ authToken = authToken || (await getAuthTokenAsync());
98012
+ if (authToken) {
98013
+ headers["authorization"] = `mkcd ${authToken}`;
98014
98014
  }
98015
98015
  headers[X_PXT_TARGET] = (_a = pxt.appTarget) === null || _a === void 0 ? void 0 : _a.id;
98016
98016
  return headers;
@@ -98448,10 +98448,7 @@ var pxt;
98448
98448
  }
98449
98449
  static async staticApiAsync(url, data, method, authToken) {
98450
98450
  const headers = await getAuthHeadersAsync(authToken);
98451
- /*
98452
98451
  url = pxt.BrowserUtils.isLocalHostDev() ? `${pxt.cloud.DEV_BACKEND}${url}` : url;
98453
- */
98454
- url = `${pxt.Cloud.apiRoot.replace(/\/$/, "")}${url}`;
98455
98452
  return pxt.Util.requestAsync({
98456
98453
  url,
98457
98454
  headers,
@@ -122222,45 +122219,6 @@ var pxt;
122222
122219
  youtube.watchUrl = watchUrl;
122223
122220
  })(youtube = pxt.youtube || (pxt.youtube = {}));
122224
122221
  })(pxt || (pxt = {}));
122225
- /**
122226
- * Cookie 관련 함수들을 정의합니다.
122227
- */
122228
- var pxt;
122229
- (function (pxt) {
122230
- var cookie;
122231
- (function (cookie_1) {
122232
- /**
122233
- * document.cookie에서 name에 해당하는 쿠키 값을 가져옵니다.
122234
- */
122235
- function getCookie(name) {
122236
- const cookies = document.cookie.split("; ");
122237
- const cookie = cookies.find((cookie) => cookie.startsWith(name + "="));
122238
- return cookie ? decodeURIComponent(cookie.split("=")[1]) : undefined;
122239
- }
122240
- function getEnv() {
122241
- const splitedHostNames = window.location.hostname.split(".");
122242
- return splitedHostNames.includes("localhost")
122243
- ? "local"
122244
- : splitedHostNames.includes("dev") || splitedHostNames.includes("revised") || splitedHostNames.includes("ver")
122245
- ? "dev"
122246
- : "prd";
122247
- }
122248
- cookie_1.getEnv = getEnv;
122249
- function getCookieName(name) {
122250
- if (window.location.hostname === "localhost") {
122251
- return `${name}_localhost_local`;
122252
- }
122253
- // hostname example: "makecode.2v8p.aidt.me"
122254
- const tenant = window.location.hostname.split(".")[1];
122255
- return `${name}_${tenant}_${getEnv()}`;
122256
- }
122257
- cookie_1.getCookieName = getCookieName;
122258
- function getCookieToken() {
122259
- return getCookie(getCookieName("token"));
122260
- }
122261
- cookie_1.getCookieToken = getCookieToken;
122262
- })(cookie = pxt.cookie || (pxt.cookie = {}));
122263
- })(pxt || (pxt = {}));
122264
122222
  // TODO: add a macro facility to make 8-bit assembly easier?
122265
122223
  var ts;
122266
122224
  (function (ts) {
package/built/pxtlib.d.ts CHANGED
@@ -3779,14 +3779,6 @@ declare namespace pxt.youtube {
3779
3779
  function listPlaylistVideosAsync(playlistId: string): Promise<PlaylistItem[]>;
3780
3780
  function watchUrl(videoId?: string, playlistId?: string): string;
3781
3781
  }
3782
- /**
3783
- * Cookie 관련 함수들을 정의합니다.
3784
- */
3785
- declare namespace pxt.cookie {
3786
- function getEnv(): string;
3787
- function getCookieName(name: string): string;
3788
- function getCookieToken(): string | undefined;
3789
- }
3790
3782
  declare namespace ts.pxtc.assembler {
3791
3783
  let debug: boolean;
3792
3784
  interface InlineError {
package/built/pxtlib.js CHANGED
@@ -287,9 +287,9 @@ var pxt;
287
287
  async function getAuthHeadersAsync(authToken) {
288
288
  var _a;
289
289
  const headers = {};
290
- const token = pxt.cookie.getCookieToken();
291
- if (token) {
292
- headers["Authorization"] = `Bearer ${token}`;
290
+ authToken = authToken || (await getAuthTokenAsync());
291
+ if (authToken) {
292
+ headers["authorization"] = `mkcd ${authToken}`;
293
293
  }
294
294
  headers[X_PXT_TARGET] = (_a = pxt.appTarget) === null || _a === void 0 ? void 0 : _a.id;
295
295
  return headers;
@@ -727,10 +727,7 @@ var pxt;
727
727
  }
728
728
  static async staticApiAsync(url, data, method, authToken) {
729
729
  const headers = await getAuthHeadersAsync(authToken);
730
- /*
731
730
  url = pxt.BrowserUtils.isLocalHostDev() ? `${pxt.cloud.DEV_BACKEND}${url}` : url;
732
- */
733
- url = `${pxt.Cloud.apiRoot.replace(/\/$/, "")}${url}`;
734
731
  return pxt.Util.requestAsync({
735
732
  url,
736
733
  headers,
@@ -24501,45 +24498,6 @@ var pxt;
24501
24498
  youtube.watchUrl = watchUrl;
24502
24499
  })(youtube = pxt.youtube || (pxt.youtube = {}));
24503
24500
  })(pxt || (pxt = {}));
24504
- /**
24505
- * Cookie 관련 함수들을 정의합니다.
24506
- */
24507
- var pxt;
24508
- (function (pxt) {
24509
- var cookie;
24510
- (function (cookie_1) {
24511
- /**
24512
- * document.cookie에서 name에 해당하는 쿠키 값을 가져옵니다.
24513
- */
24514
- function getCookie(name) {
24515
- const cookies = document.cookie.split("; ");
24516
- const cookie = cookies.find((cookie) => cookie.startsWith(name + "="));
24517
- return cookie ? decodeURIComponent(cookie.split("=")[1]) : undefined;
24518
- }
24519
- function getEnv() {
24520
- const splitedHostNames = window.location.hostname.split(".");
24521
- return splitedHostNames.includes("localhost")
24522
- ? "local"
24523
- : splitedHostNames.includes("dev") || splitedHostNames.includes("revised") || splitedHostNames.includes("ver")
24524
- ? "dev"
24525
- : "prd";
24526
- }
24527
- cookie_1.getEnv = getEnv;
24528
- function getCookieName(name) {
24529
- if (window.location.hostname === "localhost") {
24530
- return `${name}_localhost_local`;
24531
- }
24532
- // hostname example: "makecode.2v8p.aidt.me"
24533
- const tenant = window.location.hostname.split(".")[1];
24534
- return `${name}_${tenant}_${getEnv()}`;
24535
- }
24536
- cookie_1.getCookieName = getCookieName;
24537
- function getCookieToken() {
24538
- return getCookie(getCookieName("token"));
24539
- }
24540
- cookie_1.getCookieToken = getCookieToken;
24541
- })(cookie = pxt.cookie || (pxt.cookie = {}));
24542
- })(pxt || (pxt = {}));
24543
24501
  // TODO: add a macro facility to make 8-bit assembly easier?
24544
24502
  var ts;
24545
24503
  (function (ts) {
package/built/target.js CHANGED
@@ -380,8 +380,8 @@ var pxtTargetBundle = {
380
380
  },
381
381
  "uploadDocs": true,
382
382
  "versions": {
383
- "target": "0.7.1",
384
- "pxt": "0.7.1"
383
+ "target": "0.7.2",
384
+ "pxt": "0.7.2"
385
385
  },
386
386
  "blocksprj": {
387
387
  "id": "blocksprj",
@@ -4575,7 +4575,7 @@ var pxtTargetBundle = {
4575
4575
  }
4576
4576
  }
4577
4577
  },
4578
- "sha": "e7395bbf10c1edd22f10038cb8da88e11b11379a1170c0f151f0ec305eef65ab"
4578
+ "sha": "bf50cc33b61007e505083074f82337f38b10f6508afe8fe7574608477dac9905"
4579
4579
  }
4580
4580
  }
4581
4581
  }
@@ -12,8 +12,8 @@ var pxtTargetBundle = {
12
12
  },
13
13
  "uploadDocs": true,
14
14
  "versions": {
15
- "target": "0.7.1",
16
- "pxt": "0.7.1"
15
+ "target": "0.7.2",
16
+ "pxt": "0.7.2"
17
17
  },
18
18
  "blocksprj": {
19
19
  "id": "blocksprj",