From aaf97a51f0fa889cee12d9edc12316c9321ec069 Mon Sep 17 00:00:00 2001 From: myarmolinsky Date: Mon, 16 Sep 2024 12:37:07 -0400 Subject: [PATCH] Update `contract` types for API v7 Change-type: patch --- lib/release/api.ts | 4 ++-- lib/release/models.ts | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/release/api.ts b/lib/release/api.ts index e6d796f..f79e217 100644 --- a/lib/release/api.ts +++ b/lib/release/api.ts @@ -67,8 +67,8 @@ export interface Request { */ semver?: string; - /** 'balena.yml' contract contents (stringified JSON) */ - contract?: string; + /** 'balena.yml' contract contents */ + contract?: models.JsonType; } export interface Response { diff --git a/lib/release/models.ts b/lib/release/models.ts index 0bc1de6..dddda1e 100644 --- a/lib/release/models.ts +++ b/lib/release/models.ts @@ -4,6 +4,12 @@ import * as errors from './errors'; // These interfaces declare all model attributes except relations. +interface AnyObject { + [index: string]: any; +} + +export type JsonType = AnyObject; + interface ServiceAttributesBase { service_name: string; } @@ -15,7 +21,7 @@ interface ReleaseAttributesBase { source: string; start_timestamp: Date; end_timestamp?: Date; - contract?: string; + contract?: JsonType; } // eslint-disable-next-line @typescript-eslint/no-empty-interface