@sprucelabs/spruce-cli 18.1.7 → 18.2.0
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/CHANGELOG.md +10 -0
- package/build/__tests__/behavioral/WatchingSkillViews.test.js +1 -1
- package/build/__tests__/behavioral/WatchingSkillViews.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/AbstractPermissionsTest.d.ts +8 -0
- package/build/__tests__/behavioral/permissions/AbstractPermissionsTest.js +85 -0
- package/build/__tests__/behavioral/permissions/AbstractPermissionsTest.js.map +1 -0
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.d.ts +5 -6
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js +54 -34
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionStore.test.d.ts +24 -0
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js +420 -0
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js.map +1 -0
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.d.ts +7 -0
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js +88 -0
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js.map +1 -0
- package/build/__tests__/implementation/{GlobalEmitter.d.ts → GlobalEmitter.test.d.ts} +0 -0
- package/build/__tests__/implementation/{GlobalEmitter.js → GlobalEmitter.test.js} +1 -1
- package/build/__tests__/implementation/GlobalEmitter.test.js.map +1 -0
- package/build/__tests__/support/EventFaker.d.ts +5 -0
- package/build/__tests__/support/EventFaker.js +48 -0
- package/build/__tests__/support/EventFaker.js.map +1 -0
- package/build/features/error/writers/ErrorWriter.js +1 -4
- package/build/features/error/writers/ErrorWriter.js.map +1 -1
- package/build/features/event/EventFeature.js.map +1 -1
- package/build/features/event/writers/EventWriter.js +6 -2
- package/build/features/event/writers/EventWriter.js.map +1 -1
- package/build/features/permission/actions/CreateAction.d.ts +51 -24
- package/build/features/permission/actions/CreateAction.js +36 -10
- package/build/features/permission/actions/CreateAction.js.map +1 -1
- package/build/features/permission/actions/SyncAction.d.ts +16 -0
- package/build/features/permission/actions/SyncAction.js +71 -0
- package/build/features/permission/actions/SyncAction.js.map +1 -0
- package/build/features/permission/stores/PermissionStore.d.ts +7 -0
- package/build/features/permission/stores/PermissionStore.js +159 -0
- package/build/features/permission/stores/PermissionStore.js.map +1 -0
- package/build/features/permission/writers/PermissionWriter.d.ts +10 -0
- package/build/features/permission/writers/PermissionWriter.js +94 -0
- package/build/features/permission/writers/PermissionWriter.js.map +1 -0
- package/build/features/view/actions/WatchAction.js +1 -1
- package/build/features/view/actions/WatchAction.js.map +1 -1
- package/build/stores/StoreFactory.d.ts +2 -0
- package/build/stores/StoreFactory.js +3 -1
- package/build/stores/StoreFactory.js.map +1 -1
- package/build/tests/cleanTestData.js +25 -18
- package/build/tests/cleanTestData.js.map +1 -1
- package/build/writers/WriterFactory.d.ts +2 -0
- package/build/writers/WriterFactory.js +3 -1
- package/build/writers/WriterFactory.js.map +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +6 -6
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js +9 -9
- package/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js +21 -7
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js +12 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js +2 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js +39 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts +2 -2
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js +9 -9
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js +17 -17
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/package.json +12 -12
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +8 -2
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +3 -3
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +8 -2
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js +1 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +3 -3
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +3 -3
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/index.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +2 -1
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +7 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js +9 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts +2 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/package.json +6 -6
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +1 -0
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/package.json +4 -4
- package/package.json +28 -26
- package/src/__tests__/behavioral/WatchingSkillViews.test.ts +1 -1
- package/src/__tests__/behavioral/permissions/AbstractPermissionsTest.ts +20 -0
- package/src/__tests__/behavioral/permissions/CreatingPermissions.test.ts +32 -16
- package/src/__tests__/behavioral/permissions/PermissionStore.test.ts +233 -0
- package/src/__tests__/behavioral/permissions/SyncingPermissions.test.ts +25 -0
- package/src/__tests__/implementation/{GlobalEmitter.ts → GlobalEmitter.test.ts} +0 -0
- package/src/__tests__/support/EventFaker.ts +23 -0
- package/src/features/error/writers/ErrorWriter.ts +0 -2
- package/src/features/event/EventFeature.ts +0 -1
- package/src/features/event/writers/EventWriter.ts +4 -0
- package/src/features/permission/actions/CreateAction.ts +39 -16
- package/src/features/permission/actions/SyncAction.ts +23 -0
- package/src/features/permission/stores/PermissionStore.ts +51 -0
- package/src/features/permission/writers/PermissionWriter.ts +54 -0
- package/src/features/view/actions/WatchAction.ts +1 -1
- package/src/stores/StoreFactory.ts +5 -2
- package/src/tests/cleanTestData.ts +7 -3
- package/src/writers/WriterFactory.ts +3 -0
- package/build/__tests__/implementation/GlobalEmitter.js.map +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
+
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
19
|
+
var _globby = _interopRequireDefault(require("globby"));
|
|
20
|
+
var _AbstractStore2 = _interopRequireDefault(require("../../../stores/AbstractStore"));
|
|
21
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
22
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
25
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
26
|
+
var PermissionStore = /*#__PURE__*/function (_AbstractStore) {
|
|
27
|
+
(0, _inherits2["default"])(PermissionStore, _AbstractStore);
|
|
28
|
+
var _super = _createSuper(PermissionStore);
|
|
29
|
+
function PermissionStore() {
|
|
30
|
+
var _this;
|
|
31
|
+
(0, _classCallCheck2["default"])(this, PermissionStore);
|
|
32
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
|
+
args[_key] = arguments[_key];
|
|
34
|
+
}
|
|
35
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "name", 'permission');
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
(0, _createClass2["default"])(PermissionStore, [{
|
|
40
|
+
key: "loadLocalPermissions",
|
|
41
|
+
value: function () {
|
|
42
|
+
var _loadLocalPermissions = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
43
|
+
var matches, map, _iterator, _step, file, contract;
|
|
44
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
45
|
+
while (1) {
|
|
46
|
+
switch (_context.prev = _context.next) {
|
|
47
|
+
case 0:
|
|
48
|
+
_context.next = 2;
|
|
49
|
+
return (0, _globby["default"])('**/*.permissions.ts', {
|
|
50
|
+
cwd: this.cwd
|
|
51
|
+
});
|
|
52
|
+
case 2:
|
|
53
|
+
matches = _context.sent;
|
|
54
|
+
map = {};
|
|
55
|
+
_iterator = _createForOfIteratorHelper(matches);
|
|
56
|
+
_context.prev = 5;
|
|
57
|
+
_iterator.s();
|
|
58
|
+
case 7:
|
|
59
|
+
if ((_step = _iterator.n()).done) {
|
|
60
|
+
_context.next = 15;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
file = _step.value;
|
|
64
|
+
_context.next = 11;
|
|
65
|
+
return this.Service('import').importDefault(_spruceSkillUtils.diskUtil.resolvePath(this.cwd, file));
|
|
66
|
+
case 11:
|
|
67
|
+
contract = _context.sent;
|
|
68
|
+
map[contract.id] = contract.permissions.map(function (p) {
|
|
69
|
+
return p.id;
|
|
70
|
+
});
|
|
71
|
+
case 13:
|
|
72
|
+
_context.next = 7;
|
|
73
|
+
break;
|
|
74
|
+
case 15:
|
|
75
|
+
_context.next = 20;
|
|
76
|
+
break;
|
|
77
|
+
case 17:
|
|
78
|
+
_context.prev = 17;
|
|
79
|
+
_context.t0 = _context["catch"](5);
|
|
80
|
+
_iterator.e(_context.t0);
|
|
81
|
+
case 20:
|
|
82
|
+
_context.prev = 20;
|
|
83
|
+
_iterator.f();
|
|
84
|
+
return _context.finish(20);
|
|
85
|
+
case 23:
|
|
86
|
+
return _context.abrupt("return", map);
|
|
87
|
+
case 24:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, _callee, this, [[5, 17, 20, 23]]);
|
|
93
|
+
}));
|
|
94
|
+
function loadLocalPermissions() {
|
|
95
|
+
return _loadLocalPermissions.apply(this, arguments);
|
|
96
|
+
}
|
|
97
|
+
return loadLocalPermissions;
|
|
98
|
+
}()
|
|
99
|
+
}, {
|
|
100
|
+
key: "fetchContracts",
|
|
101
|
+
value: function () {
|
|
102
|
+
var _fetchContracts = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
103
|
+
var client, deps, _yield$client$emitAnd, _yield$client$emitAnd2, permissionContracts, map, _iterator2, _step2, result;
|
|
104
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
105
|
+
while (1) {
|
|
106
|
+
switch (_context2.prev = _context2.next) {
|
|
107
|
+
case 0:
|
|
108
|
+
_context2.next = 2;
|
|
109
|
+
return this.connectToApi();
|
|
110
|
+
case 2:
|
|
111
|
+
client = _context2.sent;
|
|
112
|
+
deps = this.Service('dependency').get();
|
|
113
|
+
_context2.next = 6;
|
|
114
|
+
return client.emitAndFlattenResponses('list-permission-contracts::v2020_12_25', {
|
|
115
|
+
target: {
|
|
116
|
+
namespaces: deps.map(function (d) {
|
|
117
|
+
return d.namespace;
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
case 6:
|
|
122
|
+
_yield$client$emitAnd = _context2.sent;
|
|
123
|
+
_yield$client$emitAnd2 = (0, _slicedToArray2["default"])(_yield$client$emitAnd, 1);
|
|
124
|
+
permissionContracts = _yield$client$emitAnd2[0].permissionContracts;
|
|
125
|
+
_context2.next = 11;
|
|
126
|
+
return this.loadLocalPermissions();
|
|
127
|
+
case 11:
|
|
128
|
+
map = _context2.sent;
|
|
129
|
+
_iterator2 = _createForOfIteratorHelper(permissionContracts);
|
|
130
|
+
try {
|
|
131
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
132
|
+
result = _step2.value;
|
|
133
|
+
map[result.contract.id] = result.contract.permissions.map(function (p) {
|
|
134
|
+
return p.id;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
} catch (err) {
|
|
138
|
+
_iterator2.e(err);
|
|
139
|
+
} finally {
|
|
140
|
+
_iterator2.f();
|
|
141
|
+
}
|
|
142
|
+
return _context2.abrupt("return", map);
|
|
143
|
+
case 15:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context2.stop();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, _callee2, this);
|
|
149
|
+
}));
|
|
150
|
+
function fetchContracts() {
|
|
151
|
+
return _fetchContracts.apply(this, arguments);
|
|
152
|
+
}
|
|
153
|
+
return fetchContracts;
|
|
154
|
+
}()
|
|
155
|
+
}]);
|
|
156
|
+
return PermissionStore;
|
|
157
|
+
}(_AbstractStore2["default"]);
|
|
158
|
+
exports["default"] = PermissionStore;
|
|
159
|
+
//# sourceMappingURL=PermissionStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionStore.js","names":["PermissionStore","globby","cwd","matches","map","file","Service","importDefault","diskUtil","resolvePath","contract","id","permissions","p","connectToApi","client","deps","get","emitAndFlattenResponses","target","namespaces","d","namespace","permissionContracts","loadLocalPermissions","result","AbstractStore"],"sources":["../../../../src/features/permission/stores/PermissionStore.ts"],"sourcesContent":["import {\n\tPermissionContract,\n\tPermissionContractMap,\n} from '@sprucelabs/mercury-types'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport globby from 'globby'\nimport AbstractStore from '../../../stores/AbstractStore'\n\nexport default class PermissionStore extends AbstractStore {\n\tpublic name = 'permission'\n\n\tprivate async loadLocalPermissions() {\n\t\tconst matches = await globby('**/*.permissions.ts', {\n\t\t\tcwd: this.cwd,\n\t\t})\n\n\t\tconst map: PermissionContractMap = {}\n\n\t\tfor (const file of matches) {\n\t\t\tconst contract = (await this.Service('import').importDefault(\n\t\t\t\tdiskUtil.resolvePath(this.cwd, file)\n\t\t\t)) as PermissionContract\n\n\t\t\tmap[contract.id] = contract.permissions.map((p) => p.id)\n\t\t}\n\n\t\treturn map\n\t}\n\n\tpublic async fetchContracts() {\n\t\tconst client = await this.connectToApi()\n\t\tconst deps = this.Service('dependency').get()\n\n\t\tconst [{ permissionContracts }] = await client.emitAndFlattenResponses(\n\t\t\t'list-permission-contracts::v2020_12_25',\n\t\t\t{\n\t\t\t\ttarget: {\n\t\t\t\t\tnamespaces: deps.map((d) => d.namespace),\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\n\t\tconst map: PermissionContractMap = await this.loadLocalPermissions()\n\n\t\tfor (const result of permissionContracts) {\n\t\t\tmap[result.contract.id] = result.contract.permissions.map((p) => p.id)\n\t\t}\n\n\t\treturn map\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AAAyD;AAAA;AAAA;AAAA;AAAA;AAAA,IAEpCA,eAAe;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;MAAA;IAAA;IAAA;IAAA,yFACrB,YAAY;IAAA;EAAA;EAAA;IAAA;IAAA;MAAA,0GAE1B;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACuB,IAAAC,kBAAM,EAAC,qBAAqB,EAAE;kBACnDC,GAAG,EAAE,IAAI,CAACA;gBACX,CAAC,CAAC;cAAA;gBAFIC,OAAO;gBAIPC,GAA0B,GAAG,CAAC,CAAC;gBAAA,uCAElBD,OAAO;gBAAA;gBAAA;cAAA;gBAAA;kBAAA;kBAAA;gBAAA;gBAAfE,IAAI;gBAAA;gBAAA,OACU,IAAI,CAACC,OAAO,CAAC,QAAQ,CAAC,CAACC,aAAa,CAC3DC,0BAAQ,CAACC,WAAW,CAAC,IAAI,CAACP,GAAG,EAAEG,IAAI,CAAC,CACpC;cAAA;gBAFKK,QAAQ;gBAIdN,GAAG,CAACM,QAAQ,CAACC,EAAE,CAAC,GAAGD,QAAQ,CAACE,WAAW,CAACR,GAAG,CAAC,UAACS,CAAC;kBAAA,OAAKA,CAAC,CAACF,EAAE;gBAAA,EAAC;cAAA;gBAAA;gBAAA;cAAA;gBAAA;gBAAA;cAAA;gBAAA;gBAAA;gBAAA;cAAA;gBAAA;gBAAA;gBAAA;cAAA;gBAAA,iCAGlDP,GAAG;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACV;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;IAAA;IAAA;MAAA,oGAED;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACsB,IAAI,CAACU,YAAY,EAAE;cAAA;gBAAlCC,MAAM;gBACNC,IAAI,GAAG,IAAI,CAACV,OAAO,CAAC,YAAY,CAAC,CAACW,GAAG,EAAE;gBAAA;gBAAA,OAELF,MAAM,CAACG,uBAAuB,CACrE,wCAAwC,EACxC;kBACCC,MAAM,EAAE;oBACPC,UAAU,EAAEJ,IAAI,CAACZ,GAAG,CAAC,UAACiB,CAAC;sBAAA,OAAKA,CAAC,CAACC,SAAS;oBAAA;kBACxC;gBACD,CAAC,CACD;cAAA;gBAAA;gBAAA;gBAPQC,mBAAmB,6BAAnBA,mBAAmB;gBAAA;gBAAA,OASa,IAAI,CAACC,oBAAoB,EAAE;cAAA;gBAA9DpB,GAA0B;gBAAA,wCAEXmB,mBAAmB;gBAAA;kBAAxC,uDAA0C;oBAA/BE,MAAM;oBAChBrB,GAAG,CAACqB,MAAM,CAACf,QAAQ,CAACC,EAAE,CAAC,GAAGc,MAAM,CAACf,QAAQ,CAACE,WAAW,CAACR,GAAG,CAAC,UAACS,CAAC;sBAAA,OAAKA,CAAC,CAACF,EAAE;oBAAA,EAAC;kBACvE;gBAAC;kBAAA;gBAAA;kBAAA;gBAAA;gBAAA,kCAEMP,GAAG;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACV;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA,EAzC2CsB,0BAAa;AAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import AbstractWriter from '../../../writers/AbstractWriter';
|
|
2
|
+
export default class PermissionWriter extends AbstractWriter {
|
|
3
|
+
writeTypesFile(destinationDir: string): Promise<import("../../../writers/AbstractWriter").WriteResults>;
|
|
4
|
+
writeContract(destinationDir: string, options: {
|
|
5
|
+
nameReadable: string;
|
|
6
|
+
nameKebab: string;
|
|
7
|
+
nameCamel: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}): Promise<import("../../../writers/AbstractWriter").WriteResults>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
16
|
+
var _AbstractWriter2 = _interopRequireDefault(require("../../../writers/AbstractWriter"));
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
var PermissionWriter = /*#__PURE__*/function (_AbstractWriter) {
|
|
20
|
+
(0, _inherits2["default"])(PermissionWriter, _AbstractWriter);
|
|
21
|
+
var _super = _createSuper(PermissionWriter);
|
|
22
|
+
function PermissionWriter() {
|
|
23
|
+
(0, _classCallCheck2["default"])(this, PermissionWriter);
|
|
24
|
+
return _super.apply(this, arguments);
|
|
25
|
+
}
|
|
26
|
+
(0, _createClass2["default"])(PermissionWriter, [{
|
|
27
|
+
key: "writeTypesFile",
|
|
28
|
+
value: function () {
|
|
29
|
+
var _writeTypesFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(destinationDir) {
|
|
30
|
+
var destination, files;
|
|
31
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
|
+
while (1) {
|
|
33
|
+
switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
destination = _spruceSkillUtils.diskUtil.resolveHashSprucePath(destinationDir, 'permissions', 'permissions.types.ts');
|
|
36
|
+
_context.next = 3;
|
|
37
|
+
return this.writeFileIfChangedMixinResults(destination, '', 'Types file for any permission contracts you created or depend on.');
|
|
38
|
+
case 3:
|
|
39
|
+
files = _context.sent;
|
|
40
|
+
return _context.abrupt("return", files);
|
|
41
|
+
case 5:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, _callee, this);
|
|
47
|
+
}));
|
|
48
|
+
function writeTypesFile(_x) {
|
|
49
|
+
return _writeTypesFile.apply(this, arguments);
|
|
50
|
+
}
|
|
51
|
+
return writeTypesFile;
|
|
52
|
+
}()
|
|
53
|
+
}, {
|
|
54
|
+
key: "writeContract",
|
|
55
|
+
value: function () {
|
|
56
|
+
var _writeContract = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(destinationDir, options) {
|
|
57
|
+
var nameReadable, nameKebab, nameCamel, description, destination, content, files;
|
|
58
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
59
|
+
while (1) {
|
|
60
|
+
switch (_context2.prev = _context2.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
nameReadable = options.nameReadable, nameKebab = options.nameKebab, nameCamel = options.nameCamel, description = options.description;
|
|
63
|
+
destination = _spruceSkillUtils.diskUtil.resolvePath(destinationDir, "".concat(nameKebab, ".permissions.ts"));
|
|
64
|
+
content = this.templates.permissionContractBuilder({
|
|
65
|
+
nameCamel: nameCamel,
|
|
66
|
+
nameKebab: nameKebab,
|
|
67
|
+
description: description,
|
|
68
|
+
nameReadable: nameReadable
|
|
69
|
+
});
|
|
70
|
+
_context2.next = 5;
|
|
71
|
+
return this.writeFileIfChangedMixinResults(destination, content, 'Your brand new permissions contract!');
|
|
72
|
+
case 5:
|
|
73
|
+
files = _context2.sent;
|
|
74
|
+
_context2.next = 8;
|
|
75
|
+
return this.lint(destination);
|
|
76
|
+
case 8:
|
|
77
|
+
return _context2.abrupt("return", files);
|
|
78
|
+
case 9:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context2.stop();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, _callee2, this);
|
|
84
|
+
}));
|
|
85
|
+
function writeContract(_x2, _x3) {
|
|
86
|
+
return _writeContract.apply(this, arguments);
|
|
87
|
+
}
|
|
88
|
+
return writeContract;
|
|
89
|
+
}()
|
|
90
|
+
}]);
|
|
91
|
+
return PermissionWriter;
|
|
92
|
+
}(_AbstractWriter2["default"]);
|
|
93
|
+
exports["default"] = PermissionWriter;
|
|
94
|
+
//# sourceMappingURL=PermissionWriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionWriter.js","names":["PermissionWriter","destinationDir","destination","diskUtil","resolveHashSprucePath","writeFileIfChangedMixinResults","files","options","nameReadable","nameKebab","nameCamel","description","resolvePath","content","templates","permissionContractBuilder","lint","AbstractWriter"],"sources":["../../../../src/features/permission/writers/PermissionWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nexport default class PermissionWriter extends AbstractWriter {\n\tpublic async writeTypesFile(destinationDir: string) {\n\t\tconst destination = diskUtil.resolveHashSprucePath(\n\t\t\tdestinationDir,\n\t\t\t'permissions',\n\t\t\t'permissions.types.ts'\n\t\t)\n\n\t\tconst files = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\t'',\n\t\t\t'Types file for any permission contracts you created or depend on.'\n\t\t)\n\n\t\treturn files\n\t}\n\n\tpublic async writeContract(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\tnameReadable: string\n\t\t\tnameKebab: string\n\t\t\tnameCamel: string\n\t\t\tdescription?: string\n\t\t}\n\t) {\n\t\tconst { nameReadable, nameKebab, nameCamel, description } = options\n\n\t\tconst destination = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\t`${nameKebab}.permissions.ts`\n\t\t)\n\n\t\tconst content = this.templates.permissionContractBuilder({\n\t\t\tnameCamel,\n\t\t\tnameKebab,\n\t\t\tdescription,\n\t\t\tnameReadable,\n\t\t})\n\n\t\tconst files = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tcontent,\n\t\t\t'Your brand new permissions contract!'\n\t\t)\n\n\t\tawait this.lint(destination)\n\n\t\treturn files\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAA4D;AAAA;AAAA,IAEvCA,gBAAgB;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;MAAA,oGACpC,iBAA4BC,cAAsB;QAAA;QAAA;UAAA;YAAA;cAAA;gBAC3CC,WAAW,GAAGC,0BAAQ,CAACC,qBAAqB,CACjDH,cAAc,EACd,aAAa,EACb,sBAAsB,CACtB;gBAAA;gBAAA,OAEmB,IAAI,CAACI,8BAA8B,CACtDH,WAAW,EACX,EAAE,EACF,mEAAmE,CACnE;cAAA;gBAJKI,KAAK;gBAAA,iCAMJA,KAAK;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACZ;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;IAAA;IAAA;MAAA,mGAED,kBACCL,cAAsB,EACtBM,OAKC;QAAA;QAAA;UAAA;YAAA;cAAA;gBAEOC,YAAY,GAAwCD,OAAO,CAA3DC,YAAY,EAAEC,SAAS,GAA6BF,OAAO,CAA7CE,SAAS,EAAEC,SAAS,GAAkBH,OAAO,CAAlCG,SAAS,EAAEC,WAAW,GAAKJ,OAAO,CAAvBI,WAAW;gBAEjDT,WAAW,GAAGC,0BAAQ,CAACS,WAAW,CACvCX,cAAc,YACXQ,SAAS,qBACZ;gBAEKI,OAAO,GAAG,IAAI,CAACC,SAAS,CAACC,yBAAyB,CAAC;kBACxDL,SAAS,EAATA,SAAS;kBACTD,SAAS,EAATA,SAAS;kBACTE,WAAW,EAAXA,WAAW;kBACXH,YAAY,EAAZA;gBACD,CAAC,CAAC;gBAAA;gBAAA,OAEkB,IAAI,CAACH,8BAA8B,CACtDH,WAAW,EACXW,OAAO,EACP,sCAAsC,CACtC;cAAA;gBAJKP,KAAK;gBAAA;gBAAA,OAML,IAAI,CAACU,IAAI,CAACd,WAAW,CAAC;cAAA;gBAAA,kCAErBI,KAAK;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACZ;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA,EAjD4CW,2BAAc;AAAA"}
|
|
@@ -58,7 +58,7 @@ var WatchAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
58
58
|
this.resetUi();
|
|
59
59
|
commands = this.Service('command');
|
|
60
60
|
_context.next = 8;
|
|
61
|
-
return commands.execute('ENABLED_SKILL_FEATURES=view,event
|
|
61
|
+
return commands.execute('ENABLED_SKILL_FEATURES=view,event SHOULD_WATCH_VIEWS=true MAXIMUM_LOG_PREFIXES_LENGTH=0 yarn boot', {
|
|
62
62
|
onData: function onData(data) {
|
|
63
63
|
var line = _this2.popLastLine(data);
|
|
64
64
|
_this2.ui.startLoading(line);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WatchAction.js","names":["optionsSchema","buildSchema","id","description","fields","WatchAction","Store","loadCurrentSkill","skill","skillName","name","resetUi","commands","Service","execute","onData","data","line","popLastLine","ui","startLoading","summaryLines","trim","split","filter","s","pop","length","remote","getRemote","heartwoodRemoteUtil","buildUrl","clear","renderHero","renderDivider","renderLines","getPreviewUrl","renderLine","AbstractAction"],"sources":["../../../../src/features/view/actions/WatchAction.ts"],"sourcesContent":["import { buildSchema } from '@sprucelabs/schema'\nimport { heartwoodRemoteUtil } from '@sprucelabs/spruce-event-utils'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'watchViewsOptions',\n\tdescription: 'Watch for view changes and preview them in real time.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\n\nexport default class WatchAction extends AbstractAction<OptionsSchema> {\n\tpublic commandAliases = ['watch.views']\n\tpublic optionsSchema: OptionsSchema = optionsSchema\n\tpublic invocationMessage = 'Watching views... 🤩'\n\tprivate skillName!: string\n\n\tpublic async execute(): Promise<FeatureActionResponse> {\n\t\tconst skill = await this.Store('skill').loadCurrentSkill()\n\t\tthis.skillName = skill.name\n\n\t\tthis.resetUi()\n\t\tconst commands = this.Service('command')\n\t\tawait commands.execute(\n\t\t\t'ENABLED_SKILL_FEATURES=view,event
|
|
1
|
+
{"version":3,"file":"WatchAction.js","names":["optionsSchema","buildSchema","id","description","fields","WatchAction","Store","loadCurrentSkill","skill","skillName","name","resetUi","commands","Service","execute","onData","data","line","popLastLine","ui","startLoading","summaryLines","trim","split","filter","s","pop","length","remote","getRemote","heartwoodRemoteUtil","buildUrl","clear","renderHero","renderDivider","renderLines","getPreviewUrl","renderLine","AbstractAction"],"sources":["../../../../src/features/view/actions/WatchAction.ts"],"sourcesContent":["import { buildSchema } from '@sprucelabs/schema'\nimport { heartwoodRemoteUtil } from '@sprucelabs/spruce-event-utils'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'watchViewsOptions',\n\tdescription: 'Watch for view changes and preview them in real time.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\n\nexport default class WatchAction extends AbstractAction<OptionsSchema> {\n\tpublic commandAliases = ['watch.views']\n\tpublic optionsSchema: OptionsSchema = optionsSchema\n\tpublic invocationMessage = 'Watching views... 🤩'\n\tprivate skillName!: string\n\n\tpublic async execute(): Promise<FeatureActionResponse> {\n\t\tconst skill = await this.Store('skill').loadCurrentSkill()\n\t\tthis.skillName = skill.name\n\n\t\tthis.resetUi()\n\t\tconst commands = this.Service('command')\n\t\tawait commands.execute(\n\t\t\t'ENABLED_SKILL_FEATURES=view,event SHOULD_WATCH_VIEWS=true MAXIMUM_LOG_PREFIXES_LENGTH=0 yarn boot',\n\t\t\t{\n\t\t\t\tonData: (data) => {\n\t\t\t\t\tconst line = this.popLastLine(data)\n\t\t\t\t\tthis.ui.startLoading(line)\n\t\t\t\t},\n\t\t\t}\n\t\t)\n\n\t\treturn {\n\t\t\tsummaryLines: [`Done watching...`],\n\t\t}\n\t}\n\n\tprivate popLastLine(data: string) {\n\t\tconst line = data\n\t\t\t.trim()\n\t\t\t.split('\\n')\n\t\t\t.filter((s) => !!s)\n\t\t\t.pop()\n\n\t\treturn line && line.length > 0 ? line.trim() : 'Waiting for changes'\n\t}\n\n\tprivate getPreviewUrl() {\n\t\tconst remote = this.Service('remote').getRemote() as any\n\t\treturn heartwoodRemoteUtil.buildUrl(remote) + '/#views/heartwood.watch'\n\t}\n\n\tprivate resetUi() {\n\t\tthis.ui.clear()\n\t\tthis.ui.renderHero('Heartwood')\n\t\tthis.ui.renderDivider()\n\t\tthis.ui.renderLines([\n\t\t\t'',\n\t\t\t`Skill: ${this.skillName}`,\n\t\t\t`Preview: ${this.getPreviewUrl()}`,\n\t\t\t'',\n\t\t])\n\t\tthis.ui.renderDivider()\n\t\tthis.ui.renderLine('')\n\t\tthis.ui.startLoading('Watching for changes')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAAiD;AAAA;AAGjD,IAAMA,aAAa,GAAG,IAAAC,mBAAW,EAAC;EACjCC,EAAE,EAAE,mBAAmB;EACvBC,WAAW,EAAE,uDAAuD;EACpEC,MAAM,EAAE,CAAC;AACV,CAAC,CAAC;AAAA,IAImBC,WAAW;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;MAAA;IAAA;IAAA;IAAA,mGACP,CAAC,aAAa,CAAC;IAAA,kGACDL,aAAa;IAAA,sGACxB,sBAAsB;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;MAAA,6FAGjD;QAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACqB,IAAI,CAACM,KAAK,CAAC,OAAO,CAAC,CAACC,gBAAgB,EAAE;cAAA;gBAApDC,KAAK;gBACX,IAAI,CAACC,SAAS,GAAGD,KAAK,CAACE,IAAI;gBAE3B,IAAI,CAACC,OAAO,EAAE;gBACRC,QAAQ,GAAG,IAAI,CAACC,OAAO,CAAC,SAAS,CAAC;gBAAA;gBAAA,OAClCD,QAAQ,CAACE,OAAO,CACrB,mGAAmG,EACnG;kBACCC,MAAM,EAAE,gBAACC,IAAI,EAAK;oBACjB,IAAMC,IAAI,GAAG,MAAI,CAACC,WAAW,CAACF,IAAI,CAAC;oBACnC,MAAI,CAACG,EAAE,CAACC,YAAY,CAACH,IAAI,CAAC;kBAC3B;gBACD,CAAC,CACD;cAAA;gBAAA,iCAEM;kBACNI,YAAY,EAAE;gBACf,CAAC;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,CACD;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;IAAA;IAAA,OAED,qBAAoBL,IAAY,EAAE;MACjC,IAAMC,IAAI,GAAGD,IAAI,CACfM,IAAI,EAAE,CACNC,KAAK,CAAC,IAAI,CAAC,CACXC,MAAM,CAAC,UAACC,CAAC;QAAA,OAAK,CAAC,CAACA,CAAC;MAAA,EAAC,CAClBC,GAAG,EAAE;MAEP,OAAOT,IAAI,IAAIA,IAAI,CAACU,MAAM,GAAG,CAAC,GAAGV,IAAI,CAACK,IAAI,EAAE,GAAG,qBAAqB;IACrE;EAAC;IAAA;IAAA,OAED,yBAAwB;MACvB,IAAMM,MAAM,GAAG,IAAI,CAACf,OAAO,CAAC,QAAQ,CAAC,CAACgB,SAAS,EAAS;MACxD,OAAOC,qCAAmB,CAACC,QAAQ,CAACH,MAAM,CAAC,GAAG,yBAAyB;IACxE;EAAC;IAAA;IAAA,OAED,mBAAkB;MACjB,IAAI,CAACT,EAAE,CAACa,KAAK,EAAE;MACf,IAAI,CAACb,EAAE,CAACc,UAAU,CAAC,WAAW,CAAC;MAC/B,IAAI,CAACd,EAAE,CAACe,aAAa,EAAE;MACvB,IAAI,CAACf,EAAE,CAACgB,WAAW,CAAC,CACnB,EAAE,mBACQ,IAAI,CAAC1B,SAAS,sBACZ,IAAI,CAAC2B,aAAa,EAAE,GAChC,EAAE,CACF,CAAC;MACF,IAAI,CAACjB,EAAE,CAACe,aAAa,EAAE;MACvB,IAAI,CAACf,EAAE,CAACkB,UAAU,CAAC,EAAE,CAAC;MACtB,IAAI,CAAClB,EAAE,CAACC,YAAY,CAAC,sBAAsB,CAAC;IAC7C;EAAC;EAAA;AAAA,EAvDuCkB,2BAAc;AAAA"}
|
|
@@ -3,6 +3,7 @@ import EventStore from '../features/event/stores/EventStore';
|
|
|
3
3
|
import ListenerStore from '../features/event/stores/ListenerStore';
|
|
4
4
|
import OnboardingStore from '../features/onboard/stores/OnboardingStore';
|
|
5
5
|
import OrganizationStore from '../features/organization/stores/OrganizationStore';
|
|
6
|
+
import PermissionStore from '../features/permission/stores/PermissionStore';
|
|
6
7
|
import SchemaStore from '../features/schema/stores/SchemaStore';
|
|
7
8
|
import SkillStore, { SkillStoreOptions } from '../features/skill/stores/SkillStore';
|
|
8
9
|
import StoreStore from '../features/store/stores/StoreStore';
|
|
@@ -35,6 +36,7 @@ export interface StoreMap {
|
|
|
35
36
|
store: StoreStore;
|
|
36
37
|
view: ViewStore;
|
|
37
38
|
listener: ListenerStore;
|
|
39
|
+
permission: PermissionStore;
|
|
38
40
|
}
|
|
39
41
|
export declare type StoreCode = keyof StoreMap;
|
|
40
42
|
export interface StoreFactoryOptions {
|
|
@@ -13,6 +13,7 @@ var _EventStore = _interopRequireDefault(require("../features/event/stores/Event
|
|
|
13
13
|
var _ListenerStore = _interopRequireDefault(require("../features/event/stores/ListenerStore"));
|
|
14
14
|
var _OnboardingStore = _interopRequireDefault(require("../features/onboard/stores/OnboardingStore"));
|
|
15
15
|
var _OrganizationStore = _interopRequireDefault(require("../features/organization/stores/OrganizationStore"));
|
|
16
|
+
var _PermissionStore = _interopRequireDefault(require("../features/permission/stores/PermissionStore"));
|
|
16
17
|
var _SchemaStore = _interopRequireDefault(require("../features/schema/stores/SchemaStore"));
|
|
17
18
|
var _SkillStore = _interopRequireDefault(require("../features/skill/stores/SkillStore"));
|
|
18
19
|
var _StoreStore = _interopRequireDefault(require("../features/store/stores/StoreStore"));
|
|
@@ -68,6 +69,7 @@ var storeMap = {
|
|
|
68
69
|
conversation: _ConversationStore["default"],
|
|
69
70
|
store: _StoreStore["default"],
|
|
70
71
|
view: _ViewStore["default"],
|
|
71
|
-
listener: _ListenerStore["default"]
|
|
72
|
+
listener: _ListenerStore["default"],
|
|
73
|
+
permission: _PermissionStore["default"]
|
|
72
74
|
};
|
|
73
75
|
//# sourceMappingURL=StoreFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreFactory.js","names":["StoreFactory","options","cwd","serviceFactory","homeDir","apiClientFactory","emitter","code","storeOptions","storeMap","Error","store","onboarding","OnboardingStore","schema","SchemaStore","event","EventStore","skill","SkillStore","organization","OrganizationStore","conversation","ConversationStore","StoreStore","view","ViewStore","listener","ListenerStore"],"sources":["../../src/stores/StoreFactory.ts"],"sourcesContent":["import ConversationStore from '../features/conversation/stores/ConversationStore'\nimport EventStore from '../features/event/stores/EventStore'\nimport ListenerStore from '../features/event/stores/ListenerStore'\nimport OnboardingStore from '../features/onboard/stores/OnboardingStore'\nimport OrganizationStore from '../features/organization/stores/OrganizationStore'\nimport SchemaStore from '../features/schema/stores/SchemaStore'\nimport SkillStore, {\n\tSkillStoreOptions,\n} from '../features/skill/stores/SkillStore'\nimport StoreStore from '../features/store/stores/StoreStore'\nimport ViewStore from '../features/view/stores/ViewStore'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\n\nexport default class StoreFactory {\n\tprivate serviceFactory: ServiceFactory\n\tprivate cwd: string\n\tprivate homeDir: string\n\tprivate apiClientFactory: ApiClientFactory\n\tprivate emitter: GlobalEmitter\n\n\tpublic constructor(options: StoreFactoryOptions) {\n\t\tconst { cwd, serviceFactory, homeDir, apiClientFactory, emitter } = options\n\n\t\tthis.cwd = cwd\n\t\tthis.serviceFactory = serviceFactory\n\t\tthis.homeDir = homeDir\n\t\tthis.apiClientFactory = apiClientFactory\n\t\tthis.emitter = emitter\n\t}\n\n\tpublic Store<C extends StoreCode>(\n\t\tcode: C,\n\t\toptions?: CreateStoreOptions<C>\n\t): StoreMap[C] {\n\t\tconst storeOptions = {\n\t\t\tcwd: options?.cwd ?? this.cwd,\n\t\t\tserviceFactory: this.serviceFactory,\n\t\t\thomeDir: this.homeDir,\n\t\t\tapiClientFactory: options?.apiClientFactory ?? this.apiClientFactory,\n\t\t\temitter: this.emitter,\n\t\t\t...options,\n\t\t}\n\n\t\tif (!storeMap[code]) {\n\t\t\tthrow new Error(`Could not find store with code '${code}'.`)\n\t\t}\n\n\t\tconst store = new storeMap[code](storeOptions as any)\n\n\t\treturn store as StoreMap[C]\n\t}\n}\n\ninterface UniversalOptions {\n\tcwd?: string\n\tapiClientFactory?: ApiClientFactory\n}\n\nexport type CreateStoreOptions<Code extends StoreCode> =\n\tCode extends keyof StoreOptionsMap\n\t\t? //@ts-ignore\n\t\t StoreOptionsMap[Code] & UniversalOptions\n\t\t: UniversalOptions\n\nexport interface StoreMap {\n\tonboarding: OnboardingStore\n\tschema: SchemaStore\n\tevent: EventStore\n\tskill: SkillStore\n\torganization: OrganizationStore\n\tconversation: ConversationStore\n\tstore: StoreStore\n\tview: ViewStore\n\tlistener: ListenerStore\n
|
|
1
|
+
{"version":3,"file":"StoreFactory.js","names":["StoreFactory","options","cwd","serviceFactory","homeDir","apiClientFactory","emitter","code","storeOptions","storeMap","Error","store","onboarding","OnboardingStore","schema","SchemaStore","event","EventStore","skill","SkillStore","organization","OrganizationStore","conversation","ConversationStore","StoreStore","view","ViewStore","listener","ListenerStore","permission","PermissionStore"],"sources":["../../src/stores/StoreFactory.ts"],"sourcesContent":["import ConversationStore from '../features/conversation/stores/ConversationStore'\nimport EventStore from '../features/event/stores/EventStore'\nimport ListenerStore from '../features/event/stores/ListenerStore'\nimport OnboardingStore from '../features/onboard/stores/OnboardingStore'\nimport OrganizationStore from '../features/organization/stores/OrganizationStore'\nimport PermissionStore from '../features/permission/stores/PermissionStore'\nimport SchemaStore from '../features/schema/stores/SchemaStore'\nimport SkillStore, {\n\tSkillStoreOptions,\n} from '../features/skill/stores/SkillStore'\nimport StoreStore from '../features/store/stores/StoreStore'\nimport ViewStore from '../features/view/stores/ViewStore'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\n\nexport default class StoreFactory {\n\tprivate serviceFactory: ServiceFactory\n\tprivate cwd: string\n\tprivate homeDir: string\n\tprivate apiClientFactory: ApiClientFactory\n\tprivate emitter: GlobalEmitter\n\n\tpublic constructor(options: StoreFactoryOptions) {\n\t\tconst { cwd, serviceFactory, homeDir, apiClientFactory, emitter } = options\n\n\t\tthis.cwd = cwd\n\t\tthis.serviceFactory = serviceFactory\n\t\tthis.homeDir = homeDir\n\t\tthis.apiClientFactory = apiClientFactory\n\t\tthis.emitter = emitter\n\t}\n\n\tpublic Store<C extends StoreCode>(\n\t\tcode: C,\n\t\toptions?: CreateStoreOptions<C>\n\t): StoreMap[C] {\n\t\tconst storeOptions = {\n\t\t\tcwd: options?.cwd ?? this.cwd,\n\t\t\tserviceFactory: this.serviceFactory,\n\t\t\thomeDir: this.homeDir,\n\t\t\tapiClientFactory: options?.apiClientFactory ?? this.apiClientFactory,\n\t\t\temitter: this.emitter,\n\t\t\t...options,\n\t\t}\n\n\t\tif (!storeMap[code]) {\n\t\t\tthrow new Error(`Could not find store with code '${code}'.`)\n\t\t}\n\n\t\tconst store = new storeMap[code](storeOptions as any)\n\n\t\treturn store as StoreMap[C]\n\t}\n}\n\ninterface UniversalOptions {\n\tcwd?: string\n\tapiClientFactory?: ApiClientFactory\n}\n\nexport type CreateStoreOptions<Code extends StoreCode> =\n\tCode extends keyof StoreOptionsMap\n\t\t? //@ts-ignore\n\t\t StoreOptionsMap[Code] & UniversalOptions\n\t\t: UniversalOptions\n\nexport interface StoreMap {\n\tonboarding: OnboardingStore\n\tschema: SchemaStore\n\tevent: EventStore\n\tskill: SkillStore\n\torganization: OrganizationStore\n\tconversation: ConversationStore\n\tstore: StoreStore\n\tview: ViewStore\n\tlistener: ListenerStore\n\tpermission: PermissionStore\n}\n\nconst storeMap = {\n\tonboarding: OnboardingStore,\n\tschema: SchemaStore,\n\tevent: EventStore,\n\tskill: SkillStore,\n\torganization: OrganizationStore,\n\tconversation: ConversationStore,\n\tstore: StoreStore,\n\tview: ViewStore,\n\tlistener: ListenerStore,\n\tpermission: PermissionStore,\n}\n\nexport type StoreCode = keyof StoreMap\n\nexport interface StoreFactoryOptions {\n\tcwd: string\n\tserviceFactory: ServiceFactory\n\thomeDir: string\n\tapiClientFactory: ApiClientFactory\n\temitter: GlobalEmitter\n}\n\nexport interface StoreOptionsMap {\n\tskill: SkillStoreOptions\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAAyD;AAAA;AAAA,IAKpCA,YAAY;EAOhC,sBAAmBC,OAA4B,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAChD,IAAQC,GAAG,GAAyDD,OAAO,CAAnEC,GAAG;MAAEC,cAAc,GAAyCF,OAAO,CAA9DE,cAAc;MAAEC,OAAO,GAAgCH,OAAO,CAA9CG,OAAO;MAAEC,gBAAgB,GAAcJ,OAAO,CAArCI,gBAAgB;MAAEC,OAAO,GAAKL,OAAO,CAAnBK,OAAO;IAE/D,IAAI,CAACJ,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB;IACxC,IAAI,CAACC,OAAO,GAAGA,OAAO;EACvB;EAAC;IAAA;IAAA,OAED,eACCC,IAAO,EACPN,OAA+B,EACjB;MAAA;MACd,IAAMO,YAAY;QACjBN,GAAG,kBAAED,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,uDAAI,IAAI,CAACA,GAAG;QAC7BC,cAAc,EAAE,IAAI,CAACA,cAAc;QACnCC,OAAO,EAAE,IAAI,CAACA,OAAO;QACrBC,gBAAgB,2BAAEJ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEI,gBAAgB,yEAAI,IAAI,CAACA,gBAAgB;QACpEC,OAAO,EAAE,IAAI,CAACA;MAAO,GAClBL,OAAO,CACV;MAED,IAAI,CAACQ,QAAQ,CAACF,IAAI,CAAC,EAAE;QACpB,MAAM,IAAIG,KAAK,2CAAoCH,IAAI,QAAK;MAC7D;MAEA,IAAMI,KAAK,GAAG,IAAIF,QAAQ,CAACF,IAAI,CAAC,CAACC,YAAY,CAAQ;MAErD,OAAOG,KAAK;IACb;EAAC;EAAA;AAAA;AAAA;AA2BF,IAAMF,QAAQ,GAAG;EAChBG,UAAU,EAAEC,2BAAe;EAC3BC,MAAM,EAAEC,uBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,KAAK,EAAEC,sBAAU;EACjBC,YAAY,EAAEC,6BAAiB;EAC/BC,YAAY,EAAEC,6BAAiB;EAC/BZ,KAAK,EAAEa,sBAAU;EACjBC,IAAI,EAAEC,qBAAS;EACfC,QAAQ,EAAEC,yBAAa;EACvBC,UAAU,EAAEC;AACb,CAAC"}
|
|
@@ -27,7 +27,7 @@ function run() {
|
|
|
27
27
|
}
|
|
28
28
|
function _run() {
|
|
29
29
|
_run = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
30
|
-
var serviceFactory, mercuryFixture, apiClientFactory, storeFactory, personFixture, orgFixture, skillFixture, _iterator, _step, number, totalOrgs, totalSkills;
|
|
30
|
+
var serviceFactory, mercuryFixture, apiClientFactory, storeFactory, personFixture, orgFixture, skillFixture, _iterator, _step, number, totalOrgs, totalSkills, _err$stack;
|
|
31
31
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
32
|
while (1) {
|
|
33
33
|
switch (_context.prev = _context.next) {
|
|
@@ -51,7 +51,7 @@ function _run() {
|
|
|
51
51
|
_iterator.s();
|
|
52
52
|
case 11:
|
|
53
53
|
if ((_step = _iterator.n()).done) {
|
|
54
|
-
_context.next =
|
|
54
|
+
_context.next = 36;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
number = _step.value;
|
|
@@ -67,35 +67,42 @@ function _run() {
|
|
|
67
67
|
case 21:
|
|
68
68
|
totalOrgs = _context.sent;
|
|
69
69
|
term.renderLine("".concat(totalOrgs, " orgs deleted"));
|
|
70
|
+
_context.prev = 23;
|
|
70
71
|
term.renderLine('Deleting skills');
|
|
71
|
-
_context.next =
|
|
72
|
+
_context.next = 27;
|
|
72
73
|
return skillFixture.clearAllSkills();
|
|
73
|
-
case
|
|
74
|
+
case 27:
|
|
74
75
|
totalSkills = _context.sent;
|
|
75
76
|
term.renderLine("".concat(totalSkills, " deleted"));
|
|
76
|
-
|
|
77
|
+
_context.next = 34;
|
|
78
|
+
break;
|
|
79
|
+
case 31:
|
|
80
|
+
_context.prev = 31;
|
|
81
|
+
_context.t0 = _context["catch"](23);
|
|
82
|
+
console.error((_err$stack = _context.t0.stack) !== null && _err$stack !== void 0 ? _err$stack : _context.t0.message);
|
|
83
|
+
case 34:
|
|
77
84
|
_context.next = 11;
|
|
78
85
|
break;
|
|
79
|
-
case
|
|
80
|
-
_context.next =
|
|
86
|
+
case 36:
|
|
87
|
+
_context.next = 41;
|
|
81
88
|
break;
|
|
82
|
-
case 32:
|
|
83
|
-
_context.prev = 32;
|
|
84
|
-
_context.t0 = _context["catch"](9);
|
|
85
|
-
_iterator.e(_context.t0);
|
|
86
|
-
case 35:
|
|
87
|
-
_context.prev = 35;
|
|
88
|
-
_iterator.f();
|
|
89
|
-
return _context.finish(35);
|
|
90
89
|
case 38:
|
|
91
|
-
_context.
|
|
90
|
+
_context.prev = 38;
|
|
91
|
+
_context.t1 = _context["catch"](9);
|
|
92
|
+
_iterator.e(_context.t1);
|
|
93
|
+
case 41:
|
|
94
|
+
_context.prev = 41;
|
|
95
|
+
_iterator.f();
|
|
96
|
+
return _context.finish(41);
|
|
97
|
+
case 44:
|
|
98
|
+
_context.next = 46;
|
|
92
99
|
return mercuryFixture.disconnectAll();
|
|
93
|
-
case
|
|
100
|
+
case 46:
|
|
94
101
|
case "end":
|
|
95
102
|
return _context.stop();
|
|
96
103
|
}
|
|
97
104
|
}
|
|
98
|
-
}, _callee, null, [[9,
|
|
105
|
+
}, _callee, null, [[9, 38, 41, 44], [23, 31]]);
|
|
99
106
|
}));
|
|
100
107
|
return _run.apply(this, arguments);
|
|
101
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanTestData.js","names":["demoNumbers","Object","values","demoNumbersByName","cwd","process","term","TerminalInterface","run","renderHeadline","length","serviceFactory","ServiceFactory","mercuryFixture","MercuryFixture","apiClientFactory","getApiClientFactory","storeFactory","StoreFactory","homeDir","osUtil","homedir","emitter","CliGlobalEmitter","Emitter","personFixture","PersonFixture","orgFixture","OrganizationFixture","skillFixture","SkillFixture","number","renderLine","loginAsDemoPerson","clearAllOrgs","totalOrgs","clearAllSkills","totalSkills","disconnectAll","then","err","renderError","exit"],"sources":["../../src/tests/cleanTestData.ts"],"sourcesContent":["import osUtil from 'os'\nimport CliGlobalEmitter from '../GlobalEmitter'\nimport TerminalInterface from '../interfaces/TerminalInterface'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport * as demoNumbersByName from '../tests/constants'\nimport MercuryFixture from './fixtures/MercuryFixture'\nimport OrganizationFixture from './fixtures/OrganizationFixture'\nimport PersonFixture from './fixtures/PersonFixture'\nimport SkillFixture from './fixtures/SkillFixture'\n\nconst demoNumbers = Object.values(demoNumbersByName)\n\nconst cwd = process.cwd()\nconst term = new TerminalInterface(cwd, true)\n\nasync function run() {\n\tterm.renderHeadline(\n\t\t`Starting cleanup for ${demoNumbers.length} demo numbers.`\n\t)\n\n\tconst serviceFactory = new ServiceFactory()\n\tconst mercuryFixture = new MercuryFixture(cwd, serviceFactory)\n\tconst apiClientFactory = mercuryFixture.getApiClientFactory()\n\tconst storeFactory = new StoreFactory({\n\t\tcwd,\n\t\tserviceFactory,\n\t\thomeDir: osUtil.homedir(),\n\t\temitter: CliGlobalEmitter.Emitter(),\n\t\tapiClientFactory,\n\t})\n\n\tconst personFixture = new PersonFixture(apiClientFactory)\n\tconst orgFixture = new OrganizationFixture(personFixture, storeFactory)\n\tconst skillFixture = new SkillFixture(\n\t\tpersonFixture,\n\t\tstoreFactory,\n\t\tapiClientFactory\n\t)\n\n\tfor (const number of demoNumbers) {\n\t\tterm.renderLine(`Starting cleanup for ${number}`)\n\t\tterm.renderLine(`Logging in...`)\n\n\t\tawait personFixture.loginAsDemoPerson(number)\n\n\t\tterm.renderLine(`Success`)\n\n\t\tterm.renderLine(`Deleting organizations`)\n\t\tconst totalOrgs = await orgFixture.clearAllOrgs()\n\t\tterm.renderLine(`${totalOrgs} orgs deleted`)\n\n\t\tterm.renderLine('Deleting skills')\n\t\tconst totalSkills = await skillFixture.clearAllSkills()\n\t\tterm.renderLine(`${totalSkills} deleted`)\n\t}\n\n\tawait mercuryFixture.disconnectAll()\n}\n\nvoid run()\n\t.then(() => {\n\t\tterm.renderLine('Done cleaning up!')\n\t})\n\t.catch((err) => {\n\t\tterm.renderError(err)\n\t\tprocess.exit(1)\n\t})\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAkD;AAAA;AAAA;AAAA;AAAA;AAElD,IAAMA,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACC,iBAAiB,CAAC;AAEpD,IAAMC,GAAG,GAAGC,OAAO,CAACD,GAAG,EAAE;AACzB,IAAME,IAAI,GAAG,IAAIC,6BAAiB,CAACH,GAAG,EAAE,IAAI,CAAC;AAAA,SAE9BI,GAAG;EAAA;AAAA;AAAA;EAAA,qFAAlB;IAAA;IAAA;MAAA;QAAA;UAAA;YACCF,IAAI,CAACG,cAAc,gCACMT,WAAW,CAACU,MAAM,oBAC1C;YAEKC,cAAc,GAAG,IAAIC,0BAAc,EAAE;YACrCC,cAAc,GAAG,IAAIC,0BAAc,CAACV,GAAG,EAAEO,cAAc,CAAC;YACxDI,gBAAgB,GAAGF,cAAc,CAACG,mBAAmB,EAAE;YACvDC,YAAY,GAAG,IAAIC,wBAAY,CAAC;cACrCd,GAAG,EAAHA,GAAG;cACHO,cAAc,EAAdA,cAAc;cACdQ,OAAO,EAAEC,cAAM,CAACC,OAAO,EAAE;cACzBC,OAAO,EAAEC,yBAAgB,CAACC,OAAO,EAAE;cACnCT,gBAAgB,EAAhBA;YACD,CAAC,CAAC;YAEIU,aAAa,GAAG,IAAIC,yBAAa,CAACX,gBAAgB,CAAC;YACnDY,UAAU,GAAG,IAAIC,+BAAmB,CAACH,aAAa,EAAER,YAAY,CAAC;YACjEY,YAAY,GAAG,IAAIC,wBAAY,CACpCL,aAAa,EACbR,YAAY,EACZF,gBAAgB,CAChB;YAAA,uCAEoBf,WAAW;YAAA;YAAA;UAAA;YAAA;cAAA;cAAA;YAAA;YAArB+B,MAAM;YAChBzB,IAAI,CAAC0B,UAAU,gCAAyBD,MAAM,EAAG;YACjDzB,IAAI,CAAC0B,UAAU,iBAAiB;YAAA;YAAA,OAE1BP,aAAa,CAACQ,iBAAiB,CAACF,MAAM,CAAC;UAAA;YAE7CzB,IAAI,CAAC0B,UAAU,WAAW;YAE1B1B,IAAI,CAAC0B,UAAU,0BAA0B;YAAA;YAAA,OACjBL,UAAU,CAACO,YAAY,EAAE;UAAA;YAA3CC,SAAS;YACf7B,IAAI,CAAC0B,UAAU,WAAIG,SAAS,mBAAgB;
|
|
1
|
+
{"version":3,"file":"cleanTestData.js","names":["demoNumbers","Object","values","demoNumbersByName","cwd","process","term","TerminalInterface","run","renderHeadline","length","serviceFactory","ServiceFactory","mercuryFixture","MercuryFixture","apiClientFactory","getApiClientFactory","storeFactory","StoreFactory","homeDir","osUtil","homedir","emitter","CliGlobalEmitter","Emitter","personFixture","PersonFixture","orgFixture","OrganizationFixture","skillFixture","SkillFixture","number","renderLine","loginAsDemoPerson","clearAllOrgs","totalOrgs","clearAllSkills","totalSkills","console","error","stack","message","disconnectAll","then","err","renderError","exit"],"sources":["../../src/tests/cleanTestData.ts"],"sourcesContent":["import osUtil from 'os'\nimport CliGlobalEmitter from '../GlobalEmitter'\nimport TerminalInterface from '../interfaces/TerminalInterface'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport * as demoNumbersByName from '../tests/constants'\nimport MercuryFixture from './fixtures/MercuryFixture'\nimport OrganizationFixture from './fixtures/OrganizationFixture'\nimport PersonFixture from './fixtures/PersonFixture'\nimport SkillFixture from './fixtures/SkillFixture'\n\nconst demoNumbers = Object.values(demoNumbersByName)\n\nconst cwd = process.cwd()\nconst term = new TerminalInterface(cwd, true)\n\nasync function run() {\n\tterm.renderHeadline(\n\t\t`Starting cleanup for ${demoNumbers.length} demo numbers.`\n\t)\n\n\tconst serviceFactory = new ServiceFactory()\n\tconst mercuryFixture = new MercuryFixture(cwd, serviceFactory)\n\tconst apiClientFactory = mercuryFixture.getApiClientFactory()\n\tconst storeFactory = new StoreFactory({\n\t\tcwd,\n\t\tserviceFactory,\n\t\thomeDir: osUtil.homedir(),\n\t\temitter: CliGlobalEmitter.Emitter(),\n\t\tapiClientFactory,\n\t})\n\n\tconst personFixture = new PersonFixture(apiClientFactory)\n\tconst orgFixture = new OrganizationFixture(personFixture, storeFactory)\n\tconst skillFixture = new SkillFixture(\n\t\tpersonFixture,\n\t\tstoreFactory,\n\t\tapiClientFactory\n\t)\n\n\tfor (const number of demoNumbers) {\n\t\tterm.renderLine(`Starting cleanup for ${number}`)\n\t\tterm.renderLine(`Logging in...`)\n\n\t\tawait personFixture.loginAsDemoPerson(number)\n\n\t\tterm.renderLine(`Success`)\n\n\t\tterm.renderLine(`Deleting organizations`)\n\t\tconst totalOrgs = await orgFixture.clearAllOrgs()\n\t\tterm.renderLine(`${totalOrgs} orgs deleted`)\n\n\t\ttry {\n\t\t\tterm.renderLine('Deleting skills')\n\t\t\tconst totalSkills = await skillFixture.clearAllSkills()\n\t\t\tterm.renderLine(`${totalSkills} deleted`)\n\t\t} catch (err: any) {\n\t\t\tconsole.error(err.stack ?? err.message)\n\t\t}\n\t}\n\n\tawait mercuryFixture.disconnectAll()\n}\n\nvoid run()\n\t.then(() => {\n\t\tterm.renderLine('Done cleaning up!')\n\t})\n\t.catch((err) => {\n\t\tterm.renderError(err)\n\t\tprocess.exit(1)\n\t})\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAkD;AAAA;AAAA;AAAA;AAAA;AAElD,IAAMA,WAAW,GAAGC,MAAM,CAACC,MAAM,CAACC,iBAAiB,CAAC;AAEpD,IAAMC,GAAG,GAAGC,OAAO,CAACD,GAAG,EAAE;AACzB,IAAME,IAAI,GAAG,IAAIC,6BAAiB,CAACH,GAAG,EAAE,IAAI,CAAC;AAAA,SAE9BI,GAAG;EAAA;AAAA;AAAA;EAAA,qFAAlB;IAAA;IAAA;MAAA;QAAA;UAAA;YACCF,IAAI,CAACG,cAAc,gCACMT,WAAW,CAACU,MAAM,oBAC1C;YAEKC,cAAc,GAAG,IAAIC,0BAAc,EAAE;YACrCC,cAAc,GAAG,IAAIC,0BAAc,CAACV,GAAG,EAAEO,cAAc,CAAC;YACxDI,gBAAgB,GAAGF,cAAc,CAACG,mBAAmB,EAAE;YACvDC,YAAY,GAAG,IAAIC,wBAAY,CAAC;cACrCd,GAAG,EAAHA,GAAG;cACHO,cAAc,EAAdA,cAAc;cACdQ,OAAO,EAAEC,cAAM,CAACC,OAAO,EAAE;cACzBC,OAAO,EAAEC,yBAAgB,CAACC,OAAO,EAAE;cACnCT,gBAAgB,EAAhBA;YACD,CAAC,CAAC;YAEIU,aAAa,GAAG,IAAIC,yBAAa,CAACX,gBAAgB,CAAC;YACnDY,UAAU,GAAG,IAAIC,+BAAmB,CAACH,aAAa,EAAER,YAAY,CAAC;YACjEY,YAAY,GAAG,IAAIC,wBAAY,CACpCL,aAAa,EACbR,YAAY,EACZF,gBAAgB,CAChB;YAAA,uCAEoBf,WAAW;YAAA;YAAA;UAAA;YAAA;cAAA;cAAA;YAAA;YAArB+B,MAAM;YAChBzB,IAAI,CAAC0B,UAAU,gCAAyBD,MAAM,EAAG;YACjDzB,IAAI,CAAC0B,UAAU,iBAAiB;YAAA;YAAA,OAE1BP,aAAa,CAACQ,iBAAiB,CAACF,MAAM,CAAC;UAAA;YAE7CzB,IAAI,CAAC0B,UAAU,WAAW;YAE1B1B,IAAI,CAAC0B,UAAU,0BAA0B;YAAA;YAAA,OACjBL,UAAU,CAACO,YAAY,EAAE;UAAA;YAA3CC,SAAS;YACf7B,IAAI,CAAC0B,UAAU,WAAIG,SAAS,mBAAgB;YAAA;YAG3C7B,IAAI,CAAC0B,UAAU,CAAC,iBAAiB,CAAC;YAAA;YAAA,OACRH,YAAY,CAACO,cAAc,EAAE;UAAA;YAAjDC,WAAW;YACjB/B,IAAI,CAAC0B,UAAU,WAAIK,WAAW,cAAW;YAAA;YAAA;UAAA;YAAA;YAAA;YAEzCC,OAAO,CAACC,KAAK,eAAC,YAAIC,KAAK,mDAAI,YAAIC,OAAO,CAAC;UAAA;YAAA;YAAA;UAAA;YAAA;YAAA;UAAA;YAAA;YAAA;YAAA;UAAA;YAAA;YAAA;YAAA;UAAA;YAAA;YAAA,OAInC5B,cAAc,CAAC6B,aAAa,EAAE;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACpC;EAAA;AAAA;AAED,KAAKlC,GAAG,EAAE,CACRmC,IAAI,CAAC,YAAM;EACXrC,IAAI,CAAC0B,UAAU,CAAC,mBAAmB,CAAC;AACrC,CAAC,CAAC,SACI,CAAC,UAACY,GAAG,EAAK;EACftC,IAAI,CAACuC,WAAW,CAACD,GAAG,CAAC;EACrBvC,OAAO,CAACyC,IAAI,CAAC,CAAC,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -6,6 +6,7 @@ import ErrorWriter from '../features/error/writers/ErrorWriter';
|
|
|
6
6
|
import EventWriter from '../features/event/writers/EventWriter';
|
|
7
7
|
import LogWriter from '../features/log/writers/LogWriter';
|
|
8
8
|
import NodeWriter from '../features/node/writers/NodeWriter';
|
|
9
|
+
import PermissionWriter from '../features/permission/writers/PermissionWriter';
|
|
9
10
|
import PolishWriter from '../features/polish/writers/PolishWriter';
|
|
10
11
|
import SandboxWriter from '../features/sandbox/writers/SandboxWriter';
|
|
11
12
|
import SchemaWriter from '../features/schema/writers/SchemaWriter';
|
|
@@ -33,6 +34,7 @@ export interface WriterMap {
|
|
|
33
34
|
view: ViewWriter;
|
|
34
35
|
log: LogWriter;
|
|
35
36
|
polish: PolishWriter;
|
|
37
|
+
permission: PermissionWriter;
|
|
36
38
|
}
|
|
37
39
|
export declare type WriterCode = keyof WriterMap;
|
|
38
40
|
export default class WriterFactory {
|
|
@@ -14,6 +14,7 @@ var _ErrorWriter = _interopRequireDefault(require("../features/error/writers/Err
|
|
|
14
14
|
var _EventWriter = _interopRequireDefault(require("../features/event/writers/EventWriter"));
|
|
15
15
|
var _LogWriter = _interopRequireDefault(require("../features/log/writers/LogWriter"));
|
|
16
16
|
var _NodeWriter = _interopRequireDefault(require("../features/node/writers/NodeWriter"));
|
|
17
|
+
var _PermissionWriter = _interopRequireDefault(require("../features/permission/writers/PermissionWriter"));
|
|
17
18
|
var _PolishWriter = _interopRequireDefault(require("../features/polish/writers/PolishWriter"));
|
|
18
19
|
var _SandboxWriter = _interopRequireDefault(require("../features/sandbox/writers/SandboxWriter"));
|
|
19
20
|
var _SchemaWriter = _interopRequireDefault(require("../features/schema/writers/SchemaWriter"));
|
|
@@ -38,7 +39,8 @@ var classMap = {
|
|
|
38
39
|
store: _StoreWriter["default"],
|
|
39
40
|
view: _ViewWriter["default"],
|
|
40
41
|
log: _LogWriter["default"],
|
|
41
|
-
polish: _PolishWriter["default"]
|
|
42
|
+
polish: _PolishWriter["default"],
|
|
43
|
+
permission: _PermissionWriter["default"]
|
|
42
44
|
};
|
|
43
45
|
var WriterFactory = /*#__PURE__*/function () {
|
|
44
46
|
function WriterFactory(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriterFactory.js","names":["classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","polish","PolishWriter","WriterFactory","options","templates","ui","linter","settings","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport PolishWriter from '../features/polish/writers/PolishWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n\tpolish: PolishWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n\tpolish: PolishWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAkE;AAAA;AAMlE,IAAMA,QAAQ,GAAG;EAChBC,KAAK,EAAEC,uBAAW;EAClBC,KAAK,EAAEC,uBAAW;EAClBC,MAAM,EAAEC,wBAAY;EACpBC,KAAK,EAAEC,uBAAc;EACrBC,IAAI,EAAEC,sBAAa;EACnBC,IAAI,EAAEC,sBAAU;EAChBC,MAAM,EAAEC,wBAAY;EACpBC,YAAY,EAAEC,8BAAkB;EAChCC,MAAM,EAAEC,wBAAY;EACpBC,OAAO,EAAEC,yBAAa;EACtBC,KAAK,EAAEC,uBAAW;EAClBC,IAAI,EAAEC,sBAAU;EAChBC,GAAG,EAAEC,qBAAS;EACdC,MAAM,EAAEC;
|
|
1
|
+
{"version":3,"file":"WriterFactory.js","names":["classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","polish","PolishWriter","permission","PermissionWriter","WriterFactory","options","templates","ui","linter","settings","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport PermissionWriter from '../features/permission/writers/PermissionWriter'\nimport PolishWriter from '../features/polish/writers/PolishWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n\tpolish: PolishWriter,\n\tpermission: PermissionWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n\tpolish: PolishWriter\n\tpermission: PermissionWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAkE;AAAA;AAMlE,IAAMA,QAAQ,GAAG;EAChBC,KAAK,EAAEC,uBAAW;EAClBC,KAAK,EAAEC,uBAAW;EAClBC,MAAM,EAAEC,wBAAY;EACpBC,KAAK,EAAEC,uBAAc;EACrBC,IAAI,EAAEC,sBAAa;EACnBC,IAAI,EAAEC,sBAAU;EAChBC,MAAM,EAAEC,wBAAY;EACpBC,YAAY,EAAEC,8BAAkB;EAChCC,MAAM,EAAEC,wBAAY;EACpBC,OAAO,EAAEC,yBAAa;EACtBC,KAAK,EAAEC,uBAAW;EAClBC,IAAI,EAAEC,sBAAU;EAChBC,GAAG,EAAEC,qBAAS;EACdC,MAAM,EAAEC,wBAAY;EACpBC,UAAU,EAAEC;AACb,CAAC;AAAA,IAsBoBC,aAAa;EAMjC,uBAAmBC,OAKlB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IACF,IAAQC,SAAS,GAA2BD,OAAO,CAA3CC,SAAS;MAAEC,EAAE,GAAuBF,OAAO,CAAhCE,EAAE;MAAEC,MAAM,GAAeH,OAAO,CAA5BG,MAAM;MAAEC,QAAQ,GAAKJ,OAAO,CAApBI,QAAQ;IAEvC,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;EACzB;EAAC;IAAA;IAAA,OAED,gBACCC,IAAO,EACPL,OAAyE,EAC1D;MACf,IAAMM,KAAK,GAAGtC,QAAQ,CAACqC,IAAI,CAAC;MAC5B,OAAO,IAAIC,KAAK;QACfL,SAAS,EAAE,IAAI,CAACA,SAAS;QACzBM,IAAI,EAAE,IAAI,CAACL,EAAE;QACbC,MAAM,EAAE,IAAI,CAACA,MAAM;QACnBC,QAAQ,EAAE,IAAI,CAACA;MAAQ,GACnBJ,OAAO,IAAI,CAAC,CAAC,EAChB;IACH;EAAC;EAAA;AAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/parser",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.44.0",
|
|
4
4
|
"description": "An ESLint custom parser which leverages TypeScript ESTree",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"clean": "tsc -b tsconfig.build.json --clean",
|
|
38
38
|
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
|
|
39
39
|
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
|
|
40
|
-
"lint": "
|
|
40
|
+
"lint": "nx lint",
|
|
41
41
|
"test": "jest --coverage",
|
|
42
42
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
43
43
|
},
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@typescript-eslint/scope-manager": "5.
|
|
49
|
-
"@typescript-eslint/types": "5.
|
|
50
|
-
"@typescript-eslint/typescript-estree": "5.
|
|
48
|
+
"@typescript-eslint/scope-manager": "5.44.0",
|
|
49
|
+
"@typescript-eslint/types": "5.44.0",
|
|
50
|
+
"@typescript-eslint/typescript-estree": "5.44.0",
|
|
51
51
|
"debug": "^4.3.4"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "01159d204154e31acf86162268ff27d95b7fc783"
|
|
75
75
|
}
|
|
@@ -18,15 +18,6 @@ const scope_1 = require("./scope");
|
|
|
18
18
|
const ClassFieldInitializerScope_1 = require("./scope/ClassFieldInitializerScope");
|
|
19
19
|
const ClassStaticBlockScope_1 = require("./scope/ClassStaticBlockScope");
|
|
20
20
|
class ScopeManager {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
_ScopeManager_options.set(this, void 0);
|
|
23
|
-
this.scopes = [];
|
|
24
|
-
this.globalScope = null;
|
|
25
|
-
this.nodeToScope = new WeakMap();
|
|
26
|
-
this.currentScope = null;
|
|
27
|
-
__classPrivateFieldSet(this, _ScopeManager_options, options, "f");
|
|
28
|
-
this.declaredVariables = new WeakMap();
|
|
29
|
-
}
|
|
30
21
|
get variables() {
|
|
31
22
|
const variables = new Set();
|
|
32
23
|
function recurse(scope) {
|
|
@@ -36,6 +27,15 @@ class ScopeManager {
|
|
|
36
27
|
this.scopes.forEach(recurse);
|
|
37
28
|
return Array.from(variables).sort((a, b) => a.$id - b.$id);
|
|
38
29
|
}
|
|
30
|
+
constructor(options) {
|
|
31
|
+
_ScopeManager_options.set(this, void 0);
|
|
32
|
+
this.scopes = [];
|
|
33
|
+
this.globalScope = null;
|
|
34
|
+
this.nodeToScope = new WeakMap();
|
|
35
|
+
this.currentScope = null;
|
|
36
|
+
__classPrivateFieldSet(this, _ScopeManager_options, options, "f");
|
|
37
|
+
this.declaredVariables = new WeakMap();
|
|
38
|
+
}
|
|
39
39
|
isGlobalReturn() {
|
|
40
40
|
return __classPrivateFieldGet(this, _ScopeManager_options, "f").globalReturn === true;
|
|
41
41
|
}
|