@tolinax/ayoune-cli 2024.2.18 → 2024.3.1
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/index.js +11 -11
- package/package.json +156 -147
- package/data/defaultActions.js +0 -9
- package/data/modelsAndRights.js +0 -3189
- package/data/modules.js +0 -26
- package/data/operations.js +0 -5
- package/lib/api/apiCallHandler.js +0 -42
- package/lib/api/apiClient.js +0 -16
- package/lib/api/auditCallHandler.js +0 -42
- package/lib/api/decodeToken.js +0 -4
- package/lib/api/handleAPIError.js +0 -0
- package/lib/api/login.js +0 -33
- package/lib/commands/createAuditCommand.js +0 -30
- package/lib/commands/createCopyCommand.js +0 -24
- package/lib/commands/createCreateCommand.js +0 -31
- package/lib/commands/createDescribeCommand.js +0 -27
- package/lib/commands/createEditCommand.js +0 -28
- package/lib/commands/createEventsCommand.js +0 -54
- package/lib/commands/createGetCommand.js +0 -36
- package/lib/commands/createListCommand.js +0 -35
- package/lib/commands/createLoginCommand.js +0 -17
- package/lib/commands/createLogoutCommand.js +0 -20
- package/lib/commands/createModulesCommand.js +0 -41
- package/lib/commands/createProgram.js +0 -67
- package/lib/commands/createStorageCommand.js +0 -16
- package/lib/commands/createStreamCommand.js +0 -45
- package/lib/commands/createWhoAmICommand.js +0 -26
- package/lib/helpers/addSpacesToCamelCase.js +0 -5
- package/lib/helpers/handleResponseFormatOptions.js +0 -43
- package/lib/helpers/initializeSettings.js +0 -14
- package/lib/helpers/localStorage.js +0 -4
- package/lib/helpers/makeRandomToken.js +0 -27
- package/lib/helpers/parseInt.js +0 -9
- package/lib/helpers/saveFile.js +0 -39
- package/lib/models/getCollections.js +0 -15
- package/lib/models/getModelsInModules.js +0 -13
- package/lib/models/getModuleFromCollection.js +0 -7
- package/lib/operations/handleAuditOperation.js +0 -22
- package/lib/operations/handleCollectionOperation.js +0 -68
- package/lib/operations/handleCopySingleOperation.js +0 -22
- package/lib/operations/handleCreateSingleOperation.js +0 -27
- package/lib/operations/handleDescribeSingleOperation.js +0 -20
- package/lib/operations/handleEditOperation.js +0 -51
- package/lib/operations/handleEditRawOperation.js +0 -35
- package/lib/operations/handleGetOperation.js +0 -25
- package/lib/operations/handleGetSingleOperation.js +0 -20
- package/lib/operations/handleListOperation.js +0 -24
- package/lib/operations/handleSingleAuditOperation.js +0 -27
- package/lib/prompts/promptAudits.js +0 -15
- package/lib/prompts/promptCollection.js +0 -13
- package/lib/prompts/promptCollectionInModule.js +0 -13
- package/lib/prompts/promptCollectionWithModule.js +0 -15
- package/lib/prompts/promptDefaultAction.js +0 -13
- package/lib/prompts/promptEntry.js +0 -12
- package/lib/prompts/promptFileName.js +0 -12
- package/lib/prompts/promptFilePath.js +0 -18
- package/lib/prompts/promptModule.js +0 -19
- package/lib/prompts/promptName.js +0 -11
- package/lib/prompts/promptOperation.js +0 -13
- package/lib/socket/customerSocketClient.js +0 -12
- package/lib/socket/socketClient.js +0 -11
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
import { getModelsInModules } from "../models/getModelsInModules.js";
|
|
3
|
-
export async function promptCollectionInModule(module) {
|
|
4
|
-
const { collection } = await inquirer.prompt([
|
|
5
|
-
{
|
|
6
|
-
type: "list",
|
|
7
|
-
name: "collection",
|
|
8
|
-
message: "Choose a collection:",
|
|
9
|
-
choices: getModelsInModules(module),
|
|
10
|
-
},
|
|
11
|
-
]);
|
|
12
|
-
return collection;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { promptModule } from "./promptModule.js";
|
|
2
|
-
import inquirer from "inquirer";
|
|
3
|
-
import { getModelsInModules } from "../models/getModelsInModules.js";
|
|
4
|
-
export async function promptCollectionWithModule() {
|
|
5
|
-
const module = await promptModule();
|
|
6
|
-
const { collection } = await inquirer.prompt([
|
|
7
|
-
{
|
|
8
|
-
type: "list",
|
|
9
|
-
name: "collection",
|
|
10
|
-
message: "Choose a collection:",
|
|
11
|
-
choices: getModelsInModules(module),
|
|
12
|
-
},
|
|
13
|
-
]);
|
|
14
|
-
return collection;
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
import { defaultActions } from "../../data/defaultActions.js";
|
|
3
|
-
export async function promptDefaultAction() {
|
|
4
|
-
const { action } = await inquirer.prompt([
|
|
5
|
-
{
|
|
6
|
-
type: "list",
|
|
7
|
-
name: "action",
|
|
8
|
-
message: "Choose a action:",
|
|
9
|
-
choices: defaultActions,
|
|
10
|
-
},
|
|
11
|
-
]);
|
|
12
|
-
return action;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
export async function promptEntry(result) {
|
|
3
|
-
const { entry } = await inquirer.prompt([
|
|
4
|
-
{
|
|
5
|
-
type: "list",
|
|
6
|
-
name: "entry",
|
|
7
|
-
message: "Choose a entry:",
|
|
8
|
-
choices: result.map((el) => ({ name: el.label, value: el._id })),
|
|
9
|
-
},
|
|
10
|
-
]);
|
|
11
|
-
return entry;
|
|
12
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
import os from "os";
|
|
3
|
-
import path from "path";
|
|
4
|
-
export async function promptFilePath(fp) {
|
|
5
|
-
const { filePath } = await inquirer.prompt([
|
|
6
|
-
{
|
|
7
|
-
type: "fuzzypath",
|
|
8
|
-
name: "filePath",
|
|
9
|
-
message: "Select a target directory:",
|
|
10
|
-
itemType: "directory",
|
|
11
|
-
default: fp,
|
|
12
|
-
rootPath: path.join(os.homedir(), "aYOUne"),
|
|
13
|
-
suggestOnly: false,
|
|
14
|
-
depthLimit: 8,
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
return filePath;
|
|
18
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Prompt functions
|
|
2
|
-
import inquirer from "inquirer";
|
|
3
|
-
import { aYOUneModules } from "../../data/modules.js";
|
|
4
|
-
export async function promptModule() {
|
|
5
|
-
const { module } = await inquirer.prompt([
|
|
6
|
-
{
|
|
7
|
-
type: "list",
|
|
8
|
-
name: "module",
|
|
9
|
-
message: "Choose a module:",
|
|
10
|
-
choices: aYOUneModules.map((el) => {
|
|
11
|
-
return {
|
|
12
|
-
name: el.label,
|
|
13
|
-
value: el.module,
|
|
14
|
-
};
|
|
15
|
-
}),
|
|
16
|
-
},
|
|
17
|
-
]);
|
|
18
|
-
return module;
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
import { operations } from "../../data/operations.js";
|
|
3
|
-
export async function promptOperation() {
|
|
4
|
-
const { operation } = await inquirer.prompt([
|
|
5
|
-
{
|
|
6
|
-
type: "list",
|
|
7
|
-
name: "operation",
|
|
8
|
-
message: "Choose a operation:",
|
|
9
|
-
choices: operations,
|
|
10
|
-
},
|
|
11
|
-
]);
|
|
12
|
-
return operation;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { io } from "socket.io-client";
|
|
2
|
-
export const customerSocket = (user) => {
|
|
3
|
-
return io(`https://notifier.ayoune.app`, {
|
|
4
|
-
transports: ["websocket"],
|
|
5
|
-
autoConnect: true,
|
|
6
|
-
reconnection: true,
|
|
7
|
-
query: {
|
|
8
|
-
customer: user._customerID,
|
|
9
|
-
username: user._id,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
};
|