@tolinax/ayoune-cli 2024.2.18 → 2024.3.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.
Files changed (61) hide show
  1. package/index.js +11 -11
  2. package/package.json +156 -147
  3. package/data/defaultActions.js +0 -9
  4. package/data/modelsAndRights.js +0 -3189
  5. package/data/modules.js +0 -26
  6. package/data/operations.js +0 -5
  7. package/lib/api/apiCallHandler.js +0 -42
  8. package/lib/api/apiClient.js +0 -16
  9. package/lib/api/auditCallHandler.js +0 -42
  10. package/lib/api/decodeToken.js +0 -4
  11. package/lib/api/handleAPIError.js +0 -0
  12. package/lib/api/login.js +0 -33
  13. package/lib/commands/createAuditCommand.js +0 -30
  14. package/lib/commands/createCopyCommand.js +0 -24
  15. package/lib/commands/createCreateCommand.js +0 -31
  16. package/lib/commands/createDescribeCommand.js +0 -27
  17. package/lib/commands/createEditCommand.js +0 -28
  18. package/lib/commands/createEventsCommand.js +0 -54
  19. package/lib/commands/createGetCommand.js +0 -36
  20. package/lib/commands/createListCommand.js +0 -35
  21. package/lib/commands/createLoginCommand.js +0 -17
  22. package/lib/commands/createLogoutCommand.js +0 -20
  23. package/lib/commands/createModulesCommand.js +0 -41
  24. package/lib/commands/createProgram.js +0 -67
  25. package/lib/commands/createStorageCommand.js +0 -16
  26. package/lib/commands/createStreamCommand.js +0 -45
  27. package/lib/commands/createWhoAmICommand.js +0 -26
  28. package/lib/helpers/addSpacesToCamelCase.js +0 -5
  29. package/lib/helpers/handleResponseFormatOptions.js +0 -43
  30. package/lib/helpers/initializeSettings.js +0 -14
  31. package/lib/helpers/localStorage.js +0 -4
  32. package/lib/helpers/makeRandomToken.js +0 -27
  33. package/lib/helpers/parseInt.js +0 -9
  34. package/lib/helpers/saveFile.js +0 -39
  35. package/lib/models/getCollections.js +0 -15
  36. package/lib/models/getModelsInModules.js +0 -13
  37. package/lib/models/getModuleFromCollection.js +0 -7
  38. package/lib/operations/handleAuditOperation.js +0 -22
  39. package/lib/operations/handleCollectionOperation.js +0 -68
  40. package/lib/operations/handleCopySingleOperation.js +0 -22
  41. package/lib/operations/handleCreateSingleOperation.js +0 -27
  42. package/lib/operations/handleDescribeSingleOperation.js +0 -20
  43. package/lib/operations/handleEditOperation.js +0 -51
  44. package/lib/operations/handleEditRawOperation.js +0 -35
  45. package/lib/operations/handleGetOperation.js +0 -25
  46. package/lib/operations/handleGetSingleOperation.js +0 -20
  47. package/lib/operations/handleListOperation.js +0 -24
  48. package/lib/operations/handleSingleAuditOperation.js +0 -27
  49. package/lib/prompts/promptAudits.js +0 -15
  50. package/lib/prompts/promptCollection.js +0 -13
  51. package/lib/prompts/promptCollectionInModule.js +0 -13
  52. package/lib/prompts/promptCollectionWithModule.js +0 -15
  53. package/lib/prompts/promptDefaultAction.js +0 -13
  54. package/lib/prompts/promptEntry.js +0 -12
  55. package/lib/prompts/promptFileName.js +0 -12
  56. package/lib/prompts/promptFilePath.js +0 -18
  57. package/lib/prompts/promptModule.js +0 -19
  58. package/lib/prompts/promptName.js +0 -11
  59. package/lib/prompts/promptOperation.js +0 -13
  60. package/lib/socket/customerSocketClient.js +0 -12
  61. package/lib/socket/socketClient.js +0 -11
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
- #! /usr/bin/env node
2
- import { Command } from "commander";
3
- import { createSpinner } from "nanospinner";
4
- import { initializeSettings } from "./lib/helpers/initializeSettings.js";
5
- import { createProgram } from "./lib/commands/createProgram.js";
6
- //Create new command instance
7
- const program = new Command();
8
- initializeSettings();
9
- //Setup spinner
10
- export const spinner = createSpinner("Getting data...");
11
- createProgram(program);
1
+ #! /usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { createSpinner } from "nanospinner";
4
+ import { initializeSettings } from "./lib/helpers/initializeSettings.js";
5
+ import { createProgram } from "./lib/commands/createProgram.js";
6
+ //Create new command instance
7
+ const program = new Command();
8
+ initializeSettings();
9
+ //Setup spinner
10
+ export const spinner = createSpinner("Getting data...");
11
+ createProgram(program);
package/package.json CHANGED
@@ -1,147 +1,156 @@
1
- {
2
- "name": "@tolinax/ayoune-cli",
3
- "version": "2024.2.18",
4
- "description": "",
5
- "type": "module",
6
- "main": "./index.js",
7
- "bin": {
8
- "ay": "./index.js"
9
- },
10
- "scripts": {
11
- "prebuild": "rimraf dist",
12
- "build": "npx tsc",
13
- "postbuild": "cpx package.json dist",
14
- "update-models": "npm install @tolinax/ayoune-models@latest",
15
- "update-core": "npm install @tolinax/ayoune-core@latest",
16
- "copy-package": "cpx package.json dist",
17
- "update-interfaces": "npm install @tolinax/ayoune-interfaces@latest",
18
- "release": "release-it --ci",
19
- "postrelease": "npm run release-package",
20
- "prerelease-package": "npm run copy-package",
21
- "release-package": "cd dist && npm publish"
22
- },
23
- "files": [
24
- "/"
25
- ],
26
- "autoupdater": {
27
- "updateMessage": "Would you like to update now?",
28
- "checkCommand": "ay -v",
29
- "installCommand": "npm install -g @tolinax/ayoune-cli",
30
- "promptUser": true
31
- },
32
- "keywords": [],
33
- "author": "",
34
- "license": "ISC",
35
- "release-it": {
36
- "git": {
37
- "changelog": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}",
38
- "requireCleanWorkingDir": false,
39
- "addUntrackedFiles": true,
40
- "commit": true,
41
- "push": true,
42
- "commitMessage": "ci(chore): release v${version}\n\n${changelog}",
43
- "tag": true
44
- },
45
- "npm": {
46
- "publish": false
47
- },
48
- "plugins": {
49
- "@release-it/conventional-changelog": {
50
- "preset": {
51
- "name": "conventionalcommits",
52
- "header": "# Changelog",
53
- "types": [
54
- {
55
- "type": "feat",
56
- "section": "Features"
57
- },
58
- {
59
- "type": "fix",
60
- "section": "Bug Fixes"
61
- },
62
- {
63
- "type": "chore",
64
- "section": "Chores"
65
- },
66
- {
67
- "type": "docs",
68
- "section": "Docs"
69
- },
70
- {
71
- "type": "style",
72
- "section": "Style changes"
73
- },
74
- {
75
- "type": "refactor",
76
- "section": "Refactorings"
77
- },
78
- {
79
- "type": "perf",
80
- "section": "Performance"
81
- },
82
- {
83
- "type": "test",
84
- "section": "Tests"
85
- },
86
- {
87
- "type": "ci",
88
- "section": "Continous Integration"
89
- },
90
- {
91
- "type": "build",
92
- "section": "Build Process"
93
- },
94
- {
95
- "type": "infra",
96
- "section": "Infrastructure"
97
- }
98
- ]
99
- },
100
- "infile": "CHANGELOG.md"
101
- }
102
- }
103
- },
104
- "dependencies": {
105
- "axios": "^1.6.7",
106
- "axios-retry": "^4.0.0",
107
- "chalk": "^5.3.0",
108
- "chalk-animation": "^2.0.3",
109
- "cli-autoupdater": "^1.1.0",
110
- "commander": "^12.0.0",
111
- "figlet": "^1.7.0",
112
- "gradient-string": "^2.0.2",
113
- "inquirer": "^9.2.14",
114
- "inquirer-autocomplete-prompt": "^3.0.1",
115
- "inquirer-file-tree-selection-prompt": "^2.0.5",
116
- "inquirer-fuzzy-path": "^2.3.0",
117
- "inquirer-interrupted-prompt": "^3.0.0",
118
- "inquirer-search-list": "^1.2.6",
119
- "inquirer-table-input": "^0.0.3",
120
- "js-yaml": "^4.1.0",
121
- "lodash": "^4.17.21",
122
- "mkdirp": "^3.0.1",
123
- "moment": "^2.30.1",
124
- "nanospinner": "^1.1.0",
125
- "jsonwebtoken": "^9.0.2",
126
- "node-localstorage": "^3.0.5",
127
- "os": "^0.1.2",
128
- "socket.io-client": "^4.7.4"
129
- },
130
- "devDependencies": {
131
- "@release-it/conventional-changelog": "^5.0.0",
132
- "@types/chalk": "^2.2.0",
133
- "@types/chalk-animation": "^1.6.3",
134
- "@types/commander": "^2.12.2",
135
- "@types/figlet": "^1.5.8",
136
- "@types/gradient-string": "^1.1.5",
137
- "@types/inquirer": "^9.0.7",
138
- "@types/js-yaml": "^4.0.9",
139
- "@types/lodash": "^4.14.202",
140
- "@types/node": "^20.11.16",
141
- "@types/jsonwebtoken": "^9.0.5",
142
- "@types/node-localstorage": "^1.3.3",
143
- "cpx": "^1.5.0",
144
- "prettier": "^3.2.5",
145
- "rimraf": "^5.0.5"
146
- }
147
- }
1
+ {
2
+ "name": "@tolinax/ayoune-cli",
3
+ "version": "2024.3.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "bin": {
8
+ "ay": "./index.js"
9
+ },
10
+ "scripts": {
11
+ "prebuild": "rimraf dist",
12
+ "build": "npx tsc",
13
+ "postbuild": "cpx package.json dist",
14
+ "update-models": "npm install @tolinax/ayoune-models@latest",
15
+ "update-core": "npm install @tolinax/ayoune-core@latest",
16
+ "copy-package": "cpx package.json dist",
17
+ "update-interfaces": "npm install @tolinax/ayoune-interfaces@latest",
18
+ "test": "vitest run",
19
+ "test:watch": "vitest",
20
+ "lint": "eslint src/",
21
+ "format": "prettier --write src/",
22
+ "format:check": "prettier --check src/",
23
+ "release": "release-it --ci",
24
+ "postrelease": "npm run release-package",
25
+ "prerelease-package": "npm run copy-package",
26
+ "release-package": "cd dist && npm publish"
27
+ },
28
+ "files": [
29
+ "/"
30
+ ],
31
+ "autoupdater": {
32
+ "updateMessage": "Would you like to update now?",
33
+ "checkCommand": "ay -v",
34
+ "installCommand": "npm install -g @tolinax/ayoune-cli",
35
+ "promptUser": true
36
+ },
37
+ "keywords": [],
38
+ "author": "",
39
+ "license": "ISC",
40
+ "release-it": {
41
+ "git": {
42
+ "changelog": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}",
43
+ "requireCleanWorkingDir": false,
44
+ "addUntrackedFiles": true,
45
+ "commit": true,
46
+ "push": true,
47
+ "commitMessage": "ci(chore): release v${version}\n\n${changelog}",
48
+ "tag": true
49
+ },
50
+ "npm": {
51
+ "publish": false
52
+ },
53
+ "plugins": {
54
+ "@release-it/conventional-changelog": {
55
+ "preset": {
56
+ "name": "conventionalcommits",
57
+ "header": "# Changelog",
58
+ "types": [
59
+ {
60
+ "type": "feat",
61
+ "section": "Features"
62
+ },
63
+ {
64
+ "type": "fix",
65
+ "section": "Bug Fixes"
66
+ },
67
+ {
68
+ "type": "chore",
69
+ "section": "Chores"
70
+ },
71
+ {
72
+ "type": "docs",
73
+ "section": "Docs"
74
+ },
75
+ {
76
+ "type": "style",
77
+ "section": "Style changes"
78
+ },
79
+ {
80
+ "type": "refactor",
81
+ "section": "Refactorings"
82
+ },
83
+ {
84
+ "type": "perf",
85
+ "section": "Performance"
86
+ },
87
+ {
88
+ "type": "test",
89
+ "section": "Tests"
90
+ },
91
+ {
92
+ "type": "ci",
93
+ "section": "Continous Integration"
94
+ },
95
+ {
96
+ "type": "build",
97
+ "section": "Build Process"
98
+ },
99
+ {
100
+ "type": "infra",
101
+ "section": "Infrastructure"
102
+ }
103
+ ]
104
+ },
105
+ "infile": "CHANGELOG.md"
106
+ }
107
+ }
108
+ },
109
+ "dependencies": {
110
+ "axios": "^1.6.7",
111
+ "axios-retry": "^4.0.0",
112
+ "chalk": "^5.3.0",
113
+ "chalk-animation": "^2.0.3",
114
+ "cli-autoupdater": "^1.1.0",
115
+ "commander": "^12.0.0",
116
+ "figlet": "^1.7.0",
117
+ "gradient-string": "^2.0.2",
118
+ "inquirer": "^9.2.14",
119
+ "inquirer-autocomplete-prompt": "^3.0.1",
120
+ "inquirer-file-tree-selection-prompt": "^2.0.5",
121
+ "inquirer-fuzzy-path": "^2.3.0",
122
+ "inquirer-interrupted-prompt": "^3.0.0",
123
+ "inquirer-search-list": "^1.2.6",
124
+ "inquirer-table-input": "^0.0.3",
125
+ "js-yaml": "^4.1.0",
126
+ "jsonwebtoken": "^9.0.2",
127
+ "lodash": "^4.17.21",
128
+ "mkdirp": "^3.0.1",
129
+ "moment": "^2.30.1",
130
+ "nanospinner": "^1.1.0",
131
+ "node-localstorage": "^3.0.5",
132
+ "os": "^0.1.2",
133
+ "socket.io-client": "^4.7.4"
134
+ },
135
+ "devDependencies": {
136
+ "@release-it/conventional-changelog": "^5.0.0",
137
+ "@types/chalk": "^2.2.0",
138
+ "@types/chalk-animation": "^1.6.3",
139
+ "@types/commander": "^2.12.2",
140
+ "@types/figlet": "^1.5.8",
141
+ "@types/gradient-string": "^1.1.5",
142
+ "@types/inquirer": "^9.0.7",
143
+ "@types/js-yaml": "^4.0.9",
144
+ "@types/jsonwebtoken": "^9.0.5",
145
+ "@types/lodash": "^4.14.202",
146
+ "@types/node": "^20.11.16",
147
+ "@types/node-localstorage": "^1.3.3",
148
+ "@typescript-eslint/eslint-plugin": "^8.55.0",
149
+ "@typescript-eslint/parser": "^8.55.0",
150
+ "cpx": "^1.5.0",
151
+ "eslint": "^9.39.2",
152
+ "prettier": "^3.2.5",
153
+ "rimraf": "^5.0.5",
154
+ "vitest": "^4.0.18"
155
+ }
156
+ }
@@ -1,9 +0,0 @@
1
- const defaultActions = [
2
- "describe",
3
- "edit",
4
- "edit raw",
5
- "download",
6
- "copy",
7
- "delete",
8
- ];
9
- export { defaultActions };