@budibase/pro 2.6.19-alpha.14 → 2.6.19-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/dist/package.json +5 -5
- package/dist/src/api/controllers/apps/backups.d.ts +7 -0
- package/dist/src/api/controllers/global/auditLogs.d.ts +6 -0
- package/dist/src/api/controllers/global/environmentVariables.d.ts +6 -0
- package/dist/src/api/controllers/global/groups.d.ts +10 -0
- package/dist/src/api/controllers/global/index.d.ts +2 -0
- package/dist/src/api/controllers/global/scim/groups.d.ts +5 -0
- package/dist/src/api/controllers/global/scim/users.d.ts +5 -0
- package/dist/src/api/controllers/schedules/index.d.ts +9 -0
- package/dist/src/api/errors.d.ts +4 -0
- package/dist/src/api/index.d.ts +6 -0
- package/dist/src/api/routes/apps/backups.d.ts +4 -0
- package/dist/src/api/routes/global/auditLogs.d.ts +4 -0
- package/dist/src/api/routes/global/environmentVariables.d.ts +4 -0
- package/dist/src/api/routes/global/groups.d.ts +4 -0
- package/dist/src/api/routes/global/scim.d.ts +4 -0
- package/dist/src/api/routes/schedules/index.d.ts +4 -0
- package/dist/src/constants/index.d.ts +4 -0
- package/dist/src/constants/licenses.d.ts +14 -0
- package/dist/src/constants/misc.d.ts +1 -0
- package/dist/src/constants/quotas.d.ts +71 -0
- package/dist/src/constants/version.d.ts +6 -0
- package/dist/src/db/auditLogs.d.ts +9 -0
- package/dist/src/db/automations.d.ts +22 -0
- package/dist/src/db/backups.d.ts +16 -0
- package/dist/src/db/environmentVariables.d.ts +8 -0
- package/dist/src/db/groups.d.ts +43 -0
- package/dist/src/db/index.d.ts +5 -0
- package/dist/src/db/licenseInfo.d.ts +7 -0
- package/dist/src/db/quotas/index.d.ts +2 -0
- package/dist/src/db/quotas/quotas.d.ts +16 -0
- package/dist/src/db/quotas/utils.d.ts +8 -0
- package/dist/src/db/utils/pagination.d.ts +8 -0
- package/dist/src/db/utils/retention.d.ts +2 -0
- package/dist/src/db/utils/views.d.ts +6 -0
- package/dist/src/db/views/groups.d.ts +5 -0
- package/dist/src/db/views/index.d.ts +2 -0
- package/dist/src/db/views/staticViews.d.ts +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/mappers/groups.d.ts +3 -0
- package/dist/src/mappers/index.d.ts +2 -0
- package/dist/src/mappers/users.d.ts +5 -0
- package/dist/src/middleware/doInScimContext.d.ts +2 -0
- package/dist/src/middleware/feature.d.ts +2 -0
- package/dist/src/middleware/index.d.ts +4 -0
- package/dist/src/middleware/licensing.d.ts +3 -0
- package/dist/src/middleware/requireSCIM.d.ts +2 -0
- package/dist/src/sdk/api/api.d.ts +2 -0
- package/dist/src/sdk/api/index.d.ts +1 -0
- package/dist/src/sdk/auditLogs/auditLogs.d.ts +14 -0
- package/dist/src/sdk/auditLogs/index.d.ts +1 -0
- package/dist/src/sdk/auditLogs/utils.d.ts +12 -0
- package/dist/src/sdk/automations/index.d.ts +1 -0
- package/dist/src/sdk/automations/logging/index.d.ts +10 -0
- package/dist/src/sdk/backups/backup.d.ts +35 -0
- package/dist/src/sdk/backups/index.d.ts +35 -0
- package/dist/src/sdk/backups/processing.d.ts +2 -0
- package/dist/src/sdk/backups/queue.d.ts +3 -0
- package/dist/src/sdk/branding/branding.d.ts +2 -0
- package/dist/src/sdk/branding/index.d.ts +1 -0
- package/dist/src/sdk/environmentVariables/environmentVariables.d.ts +9 -0
- package/dist/src/sdk/environmentVariables/index.d.ts +1 -0
- package/dist/src/sdk/features/features.d.ts +11 -0
- package/dist/src/sdk/features/index.d.ts +1 -0
- package/dist/src/sdk/groups/groups.d.ts +33 -0
- package/dist/src/sdk/groups/index.d.ts +1 -0
- package/dist/src/sdk/index.d.ts +14 -0
- package/dist/src/sdk/init.d.ts +2 -0
- package/dist/src/sdk/licensing/cache/cache.d.ts +4 -0
- package/dist/src/sdk/licensing/cache/index.d.ts +1 -0
- package/dist/src/sdk/licensing/cache/redis.d.ts +1 -0
- package/dist/src/sdk/licensing/index.d.ts +2 -0
- package/dist/src/sdk/licensing/licenses/client.d.ts +4 -0
- package/dist/src/sdk/licensing/licenses/index.d.ts +3 -0
- package/dist/src/sdk/licensing/licenses/licenses.d.ts +5 -0
- package/dist/src/sdk/licensing/licenses/offline.d.ts +4 -0
- package/dist/src/sdk/plugins/index.d.ts +4 -0
- package/dist/src/sdk/quotas/helpers/apps.d.ts +6 -0
- package/dist/src/sdk/quotas/helpers/automations.d.ts +5 -0
- package/dist/src/sdk/quotas/helpers/dayPasses.d.ts +2 -0
- package/dist/src/sdk/quotas/helpers/groups.d.ts +2 -0
- package/dist/src/sdk/quotas/helpers/index.d.ts +8 -0
- package/dist/src/sdk/quotas/helpers/plugins.d.ts +3 -0
- package/dist/src/sdk/quotas/helpers/queries.d.ts +5 -0
- package/dist/src/sdk/quotas/helpers/rows.d.ts +8 -0
- package/dist/src/sdk/quotas/helpers/users.d.ts +2 -0
- package/dist/src/sdk/quotas/index.d.ts +3 -0
- package/dist/src/sdk/quotas/quotas.d.ts +57 -0
- package/dist/src/sdk/scim/index.d.ts +1 -0
- package/dist/src/sdk/scim/users.d.ts +25 -0
- package/dist/src/sdk/users/index.d.ts +1 -0
- package/dist/src/sdk/users/users.d.ts +1 -0
- package/dist/src/sdk/utils/apps.d.ts +1 -0
- package/dist/src/sdk/utils/index.d.ts +1 -0
- package/dist/src/types/api.d.ts +13 -0
- package/dist/src/types/documents/index.d.ts +1 -0
- package/dist/src/types/documents/license.d.ts +5 -0
- package/dist/src/types/index.d.ts +4 -0
- package/dist/src/types/init.d.ts +27 -0
- package/dist/src/types/license.d.ts +18 -0
- package/dist/src/utilities/api.d.ts +12 -0
- package/dist/src/utilities/delay.d.ts +2 -0
- package/dist/src/utilities/fileSystem.d.ts +1 -0
- package/dist/src/utilities/index.d.ts +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ScimUserResponse, ScimCreateUserRequest } from "@budibase/types";
|
|
2
|
+
import { GetUsersFilters } from "../sdk/scim/users";
|
|
3
|
+
export declare const toScimUserResponse: (user: User) => ScimUserResponse;
|
|
4
|
+
export declare const fromScimUser: (scimUser: ScimUserResponse | ScimCreateUserRequest) => User;
|
|
5
|
+
export declare const userFilters: (filter: string) => GetUsersFilters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AuditLogDoc, AuditLogSearchParams, AuditWriteOpts, Event } from "@budibase/types";
|
|
3
|
+
import { Readable } from "stream";
|
|
4
|
+
export declare function write(event: Event, metadata: any, opts?: AuditWriteOpts): Promise<AuditLogDoc | undefined>;
|
|
5
|
+
export declare function fetch(params: AuditLogSearchParams): Promise<{
|
|
6
|
+
hasNextPage: any;
|
|
7
|
+
bookmark: any;
|
|
8
|
+
data: AuditLogEnriched[];
|
|
9
|
+
}>;
|
|
10
|
+
export declare function download(params: AuditLogSearchParams): {
|
|
11
|
+
promise: Promise<void>;
|
|
12
|
+
stream: Readable;
|
|
13
|
+
};
|
|
14
|
+
export declare function definitions(): Record<string, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auditLogs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AuditLogSearchParams, Event, FallbackInfo } from "@budibase/types";
|
|
2
|
+
export declare enum ResourceType {
|
|
3
|
+
USER = "user",
|
|
4
|
+
APP = "app"
|
|
5
|
+
}
|
|
6
|
+
export declare function fillDates(params: AuditLogSearchParams): AuditLogSearchParams;
|
|
7
|
+
export declare function getSearchFilters(params: AuditLogSearchParams): SearchFilters;
|
|
8
|
+
export declare function escapeCharacter(str: string, characters: string[]): string;
|
|
9
|
+
export declare function deleted(id: string, resourceType: ResourceType, fallbackInfo?: FallbackInfo): DeletedResourceInfo;
|
|
10
|
+
export declare function removeTemplateStrings(friendlyName: string): string;
|
|
11
|
+
export declare function auditLogsEnabled(): Promise<any>;
|
|
12
|
+
export declare function getEventFriendlyName(event: Event, metadata: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as logs from "./logging";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AutomationResults, AutomationStatus, Automation } from "@budibase/types";
|
|
2
|
+
export declare const oldestLogDate: () => Promise<string>;
|
|
3
|
+
export interface LogSearchOptions {
|
|
4
|
+
startDate: string;
|
|
5
|
+
status?: AutomationStatus;
|
|
6
|
+
automationId?: string;
|
|
7
|
+
page?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function logSearch(options: LogSearchOptions): Promise<AutomationLogPage>;
|
|
10
|
+
export declare function storeLog(automation: Automation, results: AutomationResults): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as features from "../features";
|
|
2
|
+
/**
|
|
3
|
+
* Rather than exporting functions directly from licensed sdks,
|
|
4
|
+
* we use the licensed function wrapper to apply license restrictions
|
|
5
|
+
* with minimal interference to internal logic.
|
|
6
|
+
*/
|
|
7
|
+
declare const pkg: {
|
|
8
|
+
isEnabled: typeof features.isBackupsEnabled;
|
|
9
|
+
triggerAppRestore: (appId: string, backupId: string, nameForBackup: string, createdBy?: string | undefined) => Promise<Promise<void | {
|
|
10
|
+
restoreId: string;
|
|
11
|
+
metadata: any;
|
|
12
|
+
}>>;
|
|
13
|
+
triggerAppBackup: (appId: string, trigger: AppBackupTrigger, opts?: {
|
|
14
|
+
createdBy?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
} | undefined) => Promise<Promise<string | undefined>>;
|
|
17
|
+
downloadAppBackup: (backupId: string) => Promise<Promise<{
|
|
18
|
+
metadata: AppBackup;
|
|
19
|
+
path: any;
|
|
20
|
+
}>>;
|
|
21
|
+
fetchAppBackups: (appId: string, opts?: any) => Promise<Promise<{
|
|
22
|
+
data: AppBackup[];
|
|
23
|
+
hasNextPage: boolean;
|
|
24
|
+
nextPage?: string | undefined;
|
|
25
|
+
}>>;
|
|
26
|
+
storeAppBackupMetadata: (metadata: AppBackupMetadata, opts?: {
|
|
27
|
+
filename?: string | undefined;
|
|
28
|
+
} | undefined) => Promise<Promise<PutResponse>>;
|
|
29
|
+
updateBackupStatus: (id: string, rev: string, status: AppBackupStatus, contents?: any, filename?: string | undefined) => Promise<Promise<PutResponse>>;
|
|
30
|
+
updateRestoreStatus: (id: string, rev: string, status: AppBackupStatus) => Promise<Promise<PutResponse>>;
|
|
31
|
+
getAppBackup: (backupId: string) => Promise<Promise<AppBackup>>;
|
|
32
|
+
updateAppBackup: (backupId: string, backupName: string) => Promise<Promise<PutResponse>>;
|
|
33
|
+
deleteAppBackup: (backupId: string) => Promise<Promise<void>>;
|
|
34
|
+
};
|
|
35
|
+
export default pkg;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as processing from "./processing";
|
|
2
|
+
import { BackupInitOpts } from "../../types";
|
|
3
|
+
import { getBackupQueue } from "./queue";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
processing: typeof processing;
|
|
6
|
+
init: (opts: BackupInitOpts) => Promise<void>;
|
|
7
|
+
getBackupQueue: typeof getBackupQueue;
|
|
8
|
+
isEnabled: typeof import("../features").isBackupsEnabled;
|
|
9
|
+
triggerAppRestore: (appId: string, backupId: string, nameForBackup: string, createdBy?: string | undefined) => Promise<Promise<void | {
|
|
10
|
+
restoreId: string;
|
|
11
|
+
metadata: any;
|
|
12
|
+
}>>;
|
|
13
|
+
triggerAppBackup: (appId: string, trigger: AppBackupTrigger, opts?: {
|
|
14
|
+
createdBy?: string | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
|
+
} | undefined) => Promise<Promise<string | undefined>>;
|
|
17
|
+
downloadAppBackup: (backupId: string) => Promise<Promise<{
|
|
18
|
+
metadata: AppBackup;
|
|
19
|
+
path: any;
|
|
20
|
+
}>>;
|
|
21
|
+
fetchAppBackups: (appId: string, opts?: any) => Promise<Promise<{
|
|
22
|
+
data: AppBackup[];
|
|
23
|
+
hasNextPage: boolean;
|
|
24
|
+
nextPage?: string | undefined;
|
|
25
|
+
}>>;
|
|
26
|
+
storeAppBackupMetadata: (metadata: AppBackupMetadata, opts?: {
|
|
27
|
+
filename?: string | undefined;
|
|
28
|
+
} | undefined) => Promise<Promise<PutResponse>>;
|
|
29
|
+
updateBackupStatus: (id: string, rev: string, status: AppBackupStatus, contents?: any, filename?: string | undefined) => Promise<Promise<PutResponse>>;
|
|
30
|
+
updateRestoreStatus: (id: string, rev: string, status: AppBackupStatus) => Promise<Promise<PutResponse>>;
|
|
31
|
+
getAppBackup: (backupId: string) => Promise<Promise<AppBackup>>;
|
|
32
|
+
updateAppBackup: (backupId: string, backupName: string) => Promise<Promise<PutResponse>>;
|
|
33
|
+
deleteAppBackup: (backupId: string) => Promise<Promise<void>>;
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./branding";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppEnvironment, EnvironmentVariableValue } from "@budibase/types";
|
|
2
|
+
export declare function isEncryptionKeyAvailable(): boolean;
|
|
3
|
+
export declare function fetch(): Promise<string[]>;
|
|
4
|
+
export declare function fetchValues(environment: AppEnvironment): Promise<{
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function update(varName: string, value: EnvironmentVariableValue): Promise<void>;
|
|
8
|
+
export declare function remove(varName: string): Promise<void>;
|
|
9
|
+
export declare function isValid(str: string): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./environmentVariables";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Feature } from "@budibase/types";
|
|
2
|
+
import { SettingsInnerConfig } from "@budibase/types";
|
|
3
|
+
export declare function checkFeature(featureFlag: Feature): Promise<void>;
|
|
4
|
+
export declare function checkBackups<Args extends any[], Return>(targetFunction: (...parameters: Args) => Return): (...parameters: Args) => Promise<Return>;
|
|
5
|
+
export declare function isBackupsEnabled(): Promise<any>;
|
|
6
|
+
export declare function isBrandingEnabled(): Promise<any>;
|
|
7
|
+
export declare function isEnforceableSSO(): Promise<any>;
|
|
8
|
+
export declare function isSSOEnforced(opts?: {
|
|
9
|
+
config: SettingsInnerConfig;
|
|
10
|
+
}): Promise<boolean>;
|
|
11
|
+
export declare const checkSCIM: () => Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./features";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UserGroup, User } from "@budibase/types";
|
|
2
|
+
export declare function getGroupRoleId(user: User, appId: string, opts?: {
|
|
3
|
+
groups?: UserGroup[];
|
|
4
|
+
}): Promise<any>;
|
|
5
|
+
export declare function enrichUserRolesFromGroups(user: User): Promise<User>;
|
|
6
|
+
export declare function fetch(): Promise<any[]>;
|
|
7
|
+
export declare function get(id: string): Promise<UserGroup>;
|
|
8
|
+
export declare function getBulk(ids: string[], opts?: {
|
|
9
|
+
enriched: boolean;
|
|
10
|
+
}): Promise<UserGroup[]>;
|
|
11
|
+
export declare function save(group: UserGroup): Promise<{
|
|
12
|
+
id: string;
|
|
13
|
+
rev: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare function remove(groupId: string, revision: string): Promise<any>;
|
|
16
|
+
export declare function addUsers(groupId: string, userIds: string[]): Promise<User[]>;
|
|
17
|
+
export declare function removeUsers(groupId: string, userIds: string[]): Promise<User[]>;
|
|
18
|
+
export declare function updateGroupApps(groupId: string, opts: {
|
|
19
|
+
appsToRemove?: {
|
|
20
|
+
appId: string;
|
|
21
|
+
}[];
|
|
22
|
+
appsToAdd?: {
|
|
23
|
+
appId: string;
|
|
24
|
+
roleId: string;
|
|
25
|
+
}[];
|
|
26
|
+
}): Promise<{
|
|
27
|
+
id: string;
|
|
28
|
+
rev: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function cleanupApp(appId: string): Promise<{
|
|
31
|
+
id: string;
|
|
32
|
+
rev?: string | undefined;
|
|
33
|
+
}[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./groups";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * as branding from "./branding";
|
|
2
|
+
export * as licensing from "./licensing";
|
|
3
|
+
export * as quotas from "./quotas";
|
|
4
|
+
export * as users from "./users";
|
|
5
|
+
export * as automations from "./automations";
|
|
6
|
+
export * as features from "./features";
|
|
7
|
+
export * as groups from "./groups";
|
|
8
|
+
export * as plugins from "./plugins";
|
|
9
|
+
export * as environmentVariables from "./environmentVariables";
|
|
10
|
+
export * as auditLogs from "./auditLogs";
|
|
11
|
+
export { default as backups } from "./backups";
|
|
12
|
+
export * as utils from "./utils";
|
|
13
|
+
export * from "./init";
|
|
14
|
+
export * from "./scim";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GetCachedLicenseOptions, CachedLicense } from "../../../types";
|
|
2
|
+
export declare const refresh: () => Promise<void>;
|
|
3
|
+
export declare const getCachedLicense: (ctx?: any, opts?: GetCachedLicenseOptions) => Promise<CachedLicense>;
|
|
4
|
+
export declare const invalidate: () => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cache";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getClient: () => Promise<any>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { License } from "@budibase/types";
|
|
2
|
+
export declare const getLicense: () => Promise<any>;
|
|
3
|
+
export declare const triggerQuota: (body: QuotaTriggeredRequest) => Promise<void | undefined>;
|
|
4
|
+
export declare const activateLicenseKey: (licenseKey: string) => Promise<License | undefined>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getLicenseInfo: () => Promise<import("../../..").SelfHostLicenseInfo | undefined>;
|
|
2
|
+
export declare const deleteLicenseInfo: () => Promise<void>;
|
|
3
|
+
export declare const activateLicenseKey: (licenseKey: string) => Promise<void>;
|
|
4
|
+
export declare const getLicense: () => Promise<any>;
|
|
5
|
+
export declare const getFreeLicense: () => License;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PluginSource } from "@budibase/types";
|
|
2
|
+
export declare function storePlugin(metadata: any, directory: any, source?: PluginSource): Promise<any>;
|
|
3
|
+
export declare function deletePlugin(pluginId: string): Promise<void>;
|
|
4
|
+
export declare function checkPluginQuotas(): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare type RowOpts = {
|
|
2
|
+
tableId?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const addRow: (addRowFn: any, { tableId }?: RowOpts) => Promise<any>;
|
|
5
|
+
export declare const removeRow: ({ tableId }?: RowOpts) => Promise<void>;
|
|
6
|
+
export declare const addRows: (change: number, addRowsFn?: () => Promise<any>, { tableId }?: RowOpts) => Promise<any>;
|
|
7
|
+
export declare const removeRows: (change: number, { tableId }?: RowOpts) => Promise<void>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ConstantQuotaName, MonthlyQuotaName, Quota, StaticQuotaName } from "@budibase/types";
|
|
2
|
+
interface IncrementOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The function being wrapped by this quota usage.
|
|
5
|
+
*/
|
|
6
|
+
fn?: () => Promise<any>;
|
|
7
|
+
/**
|
|
8
|
+
* If provided, the new usage value will be calculated using this function.
|
|
9
|
+
*/
|
|
10
|
+
valueFn?: () => Promise<number>;
|
|
11
|
+
/**
|
|
12
|
+
* Turn on or off error logging when a quotas has been exceeded
|
|
13
|
+
*/
|
|
14
|
+
suppressErrorLog?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If using a specific resource which has an ID, can pass this ID for granular quotas.
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const increment: (name: MeteredQuotaName, type: QuotaUsageType, opts?: IncrementOptions) => Promise<any>;
|
|
21
|
+
export declare const incrementMany: (change: number, name: MeteredQuotaName, type: QuotaUsageType, opts?: IncrementOptions) => Promise<any>;
|
|
22
|
+
interface DecrementOptions {
|
|
23
|
+
/**
|
|
24
|
+
* If provided, the new usage value will be calculated using this function.
|
|
25
|
+
*/
|
|
26
|
+
valueFn?: () => Promise<number>;
|
|
27
|
+
/**
|
|
28
|
+
* If using a specific resource which has an ID, can pass this ID for granular quotas.
|
|
29
|
+
*/
|
|
30
|
+
id?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const decrement: (name: MeteredQuotaName, type: QuotaUsageType, opts?: DecrementOptions) => Promise<void>;
|
|
33
|
+
export declare const decrementMany: (change: number, name: MeteredQuotaName, type: QuotaUsageType, opts?: DecrementOptions) => Promise<void>;
|
|
34
|
+
export declare const set: (name: MeteredQuotaName, type: QuotaUsageType, value: number) => Promise<QuotaUsage>;
|
|
35
|
+
interface UpdateUsageOptions {
|
|
36
|
+
/**
|
|
37
|
+
* If provided and true, the usage quota will not be updated.
|
|
38
|
+
* Used to verify that a quota is not exceeded before running.
|
|
39
|
+
*/
|
|
40
|
+
dryRun?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If provided, the new usage value will be calculated using this function.
|
|
43
|
+
*/
|
|
44
|
+
valueFn?: () => Promise<number>;
|
|
45
|
+
/**
|
|
46
|
+
* Turn on or off error logging when a quotas has been exceeded
|
|
47
|
+
*/
|
|
48
|
+
suppressErrorLog?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If using a specific resource which has an ID, can pass this ID for granular quotas.
|
|
51
|
+
*/
|
|
52
|
+
id?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare const updateUsage: (usageChange: number, name: MeteredQuotaName, type: QuotaUsageType, opts?: UpdateUsageOptions) => Promise<void>;
|
|
55
|
+
export declare const getLicensedQuota: (quotaType: QuotaType, name: MonthlyQuotaName | StaticQuotaName | ConstantQuotaName, usageType?: any) => Promise<Quota>;
|
|
56
|
+
export declare const usageLimitIsExceeded: (name: MeteredQuotaName, type: QuotaUsageType) => Promise<boolean>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as scimUsers from "./users";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SaveUserOpts, User } from "@budibase/types";
|
|
2
|
+
export interface ScimUserServiceConfig {
|
|
3
|
+
functions: {
|
|
4
|
+
saveUser: (user: User, opts?: SaveUserOpts) => Promise<User>;
|
|
5
|
+
removeUser: (id: string) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface GetUsersFilters {
|
|
9
|
+
equal?: Record<string, any>;
|
|
10
|
+
}
|
|
11
|
+
interface GetParams {
|
|
12
|
+
pageSize: number;
|
|
13
|
+
skip?: number;
|
|
14
|
+
filters?: GetUsersFilters;
|
|
15
|
+
}
|
|
16
|
+
export declare const init: (config: ScimUserServiceConfig) => void;
|
|
17
|
+
export declare const get: (query: GetParams) => Promise<{
|
|
18
|
+
users: User[];
|
|
19
|
+
total: number;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const find: (id: string) => Promise<any>;
|
|
22
|
+
export declare const create: (user: User) => Promise<User>;
|
|
23
|
+
export declare const update: (user: User) => Promise<User>;
|
|
24
|
+
export declare const remove: (id: string) => Promise<void>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./users";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createActivity: (userId: string) => Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function appExists(appId: string): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./apps";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./license";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AppBackupContents } from "@budibase/types";
|
|
2
|
+
import { ScimUserServiceConfig } from "../sdk/scim/users";
|
|
3
|
+
export interface InitOpts {
|
|
4
|
+
backups?: BackupInitOpts;
|
|
5
|
+
scimUserServiceConfig?: ScimUserServiceConfig;
|
|
6
|
+
}
|
|
7
|
+
export interface BackupInitOpts {
|
|
8
|
+
processing: BackupProcessingOpts;
|
|
9
|
+
}
|
|
10
|
+
export interface ImportAppConfig {
|
|
11
|
+
file: {
|
|
12
|
+
type: string;
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
key: string;
|
|
16
|
+
}
|
|
17
|
+
declare type ExportAppFn = (devAppId: string, opts: {
|
|
18
|
+
tar: boolean;
|
|
19
|
+
}) => Promise<string>;
|
|
20
|
+
declare type ImportAppFn = (devAppId: string, db: any, config: ImportAppConfig) => Promise<string>;
|
|
21
|
+
declare type StatsFn = (devAppId: string) => Promise<AppBackupContents>;
|
|
22
|
+
export interface BackupProcessingOpts {
|
|
23
|
+
exportAppFn: ExportAppFn;
|
|
24
|
+
importAppFn: ImportAppFn;
|
|
25
|
+
statsFn: StatsFn;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { License } from "@budibase/types";
|
|
2
|
+
export interface CachedLicense extends License {
|
|
3
|
+
refreshedAt?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LicenseMiddlewareOptions {
|
|
7
|
+
checkDayPasses: boolean;
|
|
8
|
+
checkUsersLimit: boolean;
|
|
9
|
+
refreshVersion: boolean;
|
|
10
|
+
licensingCheck?: (ctx: any) => boolean;
|
|
11
|
+
populateLicense?: (tenantId: string) => Promise<License | undefined>;
|
|
12
|
+
populateFreeLicense?: (ctx: any, tenantId: string) => License;
|
|
13
|
+
}
|
|
14
|
+
export interface GetCachedLicenseOptions {
|
|
15
|
+
populateLicense?: (tenantId: string) => Promise<License | undefined>;
|
|
16
|
+
populateFreeLicense?: (ctx: any, tenantId: string) => License;
|
|
17
|
+
refreshVersion: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Method, Options } from "../types";
|
|
2
|
+
declare class API {
|
|
3
|
+
host: string;
|
|
4
|
+
constructor(host: string);
|
|
5
|
+
apiCall: (method: Method) => (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
6
|
+
post: (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
7
|
+
get: (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
8
|
+
patch: (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
9
|
+
del: (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
10
|
+
put: (url?: string, options?: Options) => Promise<import("node-fetch").Response>;
|
|
11
|
+
}
|
|
12
|
+
export default API;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadJSFile(directory: string, name: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as API } from "./api";
|