Skip to content

Commit

Permalink
Add monogram to organisation model for testing file-upload
Browse files Browse the repository at this point in the history
Change-Type: patch
Signed-off-by: Nitish Agarwal <[email protected]>
  • Loading branch information
nitishagar committed Jan 29, 2023
1 parent 9864a1b commit 591cda8
Show file tree
Hide file tree
Showing 7 changed files with 8,149 additions and 12,033 deletions.
2 changes: 2 additions & 0 deletions config/confd/templates/env.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ TOKEN_AUTH_CERT_KEY='{{getenv "TOKEN_AUTH_CERT_KEY"}}'
TOKEN_AUTH_CERT_KID='{{getenv "TOKEN_AUTH_CERT_KID"}}'
TOKEN_AUTH_CERT_PUB='{{getenv "TOKEN_AUTH_CERT_PUB"}}'
TOKEN_AUTH_JWT_ALGO='{{getenv "TOKEN_AUTH_JWT_ALGO"}}'
PINEJS_MAX_FILE_SIZE='{{getenv "PINEJS_MAX_FILE_SIZE"}}'
PINEJS_STORAGE_ENGINE=S3
TRANSACTION_TIMEOUT_MS=30000
UV_THREADPOOL_SIZE=128
VPN_HOST={{getenv "VPN_HOST"}}
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.test-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ services:
BLUEBIRD_LONG_STACK_TRACES: 0
COOKIE_SESSION_SECRET: fuschia
DATABASE_URL: postgres://docker:docker@db:5432/postgres
PINEJS_MAX_FILE_SIZE: 10485760
PINEJS_STORAGE_ENGINE: S3
DEBUG:
DELTA_HOST: delta_host.com
DEVICE_CONFIG_OPENVPN_CA: 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNXRENDQWNHZ0F3SUJBZ0lKQVBTeHZhSG5zanVpTUEwR0NTcUdTSWIzRFFFQkJRVUFNRVV4Q3pBSkJnTlYKQkFZVEFrRlZNUk13RVFZRFZRUUlEQXBUYjIxbExWTjBZWFJsTVNFd0h3WURWUVFLREJoSmJuUmxjbTVsZENCWAphV1JuYVhSeklGQjBlU0JNZEdRd0hoY05NVE14TWpFeU1UUTBOelUyV2hjTk1qTXhNakV3TVRRME56VTJXakJGCk1Rc3dDUVlEVlFRR0V3SkJWVEVUTUJFR0ExVUVDQXdLVTI5dFpTMVRkR0YwWlRFaE1COEdBMVVFQ2d3WVNXNTAKWlhKdVpYUWdWMmxrWjJsMGN5QlFkSGtnVEhSa01JR2ZNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0R05BRENCaVFLQgpnUURsTXZRMmp1WnJ6WFJxV3BYN3Q0RlhYTGw0RzhuY05UMXYyTW1UM3BwNnVGNG5rVkd1UjRZdFczYmlwQ0thClRYRnZ5aFp1eEUvN2ZKWUdoYWZNV1pzMjZrUHQ3dnNtaVRSRUVHQytCSHFOUWIwd0ltckxaT0syVzk3R2R1U2UKZThuWmNXU0MzWjhVQ1hSQkg3WmtzNHphRndodGNnZ3ZkSi9Qdzl3MTJ0Tkl6UUlEQVFBQm8xQXdUakFkQmdOVgpIUTRFRmdRVVU0V3FYMmZMeDdnVTJRcFF2VkgwblpOUXNSWXdId1lEVlIwakJCZ3dGb0FVVTRXcVgyZkx4N2dVCjJRcFF2VkgwblpOUXNSWXdEQVlEVlIwVEJBVXdBd0VCL3pBTkJna3Foa2lHOXcwQkFRVUZBQU9CZ1FBWWhUTWQKUHNDQ3hIbHFCak91c3dQNlBZT2c1TXo1QXFnNzBaWmZoTGpFV3lvU0VzclZKTTRlcyt4cnRIQUl0VDI4QXhreQpSUE43cnpMc2QzR2lIOWE2V3phZU5kcFdkWU1TaTMrTnJOYmtPU3ZuTmhHeHUvUUhiMEx0bWV0eHBENlNERmZQCkoxMUVuTjM0dldHMUpCWUh2NVNvditFOTkzclJKdkU0VUV1bFpRPT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo='
Expand Down
20,133 changes: 8,107 additions & 12,026 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\""
},
"dependencies": {
"@balena/abstract-sql-compiler": "^7.25.3",
"@balena/abstract-sql-compiler": "7.24.1-build-web-resource-2-924b6a699f0e50a1ecd787695879418e54671abd-1",
"@balena/env-parsing": "^1.1.5",
"@balena/es-version": "^1.0.2",
"@balena/node-metrics-gatherer": "^6.0.3",
"@balena/pinejs": "^14.57.2",
"@balena/pinejs": "14.54.8-build-web-resource-2-6b3e0e820e9e0914ec6226c0453f64a264876297-1",
"@sentry/node": "^7.31.1",
"@types/basic-auth": "^1.1.3",
"@types/bluebird": "^3.5.38",
Expand Down
33 changes: 33 additions & 0 deletions src/balena-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface Permission {
is_of__user?: UserHasPermission[];
is_of__api_key?: ApiKeyHasPermission[];
user__has__permission?: UserHasPermission[];
user_permission?: UserHasPermission[];
}

export interface Role {
Expand All @@ -40,6 +41,7 @@ export interface Role {
name: string;
role__has__permission?: RoleHasPermission[];
user__has__role?: UserHasRole[];
user_role?: UserHasRole[];
is_of__user?: UserHasRole[];
is_of__api_key?: ApiKeyHasRole[];
}
Expand All @@ -62,9 +64,13 @@ export interface User {
jwt_secret: string | null;
email: string | null;
user__has__role?: UserHasRole[];
user_role?: UserHasRole[];
user__has__permission?: UserHasPermission[];
user_permission?: UserHasPermission[];
user__has__public_key?: UserHasPublicKey[];
user_public_key?: UserHasPublicKey[];
user__is_member_of__organization?: OrganizationMembership[];
organization_membership?: OrganizationMembership[];
is_member_of__organization?: OrganizationMembership[];
has_direct_access_to__application?: UserHasDirectAccessToApplication[];
}
Expand Down Expand Up @@ -186,6 +192,7 @@ export interface DeviceType {
is_default_for__application?: Application[];
describes__device?: Device[];
device_type__is_referenced_by__alias?: DeviceTypeAlias[];
device_type_alias?: DeviceTypeAlias[];
is_referenced_by__alias?: DeviceTypeAlias[];
}

Expand All @@ -207,10 +214,13 @@ export interface Image {
content_hash: string | null;
contract: {} | null;
device__installs__image?: ImageInstall[];
image_install?: ImageInstall[];
is_installed_on__device?: ImageInstall[];
is_downloaded_by__device?: GatewayDownload[];
image__is_downloaded_by__device?: GatewayDownload[];
gateway_download?: GatewayDownload[];
image__is_part_of__release?: ImageIsPartOfRelease[];
release_image?: ImageIsPartOfRelease[];
is_part_of__release?: ImageIsPartOfRelease[];
}

Expand All @@ -221,6 +231,7 @@ export interface Organization {
name: string;
handle: string;
user__is_member_of__organization?: OrganizationMembership[];
organization_membership?: OrganizationMembership[];
includes__user?: OrganizationMembership[];
application?: Application[];
}
Expand Down Expand Up @@ -254,9 +265,13 @@ export interface Application {
uuid: string;
is_public: boolean;
application__has__env_var_name?: ApplicationEnvironmentVariable[];
application_environment_variable?: ApplicationEnvironmentVariable[];
application__has__config_var_name?: ApplicationConfigVariable[];
application_config_variable?: ApplicationConfigVariable[];
application__has__service_name?: Service[];
service?: Service[];
application__has__tag_key?: ApplicationTag[];
application_tag?: ApplicationTag[];
is_depended_on_by__application?: Application[];
owns__device?: Device[];
owns__release?: Release[];
Expand Down Expand Up @@ -288,8 +303,11 @@ export interface Service {
service_name: string;
id: number;
application__has__service_name__has__label_name?: ServiceLabel[];
service_label?: ServiceLabel[];
application__has__service_name__has__name?: ServiceEnvironmentVariable[];
service_environment_variable?: ServiceEnvironmentVariable[];
device__installs__application__has__service_name?: ServiceInstall[];
service_install?: ServiceInstall[];
is_installed_on__device?: ServiceInstall[];
is_built_by__image?: Image[];
}
Expand Down Expand Up @@ -371,13 +389,19 @@ export interface Device {
overall_status: string | null;
overall_progress: number | null;
device__has__env_var_name?: DeviceEnvironmentVariable[];
device_environment_variable?: DeviceEnvironmentVariable[];
device__has__config_var_name?: DeviceConfigVariable[];
device_config_variable?: DeviceConfigVariable[];
device__has__tag_key?: DeviceTag[];
device_tag?: DeviceTag[];
device__installs__image?: ImageInstall[];
image_install?: ImageInstall[];
device__installs__application__has__service_name?: ServiceInstall[];
service_install?: ServiceInstall[];
installs__image?: ImageInstall[];
installs__application__has__service_name?: ServiceInstall[];
image__is_downloaded_by__device?: GatewayDownload[];
gateway_download?: GatewayDownload[];
downloads__image?: GatewayDownload[];
manages__device?: Device[];
}
Expand Down Expand Up @@ -419,6 +443,7 @@ export interface ServiceInstall {
installs__service: { __id: number } | [Service];
id: number;
device__installs__application__has__service_name__has__name?: DeviceServiceEnvironmentVariable[];
device_service_environment_variable?: DeviceServiceEnvironmentVariable[];
}

export interface DeviceServiceEnvironmentVariable {
Expand Down Expand Up @@ -473,7 +498,9 @@ export interface Release {
raw_version: string;
version: {};
release__has__tag_key?: ReleaseTag[];
release_tag?: ReleaseTag[];
image__is_part_of__release?: ImageIsPartOfRelease[];
release_image?: ImageIsPartOfRelease[];
contains__image?: ImageIsPartOfRelease[];
should_be_running_on__application?: Application[];
should_be_running_on__device?: Device[];
Expand Down Expand Up @@ -509,7 +536,9 @@ export interface ImageIsPartOfRelease {
is_part_of__release: { __id: number } | [Release];
id: number;
image__is_part_of__release__has__label_name?: ImageLabel[];
image_label?: ImageLabel[];
image__is_part_of__release__has__name?: ImageEnvironmentVariable[];
image_environment_variable?: ImageEnvironmentVariable[];
}

export interface ImageLabel {
Expand Down Expand Up @@ -574,9 +603,13 @@ export interface MyApplication {
uuid: string;
is_public: boolean;
application__has__env_var_name?: ApplicationEnvironmentVariable[];
application_environment_variable?: ApplicationEnvironmentVariable[];
application__has__config_var_name?: ApplicationConfigVariable[];
application_config_variable?: ApplicationConfigVariable[];
application__has__service_name?: Service[];
service?: Service[];
application__has__tag_key?: ApplicationTag[];
application_tag?: ApplicationTag[];
is_depended_on_by__application?: Application[];
owns__device?: Device[];
owns__release?: Release[];
Expand Down
2 changes: 0 additions & 2 deletions src/balena.sbvr
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ Term: version
Term: vpn address
Concept Type: Short Text (Type)


-- Complex terms

Term: application type
Expand Down Expand Up @@ -434,7 +433,6 @@ Fact type: organization has handle
Necessity: each handle is of exactly one organization.
Necessity: each handle of an organization, has a Length (Type) that is greater than 0.


-- user

Fact type: user (Auth) has email
Expand Down
6 changes: 3 additions & 3 deletions src/infra/redis/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const getRedisOptions = ({
retryStrategy: redisRetryStrategy,
enableOfflineQueue: false,
enableAutoPipelining,
// @ts-expect-error - `keepAlive` is actually used as `initialDelay` which is a number as the typings say
// but it clashes with the socket keepAlive option which is a boolean, this probably
// needs updated ioredis typings
// `keepAlive` is actually used as `initialDelay` which is a number as the typings say
// but it clashes with the socket keepAlive option which is a boolean, this probably
// needs updated ioredis typings
keepAlive: 0,
};

Expand Down

0 comments on commit 591cda8

Please sign in to comment.