trm-client 6.1.1 → 7.0.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 (184) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +65 -65
  3. package/changelog.txt +179 -165
  4. package/dist/command/AbstractCommand.d.ts +42 -0
  5. package/dist/command/AbstractCommand.js +418 -0
  6. package/dist/command/InquirerType.d.ts +3 -0
  7. package/dist/command/InquirerType.js +7 -0
  8. package/dist/{utils/executeCommand.d.ts → command/LoggerType.d.ts} +0 -4
  9. package/dist/command/LoggerType.js +11 -0
  10. package/dist/{utils/registerCommand.d.ts → command/RegisterCommandOpts.d.ts} +4 -3
  11. package/dist/command/implementations/Alias.d.ts +8 -0
  12. package/dist/command/implementations/Alias.js +172 -0
  13. package/dist/command/implementations/Compare.d.ts +7 -0
  14. package/dist/command/implementations/Compare.js +133 -0
  15. package/dist/command/implementations/Content.d.ts +5 -0
  16. package/dist/command/implementations/Content.js +195 -0
  17. package/dist/command/implementations/Deprecate.d.ts +5 -0
  18. package/dist/command/implementations/Deprecate.js +33 -0
  19. package/dist/command/implementations/DistTag.d.ts +5 -0
  20. package/dist/command/implementations/DistTag.js +48 -0
  21. package/dist/command/implementations/FindDependencies.d.ts +5 -0
  22. package/dist/command/implementations/FindDependencies.js +42 -0
  23. package/dist/command/implementations/Info.d.ts +11 -0
  24. package/dist/command/implementations/Info.js +245 -0
  25. package/dist/command/implementations/Install.d.ts +13 -0
  26. package/dist/command/implementations/Install.js +201 -0
  27. package/dist/command/implementations/List.d.ts +5 -0
  28. package/dist/command/implementations/List.js +116 -0
  29. package/dist/command/implementations/Lock.d.ts +5 -0
  30. package/dist/command/implementations/Lock.js +40 -0
  31. package/dist/command/implementations/Login.d.ts +5 -0
  32. package/dist/command/implementations/Login.js +66 -0
  33. package/dist/command/implementations/Logout.d.ts +5 -0
  34. package/dist/command/implementations/Logout.js +37 -0
  35. package/dist/command/implementations/Ping.d.ts +5 -0
  36. package/dist/{commands/findDependencies.js → command/implementations/Ping.js} +15 -16
  37. package/dist/command/implementations/Publish.d.ts +6 -0
  38. package/dist/command/implementations/Publish.js +145 -0
  39. package/dist/command/implementations/Registry.d.ts +5 -0
  40. package/dist/command/implementations/Registry.js +88 -0
  41. package/dist/command/implementations/Settings.d.ts +5 -0
  42. package/dist/command/implementations/Settings.js +42 -0
  43. package/dist/command/implementations/Unpublish.d.ts +5 -0
  44. package/dist/command/implementations/Unpublish.js +34 -0
  45. package/dist/command/implementations/View.d.ts +9 -0
  46. package/dist/command/implementations/View.js +237 -0
  47. package/dist/command/implementations/WhoAmI.d.ts +5 -0
  48. package/dist/command/implementations/WhoAmI.js +36 -0
  49. package/dist/command/implementations/index.d.ts +19 -0
  50. package/dist/command/implementations/index.js +35 -0
  51. package/dist/command/index.d.ts +4 -0
  52. package/dist/{commands/commons → command}/index.js +4 -2
  53. package/dist/{commands/arguments/ConnectArguments.d.ts → command/prompts/connect.d.ts} +2 -0
  54. package/dist/{commands → command}/prompts/connect.js +3 -3
  55. package/dist/command/prompts/createAlias.d.ts +1 -0
  56. package/dist/{commands → command/prompts}/createAlias.js +8 -8
  57. package/dist/command/prompts/deleteAlias.d.ts +1 -0
  58. package/dist/{commands → command/prompts}/deleteAlias.js +3 -4
  59. package/dist/command/prompts/index.d.ts +4 -0
  60. package/dist/{commands → command}/prompts/index.js +2 -0
  61. package/dist/index.js +34 -278
  62. package/dist/registryAlias/RegistryAlias.js +1 -1
  63. package/dist/systemAlias/SystemAlias.js +4 -4
  64. package/dist/utils/{Context.d.ts → GlobalContext.d.ts} +3 -3
  65. package/dist/utils/{Context.js → GlobalContext.js} +6 -6
  66. package/dist/utils/checkCliUpdate.d.ts +3 -2
  67. package/dist/utils/checkCliUpdate.js +3 -3
  68. package/dist/utils/getSapLogonConnections.js +3 -3
  69. package/dist/utils/index.d.ts +1 -4
  70. package/dist/utils/index.js +1 -4
  71. package/package.json +67 -65
  72. package/dist/commands/addRegistry.d.ts +0 -2
  73. package/dist/commands/addRegistry.js +0 -66
  74. package/dist/commands/alias.d.ts +0 -2
  75. package/dist/commands/alias.js +0 -156
  76. package/dist/commands/arguments/AddRegistryArguments.d.ts +0 -5
  77. package/dist/commands/arguments/AliasArguments.d.ts +0 -3
  78. package/dist/commands/arguments/AliasArguments.js +0 -2
  79. package/dist/commands/arguments/CheckArguments.d.ts +0 -4
  80. package/dist/commands/arguments/CheckArguments.js +0 -2
  81. package/dist/commands/arguments/CompareArguments.d.ts +0 -4
  82. package/dist/commands/arguments/CompareArguments.js +0 -2
  83. package/dist/commands/arguments/ConnectArguments.js +0 -2
  84. package/dist/commands/arguments/ContentArguments.d.ts +0 -6
  85. package/dist/commands/arguments/ContentArguments.js +0 -2
  86. package/dist/commands/arguments/CreateAliasArguments.d.ts +0 -3
  87. package/dist/commands/arguments/CreateAliasArguments.js +0 -2
  88. package/dist/commands/arguments/DeleteAliasArguments.d.ts +0 -3
  89. package/dist/commands/arguments/DeleteAliasArguments.js +0 -2
  90. package/dist/commands/arguments/FindDependenciesArguments.d.ts +0 -5
  91. package/dist/commands/arguments/FindDependenciesArguments.js +0 -2
  92. package/dist/commands/arguments/ImportArguments.d.ts +0 -19
  93. package/dist/commands/arguments/ImportArguments.js +0 -2
  94. package/dist/commands/arguments/InfoArguments.d.ts +0 -1
  95. package/dist/commands/arguments/InfoArguments.js +0 -2
  96. package/dist/commands/arguments/InstallArguments.d.ts +0 -20
  97. package/dist/commands/arguments/InstallArguments.js +0 -2
  98. package/dist/commands/arguments/ListArguments.d.ts +0 -3
  99. package/dist/commands/arguments/ListArguments.js +0 -2
  100. package/dist/commands/arguments/LockArguments.d.ts +0 -4
  101. package/dist/commands/arguments/LockArguments.js +0 -2
  102. package/dist/commands/arguments/LoginArguments.d.ts +0 -4
  103. package/dist/commands/arguments/LoginArguments.js +0 -2
  104. package/dist/commands/arguments/LogoutArguments.d.ts +0 -1
  105. package/dist/commands/arguments/LogoutArguments.js +0 -2
  106. package/dist/commands/arguments/PackArguments.d.ts +0 -22
  107. package/dist/commands/arguments/PackArguments.js +0 -2
  108. package/dist/commands/arguments/PingArguments.d.ts +0 -1
  109. package/dist/commands/arguments/PingArguments.js +0 -2
  110. package/dist/commands/arguments/PublishArguments.d.ts +0 -24
  111. package/dist/commands/arguments/PublishArguments.js +0 -2
  112. package/dist/commands/arguments/RemoveRegistryArguments.d.ts +0 -4
  113. package/dist/commands/arguments/RemoveRegistryArguments.js +0 -2
  114. package/dist/commands/arguments/SettingsArgument.d.ts +0 -3
  115. package/dist/commands/arguments/SettingsArgument.js +0 -2
  116. package/dist/commands/arguments/UnpublishArguments.d.ts +0 -4
  117. package/dist/commands/arguments/UnpublishArguments.js +0 -2
  118. package/dist/commands/arguments/UpdateArguments.d.ts +0 -2
  119. package/dist/commands/arguments/UpdateArguments.js +0 -2
  120. package/dist/commands/arguments/ViewArguments.d.ts +0 -3
  121. package/dist/commands/arguments/ViewArguments.js +0 -2
  122. package/dist/commands/arguments/WhoAmIArguments.d.ts +0 -1
  123. package/dist/commands/arguments/WhoAmIArguments.js +0 -2
  124. package/dist/commands/arguments/index.d.ts +0 -24
  125. package/dist/commands/arguments/index.js +0 -40
  126. package/dist/commands/check.d.ts +0 -2
  127. package/dist/commands/check.js +0 -87
  128. package/dist/commands/commons/CommandContext.d.ts +0 -9
  129. package/dist/commands/commons/CommandContext.js +0 -41
  130. package/dist/commands/commons/index.d.ts +0 -2
  131. package/dist/commands/commons/viewRegistryPackage.d.ts +0 -2
  132. package/dist/commands/commons/viewRegistryPackage.js +0 -48
  133. package/dist/commands/compare.d.ts +0 -2
  134. package/dist/commands/compare.js +0 -167
  135. package/dist/commands/content.d.ts +0 -2
  136. package/dist/commands/content.js +0 -182
  137. package/dist/commands/createAlias.d.ts +0 -2
  138. package/dist/commands/deleteAlias.d.ts +0 -2
  139. package/dist/commands/findDependencies.d.ts +0 -2
  140. package/dist/commands/import.d.ts +0 -2
  141. package/dist/commands/import.js +0 -84
  142. package/dist/commands/index.d.ts +0 -27
  143. package/dist/commands/index.js +0 -43
  144. package/dist/commands/info.d.ts +0 -2
  145. package/dist/commands/info.js +0 -233
  146. package/dist/commands/install.d.ts +0 -2
  147. package/dist/commands/install.js +0 -85
  148. package/dist/commands/list.d.ts +0 -2
  149. package/dist/commands/list.js +0 -70
  150. package/dist/commands/lock.d.ts +0 -2
  151. package/dist/commands/lock.js +0 -64
  152. package/dist/commands/login.d.ts +0 -2
  153. package/dist/commands/login.js +0 -59
  154. package/dist/commands/logout.d.ts +0 -2
  155. package/dist/commands/logout.js +0 -27
  156. package/dist/commands/pack.d.ts +0 -2
  157. package/dist/commands/pack.js +0 -95
  158. package/dist/commands/ping.d.ts +0 -2
  159. package/dist/commands/ping.js +0 -21
  160. package/dist/commands/prompts/connect.d.ts +0 -3
  161. package/dist/commands/prompts/index.d.ts +0 -2
  162. package/dist/commands/publish.d.ts +0 -2
  163. package/dist/commands/publish.js +0 -128
  164. package/dist/commands/removeRegistry.d.ts +0 -2
  165. package/dist/commands/removeRegistry.js +0 -36
  166. package/dist/commands/selfUpdate.d.ts +0 -1
  167. package/dist/commands/selfUpdate.js +0 -77
  168. package/dist/commands/settings.d.ts +0 -2
  169. package/dist/commands/settings.js +0 -32
  170. package/dist/commands/unpublish.d.ts +0 -2
  171. package/dist/commands/unpublish.js +0 -61
  172. package/dist/commands/update.d.ts +0 -2
  173. package/dist/commands/update.js +0 -20
  174. package/dist/commands/view.d.ts +0 -2
  175. package/dist/commands/view.js +0 -219
  176. package/dist/commands/whoami.d.ts +0 -2
  177. package/dist/commands/whoami.js +0 -34
  178. package/dist/utils/checkTrmDependencies.d.ts +0 -1
  179. package/dist/utils/checkTrmDependencies.js +0 -43
  180. package/dist/utils/executeCommand.js +0 -213
  181. package/dist/utils/registerCommand.js +0 -93
  182. /package/dist/{commands/arguments/AddRegistryArguments.js → command/RegisterCommandOpts.js} +0 -0
  183. /package/dist/{commands → command}/prompts/pickRegistry.d.ts +0 -0
  184. /package/dist/{commands → command}/prompts/pickRegistry.js +0 -0
