@budibase/types 1.3.21-alpha.0 → 1.3.21
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/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/index.js.map +1 -1
- package/dist/documents/account/account.d.ts +4 -1
- package/dist/documents/account/account.js.map +1 -1
- package/dist/documents/account/index.d.ts +0 -1
- package/dist/documents/account/index.js +0 -1
- package/dist/documents/account/index.js.map +1 -1
- package/dist/documents/global/index.d.ts +0 -1
- package/dist/documents/global/index.js +0 -1
- package/dist/documents/global/index.js.map +1 -1
- package/dist/documents/global/user.d.ts +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/sdk/auth.d.ts +0 -17
- package/dist/sdk/events/datasource.d.ts +0 -3
- package/dist/sdk/events/event.d.ts +1 -4
- package/dist/sdk/events/event.js +0 -4
- package/dist/sdk/events/event.js.map +1 -1
- package/dist/sdk/events/index.d.ts +0 -1
- package/dist/sdk/events/index.js +0 -1
- package/dist/sdk/events/index.js.map +1 -1
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.js +0 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/licensing/index.d.ts +0 -4
- package/dist/sdk/licensing/index.js +0 -4
- package/dist/sdk/licensing/index.js.map +1 -1
- package/dist/sdk/licensing/license.d.ts +0 -5
- package/dist/sdk/migrations.d.ts +2 -0
- package/dist/sdk/migrations.js +2 -0
- package/dist/sdk/migrations.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/src/api/index.ts +0 -1
- package/src/documents/account/account.ts +5 -1
- package/src/documents/account/index.ts +0 -1
- package/src/documents/global/index.ts +0 -1
- package/src/documents/global/user.ts +0 -1
- package/src/index.ts +2 -0
- package/src/sdk/auth.ts +0 -22
- package/src/sdk/events/datasource.ts +0 -3
- package/src/sdk/events/event.ts +0 -5
- package/src/sdk/events/index.ts +0 -1
- package/src/sdk/index.ts +0 -1
- package/src/sdk/licensing/index.ts +0 -4
- package/src/sdk/licensing/license.ts +1 -8
- package/src/sdk/migrations.ts +2 -0
- package/dist/api/account/index.d.ts +0 -1
- package/dist/api/account/index.js +0 -18
- package/dist/api/account/index.js.map +0 -1
- package/dist/api/account/user.d.ts +0 -7
- package/dist/api/account/user.js +0 -3
- package/dist/api/account/user.js.map +0 -1
- package/dist/documents/account/user.d.ts +0 -9
- package/dist/documents/account/user.js +0 -3
- package/dist/documents/account/user.js.map +0 -1
- package/dist/documents/global/plugin.d.ts +0 -30
- package/dist/documents/global/plugin.js +0 -17
- package/dist/documents/global/plugin.js.map +0 -1
- package/dist/sdk/events/plugin.d.ts +0 -23
- package/dist/sdk/events/plugin.js +0 -3
- package/dist/sdk/events/plugin.js.map +0 -1
- package/dist/sdk/koa.d.ts +0 -11
- package/dist/sdk/koa.js +0 -3
- package/dist/sdk/koa.js.map +0 -1
- package/dist/sdk/licensing/billing.d.ts +0 -17
- package/dist/sdk/licensing/billing.js +0 -3
- package/dist/sdk/licensing/billing.js.map +0 -1
- package/dist/sdk/licensing/feature.d.ts +0 -3
- package/dist/sdk/licensing/feature.js +0 -8
- package/dist/sdk/licensing/feature.js.map +0 -1
- package/dist/sdk/licensing/plan.d.ts +0 -22
- package/dist/sdk/licensing/plan.js +0 -16
- package/dist/sdk/licensing/plan.js.map +0 -1
- package/dist/sdk/licensing/quota.d.ts +0 -53
- package/dist/sdk/licensing/quota.js +0 -43
- package/dist/sdk/licensing/quota.js.map +0 -1
- package/src/api/account/index.ts +0 -1
- package/src/api/account/user.ts +0 -8
- package/src/documents/account/user.ts +0 -10
- package/src/documents/global/plugin.ts +0 -32
- package/src/sdk/events/plugin.ts +0 -26
- package/src/sdk/koa.ts +0 -13
- package/src/sdk/licensing/billing.ts +0 -20
- package/src/sdk/licensing/feature.ts +0 -3
- package/src/sdk/licensing/plan.ts +0 -25
- package/src/sdk/licensing/quota.ts +0 -82
package/src/sdk/migrations.ts
CHANGED
|
@@ -41,6 +41,8 @@ export enum MigrationName {
|
|
|
41
41
|
USER_EMAIL_VIEW_CASING = "user_email_view_casing",
|
|
42
42
|
QUOTAS_1 = "quotas_1",
|
|
43
43
|
APP_URLS = "app_urls",
|
|
44
|
+
DEVELOPER_QUOTA = "developer_quota",
|
|
45
|
+
PUBLISHED_APP_QUOTA = "published_apps_quota",
|
|
44
46
|
EVENT_APP_BACKFILL = "event_app_backfill",
|
|
45
47
|
EVENT_GLOBAL_BACKFILL = "event_global_backfill",
|
|
46
48
|
EVENT_INSTALLATION_BACKFILL = "event_installation_backfill",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./user";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./user"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
|
package/dist/api/account/user.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/api/account/user.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../src/documents/account/user.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Document } from "../document";
|
|
2
|
-
export declare enum PluginType {
|
|
3
|
-
DATASOURCE = "datasource",
|
|
4
|
-
COMPONENT = "component"
|
|
5
|
-
}
|
|
6
|
-
export declare enum PluginSource {
|
|
7
|
-
NPM = "NPM",
|
|
8
|
-
GITHUB = "Github",
|
|
9
|
-
URL = "URL",
|
|
10
|
-
FILE = "File Upload"
|
|
11
|
-
}
|
|
12
|
-
export interface FileType {
|
|
13
|
-
path: string;
|
|
14
|
-
name: string;
|
|
15
|
-
}
|
|
16
|
-
export interface Plugin extends Document {
|
|
17
|
-
description: string;
|
|
18
|
-
name: string;
|
|
19
|
-
version: string;
|
|
20
|
-
jsUrl?: string;
|
|
21
|
-
source: PluginSource;
|
|
22
|
-
package: {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
25
|
-
schema: {
|
|
26
|
-
type: PluginType;
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare const PLUGIN_TYPE_ARR: PluginType[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PLUGIN_TYPE_ARR = exports.PluginSource = exports.PluginType = void 0;
|
|
4
|
-
var PluginType;
|
|
5
|
-
(function (PluginType) {
|
|
6
|
-
PluginType["DATASOURCE"] = "datasource";
|
|
7
|
-
PluginType["COMPONENT"] = "component";
|
|
8
|
-
})(PluginType = exports.PluginType || (exports.PluginType = {}));
|
|
9
|
-
var PluginSource;
|
|
10
|
-
(function (PluginSource) {
|
|
11
|
-
PluginSource["NPM"] = "NPM";
|
|
12
|
-
PluginSource["GITHUB"] = "Github";
|
|
13
|
-
PluginSource["URL"] = "URL";
|
|
14
|
-
PluginSource["FILE"] = "File Upload";
|
|
15
|
-
})(PluginSource = exports.PluginSource || (exports.PluginSource = {}));
|
|
16
|
-
exports.PLUGIN_TYPE_ARR = Object.values(PluginType);
|
|
17
|
-
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/documents/global/plugin.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;AACzB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,oCAAoB,CAAA;AACtB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAmBY,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BaseEvent } from "./event";
|
|
2
|
-
import { PluginSource, PluginType } from "../../";
|
|
3
|
-
export interface PluginInitEvent extends BaseEvent {
|
|
4
|
-
type: PluginType;
|
|
5
|
-
name: string;
|
|
6
|
-
version: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
export interface PluginImportedEvent extends BaseEvent {
|
|
10
|
-
pluginId: string;
|
|
11
|
-
type: PluginType;
|
|
12
|
-
source: PluginSource;
|
|
13
|
-
name: string;
|
|
14
|
-
version: string;
|
|
15
|
-
description: string;
|
|
16
|
-
}
|
|
17
|
-
export interface PluginDeletedEvent extends BaseEvent {
|
|
18
|
-
pluginId: string;
|
|
19
|
-
type: PluginType;
|
|
20
|
-
name: string;
|
|
21
|
-
version: string;
|
|
22
|
-
description: string;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/sdk/events/plugin.ts"],"names":[],"mappings":""}
|
package/dist/sdk/koa.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { User } from "../documents";
|
|
3
|
-
import { License } from "../sdk";
|
|
4
|
-
export interface ContextUser extends User {
|
|
5
|
-
globalId?: string;
|
|
6
|
-
license: License;
|
|
7
|
-
}
|
|
8
|
-
export interface BBContext extends Context {
|
|
9
|
-
user?: ContextUser;
|
|
10
|
-
body: any;
|
|
11
|
-
}
|
package/dist/sdk/koa.js
DELETED
package/dist/sdk/koa.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"koa.js","sourceRoot":"","sources":["../../src/sdk/koa.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PriceDuration } from "./plan";
|
|
2
|
-
export interface Customer {
|
|
3
|
-
balance: number | null | undefined;
|
|
4
|
-
currency: string | null | undefined;
|
|
5
|
-
}
|
|
6
|
-
export interface Subscription {
|
|
7
|
-
amount: number;
|
|
8
|
-
quantity: number;
|
|
9
|
-
duration: PriceDuration;
|
|
10
|
-
cancelAt: number | null | undefined;
|
|
11
|
-
currentPeriodStart: number;
|
|
12
|
-
currentPeriodEnd: number;
|
|
13
|
-
}
|
|
14
|
-
export interface Billing {
|
|
15
|
-
customer: Customer;
|
|
16
|
-
subscription?: Subscription;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/sdk/licensing/billing.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Feature = void 0;
|
|
4
|
-
var Feature;
|
|
5
|
-
(function (Feature) {
|
|
6
|
-
Feature["USER_GROUPS"] = "userGroups";
|
|
7
|
-
})(Feature = exports.Feature || (exports.Feature = {}));
|
|
8
|
-
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../src/sdk/licensing/feature.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAEX;AAFD,WAAY,OAAO;IACjB,qCAA0B,CAAA;AAC5B,CAAC,EAFW,OAAO,GAAP,eAAO,KAAP,eAAO,QAElB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface AccountPlan {
|
|
2
|
-
type: PlanType;
|
|
3
|
-
price?: Price;
|
|
4
|
-
}
|
|
5
|
-
export declare enum PlanType {
|
|
6
|
-
FREE = "free",
|
|
7
|
-
PRO = "pro",
|
|
8
|
-
BUSINESS = "business",
|
|
9
|
-
ENTERPRISE = "enterprise"
|
|
10
|
-
}
|
|
11
|
-
export declare enum PriceDuration {
|
|
12
|
-
MONTHLY = "monthly",
|
|
13
|
-
YEARLY = "yearly"
|
|
14
|
-
}
|
|
15
|
-
export interface Price {
|
|
16
|
-
amount: number;
|
|
17
|
-
amountMonthly: number;
|
|
18
|
-
currency: string;
|
|
19
|
-
duration: PriceDuration;
|
|
20
|
-
priceId: string;
|
|
21
|
-
dayPasses: number;
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PriceDuration = exports.PlanType = void 0;
|
|
4
|
-
var PlanType;
|
|
5
|
-
(function (PlanType) {
|
|
6
|
-
PlanType["FREE"] = "free";
|
|
7
|
-
PlanType["PRO"] = "pro";
|
|
8
|
-
PlanType["BUSINESS"] = "business";
|
|
9
|
-
PlanType["ENTERPRISE"] = "enterprise";
|
|
10
|
-
})(PlanType = exports.PlanType || (exports.PlanType = {}));
|
|
11
|
-
var PriceDuration;
|
|
12
|
-
(function (PriceDuration) {
|
|
13
|
-
PriceDuration["MONTHLY"] = "monthly";
|
|
14
|
-
PriceDuration["YEARLY"] = "yearly";
|
|
15
|
-
})(PriceDuration = exports.PriceDuration || (exports.PriceDuration = {}));
|
|
16
|
-
//# sourceMappingURL=plan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/sdk/licensing/plan.ts"],"names":[],"mappings":";;;AAKA,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,uBAAW,CAAA;IACX,iCAAqB,CAAA;IACrB,qCAAyB,CAAA;AAC3B,CAAC,EALW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAKnB;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { PlanType } from ".";
|
|
2
|
-
export declare enum QuotaUsageType {
|
|
3
|
-
STATIC = "static",
|
|
4
|
-
MONTHLY = "monthly"
|
|
5
|
-
}
|
|
6
|
-
export declare enum QuotaType {
|
|
7
|
-
USAGE = "usage",
|
|
8
|
-
CONSTANT = "constant"
|
|
9
|
-
}
|
|
10
|
-
export declare enum StaticQuotaName {
|
|
11
|
-
ROWS = "rows",
|
|
12
|
-
APPS = "apps"
|
|
13
|
-
}
|
|
14
|
-
export declare enum MonthlyQuotaName {
|
|
15
|
-
QUERIES = "queries",
|
|
16
|
-
AUTOMATIONS = "automations",
|
|
17
|
-
DAY_PASSES = "dayPasses"
|
|
18
|
-
}
|
|
19
|
-
export declare enum ConstantQuotaName {
|
|
20
|
-
QUERY_TIMEOUT_SECONDS = "queryTimeoutSeconds",
|
|
21
|
-
AUTOMATION_LOG_RETENTION_DAYS = "automationLogRetentionDays"
|
|
22
|
-
}
|
|
23
|
-
export declare type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuotaName;
|
|
24
|
-
export declare const isStaticQuota: (quotaType: QuotaType, usageType: QuotaUsageType, name: QuotaName) => name is StaticQuotaName;
|
|
25
|
-
export declare const isMonthlyQuota: (quotaType: QuotaType, usageType: QuotaUsageType, name: QuotaName) => name is MonthlyQuotaName;
|
|
26
|
-
export declare const isConstantQuota: (quotaType: QuotaType, name: QuotaName) => name is ConstantQuotaName;
|
|
27
|
-
export declare type PlanQuotas = {
|
|
28
|
-
[PlanType.FREE]: Quotas;
|
|
29
|
-
[PlanType.PRO]: Quotas;
|
|
30
|
-
[PlanType.BUSINESS]: Quotas;
|
|
31
|
-
[PlanType.ENTERPRISE]: Quotas;
|
|
32
|
-
};
|
|
33
|
-
export declare type Quotas = {
|
|
34
|
-
[QuotaType.USAGE]: {
|
|
35
|
-
[QuotaUsageType.MONTHLY]: {
|
|
36
|
-
[MonthlyQuotaName.QUERIES]: Quota;
|
|
37
|
-
[MonthlyQuotaName.AUTOMATIONS]: Quota;
|
|
38
|
-
[MonthlyQuotaName.DAY_PASSES]: Quota;
|
|
39
|
-
};
|
|
40
|
-
[QuotaUsageType.STATIC]: {
|
|
41
|
-
[StaticQuotaName.ROWS]: Quota;
|
|
42
|
-
[StaticQuotaName.APPS]: Quota;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
[QuotaType.CONSTANT]: {
|
|
46
|
-
[ConstantQuotaName.QUERY_TIMEOUT_SECONDS]: Quota;
|
|
47
|
-
[ConstantQuotaName.AUTOMATION_LOG_RETENTION_DAYS]: Quota;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export interface Quota {
|
|
51
|
-
name: string;
|
|
52
|
-
value: number;
|
|
53
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isConstantQuota = exports.isMonthlyQuota = exports.isStaticQuota = exports.ConstantQuotaName = exports.MonthlyQuotaName = exports.StaticQuotaName = exports.QuotaType = exports.QuotaUsageType = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
var QuotaUsageType;
|
|
6
|
-
(function (QuotaUsageType) {
|
|
7
|
-
QuotaUsageType["STATIC"] = "static";
|
|
8
|
-
QuotaUsageType["MONTHLY"] = "monthly";
|
|
9
|
-
})(QuotaUsageType = exports.QuotaUsageType || (exports.QuotaUsageType = {}));
|
|
10
|
-
var QuotaType;
|
|
11
|
-
(function (QuotaType) {
|
|
12
|
-
QuotaType["USAGE"] = "usage";
|
|
13
|
-
QuotaType["CONSTANT"] = "constant";
|
|
14
|
-
})(QuotaType = exports.QuotaType || (exports.QuotaType = {}));
|
|
15
|
-
var StaticQuotaName;
|
|
16
|
-
(function (StaticQuotaName) {
|
|
17
|
-
StaticQuotaName["ROWS"] = "rows";
|
|
18
|
-
StaticQuotaName["APPS"] = "apps";
|
|
19
|
-
})(StaticQuotaName = exports.StaticQuotaName || (exports.StaticQuotaName = {}));
|
|
20
|
-
var MonthlyQuotaName;
|
|
21
|
-
(function (MonthlyQuotaName) {
|
|
22
|
-
MonthlyQuotaName["QUERIES"] = "queries";
|
|
23
|
-
MonthlyQuotaName["AUTOMATIONS"] = "automations";
|
|
24
|
-
MonthlyQuotaName["DAY_PASSES"] = "dayPasses";
|
|
25
|
-
})(MonthlyQuotaName = exports.MonthlyQuotaName || (exports.MonthlyQuotaName = {}));
|
|
26
|
-
var ConstantQuotaName;
|
|
27
|
-
(function (ConstantQuotaName) {
|
|
28
|
-
ConstantQuotaName["QUERY_TIMEOUT_SECONDS"] = "queryTimeoutSeconds";
|
|
29
|
-
ConstantQuotaName["AUTOMATION_LOG_RETENTION_DAYS"] = "automationLogRetentionDays";
|
|
30
|
-
})(ConstantQuotaName = exports.ConstantQuotaName || (exports.ConstantQuotaName = {}));
|
|
31
|
-
const isStaticQuota = (quotaType, usageType, name) => {
|
|
32
|
-
return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.STATIC;
|
|
33
|
-
};
|
|
34
|
-
exports.isStaticQuota = isStaticQuota;
|
|
35
|
-
const isMonthlyQuota = (quotaType, usageType, name) => {
|
|
36
|
-
return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.MONTHLY;
|
|
37
|
-
};
|
|
38
|
-
exports.isMonthlyQuota = isMonthlyQuota;
|
|
39
|
-
const isConstantQuota = (quotaType, name) => {
|
|
40
|
-
return quotaType === QuotaType.CONSTANT;
|
|
41
|
-
};
|
|
42
|
-
exports.isConstantQuota = isConstantQuota;
|
|
43
|
-
//# sourceMappingURL=quota.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../src/sdk/licensing/quota.ts"],"names":[],"mappings":";;;AAAA,wBAA4B;AAE5B,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,4CAAwB,CAAA;AAC1B,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kEAA6C,CAAA;IAC7C,iFAA4D,CAAA;AAC9D,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAIM,MAAM,aAAa,GAAG,CAC3B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACU,EAAE;IAC3B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,MAAM,CAAA;AAC7E,CAAC,CAAA;AANY,QAAA,aAAa,iBAMzB;AAEM,MAAM,cAAc,GAAG,CAC5B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACW,EAAE;IAC5B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,OAAO,CAAA;AAC9E,CAAC,CAAA;AANY,QAAA,cAAc,kBAM1B;AAEM,MAAM,eAAe,GAAG,CAC7B,SAAoB,EACpB,IAAe,EACY,EAAE;IAC7B,OAAO,SAAS,KAAK,SAAS,CAAC,QAAQ,CAAA;AACzC,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B"}
|
package/src/api/account/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./user"
|
package/src/api/account/user.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Document } from "../document"
|
|
2
|
-
|
|
3
|
-
export enum PluginType {
|
|
4
|
-
DATASOURCE = "datasource",
|
|
5
|
-
COMPONENT = "component",
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum PluginSource {
|
|
9
|
-
NPM = "NPM",
|
|
10
|
-
GITHUB = "Github",
|
|
11
|
-
URL = "URL",
|
|
12
|
-
FILE = "File Upload",
|
|
13
|
-
}
|
|
14
|
-
export interface FileType {
|
|
15
|
-
path: string
|
|
16
|
-
name: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface Plugin extends Document {
|
|
20
|
-
description: string
|
|
21
|
-
name: string
|
|
22
|
-
version: string
|
|
23
|
-
jsUrl?: string
|
|
24
|
-
source: PluginSource
|
|
25
|
-
package: { [key: string]: any }
|
|
26
|
-
schema: {
|
|
27
|
-
type: PluginType
|
|
28
|
-
[key: string]: any
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const PLUGIN_TYPE_ARR = Object.values(PluginType)
|
package/src/sdk/events/plugin.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BaseEvent } from "./event"
|
|
2
|
-
import { PluginSource, PluginType } from "../../"
|
|
3
|
-
|
|
4
|
-
export interface PluginInitEvent extends BaseEvent {
|
|
5
|
-
type: PluginType
|
|
6
|
-
name: string
|
|
7
|
-
version: string
|
|
8
|
-
description: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface PluginImportedEvent extends BaseEvent {
|
|
12
|
-
pluginId: string
|
|
13
|
-
type: PluginType
|
|
14
|
-
source: PluginSource
|
|
15
|
-
name: string
|
|
16
|
-
version: string
|
|
17
|
-
description: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface PluginDeletedEvent extends BaseEvent {
|
|
21
|
-
pluginId: string
|
|
22
|
-
type: PluginType
|
|
23
|
-
name: string
|
|
24
|
-
version: string
|
|
25
|
-
description: string
|
|
26
|
-
}
|
package/src/sdk/koa.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa"
|
|
2
|
-
import { User } from "../documents"
|
|
3
|
-
import { License } from "../sdk"
|
|
4
|
-
|
|
5
|
-
export interface ContextUser extends User {
|
|
6
|
-
globalId?: string
|
|
7
|
-
license: License
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface BBContext extends Context {
|
|
11
|
-
user?: ContextUser
|
|
12
|
-
body: any
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PriceDuration } from "./plan"
|
|
2
|
-
|
|
3
|
-
export interface Customer {
|
|
4
|
-
balance: number | null | undefined
|
|
5
|
-
currency: string | null | undefined
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface Subscription {
|
|
9
|
-
amount: number
|
|
10
|
-
quantity: number
|
|
11
|
-
duration: PriceDuration
|
|
12
|
-
cancelAt: number | null | undefined
|
|
13
|
-
currentPeriodStart: number
|
|
14
|
-
currentPeriodEnd: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface Billing {
|
|
18
|
-
customer: Customer
|
|
19
|
-
subscription?: Subscription
|
|
20
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface AccountPlan {
|
|
2
|
-
type: PlanType
|
|
3
|
-
price?: Price
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export enum PlanType {
|
|
7
|
-
FREE = "free",
|
|
8
|
-
PRO = "pro",
|
|
9
|
-
BUSINESS = "business",
|
|
10
|
-
ENTERPRISE = "enterprise",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export enum PriceDuration {
|
|
14
|
-
MONTHLY = "monthly",
|
|
15
|
-
YEARLY = "yearly",
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface Price {
|
|
19
|
-
amount: number
|
|
20
|
-
amountMonthly: number
|
|
21
|
-
currency: string
|
|
22
|
-
duration: PriceDuration
|
|
23
|
-
priceId: string
|
|
24
|
-
dayPasses: number
|
|
25
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { PlanType } from "."
|
|
2
|
-
|
|
3
|
-
export enum QuotaUsageType {
|
|
4
|
-
STATIC = "static",
|
|
5
|
-
MONTHLY = "monthly",
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum QuotaType {
|
|
9
|
-
USAGE = "usage",
|
|
10
|
-
CONSTANT = "constant",
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export enum StaticQuotaName {
|
|
14
|
-
ROWS = "rows",
|
|
15
|
-
APPS = "apps",
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export enum MonthlyQuotaName {
|
|
19
|
-
QUERIES = "queries",
|
|
20
|
-
AUTOMATIONS = "automations",
|
|
21
|
-
DAY_PASSES = "dayPasses",
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export enum ConstantQuotaName {
|
|
25
|
-
QUERY_TIMEOUT_SECONDS = "queryTimeoutSeconds",
|
|
26
|
-
AUTOMATION_LOG_RETENTION_DAYS = "automationLogRetentionDays",
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuotaName
|
|
30
|
-
|
|
31
|
-
export const isStaticQuota = (
|
|
32
|
-
quotaType: QuotaType,
|
|
33
|
-
usageType: QuotaUsageType,
|
|
34
|
-
name: QuotaName
|
|
35
|
-
): name is StaticQuotaName => {
|
|
36
|
-
return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.STATIC
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const isMonthlyQuota = (
|
|
40
|
-
quotaType: QuotaType,
|
|
41
|
-
usageType: QuotaUsageType,
|
|
42
|
-
name: QuotaName
|
|
43
|
-
): name is MonthlyQuotaName => {
|
|
44
|
-
return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.MONTHLY
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const isConstantQuota = (
|
|
48
|
-
quotaType: QuotaType,
|
|
49
|
-
name: QuotaName
|
|
50
|
-
): name is ConstantQuotaName => {
|
|
51
|
-
return quotaType === QuotaType.CONSTANT
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type PlanQuotas = {
|
|
55
|
-
[PlanType.FREE]: Quotas
|
|
56
|
-
[PlanType.PRO]: Quotas
|
|
57
|
-
[PlanType.BUSINESS]: Quotas
|
|
58
|
-
[PlanType.ENTERPRISE]: Quotas
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type Quotas = {
|
|
62
|
-
[QuotaType.USAGE]: {
|
|
63
|
-
[QuotaUsageType.MONTHLY]: {
|
|
64
|
-
[MonthlyQuotaName.QUERIES]: Quota
|
|
65
|
-
[MonthlyQuotaName.AUTOMATIONS]: Quota
|
|
66
|
-
[MonthlyQuotaName.DAY_PASSES]: Quota
|
|
67
|
-
}
|
|
68
|
-
[QuotaUsageType.STATIC]: {
|
|
69
|
-
[StaticQuotaName.ROWS]: Quota
|
|
70
|
-
[StaticQuotaName.APPS]: Quota
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
[QuotaType.CONSTANT]: {
|
|
74
|
-
[ConstantQuotaName.QUERY_TIMEOUT_SECONDS]: Quota
|
|
75
|
-
[ConstantQuotaName.AUTOMATION_LOG_RETENTION_DAYS]: Quota
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface Quota {
|
|
80
|
-
name: string
|
|
81
|
-
value: number
|
|
82
|
-
}
|