@teambit/scope 0.0.881 → 0.0.883

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 (52) hide show
  1. package/dist/exceptions/component-not-found.js +0 -6
  2. package/dist/exceptions/component-not-found.js.map +1 -1
  3. package/dist/exceptions/index.js +0 -6
  4. package/dist/exceptions/index.js.map +1 -1
  5. package/dist/exceptions/no-id-match-pattern.js +0 -6
  6. package/dist/exceptions/no-id-match-pattern.js.map +1 -1
  7. package/dist/index.js +0 -14
  8. package/dist/index.js.map +1 -1
  9. package/dist/routes/action.route.js +2 -19
  10. package/dist/routes/action.route.js.map +1 -1
  11. package/dist/routes/delete.route.js +0 -11
  12. package/dist/routes/delete.route.js.map +1 -1
  13. package/dist/routes/fetch.route.js +0 -27
  14. package/dist/routes/fetch.route.js.map +1 -1
  15. package/dist/routes/index.js +0 -12
  16. package/dist/routes/index.js.map +1 -1
  17. package/dist/routes/put.route.js +0 -18
  18. package/dist/routes/put.route.js.map +1 -1
  19. package/dist/scope-cmd.js +0 -13
  20. package/dist/scope-cmd.js.map +1 -1
  21. package/dist/scope-component-loader.js +18 -69
  22. package/dist/scope-component-loader.js.map +1 -1
  23. package/dist/scope.aspect.js +0 -5
  24. package/dist/scope.aspect.js.map +1 -1
  25. package/dist/scope.composition.js +0 -6
  26. package/dist/scope.composition.js.map +1 -1
  27. package/dist/scope.graphql.js +4 -23
  28. package/dist/scope.graphql.js.map +1 -1
  29. package/dist/scope.main.runtime.js +71 -349
  30. package/dist/scope.main.runtime.js.map +1 -1
  31. package/dist/scope.ui-root.js +0 -14
  32. package/dist/scope.ui-root.js.map +1 -1
  33. package/dist/scope.ui.drawer.js +5 -38
  34. package/dist/scope.ui.drawer.js.map +1 -1
  35. package/dist/scope.ui.runtime.js +11 -97
  36. package/dist/scope.ui.runtime.js.map +1 -1
  37. package/dist/staged-config.js +0 -35
  38. package/dist/staged-config.js.map +1 -1
  39. package/dist/ui/menu/index.js +0 -3
  40. package/dist/ui/menu/index.js.map +1 -1
  41. package/dist/ui/menu/menu.js +3 -35
  42. package/dist/ui/menu/menu.js.map +1 -1
  43. package/dist/ui/scope-overview/index.js +0 -2
  44. package/dist/ui/scope-overview/index.js.map +1 -1
  45. package/dist/ui/scope-overview/scope-overview.js +0 -32
  46. package/dist/ui/scope-overview/scope-overview.js.map +1 -1
  47. package/dist/ui/scope.js +0 -57
  48. package/dist/ui/scope.js.map +1 -1
  49. package/package-tar/teambit-scope-0.0.883.tgz +0 -0
  50. package/package.json +16 -16
  51. package/{preview-1666409808293.js → preview-1666582798766.js} +2 -2
  52. package/package-tar/teambit-scope-0.0.881.tgz +0 -0
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ComponentNotFound = void 0;
7
-
8
7
  function _bitError() {
9
8
  const data = require("@teambit/bit-error");
10
-
11
9
  _bitError = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  class ComponentNotFound extends _bitError().BitError {
19
15
  constructor(
20
16
  /**
@@ -23,9 +19,7 @@ class ComponentNotFound extends _bitError().BitError {
23
19
  id) {
24
20
  super(`component with id: ${id} was not found`);
25
21
  }
26
-
27
22
  }
28
-
29
23
  exports.ComponentNotFound = ComponentNotFound;
30
24
 
31
25
  //# sourceMappingURL=component-not-found.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ComponentNotFound","BitError","constructor","id"],"sources":["component-not-found.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { ComponentID } from '@teambit/component';\n\nexport class ComponentNotFound extends BitError {\n constructor(\n /**\n * id of the missing component.\n */\n id: ComponentID\n ) {\n super(`component with id: ${id} was not found`);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,iBAAN,SAAgCC,oBAAhC,CAAyC;EAC9CC,WAAW;EACT;AACJ;AACA;EACIC,EAJS,EAKT;IACA,MAAO,sBAAqBA,EAAG,gBAA/B;EACD;;AAR6C"}
1
+ {"version":3,"names":["ComponentNotFound","BitError","constructor","id"],"sources":["component-not-found.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { ComponentID } from '@teambit/component';\n\nexport class ComponentNotFound extends BitError {\n constructor(\n /**\n * id of the missing component.\n */\n id: ComponentID\n ) {\n super(`component with id: ${id} was not found`);\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,iBAAiB,SAASC,oBAAQ,CAAC;EAC9CC,WAAW;EACT;AACJ;AACA;EACIC,EAAe,EACf;IACA,KAAK,CAAE,sBAAqBA,EAAG,gBAAe,CAAC;EACjD;AACF;AAAC"}
@@ -15,24 +15,18 @@ Object.defineProperty(exports, "NoIdMatchPattern", {
15
15
  return _noIdMatchPattern().NoIdMatchPattern;
16
16
  }
17
17
  });
18
-
19
18
  function _componentNotFound() {
20
19
  const data = require("./component-not-found");
21
-
22
20
  _componentNotFound = function () {
23
21
  return data;
24
22
  };
25
-
26
23
  return data;
27
24
  }
28
-
29
25
  function _noIdMatchPattern() {
30
26
  const data = require("./no-id-match-pattern");
31
-
32
27
  _noIdMatchPattern = function () {
33
28
  return data;
34
29
  };
35
-
36
30
  return data;
37
31
  }
38
32
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ComponentNotFound } from './component-not-found';\nexport { NoIdMatchPattern } from './no-id-match-pattern';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { ComponentNotFound } from './component-not-found';\nexport { NoIdMatchPattern } from './no-id-match-pattern';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.NoIdMatchPattern = void 0;
7
-
8
7
  function _bitError() {
9
8
  const data = require("@teambit/bit-error");
10
-
11
9
  _bitError = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  class NoIdMatchPattern extends _bitError().BitError {
19
15
  constructor(pattern) {
20
16
  super(`unable to find any matching for "${pattern}" pattern`);
21
17
  }
22
-
23
18
  }
24
-
25
19
  exports.NoIdMatchPattern = NoIdMatchPattern;
26
20
 
27
21
  //# sourceMappingURL=no-id-match-pattern.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NoIdMatchPattern","BitError","constructor","pattern"],"sources":["no-id-match-pattern.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class NoIdMatchPattern extends BitError {\n constructor(pattern: string) {\n super(`unable to find any matching for \"${pattern}\" pattern`);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,gBAAN,SAA+BC,oBAA/B,CAAwC;EAC7CC,WAAW,CAACC,OAAD,EAAkB;IAC3B,MAAO,oCAAmCA,OAAQ,WAAlD;EACD;;AAH4C"}
1
+ {"version":3,"names":["NoIdMatchPattern","BitError","constructor","pattern"],"sources":["no-id-match-pattern.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\n\nexport class NoIdMatchPattern extends BitError {\n constructor(pattern: string) {\n super(`unable to find any matching for \"${pattern}\" pattern`);\n }\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAAgB,SAASC,oBAAQ,CAAC;EAC7CC,WAAW,CAACC,OAAe,EAAE;IAC3B,KAAK,CAAE,oCAAmCA,OAAQ,WAAU,CAAC;EAC/D;AACF;AAAC"}
package/dist/index.js CHANGED
@@ -34,49 +34,35 @@ Object.defineProperty(exports, "ScopeContext", {
34
34
  }
35
35
  });
36
36
  exports.default = void 0;
37
-
38
37
  function _scope() {
39
38
  const data = require("./scope.aspect");
40
-
41
39
  _scope = function () {
42
40
  return data;
43
41
  };
44
-
45
42
  return data;
46
43
  }
47
-
48
44
  function _exceptions() {
49
45
  const data = require("./exceptions");
50
-
51
46
  _exceptions = function () {
52
47
  return data;
53
48
  };
54
-
55
49
  return data;
56
50
  }
57
-
58
51
  function _scopeOverview() {
59
52
  const data = require("./ui/scope-overview/scope-overview");
60
-
61
53
  _scopeOverview = function () {
62
54
  return data;
63
55
  };
64
-
65
56
  return data;
66
57
  }
67
-
68
58
  function _scopeUiHooks() {
69
59
  const data = require("@teambit/scope.ui.hooks.scope-context");
70
-
71
60
  _scopeUiHooks = function () {
72
61
  return data;
73
62
  };
74
-
75
63
  return data;
76
64
  }
77
-
78
65
  var _default = _scope().ScopeAspect;
79
-
80
66
  exports.default = _default;
81
67
 
82
68
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ScopeAspect"],"sources":["index.ts"],"sourcesContent":["import { ScopeAspect } from './scope.aspect';\n\nexport { ComponentNotFound, NoIdMatchPattern } from './exceptions';\nexport { ScopeComponentCard } from './ui/scope-overview/scope-overview';\nexport type { ScopeMain } from './scope.main.runtime';\nexport type { ScopeModel } from '@teambit/scope.models.scope-model';\nexport { ScopeContext } from '@teambit/scope.ui.hooks.scope-context';\nexport type { ScopeUI, ScopeBadgeSlot, ScopeOverview, ScopeOverviewSlot, OverviewLineSlot } from './scope.ui.runtime';\nexport { ScopeAspect };\nexport default ScopeAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAGeA,oB"}
1
+ {"version":3,"names":["ScopeAspect"],"sources":["index.ts"],"sourcesContent":["import { ScopeAspect } from './scope.aspect';\n\nexport { ComponentNotFound, NoIdMatchPattern } from './exceptions';\nexport { ScopeComponentCard } from './ui/scope-overview/scope-overview';\nexport type { ScopeMain } from './scope.main.runtime';\nexport type { ScopeModel } from '@teambit/scope.models.scope-model';\nexport { ScopeContext } from '@teambit/scope.ui.hooks.scope-context';\nexport type { ScopeUI, ScopeBadgeSlot, ScopeOverview, ScopeOverviewSlot, OverviewLineSlot } from './scope.ui.runtime';\nexport { ScopeAspect };\nexport default ScopeAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAqE,eAGtDA,oBAAW;AAAA"}
@@ -1,54 +1,39 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.ActionRoute = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  function _express() {
23
17
  const data = require("@teambit/express");
24
-
25
18
  _express = function () {
26
19
  return data;
27
20
  };
28
-
29
21
  return data;
30
22
  }
31
-
32
23
  function _action() {
33
24
  const data = require("@teambit/legacy/dist/api/scope/lib/action");
34
-
35
25
  _action = function () {
36
26
  return data;
37
27
  };
38
-
39
28
  return data;
40
29
  }
41
-
42
30
  function _http() {
43
31
  const data = require("@teambit/legacy/dist/scope/network/http/http");
44
-
45
32
  _http = function () {
46
33
  return data;
47
34
  };
48
-
49
35
  return data;
50
36
  }
51
-
52
37
  class ActionRoute {
53
38
  constructor(scope) {
54
39
  this.scope = scope;
@@ -58,14 +43,12 @@ class ActionRoute {
58
43
  (0, _defineProperty2().default)(this, "middlewares", [async (req, res) => {
59
44
  req.setTimeout(this.scope.config.httpTimeOut);
60
45
  const authData = (0, _http().getAuthDataFromHeader)(req.headers.authorization);
61
- const result = await (0, _action().action)(this.scope.path, req.body.name, req.body.options, authData); // in case the result is empty, send `{}` to make it a valid json.
62
-
46
+ const result = await (0, _action().action)(this.scope.path, req.body.name, req.body.options, authData);
47
+ // in case the result is empty, send `{}` to make it a valid json.
63
48
  res.json(result || {});
64
49
  }]);
65
50
  }
66
-
67
51
  }
68
-
69
52
  exports.ActionRoute = ActionRoute;
70
53
 
71
54
  //# sourceMappingURL=action.route.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ActionRoute","constructor","scope","Verb","WRITE","req","res","setTimeout","config","httpTimeOut","authData","getAuthDataFromHeader","headers","authorization","result","action","path","body","name","options","json"],"sources":["action.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { action } from '@teambit/legacy/dist/api/scope/lib/action';\nimport { getAuthDataFromHeader } from '@teambit/legacy/dist/scope/network/http/http';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class ActionRoute implements Route {\n constructor(private scope: ScopeMain) {}\n\n method = 'post';\n route = '/scope/action';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const authData = getAuthDataFromHeader(req.headers.authorization);\n const result = await action(this.scope.path, req.body.name, req.body.options, authData);\n // in case the result is empty, send `{}` to make it a valid json.\n res.json(result || {});\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,WAAN,CAAmC;EACxCC,WAAW,CAASC,KAAT,EAA2B;IAAA,KAAlBA,KAAkB,GAAlBA,KAAkB;IAAA,gDAE7B,MAF6B;IAAA,+CAG9B,eAH8B;IAAA,8CAI/BC,eAAA,CAAKC,KAJ0B;IAAA,qDAMxB,CACZ,OAAOC,GAAP,EAAqBC,GAArB,KAAuC;MACrCD,GAAG,CAACE,UAAJ,CAAe,KAAKL,KAAL,CAAWM,MAAX,CAAkBC,WAAjC;MACA,MAAMC,QAAQ,GAAG,IAAAC,6BAAA,EAAsBN,GAAG,CAACO,OAAJ,CAAYC,aAAlC,CAAjB;MACA,MAAMC,MAAM,GAAG,MAAM,IAAAC,gBAAA,EAAO,KAAKb,KAAL,CAAWc,IAAlB,EAAwBX,GAAG,CAACY,IAAJ,CAASC,IAAjC,EAAuCb,GAAG,CAACY,IAAJ,CAASE,OAAhD,EAAyDT,QAAzD,CAArB,CAHqC,CAIrC;;MACAJ,GAAG,CAACc,IAAJ,CAASN,MAAM,IAAI,EAAnB;IACD,CAPW,CANwB;EAAE;;AADA"}
1
+ {"version":3,"names":["ActionRoute","constructor","scope","Verb","WRITE","req","res","setTimeout","config","httpTimeOut","authData","getAuthDataFromHeader","headers","authorization","result","action","path","body","name","options","json"],"sources":["action.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { action } from '@teambit/legacy/dist/api/scope/lib/action';\nimport { getAuthDataFromHeader } from '@teambit/legacy/dist/scope/network/http/http';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class ActionRoute implements Route {\n constructor(private scope: ScopeMain) {}\n\n method = 'post';\n route = '/scope/action';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const authData = getAuthDataFromHeader(req.headers.authorization);\n const result = await action(this.scope.path, req.body.name, req.body.options, authData);\n // in case the result is empty, send `{}` to make it a valid json.\n res.json(result || {});\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,WAAW,CAAkB;EACxCC,WAAW,CAASC,KAAgB,EAAE;IAAA,KAAlBA,KAAgB,GAAhBA,KAAgB;IAAA,gDAE3B,MAAM;IAAA,+CACP,eAAe;IAAA,8CAChBC,eAAI,CAACC,KAAK;IAAA,qDAEH,CACZ,OAAOC,GAAY,EAAEC,GAAa,KAAK;MACrCD,GAAG,CAACE,UAAU,CAAC,IAAI,CAACL,KAAK,CAACM,MAAM,CAACC,WAAW,CAAC;MAC7C,MAAMC,QAAQ,GAAG,IAAAC,6BAAqB,EAACN,GAAG,CAACO,OAAO,CAACC,aAAa,CAAC;MACjE,MAAMC,MAAM,GAAG,MAAM,IAAAC,gBAAM,EAAC,IAAI,CAACb,KAAK,CAACc,IAAI,EAAEX,GAAG,CAACY,IAAI,CAACC,IAAI,EAAEb,GAAG,CAACY,IAAI,CAACE,OAAO,EAAET,QAAQ,CAAC;MACvF;MACAJ,GAAG,CAACc,IAAI,CAACN,MAAM,IAAI,CAAC,CAAC,CAAC;IACxB,CAAC,CACF;EAdsC;AAezC;AAAC"}
@@ -1,34 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.promise.js");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.DeleteRoute = void 0;
11
-
12
9
  function _defineProperty2() {
13
10
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
-
15
11
  _defineProperty2 = function () {
16
12
  return data;
17
13
  };
18
-
19
14
  return data;
20
15
  }
21
-
22
16
  function _express() {
23
17
  const data = require("@teambit/express");
24
-
25
18
  _express = function () {
26
19
  return data;
27
20
  };
28
-
29
21
  return data;
30
22
  }
31
-
32
23
  class DeleteRoute {
33
24
  constructor(scope) {
34
25
  this.scope = scope;
@@ -48,9 +39,7 @@ class DeleteRoute {
48
39
  res.json(result);
49
40
  }]);
50
41
  }
51
-
52
42
  }
53
-
54
43
  exports.DeleteRoute = DeleteRoute;
55
44
 
56
45
  //# sourceMappingURL=delete.route.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DeleteRoute","constructor","scope","Verb","WRITE","req","res","headers","setTimeout","config","httpTimeOut","result","delete","ids","body","force","lanes","json"],"sources":["delete.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class DeleteRoute implements Route {\n constructor(private scope: ScopeMain) {}\n\n method = 'post';\n route = '/scope/delete';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n const { headers } = req;\n req.setTimeout(this.scope.config.httpTimeOut);\n const result = await this.scope.delete(\n {\n ids: req.body.ids,\n force: req.body.force,\n lanes: req.body.lanes,\n },\n headers\n );\n res.json(result);\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,WAAN,CAAmC;EACxCC,WAAW,CAASC,KAAT,EAA2B;IAAA,KAAlBA,KAAkB,GAAlBA,KAAkB;IAAA,gDAE7B,MAF6B;IAAA,+CAG9B,eAH8B;IAAA,8CAI/BC,eAAA,CAAKC,KAJ0B;IAAA,qDAMxB,CACZ,OAAOC,GAAP,EAAqBC,GAArB,KAAuC;MACrC,MAAM;QAAEC;MAAF,IAAcF,GAApB;MACAA,GAAG,CAACG,UAAJ,CAAe,KAAKN,KAAL,CAAWO,MAAX,CAAkBC,WAAjC;MACA,MAAMC,MAAM,GAAG,MAAM,KAAKT,KAAL,CAAWU,MAAX,CACnB;QACEC,GAAG,EAAER,GAAG,CAACS,IAAJ,CAASD,GADhB;QAEEE,KAAK,EAAEV,GAAG,CAACS,IAAJ,CAASC,KAFlB;QAGEC,KAAK,EAAEX,GAAG,CAACS,IAAJ,CAASE;MAHlB,CADmB,EAMnBT,OANmB,CAArB;MAQAD,GAAG,CAACW,IAAJ,CAASN,MAAT;IACD,CAbW,CANwB;EAAE;;AADA"}
1
+ {"version":3,"names":["DeleteRoute","constructor","scope","Verb","WRITE","req","res","headers","setTimeout","config","httpTimeOut","result","delete","ids","body","force","lanes","json"],"sources":["delete.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class DeleteRoute implements Route {\n constructor(private scope: ScopeMain) {}\n\n method = 'post';\n route = '/scope/delete';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n const { headers } = req;\n req.setTimeout(this.scope.config.httpTimeOut);\n const result = await this.scope.delete(\n {\n ids: req.body.ids,\n force: req.body.force,\n lanes: req.body.lanes,\n },\n headers\n );\n res.json(result);\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,WAAW,CAAkB;EACxCC,WAAW,CAASC,KAAgB,EAAE;IAAA,KAAlBA,KAAgB,GAAhBA,KAAgB;IAAA,gDAE3B,MAAM;IAAA,+CACP,eAAe;IAAA,8CAChBC,eAAI,CAACC,KAAK;IAAA,qDAEH,CACZ,OAAOC,GAAY,EAAEC,GAAa,KAAK;MACrC,MAAM;QAAEC;MAAQ,CAAC,GAAGF,GAAG;MACvBA,GAAG,CAACG,UAAU,CAAC,IAAI,CAACN,KAAK,CAACO,MAAM,CAACC,WAAW,CAAC;MAC7C,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACT,KAAK,CAACU,MAAM,CACpC;QACEC,GAAG,EAAER,GAAG,CAACS,IAAI,CAACD,GAAG;QACjBE,KAAK,EAAEV,GAAG,CAACS,IAAI,CAACC,KAAK;QACrBC,KAAK,EAAEX,GAAG,CAACS,IAAI,CAACE;MAClB,CAAC,EACDT,OAAO,CACR;MACDD,GAAG,CAACW,IAAI,CAACN,MAAM,CAAC;IAClB,CAAC,CACF;EApBsC;AAqBzC;AAAC"}
@@ -1,76 +1,54 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.FetchRoute = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _express() {
25
18
  const data = require("@teambit/express");
26
-
27
19
  _express = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _scope() {
35
25
  const data = require("@teambit/legacy/dist/api/scope");
36
-
37
26
  _scope = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _objectList() {
45
32
  const data = require("@teambit/legacy/dist/scope/objects/object-list");
46
-
47
33
  _objectList = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  function _util() {
55
39
  const data = require("util");
56
-
57
40
  _util = function () {
58
41
  return data;
59
42
  };
60
-
61
43
  return data;
62
44
  }
63
-
64
45
  function _stream() {
65
46
  const data = require("stream");
66
-
67
47
  _stream = function () {
68
48
  return data;
69
49
  };
70
-
71
50
  return data;
72
51
  }
73
-
74
52
  class FetchRoute {
75
53
  constructor(scope, logger) {
76
54
  this.scope = scope;
@@ -90,11 +68,8 @@ class FetchRoute {
90
68
  this.logger.error('fatal: onPreFetchObjects encountered an error (this error does not stop the process)', err);
91
69
  });
92
70
  const readable = await (0, _scope().fetch)(this.scope.path, req.body.ids, req.body.fetchOptions);
93
-
94
71
  const pack = _objectList().ObjectList.fromObjectStreamToTar(readable, this.scope.name);
95
-
96
72
  const pipelinePromise = (0, _util().promisify)(_stream().pipeline);
97
-
98
73
  try {
99
74
  await pipelinePromise(pack, res);
100
75
  this.logger.info('fetch.router, the response has been sent successfully to the client', req.headers);
@@ -108,9 +83,7 @@ class FetchRoute {
108
83
  }
109
84
  }]);
110
85
  }
111
-
112
86
  }
113
-
114
87
  exports.FetchRoute = FetchRoute;
115
88
 
116
89
  //# sourceMappingURL=fetch.route.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FetchRoute","constructor","scope","logger","Verb","READ","req","res","setTimeout","config","httpTimeOut","preFetchHookP","preFetchObjects","values","map","fn","ids","body","fetchOptions","headers","Promise","all","catch","err","error","readable","fetch","path","pack","ObjectList","fromObjectStreamToTar","name","pipelinePromise","promisify","pipeline","info","aborted","warn"],"sources":["fetch.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { fetch } from '@teambit/legacy/dist/api/scope';\nimport { ObjectList } from '@teambit/legacy/dist/scope/objects/object-list';\nimport { Logger } from '@teambit/logger';\nimport { promisify } from 'util';\nimport { pipeline } from 'stream';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class FetchRoute implements Route {\n constructor(private scope: ScopeMain, private logger: Logger) {}\n\n route = '/scope/fetch';\n method = 'post';\n verb = Verb.READ;\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const preFetchHookP = this.scope.preFetchObjects\n .values()\n .map((fn) => fn({ ids: req.body.ids, fetchOptions: req.body.fetchOptions }, { headers: req.headers }));\n\n Promise.all(preFetchHookP).catch((err) => {\n this.logger.error('fatal: onPreFetchObjects encountered an error (this error does not stop the process)', err);\n });\n\n const readable = await fetch(this.scope.path, req.body.ids, req.body.fetchOptions);\n const pack = ObjectList.fromObjectStreamToTar(readable, this.scope.name);\n const pipelinePromise = promisify(pipeline);\n try {\n await pipelinePromise(pack, res);\n this.logger.info('fetch.router, the response has been sent successfully to the client', req.headers);\n } catch (err: any) {\n if (req.aborted) {\n this.logger.warn('FetchRoute, the client aborted the request', err);\n } else {\n this.logger.error(\n `FetchRoute encountered an error during the pipeline streaming, this should never happen.\n make sure the error is caught in fromObjectStreamToTar and it streamed using the name \"ERROR\"`,\n err\n );\n }\n }\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,UAAN,CAAkC;EACvCC,WAAW,CAASC,KAAT,EAAmCC,MAAnC,EAAmD;IAAA,KAA1CD,KAA0C,GAA1CA,KAA0C;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,+CAEtD,cAFsD;IAAA,gDAGrD,MAHqD;IAAA,8CAIvDC,eAAA,CAAKC,IAJkD;IAAA,qDAKhD,CACZ,OAAOC,GAAP,EAAqBC,GAArB,KAAuC;MACrCD,GAAG,CAACE,UAAJ,CAAe,KAAKN,KAAL,CAAWO,MAAX,CAAkBC,WAAjC;MACA,MAAMC,aAAa,GAAG,KAAKT,KAAL,CAAWU,eAAX,CACnBC,MADmB,GAEnBC,GAFmB,CAEdC,EAAD,IAAQA,EAAE,CAAC;QAAEC,GAAG,EAAEV,GAAG,CAACW,IAAJ,CAASD,GAAhB;QAAqBE,YAAY,EAAEZ,GAAG,CAACW,IAAJ,CAASC;MAA5C,CAAD,EAA6D;QAAEC,OAAO,EAAEb,GAAG,CAACa;MAAf,CAA7D,CAFK,CAAtB;MAIAC,OAAO,CAACC,GAAR,CAAYV,aAAZ,EAA2BW,KAA3B,CAAkCC,GAAD,IAAS;QACxC,KAAKpB,MAAL,CAAYqB,KAAZ,CAAkB,sFAAlB,EAA0GD,GAA1G;MACD,CAFD;MAIA,MAAME,QAAQ,GAAG,MAAM,IAAAC,cAAA,EAAM,KAAKxB,KAAL,CAAWyB,IAAjB,EAAuBrB,GAAG,CAACW,IAAJ,CAASD,GAAhC,EAAqCV,GAAG,CAACW,IAAJ,CAASC,YAA9C,CAAvB;;MACA,MAAMU,IAAI,GAAGC,wBAAA,CAAWC,qBAAX,CAAiCL,QAAjC,EAA2C,KAAKvB,KAAL,CAAW6B,IAAtD,CAAb;;MACA,MAAMC,eAAe,GAAG,IAAAC,iBAAA,EAAUC,kBAAV,CAAxB;;MACA,IAAI;QACF,MAAMF,eAAe,CAACJ,IAAD,EAAOrB,GAAP,CAArB;QACA,KAAKJ,MAAL,CAAYgC,IAAZ,CAAiB,qEAAjB,EAAwF7B,GAAG,CAACa,OAA5F;MACD,CAHD,CAGE,OAAOI,GAAP,EAAiB;QACjB,IAAIjB,GAAG,CAAC8B,OAAR,EAAiB;UACf,KAAKjC,MAAL,CAAYkC,IAAZ,CAAiB,4CAAjB,EAA+Dd,GAA/D;QACD,CAFD,MAEO;UACL,KAAKpB,MAAL,CAAYqB,KAAZ,CACG;AACb,gGAFU,EAGED,GAHF;QAKD;MACF;IACF,CA5BW,CALgD;EAAE;;AADzB"}
1
+ {"version":3,"names":["FetchRoute","constructor","scope","logger","Verb","READ","req","res","setTimeout","config","httpTimeOut","preFetchHookP","preFetchObjects","values","map","fn","ids","body","fetchOptions","headers","Promise","all","catch","err","error","readable","fetch","path","pack","ObjectList","fromObjectStreamToTar","name","pipelinePromise","promisify","pipeline","info","aborted","warn"],"sources":["fetch.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { fetch } from '@teambit/legacy/dist/api/scope';\nimport { ObjectList } from '@teambit/legacy/dist/scope/objects/object-list';\nimport { Logger } from '@teambit/logger';\nimport { promisify } from 'util';\nimport { pipeline } from 'stream';\nimport { ScopeMain } from '../scope.main.runtime';\n\nexport class FetchRoute implements Route {\n constructor(private scope: ScopeMain, private logger: Logger) {}\n\n route = '/scope/fetch';\n method = 'post';\n verb = Verb.READ;\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const preFetchHookP = this.scope.preFetchObjects\n .values()\n .map((fn) => fn({ ids: req.body.ids, fetchOptions: req.body.fetchOptions }, { headers: req.headers }));\n\n Promise.all(preFetchHookP).catch((err) => {\n this.logger.error('fatal: onPreFetchObjects encountered an error (this error does not stop the process)', err);\n });\n\n const readable = await fetch(this.scope.path, req.body.ids, req.body.fetchOptions);\n const pack = ObjectList.fromObjectStreamToTar(readable, this.scope.name);\n const pipelinePromise = promisify(pipeline);\n try {\n await pipelinePromise(pack, res);\n this.logger.info('fetch.router, the response has been sent successfully to the client', req.headers);\n } catch (err: any) {\n if (req.aborted) {\n this.logger.warn('FetchRoute, the client aborted the request', err);\n } else {\n this.logger.error(\n `FetchRoute encountered an error during the pipeline streaming, this should never happen.\n make sure the error is caught in fromObjectStreamToTar and it streamed using the name \"ERROR\"`,\n err\n );\n }\n }\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,UAAU,CAAkB;EACvCC,WAAW,CAASC,KAAgB,EAAUC,MAAc,EAAE;IAAA,KAA1CD,KAAgB,GAAhBA,KAAgB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,+CAEpD,cAAc;IAAA,gDACb,MAAM;IAAA,8CACRC,eAAI,CAACC,IAAI;IAAA,qDACF,CACZ,OAAOC,GAAY,EAAEC,GAAa,KAAK;MACrCD,GAAG,CAACE,UAAU,CAAC,IAAI,CAACN,KAAK,CAACO,MAAM,CAACC,WAAW,CAAC;MAC7C,MAAMC,aAAa,GAAG,IAAI,CAACT,KAAK,CAACU,eAAe,CAC7CC,MAAM,EAAE,CACRC,GAAG,CAAEC,EAAE,IAAKA,EAAE,CAAC;QAAEC,GAAG,EAAEV,GAAG,CAACW,IAAI,CAACD,GAAG;QAAEE,YAAY,EAAEZ,GAAG,CAACW,IAAI,CAACC;MAAa,CAAC,EAAE;QAAEC,OAAO,EAAEb,GAAG,CAACa;MAAQ,CAAC,CAAC,CAAC;MAExGC,OAAO,CAACC,GAAG,CAACV,aAAa,CAAC,CAACW,KAAK,CAAEC,GAAG,IAAK;QACxC,IAAI,CAACpB,MAAM,CAACqB,KAAK,CAAC,sFAAsF,EAAED,GAAG,CAAC;MAChH,CAAC,CAAC;MAEF,MAAME,QAAQ,GAAG,MAAM,IAAAC,cAAK,EAAC,IAAI,CAACxB,KAAK,CAACyB,IAAI,EAAErB,GAAG,CAACW,IAAI,CAACD,GAAG,EAAEV,GAAG,CAACW,IAAI,CAACC,YAAY,CAAC;MAClF,MAAMU,IAAI,GAAGC,wBAAU,CAACC,qBAAqB,CAACL,QAAQ,EAAE,IAAI,CAACvB,KAAK,CAAC6B,IAAI,CAAC;MACxE,MAAMC,eAAe,GAAG,IAAAC,iBAAS,EAACC,kBAAQ,CAAC;MAC3C,IAAI;QACF,MAAMF,eAAe,CAACJ,IAAI,EAAErB,GAAG,CAAC;QAChC,IAAI,CAACJ,MAAM,CAACgC,IAAI,CAAC,qEAAqE,EAAE7B,GAAG,CAACa,OAAO,CAAC;MACtG,CAAC,CAAC,OAAOI,GAAQ,EAAE;QACjB,IAAIjB,GAAG,CAAC8B,OAAO,EAAE;UACf,IAAI,CAACjC,MAAM,CAACkC,IAAI,CAAC,4CAA4C,EAAEd,GAAG,CAAC;QACrE,CAAC,MAAM;UACL,IAAI,CAACpB,MAAM,CAACqB,KAAK,CACd;AACb,gGAAgG,EACpFD,GAAG,CACJ;QACH;MACF;IACF,CAAC,CACF;EAlC8D;AAmCjE;AAAC"}
@@ -27,44 +27,32 @@ Object.defineProperty(exports, "PutRoute", {
27
27
  return _put().PutRoute;
28
28
  }
29
29
  });
30
-
31
30
  function _fetch() {
32
31
  const data = require("./fetch.route");
33
-
34
32
  _fetch = function () {
35
33
  return data;
36
34
  };
37
-
38
35
  return data;
39
36
  }
40
-
41
37
  function _put() {
42
38
  const data = require("./put.route");
43
-
44
39
  _put = function () {
45
40
  return data;
46
41
  };
47
-
48
42
  return data;
49
43
  }
50
-
51
44
  function _action() {
52
45
  const data = require("./action.route");
53
-
54
46
  _action = function () {
55
47
  return data;
56
48
  };
57
-
58
49
  return data;
59
50
  }
60
-
61
51
  function _delete() {
62
52
  const data = require("./delete.route");
63
-
64
53
  _delete = function () {
65
54
  return data;
66
55
  };
67
-
68
56
  return data;
69
57
  }
70
58
 
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { FetchRoute } from './fetch.route';\nexport { PutRoute } from './put.route';\nexport { ActionRoute } from './action.route';\nexport { DeleteRoute } from './delete.route';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { FetchRoute } from './fetch.route';\nexport { PutRoute } from './put.route';\nexport { ActionRoute } from './action.route';\nexport { DeleteRoute } from './delete.route';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
@@ -1,56 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.PutRoute = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _express() {
25
18
  const data = require("@teambit/express");
26
-
27
19
  _express = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  function _objectList() {
35
25
  const data = require("@teambit/legacy/dist/scope/objects/object-list");
36
-
37
26
  _objectList = function () {
38
27
  return data;
39
28
  };
40
-
41
29
  return data;
42
30
  }
43
-
44
31
  function _scope() {
45
32
  const data = require("@teambit/legacy/dist/api/scope");
46
-
47
33
  _scope = function () {
48
34
  return data;
49
35
  };
50
-
51
36
  return data;
52
37
  }
53
-
54
38
  class PutRoute {
55
39
  constructor(scope, postPutSlot) {
56
40
  this.scope = scope;
@@ -74,9 +58,7 @@ class PutRoute {
74
58
  res.json(ids);
75
59
  }]);
76
60
  }
77
-
78
61
  }
79
-
80
62
  exports.PutRoute = PutRoute;
81
63
 
82
64
  //# sourceMappingURL=put.route.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PutRoute","constructor","scope","postPutSlot","Verb","WRITE","req","res","setTimeout","config","httpTimeOut","pushOptionsStr","headers","Error","pushOptions","JSON","parse","objectList","ObjectList","fromTar","ids","put","path","Promise","all","map","id","resolveComponentId","json"],"sources":["put.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { ObjectList } from '@teambit/legacy/dist/scope/objects/object-list';\nimport { put } from '@teambit/legacy/dist/api/scope';\nimport { OnPostPutSlot, ScopeMain } from '../scope.main.runtime';\n\nexport class PutRoute implements Route {\n constructor(private scope: ScopeMain, private postPutSlot: OnPostPutSlot) {}\n\n method = 'post';\n route = '/scope/put';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const pushOptionsStr = req.headers['push-options'];\n if (!pushOptionsStr) throw new Error('http is missing the push-options header');\n const pushOptions = JSON.parse(pushOptionsStr as string);\n const objectList = await ObjectList.fromTar(req);\n const ids = await put(\n {\n path: this.scope.path,\n objectList,\n },\n pushOptions\n );\n\n await Promise.all(\n ids.map((id) => {\n return this.scope.resolveComponentId(id);\n })\n );\n\n res.json(ids);\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,QAAN,CAAgC;EACrCC,WAAW,CAASC,KAAT,EAAmCC,WAAnC,EAA+D;IAAA,KAAtDD,KAAsD,GAAtDA,KAAsD;IAAA,KAA5BC,WAA4B,GAA5BA,WAA4B;IAAA,gDAEjE,MAFiE;IAAA,+CAGlE,YAHkE;IAAA,8CAInEC,eAAA,CAAKC,KAJ8D;IAAA,qDAM5D,CACZ,OAAOC,GAAP,EAAqBC,GAArB,KAAuC;MACrCD,GAAG,CAACE,UAAJ,CAAe,KAAKN,KAAL,CAAWO,MAAX,CAAkBC,WAAjC;MACA,MAAMC,cAAc,GAAGL,GAAG,CAACM,OAAJ,CAAY,cAAZ,CAAvB;MACA,IAAI,CAACD,cAAL,EAAqB,MAAM,IAAIE,KAAJ,CAAU,yCAAV,CAAN;MACrB,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWL,cAAX,CAApB;MACA,MAAMM,UAAU,GAAG,MAAMC,wBAAA,CAAWC,OAAX,CAAmBb,GAAnB,CAAzB;MACA,MAAMc,GAAG,GAAG,MAAM,IAAAC,YAAA,EAChB;QACEC,IAAI,EAAE,KAAKpB,KAAL,CAAWoB,IADnB;QAEEL;MAFF,CADgB,EAKhBH,WALgB,CAAlB;MAQA,MAAMS,OAAO,CAACC,GAAR,CACJJ,GAAG,CAACK,GAAJ,CAASC,EAAD,IAAQ;QACd,OAAO,KAAKxB,KAAL,CAAWyB,kBAAX,CAA8BD,EAA9B,CAAP;MACD,CAFD,CADI,CAAN;MAMAnB,GAAG,CAACqB,IAAJ,CAASR,GAAT;IACD,CAtBW,CAN4D;EAAE;;AADvC"}
1
+ {"version":3,"names":["PutRoute","constructor","scope","postPutSlot","Verb","WRITE","req","res","setTimeout","config","httpTimeOut","pushOptionsStr","headers","Error","pushOptions","JSON","parse","objectList","ObjectList","fromTar","ids","put","path","Promise","all","map","id","resolveComponentId","json"],"sources":["put.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { ObjectList } from '@teambit/legacy/dist/scope/objects/object-list';\nimport { put } from '@teambit/legacy/dist/api/scope';\nimport { OnPostPutSlot, ScopeMain } from '../scope.main.runtime';\n\nexport class PutRoute implements Route {\n constructor(private scope: ScopeMain, private postPutSlot: OnPostPutSlot) {}\n\n method = 'post';\n route = '/scope/put';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n req.setTimeout(this.scope.config.httpTimeOut);\n const pushOptionsStr = req.headers['push-options'];\n if (!pushOptionsStr) throw new Error('http is missing the push-options header');\n const pushOptions = JSON.parse(pushOptionsStr as string);\n const objectList = await ObjectList.fromTar(req);\n const ids = await put(\n {\n path: this.scope.path,\n objectList,\n },\n pushOptions\n );\n\n await Promise.all(\n ids.map((id) => {\n return this.scope.resolveComponentId(id);\n })\n );\n\n res.json(ids);\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,QAAQ,CAAkB;EACrCC,WAAW,CAASC,KAAgB,EAAUC,WAA0B,EAAE;IAAA,KAAtDD,KAAgB,GAAhBA,KAAgB;IAAA,KAAUC,WAA0B,GAA1BA,WAA0B;IAAA,gDAE/D,MAAM;IAAA,+CACP,YAAY;IAAA,8CACbC,eAAI,CAACC,KAAK;IAAA,qDAEH,CACZ,OAAOC,GAAY,EAAEC,GAAa,KAAK;MACrCD,GAAG,CAACE,UAAU,CAAC,IAAI,CAACN,KAAK,CAACO,MAAM,CAACC,WAAW,CAAC;MAC7C,MAAMC,cAAc,GAAGL,GAAG,CAACM,OAAO,CAAC,cAAc,CAAC;MAClD,IAAI,CAACD,cAAc,EAAE,MAAM,IAAIE,KAAK,CAAC,yCAAyC,CAAC;MAC/E,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACL,cAAc,CAAW;MACxD,MAAMM,UAAU,GAAG,MAAMC,wBAAU,CAACC,OAAO,CAACb,GAAG,CAAC;MAChD,MAAMc,GAAG,GAAG,MAAM,IAAAC,YAAG,EACnB;QACEC,IAAI,EAAE,IAAI,CAACpB,KAAK,CAACoB,IAAI;QACrBL;MACF,CAAC,EACDH,WAAW,CACZ;MAED,MAAMS,OAAO,CAACC,GAAG,CACfJ,GAAG,CAACK,GAAG,CAAEC,EAAE,IAAK;QACd,OAAO,IAAI,CAACxB,KAAK,CAACyB,kBAAkB,CAACD,EAAE,CAAC;MAC1C,CAAC,CAAC,CACH;MAEDnB,GAAG,CAACqB,IAAI,CAACR,GAAG,CAAC;IACf,CAAC,CACF;EA7B0E;AA8B7E;AAAC"}
package/dist/scope-cmd.js CHANGED
@@ -1,36 +1,26 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  require("core-js/modules/es.array.iterator.js");
6
-
7
5
  require("core-js/modules/es.promise.js");
8
-
9
6
  Object.defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
9
  exports.ScopeCmd = void 0;
13
-
14
10
  function _defineProperty2() {
15
11
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
-
17
12
  _defineProperty2 = function () {
18
13
  return data;
19
14
  };
20
-
21
15
  return data;
22
16
  }
23
-
24
17
  function _chalk() {
25
18
  const data = _interopRequireDefault(require("chalk"));
26
-
27
19
  _chalk = function () {
28
20
  return data;
29
21
  };
30
-
31
22
  return data;
32
23
  }
33
-
34
24
  class ScopeCmd {
35
25
  constructor() {
36
26
  (0, _defineProperty2().default)(this, "name", 'scope <sub-command>');
@@ -40,13 +30,10 @@ class ScopeCmd {
40
30
  (0, _defineProperty2().default)(this, "group", 'development');
41
31
  (0, _defineProperty2().default)(this, "commands", []);
42
32
  }
43
-
44
33
  async report([unrecognizedSubcommand]) {
45
34
  return _chalk().default.red(`"${unrecognizedSubcommand}" is not a subcommand of "scope", please run "bit scope --help" to list the subcommands`);
46
35
  }
47
-
48
36
  }
49
-
50
37
  exports.ScopeCmd = ScopeCmd;
51
38
 
52
39
  //# sourceMappingURL=scope-cmd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ScopeCmd","report","unrecognizedSubcommand","chalk","red"],"sources":["scope-cmd.ts"],"sourcesContent":["import { Command } from '@teambit/cli';\nimport chalk from 'chalk';\n\nexport class ScopeCmd implements Command {\n name = 'scope <sub-command>';\n alias = '';\n description = 'EXPERIMENTAL. manage the scope-name for components';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"scope\", please run \"bit scope --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,QAAN,CAAkC;EAAA;IAAA,8CAChC,qBADgC;IAAA,+CAE/B,EAF+B;IAAA,qDAGzB,oDAHyB;IAAA,iDAI7B,EAJ6B;IAAA,+CAK/B,aAL+B;IAAA,kDAMjB,EANiB;EAAA;;EAQ3B,MAANC,MAAM,CAAC,CAACC,sBAAD,CAAD,EAAqC;IAC/C,OAAOC,gBAAA,CAAMC,GAAN,CACJ,IAAGF,sBAAuB,yFADtB,CAAP;EAGD;;AAZsC"}
1
+ {"version":3,"names":["ScopeCmd","report","unrecognizedSubcommand","chalk","red"],"sources":["scope-cmd.ts"],"sourcesContent":["import { Command } from '@teambit/cli';\nimport chalk from 'chalk';\n\nexport class ScopeCmd implements Command {\n name = 'scope <sub-command>';\n alias = '';\n description = 'EXPERIMENTAL. manage the scope-name for components';\n options = [];\n group = 'development';\n commands: Command[] = [];\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"scope\", please run \"bit scope --help\" to list the subcommands`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,QAAQ,CAAoB;EAAA;IAAA,8CAChC,qBAAqB;IAAA,+CACpB,EAAE;IAAA,qDACI,oDAAoD;IAAA,iDACxD,EAAE;IAAA,+CACJ,aAAa;IAAA,kDACC,EAAE;EAAA;EAExB,MAAMC,MAAM,CAAC,CAACC,sBAAsB,CAAW,EAAE;IAC/C,OAAOC,gBAAK,CAACC,GAAG,CACb,IAAGF,sBAAuB,yFAAwF,CACpH;EACH;AACF;AAAC"}