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
18 changes: 0 additions & 18 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ package-lock.json
playground/
oclif.manifest.json
.idea
.claude
5 changes: 0 additions & 5 deletions e2e/.eslintrc.json

This file was deleted.

48 changes: 48 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

const aioLibConfig = require('@adobe/eslint-config-aio-lib-config')
const pluginJest = require('eslint-plugin-jest')

module.exports = [
...aioLibConfig,
{
settings: {
jsdoc: {
ignorePrivate: true
}
},
rules: {
'jsdoc/tag-lines': [
'error',
'never',
{
startLines: null
}
]
}
},
{
files: ['test/**/*.js'],
...pluginJest.configs['flat/recommended'],
rules: {
...pluginJest.configs['flat/recommended'].rules
}
},
{
files: ['e2e/**/*.js'],
...pluginJest.configs['flat/recommended'],
rules: {
...pluginJest.configs['flat/recommended'].rules,
Comment on lines +35 to +44
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

In the test/**/*.js and e2e/**/*.js overrides, ...pluginJest.configs['flat/recommended'] already includes the rules field; re-specifying rules: { ...pluginJest.configs['flat/recommended'].rules } is redundant and makes it easier for the two to get out of sync if one side changes.

Consider removing the redundant rules assignments (keeping only the additional overrides you need).

Suggested change
...pluginJest.configs['flat/recommended'],
rules: {
...pluginJest.configs['flat/recommended'].rules
}
},
{
files: ['e2e/**/*.js'],
...pluginJest.configs['flat/recommended'],
rules: {
...pluginJest.configs['flat/recommended'].rules,
...pluginJest.configs['flat/recommended']
},
{
files: ['e2e/**/*.js'],
...pluginJest.configs['flat/recommended']
},
{
files: ['e2e/**/*.js'],
rules: {

Copilot uses AI. Check for mistakes.
'n/no-unpublished-require': 'off'
}
}
]
16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,27 @@
"@adobe/aio-lib-env": "^3",
"@adobe/aio-lib-events": "^4",
"@adobe/aio-lib-ims": "^7",
"@oclif/core": "^2.8.12",
"@oclif/core": "^4.9.0",
"inquirer": "^8.2.5",
"js-yaml": "^4.1.0"
},
"repository": "adobe/aio-cli-plugin-events",
"devDependencies": {
"@adobe/eslint-config-aio-lib-config": "^4.0.0",
"@adobe/eslint-config-aio-lib-config": "^5.0.0",
"@types/jest": "^29.5.3",
"acorn": "^8.10.0",
"babel-runtime": "^6.26.0",
"chalk": "^4.0.0",
"eol": "^0.9.1",
"eslint": "^8.57.1",
"eslint-config-oclif": "^4.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^27.9.0",
"eslint": "^9.39.4",
"eslint-plugin-jest": "^29.15.1",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.6.0",
"eslint-plugin-standard": "^5.0.0",
"execa": "^7.2.0",
"jest": "^29.5.0",
"jest-haste-map": "^29.5.0",
"jest-junit": "^16.0.0",
"jest-resolve": "^29.5.0",
"neostandard": "^0.13.0",
"oclif": "^3.2.0",
"stdout-stderr": "^0.1.13"
},
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/eventmetadata/create.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 BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const { sentenceValidatorWithMinOneChar, eventCodeValidator } = require('../../../utils/validator')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:eventmetadata:create', { provider: 'debug' })
Expand Down Expand Up @@ -41,9 +41,9 @@ class EventmetadataCreateCommand extends BaseCommand {
description: response.description
}

cli.action.start('Creating Event Metadata')
ux.action.start('Creating Event Metadata')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought action was removed and we're all just supposed to use ora

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

const eventmetadata = await this.eventClient.createEventMetadataForProvider(this.conf.org.id, this.conf.project.id, this.conf.workspace.id, args.providerId, eventMetadataPayload)
cli.action.stop()
ux.action.stop()

if (flags.json) {
this.printJson(eventmetadata)
Expand Down
10 changes: 5 additions & 5 deletions src/commands/event/eventmetadata/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 BaseCommand = require('../../../BaseCommand.js')
const { Args, ux: cli } = require('@oclif/core')
const { Args, ux } = require('@oclif/core')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:eventmetadata:delete', { provider: 'debug' })

Expand All @@ -29,10 +29,10 @@ class EventmetadataDeleteCommand extends BaseCommand {

}])
if (response.delete) {
cli.action.start('Deleting ALL Event Metadata for provider')
ux.action.start('Deleting ALL Event Metadata for provider')
await this.eventClient.deleteAllEventMetadata(this.conf.org.id,
this.conf.project.id, this.conf.workspace.id, args.providerId)
cli.action.stop()
ux.action.stop()
this.log('All event metadata of provider ' + args.providerId + ' has been deleted successfully')
} else {
this.log('Deletion operation has been cancelled. For more information on delete use --help')
Expand All @@ -45,11 +45,11 @@ class EventmetadataDeleteCommand extends BaseCommand {

}])
if (response.delete) {
cli.action.start('Deleting Event Metadata for provider')
ux.action.start('Deleting Event Metadata for provider')
await this.eventClient.deleteEventMetadata(this.conf.org.id,
this.conf.project.id, this.conf.workspace.id, args.providerId,
args.eventCode)
cli.action.stop()
ux.action.stop()
this.log(args.eventCode + ' event metadata of provider ' + args.providerId + ' has been deleted successfully')
} else {
this.log('Deletion operation has been cancelled. For more information on delete use --help')
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/eventmetadata/get.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 BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:eventmetadata:get', { provider: 'debug' })

class EventmetadataGetCommand extends BaseCommand {
Expand All @@ -20,10 +20,10 @@ class EventmetadataGetCommand extends BaseCommand {

try {
await this.initSdk()
cli.action.start('Fetching the event metadata for the provider')
ux.action.start('Fetching the event metadata for the provider')
const eventmetadata = await this.eventClient.getEventMetadataForProvider(args.providerId,
args.eventCode)
cli.action.stop()
ux.action.stop()

if (flags.json) {
this.printJson(eventmetadata)
Expand Down
9 changes: 5 additions & 4 deletions src/commands/event/eventmetadata/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ governing permissions and limitations under the License.
*/

const BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const { table } = require('../../../utils/table')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:eventmetadata:list', { provider: 'debug' })

class EventmetadataListCommand extends BaseCommand {
async run () {
const { args, flags } = await this.parse(EventmetadataListCommand)
try {
await this.initSdk()
cli.action.start('Fetching all Event Metadata for provider')
ux.action.start('Fetching all Event Metadata for provider')
const eventmetadatas = await this.eventClient.getAllEventMetadataForProvider(args.providerId)
cli.action.stop()
ux.action.stop()
if (flags.json) {
this.printJson(eventmetadatas)
} else if (flags.yml) {
Expand All @@ -48,7 +49,7 @@ class EventmetadataListCommand extends BaseCommand {
header: 'DESC'
}
}
cli.table(projects, columns)
table(projects, columns)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

table() defaults to console.log, which bypasses the command’s this.log/stdout handling. Consider passing printLine: this.log.bind(this) so table output flows through the same channel as other command output (and is easier to stub in tests).

Suggested change
table(projects, columns)
table(projects, columns, { printLine: this.log.bind(this) })

Copilot uses AI. Check for mistakes.
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/eventmetadata/update.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 BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const { sentenceValidatorWithMinOneChar } = require('../../../utils/validator')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:eventmetadata:update', { provider: 'debug' })
Expand All @@ -37,9 +37,9 @@ class EventmetadataUpdateCommand extends BaseCommand {
description: response.description
}

cli.action.start('Updating Event Metadata for Provider')
ux.action.start('Updating Event Metadata for Provider')
const eventmetadata = await this.eventClient.updateEventMetadataForProvider(this.conf.org.id, this.conf.project.id, this.conf.workspace.id, args.providerId, args.eventCode, eventMetadataPayload)
cli.action.stop()
ux.action.stop()
if (flags.json) {
this.printJson(eventmetadata)
} else if (flags.yml) {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/provider/create.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 BaseCommand = require('../../../BaseCommand.js')
const { Flags, ux: cli } = require('@oclif/core')
const { Flags, ux } = require('@oclif/core')
const { sentenceValidatorWithMinOneChar, sentenceValidatorWithMinZeroChar } = require('../../../utils/validator')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:provider:create', { provider: 'debug' })
Expand Down Expand Up @@ -40,9 +40,9 @@ class ProviderCreateCommand extends BaseCommand {
docs_url: response.docs_url || undefined
}

cli.action.start('Creating Event Provider')
ux.action.start('Creating Event Provider')
const provider = await this.eventClient.createProvider(this.conf.org.id, this.conf.project.id, this.conf.workspace.id, providerPayload)
cli.action.stop()
ux.action.stop()
if (flags.json) {
this.printJson(provider)
} else if (flags.yml) {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/provider/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 BaseCommand = require('../../../BaseCommand.js')
const { Args, ux: cli } = require('@oclif/core')
const { Args, ux } = require('@oclif/core')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:provider:delete', { provider: 'debug' })

Expand All @@ -28,10 +28,10 @@ class ProviderDeleteCommand extends BaseCommand {

}])
if (response.delete) {
cli.action.start('Deleting Event Provider')
ux.action.start('Deleting Event Provider')
await this.eventClient.deleteProvider(this.conf.org.id,
this.conf.project.id, this.conf.workspace.id, args.providerId)
cli.action.stop()
ux.action.stop()
this.log('Provider ' + args.providerId +
' has been deleted successfully')
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/provider/get.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 BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:provider:get', { provider: 'debug' })

class ProviderGetCommand extends BaseCommand {
Expand All @@ -20,10 +20,10 @@ class ProviderGetCommand extends BaseCommand {

try {
await this.initSdk()
cli.action.start('Fetching the Event Provider')
ux.action.start('Fetching the Event Provider')
const provider = await this.eventClient.getProvider(args.providerId,
flags.fetchEventMetadata)
cli.action.stop()
ux.action.stop()

if (flags.json) {
this.printJson(provider)
Expand Down
9 changes: 5 additions & 4 deletions src/commands/event/provider/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ governing permissions and limitations under the License.
*/

const BaseCommand = require('../../../BaseCommand.js')
const { Flags, ux: cli } = require('@oclif/core')
const { Flags, ux } = require('@oclif/core')
const { table } = require('../../../utils/table')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:provider:list', { provider: 'debug' })

class ProviderListCommand extends BaseCommand {
async run () {
const { flags } = await this.parse(ProviderListCommand)
try {
await this.initSdk()
cli.action.start('Fetching all Event Providers')
ux.action.start('Fetching all Event Providers')
const options = {
fetchEventMetadata: flags.fetchEventMetadata,
filterBy: {
Expand All @@ -29,7 +30,7 @@ class ProviderListCommand extends BaseCommand {
}
}
const providers = await this.eventClient.getAllProviders(this.conf.org.id, options)
cli.action.stop()
ux.action.stop()
if (flags.json) {
this.printJson(providers)
} else if (flags.yml) {
Expand Down Expand Up @@ -61,7 +62,7 @@ class ProviderListCommand extends BaseCommand {
header: 'DOCS'
}
}
cli.table(projects, columns)
table(projects, columns)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

table() defaults to console.log, which bypasses the command’s this.log/stdout handling. For consistency with registration:list (and to make output interception/redirection more predictable), consider passing printLine: this.log.bind(this) here as well.

Suggested change
table(projects, columns)
table(projects, columns, { printLine: this.log.bind(this) })

Copilot uses AI. Check for mistakes.
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/provider/update.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 BaseCommand = require('../../../BaseCommand.js')
const { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const { sentenceValidatorWithMinOneChar, sentenceValidatorWithMinZeroChar } = require('../../../utils/validator')
const inquirer = require('inquirer')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-events:provider:update', { provider: 'debug' })
Expand Down Expand Up @@ -40,9 +40,9 @@ class ProviderUpdateCommand extends BaseCommand {
docs_url: response.docs_url || undefined
}

cli.action.start('Updating the Event Provider')
ux.action.start('Updating the Event Provider')
const provider = await this.eventClient.updateProvider(this.conf.org.id, this.conf.project.id, this.conf.workspace.id, args.providerId, providerPayload)
cli.action.stop()
ux.action.stop()
if (flags.json) {
this.printJson(provider)
} else if (flags.yml) {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/event/registration/create.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 { Args, Flags, ux: cli } = require('@oclif/core')
const { Args, Flags, ux } = require('@oclif/core')
const fs = require('fs')

const BaseCommand = require('../../../BaseCommand')
Expand All @@ -31,9 +31,9 @@ class CreateCommand extends BaseCommand {
// other checks are performed by the server

aioLogger.debug(`create event registration with body ${body}`)
cli.action.start('Creating new Event Registration')
ux.action.start('Creating new Event Registration')
const registration = await this.eventClient.createRegistration(this.conf.org.id, this.conf.project.id, this.conf.workspace.id, body)
cli.action.stop()
ux.action.stop()
aioLogger.debug(`create successful, id: ${registration.registration_id}, name: ${registration.name}`)

if (flags.json) {
Expand Down
Loading
Loading