@appsemble/types 0.34.20 → 0.35.3-test.0
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/README.md +3 -3
- package/cli.d.ts +16 -0
- package/index.d.ts +123 -8
- package/index.js +45 -0
- package/package.json +2 -2
- package/permissions.d.ts +9 -1
- package/permissions.js +8 -0
- package/roles.js +2 -0
- package/subscriptionPlans.d.ts +45 -0
- package/subscriptionPlans.js +71 -0
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Types
|
|
2
2
|
|
|
3
3
|
> Reusable TypeScript types
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/types)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.35.3-test.0)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.35.3-test.0/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/cli.d.ts
CHANGED
|
@@ -143,6 +143,22 @@ export interface AppsembleContext {
|
|
|
143
143
|
* line.
|
|
144
144
|
*/
|
|
145
145
|
assetsClonable?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* The name of the external app database.
|
|
148
|
+
*/
|
|
149
|
+
dbName?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The host of the external app database.
|
|
152
|
+
*/
|
|
153
|
+
dbHost?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The port of the external app database.
|
|
156
|
+
*/
|
|
157
|
+
dbPort?: string;
|
|
158
|
+
/**
|
|
159
|
+
* The user of the external app database.
|
|
160
|
+
*/
|
|
161
|
+
dbUser?: string;
|
|
146
162
|
}
|
|
147
163
|
export interface AppsembleRC {
|
|
148
164
|
/**
|
package/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './training.js';
|
|
|
20
20
|
export * from './quota.js';
|
|
21
21
|
export * from './permissions.js';
|
|
22
22
|
export * from './roles.js';
|
|
23
|
+
export * from './subscriptionPlans.js';
|
|
23
24
|
export type { AppMemberInfo };
|
|
24
25
|
export type { ProjectImplementations, BlockManifest, ProjectManifest, ActionType, EventType };
|
|
25
26
|
/**
|
|
@@ -125,6 +126,45 @@ export interface TokenResponse {
|
|
|
125
126
|
refresh_token?: string;
|
|
126
127
|
token_type: 'bearer';
|
|
127
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* A type to represent different subscription plans.
|
|
131
|
+
*/
|
|
132
|
+
export declare enum SubscriptionPlanType {
|
|
133
|
+
Free = "free",
|
|
134
|
+
Basic = "basic",
|
|
135
|
+
Standard = "standard",
|
|
136
|
+
Extensive = "extensive",
|
|
137
|
+
Enterprise = "enterprise"
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A type to represent different payment statuses for invoice.
|
|
141
|
+
*/
|
|
142
|
+
export declare enum InvoiceStatus {
|
|
143
|
+
Paid = "paid",
|
|
144
|
+
Pending = "pending",
|
|
145
|
+
Retry = "retry",
|
|
146
|
+
Failed = "failed"
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A type to represent different payment providers.
|
|
150
|
+
*/
|
|
151
|
+
export declare enum PaymentProvider {
|
|
152
|
+
Stripe = "stripe"
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* A type to represent different payment methods.
|
|
156
|
+
*/
|
|
157
|
+
export declare enum PaymentMethod {
|
|
158
|
+
Debit = "sepa_debit",
|
|
159
|
+
Card = "card"
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A type to represent different subscription renewal periods.
|
|
163
|
+
*/
|
|
164
|
+
export declare enum SubscriptionRenewalPeriod {
|
|
165
|
+
Month = "month",
|
|
166
|
+
Year = "year"
|
|
167
|
+
}
|
|
128
168
|
/**
|
|
129
169
|
* A type to represent the app lock.
|
|
130
170
|
*/
|
|
@@ -242,14 +282,6 @@ export interface App {
|
|
|
242
282
|
*/
|
|
243
283
|
average: number;
|
|
244
284
|
};
|
|
245
|
-
/**
|
|
246
|
-
* Whether the app has clonable resources.
|
|
247
|
-
*/
|
|
248
|
-
hasClonableResources?: boolean;
|
|
249
|
-
/**
|
|
250
|
-
* Whether the app has clonable assets.
|
|
251
|
-
*/
|
|
252
|
-
hasClonableAssets?: boolean;
|
|
253
285
|
/**
|
|
254
286
|
* A list of URLs to app screenshots
|
|
255
287
|
*/
|
|
@@ -316,6 +348,22 @@ export interface App {
|
|
|
316
348
|
* The version of the app.
|
|
317
349
|
*/
|
|
318
350
|
version?: number;
|
|
351
|
+
/**
|
|
352
|
+
* The name of the app database.
|
|
353
|
+
*/
|
|
354
|
+
dbName: string;
|
|
355
|
+
/**
|
|
356
|
+
* The host of the app database.
|
|
357
|
+
*/
|
|
358
|
+
dbHost: string;
|
|
359
|
+
/**
|
|
360
|
+
* The port of the app database.
|
|
361
|
+
*/
|
|
362
|
+
dbPort: number;
|
|
363
|
+
/**
|
|
364
|
+
* The user of the app database.
|
|
365
|
+
*/
|
|
366
|
+
dbUser: string;
|
|
319
367
|
}
|
|
320
368
|
/**
|
|
321
369
|
* A rating given to an app.
|
|
@@ -376,6 +424,73 @@ export interface Organization {
|
|
|
376
424
|
* The URL at which the organization’s icon can be found.
|
|
377
425
|
*/
|
|
378
426
|
iconUrl: string;
|
|
427
|
+
/**
|
|
428
|
+
* The preferred payment provider of the organization.
|
|
429
|
+
*/
|
|
430
|
+
preferredPaymentProvider: PaymentProvider;
|
|
431
|
+
/**
|
|
432
|
+
* The vat id number of the organization.
|
|
433
|
+
*/
|
|
434
|
+
vatIdNumber: string;
|
|
435
|
+
/**
|
|
436
|
+
* The street name of the organization.
|
|
437
|
+
*/
|
|
438
|
+
streetName: string;
|
|
439
|
+
/**
|
|
440
|
+
* The house number of the organization.
|
|
441
|
+
*/
|
|
442
|
+
houseNumber: string;
|
|
443
|
+
/**
|
|
444
|
+
* The city of the organization.
|
|
445
|
+
*/
|
|
446
|
+
city: string;
|
|
447
|
+
/**
|
|
448
|
+
* The zip code of the organization.
|
|
449
|
+
*/
|
|
450
|
+
zipCode: string;
|
|
451
|
+
/**
|
|
452
|
+
* The country code of the organization.
|
|
453
|
+
*/
|
|
454
|
+
countryCode: string;
|
|
455
|
+
/**
|
|
456
|
+
* The reference to be shown on invoices of the organization.
|
|
457
|
+
*/
|
|
458
|
+
invoiceReference: string;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* A subscription owned by an organization.
|
|
462
|
+
*/
|
|
463
|
+
export interface OrganizationSubscription {
|
|
464
|
+
/**
|
|
465
|
+
* The ID of the subscription.
|
|
466
|
+
*/
|
|
467
|
+
id: number;
|
|
468
|
+
/**
|
|
469
|
+
* The status of the subscription.
|
|
470
|
+
*/
|
|
471
|
+
cancelled: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* The reason for cancelling the subscription.
|
|
474
|
+
*/
|
|
475
|
+
cancellationReason: string;
|
|
476
|
+
/**
|
|
477
|
+
* The date until which the subscription has been paid for.
|
|
478
|
+
*/
|
|
479
|
+
expirationDate: string;
|
|
480
|
+
/**
|
|
481
|
+
* The associated subscription plan.
|
|
482
|
+
*/
|
|
483
|
+
subscriptionPlan: SubscriptionPlanType;
|
|
484
|
+
/**
|
|
485
|
+
* The associated renewal period plan.
|
|
486
|
+
*/
|
|
487
|
+
renewalPeriod: SubscriptionRenewalPeriod;
|
|
488
|
+
/**
|
|
489
|
+
* The ID of the organization that owns the subscription.
|
|
490
|
+
*
|
|
491
|
+
* This typically is prepended with an `@`
|
|
492
|
+
*/
|
|
493
|
+
organizationId: string;
|
|
379
494
|
}
|
|
380
495
|
/**
|
|
381
496
|
* An invite for an organization.
|
package/index.js
CHANGED
|
@@ -16,8 +16,53 @@ export * from './training.js';
|
|
|
16
16
|
export * from './quota.js';
|
|
17
17
|
export * from './permissions.js';
|
|
18
18
|
export * from './roles.js';
|
|
19
|
+
export * from './subscriptionPlans.js';
|
|
19
20
|
const assertAppMemberInfoIsBaseUserInfo = true;
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
21
22
|
assertAppMemberInfoIsBaseUserInfo;
|
|
23
|
+
/**
|
|
24
|
+
* A type to represent different subscription plans.
|
|
25
|
+
*/
|
|
26
|
+
export var SubscriptionPlanType;
|
|
27
|
+
(function (SubscriptionPlanType) {
|
|
28
|
+
SubscriptionPlanType["Free"] = "free";
|
|
29
|
+
SubscriptionPlanType["Basic"] = "basic";
|
|
30
|
+
SubscriptionPlanType["Standard"] = "standard";
|
|
31
|
+
SubscriptionPlanType["Extensive"] = "extensive";
|
|
32
|
+
SubscriptionPlanType["Enterprise"] = "enterprise";
|
|
33
|
+
})(SubscriptionPlanType || (SubscriptionPlanType = {}));
|
|
34
|
+
/**
|
|
35
|
+
* A type to represent different payment statuses for invoice.
|
|
36
|
+
*/
|
|
37
|
+
export var InvoiceStatus;
|
|
38
|
+
(function (InvoiceStatus) {
|
|
39
|
+
InvoiceStatus["Paid"] = "paid";
|
|
40
|
+
InvoiceStatus["Pending"] = "pending";
|
|
41
|
+
InvoiceStatus["Retry"] = "retry";
|
|
42
|
+
InvoiceStatus["Failed"] = "failed";
|
|
43
|
+
})(InvoiceStatus || (InvoiceStatus = {}));
|
|
44
|
+
/**
|
|
45
|
+
* A type to represent different payment providers.
|
|
46
|
+
*/
|
|
47
|
+
export var PaymentProvider;
|
|
48
|
+
(function (PaymentProvider) {
|
|
49
|
+
PaymentProvider["Stripe"] = "stripe";
|
|
50
|
+
})(PaymentProvider || (PaymentProvider = {}));
|
|
51
|
+
/**
|
|
52
|
+
* A type to represent different payment methods.
|
|
53
|
+
*/
|
|
54
|
+
export var PaymentMethod;
|
|
55
|
+
(function (PaymentMethod) {
|
|
56
|
+
PaymentMethod["Debit"] = "sepa_debit";
|
|
57
|
+
PaymentMethod["Card"] = "card";
|
|
58
|
+
})(PaymentMethod || (PaymentMethod = {}));
|
|
59
|
+
/**
|
|
60
|
+
* A type to represent different subscription renewal periods.
|
|
61
|
+
*/
|
|
62
|
+
export var SubscriptionRenewalPeriod;
|
|
63
|
+
(function (SubscriptionRenewalPeriod) {
|
|
64
|
+
SubscriptionRenewalPeriod["Month"] = "month";
|
|
65
|
+
SubscriptionRenewalPeriod["Year"] = "year";
|
|
66
|
+
})(SubscriptionRenewalPeriod || (SubscriptionRenewalPeriod = {}));
|
|
22
67
|
export const resourceSubscribableAction = ['create', 'update', 'delete'];
|
|
23
68
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.3-test.0",
|
|
4
4
|
"description": "TypeScript definitions reused within Appsemble internally",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"test": "vitest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@appsemble/lang-sdk": "0.
|
|
43
|
+
"@appsemble/lang-sdk": "0.35.3-test.0",
|
|
44
44
|
"@fortawesome/fontawesome-common-types": "^6.0.0",
|
|
45
45
|
"jsonschema": "~1.4.1",
|
|
46
46
|
"openapi-types": "^12.0.0",
|
package/permissions.d.ts
CHANGED
|
@@ -266,7 +266,15 @@ export declare enum OrganizationPermission {
|
|
|
266
266
|
/**
|
|
267
267
|
* The permission to send manual push notifications for an app.
|
|
268
268
|
*/
|
|
269
|
-
PushAppNotifications = 65
|
|
269
|
+
PushAppNotifications = 65,
|
|
270
|
+
/**
|
|
271
|
+
* The permission to manage organization subscriptions.
|
|
272
|
+
*/
|
|
273
|
+
ManageOrganizationSubscriptions = 66,
|
|
274
|
+
/**
|
|
275
|
+
* The permission to query organization subscriptions.
|
|
276
|
+
*/
|
|
277
|
+
QueryOrganizationSubscriptions = 67
|
|
270
278
|
}
|
|
271
279
|
export declare const appOrganizationPermissionMapping: {
|
|
272
280
|
[key in AppPermission]: OrganizationPermission;
|
package/permissions.js
CHANGED
|
@@ -268,6 +268,14 @@ export var OrganizationPermission;
|
|
|
268
268
|
* The permission to send manual push notifications for an app.
|
|
269
269
|
*/
|
|
270
270
|
OrganizationPermission[OrganizationPermission["PushAppNotifications"] = 65] = "PushAppNotifications";
|
|
271
|
+
/**
|
|
272
|
+
* The permission to manage organization subscriptions.
|
|
273
|
+
*/
|
|
274
|
+
OrganizationPermission[OrganizationPermission["ManageOrganizationSubscriptions"] = 66] = "ManageOrganizationSubscriptions";
|
|
275
|
+
/**
|
|
276
|
+
* The permission to query organization subscriptions.
|
|
277
|
+
*/
|
|
278
|
+
OrganizationPermission[OrganizationPermission["QueryOrganizationSubscriptions"] = 67] = "QueryOrganizationSubscriptions";
|
|
271
279
|
})(OrganizationPermission || (OrganizationPermission = {}));
|
|
272
280
|
export const appOrganizationPermissionMapping = {
|
|
273
281
|
[AppPermission.CreateAppInvites]: OrganizationPermission.CreateAppInvites,
|
package/roles.js
CHANGED
|
@@ -2,6 +2,7 @@ import { OrganizationPermission } from './permissions.js';
|
|
|
2
2
|
const OrganizationMemberPermissions = [
|
|
3
3
|
OrganizationPermission.QueryApps,
|
|
4
4
|
OrganizationPermission.QueryOrganizationMembers,
|
|
5
|
+
OrganizationPermission.QueryOrganizationSubscriptions,
|
|
5
6
|
];
|
|
6
7
|
const OrganizationAppTranslatorPermissions = [
|
|
7
8
|
...OrganizationMemberPermissions,
|
|
@@ -102,6 +103,7 @@ const OrganizationOwnerPermissions = [
|
|
|
102
103
|
OrganizationPermission.DeleteOrganizations,
|
|
103
104
|
OrganizationPermission.RemoveOrganizationMembers,
|
|
104
105
|
OrganizationPermission.UpdateOrganizationMemberRoles,
|
|
106
|
+
OrganizationPermission.ManageOrganizationSubscriptions,
|
|
105
107
|
];
|
|
106
108
|
export var PredefinedOrganizationRole;
|
|
107
109
|
(function (PredefinedOrganizationRole) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface SubscriptionPlan {
|
|
2
|
+
/**
|
|
3
|
+
* The name of the Subscription plan.
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* The price of the Subscription plan.
|
|
8
|
+
*/
|
|
9
|
+
price: string;
|
|
10
|
+
/**
|
|
11
|
+
* Amount of apps the user can publish.
|
|
12
|
+
*/
|
|
13
|
+
appLimit: number;
|
|
14
|
+
/**
|
|
15
|
+
* How many notifications we allow organizations on this plan to send daily
|
|
16
|
+
* from our SMTP server. Unlimited with their custom server.
|
|
17
|
+
*/
|
|
18
|
+
dailyNotifications: number | 'unlimited';
|
|
19
|
+
/**
|
|
20
|
+
* How many GB of data we allow the organization to store on our servers.
|
|
21
|
+
*/
|
|
22
|
+
persistentStorage: number;
|
|
23
|
+
/**
|
|
24
|
+
* Whether we allow the organizations to use custom containers.
|
|
25
|
+
*/
|
|
26
|
+
customContainers: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Service level agreement associated with this plan.
|
|
29
|
+
*/
|
|
30
|
+
sla: string;
|
|
31
|
+
/**
|
|
32
|
+
* Level of block support included in the plan.
|
|
33
|
+
*/
|
|
34
|
+
blocks: string;
|
|
35
|
+
/**
|
|
36
|
+
* Type of backend support included in the plan.
|
|
37
|
+
*/
|
|
38
|
+
backend: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const freePlan: SubscriptionPlan;
|
|
41
|
+
export declare const basicPlan: SubscriptionPlan;
|
|
42
|
+
export declare const standardPlan: SubscriptionPlan;
|
|
43
|
+
export declare const extensivePlan: SubscriptionPlan;
|
|
44
|
+
export declare const enterprisePlan: SubscriptionPlan;
|
|
45
|
+
export declare function getSubscriptionPlanByName(name: string): SubscriptionPlan;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const freePlan = {
|
|
2
|
+
name: 'free',
|
|
3
|
+
blocks: 'Appsemble supported basic blocks',
|
|
4
|
+
backend: 'Standard Appsemble backend',
|
|
5
|
+
price: '0',
|
|
6
|
+
appLimit: 3,
|
|
7
|
+
dailyNotifications: 50,
|
|
8
|
+
persistentStorage: 1,
|
|
9
|
+
customContainers: false,
|
|
10
|
+
sla: 'none',
|
|
11
|
+
};
|
|
12
|
+
export const basicPlan = {
|
|
13
|
+
name: 'basic',
|
|
14
|
+
blocks: 'Appsemble supported basic blocks',
|
|
15
|
+
backend: 'Standard Appsemble backend',
|
|
16
|
+
price: '5',
|
|
17
|
+
appLimit: Number.POSITIVE_INFINITY,
|
|
18
|
+
dailyNotifications: 50,
|
|
19
|
+
persistentStorage: 1,
|
|
20
|
+
customContainers: false,
|
|
21
|
+
sla: 'basic',
|
|
22
|
+
};
|
|
23
|
+
export const standardPlan = {
|
|
24
|
+
name: 'standard',
|
|
25
|
+
blocks: 'Appsemble supported basic blocks',
|
|
26
|
+
backend: 'Standard Appsemble backend',
|
|
27
|
+
price: '25',
|
|
28
|
+
appLimit: Number.POSITIVE_INFINITY,
|
|
29
|
+
dailyNotifications: 5000,
|
|
30
|
+
persistentStorage: 50,
|
|
31
|
+
customContainers: false,
|
|
32
|
+
sla: 'standard',
|
|
33
|
+
};
|
|
34
|
+
export const extensivePlan = {
|
|
35
|
+
name: 'extensive',
|
|
36
|
+
blocks: '3rd party building blocks',
|
|
37
|
+
backend: 'Standard Appsemble backend',
|
|
38
|
+
price: '50',
|
|
39
|
+
appLimit: Number.POSITIVE_INFINITY,
|
|
40
|
+
dailyNotifications: Number.POSITIVE_INFINITY,
|
|
41
|
+
persistentStorage: 200,
|
|
42
|
+
customContainers: true,
|
|
43
|
+
sla: 'extensive',
|
|
44
|
+
};
|
|
45
|
+
export const enterprisePlan = {
|
|
46
|
+
name: 'enterprise',
|
|
47
|
+
blocks: '3rd party building blocks',
|
|
48
|
+
backend: 'Hosting of custom backends',
|
|
49
|
+
price: '100',
|
|
50
|
+
appLimit: Number.POSITIVE_INFINITY,
|
|
51
|
+
dailyNotifications: Number.POSITIVE_INFINITY,
|
|
52
|
+
persistentStorage: 500,
|
|
53
|
+
customContainers: true,
|
|
54
|
+
sla: 'enterprise',
|
|
55
|
+
};
|
|
56
|
+
export function getSubscriptionPlanByName(name) {
|
|
57
|
+
if (basicPlan.name === name) {
|
|
58
|
+
return basicPlan;
|
|
59
|
+
}
|
|
60
|
+
if (standardPlan.name === name) {
|
|
61
|
+
return standardPlan;
|
|
62
|
+
}
|
|
63
|
+
if (extensivePlan.name === name) {
|
|
64
|
+
return extensivePlan;
|
|
65
|
+
}
|
|
66
|
+
if (enterprisePlan.name === name) {
|
|
67
|
+
return enterprisePlan;
|
|
68
|
+
}
|
|
69
|
+
return freePlan;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=subscriptionPlans.js.map
|