Skip to content

Commit

Permalink
Merge branch 'master' into ts-portal-auth-store
Browse files Browse the repository at this point in the history
  • Loading branch information
aptkingston authored Dec 17, 2024
2 parents f9dc834 + a873fa7 commit 1efa9f1
Show file tree
Hide file tree
Showing 52 changed files with 283 additions and 126 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/budibase_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -47,7 +47,7 @@ jobs:
- run: yarn lint

build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
fi
helm-lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -88,7 +88,7 @@ jobs:
- run: cd charts/budibase && helm lint .

test-libraries:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
fi
test-worker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
yarn test --verbose --reporters=default --reporters=github-actions
test-server:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
datasource:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
yarn test --filter $FILTER --verbose --reporters=default --reporters=github-actions
check-pro-submodule:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase')
steps:
- name: Checkout repo and submodules
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
fi
check-lockfile:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase')
steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "3.2.28",
"version": "3.2.29",
"npmClient": "yarn",
"concurrency": 20,
"command": {
Expand Down
3 changes: 1 addition & 2 deletions packages/bbui/src/Layout/Page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
flex-direction: row;
justify-content: flex-start;
align-items: stretch;
overflow-y: scroll !important;
flex: 1 1 auto;
overflow-x: hidden;
}
.main {
overflow: auto;
overflow-y: scroll;
}
.content {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}
try {
const app = await API.duplicateApp(data, appId)
const app = await API.duplicateApp(appId, data)
appsStore.load()
if (!sdk.users.isBuilder($auth.user, app?.duplicateAppId)) {
// Refresh for access to created applications
Expand Down
5 changes: 2 additions & 3 deletions packages/builder/src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ a {
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--spectrum-alias-background-color-default);
background: transparent;
}
::-webkit-scrollbar-thumb {
background-color: var(--spectrum-global-color-gray-400);
Expand All @@ -71,6 +71,5 @@ a {
background: var(--spectrum-alias-background-color-default);
}
html * {
scrollbar-color: var(--spectrum-global-color-gray-400)
var(--spectrum-alias-background-color-default);
scrollbar-color: var(--spectrum-global-color-gray-400) transparent;
}
2 changes: 1 addition & 1 deletion packages/builder/src/stores/portal/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function createPluginsStore() {
const { subscribe, set, update } = writable<Plugin[]>([])

async function load() {
const plugins = (await API.getPlugins()) as Plugin[]
const plugins: Plugin[] = await API.getPlugins()
set(plugins)
}

Expand Down
11 changes: 7 additions & 4 deletions packages/frontend-core/src/api/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { BaseAPIClient } from "./types"
import { AnalyticsEnabledResponse, AnalyticsPingRequest } from "@budibase/types"
import {
AnalyticsEnabledResponse,
AnalyticsPingRequest,
AnalyticsPingResponse,
} from "@budibase/types"

export interface AnalyticsEndpoints {
getAnalyticsStatus: () => Promise<AnalyticsEnabledResponse>
analyticsPing: (
payload: Omit<AnalyticsPingRequest, "timezone">
) => Promise<void>
) => Promise<AnalyticsPingResponse>
}

export const buildAnalyticsEndpoints = (
Expand All @@ -24,13 +28,12 @@ export const buildAnalyticsEndpoints = (
* Notifies analytics of a certain environment
*/
analyticsPing: async request => {
return await API.post<AnalyticsPingRequest>({
return await API.post<AnalyticsPingRequest, AnalyticsPingResponse>({
url: "/api/bbtel/ping",
body: {
...request,
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
},
parseResponse: () => undefined,
})
},
})
14 changes: 10 additions & 4 deletions packages/frontend-core/src/api/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { sdk } from "@budibase/shared-core"
import { BaseAPIClient } from "./types"
import {
AddAppSampleDataResponse,
ClearDevLockResponse,
CreateAppRequest,
CreateAppResponse,
Expand All @@ -18,7 +19,9 @@ import {
RevertAppClientResponse,
RevertAppResponse,
SetRevertableAppVersionRequest,
SetRevertableAppVersionResponse,
SyncAppResponse,
UnpublishAppResponse,
UpdateAppClientResponse,
UpdateAppRequest,
UpdateAppResponse,
Expand All @@ -30,7 +33,7 @@ export interface AppEndpoints {
appId: string,
metadata: UpdateAppRequest
) => Promise<UpdateAppResponse>
unpublishApp: (appId: string) => Promise<void>
unpublishApp: (appId: string) => Promise<UnpublishAppResponse>
publishAppChanges: (appId: string) => Promise<PublishAppResponse>
revertAppChanges: (appId: string) => Promise<RevertAppResponse>
updateAppClientVersion: (appId: string) => Promise<UpdateAppClientResponse>
Expand All @@ -56,8 +59,8 @@ export interface AppEndpoints {
setRevertableVersion: (
appId: string,
revertableVersion: string
) => Promise<void>
addSampleData: (appId: string) => Promise<void>
) => Promise<SetRevertableAppVersionResponse>
addSampleData: (appId: string) => Promise<AddAppSampleDataResponse>

// Missing request or response types
importApps: (apps: any) => Promise<any>
Expand Down Expand Up @@ -272,7 +275,10 @@ export const buildAppEndpoints = (API: BaseAPIClient): AppEndpoints => ({
* @param revertableVersion the version number
*/
setRevertableVersion: async (appId, revertableVersion) => {
return await API.post<SetRevertableAppVersionRequest>({
return await API.post<
SetRevertableAppVersionRequest,
SetRevertableAppVersionResponse
>({
url: `/api/applications/${appId}/setRevertableVersion`,
body: {
revertableVersion,
Expand Down
13 changes: 9 additions & 4 deletions packages/frontend-core/src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import {
GetInitInfoResponse,
LoginRequest,
LoginResponse,
LogoutResponse,
PasswordResetRequest,
PasswordResetResponse,
PasswordResetUpdateRequest,
PasswordResetUpdateResponse,
SetInitInfoRequest,
SetInitInfoResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types"

export interface AuthEndpoints {
logIn: (tenantId: string, username: string, password: string) => Promise<void>
logIn: (
tenantId: string,
username: string,
password: string
) => Promise<LoginResponse>
logOut: () => Promise<LogoutResponse>
requestForgotPassword: (
tenantId: string,
Expand All @@ -22,7 +28,7 @@ export interface AuthEndpoints {
password: string,
resetCode: string
) => Promise<PasswordResetUpdateResponse>
setInitInfo: (info: SetInitInfoRequest) => Promise<void>
setInitInfo: (info: SetInitInfoRequest) => Promise<SetInitInfoResponse>
getInitInfo: () => Promise<GetInitInfoResponse>
}

Expand All @@ -34,13 +40,12 @@ export const buildAuthEndpoints = (API: BaseAPIClient): AuthEndpoints => ({
* @param password the password
*/
logIn: async (tenantId, username, password) => {
return await API.post<LoginRequest>({
return await API.post<LoginRequest, LoginResponse>({
url: `/api/global/auth/${tenantId}/login`,
body: {
username,
password,
},
parseResponse: () => undefined,
})
},

Expand Down
11 changes: 8 additions & 3 deletions packages/frontend-core/src/api/environmentVariables.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {
CreateEnvironmentVariableRequest,
CreateEnvironmentVariableResponse,
DeleteEnvironmentVariablesResponse,
GetEnvironmentVariablesResponse,
StatusEnvironmentVariableResponse,
UpdateEnvironmentVariableRequest,
UpdateEnvironmentVariableResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types"

Expand All @@ -11,12 +14,14 @@ export interface EnvironmentVariableEndpoints {
fetchEnvironmentVariables: () => Promise<GetEnvironmentVariablesResponse>
createEnvironmentVariable: (
data: CreateEnvironmentVariableRequest
) => Promise<void>
deleteEnvironmentVariable: (name: string) => Promise<void>
) => Promise<CreateEnvironmentVariableResponse>
deleteEnvironmentVariable: (
name: string
) => Promise<DeleteEnvironmentVariablesResponse>
updateEnvironmentVariable: (
name: string,
data: UpdateEnvironmentVariableRequest
) => Promise<void>
) => Promise<UpdateEnvironmentVariableResponse>
}

export const buildEnvironmentVariableEndpoints = (
Expand Down
10 changes: 7 additions & 3 deletions packages/frontend-core/src/api/events.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { EventPublishType, PostEventPublishRequest } from "@budibase/types"
import {
EventPublishType,
PostEventPublishRequest,
PostEventPublishResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types"

export interface EventEndpoints {
publishEvent: (type: EventPublishType) => Promise<void>
publishEvent: (type: EventPublishType) => Promise<PostEventPublishResponse>
}

export const buildEventEndpoints = (API: BaseAPIClient): EventEndpoints => ({
publishEvent: async type => {
return await API.post<PostEventPublishRequest>({
return await API.post<PostEventPublishRequest, PostEventPublishResponse>({
url: `/api/global/event/publish`,
body: {
type,
Expand Down
21 changes: 15 additions & 6 deletions packages/frontend-core/src/api/licensing.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import {
ActivateLicenseKeyRequest,
ActivateLicenseKeyResponse,
ActivateOfflineLicenseTokenRequest,
ActivateOfflineLicenseTokenResponse,
GetLicenseKeyResponse,
GetOfflineIdentifierResponse,
GetOfflineLicenseTokenResponse,
QuotaUsage,
RefreshOfflineLicenseResponse,
} from "@budibase/types"
import { BaseAPIClient } from "./types"

export interface LicensingEndpoints {
activateLicenseKey: (licenseKey: string) => Promise<void>
activateLicenseKey: (
licenseKey: string
) => Promise<ActivateLicenseKeyResponse>
deleteLicenseKey: () => Promise<void>
getLicenseKey: () => Promise<GetLicenseKeyResponse | void>
activateOfflineLicense: (offlineLicenseToken: string) => Promise<void>
activateOfflineLicense: (
offlineLicenseToken: string
) => Promise<ActivateOfflineLicenseTokenResponse>
deleteOfflineLicense: () => Promise<void>
getOfflineLicense: () => Promise<GetOfflineLicenseTokenResponse | void>
getOfflineLicenseIdentifier: () => Promise<GetOfflineIdentifierResponse>
refreshLicense: () => Promise<void>
refreshLicense: () => Promise<RefreshOfflineLicenseResponse>
getQuotaUsage: () => Promise<QuotaUsage>
}

Expand All @@ -25,7 +32,7 @@ export const buildLicensingEndpoints = (
): LicensingEndpoints => ({
// LICENSE KEY
activateLicenseKey: async licenseKey => {
return API.post<ActivateLicenseKeyRequest>({
return API.post<ActivateLicenseKeyRequest, ActivateLicenseKeyResponse>({
url: `/api/global/license/key`,
body: { licenseKey },
})
Expand All @@ -49,7 +56,10 @@ export const buildLicensingEndpoints = (

// OFFLINE LICENSE
activateOfflineLicense: async offlineLicenseToken => {
return API.post<ActivateOfflineLicenseTokenRequest>({
return API.post<
ActivateOfflineLicenseTokenRequest,
ActivateOfflineLicenseTokenResponse
>({
url: "/api/global/license/offline",
body: {
offlineLicenseToken,
Expand Down Expand Up @@ -84,7 +94,6 @@ export const buildLicensingEndpoints = (
refreshLicense: async () => {
return API.post({
url: "/api/global/license/refresh",
parseResponse: () => undefined,
})
},
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/pro
Submodule pro updated from e7c9f0 to 7fc699
Loading

0 comments on commit 1efa9f1

Please sign in to comment.