@sprucelabs/spruce-cli 14.21.27 → 14.21.28
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 +8 -0
- package/build/__tests__/behavioral/SettingRemote.test.d.ts +2 -1
- package/build/__tests__/behavioral/SettingRemote.test.js +7 -7
- package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
- package/build/features/event/EventFeature.js +1 -1
- package/build/features/event/EventFeature.js.map +1 -1
- package/package.json +21 -20
- package/src/__tests__/behavioral/SettingRemote.test.ts +7 -3
- package/src/features/event/EventFeature.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.21.28](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.21.27...v14.21.28) (2021-10-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [14.21.27](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.21.26...v14.21.27) (2021-10-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { FeatureCode } from '../../features/features.types';
|
|
1
2
|
import AbstractSkillTest from '../../tests/AbstractSkillTest';
|
|
2
3
|
export default class SettingRemoteTest extends AbstractSkillTest {
|
|
3
4
|
protected static skillCacheKey: string;
|
|
4
5
|
protected static hasSetRemoteAction(): Promise<void>;
|
|
5
6
|
protected static savesRemote(remote: string, expected: string): Promise<void>;
|
|
6
|
-
protected static shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(action: string): Promise<void>;
|
|
7
|
+
protected static shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(feature: FeatureCode, action: string): Promise<void>;
|
|
7
8
|
protected static shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt(action: string): Promise<void>;
|
|
8
9
|
protected static resultsOfCommandHasRemoteMixedIntoSummary(): Promise<void>;
|
|
9
10
|
}
|
|
@@ -33,13 +33,13 @@ var _TerminalInterface = _interopRequireDefault(require("../../interfaces/Termin
|
|
|
33
33
|
|
|
34
34
|
var _AbstractSkillTest2 = _interopRequireDefault(require("../../tests/AbstractSkillTest"));
|
|
35
35
|
|
|
36
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _class2, _temp;
|
|
36
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _temp;
|
|
37
37
|
|
|
38
38
|
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); }; }
|
|
39
39
|
|
|
40
40
|
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; } }
|
|
41
41
|
|
|
42
|
-
var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("saves local as ".concat(_spruceEventUtils.REMOTE_LOCAL), "local", "".concat(_spruceEventUtils.REMOTE_LOCAL)), _dec3 = (0, _test.test)("saves dev as ".concat(_spruceEventUtils.REMOTE_DEV), "developer", "".concat(_spruceEventUtils.REMOTE_DEV)), _dec4 = (0, _test.test)("saves sandbox as ".concat(_spruceEventUtils.REMOTE_SANDBOX), "sandbox", "".concat(_spruceEventUtils.REMOTE_SANDBOX)), _dec5 = (0, _test.test)("saves prod as ".concat(_spruceEventUtils.REMOTE_PROD), "production", "".concat(_spruceEventUtils.REMOTE_PROD)), _dec6 = (0, _test.test)('create.event asks for remote on IS TTY', 'create'), _dec7 = (0, _test.test)('sync.events asks for remote on IS TTY', 'sync'), _dec8 = (0, _test.test)('create.event throws for remote on NOT TTY', 'create', false),
|
|
42
|
+
var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("saves local as ".concat(_spruceEventUtils.REMOTE_LOCAL), "local", "".concat(_spruceEventUtils.REMOTE_LOCAL)), _dec3 = (0, _test.test)("saves dev as ".concat(_spruceEventUtils.REMOTE_DEV), "developer", "".concat(_spruceEventUtils.REMOTE_DEV)), _dec4 = (0, _test.test)("saves sandbox as ".concat(_spruceEventUtils.REMOTE_SANDBOX), "sandbox", "".concat(_spruceEventUtils.REMOTE_SANDBOX)), _dec5 = (0, _test.test)("saves prod as ".concat(_spruceEventUtils.REMOTE_PROD), "production", "".concat(_spruceEventUtils.REMOTE_PROD)), _dec6 = (0, _test.test)('create.event asks for remote on IS TTY', 'event', 'create'), _dec7 = (0, _test.test)('sync.events asks for remote on IS TTY', 'event', 'sync'), _dec8 = (0, _test.test)('login asks for remote on IS TTY', 'person', 'login'), _dec9 = (0, _test.test)('skill.login asks for remote on IS TTY', 'skill', 'login'), _dec10 = (0, _test.test)('create.event throws for remote on NOT TTY', 'create', false), _dec11 = (0, _test.test)('sync.events throws for remote on NOT TTY', 'sync', false), _dec12 = (0, _test.test)(), (_class = (_temp = _class2 = /*#__PURE__*/function (_AbstractSkillTest) {
|
|
43
43
|
(0, _inherits2["default"])(SettingRemoteTest, _AbstractSkillTest);
|
|
44
44
|
|
|
45
45
|
var _super = _createSuper(SettingRemoteTest);
|
|
@@ -110,7 +110,7 @@ var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("save
|
|
|
110
110
|
}, {
|
|
111
111
|
key: "shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt",
|
|
112
112
|
value: function () {
|
|
113
|
-
var _shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(action) {
|
|
113
|
+
var _shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(feature, action) {
|
|
114
114
|
var env, last;
|
|
115
115
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
116
116
|
while (1) {
|
|
@@ -120,7 +120,7 @@ var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("save
|
|
|
120
120
|
|
|
121
121
|
env = this.Service('env');
|
|
122
122
|
env.unset('HOST');
|
|
123
|
-
void this.Action(
|
|
123
|
+
void this.Action(feature, action, {
|
|
124
124
|
shouldAutoHandleDependencies: true
|
|
125
125
|
}).execute({});
|
|
126
126
|
_context3.next = 6;
|
|
@@ -141,7 +141,7 @@ var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("save
|
|
|
141
141
|
}, _callee3, this);
|
|
142
142
|
}));
|
|
143
143
|
|
|
144
|
-
function shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(_x3) {
|
|
144
|
+
function shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(_x3, _x4) {
|
|
145
145
|
return _shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt.apply(this, arguments);
|
|
146
146
|
}
|
|
147
147
|
|
|
@@ -180,7 +180,7 @@ var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("save
|
|
|
180
180
|
}, _callee4, this);
|
|
181
181
|
}));
|
|
182
182
|
|
|
183
|
-
function shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt(
|
|
183
|
+
function shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt(_x5) {
|
|
184
184
|
return _shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt.apply(this, arguments);
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -222,6 +222,6 @@ var SettingRemoteTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)("save
|
|
|
222
222
|
}()
|
|
223
223
|
}]);
|
|
224
224
|
return SettingRemoteTest;
|
|
225
|
-
}(_AbstractSkillTest2["default"]), (0, _defineProperty2["default"])(_class2, "skillCacheKey", 'events'), _temp), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasSetRemoteAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasSetRemoteAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "savesRemote", [_dec2, _dec3, _dec4, _dec5], Object.getOwnPropertyDescriptor(_class, "savesRemote"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt", [_dec6, _dec7], Object.getOwnPropertyDescriptor(_class, "shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt", [
|
|
225
|
+
}(_AbstractSkillTest2["default"]), (0, _defineProperty2["default"])(_class2, "skillCacheKey", 'events'), _temp), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasSetRemoteAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasSetRemoteAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "savesRemote", [_dec2, _dec3, _dec4, _dec5], Object.getOwnPropertyDescriptor(_class, "savesRemote"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt", [_dec6, _dec7, _dec8, _dec9], Object.getOwnPropertyDescriptor(_class, "shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt", [_dec10, _dec11], Object.getOwnPropertyDescriptor(_class, "shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "resultsOfCommandHasRemoteMixedIntoSummary", [_dec12], Object.getOwnPropertyDescriptor(_class, "resultsOfCommandHasRemoteMixedIntoSummary"), _class)), _class));
|
|
226
226
|
exports["default"] = SettingRemoteTest;
|
|
227
227
|
//# sourceMappingURL=SettingRemote.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/behavioral/SettingRemote.test.ts"],"names":["SettingRemoteTest","REMOTE_LOCAL","REMOTE_DEV","REMOTE_SANDBOX","REMOTE_PROD","assert","isFunction","Action","execute","remote","expected","env","Service","host","get","isEqual","action","TerminalInterface","setDoesSupportColor","unset","shouldAutoHandleDependencies","waitForInput","last","ui","lastInvocation","doesInclude","options","label","reset","shouldThrowOnListenerError","results","isTruthy","errors","stack","set","summaryLines","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAMA;;
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/behavioral/SettingRemote.test.ts"],"names":["SettingRemoteTest","REMOTE_LOCAL","REMOTE_DEV","REMOTE_SANDBOX","REMOTE_PROD","assert","isFunction","Action","execute","remote","expected","env","Service","host","get","isEqual","feature","action","TerminalInterface","setDoesSupportColor","unset","shouldAutoHandleDependencies","waitForInput","last","ui","lastInvocation","doesInclude","options","label","reset","shouldThrowOnListenerError","results","isTruthy","errors","stack","set","summaryLines","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAMA;;AAEA;;AACA;;;;;;;;IAEqBA,iB,WAGnB,iB,UAKA,yCAAuBC,8BAAvB,sBAAmDA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OAA7B,CAAqC,EAArC,CAHvB;;AAAA;AAGOuB,gBAAAA,OAHP;;AAKC1B,6BAAO2B,QAAP,CAAgBD,OAAO,CAACK,YAAxB;;AACA/B,6BAAOqB,WAAP,CAAmBK,OAAO,CAACK,YAA3B,EAAyC,aAAzC;;AAND;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAhE8CC,8B,8DACb,Q","sourcesContent":["import {\n\tREMOTE_DEV,\n\tREMOTE_LOCAL,\n\tREMOTE_PROD,\n\tREMOTE_SANDBOX,\n} from '@sprucelabs/spruce-event-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { FeatureCode } from '../../features/features.types'\nimport TerminalInterface from '../../interfaces/TerminalInterface'\nimport AbstractSkillTest from '../../tests/AbstractSkillTest'\n\nexport default class SettingRemoteTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'events'\n\n\t@test()\n\tprotected static async hasSetRemoteAction() {\n\t\tassert.isFunction(this.Action('event', 'setRemote').execute)\n\t}\n\n\t@test(`saves local as ${REMOTE_LOCAL}`, `local`, `${REMOTE_LOCAL}`)\n\t@test(`saves dev as ${REMOTE_DEV}`, `developer`, `${REMOTE_DEV}`)\n\t@test(`saves sandbox as ${REMOTE_SANDBOX}`, `sandbox`, `${REMOTE_SANDBOX}`)\n\t@test(`saves prod as ${REMOTE_PROD}`, `production`, `${REMOTE_PROD}`)\n\tprotected static async savesRemote(remote: string, expected: string) {\n\t\tawait this.Action('event', 'setRemote').execute({ remote })\n\n\t\tconst env = this.Service('env')\n\t\tconst host = env.get('HOST')\n\n\t\tassert.isEqual(host, expected)\n\t}\n\n\t@test('create.event asks for remote on IS TTY', 'event', 'create')\n\t@test('sync.events asks for remote on IS TTY', 'event', 'sync')\n\t@test('login asks for remote on IS TTY', 'person', 'login')\n\t@test('skill.login asks for remote on IS TTY', 'skill', 'login')\n\tprotected static async shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(\n\t\tfeature: FeatureCode,\n\t\taction: string\n\t) {\n\t\tTerminalInterface.setDoesSupportColor(true)\n\n\t\tconst env = this.Service('env')\n\t\tenv.unset('HOST')\n\n\t\tvoid this.Action(feature, action, {\n\t\t\tshouldAutoHandleDependencies: true,\n\t\t}).execute({})\n\n\t\tawait this.waitForInput()\n\n\t\tconst last = this.ui.lastInvocation()\n\n\t\tassert.doesInclude(last.options.label, 'remote')\n\n\t\tthis.ui.reset()\n\t}\n\n\t@test('create.event throws for remote on NOT TTY', 'create', false)\n\t@test('sync.events throws for remote on NOT TTY', 'sync', false)\n\tprotected static async shouldThrowBeforeEventActionIsInvokedIfTerminalSupportsIt(\n\t\taction: string\n\t) {\n\t\tTerminalInterface.setDoesSupportColor(false)\n\t\tconst env = this.Service('env')\n\t\tenv.unset('HOST')\n\n\t\tconst results = await this.Action('event', action, {\n\t\t\tshouldThrowOnListenerError: false,\n\t\t}).execute({})\n\n\t\tassert.isTruthy(results.errors)\n\t\tassert.doesInclude(results.errors[0].stack, 'env.HOST')\n\t}\n\n\t@test()\n\tprotected static async resultsOfCommandHasRemoteMixedIntoSummary() {\n\t\tthis.Service('remote').set('developer')\n\t\tconst results = await this.Action('event', 'sync').execute({})\n\n\t\tassert.isTruthy(results.summaryLines)\n\t\tassert.doesInclude(results.summaryLines, 'Remote: dev')\n\t}\n}\n"],"file":"SettingRemote.test.js"}
|
|
@@ -163,7 +163,7 @@ var EventFeature = /*#__PURE__*/function (_AbstractFeature) {
|
|
|
163
163
|
settings.clearListenerCache();
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
if (!(isInstalled && (featureCode === 'event' || featureCode === 'eventContract') && actionCode !== 'setRemote')) {
|
|
166
|
+
if (!(isInstalled && (featureCode === 'event' || featureCode === 'eventContract' || actionCode === 'login') && actionCode !== 'setRemote')) {
|
|
167
167
|
_context3.next = 7;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/event/EventFeature.ts"],"names":["EventFeature","options","code","isRequired","name","diskUtil","resolvePath","__dirname","emitter","on","handleDidFetchSchemas","bind","handleWillExecute","handleDidExecute","createDir","cwd","payload","featureCode","actionCode","featureInstaller","isInstalled","Action","execute","settings","Service","clearListenerCache","appendRemoteToResultsOrPrompt","remote","r","getRemote","TerminalInterface","doesSupportColor","Error","ui","stopLoading","renderLine","results","summaryLines","getHost","lastSync","getLastSyncOptions","writer","getEventContractBuilder","fetchContractsAndGenerateUniqueSchemas","schemas","shouldSyncOnlyCoreEvents","uniqueSchemas","contractBuilder","EventContractBuilder","optionsSchema","syncEventActionSchema","eventGenerator","Writer","eventStore","Store","skillStore","doesHashSprucePathExist","hasCombinedContractBeenWritten","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;AAKA;;;;;;IAYqBA,Y;;;;;AA8BpB,wBAAmBC,OAAnB,EAA4C;AAAA;;AAAA;AAC3C,8BAAMA,OAAN;AAD2C,6FA7BjB,OA6BiB;AAAA,qGA5BtB,QA4BsB;AAAA,oGA3BvB,sCA2BuB;AAAA,qGA1BD,CAC1C;AAAEC,MAAAA,IAAI,EAAE,QAAR;AAAkBC,MAAAA,UAAU,EAAE;AAA9B,KAD0C,CA0BC;AAAA,4GAvBf,CAC5B;AACCC,MAAAA,IAAI,EAAE;AADP,KAD4B,EAI5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAJ4B,EAO5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAP4B,EAU5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAV4B,EAa5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAb4B,CAuBe;AAAA,mGALxBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAKwB;AAAA,yGAHU,EAGV;AAAA;AAG3C,SAAK,MAAKC,OAAL,CAAaC,EAAb,CACJ,0BADI,EAEJ,MAAKC,qBAAL,CAA2BC,IAA3B,gDAFI,CAAL;AAKA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WAAW,KAAK,SAA9C,EAAyD;AAClDM,kBAAAA,QADkD,GACvC,KAAKC,OAAL,CAAa,eAAb,CADuC;AAExDD,kBAAAA,QAAQ,CAACE,kBAAT;AACA;;AAXF,sBAcEL,WAAW,KACVH,WAAW,KAAK,OAAhB,
|
|
1
|
+
{"version":3,"sources":["../../../src/features/event/EventFeature.ts"],"names":["EventFeature","options","code","isRequired","name","diskUtil","resolvePath","__dirname","emitter","on","handleDidFetchSchemas","bind","handleWillExecute","handleDidExecute","createDir","cwd","payload","featureCode","actionCode","featureInstaller","isInstalled","Action","execute","settings","Service","clearListenerCache","appendRemoteToResultsOrPrompt","remote","r","getRemote","TerminalInterface","doesSupportColor","Error","ui","stopLoading","renderLine","results","summaryLines","getHost","lastSync","getLastSyncOptions","writer","getEventContractBuilder","fetchContractsAndGenerateUniqueSchemas","schemas","shouldSyncOnlyCoreEvents","uniqueSchemas","contractBuilder","EventContractBuilder","optionsSchema","syncEventActionSchema","eventGenerator","Writer","eventStore","Store","skillStore","doesHashSprucePathExist","hasCombinedContractBeenWritten","AbstractFeature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;AAKA;;;;;;IAYqBA,Y;;;;;AA8BpB,wBAAmBC,OAAnB,EAA4C;AAAA;;AAAA;AAC3C,8BAAMA,OAAN;AAD2C,6FA7BjB,OA6BiB;AAAA,qGA5BtB,QA4BsB;AAAA,oGA3BvB,sCA2BuB;AAAA,qGA1BD,CAC1C;AAAEC,MAAAA,IAAI,EAAE,QAAR;AAAkBC,MAAAA,UAAU,EAAE;AAA9B,KAD0C,CA0BC;AAAA,4GAvBf,CAC5B;AACCC,MAAAA,IAAI,EAAE;AADP,KAD4B,EAI5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAJ4B,EAO5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAP4B,EAU5B;AACCA,MAAAA,IAAI,EAAE;AADP,KAV4B,EAa5B;AACCA,MAAAA,IAAI,EA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ED,yBAAuB;AACtB,UAAI1C,2BAASmD,uBAAT,CAAiC,KAAKzC,GAAtC,CAAJ,EAAgD;AAC/C,YAAM0B,MAAM,GAAG,KAAKW,MAAL,CAAY,OAAZ,CAAf;AAEA,eAAOX,MAAM,CAACgB,8BAAP,CAAsC,KAAK1C,GAA3C,CAAP;AACA;;AAED,aAAO,KAAP;AACA;;;EAtKwC2C,4B","sourcesContent":["import { Schema } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport syncEventActionSchema from '#spruce/schemas/spruceCli/v2020_07_22/syncEventOptions.schema'\nimport TerminalInterface from '../../interfaces/TerminalInterface'\nimport { FileDescription } from '../../types/cli.types'\nimport AbstractFeature, {\n\tFeatureDependency,\n\tFeatureOptions,\n} from '../AbstractFeature'\nimport { FeatureActionResponse, FeatureCode } from '../features.types'\nimport EventContractBuilder from './builders/EventContractBuilder'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tevent: EventFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tevent: undefined\n\t}\n}\n\nexport default class EventFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'event'\n\tpublic nameReadable = 'Events'\n\tpublic description = 'Connect to the Mercury Event Engine.'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{ code: 'schema', isRequired: true },\n\t]\n\tpublic packageDependencies = [\n\t\t{\n\t\t\tname: '@sprucelabs/mercury-client',\n\t\t},\n\t\t{\n\t\t\tname: '@sprucelabs/mercury-types',\n\t\t},\n\t\t{\n\t\t\tname: '@sprucelabs/spruce-event-utils',\n\t\t},\n\t\t{\n\t\t\tname: '@sprucelabs/spruce-event-plugin',\n\t\t},\n\t\t{\n\t\t\tname: '@sprucelabs/mercury-core-events',\n\t\t},\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic readonly fileDescriptions: FileDescription[] = []\n\tprivate contractBuilder?: EventContractBuilder\n\n\tpublic constructor(options: FeatureOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on(\n\t\t\t'schema.did-fetch-schemas',\n\t\t\tthis.handleDidFetchSchemas.bind(this)\n\t\t)\n\n\t\tvoid this.emitter.on(\n\t\t\t'feature.will-execute',\n\t\t\tthis.handleWillExecute.bind(this)\n\t\t)\n\n\t\tvoid this.emitter.on(\n\t\t\t'feature.did-execute',\n\t\t\tthis.handleDidExecute.bind(this)\n\t\t)\n\t}\n\n\tpublic async afterPackageInstall() {\n\t\tdiskUtil.createDir(diskUtil.resolvePath(this.cwd, 'src', 'events'))\n\t\treturn {}\n\t}\n\n\tprivate async handleDidExecute(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\tconst { featureCode, actionCode } = payload\n\t\tconst isInstalled = await this.featureInstaller.isInstalled('event')\n\n\t\tif (isInstalled && featureCode === 'node' && actionCode === 'upgrade') {\n\t\t\treturn this.Action('event', 'sync').execute({})\n\t\t}\n\n\t\treturn {}\n\t}\n\n\tprivate async handleWillExecute(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}): Promise<FeatureActionResponse> {\n\t\tconst { featureCode, actionCode } = payload\n\n\t\tconst isInstalled = await this.featureInstaller.isInstalled('event')\n\n\t\tif (featureCode === 'node' || featureCode === 'upgrade') {\n\t\t\tconst settings = this.Service('eventSettings')\n\t\t\tsettings.clearListenerCache()\n\t\t}\n\n\t\tif (\n\t\t\tisInstalled &&\n\t\t\t(featureCode === 'event' ||\n\t\t\t\tfeatureCode === 'eventContract' ||\n\t\t\t\tactionCode === 'login') &&\n\t\t\tactionCode !== 'setRemote'\n\t\t) {\n\t\t\treturn this.appendRemoteToResultsOrPrompt()\n\t\t}\n\n\t\treturn {}\n\t}\n\n\tprivate async appendRemoteToResultsOrPrompt(): Promise<FeatureActionResponse> {\n\t\tconst remote = this.Service('remote')\n\t\tconst r = remote.getRemote()\n\n\t\tif (!r) {\n\t\t\tif (!TerminalInterface.doesSupportColor()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Dang! I couldn't find env.HOST. Once that is set, lets try again!`\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tthis.ui.stopLoading()\n\t\t\tthis.ui.renderLine(\n\t\t\t\t`Uh oh! It looks like you haven't configured your remote! We gotta do that.`\n\t\t\t)\n\n\t\t\tconst results = await this.Action('event', 'setRemote').execute({})\n\n\t\t\treturn results\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tsummaryLines: [`Remote: ${r}`, `Host: ${remote.getHost()}`],\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate async handleDidFetchSchemas(payload: { schemas?: Schema[] | null }) {\n\t\tconst isInstalled = await this.featureInstaller.isInstalled(this.code)\n\n\t\tconst lastSync = this.Service('eventSettings').getLastSyncOptions()\n\n\t\tif (lastSync && isInstalled) {\n\t\t\tconst writer = this.getEventContractBuilder()\n\n\t\t\tconst uniqueSchemas = await writer.fetchContractsAndGenerateUniqueSchemas(\n\t\t\t\tpayload.schemas ?? [],\n\t\t\t\tlastSync.shouldSyncOnlyCoreEvents\n\t\t\t)\n\n\t\t\treturn {\n\t\t\t\tschemas: uniqueSchemas.schemas ?? [],\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tschemas: [],\n\t\t}\n\t}\n\n\tpublic getEventContractBuilder() {\n\t\tif (!this.contractBuilder) {\n\t\t\tthis.contractBuilder = new EventContractBuilder({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\toptionsSchema: syncEventActionSchema,\n\t\t\t\tui: this.ui,\n\t\t\t\teventGenerator: this.Writer('event'),\n\t\t\t\teventStore: this.Store('event'),\n\t\t\t\tskillStore: this.Store('skill'),\n\t\t\t})\n\t\t}\n\n\t\treturn this.contractBuilder\n\t}\n\n\tpublic hasBeenSynced() {\n\t\tif (diskUtil.doesHashSprucePathExist(this.cwd)) {\n\t\t\tconst writer = this.Writer('event')\n\n\t\t\treturn writer.hasCombinedContractBeenWritten(this.cwd)\n\t\t}\n\n\t\treturn false\n\t}\n}\n"],"file":"EventFeature.js"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"version": "14.21.
|
|
20
|
+
"version": "14.21.28",
|
|
21
21
|
"bin": {
|
|
22
22
|
"spruce": "./build/index.js"
|
|
23
23
|
},
|
|
@@ -76,18 +76,18 @@
|
|
|
76
76
|
"@babel/runtime": "^7.15.4",
|
|
77
77
|
"@jest/reporters": "^27.3.0",
|
|
78
78
|
"@sprucelabs/error": "^5.0.238",
|
|
79
|
-
"@sprucelabs/heartwood-view-controllers": "^33.
|
|
79
|
+
"@sprucelabs/heartwood-view-controllers": "^33.1.10",
|
|
80
80
|
"@sprucelabs/jest-json-reporter": "^6.0.210",
|
|
81
|
-
"@sprucelabs/mercury-client": "^16.13.
|
|
82
|
-
"@sprucelabs/mercury-event-emitter": "^16.13.
|
|
83
|
-
"@sprucelabs/mercury-types": "^26.1.
|
|
84
|
-
"@sprucelabs/schema": "^25.3.
|
|
85
|
-
"@sprucelabs/spruce-core-schemas": "^22.5.
|
|
86
|
-
"@sprucelabs/spruce-event-plugin": "^5.4.
|
|
87
|
-
"@sprucelabs/spruce-event-utils": "^16.0.
|
|
88
|
-
"@sprucelabs/spruce-skill-booter": "^5.4.
|
|
89
|
-
"@sprucelabs/spruce-skill-utils": "^20.6.
|
|
90
|
-
"@sprucelabs/spruce-templates": "^14.21.
|
|
81
|
+
"@sprucelabs/mercury-client": "^16.13.63",
|
|
82
|
+
"@sprucelabs/mercury-event-emitter": "^16.13.63",
|
|
83
|
+
"@sprucelabs/mercury-types": "^26.1.450",
|
|
84
|
+
"@sprucelabs/schema": "^25.3.333",
|
|
85
|
+
"@sprucelabs/spruce-core-schemas": "^22.5.425",
|
|
86
|
+
"@sprucelabs/spruce-event-plugin": "^5.4.164",
|
|
87
|
+
"@sprucelabs/spruce-event-utils": "^16.0.454",
|
|
88
|
+
"@sprucelabs/spruce-skill-booter": "^5.4.164",
|
|
89
|
+
"@sprucelabs/spruce-skill-utils": "^20.6.275",
|
|
90
|
+
"@sprucelabs/spruce-templates": "^14.21.28",
|
|
91
91
|
"cfonts": "^2.10.0",
|
|
92
92
|
"chalk": "^4.1.2",
|
|
93
93
|
"chokidar": "^3.5.2",
|
|
@@ -116,14 +116,14 @@
|
|
|
116
116
|
"uuid": "^8.3.2"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
|
-
"@sprucelabs/data-stores": "^6.1.
|
|
119
|
+
"@sprucelabs/data-stores": "^6.1.347",
|
|
120
120
|
"@sprucelabs/jest-sheets-reporter": "^1.2.218",
|
|
121
|
-
"@sprucelabs/mercury-core-events": "^1.2.
|
|
121
|
+
"@sprucelabs/mercury-core-events": "^1.2.536",
|
|
122
122
|
"@sprucelabs/resolve-path-aliases": "^1.0.214",
|
|
123
|
-
"@sprucelabs/spruce-conversation-plugin": "^5.4.
|
|
124
|
-
"@sprucelabs/spruce-deploy-plugin": "^5.4.
|
|
125
|
-
"@sprucelabs/spruce-store-plugin": "^5.4.
|
|
126
|
-
"@sprucelabs/spruce-test-fixtures": "^5.4.
|
|
123
|
+
"@sprucelabs/spruce-conversation-plugin": "^5.4.164",
|
|
124
|
+
"@sprucelabs/spruce-deploy-plugin": "^5.4.164",
|
|
125
|
+
"@sprucelabs/spruce-store-plugin": "^5.4.164",
|
|
126
|
+
"@sprucelabs/spruce-test-fixtures": "^5.4.164",
|
|
127
127
|
"@sprucelabs/test": "^7.7.198",
|
|
128
128
|
"@sprucelabs/test-utils": "^3.0.210",
|
|
129
129
|
"@types/blessed": "^0.1.19",
|
|
@@ -570,7 +570,8 @@
|
|
|
570
570
|
"upgradeCallsUpdateDependencies": "I252",
|
|
571
571
|
"canAlwaysSkipFiles": "I264",
|
|
572
572
|
"upgradingWritesExpectedFiles": "I289",
|
|
573
|
-
"globalEmitterEmitsSEquentally": "I328"
|
|
573
|
+
"globalEmitterEmitsSEquentally": "I328",
|
|
574
|
+
"skill.login asks for remote on IS TTY": "I338"
|
|
574
575
|
}
|
|
575
576
|
}
|
|
576
577
|
],
|
|
@@ -591,5 +592,5 @@
|
|
|
591
592
|
"ora"
|
|
592
593
|
]
|
|
593
594
|
},
|
|
594
|
-
"gitHead": "
|
|
595
|
+
"gitHead": "503fcd2df70b4168a6010adfac4f390aaaa380fa"
|
|
595
596
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
REMOTE_SANDBOX,
|
|
6
6
|
} from '@sprucelabs/spruce-event-utils'
|
|
7
7
|
import { test, assert } from '@sprucelabs/test'
|
|
8
|
+
import { FeatureCode } from '../../features/features.types'
|
|
8
9
|
import TerminalInterface from '../../interfaces/TerminalInterface'
|
|
9
10
|
import AbstractSkillTest from '../../tests/AbstractSkillTest'
|
|
10
11
|
|
|
@@ -29,9 +30,12 @@ export default class SettingRemoteTest extends AbstractSkillTest {
|
|
|
29
30
|
assert.isEqual(host, expected)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
@test('create.event asks for remote on IS TTY', 'create')
|
|
33
|
-
@test('sync.events asks for remote on IS TTY', 'sync')
|
|
33
|
+
@test('create.event asks for remote on IS TTY', 'event', 'create')
|
|
34
|
+
@test('sync.events asks for remote on IS TTY', 'event', 'sync')
|
|
35
|
+
@test('login asks for remote on IS TTY', 'person', 'login')
|
|
36
|
+
@test('skill.login asks for remote on IS TTY', 'skill', 'login')
|
|
34
37
|
protected static async shouldAskForRemoteBeforeEventActionIsInvokedIfTerminalSupportsIt(
|
|
38
|
+
feature: FeatureCode,
|
|
35
39
|
action: string
|
|
36
40
|
) {
|
|
37
41
|
TerminalInterface.setDoesSupportColor(true)
|
|
@@ -39,7 +43,7 @@ export default class SettingRemoteTest extends AbstractSkillTest {
|
|
|
39
43
|
const env = this.Service('env')
|
|
40
44
|
env.unset('HOST')
|
|
41
45
|
|
|
42
|
-
void this.Action(
|
|
46
|
+
void this.Action(feature, action, {
|
|
43
47
|
shouldAutoHandleDependencies: true,
|
|
44
48
|
}).execute({})
|
|
45
49
|
|
|
@@ -103,7 +103,9 @@ export default class EventFeature extends AbstractFeature {
|
|
|
103
103
|
|
|
104
104
|
if (
|
|
105
105
|
isInstalled &&
|
|
106
|
-
(featureCode === 'event' ||
|
|
106
|
+
(featureCode === 'event' ||
|
|
107
|
+
featureCode === 'eventContract' ||
|
|
108
|
+
actionCode === 'login') &&
|
|
107
109
|
actionCode !== 'setRemote'
|
|
108
110
|
) {
|
|
109
111
|
return this.appendRemoteToResultsOrPrompt()
|