Skip to content

Commit

Permalink
BREAKING config.getAll: Remove the missed deprecated deviceTypes prop…
Browse files Browse the repository at this point in the history
…erty

Change-type: patch
  • Loading branch information
thgreasi committed Jan 15, 2025
1 parent 4339670 commit 886bf9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export interface Config {
recurlyPublicKey?: string;
stripePublicKey?: string;
freezeBillingVersions?: string[];
/** @deprecated Will be removed in a future API version. */
deviceTypes?: DeviceTypeJson.DeviceType[];
DEVICE_ONLINE_ICON: string;
DEVICE_OFFLINE_ICON: string;
signupCodeRequired: boolean;
Expand Down Expand Up @@ -107,7 +105,9 @@ const getConfigModel = function (
baseUrl: apiUrl,
sendToken: false,
});
body.deviceTypes = normalizeDeviceTypes(body.deviceTypes);
if ('deviceTypes' in body) {
delete body.deviceTypes;
}
return body;
},

Expand Down
20 changes: 3 additions & 17 deletions tests/integration/models/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,10 @@ describe('Config Model', function () {
});
});

it('should include the deviceTypes', async function () {
const { deviceTypes } = await balena.models.config.getAll();
if (deviceTypes == null) {
this.skip();
return;
}
expectDeviceTypeArray(deviceTypes);
});
});

describe('device type normalization', function () {
before(function () {
return balena.models.config.getAll().then(({ deviceTypes }) => {
this.deviceTypes = deviceTypes;
});
it('should not include the deviceTypes', async function () {
const config = await balena.models.config.getAll();
expect(config).to.not.have.property('deviceTypes');
});

itNormalizesDeviceTypes();
});
});

Expand Down

0 comments on commit 886bf9d

Please sign in to comment.