diff --git a/packages/base/command.gts b/packages/base/command.gts index d79224ba87..b8bfb6b07e 100644 --- a/packages/base/command.gts +++ b/packages/base/command.gts @@ -60,8 +60,8 @@ export class CopyCardResult extends CardDef { } export class CopySourceInput extends CardDef { - @field fromRealmUrl = contains(StringField); - @field toRealmUrl = contains(StringField); + @field originSourceUrl = contains(StringField); + @field destinationSourceUrl = contains(StringField); } export class CopySourceResult extends CardDef { diff --git a/packages/host/app/commands/copy-source.ts b/packages/host/app/commands/copy-source.ts index f36e934b02..0ccb4156df 100644 --- a/packages/host/app/commands/copy-source.ts +++ b/packages/host/app/commands/copy-source.ts @@ -20,14 +20,17 @@ export default class CopySourceCommand extends HostBaseCommand< return CopySourceInput; } - requireInputFields = ['fromRealmUrl', 'toRealmUrl']; + requireInputFields = ['originSourceUrl', 'destinationSourceUrl']; protected async run( input: BaseCommandModule.CopySourceInput, ): Promise { - const fromRealmUrl = new URL(input.fromRealmUrl); - const toRealmUrl = new URL(input.toRealmUrl); - let r = await this.cardService.copySource(fromRealmUrl, toRealmUrl); + const originSourceUrl = new URL(input.originSourceUrl); + const destinationSourceUrl = new URL(input.destinationSourceUrl); + let r = await this.cardService.copySource( + originSourceUrl, + destinationSourceUrl, + ); let commandModule = await this.loadCommandModule(); const { CopySourceResult } = commandModule; if (r.ok && r.url) { diff --git a/packages/host/tests/integration/commands/copy-source-test.gts b/packages/host/tests/integration/commands/copy-source-test.gts index 0ab7f698bb..a765b62e8c 100644 --- a/packages/host/tests/integration/commands/copy-source-test.gts +++ b/packages/host/tests/integration/commands/copy-source-test.gts @@ -62,15 +62,15 @@ module('Integration | commands | copy-source', function (hooks) { let copySourceCommand = new CopySourceCommand( commandService.commandContext, ); - const fromRealmUrl = testRealmURL + 'person.gts'; - const toRealmUrl = testRealmURL + 'person-copy.gts'; + const originSourceUrl = testRealmURL + 'person.gts'; + const destinationSourceUrl = testRealmURL + 'person-copy.gts'; await copySourceCommand.execute({ - fromRealmUrl, - toRealmUrl, + originSourceUrl, + destinationSourceUrl, }); - let personResponse = await fetch(new URL(fromRealmUrl)); + let personResponse = await fetch(new URL(originSourceUrl)); let personContent = await personResponse.text(); - let personCopyResponse = await fetch(new URL(toRealmUrl)); + let personCopyResponse = await fetch(new URL(destinationSourceUrl)); let personCopyContent = await personCopyResponse.text(); assert.strictEqual(personCopyContent, personContent);