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 Oct 5, 2023
1 parent 2938975 commit dd434a4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
"balena-auth": "^5.1.0",
"balena-errors": "^4.8.0",
"balena-hup-action-utils": "~5.0.0",
"balena-register-device": "^8.0.7",
"balena-request": "^12.0.4",
"balena-register-device": "8.0.8-build-oj-test-deploy-with-new-balena-request-0ac48d85cd5e13b2b070bcc0dde0bffe69462932-1",
"balena-request": "12.1.0-build-otaviojacobi-does-multipart-form-when-blob-is-present-4393908d872d57fc6258663d76107cbbc4b39016-3",
"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 @@ -83,6 +84,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
11 changes: 10 additions & 1 deletion typings/pinejs-client-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ export type PostResult<T> = SelectResultObject<
Exclude<StringKeyof<T>, PropsOfType<T, ReverseNavigationResource<object>>>
>;

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 @@ -379,10 +387,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<object>
? number | null
: T[k];
: ReplaceWebResource<T[k]>;
};

type BaseResourceId =
Expand Down

0 comments on commit dd434a4

Please sign in to comment.