Skip to content

Commit

Permalink
Add organization logo to organization
Browse files Browse the repository at this point in the history
Change-type: minor
  • Loading branch information
otaviojacobi committed Aug 8, 2023
1 parent dde3a13 commit 44d4ad6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"balena-errors": "^4.8.0",
"balena-hup-action-utils": "~5.0.0",
"balena-register-device": "^8.0.7",
"balena-request": "^12.0.2",
"balena-request": "12.1.0-build-otaviojacobi-does-multipart-form-when-blob-is-present-c55aae989843200f9a73b9e5a84c42643c31767d-1",
"balena-semver": "^2.3.0",
"balena-settings-client": "^5.0.0",
"date-fns": "^2.29.3",
Expand Down
2 changes: 2 additions & 0 deletions src/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
OptionalNavigationResource,
ReverseNavigationResource,
ConceptTypeNavigationResource,
WebResource,
} from '../../typings/pinejs-client-core';
import type { AnyObject } from '../../typings/utils';

Expand Down Expand Up @@ -82,6 +83,7 @@ export interface Organization {
handle: string;
has_past_due_invoice_since__date: string | null;
is_frozen: boolean;
logo_image: WebResource;

application: ReverseNavigationResource<Application>;
/** includes__organization_membership */
Expand Down
13 changes: 12 additions & 1 deletion typings/pinejs-client-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ export type PostResult<T> = SelectResultObject<
Exclude<StringKeyof<T>, PropsOfType<T, ReverseNavigationResource<{}>>>
>;

export type WebResource = {
filename: string;
href: string;
contentType?: string;
contentDisposition?: string;
size?: number;
};

// based on https://github.com/balena-io/pinejs-client-js/blob/master/core.d.ts

type RawFilter =
Expand Down Expand Up @@ -378,8 +386,11 @@ export type ODataOptionsStrict<T> = Omit<
export type ODataOptionsWithFilter<T> = ODataOptions<T> &
Required<Pick<ODataOptions<T>, '$filter'>>;

export type ReplaceWebResource<K> = K extends WebResource ? Blob : K;
export type SubmitBody<T> = {
[k in keyof T]?: T[k] extends AssociatedResource<{}> ? number | null : T[k];
[k in keyof T]?: T[k] extends AssociatedResource<{}>
? number | null
: ReplaceWebResource<T[k]>;
};

type BaseResourceId =
Expand Down

0 comments on commit 44d4ad6

Please sign in to comment.