@cloud-cli/env 1.1.2 → 1.1.4
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/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Model, NotNull, Property, Query, Resource, Unique } from '@cloud-cli/store';
|
|
7
|
+
import { Model, NotNull, Property, Query, Resource, SQLiteDriver, Unique } from '@cloud-cli/store';
|
|
8
8
|
import { init } from '@cloud-cli/cli';
|
|
9
9
|
const appNotSpecifiedError = new Error('App not specified');
|
|
10
10
|
const keyNotSpecifiedError = new Error('Key not specified');
|
|
@@ -27,6 +27,7 @@ EnvEntry = __decorate([
|
|
|
27
27
|
Model('env')
|
|
28
28
|
], EnvEntry);
|
|
29
29
|
async function reload() {
|
|
30
|
+
Resource.use(new SQLiteDriver());
|
|
30
31
|
await Resource.create(EnvEntry);
|
|
31
32
|
}
|
|
32
33
|
async function show(options) {
|
|
@@ -38,7 +39,7 @@ async function show(options) {
|
|
|
38
39
|
}
|
|
39
40
|
async function apps() {
|
|
40
41
|
const rows = await Resource.find(EnvEntry, new Query());
|
|
41
|
-
return rows.map(entry => entry.app);
|
|
42
|
+
return Array.from(new Set(rows.map(entry => entry.app)));
|
|
42
43
|
}
|
|
43
44
|
async function set(options) {
|
|
44
45
|
const { app, key, value } = options;
|