@team-monolith/pxt-core 0.2.2 → 0.2.3

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.
@@ -9999,6 +9999,10 @@ var pxt;
9999
9999
  var github;
10000
10000
  (function (github) {
10001
10001
  github.token = null;
10002
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
10003
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
10004
+ // CORS: makecode.com에서 허용됨
10005
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
10002
10006
  github.forceProxy = false;
10003
10007
  function hasProxy() {
10004
10008
  var _a, _b;
@@ -10056,9 +10060,11 @@ var pxt;
10056
10060
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
10057
10061
  }
10058
10062
  function ghProxyWithCdnJsonAsync(path) {
10059
- return pxt.Cloud.apiRequestWithCdnAsync({
10060
- url: "gh/" + path,
10061
- forceLiveEndpoint: true
10063
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
10064
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
10065
+ return pxt.U.requestAsync({
10066
+ url: MAKECODE_API_ROOT + "gh/" + path,
10067
+ allowGzipPost: true
10062
10068
  }).then(r => r.json);
10063
10069
  }
10064
10070
  function ghProxyHandleException(e) {
@@ -10406,7 +10412,8 @@ var pxt;
10406
10412
  const fetch = !proxy ?
10407
10413
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
10408
10414
  // no CDN caching here, bust browser cace
10409
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10415
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
10416
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10410
10417
  .then(r => {
10411
10418
  let res = Object.keys(r.refs)
10412
10419
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -10640,7 +10647,8 @@ var pxt;
10640
10647
  }
10641
10648
  github.repoIconUrl = repoIconUrl;
10642
10649
  function mkRepoIconUrl(repo) {
10643
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
10650
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
10651
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
10644
10652
  }
10645
10653
  github.mkRepoIconUrl = mkRepoIconUrl;
10646
10654
  function mkRepo(r, options) {
@@ -10770,7 +10778,8 @@ var pxt;
10770
10778
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
10771
10779
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
10772
10780
  // todo fix search
10773
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10781
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
10782
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10774
10783
  return fetch()
10775
10784
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
10776
10785
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
@@ -107680,6 +107680,10 @@ var pxt;
107680
107680
  var github;
107681
107681
  (function (github) {
107682
107682
  github.token = null;
107683
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
107684
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
107685
+ // CORS: makecode.com에서 허용됨
107686
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
107683
107687
  github.forceProxy = false;
107684
107688
  function hasProxy() {
107685
107689
  var _a, _b;
@@ -107737,9 +107741,11 @@ var pxt;
107737
107741
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
107738
107742
  }
107739
107743
  function ghProxyWithCdnJsonAsync(path) {
107740
- return pxt.Cloud.apiRequestWithCdnAsync({
107741
- url: "gh/" + path,
107742
- forceLiveEndpoint: true
107744
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
107745
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
107746
+ return pxt.U.requestAsync({
107747
+ url: MAKECODE_API_ROOT + "gh/" + path,
107748
+ allowGzipPost: true
107743
107749
  }).then(r => r.json);
107744
107750
  }
107745
107751
  function ghProxyHandleException(e) {
@@ -108087,7 +108093,8 @@ var pxt;
108087
108093
  const fetch = !proxy ?
108088
108094
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
108089
108095
  // no CDN caching here, bust browser cace
108090
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108096
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
108097
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108091
108098
  .then(r => {
108092
108099
  let res = Object.keys(r.refs)
108093
108100
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -108321,7 +108328,8 @@ var pxt;
108321
108328
  }
108322
108329
  github.repoIconUrl = repoIconUrl;
108323
108330
  function mkRepoIconUrl(repo) {
108324
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
108331
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
108332
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
108325
108333
  }
108326
108334
  github.mkRepoIconUrl = mkRepoIconUrl;
108327
108335
  function mkRepo(r, options) {
@@ -108451,7 +108459,8 @@ var pxt;
108451
108459
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
108452
108460
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
108453
108461
  // todo fix search
108454
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108462
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
108463
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108455
108464
  return fetch()
108456
108465
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
108457
108466
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
@@ -9993,6 +9993,10 @@ var pxt;
9993
9993
  var github;
9994
9994
  (function (github) {
9995
9995
  github.token = null;
9996
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
9997
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
9998
+ // CORS: makecode.com에서 허용됨
9999
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
9996
10000
  github.forceProxy = false;
9997
10001
  function hasProxy() {
9998
10002
  var _a, _b;
@@ -10050,9 +10054,11 @@ var pxt;
10050
10054
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
10051
10055
  }
10052
10056
  function ghProxyWithCdnJsonAsync(path) {
10053
- return pxt.Cloud.apiRequestWithCdnAsync({
10054
- url: "gh/" + path,
10055
- forceLiveEndpoint: true
10057
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
10058
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
10059
+ return pxt.U.requestAsync({
10060
+ url: MAKECODE_API_ROOT + "gh/" + path,
10061
+ allowGzipPost: true
10056
10062
  }).then(r => r.json);
10057
10063
  }
10058
10064
  function ghProxyHandleException(e) {
@@ -10400,7 +10406,8 @@ var pxt;
10400
10406
  const fetch = !proxy ?
10401
10407
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
10402
10408
  // no CDN caching here, bust browser cace
10403
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10409
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
10410
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
10404
10411
  .then(r => {
10405
10412
  let res = Object.keys(r.refs)
10406
10413
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -10634,7 +10641,8 @@ var pxt;
10634
10641
  }
10635
10642
  github.repoIconUrl = repoIconUrl;
10636
10643
  function mkRepoIconUrl(repo) {
10637
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
10644
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
10645
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
10638
10646
  }
10639
10647
  github.mkRepoIconUrl = mkRepoIconUrl;
10640
10648
  function mkRepo(r, options) {
@@ -10764,7 +10772,8 @@ var pxt;
10764
10772
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
10765
10773
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
10766
10774
  // todo fix search
10767
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10775
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
10776
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
10768
10777
  return fetch()
10769
10778
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
10770
10779
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
@@ -107690,6 +107690,10 @@ var pxt;
107690
107690
  var github;
107691
107691
  (function (github) {
107692
107692
  github.token = null;
107693
+ // [Monolith] GitHub API 요청은 원본 makecode 서버로 라우팅
107694
+ // 자체 서버(class rails)에는 GitHub 프록시가 없으므로 원본 서버 사용
107695
+ // CORS: makecode.com에서 허용됨
107696
+ const MAKECODE_API_ROOT = "https://www.makecode.com/api/";
107693
107697
  github.forceProxy = false;
107694
107698
  function hasProxy() {
107695
107699
  var _a, _b;
@@ -107747,9 +107751,11 @@ var pxt;
107747
107751
  return ghRequestAsync({ url, method: "GET" }).then(resp => resp.json);
107748
107752
  }
107749
107753
  function ghProxyWithCdnJsonAsync(path) {
107750
- return pxt.Cloud.apiRequestWithCdnAsync({
107751
- url: "gh/" + path,
107752
- forceLiveEndpoint: true
107754
+ // [Monolith] GitHub 프록시 요청은 원본 makecode 서버로 직접 전송
107755
+ // 자체 서버에는 /api/gh/* 엔드포인트가 없음
107756
+ return pxt.U.requestAsync({
107757
+ url: MAKECODE_API_ROOT + "gh/" + path,
107758
+ allowGzipPost: true
107753
107759
  }).then(r => r.json);
107754
107760
  }
107755
107761
  function ghProxyHandleException(e) {
@@ -108097,7 +108103,8 @@ var pxt;
108097
108103
  const fetch = !proxy ?
108098
108104
  ghGetJsonAsync(`https://api.github.com/repos/${parsed.slug}/git/refs/${namespace}/?per_page=100`) :
108099
108105
  // no CDN caching here, bust browser cace
108100
- pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${pxt.Cloud.apiRoot}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108106
+ // [Monolith] refs 조회는 원본 makecode 서버로 전송
108107
+ pxt.U.httpGetJsonAsync(pxt.BrowserUtils.cacheBustingUrl(`${MAKECODE_API_ROOT}gh/${parsed.slug}/refs${noCache ? "?nocache=1" : ""}`))
108101
108108
  .then(r => {
108102
108109
  let res = Object.keys(r.refs)
108103
108110
  .filter(k => pxt.U.startsWith(k, "refs/" + namespace + "/"))
@@ -108331,7 +108338,8 @@ var pxt;
108331
108338
  }
108332
108339
  github.repoIconUrl = repoIconUrl;
108333
108340
  function mkRepoIconUrl(repo) {
108334
- return pxt.Cloud.cdnApiUrl(`gh/${repo.fullName}/icon`);
108341
+ // [Monolith] 아이콘 URL은 원본 makecode 서버 사용
108342
+ return `${MAKECODE_API_ROOT}gh/${repo.fullName}/icon`;
108335
108343
  }
108336
108344
  github.mkRepoIconUrl = mkRepoIconUrl;
108337
108345
  function mkRepo(r, options) {
@@ -108461,7 +108469,8 @@ var pxt;
108461
108469
  return Promise.all(repos.map(id => repoAsync(id.fullName, config)))
108462
108470
  .then(rs => rs.filter(r => r && r.status != GitRepoStatus.Banned)); // allow deep links to github repos
108463
108471
  // todo fix search
108464
- const fetch = () => pxt.U.httpGetJsonAsync(`${pxt.Cloud.apiRoot}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108472
+ // [Monolith] GitHub 검색은 원본 makecode 서버로 전송
108473
+ const fetch = () => pxt.U.httpGetJsonAsync(`${MAKECODE_API_ROOT}ghsearch/${pxt.appTarget.id}/${pxt.appTarget.platformid || pxt.appTarget.id}?q=${encodeURIComponent(query)}`);
108465
108474
  return fetch()
108466
108475
  .then((rs) => rs.items.map(item => mkRepo(item, { config, fullName: item.full_name }))
108467
108476
  .filter(r => r.status == GitRepoStatus.Approved || (config.allowUnapproved && r.status == GitRepoStatus.Unknown))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/pxt-core",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "files": [
5
5
  "README.md",
6
6
  "built/*.js",