Skip to content

Commit

Permalink
Rename getDeviceOnboardingToken to createDeviceOnboardingToken (#373)
Browse files Browse the repository at this point in the history
* refactor: rename getDeviceOnboardingToken to createDeviceOnboardingToken

* chore: update usages
  • Loading branch information
jkoenig134 authored Dec 18, 2024
1 parent b44bcaf commit 6bd9be2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe("AppStringProcessor", function () {

test("device onboarding with a password protected Token", async function () {
const deviceResult = await runtime1Session.transportServices.devices.createDevice({});
const tokenResult = await runtime1Session.transportServices.devices.getDeviceOnboardingToken({
const tokenResult = await runtime1Session.transportServices.devices.createDeviceOnboardingToken({
id: deviceResult.value.id,
passwordProtection: { password: "password" }
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class DevicesFacade {
@Inject private readonly updateDeviceUseCase: UpdateDeviceUseCase,
@Inject private readonly deleteDeviceUseCase: DeleteDeviceUseCase,
@Inject private readonly getDeviceOnboardingInfoUseCase: GetDeviceOnboardingInfoUseCase,
@Inject private readonly getDeviceOnboardingTokenUseCase: CreateDeviceOnboardingTokenUseCase,
@Inject private readonly createDeviceOnboardingTokenUseCase: CreateDeviceOnboardingTokenUseCase,
@Inject private readonly setCommunicationLanguageUseCase: SetCommunicationLanguageUseCase
) {}

Expand All @@ -47,8 +47,8 @@ export class DevicesFacade {
return await this.getDeviceOnboardingInfoUseCase.execute(request);
}

public async getDeviceOnboardingToken(request: CreateDeviceOnboardingTokenRequest): Promise<Result<TokenDTO, ApplicationError>> {
return await this.getDeviceOnboardingTokenUseCase.execute(request);
public async createDeviceOnboardingToken(request: CreateDeviceOnboardingTokenRequest): Promise<Result<TokenDTO, ApplicationError>> {
return await this.createDeviceOnboardingTokenUseCase.execute(request);
}

public async updateDevice(request: UpdateDeviceRequest): Promise<Result<DeviceDTO, ApplicationError>> {
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/test/transport/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe("LoadItemFromTruncatedReference", () => {
});

test("loads the DeviceOnboardingInfo with the truncated reference", async () => {
const deviceOnboardingInfoReference = (await sTransportServices.devices.getDeviceOnboardingToken({ id: device.id })).value.truncatedReference;
const deviceOnboardingInfoReference = (await sTransportServices.devices.createDeviceOnboardingToken({ id: device.id })).value.truncatedReference;

const result = await sTransportServices.account.loadItemFromTruncatedReference({ reference: deviceOnboardingInfoReference });

Expand All @@ -176,7 +176,7 @@ describe("LoadItemFromTruncatedReference", () => {

test("loads the DeviceOnboardingInfo with the truncated reference including a profile name", async () => {
const profileName = "aProfileName";
const deviceOnboardingInfoReference = (await sTransportServices.devices.getDeviceOnboardingToken({ id: device.id, profileName })).value.truncatedReference;
const deviceOnboardingInfoReference = (await sTransportServices.devices.createDeviceOnboardingToken({ id: device.id, profileName })).value.truncatedReference;

const result = await sTransportServices.account.loadItemFromTruncatedReference({ reference: deviceOnboardingInfoReference });

Expand Down

0 comments on commit 6bd9be2

Please sign in to comment.