package/dist/index.js CHANGED
@@ -7,289 +7,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const dotenv_1 = __importDefault(require("dotenv"));
8
8
  const commander_1 = require("commander");
9
9
  const utils_1 = require("./utils");
10
- const trm_registry_types_1 = require("trm-registry-types");
10
+ const implementations_1 = require("./command/implementations");
11
11
  dotenv_1.default.config({
12
12
  quiet: true
13
13
  });
14
14
  const program = new commander_1.Command();
15
15
  program
16
16
  .name(`trm`)
17
- .description(`TRM - Transport Request Manager CLI
18
-
19
- Full documentation available at https://docs.trmregistry.com/
20
-
21
- © 2025 RegestaItalia https://www.regestaitalia.eu/`)
17
+ .description(`TRM - Transport Request Manager CLI
18
+
19
+ Full documentation available at https://docs.trmregistry.com/
20
+ Public registry at https://trmregistry.com/
21
+
22
+ © 2025 RegestaItalia https://regestaitalia.eu/`)
22
23
  .version((0, utils_1.getClientVersion)());
23
- const createAlias = program.command(`createAlias`)
24
- .argument(`<alias>`, `Name of the alias to generate.`)
25
- .description(`Create a new system alias.`);
26
- (0, utils_1.registerCommand)(createAlias);
27
- const deleteAlias = program.command(`deleteAlias`)
28
- .argument(`<alias>`, `Name of the alias to delete.`)
29
- .description(`Delete a system alias.`);
30
- (0, utils_1.registerCommand)(deleteAlias);
31
- const manageAliases = program.command(`alias`)
32
- .argument(`[alias]`, `Optional: Single alias to maintain.`)
33
- .description(`List and manage aliases.`);
34
- (0, utils_1.registerCommand)(manageAliases);
35
- const addRegistry = program.command(`addRegistry`)
36
- .argument(`<registryName>`, `Name of the registry to generate.`)
37
- .description(`Add a new registry.`)
38
- .option(`-e, --endpoint <endpoint>`, `Endpoint.`)
39
- .option(`-a, --authentication <authentication>`, `Authentication as a valid JSON string.`);
40
- (0, utils_1.registerCommand)(addRegistry);
41
- const removeRegistry = program.command(`removeRegistry`)
42
- .argument(`<registryName>`, `Name of the registry to delete.`)
43
- .description(`Remove a registry.`)
44
- .option(`-f, --force`, `Force.`, false);
45
- (0, utils_1.registerCommand)(removeRegistry);
46
- const login = program.command(`login`)
47
- .description(`Log into a registry.`)
48
- .addHelpText(`before`, `This command has no effect when trying to login into a registry that doesn't require authentication.`)
49
- .option(`-f, --force`, `Force login.`, false)
50
- .option(`-a, --authentication <authentication>`, `Authentication as a valid JSON string.`);
51
- (0, utils_1.registerCommand)(login, {
52
- requiresRegistry: true,
53
- registryAuthBlacklist: [trm_registry_types_1.AuthenticationType.NO_AUTH]
54
- });
55
- const whoami = program.command(`whoami`)
56
- .description(`Registry logged user data.`)
57
- .addHelpText(`before`, `This command has no effect when trying to get user info from a registry that doesn't require authentication.`);
58
- (0, utils_1.registerCommand)(whoami, {
59
- requiresRegistry: true,
60
- registryAuthBlacklist: [trm_registry_types_1.AuthenticationType.NO_AUTH]
61
- });
62
- const logout = program.command(`logout`)
63
- .description(`Log out of a registry.`)
64
- .addHelpText(`before`, `This command has no effect when trying to logout from a registry that doesn't require authentication.`);
65
- (0, utils_1.registerCommand)(logout, {
66
- requiresRegistry: true,
67
- registryAuthBlacklist: [trm_registry_types_1.AuthenticationType.NO_AUTH]
68
- });
69
- const ping = program.command(`ping`)
70
- .description(`Ping trm-server.`);
71
- (0, utils_1.registerCommand)(ping, {
72
- requiresConnection: true,
73
- requiresTrmDependencies: true
74
- });
75
- const publish = program.command(`publish`)
76
- .argument(`<package>`, `Name of the package to publish.`)
77
- .argument(`[version]`, `Optional: Version of the package to publish. If not specified, check help text for details.`)
78
- .description(`Publish package to registry.`)
79
- .addHelpText(`before`, `When no version argument is defined, it will automatically set to:
80
- - When it's the first publish: 1.0.0
81
- - When it's already published: the latest available release with patch increased by 1
82
- When it's the first publish, full manifest definition is asked.
83
- When a release is already published, the latest available manifest is used but can be overwritten.
84
- Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
85
- Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
86
- If a default manifest with dependencies is provided in conjunction with the automatic dependency generation, results will be merged.`)
87
- .option(`-p, --private`, `Publish package with private visibility.`)
88
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
89
- .option(`-km, --keepLatestReleaseManifestValues`, `Keep the latest release (if exists) manifest values as defaults.`, true)
90
- .option(`-nl, --noLanguageTransport`, `Skip language (translations) transport publish.`, false)
91
- .option(`-nd, --noDependenciesDetection`, `Skip automatic dependencies detection.`, false)
92
- .option(`-sc, --skipCustomizingTransports`, `Skip customizing transports input.`, false)
93
- .option(`-to, --releaseTimeout <timeout>`, `Publish transports release timeout (in seconds).`, '180')
94
- .option(`-d, --devclass <devclass>`, `ABAP package to publish.`)
95
- .option(`-cust, --customizingTransports <customizingTransports>`, `Customizing transports (separated by comma).`)
96
- .option(`-rm, --readme <readme>`, `Path to file or value of readme.`)
97
- .option(`-tt, --transportTarget <transportTarget>`, `Publish transports target.`)
98
- .option(`-bc, --backwardsCompatible`, `Indicates backwards compatibility with older releases.`, true)
99
- .option(`-sd, --description`, `Short description of the package.`)
100
- .option(`-gl, --git <link>`, `Git link.`)
101
- .option(`-wl, --website <link>`, `Website link.`)
102
- .option(`-pl, --license <license>`, `Package license.`)
103
- .option(`-pa, --authors <authors>`, `Package authors (separated by comma).`)
104
- .option(`-pk, --keywords <keywords>`, `Package keywords (separated by comma).`)
105
- .option(`-pd, --dependencies <JSON>`, `Package dependencies (in JSON format).`)
106
- .option(`-ps, --sapEntries <JSON>`, `Package SAP entries (in JSON format).`);
107
- (0, utils_1.registerCommand)(publish, {
108
- requiresConnection: true,
109
- requiresRegistry: true,
110
- requiresTrmDependencies: true
111
- });
112
- const pack = program.command(`pack`)
113
- .argument(`<package>`, `Name of the package to generate.`)
114
- .argument(`[version]`, `Optional: Version of the package to generate. If not specified, check help text for details.`)
115
- .description(`Save package locally.`)
116
- .addHelpText(`before`, `When no version is defined, it will automatically set to 1.0.0.
117
- Translation transport is only generated for packages that contain one or more objects with translations (unless skipped by flag).
118
- Customizing transport is only generated if a valid list of customizing transports is provided (unless skipped by flag).
119
- If a default manifest with dependencies is provided in conjunction with the automatic dependency generation, results will be merged.`)
120
- .option(`-o, --output <outputPath>`, `Output path.`)
121
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
122
- .option(`-nl, --noLanguageTransport`, `Skip language (translations) transport publish.`, false)
123
- .option(`-nd, --noDependenciesDetection`, `Skip automatic dependencies detection.`, false)
124
- .option(`-sc, --skipCustomizingTransports`, `Skip customizing transports input.`, false)
125
- .option(`-to, --releaseTimeout <timeout>`, `Publish transports release timeout (in seconds).`, '180')
126
- .option(`-d, --devclass <devclass>`, `ABAP package to publish.`)
127
- .option(`-cust, --customizingTransports <customizingTransports>`, `Customizing transports (separated by comma).`)
128
- .option(`-tt, --transportTarget <transportTarget>`, `Publish transports target.`)
129
- .option(`-bc, --backwardsCompatible`, `Indicates backwards compatibility with older releases.`, true)
130
- .option(`-sd, --description`, `Short description of the package.`)
131
- .option(`-gl, --git <link>`, `Git link.`)
132
- .option(`-wl, --website <link>`, `Website link.`)
133
- .option(`-pl, --license <license>`, `Package license.`)
134
- .option(`-pa, --authors <authors>`, `Package authors (separated by comma).`)
135
- .option(`-pk, --keywords <keywords>`, `Package keywords (separated by comma).`)
136
- .option(`-pd, --dependencies <JSON>`, `Package dependencies (in JSON format).`)
137
- .option(`-ps, --sapEntries <JSON>`, `Package SAP entries (in JSON format).`);
138
- (0, utils_1.registerCommand)(pack, {
139
- requiresConnection: true,
140
- requiresTrmDependencies: true
141
- });
142
- const unpublish = program.command(`unpublish`)
143
- .argument(`<package>`, `Name of the package to unpublish from registry.`)
144
- .argument(`[version]`, `Optional: Version of the package to generate.`, `latest`)
145
- .description(`Unpublish a package release from registry.`);
146
- (0, utils_1.registerCommand)(unpublish, {
147
- requiresRegistry: true
148
- });
149
- const install = program.command(`install`)
150
- .argument(`<package>`, `Name of the package to install.`)
151
- .argument(`[version]`, `Optional: Version of the package to install.`, `latest`)
152
- .description(`Install package from registry into system.`)
153
- .addHelpText(`before`, `When no version is specified, the latest will be installed.`)
154
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
155
- .option(`-ow, --overwrite`, `Overwrite installation (allow re-install).`, false)
156
- .option(`-sf, --safe`, `Safe install (needs package integrity).`, false)
157
- .option(`-nd, --noDependencies`, `Skip check/install of package dependencies.`, false)
158
- .option(`-no, --noObjectTypes`, `Skip check of package object types.`, false)
159
- .option(`-ns, --noSapEntries`, `Skip check of package SAP entries/objects.`, false)
160
- .option(`-nl, --noLanguageTransport`, `Skip install of language (translations) transport (if exists).`, false)
161
- .option(`-nc, --noCustomizingTransport`, `Skip install of customizing transport (if exists).`, false)
162
- .option(`-to, --importTimeout <timeout>`, `Install transports import timeout (in seconds).`, '180')
163
- .option(`-kd, --keepOriginalPackages`, `Keep original ABAP packages names.`)
164
- .option(`-it, --createInstallTransport`, `Create/update install transport (used for landscape transports).`, true)
165
- .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
166
- .option(`-sha, --integrity <sha>`, `Package integrity.`)
167
- .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
168
- .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
169
- .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
170
- (0, utils_1.registerCommand)(install, {
171
- requiresConnection: true,
172
- requiresRegistry: true,
173
- requiresTrmDependencies: true
174
- });
175
- const update = program.command(`update`)
176
- .argument(`[package]`, `Name of the package to update.`)
177
- .argument(`[version]`, `Optional: Target package version to update.`)
178
- .description(`Update trm-client / Update package from registry into system.`)
179
- .addHelpText(`before`, `When no package name is specified, trm-client will self-update. All options are invalid, in this case.
180
- When no version is specified, the latest will be installed.`)
181
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
182
- .option(`-sf, --safe`, `Safe install (needs package integrity).`, false)
183
- .option(`-nd, --noDependencies`, `Skip check/install of package dependencies.`, false)
184
- .option(`-no, --noObjectTypes`, `Skip check of package object types.`, false)
185
- .option(`-ns, --noSapEntries`, `Skip check of package SAP entries/objects.`, false)
186
- .option(`-nl, --noLanguageTransport`, `Skip install of language (translations) transport (if exists).`, false)
187
- .option(`-nc, --noCustomizingTransport`, `Skip install of customizing transport (if exists).`, false)
188
- .option(`-to, --importTimeout <timeout>`, `Install transports import timeout (in seconds).`, '180')
189
- .option(`-kd, --keepOriginalPackages`, `Keep original ABAP packages names.`)
190
- .option(`-it, --createInstallTransport`, `Create/update install transport (used for landscape transports).`, true)
191
- .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
192
- .option(`-sha, --integrity <sha>`, `Package integrity.`)
193
- .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
194
- .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
195
- .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
196
- (0, utils_1.registerCommand)(update, {
197
- requiresConnection: true,
198
- requiresRegistry: true,
199
- requiresTrmDependencies: true
200
- });
201
- const _import = program.command(`import <file>`)
202
- .argument(`<file>`, `Path or filename of the TRM package to import.`)
203
- .description(`Import a package (as a file) into system.`)
204
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false)
205
- .option(`-ow, --overwrite`, `Overwrite installation (allow re-install).`, false)
206
- .option(`-sf, --safe`, `Safe install (needs package integrity).`, false)
207
- .option(`-nd, --noDependencies`, `Skip check/install of package dependencies.`, false)
208
- .option(`-no, --noObjectTypes`, `Skip check of package object types.`, false)
209
- .option(`-ns, --noSapEntries`, `Skip check of package SAP entries/objects.`, false)
210
- .option(`-nl, --noLanguageTransport`, `Skip install of language (translations) transport (if exists).`, false)
211
- .option(`-nc, --noCustomizingTransport`, `Skip install of customizing transport (if exists).`, false)
212
- .option(`-to, --importTimeout <timeout>`, `Install transports import timeout (in seconds).`, '180')
213
- .option(`-kd, --keepOriginalPackages`, `Keep original ABAP packages names.`)
214
- .option(`-it, --createInstallTransport`, `Create/update install transport (used for landscape transports).`, true)
215
- .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`)
216
- .option(`-sha, --integrity <sha>`, `Package integrity.`)
217
- .option(`-tl, --transportLayer <transportLayer>`, `ABAP packages transport layer. (default: System default)`)
218
- .option(`-pr, --packageReplacements <JSON>`, `ABAP package replacements in JSON format.`)
219
- .option(`-itt, --installTransportTargetSys <transportTarget>`, `Install transport target system.`);
220
- (0, utils_1.registerCommand)(_import, {
221
- requiresConnection: true,
222
- requiresTrmDependencies: true
223
- });
224
- const lock = program.command(`lock`)
225
- .argument(`<package>`, `Name of the package to generate lock file.`)
226
- .argument(`[outputPath]`, `Output path.`, 'trm-lock.json')
227
- .description(`Generate lock file.`);
228
- (0, utils_1.registerCommand)(lock, {
229
- requiresConnection: true,
230
- requiresRegistry: true,
231
- ignoreRegistryUnreachable: true
232
- });
233
- const view = program.command(`view`)
234
- .argument(`<package>`, `Name of the package to view.`)
235
- .description(`View package.`)
236
- .addHelpText(`before`, `Shows package details.
237
- If the package is not found on the system, it will automatically fall back to the data provided by the registry, granted it exists.`);
238
- (0, utils_1.registerCommand)(view, {
239
- requiresConnection: true,
240
- addNoConnection: true,
241
- requiresRegistry: true,
242
- ignoreRegistryUnreachable: true
243
- });
244
- const compare = program.command(`compare`)
245
- .argument(`<package>`, `Name of the package to compare.`)
246
- .description(`Compare a package on different systems.`)
247
- .option(`-c, --connections <json>`, `Path to JSON file or JSON containing an array of aliases.`);
248
- (0, utils_1.registerCommand)(compare, {
249
- requiresRegistry: true,
250
- ignoreRegistryUnreachable: true
251
- });
252
- const content = program.command(`content`)
253
- .argument(`<package>`, `Name of the package.`)
254
- .argument(`[version]`, `Optional: Version of the package`)
255
- .description(`List content of a package.`)
256
- .option(`-a, --all`, `List all content`, false)
257
- .option(`-r3, --r3transPath <path>`, `R3trans program path. (default: Environment variable R3TRANS_HOME)`);
258
- (0, utils_1.registerCommand)(content, {
259
- requiresRegistry: true
260
- });
261
- const list = program.command(`list`)
262
- .description(`List packages installed on a system.`)
263
- .option(`-l, --locals`, `List imported/exported local packages`, false);
264
- (0, utils_1.registerCommand)(list, {
265
- requiresConnection: true
266
- });
267
- const check = program.command(`check`)
268
- .argument(`<package>`, `Name of the package to check.`)
269
- .description(`Analyze installed package status on a system.`)
270
- .option(`-at, --analysisType`, `Analysis type (DEPENDENCIES, SAPENTRIES or ALL).`, `DEPENDENCIES`);
271
- (0, utils_1.registerCommand)(check, {
272
- requiresConnection: true,
273
- requiresRegistry: true,
274
- ignoreRegistryUnreachable: true
275
- });
276
- const findDependencies = program.command(`findDependencies`)
277
- .argument(`<devclass>`, `Name of the SAP package to check.`)
278
- .description(`Find SAP package dependencies with custom packages/trm packages/SAP entries/objects.`)
279
- .option(`-se, --sapEntries`, `Show list of required SAP entries/objects.`, false)
280
- .option(`-np, --noPrompts`, `No prompts (will force some decisions).`, false);
281
- (0, utils_1.registerCommand)(findDependencies, {
282
- requiresConnection: true
283
- });
284
- const info = program.command(`info`)
285
- .description(`TRM Client/Server Info.`);
286
- (0, utils_1.registerCommand)(info, {
287
- requiresConnection: true,
288
- addNoConnection: true,
289
- requiresTrmDependencies: true
290
- });
291
- const settings = program.command(`settings`)
292
- .description(`Show/Set settings.`)
293
- .option(`-s, --set <property>`, `Property as KEY=VALUE.`);
294
- (0, utils_1.registerCommand)(settings);
24
+ new implementations_1.Ping(program, 'ping').register();
25
+ new implementations_1.Info(program, 'info').register();
26
+ new implementations_1.Registry(program, 'registry add').register();
27
+ new implementations_1.Registry(program, 'registry rm').register();
28
+ new implementations_1.Login(program, 'login').register();
29
+ new implementations_1.WhoAmI(program, 'whoami').register();
30
+ new implementations_1.Logout(program, 'logout').register();
31
+ new implementations_1.Alias(program, 'alias create').register();
32
+ new implementations_1.Alias(program, 'alias delete').register();
33
+ new implementations_1.Alias(program, 'alias').register();
34
+ new implementations_1.Publish(program, 'publish').register();
35
+ new implementations_1.DistTag(program, 'dist-tag add').register();
36
+ new implementations_1.DistTag(program, 'dist-tag rm').register();
37
+ new implementations_1.Publish(program, 'pack', ['export']).register();
38
+ new implementations_1.Lock(program, 'lock', ['lock-file']).register();
39
+ new implementations_1.Unpublish(program, 'unpublish').register();
40
+ new implementations_1.Deprecate(program, 'deprecrate').register();
41
+ new implementations_1.Install(program, 'install', ['i']).register();
42
+ new implementations_1.Install(program, 'clean-install', ['ci']).register();
43
+ new implementations_1.Install(program, 'update').register();
44
+ new implementations_1.Install(program, 'import').register();
45
+ new implementations_1.List(program, 'list', ['ls']).register();
46
+ new implementations_1.Content(program, 'content', ['contents']).register();
47
+ new implementations_1.View(program, 'view').register();
48
+ new implementations_1.Compare(program, 'compare').register();
49
+ new implementations_1.FindDependencies(program, 'find-dependencies').register();
50
+ new implementations_1.Settings(program, 'settings').register();
295
51
  program.parse(process.argv);
@@ -144,7 +144,7 @@ class RegistryAlias {
144
144
  }
145
145
  static delete(name) {
146
146
  var aAlias = this.getAll();
147
- aAlias = aAlias.filter(o => o.alias.trim().toUpperCase() === name.trim().toUpperCase());
147
+ aAlias = aAlias.filter(o => o.alias.trim().toUpperCase() !== name.trim().toUpperCase());
148
148
  this.generateFile(aAlias);
149
149
  }
150
150
  static update(name, auth = {}) {
@@ -58,9 +58,9 @@ class SystemAlias {
58
58
  this._data = _data;
59
59
  }
60
60
  getConnection() {
61
- const connection = utils_1.Context.getInstance().getConnections().find(o => o.name === this.type);
61
+ const connection = utils_1.GlobalContext.getInstance().getConnections().find(o => o.name === this.type);
62
62
  if (!connection) {
63
- throw new Error(`Unknown connection type "${this.type}". Possible values are ${utils_1.Context.getInstance().getConnections().map(k => k.name).join(', ')}.`);
63
+ throw new Error(`Unknown connection type "${this.type}". Possible values are ${utils_1.GlobalContext.getInstance().getConnections().map(k => k.name).join(', ')}.`);
64
64
  }
65
65
  connection.setData(this._data.data || this._data);
66
66
  return connection.getSystemConnector();
@@ -71,7 +71,7 @@ class SystemAlias {
71
71
  }
72
72
  var oContent = {};
73
73
  content.forEach(o => {
74
- const connection = utils_1.Context.getInstance().getConnections().find(k => k.name === o.type);
74
+ const connection = utils_1.GlobalContext.getInstance().getConnections().find(k => k.name === o.type);
75
75
  if (connection) {
76
76
  oContent[o.alias] = o.data;
77
77
  oContent[o.alias].type = o.type;
@@ -95,7 +95,7 @@ class SystemAlias {
95
95
  if (!oIni[sAlias].type) {
96
96
  oIni[sAlias].type = 'RFC';
97
97
  }
98
- const connection = utils_1.Context.getInstance().getConnections().find(o => o.name === oIni[sAlias].type);
98
+ const connection = utils_1.GlobalContext.getInstance().getConnections().find(o => o.name === oIni[sAlias].type);
99
99
  if (connection) {
100
100
  aAlias.push({
101
101
  alias: sAlias,
@@ -1,7 +1,7 @@
1
1
  import { CacheData } from ".";
2
- import { SettingsData } from "./";
2
+ import { SettingsData } from ".";
3
3
  import { IConnect, PluginModule } from "trm-commons";
4
- export declare class Context {
4
+ export declare class GlobalContext {
5
5
  private static _instance;
6
6
  private _pluginsLoaded;
7
7
  private _settings;
@@ -25,5 +25,5 @@ export declare class Context {
25
25
  private getCacheInternal;
26
26
  private generateSettingsFile;
27
27
  private generateCacheFile;
28
- static getInstance(): Context;
28
+ static getInstance(): GlobalContext;
29
29
  }
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.Context = void 0;
48
+ exports.GlobalContext = void 0;
49
49
  const path_1 = __importDefault(require("path"));
50
50
  const _1 = require(".");
51
51
  const fs = __importStar(require("fs"));
@@ -63,10 +63,10 @@ class RESTConnectExtended extends trm_commons_1.RESTConnect {
63
63
  class RFCConnectExtended extends trm_commons_1.RFCConnect {
64
64
  getSystemConnector() {
65
65
  const data = this.getData();
66
- return new trm_core_1.RFCSystemConnector(data, data, (0, _1.getTempFolder)(), Context.getInstance().getSettings().globalNodeModules);
66
+ return new trm_core_1.RFCSystemConnector(data, data, (0, _1.getTempFolder)(), GlobalContext.getInstance().getSettings().globalNodeModules);
67
67
  }
68
68
  }
69
- class Context {
69
+ class GlobalContext {
70
70
  constructor() {
71
71
  this._pluginsLoaded = false;
72
72
  this._connections = [];
@@ -187,10 +187,10 @@ class Context {
187
187
  }
188
188
  static getInstance() {
189
189
  if (!this._instance) {
190
- this._instance = new Context();
190
+ this._instance = new GlobalContext();
191
191
  }
192
192
  return this._instance;
193
193
  }
194
194
  }
195
- exports.Context = Context;
196
- Context._instance = null;
195
+ exports.GlobalContext = GlobalContext;
196
+ GlobalContext._instance = null;
@@ -1,4 +1,5 @@
1
- export declare function checkCliUpdate(print: boolean): Promise<{
1
+ export interface CliVersionStatus {
2
2
  localVersion: string;
3
3
  latestVersion: string;
4
- }>;
4
+ }
5
+ export declare function checkCliUpdate(print: boolean): Promise<CliVersionStatus>;
@@ -18,18 +18,18 @@ const getClientVersion_1 = require("./getClientVersion");
18
18
  const chalk_1 = __importDefault(require("chalk"));
19
19
  const getNpmPackageLatestVersion_1 = require("./getNpmPackageLatestVersion");
20
20
  const trm_commons_1 = require("trm-commons");
21
- const Context_1 = require("./Context");
21
+ const GlobalContext_1 = require("./GlobalContext");
22
22
  function checkCliUpdate(print) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  try {
25
25
  var latestVersion;
26
- const cache = Context_1.Context.getInstance().getCache().latestVersion;
26
+ const cache = GlobalContext_1.GlobalContext.getInstance().getCache().latestVersion;
27
27
  if (cache && cache.ts && Date.now() - cache.ts <= 60000) {
28
28
  latestVersion = cache.data;
29
29
  }
30
30
  else {
31
31
  latestVersion = yield (0, getNpmPackageLatestVersion_1.getNpmPackageLatestVersion)('trm-client');
32
- Context_1.Context.getInstance().setCache('latestVersion', latestVersion);
32
+ GlobalContext_1.GlobalContext.getInstance().setCache('latestVersion', latestVersion);
33
33
  }
34
34
  const localVersion = (0, getClientVersion_1.getClientVersion)();
35
35
  const versionDiff = (0, semver_1.diff)(localVersion, latestVersion);
@@ -45,13 +45,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.getSapLogonConnections = getSapLogonConnections;
46
46
  const fs = __importStar(require("fs"));
47
47
  const xml2js_1 = require("./xml2js");
48
- const Context_1 = require("./Context");
48
+ const GlobalContext_1 = require("./GlobalContext");
49
49
  function getSapLogonConnections() {
50
50
  return __awaiter(this, void 0, void 0, function* () {
51
51
  var systems = [];
52
- const sapLandscape = Context_1.Context.getInstance().getSettings().sapLandscape;
52
+ const sapLandscape = GlobalContext_1.GlobalContext.getInstance().getSettings().sapLandscape;
53
53
  if (sapLandscape) {
54
- const sXml = fs.readFileSync(Context_1.Context.getInstance().getSettings().sapLandscape, { encoding: 'utf8', flag: 'r' });
54
+ const sXml = fs.readFileSync(GlobalContext_1.GlobalContext.getInstance().getSettings().sapLandscape, { encoding: 'utf8', flag: 'r' });
55
55
  const result = yield (0, xml2js_1.xml2js)(sXml);
56
56
  try {
57
57
  result.Landscape.Services[0].Service.forEach((xmlObj) => {
@@ -1,11 +1,8 @@
1
- export * from "./registerCommand";
2
- export * from "./executeCommand";
3
1
  export * from "./getRoamingPath";
4
2
  export * from "./getRoamingFolder";
5
3
  export * from "./xml2js";
6
4
  export * from "./getSapLogonConnections";
7
5
  export * from "./logError";
8
- export * from "./checkTrmDependencies";
9
6
  export * from "./checkCliUpdate";
10
7
  export * from "./getNodePackage";
11
8
  export * from "./getClientVersion";
@@ -16,4 +13,4 @@ export * from "./DummyConnector";
16
13
  export * from "./getNpmPackageLatestVersion";
17
14
  export * from "./SettingsData";
18
15
  export * from "./CacheData";
19
- export * from "./Context";
16
+ export * from "./GlobalContext";
@@ -14,14 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./registerCommand"), exports);
18
- __exportStar(require("./executeCommand"), exports);
19
17
  __exportStar(require("./getRoamingPath"), exports);
20
18
  __exportStar(require("./getRoamingFolder"), exports);
21
19
  __exportStar(require("./xml2js"), exports);
22
20
  __exportStar(require("./getSapLogonConnections"), exports);
23
21
  __exportStar(require("./logError"), exports);
24
- __exportStar(require("./checkTrmDependencies"), exports);
25
22
  __exportStar(require("./checkCliUpdate"), exports);
26
23
  __exportStar(require("./getNodePackage"), exports);
27
24
  __exportStar(require("./getClientVersion"), exports);
@@ -32,4 +29,4 @@ __exportStar(require("./DummyConnector"), exports);
32
29
  __exportStar(require("./getNpmPackageLatestVersion"), exports);
33
30
  __exportStar(require("./SettingsData"), exports);
34
31
  __exportStar(require("./CacheData"), exports);
35
- __exportStar(require("./Context"), exports);
32
+ __exportStar(require("./GlobalContext"), exports);
package/package.json CHANGED
@@ -1,65 +1,67 @@
1
- {
2
- "name": "trm-client",
3
- "version": "6.1.1",
4
- "description": "TRM (Transport Request Manager) Client",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "files": [
8
- "changelog.txt",
9
- "dist",
10
- "!dist/test.js",
11
- "!dist/test.js.map",
12
- "!dist/test.d.ts",
13
- "!dist/.env",
14
- "!dist/dev_rfc.log"
15
- ],
16
- "bin": {
17
- "trm": "dist/index.js"
18
- },
19
- "scripts": {
20
- "cleanBuild": "rimraf dist/",
21
- "build": "npm run cleanBuild && tsc --sourceMap false",
22
- "prepublishOnly": "npm run build"
23
- },
24
- "keywords": [
25
- "trm",
26
- "abap"
27
- ],
28
- "homepage": "https://www.trmregistry.com",
29
- "repository": {
30
- "type": "git",
31
- "url": "git+https://github.com/RegestaItalia/trm-client.git"
32
- },
33
- "author": {
34
- "name": "Simone Gaffurini",
35
- "email": "simone.gaffurini@regestaitalia.it"
36
- },
37
- "license": "MIT",
38
- "dependencies": {
39
- "@esm2cjs/normalize-url": "^8.0.0",
40
- "chalk": "^4.1.2",
41
- "commander": "^11.0.0",
42
- "dotenv": "^17.2.2",
43
- "execa": "^9.6.0",
44
- "get-latest-version": "^5.1.0",
45
- "get-root-path": "^2.0.2",
46
- "ini": "^4.1.1",
47
- "lodash": "^4.17.21",
48
- "semver": "^7.5.4",
49
- "trm-commons": "^3.4.2",
50
- "trm-core": "^8.0.1",
51
- "trm-registry-types": "^2.0.0",
52
- "xml2js": "^0.6.2"
53
- },
54
- "peerDependencies": {
55
- "trm-commons": "^3.4.2"
56
- },
57
- "devDependencies": {
58
- "@types/ini": "^1.3.31",
59
- "@types/lodash": "^4.17.20",
60
- "@types/node": "^20.4.8",
61
- "@types/semver": "^7.5.3",
62
- "@types/xml2js": "^0.4.11",
63
- "rimraf": "^6.0.1"
64
- }
65
- }
1
+ {
2
+ "name": "trm-client",
3
+ "version": "7.0.0",
4
+ "description": "TRM (Transport Request Manager) Client",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "changelog.txt",
9
+ "dist",
10
+ "!dist/test.js",
11
+ "!dist/test.js.map",
12
+ "!dist/test.d.ts",
13
+ "!dist/.env",
14
+ "!dist/dev_rfc.log"
15
+ ],
16
+ "bin": {
17
+ "trm": "dist/index.js"
18
+ },
19
+ "scripts": {
20
+ "cleanBuild": "rimraf dist/",
21
+ "build": "npm run cleanBuild && tsc --sourceMap false",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "keywords": [
25
+ "trm",
26
+ "abap"
27
+ ],
28
+ "homepage": "https://www.trmregistry.com",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/RegestaItalia/trm-client.git"
32
+ },
33
+ "author": {
34
+ "name": "Simone Gaffurini",
35
+ "email": "simone.gaffurini@regestaitalia.it"
36
+ },
37
+ "license": "MIT",
38
+ "dependencies": {
39
+ "@esm2cjs/normalize-url": "^8.0.0",
40
+ "chalk": "^4.1.2",
41
+ "commander": "^11.0.0",
42
+ "dotenv": "^17.2.2",
43
+ "execa": "^9.6.0",
44
+ "get-latest-version": "^5.1.0",
45
+ "get-root-path": "^2.0.2",
46
+ "i": "^0.3.7",
47
+ "ini": "^4.1.1",
48
+ "lodash": "^4.17.21",
49
+ "npm": "^11.6.0",
50
+ "semver": "^7.5.4",
51
+ "trm-commons": "^3.4.2",
52
+ "trm-core": "^8.1.2",
53
+ "trm-registry-types": "^2.1.0",
54
+ "xml2js": "^0.6.2"
55
+ },
56
+ "peerDependencies": {
57
+ "trm-commons": "^3.4.2"
58
+ },
59
+ "devDependencies": {
60
+ "@types/ini": "^1.3.31",
61
+ "@types/lodash": "^4.17.20",
62
+ "@types/node": "^20.4.8",
63
+ "@types/semver": "^7.5.3",
64
+ "@types/xml2js": "^0.4.11",
65
+ "rimraf": "^6.0.1"
66
+ }
67
+ }