Skip to content

Commit

Permalink
feat: remove some deprecated fields
Browse files Browse the repository at this point in the history
Companion now sets them to 'default' values, so they are no longer useful
  • Loading branch information
Julusian committed Jan 6, 2024
1 parent 27ea96c commit aabc536
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 64 deletions.
16 changes: 0 additions & 16 deletions src/host-api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ export interface ExecuteActionMessage {

/** Identifier of the surface which triggered this action */
surfaceId: string | undefined

/** @deprecated will be removed in favor of `surfaceId` soon */
deviceId: string | undefined
}

export interface UpdateFeedbackValuesMessage {
Expand Down Expand Up @@ -186,14 +183,6 @@ export interface FeedbackInstance extends FeedbackInstanceBase {
width: number
height: number
}

/** @deprecated */
page: number
/** @deprecated */
bank: number

/** @deprecated */
rawBank: any
}

export interface UpdateConfigAndLabelMessage {
Expand All @@ -217,11 +206,6 @@ export interface ActionInstanceBase {
}
export interface ActionInstance extends ActionInstanceBase {
controlId: string

/** @deprecated */
page: number | null
/** @deprecated */
bank: number | null
}

export interface UpdateActionInstancesMessage {
Expand Down
7 changes: 0 additions & 7 deletions src/internal/__tests__/feedback.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ const feedback: FeedbackInstance = {

controlId: 'control0',
image: undefined,
page: 0,
bank: 0,
rawBank: 'test' as any,
}

const feedbackId2 = 'abc123'
Expand All @@ -43,9 +40,6 @@ const feedback2: FeedbackInstance = {

controlId: 'control1',
image: undefined,
page: 0,
bank: 0,
rawBank: 'test' as any,
}

const unimplementedAsyncFunction = async () => {
Expand Down Expand Up @@ -160,7 +154,6 @@ describe('FeedbackManager', () => {
feedbackId: feedback.feedbackId,
controlId: feedback.controlId,
options: feedback.options,
_rawBank: feedback.rawBank,
},
expect.anything()
)
Expand Down
8 changes: 0 additions & 8 deletions src/internal/__tests__/upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ describe('runThroughUpgradeScripts', () => {
actionId: 'my-action',
options: { a: 1, b: 2 },
controlId: 'control0',
page: null,
bank: null,
}
const action1Before: ActionInstance = {
id: 'act1',
Expand All @@ -159,8 +157,6 @@ describe('runThroughUpgradeScripts', () => {
actionId: 'my-action',
options: { c: 1, d: 2 },
controlId: 'control1',
page: null,
bank: null,
}

const scripts = createMockScripts(2)
Expand Down Expand Up @@ -215,8 +211,6 @@ describe('runThroughUpgradeScripts', () => {
actionId: 'my-action',
options: { a: 1, b: 2 },
controlId: 'control0',
page: null,
bank: null,
}
const action1Before: ActionInstance = {
id: 'act1',
Expand All @@ -225,8 +219,6 @@ describe('runThroughUpgradeScripts', () => {
actionId: 'my-action',
options: { c: 1, d: 2 },
controlId: 'control1',
page: null,
bank: null,
}

const scripts = createMockScripts(2)
Expand Down
10 changes: 1 addition & 9 deletions src/internal/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ export class ActionManager {
controlId: msg.action.controlId,
options: msg.action.options,

surfaceId: msg.surfaceId ?? msg.deviceId,

_deviceId: msg.surfaceId ?? msg.deviceId,
_page: msg.action.page,
_bank: msg.action.bank,
surfaceId: msg.surfaceId,
},
context
)
Expand Down Expand Up @@ -164,10 +160,6 @@ export class ActionManager {
options: msg.action.options,

surfaceId: undefined,

_deviceId: undefined,
_page: msg.action.page,
_bank: msg.action.bank,
},
context
)
Expand Down
4 changes: 0 additions & 4 deletions src/internal/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ export class FeedbackManager {
{
...convertFeedbackInstanceToEvent('boolean', feedback),
type: 'boolean',
_rawBank: feedback.rawBank,
},
context
)
Expand All @@ -304,9 +303,6 @@ export class FeedbackManager {
...convertFeedbackInstanceToEvent('advanced', feedback),
type: 'advanced',
image: feedback.image,
_page: feedback.page,
_bank: feedback.bank,
_rawBank: feedback.rawBank,
},
context
)
Expand Down
3 changes: 1 addition & 2 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export function validateManifest(manifest: ModuleManifest): void {
if (manifestStr.includes('A short one line description of your module'))
throw new Error(`Manifest incorrectly references template module 'A short one line description of your module'`)

if (manifestStr.includes('Your name'))
throw new Error(`Manifest incorrectly references template module 'Your name'`)
if (manifestStr.includes('Your name')) throw new Error(`Manifest incorrectly references template module 'Your name'`)

if (manifestStr.includes('Your email'))
throw new Error(`Manifest incorrectly references template module 'Your email'`)
Expand Down
7 changes: 0 additions & 7 deletions src/module-api/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,4 @@ export interface CompanionActionInfo {
export interface CompanionActionEvent extends CompanionActionInfo {
/** Identifier of the surface which triggered this action */
readonly surfaceId: string | undefined

/** @deprecated use `surfaceId` instead */
readonly _deviceId: string | undefined
/** @deprecated */
readonly _page: number | null
/** @deprecated */
readonly _bank: number | null
}
12 changes: 1 addition & 11 deletions src/module-api/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ export interface CompanionFeedbackInfo {
/**
* Extended information for execution of a boolean feedback
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface CompanionFeedbackBooleanEvent extends CompanionFeedbackInfo {
// readonly type: 'boolean'

/** @deprecated */
readonly _rawBank: any
}

/**
Expand All @@ -57,14 +55,6 @@ export interface CompanionFeedbackAdvancedEvent extends CompanionFeedbackInfo {
readonly width: number
readonly height: number
}

/** @deprecated */
readonly _page: number
/** @deprecated */
readonly _bank: number

/** @deprecated */
readonly _rawBank: any
}

/**
Expand Down

0 comments on commit aabc536

Please sign in to comment.