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 9, 2023
1 parent dde3a13 commit 081acbc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@
"balena-auth": "^5.0.0",
"balena-errors": "^4.8.0",
"balena-hup-action-utils": "~5.0.0",
"balena-register-device": "^8.0.7",
"balena-request": "^12.0.2",
"balena-register-device": "8.0.8-build-oj-test-deploy-with-new-balena-request-60c0867d3c634ad0e48f8769a4ddf50cc5f498bf-1",
"balena-request": "12.1.0-build-otaviojacobi-does-multipart-form-when-blob-is-present-49219e9755546df6cd34c6404af9d88abc559389-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 081acbc

Please sign in to comment.