Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@adobe/aio-lib-env": "^3.0.1",
"@adobe/aio-lib-ims": "^8.0.1",
"@adobe/aio-lib-runtime": "^7.1.0",
"@oclif/core": "^1.3.0",
"@oclif/core": "^2.8.12",
"@types/jest": "^29.5.3",
"chalk": "^4.1.2",
"dayjs": "^1.10.4",
Expand Down Expand Up @@ -46,7 +46,6 @@
"execa": "^4.0.0",
"jest": "^29.6.2",
"jest-junit": "^16.0.0",
"jest-plugin-fs": "^2.9.0",
"oclif": "^3.2.0",
"stdout-stderr": "^0.1.9"
},
Expand Down
15 changes: 5 additions & 10 deletions src/commands/runtime/action/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ governing permissions and limitations under the License.
const fs = require('fs')
const { createKeyValueArrayFromFlag, createKeyValueArrayFromFile, createComponentsfromSequence, getKeyValueArrayFromMergedParameters } = require('@adobe/aio-lib-runtime').utils
const { kindForFileExtension } = require('../../../kinds')
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const DeployServiceCommand = require('../../../DeployServiceCommand')

class ActionCreate extends DeployServiceCommand {
Expand Down Expand Up @@ -224,15 +224,10 @@ class ActionCreate extends DeployServiceCommand {
}
}

ActionCreate.args = [
{
name: 'actionName',
required: true
},
{
name: 'actionPath'
}
]
ActionCreate.args = {
actionName: Args.string({ required: true }),
actionPath: Args.string({ required: false })
}

