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
17 changes: 8 additions & 9 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,14 @@ class ActionCreate extends DeployServiceCommand {
}
}

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

ActionCreate.flags = {
...DeployServiceCommand.flags,
Expand Down
11 changes: 5 additions & 6 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,11 @@ class ActionDelete extends DeployServiceCommand {
}
}

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

ActionDelete.flags = {
...DeployServiceCommand.flags,
Expand Down
11 changes: 5 additions & 6 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,11 @@ class ActionGet extends RuntimeBaseCommand {
}
}

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

ActionGet.flags = {
...RuntimeBaseCommand.flags,
Expand Down
11 changes: 5 additions & 6 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,11 @@ class ActionInvoke extends RuntimeBaseCommand {
}
}

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

ActionInvoke.flags = {
...RuntimeBaseCommand.flags,
Expand Down
13 changes: 6 additions & 7 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,19 @@ 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',
ActionList.args = {
packageName: Args.string({
required: false
}
]
})
}

ActionList.flags = {
...RuntimeBaseCommand.flags,
Expand Down
16 changes: 8 additions & 8 deletions src/commands/runtime/action/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ 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',
ActionUpdate.args = {
actionName: Args.string({
required: true
},
{
name: 'actionPath'
}
]
}),
actionPath: Args.string({
required: false
})
}

ActionUpdate.flags = ActionCreate.flags

Expand Down
12 changes: 6 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,11 @@ class ActivationGet extends RuntimeBaseCommand {
}
}

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

ActivationGet.flags = {
...RuntimeBaseCommand.flags,
Expand Down
14 changes: 7 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,11 @@ class ActivationList extends RuntimeBaseCommand {
}
}

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

ActivationList.flags = {
...RuntimeBaseCommand.flags,
Expand Down
12 changes: 6 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,11 @@ class ActivationLogs extends RuntimeBaseCommand {
}
}

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

ActivationLogs.flags = {
...RuntimeBaseCommand.flags,
Expand Down
12 changes: 6 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,11 @@ class ActivationResult extends RuntimeBaseCommand {
}
}

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

ActivationResult.flags = {
...RuntimeBaseCommand.flags,
Expand Down
26 changes: 11 additions & 15 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,25 @@ class ApiCreate extends DeployServiceCommand {
}
}

ApiCreate.args = [
{
name: 'basePath',
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

Copy link
Author

Choose a reason for hiding this comment

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

Makes Sense, Thanks for the input, fixed

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

ApiCreate.flags = {
...DeployServiceCommand.flags,
Expand Down
23 changes: 11 additions & 12 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,21 @@ class ApiDelete extends DeployServiceCommand {
}
}

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

ApiDelete.flags = {
...DeployServiceCommand.flags
Expand Down
Loading