@fonoster/ctl 0.4.7 → 0.7.37
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/LICENSE +2 -2
- package/README.md +349 -606
- package/bin/run.js +7 -0
- package/dist/commands/workspace/login.d.ts +6 -0
- package/dist/commands/workspace/login.js +80 -0
- package/dist/config/addWorkspace.d.ts +3 -0
- package/dist/config/addWorkspace.js +10 -0
- package/dist/config/getConfig.d.ts +3 -0
- package/dist/{commands/projects/delete.js → config/getConfig.js} +10 -14
- package/dist/config/getCurrentWorkspace.d.ts +3 -0
- package/dist/config/getCurrentWorkspace.js +10 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.js +41 -0
- package/dist/config/removeWorkspace.d.ts +3 -0
- package/dist/config/removeWorkspace.js +6 -0
- package/dist/config/saveConfig.d.ts +3 -0
- package/dist/{commands/feedback.js → config/saveConfig.js} +11 -12
- package/dist/config/setCurrentWorkspace.d.ts +3 -0
- package/dist/config/setCurrentWorkspace.js +11 -0
- package/dist/config/types.d.ts +4 -0
- package/dist/config/types.js +2 -0
- package/dist/config/validations.d.ts +24 -0
- package/dist/{index.js → config/validations.js} +12 -4
- package/dist/constants.d.ts +3 -0
- package/dist/{utils.js → constants.js} +7 -10
- package/package.json +29 -64
- package/bin/run +0 -5
- package/bin/run.cmd +0 -3
- package/dist/base/delete.d.ts +0 -9
- package/dist/base/delete.js +0 -50
- package/dist/commands/agents/create.d.ts +0 -6
- package/dist/commands/agents/create.js +0 -112
- package/dist/commands/agents/delete.d.ts +0 -9
- package/dist/commands/agents/delete.js +0 -39
- package/dist/commands/agents/get.d.ts +0 -9
- package/dist/commands/agents/get.js +0 -60
- package/dist/commands/agents/list.d.ts +0 -10
- package/dist/commands/agents/list.js +0 -92
- package/dist/commands/agents/update.d.ts +0 -9
- package/dist/commands/agents/update.js +0 -90
- package/dist/commands/apps/create.d.ts +0 -6
- package/dist/commands/apps/create.js +0 -213
- package/dist/commands/apps/delete.d.ts +0 -9
- package/dist/commands/apps/delete.js +0 -54
- package/dist/commands/apps/list.d.ts +0 -10
- package/dist/commands/apps/list.js +0 -107
- package/dist/commands/apps/update.d.ts +0 -9
- package/dist/commands/apps/update.js +0 -235
- package/dist/commands/auth/login.d.ts +0 -6
- package/dist/commands/auth/login.js +0 -84
- package/dist/commands/auth/logout.d.ts +0 -6
- package/dist/commands/auth/logout.js +0 -46
- package/dist/commands/bug.d.ts +0 -6
- package/dist/commands/bug.js +0 -33
- package/dist/commands/domains/create.d.ts +0 -6
- package/dist/commands/domains/create.js +0 -130
- package/dist/commands/domains/delete.d.ts +0 -9
- package/dist/commands/domains/delete.js +0 -49
- package/dist/commands/domains/get.d.ts +0 -9
- package/dist/commands/domains/get.js +0 -63
- package/dist/commands/domains/list.d.ts +0 -10
- package/dist/commands/domains/list.js +0 -95
- package/dist/commands/domains/update.d.ts +0 -9
- package/dist/commands/domains/update.js +0 -124
- package/dist/commands/feedback.d.ts +0 -6
- package/dist/commands/numbers/create.d.ts +0 -6
- package/dist/commands/numbers/create.js +0 -117
- package/dist/commands/numbers/delete.d.ts +0 -9
- package/dist/commands/numbers/delete.js +0 -49
- package/dist/commands/numbers/get.d.ts +0 -9
- package/dist/commands/numbers/get.js +0 -59
- package/dist/commands/numbers/list.d.ts +0 -10
- package/dist/commands/numbers/list.js +0 -100
- package/dist/commands/numbers/update.d.ts +0 -9
- package/dist/commands/numbers/update.js +0 -104
- package/dist/commands/projects/create.d.ts +0 -6
- package/dist/commands/projects/create.js +0 -75
- package/dist/commands/projects/delete.d.ts +0 -9
- package/dist/commands/projects/get.d.ts +0 -9
- package/dist/commands/projects/get.js +0 -55
- package/dist/commands/projects/list.d.ts +0 -6
- package/dist/commands/projects/list.js +0 -50
- package/dist/commands/projects/renew.d.ts +0 -9
- package/dist/commands/projects/renew.js +0 -47
- package/dist/commands/projects/use.d.ts +0 -9
- package/dist/commands/projects/use.js +0 -60
- package/dist/commands/providers/create.d.ts +0 -6
- package/dist/commands/providers/create.js +0 -114
- package/dist/commands/providers/delete.d.ts +0 -9
- package/dist/commands/providers/delete.js +0 -49
- package/dist/commands/providers/get.d.ts +0 -9
- package/dist/commands/providers/get.js +0 -61
- package/dist/commands/providers/list.d.ts +0 -10
- package/dist/commands/providers/list.js +0 -98
- package/dist/commands/providers/update.d.ts +0 -9
- package/dist/commands/providers/update.js +0 -113
- package/dist/commands/secrets/create.d.ts +0 -14
- package/dist/commands/secrets/create.js +0 -69
- package/dist/commands/secrets/delete.d.ts +0 -10
- package/dist/commands/secrets/delete.js +0 -57
- package/dist/commands/secrets/list.d.ts +0 -10
- package/dist/commands/secrets/list.js +0 -71
- package/dist/config.d.ts +0 -29
- package/dist/config.js +0 -73
- package/dist/data/voices.d.ts +0 -1
- package/dist/data/voices.js +0 -337
- package/dist/decorators/project_guard.d.ts +0 -9
- package/dist/decorators/project_guard.js +0 -44
- package/dist/help.d.ts +0 -6
- package/dist/help.js +0 -47
- package/dist/index.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
package/bin/run.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/* eslint-disable import/no-unresolved */
|
|
13
|
+
/*
|
|
14
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
15
|
+
* http://github.com/fonoster/fonoster
|
|
16
|
+
*
|
|
17
|
+
* This file is part of Fonoster
|
|
18
|
+
*
|
|
19
|
+
* Licensed under the MIT License (the "License");
|
|
20
|
+
* you may not use this file except in compliance with
|
|
21
|
+
* the License. You may obtain a copy of the License at
|
|
22
|
+
*
|
|
23
|
+
* https://opensource.org/licenses/MIT
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28
|
+
* See the License for the specific language governing permissions and
|
|
29
|
+
* limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
const sdk_1 = require("@fonoster/sdk");
|
|
32
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
33
|
+
const core_1 = require("@oclif/core");
|
|
34
|
+
const config_1 = require("../../config");
|
|
35
|
+
const saveConfig_1 = require("../../config/saveConfig");
|
|
36
|
+
const constants_1 = require("../../constants");
|
|
37
|
+
class AuthLogin extends core_1.Command {
|
|
38
|
+
run() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
this.log("This utility will help you link to a Workspace.");
|
|
41
|
+
this.log("Press ^C at any time to quit.");
|
|
42
|
+
const answers = {
|
|
43
|
+
endpoint: yield (0, prompts_1.input)({
|
|
44
|
+
message: "Endpoint",
|
|
45
|
+
default: "api.fonoster.dev"
|
|
46
|
+
}),
|
|
47
|
+
accessKeyId: yield (0, prompts_1.input)({
|
|
48
|
+
message: "Access Key Id",
|
|
49
|
+
required: true
|
|
50
|
+
}),
|
|
51
|
+
accessKeySecret: yield (0, prompts_1.password)({
|
|
52
|
+
message: "Access Key Secret"
|
|
53
|
+
}),
|
|
54
|
+
confirm: yield (0, prompts_1.confirm)({
|
|
55
|
+
message: "Ready?"
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
if (!answers.confirm) {
|
|
59
|
+
this.log("Aborted!");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Get Workspace configuration (which validates the login)
|
|
63
|
+
const client = new sdk_1.Client({
|
|
64
|
+
endpoint: answers.endpoint,
|
|
65
|
+
accessKeyId: answers.accessKeyId,
|
|
66
|
+
allowInsecure: true
|
|
67
|
+
});
|
|
68
|
+
yield client.loginWithApiKey(answers.accessKeySecret);
|
|
69
|
+
this.log("Saving configuration...");
|
|
70
|
+
const config = (0, config_1.getConfig)(constants_1.CONFIG_FILE);
|
|
71
|
+
const answerWithoutConfirm = Object.assign(Object.assign({}, answers), { confirm: undefined });
|
|
72
|
+
const updatedConfig = (0, config_1.addWorkspace)(answerWithoutConfirm, config);
|
|
73
|
+
(0, saveConfig_1.saveConfig)(constants_1.CONFIG_FILE, updatedConfig);
|
|
74
|
+
this.log("Done!");
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
AuthLogin.description = "log in to a Fonoster deployment";
|
|
79
|
+
AuthLogin.examples = ["<%= config.bin %> <%= command.id %>"];
|
|
80
|
+
exports.default = AuthLogin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addWorkspace = addWorkspace;
|
|
4
|
+
function addWorkspace(config, workspaces) {
|
|
5
|
+
const workspaceIndex = workspaces.findIndex((workspace) => workspace.workspaceRef === config.workspaceRef);
|
|
6
|
+
if (workspaceIndex === -1) {
|
|
7
|
+
return workspaces.concat(Object.assign(Object.assign({}, config), { active: true }));
|
|
8
|
+
}
|
|
9
|
+
workspaces[workspaceIndex] = Object.assign(Object.assign({}, config), { active: true });
|
|
10
|
+
}
|
|
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getConfig = getConfig;
|
|
6
7
|
/*
|
|
7
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
8
9
|
* http://github.com/fonoster/fonoster
|
|
9
10
|
*
|
|
10
11
|
* This file is part of Fonoster
|
|
@@ -21,18 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
22
|
* See the License for the specific language governing permissions and
|
|
22
23
|
* limitations under the License.
|
|
23
24
|
*/
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
await super.deleteResource(new Projects(), "deleteProject");
|
|
30
|
-
if ((0, config_1.isDefaultProject)(this.ref)) {
|
|
31
|
-
(0, config_1.unsetDefaultProject)();
|
|
32
|
-
}
|
|
25
|
+
const fs_1 = __importDefault(require("fs"));
|
|
26
|
+
// import { workspaceConfigSchema } from "./validations";
|
|
27
|
+
function getConfig(path) {
|
|
28
|
+
if (!fs_1.default.existsSync(path)) {
|
|
29
|
+
return [];
|
|
33
30
|
}
|
|
31
|
+
const data = fs_1.default.readFileSync(path, "utf8");
|
|
32
|
+
// workspaceConfigSchema.parse(config);
|
|
33
|
+
return JSON.parse(data);
|
|
34
34
|
}
|
|
35
|
-
default_1.description = "delete a Fonoster Project";
|
|
36
|
-
default_1.args = [{ name: "ref" }];
|
|
37
|
-
default_1.aliases = ["projects:del", "projects:rm"];
|
|
38
|
-
exports.default = default_1;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrentWorkspace = getCurrentWorkspace;
|
|
4
|
+
function getCurrentWorkspace(workspaces) {
|
|
5
|
+
const workspace = workspaces.find((w) => w.active === true);
|
|
6
|
+
if (!workspace) {
|
|
7
|
+
throw new Error("No active workspace found");
|
|
8
|
+
}
|
|
9
|
+
return `Current Workspace: ${workspace.workspaceName} (${workspace.workspaceRef})`;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*
|
|
18
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
19
|
+
* http://github.com/fonoster/fonoster
|
|
20
|
+
*
|
|
21
|
+
* This file is part of Fonoster
|
|
22
|
+
*
|
|
23
|
+
* Licensed under the MIT License (the "License");
|
|
24
|
+
* you may not use this file except in compliance with
|
|
25
|
+
* the License. You may obtain a copy of the License at
|
|
26
|
+
*
|
|
27
|
+
* https://opensource.org/licenses/MIT
|
|
28
|
+
*
|
|
29
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
30
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
31
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
32
|
+
* See the License for the specific language governing permissions and
|
|
33
|
+
* limitations under the License.
|
|
34
|
+
*/
|
|
35
|
+
__exportStar(require("./addWorkspace"), exports);
|
|
36
|
+
__exportStar(require("./getConfig"), exports);
|
|
37
|
+
__exportStar(require("./getCurrentWorkspace"), exports);
|
|
38
|
+
__exportStar(require("./removeWorkspace"), exports);
|
|
39
|
+
__exportStar(require("./saveConfig"), exports);
|
|
40
|
+
__exportStar(require("./setCurrentWorkspace"), exports);
|
|
41
|
+
__exportStar(require("./types"), exports);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.saveConfig = saveConfig;
|
|
3
7
|
/*
|
|
4
|
-
* Copyright (C)
|
|
8
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
5
9
|
* http://github.com/fonoster/fonoster
|
|
6
10
|
*
|
|
7
11
|
* This file is part of Fonoster
|
|
@@ -18,16 +22,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
22
|
* See the License for the specific language governing permissions and
|
|
19
23
|
* limitations under the License.
|
|
20
24
|
*/
|
|
21
|
-
require("
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
await core_1.CliUx.ux.open("https://docs.google.com/forms/d/e/1FAIpQLSd1G2ahRYqkbksOvz7XhNHfSLepUh3KzRHsXh2HXfZr68nhtQ/viewform?vc=0&c=0&w=1&flr=0");
|
|
25
|
+
const fs_1 = __importDefault(require("fs"));
|
|
26
|
+
const constants_1 = require("../constants");
|
|
27
|
+
function saveConfig(path, config) {
|
|
28
|
+
if (!fs_1.default.existsSync(constants_1.BASE_DIR)) {
|
|
29
|
+
fs_1.default.mkdirSync(constants_1.BASE_DIR, { recursive: true });
|
|
27
30
|
}
|
|
31
|
+
fs_1.default.writeFileSync(path, JSON.stringify(config, null, 2));
|
|
28
32
|
}
|
|
29
|
-
default_1.description = `let us know how we're doing
|
|
30
|
-
...
|
|
31
|
-
Help us improve by providing some feedback
|
|
32
|
-
`;
|
|
33
|
-
exports.default = default_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setCurrentWorkspace = setCurrentWorkspace;
|
|
4
|
+
function setCurrentWorkspace(ref, workspaces) {
|
|
5
|
+
return workspaces.map((w) => {
|
|
6
|
+
if (w.workspaceRef === ref) {
|
|
7
|
+
return Object.assign(Object.assign({}, w), { active: true });
|
|
8
|
+
}
|
|
9
|
+
return Object.assign(Object.assign({}, w), { active: false });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const workspaceConfigSchema: z.ZodObject<{
|
|
3
|
+
endpoint: z.ZodString;
|
|
4
|
+
accessKeyId: z.ZodString;
|
|
5
|
+
accessKeySecret: z.ZodString;
|
|
6
|
+
workspaceRef: z.ZodString;
|
|
7
|
+
workspaceName: z.ZodString;
|
|
8
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
endpoint?: string;
|
|
11
|
+
accessKeyId?: string;
|
|
12
|
+
accessKeySecret?: string;
|
|
13
|
+
workspaceRef?: string;
|
|
14
|
+
workspaceName?: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
}, {
|
|
17
|
+
endpoint?: string;
|
|
18
|
+
accessKeyId?: string;
|
|
19
|
+
accessKeySecret?: string;
|
|
20
|
+
workspaceRef?: string;
|
|
21
|
+
workspaceName?: string;
|
|
22
|
+
active?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export { workspaceConfigSchema };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.workspaceConfigSchema = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
7
7
|
*
|
|
8
8
|
* This file is part of Fonoster
|
|
@@ -19,5 +19,13 @@ exports.run = void 0;
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
const workspaceConfigSchema = zod_1.z.object({
|
|
24
|
+
endpoint: zod_1.z.string().min(1, "The endpoint value is required"),
|
|
25
|
+
accessKeyId: zod_1.z.string().min(1, "The accessKeyId value is required"),
|
|
26
|
+
accessKeySecret: zod_1.z.string().min(1, "The accessKeySecret value is required"),
|
|
27
|
+
workspaceRef: zod_1.z.string().min(1, "The workspaceRef value is required"),
|
|
28
|
+
workspaceName: zod_1.z.string().min(1, "The workspaceName value is required"),
|
|
29
|
+
active: zod_1.z.boolean().optional()
|
|
30
|
+
});
|
|
31
|
+
exports.workspaceConfigSchema = workspaceConfigSchema;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WORKSPACE_ENDPOINT = exports.CONFIG_FILE = exports.BASE_DIR = void 0;
|
|
4
4
|
/*
|
|
5
|
-
* Copyright (C)
|
|
5
|
+
* Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
7
7
|
*
|
|
8
8
|
* This file is part of Fonoster
|
|
@@ -19,11 +19,8 @@ exports.toPascalCase = void 0;
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.replace(/\s+/g, "");
|
|
28
|
-
}
|
|
29
|
-
exports.toPascalCase = toPascalCase;
|
|
22
|
+
const os_1 = require("os");
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
exports.BASE_DIR = (0, path_1.join)((0, os_1.homedir)(), ".fonoster");
|
|
25
|
+
exports.CONFIG_FILE = (0, path_1.join)((0, os_1.homedir)(), ".fonoster", "config.json");
|
|
26
|
+
exports.WORKSPACE_ENDPOINT = "api.fonoster.dev";
|
package/package.json
CHANGED
|
@@ -1,49 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/ctl",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Command
|
|
3
|
+
"version": "0.7.37",
|
|
4
|
+
"description": "Fonoster Command Line Interface",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"main": "dist/index
|
|
9
|
-
"types": "dist/index
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=14.16.0"
|
|
8
|
+
"main": "dist/index",
|
|
9
|
+
"types": "dist/index",
|
|
10
|
+
"directories": {
|
|
11
|
+
"src": "src",
|
|
12
|
+
"test": "test"
|
|
15
13
|
},
|
|
16
14
|
"scripts": {
|
|
17
15
|
"prebuild": "rimraf ./dist tsconfig.tsbuildinfo",
|
|
18
|
-
"build": "tsc -b tsconfig.json"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"src": "src",
|
|
22
|
-
"test": "test",
|
|
23
|
-
"bin": "bin"
|
|
16
|
+
"build": "tsc -b tsconfig.json",
|
|
17
|
+
"clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo",
|
|
18
|
+
"generate:readme": "node ../../.scripts/gen-readme.js"
|
|
24
19
|
},
|
|
25
20
|
"files": [
|
|
26
|
-
"
|
|
27
|
-
"/npm-shrinkwrap.json",
|
|
28
|
-
"/oclif.manifest.json",
|
|
29
|
-
"/dist"
|
|
21
|
+
"dist"
|
|
30
22
|
],
|
|
31
|
-
"oclif": {
|
|
32
|
-
"commands": "./dist/commands",
|
|
33
|
-
"helpClass": "./dist/help",
|
|
34
|
-
"bin": "fonoster",
|
|
35
|
-
"plugins": [
|
|
36
|
-
"@oclif/plugin-help",
|
|
37
|
-
"@oclif/plugin-plugins",
|
|
38
|
-
"@oclif/plugin-not-found",
|
|
39
|
-
"@fonoster/plugin-warn-if-update-available"
|
|
40
|
-
],
|
|
41
|
-
"warn-if-update-available": {
|
|
42
|
-
"timeoutInDays": 1,
|
|
43
|
-
"nagTimeoutInDays": 1,
|
|
44
|
-
"message": "\n <%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>."
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
23
|
"publishConfig": {
|
|
48
24
|
"access": "public"
|
|
49
25
|
},
|
|
@@ -54,36 +30,25 @@
|
|
|
54
30
|
"bugs": {
|
|
55
31
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
56
32
|
},
|
|
33
|
+
"gitHead": "b9696f512b3abfd6a798045b16ed9f102d58b11a",
|
|
34
|
+
"bin": {
|
|
35
|
+
"fonoster": "./bin/run.js"
|
|
36
|
+
},
|
|
37
|
+
"oclif": {
|
|
38
|
+
"bin": "fonoster",
|
|
39
|
+
"commands": "./dist/commands",
|
|
40
|
+
"dirname": "fonoster",
|
|
41
|
+
"topicSeparator": ":"
|
|
42
|
+
},
|
|
57
43
|
"dependencies": {
|
|
58
|
-
"@fonoster/
|
|
59
|
-
"@fonoster/
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"
|
|
63
|
-
"@fonoster/plugin-warn-if-update-available": "github:fonoster/plugin-warn-if-update-available",
|
|
64
|
-
"@fonoster/projects": "^0.4.7",
|
|
65
|
-
"@fonoster/providers": "^0.4.7",
|
|
66
|
-
"@fonoster/secrets": "^0.4.7",
|
|
67
|
-
"@oclif/command": "^1.8.22",
|
|
68
|
-
"@oclif/config": "^1.18.8",
|
|
69
|
-
"@oclif/core": "^1.26.2",
|
|
70
|
-
"@oclif/errors": "^1.3.5",
|
|
71
|
-
"@oclif/plugin-help": "^3.3.1",
|
|
72
|
-
"@oclif/plugin-not-found": "^2.3.23",
|
|
73
|
-
"@oclif/plugin-plugins": "^2.4.4",
|
|
74
|
-
"easy-table": "^1.2.0",
|
|
75
|
-
"figlet": "^1.5.2",
|
|
76
|
-
"get-stdin-with-tty": "^6.0.0",
|
|
77
|
-
"inquirer": "^7.3.3",
|
|
78
|
-
"moment": "^2.29.4",
|
|
79
|
-
"phone": "^2.4.22",
|
|
80
|
-
"prettyjson": "^1.2.5",
|
|
81
|
-
"update-notifier": "^6.0.2"
|
|
44
|
+
"@fonoster/sdk": "^0.7.37",
|
|
45
|
+
"@fonoster/websdk": "^0.4.13",
|
|
46
|
+
"@inquirer/prompts": "^7.1.0",
|
|
47
|
+
"@oclif/core": "^4.0.34",
|
|
48
|
+
"zod": "^3.23.8"
|
|
82
49
|
},
|
|
83
50
|
"devDependencies": {
|
|
84
|
-
"@types/
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
"gitHead": "ed437f652e2a294fab087cacc41fb311a63050a7"
|
|
51
|
+
"@types/node": "^18.19.67",
|
|
52
|
+
"ts-node": "^10.9.2"
|
|
53
|
+
}
|
|
89
54
|
}
|
package/bin/run
DELETED
package/bin/run.cmd
DELETED
package/dist/base/delete.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "../config";
|
|
2
|
-
import Command from "@oclif/command";
|
|
3
|
-
export default abstract class extends Command {
|
|
4
|
-
ref: string;
|
|
5
|
-
deleteResource(API: any, funcName: string): Promise<void>;
|
|
6
|
-
init(): Promise<void>;
|
|
7
|
-
catch(err: any): Promise<any>;
|
|
8
|
-
finally(err: any): Promise<any>;
|
|
9
|
-
}
|
package/dist/base/delete.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/*
|
|
7
|
-
* Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
|
|
8
|
-
* http://github.com/fonoster/fonoster
|
|
9
|
-
*
|
|
10
|
-
* This file is part of Fonoster
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the MIT License (the "License");
|
|
13
|
-
* you may not use this file except in compliance with
|
|
14
|
-
* the License. You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* https://opensource.org/licenses/MIT
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
|
-
require("../config");
|
|
25
|
-
const command_1 = __importDefault(require("@oclif/command"));
|
|
26
|
-
const core_1 = require("@oclif/core");
|
|
27
|
-
const errors_1 = require("@oclif/errors");
|
|
28
|
-
class default_1 extends command_1.default {
|
|
29
|
-
async deleteResource(API, funcName) {
|
|
30
|
-
if (!this.ref) {
|
|
31
|
-
core_1.CliUx.ux.action.stop();
|
|
32
|
-
throw new errors_1.CLIError("You must provide a resource ref before continuing");
|
|
33
|
-
}
|
|
34
|
-
core_1.CliUx.ux.action.start(`Deleting resource ${this.ref}`);
|
|
35
|
-
const results = await API[funcName](this.ref);
|
|
36
|
-
await core_1.CliUx.ux.wait(1000);
|
|
37
|
-
core_1.CliUx.ux.action.stop(results ? "Done" : "Failed");
|
|
38
|
-
}
|
|
39
|
-
async init() {
|
|
40
|
-
const { args } = this.parse(this.constructor);
|
|
41
|
-
this.ref = args.ref;
|
|
42
|
-
}
|
|
43
|
-
async catch(err) {
|
|
44
|
-
return super.catch(err);
|
|
45
|
-
}
|
|
46
|
-
async finally(err) {
|
|
47
|
-
return super.finally(err);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.default = default_1;
|