ActionCreate.flags = {
...DeployServiceCommand.flags,
Expand Down
11 changes: 4 additions & 7 deletions src/commands/runtime/action/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ governing permissions and limitations under the License.
*/

const DeployServiceCommand = require('../../../DeployServiceCommand')
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')

class ActionDelete extends DeployServiceCommand {
async run () {
Expand All @@ -29,12 +29,9 @@ class ActionDelete extends DeployServiceCommand {
}
}

ActionDelete.args = [
{
name: 'actionName',
required: true
}
]
ActionDelete.args = {
actionName: Args.string({ required: true })
}

ActionDelete.flags = {
...DeployServiceCommand.flags,
Expand Down
11 changes: 4 additions & 7 deletions src/commands/runtime/action/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ governing permissions and limitations under the License.
const fs = require('fs')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { fileExtensionForKind } = require('../../../kinds')
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')

class ActionGet extends RuntimeBaseCommand {
async run () {
Expand Down Expand Up @@ -93,12 +93,9 @@ class ActionGet extends RuntimeBaseCommand {
}
}

ActionGet.args = [
{
name: 'actionName',
required: true
}
]
ActionGet.args = {
actionName: Args.string({ required: true })
}

ActionGet.flags = {
...RuntimeBaseCommand.flags,
Expand Down
11 changes: 4 additions & 7 deletions src/commands/runtime/action/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ governing permissions and limitations under the License.
*/

const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const { getKeyValueObjectFromMergedParameters } = require('@adobe/aio-lib-runtime').utils

class ActionInvoke extends RuntimeBaseCommand {
Expand Down Expand Up @@ -49,12 +49,9 @@ class ActionInvoke extends RuntimeBaseCommand {
}
}

ActionInvoke.args = [
{
name: 'actionName',
required: true
}
]
ActionInvoke.args = {
actionName: Args.string({ required: true })
}

ActionInvoke.flags = {
...RuntimeBaseCommand.flags,
Expand Down
13 changes: 5 additions & 8 deletions src/commands/runtime/action/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ governing permissions and limitations under the License.
const moment = require('dayjs')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { parsePackageName } = require('@adobe/aio-lib-runtime').utils
const { Flags, CliUx: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const decorators = require('../../../decorators').decorators()

class ActionList extends RuntimeBaseCommand {
Expand Down Expand Up @@ -86,20 +86,17 @@ class ActionList extends RuntimeBaseCommand {
}
}
}
cli.ux.table(result, columns)
ux.table(result, columns)
}
} catch (err) {
await this.handleError('failed to list the actions', err)
}
}
}

ActionList.args = [
{
name: 'packageName',
required: false
}
]
ActionList.args = {
packageName: Args.string({ required: false })
}

ActionList.flags = {
...RuntimeBaseCommand.flags,
Expand Down
14 changes: 5 additions & 9 deletions src/commands/runtime/action/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ governing permissions and limitations under the License.
*/

const ActionCreate = require('./create')
const { Args } = require('@oclif/core')

class ActionUpdate extends ActionCreate {
isUpdate () { return true }
}

ActionUpdate.args = [
{
name: 'actionName',
required: true
},
{
name: 'actionPath'
}
]
ActionUpdate.args = {
actionName: Args.string({ required: true }),
actionPath: Args.string({ required: false })
}

ActionUpdate.flags = ActionCreate.flags

Expand Down
10 changes: 4 additions & 6 deletions src/commands/runtime/activation/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { printLogs } = require('@adobe/aio-lib-runtime').utils

Expand Down Expand Up @@ -45,11 +45,9 @@ class ActivationGet extends RuntimeBaseCommand {
}
}

ActivationGet.args = [
{
name: 'activationID'
}
]
ActivationGet.args = {
activationID: Args.string({ required: false })
}

ActivationGet.flags = {
...RuntimeBaseCommand.flags,
Expand Down
12 changes: 5 additions & 7 deletions src/commands/runtime/activation/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ governing permissions and limitations under the License.

const moment = require('dayjs')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { Flags, CliUx: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const decorators = require('../../../decorators').decorators()
const statusStrings = ['success', 'app error', 'dev error', 'sys error']

Expand Down Expand Up @@ -187,7 +187,7 @@ class ActivationList extends RuntimeBaseCommand {
}
}
if (listActivation) {
cli.ux.table(listActivation, columns, {
ux.table(listActivation, columns, {
'no-truncate': true
})
}
Expand All @@ -198,11 +198,9 @@ class ActivationList extends RuntimeBaseCommand {
}
}

ActivationList.args = [
{
name: 'action_name'
}
]
ActivationList.args = {
action_name: Args.string({ required: false })
}

ActivationList.flags = {
...RuntimeBaseCommand.flags,
Expand Down
10 changes: 4 additions & 6 deletions src/commands/runtime/activation/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const rtLib = require('@adobe/aio-lib-runtime')
const printLogs = rtLib.utils.printLogs
Expand Down Expand Up @@ -86,11 +86,9 @@ class ActivationLogs extends RuntimeBaseCommand {
}
}

ActivationLogs.args = [
{
name: 'activationId'
}
]
ActivationLogs.args = {
activationId: Args.string({ required: false })
}

ActivationLogs.flags = {
...RuntimeBaseCommand.flags,
Expand Down
10 changes: 4 additions & 6 deletions src/commands/runtime/activation/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')

class ActivationResult extends RuntimeBaseCommand {
Expand All @@ -35,11 +35,9 @@ class ActivationResult extends RuntimeBaseCommand {
}
}

ActivationResult.args = [
{
name: 'activationID'
}
]
ActivationResult.args = {
activationID: Args.string({ required: false })
}

ActivationResult.flags = {
...RuntimeBaseCommand.flags,
Expand Down
31 changes: 7 additions & 24 deletions src/commands/runtime/api/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ governing permissions and limitations under the License.
*/

const DeployServiceCommand = require('../../../DeployServiceCommand')
const { Flags } = require('@oclif/core')
const { Args, Flags } = require('@oclif/core')
const fs = require('fs')

class ApiCreate extends DeployServiceCommand {
Expand Down Expand Up @@ -48,29 +48,12 @@ class ApiCreate extends DeployServiceCommand {
}
}

ApiCreate.args = [
{
name: 'basePath',
required: false,
description: 'The base path of the api'
},
{
name: 'relPath',
required: false,
description: 'The path of the api relative to the base path'
},
{
name: 'apiVerb',
required: false,
description: 'The http verb',
options: ['get', 'post', 'put', 'patch', 'delete', 'head', 'options']
},
{
name: 'action',
required: false,
description: 'The action to call'
}
]
ApiCreate.args = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use newlines in formatting so this can be read easier

basePath: Args.string({ required: false, description: 'The base path of the api' }),
relPath: Args.string({ required: false, description: 'The path of the api relative to the base path' }),
apiVerb: Args.string({ required: false, description: 'The http verb', options: ['get', 'post', 'put', 'patch', 'delete', 'head', 'options'] }),
action: Args.string({ required: false, description: 'The action to call' })
}

ApiCreate.flags = {
...DeployServiceCommand.flags,
Expand Down
23 changes: 6 additions & 17 deletions src/commands/runtime/api/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ governing permissions and limitations under the License.
*/

const DeployServiceCommand = require('../../../DeployServiceCommand')
// eslint-disable-next-line no-unused-vars
const { Args } = require('@oclif/core')

class ApiDelete extends DeployServiceCommand {
async run () {
Expand All @@ -31,22 +31,11 @@ class ApiDelete extends DeployServiceCommand {
}
}

ApiDelete.args = [
{
name: 'basePathOrApiName',
required: true,
description: 'The base path or api name'
},
{
name: 'relPath',
description: 'The path of the api relative to the base path'
},
{
name: 'apiVerb',
description: 'The http verb',
options: ['get', 'post', 'put', 'patch', 'delete', 'head', 'options']
}
]
ApiDelete.args = {
basePathOrApiName: Args.string({ required: true, description: 'The base path or api name' }),
relPath: Args.string({ required: false, description: 'The path of the api relative to the base path' }),
apiVerb: Args.string({ required: false, description: 'The http verb', options: ['get', 'post', 'put', 'patch', 'delete', 'head', 'options'] })
}

ApiDelete.flags = {
...DeployServiceCommand.flags
Expand Down
11 changes: 4 additions & 7 deletions src/commands/runtime/api/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ governing permissions and limitations under the License.
*/

const RuntimeBaseCommand = require('../../../RuntimeBaseCommand')
const { Args } = require('@oclif/core')
// eslint-disable-next-line no-unused-vars
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The eslint-disable comment for no-unused-vars appears to be unnecessary as all imports are now being used. The Args import is actively used in the args definition. Consider removing this unused eslint-disable comment.

Suggested change
// eslint-disable-next-line no-unused-vars

Copilot uses AI. Check for mistakes.

class ApiGet extends RuntimeBaseCommand {
Expand All @@ -30,13 +31,9 @@ class ApiGet extends RuntimeBaseCommand {
}
}

ApiGet.args = [
{
name: 'basePathOrApiName',
required: true,
description: 'The base path or api name'
}
]
ApiGet.args = {
basePathOrApiName: Args.string({ required: true, description: 'The base path or api name' })
}

ApiGet.flags = {
...RuntimeBaseCommand.flags
Expand Down
Loading
Loading