@abyss-project/main 1.0.110 → 1.0.111
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/billing-account.admin.api.d.ts +10 -0
- package/dist/api/billing-account.admin.api.js +38 -0
- package/dist/api/billing-addon-template.admin.api.d.ts +7 -0
- package/dist/api/billing-addon-template.admin.api.js +26 -0
- package/dist/api/billing-plan.admin.api.d.ts +6 -0
- package/dist/api/billing-plan.admin.api.js +20 -0
- package/dist/api/billing-plan.api.d.ts +4 -0
- package/dist/api/billing-plan.api.js +12 -0
- package/dist/api/index.d.ts +7 -4
- package/dist/api/index.js +7 -4
- package/dist/api/organization-billing.api.d.ts +17 -0
- package/dist/api/organization-billing.api.js +64 -0
- package/dist/api/organization-member.api.d.ts +9 -6
- package/dist/api/organization-member.api.js +19 -7
- package/dist/api/organization.api.d.ts +3 -2
- package/dist/api/organization.api.js +5 -1
- package/dist/api/project-access.admin.api.d.ts +1 -3
- package/dist/api/project-access.admin.api.js +1 -9
- package/dist/api/project-access.api.d.ts +5 -3
- package/dist/api/project-access.api.js +17 -9
- package/dist/api/project-api-key.api.d.ts +8 -0
- package/dist/api/project-api-key.api.js +29 -0
- package/dist/api/project.api.d.ts +1 -5
- package/dist/api/project.api.js +1 -17
- package/dist/api/user-billing.api.d.ts +11 -0
- package/dist/api/user-billing.api.js +40 -0
- package/dist/api/user.api.d.ts +1 -4
- package/dist/api/user.api.js +1 -16
- package/dist/index.d.ts +1 -37
- package/dist/index.js +1 -37
- package/dist/permissions/ability.d.ts +12 -0
- package/dist/permissions/ability.js +134 -0
- package/dist/permissions/index.d.ts +1 -0
- package/dist/{workflow → permissions}/index.js +1 -1
- package/dist/types/enum/abyss-application-event.enum.d.ts +17 -1
- package/dist/types/enum/abyss-application-event.enum.js +16 -0
- package/dist/types/enum/index.d.ts +1 -4
- package/dist/types/enum/index.js +1 -4
- package/dist/types/enum/onboarding-steps.enum.d.ts +5 -3
- package/dist/types/enum/onboarding-steps.enum.js +5 -3
- package/dist/types/enum/organization-billing.enum.d.ts +70 -0
- package/dist/types/enum/organization-billing.enum.js +82 -0
- package/dist/types/enum/user-type.enum.d.ts +1 -0
- package/dist/types/enum/user-type.enum.js +1 -0
- package/dist/types/interface/api/index.d.ts +13 -8
- package/dist/types/interface/api/index.js +13 -8
- package/dist/types/interface/api/requests/billing-account.admin.request.d.ts +53 -0
- package/dist/types/interface/api/requests/billing-addon-template.request.d.ts +32 -0
- package/dist/types/interface/api/requests/billing-plan.request.d.ts +37 -0
- package/dist/types/interface/api/requests/organization-billing.request.d.ts +95 -0
- package/dist/types/interface/api/requests/organization-member.request.d.ts +13 -3
- package/dist/types/interface/api/requests/organization.request.d.ts +10 -0
- package/dist/types/interface/api/requests/project-access.admin.request.d.ts +1 -20
- package/dist/types/interface/api/requests/project-access.request.d.ts +16 -20
- package/dist/types/interface/api/requests/project-api-key.request.d.ts +39 -0
- package/dist/types/interface/api/requests/project.request.d.ts +2 -23
- package/dist/types/interface/api/requests/user-billing.request.d.ts +23 -0
- package/dist/types/interface/api/requests/user.request.d.ts +2 -8
- package/dist/types/interface/api/responses/billing-account.admin.response.d.ts +38 -0
- package/dist/types/interface/api/responses/billing-addon-template.response.d.ts +22 -0
- package/dist/types/interface/api/responses/billing-plan.response.d.ts +26 -0
- package/dist/types/interface/api/responses/gift-code.admin.response.d.ts +0 -1
- package/dist/types/interface/api/responses/gift-code.response.d.ts +0 -1
- package/dist/types/interface/api/responses/organization-billing.response.d.ts +82 -0
- package/dist/types/interface/api/responses/organization-member.response.d.ts +20 -8
- package/dist/types/interface/api/responses/project-access.admin.response.d.ts +0 -8
- package/dist/types/interface/api/responses/project-access.response.d.ts +16 -8
- package/dist/types/interface/api/responses/project-api-key.response.d.ts +26 -0
- package/dist/types/interface/api/responses/project.response.d.ts +0 -14
- package/dist/types/interface/api/responses/report.public.response.d.ts +0 -1
- package/dist/types/interface/api/responses/user-billing.response.d.ts +45 -0
- package/dist/types/interface/index.d.ts +13 -3
- package/dist/types/interface/index.js +13 -3
- package/dist/types/interface/models/application.model.d.ts +1 -1
- package/dist/types/interface/models/atlas-group.model.d.ts +2 -2
- package/dist/types/interface/models/atlas-page.model.d.ts +2 -2
- package/dist/types/interface/models/atlas.model.d.ts +8 -5
- package/dist/types/interface/models/billing-account.model.d.ts +40 -0
- package/dist/types/interface/models/billing-account.model.js +2 -0
- package/dist/types/interface/models/billing-addon-template.model.d.ts +15 -0
- package/dist/types/interface/models/billing-addon-template.model.js +2 -0
- package/dist/types/interface/models/board-card-checklist.model.d.ts +1 -1
- package/dist/types/interface/models/board-card.model.d.ts +6 -6
- package/dist/types/interface/models/board-column.model.d.ts +1 -1
- package/dist/types/interface/models/board.model.d.ts +7 -4
- package/dist/types/interface/models/credit-transaction.model.d.ts +22 -0
- package/dist/types/interface/models/credit-transaction.model.js +2 -0
- package/dist/types/interface/models/draw.model.d.ts +3 -0
- package/dist/types/interface/models/gift-code-activation.model.d.ts +4 -3
- package/dist/types/interface/models/gift-code.model.d.ts +1 -1
- package/dist/types/interface/models/invoice.model.d.ts +26 -0
- package/dist/types/interface/models/invoice.model.js +2 -0
- package/dist/types/interface/models/memo.model.d.ts +3 -0
- package/dist/types/interface/models/organization-billing.model.d.ts +37 -0
- package/dist/types/interface/models/organization-billing.model.js +2 -0
- package/dist/types/interface/models/organization-member.model.d.ts +0 -1
- package/dist/types/interface/models/organization-project-quota.model.d.ts +15 -0
- package/dist/types/interface/models/organization-project-quota.model.js +2 -0
- package/dist/types/interface/models/organization-quota-alert.model.d.ts +11 -0
- package/dist/types/interface/models/organization-quota-alert.model.js +2 -0
- package/dist/types/interface/models/organization-service-quota.model.d.ts +13 -0
- package/dist/types/interface/models/organization-service-quota.model.js +2 -0
- package/dist/types/interface/models/organization.model.d.ts +7 -0
- package/dist/types/interface/models/plan-template.model.d.ts +29 -0
- package/dist/types/interface/models/plan-template.model.js +2 -0
- package/dist/types/interface/models/project-access.model.d.ts +5 -6
- package/dist/types/interface/models/project-api-key-application-access.model.d.ts +13 -0
- package/dist/types/interface/models/project-api-key-application-access.model.js +2 -0
- package/dist/types/interface/models/project-api-key.model.d.ts +15 -0
- package/dist/types/interface/models/project-api-key.model.js +2 -0
- package/dist/types/interface/models/project.model.d.ts +8 -12
- package/dist/types/interface/models/quota-grant.model.d.ts +20 -0
- package/dist/types/interface/models/quota-grant.model.js +2 -0
- package/dist/types/interface/models/retrospective.model.d.ts +6 -3
- package/dist/types/interface/models/short-link.model.d.ts +4 -1
- package/dist/types/interface/models/team-project-access.model.d.ts +2 -0
- package/dist/types/interface/models/team-project-application-access.model.d.ts +13 -0
- package/dist/types/interface/models/team-project-application-access.model.js +2 -0
- package/dist/types/interface/models/team.model.d.ts +1 -1
- package/dist/types/interface/models/token-history.model.d.ts +2 -0
- package/dist/types/interface/models/usage-record.model.d.ts +24 -0
- package/dist/types/interface/models/usage-record.model.js +2 -0
- package/dist/types/interface/models/user-ticket-message.model.d.ts +1 -1
- package/dist/types/interface/models/user-ticket.model.d.ts +1 -1
- package/dist/types/interface/models/user.model.d.ts +16 -18
- package/dist/types/utils/onboarding.utils.d.ts +1 -6
- package/dist/types/utils/onboarding.utils.js +9 -5
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/package.json +2 -1
- package/dist/api/user-credit-purchase.admin.api.d.ts +0 -7
- package/dist/api/user-credit-purchase.admin.api.js +0 -28
- package/dist/api/user-credit-purchase.api.d.ts +0 -3
- package/dist/api/user-credit-purchase.api.js +0 -14
- package/dist/api/user-transaction.admin.api.d.ts +0 -5
- package/dist/api/user-transaction.admin.api.js +0 -20
- package/dist/api/user-transaction.api.d.ts +0 -3
- package/dist/api/user-transaction.api.js +0 -14
- package/dist/expressions/index.d.ts +0 -5
- package/dist/expressions/index.js +0 -16
- package/dist/expressions/mapper.d.ts +0 -9
- package/dist/expressions/mapper.js +0 -90
- package/dist/expressions/parser.d.ts +0 -3
- package/dist/expressions/parser.js +0 -97
- package/dist/expressions/resolver.d.ts +0 -12
- package/dist/expressions/resolver.js +0 -88
- package/dist/expressions/types.d.ts +0 -36
- package/dist/types/enum/integration-type.enum.d.ts +0 -4
- package/dist/types/enum/integration-type.enum.js +0 -8
- package/dist/types/enum/invoice-status.enum.d.ts +0 -7
- package/dist/types/enum/invoice-status.enum.js +0 -11
- package/dist/types/enum/organization-role.enum.d.ts +0 -6
- package/dist/types/enum/organization-role.enum.js +0 -10
- package/dist/types/enum/organization-subscription-status.enum.d.ts +0 -7
- package/dist/types/enum/organization-subscription-status.enum.js +0 -11
- package/dist/types/enum/plan-billing-period.enum.d.ts +0 -4
- package/dist/types/enum/plan-billing-period.enum.js +0 -8
- package/dist/types/enum/plan-status.enum.d.ts +0 -4
- package/dist/types/enum/plan-status.enum.js +0 -8
- package/dist/types/enum/subscription-level.enum.d.ts +0 -72
- package/dist/types/enum/subscription-level.enum.js +0 -179
- package/dist/types/enum/usage-record-type.enum.d.ts +0 -8
- package/dist/types/enum/usage-record-type.enum.js +0 -12
- package/dist/types/enum/user-credit-purchase-payment-method.enum.d.ts +0 -3
- package/dist/types/enum/user-credit-purchase-payment-method.enum.js +0 -7
- package/dist/types/enum/user-credit-purchase-platform.enum.d.ts +0 -8
- package/dist/types/enum/user-credit-purchase-platform.enum.js +0 -12
- package/dist/types/enum/user-transaction-type.enum.d.ts +0 -14
- package/dist/types/enum/user-transaction-type.enum.js +0 -18
- package/dist/types/interface/api/requests/user-credit-purchase.admin.request.d.ts +0 -42
- package/dist/types/interface/api/requests/user-credit-purchase.request.d.ts +0 -9
- package/dist/types/interface/api/requests/user-transaction.admin.request.d.ts +0 -30
- package/dist/types/interface/api/requests/user-transaction.request.d.ts +0 -8
- package/dist/types/interface/api/responses/user-credit-purchase.admin.response.d.ts +0 -22
- package/dist/types/interface/api/responses/user-credit-purchase.response.d.ts +0 -8
- package/dist/types/interface/api/responses/user-transaction.admin.response.d.ts +0 -13
- package/dist/types/interface/api/responses/user-transaction.response.d.ts +0 -11
- package/dist/types/interface/models/subscription.model.d.ts +0 -16
- package/dist/types/interface/models/user-credit-purchase.model.d.ts +0 -22
- package/dist/types/interface/models/user-transaction.model.d.ts +0 -19
- package/dist/utils/organization-permission.utils.d.ts +0 -3
- package/dist/utils/organization-permission.utils.js +0 -36
- package/dist/utils/subscription.utils.d.ts +0 -6
- package/dist/utils/subscription.utils.js +0 -41
- package/dist/workflow/expression/expression-functions.utils.d.ts +0 -6
- package/dist/workflow/expression/expression-functions.utils.js +0 -61
- package/dist/workflow/expression/expression-mapper.d.ts +0 -11
- package/dist/workflow/expression/expression-mapper.js +0 -32
- package/dist/workflow/expression/expression-mapping.utils.d.ts +0 -4
- package/dist/workflow/expression/expression-mapping.utils.js +0 -43
- package/dist/workflow/expression/expression-resolver.utils.d.ts +0 -3
- package/dist/workflow/expression/expression-resolver.utils.js +0 -54
- package/dist/workflow/expression/expression-tokenizer.utils.d.ts +0 -4
- package/dist/workflow/expression/expression-tokenizer.utils.js +0 -123
- package/dist/workflow/expression/expression.types.d.ts +0 -33
- package/dist/workflow/expression/expression.types.js +0 -17
- package/dist/workflow/expression/index.d.ts +0 -10
- package/dist/workflow/expression/index.js +0 -40
- package/dist/workflow/expression/workflow-resolver.d.ts +0 -9
- package/dist/workflow/expression/workflow-resolver.js +0 -102
- package/dist/workflow/expressions/functions/array.d.ts +0 -2
- package/dist/workflow/expressions/functions/array.js +0 -252
- package/dist/workflow/expressions/functions/crypto.d.ts +0 -2
- package/dist/workflow/expressions/functions/crypto.js +0 -101
- package/dist/workflow/expressions/functions/datetime.d.ts +0 -2
- package/dist/workflow/expressions/functions/datetime.js +0 -256
- package/dist/workflow/expressions/functions/index.d.ts +0 -7
- package/dist/workflow/expressions/functions/index.js +0 -46
- package/dist/workflow/expressions/functions/math.d.ts +0 -2
- package/dist/workflow/expressions/functions/math.js +0 -174
- package/dist/workflow/expressions/functions/string.d.ts +0 -2
- package/dist/workflow/expressions/functions/string.js +0 -301
- package/dist/workflow/expressions/functions/utility.d.ts +0 -2
- package/dist/workflow/expressions/functions/utility.js +0 -230
- package/dist/workflow/expressions/helpers.d.ts +0 -26
- package/dist/workflow/expressions/helpers.js +0 -132
- package/dist/workflow/expressions/index.d.ts +0 -15
- package/dist/workflow/expressions/index.js +0 -61
- package/dist/workflow/expressions/parser.d.ts +0 -8
- package/dist/workflow/expressions/parser.js +0 -436
- package/dist/workflow/expressions/pipes/array-pipes.d.ts +0 -2
- package/dist/workflow/expressions/pipes/array-pipes.js +0 -248
- package/dist/workflow/expressions/pipes/index.d.ts +0 -8
- package/dist/workflow/expressions/pipes/index.js +0 -40
- package/dist/workflow/expressions/pipes/object-pipes.d.ts +0 -2
- package/dist/workflow/expressions/pipes/object-pipes.js +0 -243
- package/dist/workflow/expressions/pipes/string-pipes.d.ts +0 -9
- package/dist/workflow/expressions/pipes/string-pipes.js +0 -178
- package/dist/workflow/expressions/resolver.d.ts +0 -8
- package/dist/workflow/expressions/resolver.js +0 -263
- package/dist/workflow/expressions/types.d.ts +0 -144
- package/dist/workflow/expressions/types.js +0 -33
- package/dist/workflow/index.d.ts +0 -1
- /package/dist/{expressions/types.js → types/interface/api/requests/billing-account.admin.request.js} +0 -0
- /package/dist/types/interface/api/requests/{user-credit-purchase.admin.request.js → billing-addon-template.request.js} +0 -0
- /package/dist/types/interface/api/requests/{user-credit-purchase.request.js → billing-plan.request.js} +0 -0
- /package/dist/types/interface/api/requests/{user-transaction.admin.request.js → organization-billing.request.js} +0 -0
- /package/dist/types/interface/api/requests/{user-transaction.request.js → project-api-key.request.js} +0 -0
- /package/dist/types/interface/api/{responses/user-credit-purchase.admin.response.js → requests/user-billing.request.js} +0 -0
- /package/dist/types/interface/api/responses/{user-credit-purchase.response.js → billing-account.admin.response.js} +0 -0
- /package/dist/types/interface/api/responses/{user-transaction.admin.response.js → billing-addon-template.response.js} +0 -0
- /package/dist/types/interface/api/responses/{user-transaction.response.js → billing-plan.response.js} +0 -0
- /package/dist/types/interface/{models/subscription.model.js → api/responses/organization-billing.response.js} +0 -0
- /package/dist/types/interface/{models/user-credit-purchase.model.js → api/responses/project-api-key.response.js} +0 -0
- /package/dist/types/interface/{models/user-transaction.model.js → api/responses/user-billing.response.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProjectAccessPermission } from '../../enum';
|
|
2
2
|
import { ITeam } from './team.model';
|
|
3
3
|
import { IProject } from './project.model';
|
|
4
|
+
import { ITeamProjectApplicationAccess } from './team-project-application-access.model';
|
|
4
5
|
export interface ITeamProjectAccess {
|
|
5
6
|
id?: string;
|
|
6
7
|
teamId: string;
|
|
@@ -10,4 +11,5 @@ export interface ITeamProjectAccess {
|
|
|
10
11
|
createdAt?: Date;
|
|
11
12
|
team?: ITeam;
|
|
12
13
|
project?: IProject;
|
|
14
|
+
teamProjectApplicationAccesses?: ITeamProjectApplicationAccess[];
|
|
13
15
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ProjectApplicationAccessPermission } from '../../enum';
|
|
2
|
+
import { ITeamProjectAccess } from './team-project-access.model';
|
|
3
|
+
import { IApplication } from './application.model';
|
|
4
|
+
export interface ITeamProjectApplicationAccess {
|
|
5
|
+
id?: string;
|
|
6
|
+
permission: ProjectApplicationAccessPermission[];
|
|
7
|
+
teamProjectAccessId: string;
|
|
8
|
+
applicationId: string;
|
|
9
|
+
updatedAt?: Date;
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
teamProjectAccess?: ITeamProjectAccess;
|
|
12
|
+
application?: IApplication;
|
|
13
|
+
}
|
|
@@ -31,6 +31,7 @@ export type TokenHistoryMetadataProject = {
|
|
|
31
31
|
permission: ProjectApplicationAccessPermission[];
|
|
32
32
|
applicationId: string;
|
|
33
33
|
}[];
|
|
34
|
+
teamIds?: string[];
|
|
34
35
|
};
|
|
35
36
|
export type TokenHistoryMetadataCloud = {
|
|
36
37
|
cloudId: string;
|
|
@@ -49,6 +50,7 @@ export type TokenHistoryMetadataExtendsUserInvitation = {
|
|
|
49
50
|
export type TokenHistoryMetadataOrganization = {
|
|
50
51
|
organizationId: string;
|
|
51
52
|
permissions: OrganizationPermission[];
|
|
53
|
+
teamIds?: string[];
|
|
52
54
|
};
|
|
53
55
|
export type TokenHistoryMetadataPublicEmailVerification = {
|
|
54
56
|
email: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BillingMetric, BillingService, UsagePoolType } from '../../enum';
|
|
2
|
+
import { IBillingAccount } from './billing-account.model';
|
|
3
|
+
import { IInvoice } from './invoice.model';
|
|
4
|
+
import { IProject } from './project.model';
|
|
5
|
+
export interface IUsageRecord {
|
|
6
|
+
id?: string;
|
|
7
|
+
billingAccountId: string;
|
|
8
|
+
projectId: string | null;
|
|
9
|
+
service: BillingService;
|
|
10
|
+
metric: BillingMetric;
|
|
11
|
+
poolType: UsagePoolType | null;
|
|
12
|
+
poolId: string | null;
|
|
13
|
+
quantity: number;
|
|
14
|
+
periodStart: Date;
|
|
15
|
+
periodEnd: Date;
|
|
16
|
+
overageQuantity: number;
|
|
17
|
+
overageAmountEur: number;
|
|
18
|
+
invoiceId: string | null;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
createdAt?: Date;
|
|
21
|
+
billingAccount?: IBillingAccount;
|
|
22
|
+
project?: IProject | null;
|
|
23
|
+
invoice?: IInvoice | null;
|
|
24
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { IAtlas, IBoard, IGiftCodeActivation, IMemo, IOAuthAccount, IProject, IRetrospective, IShortLink
|
|
2
|
-
import {
|
|
1
|
+
import { IAtlas, IBoard, IGiftCodeActivation, IMemo, IOAuthAccount, IProject, IRetrospective, IShortLink } from '..';
|
|
2
|
+
import { MeasurementSystem, OnboardingSteps, UserLanguage, UserType } from '../../enum';
|
|
3
3
|
import { OnboardingData } from '../../utils';
|
|
4
4
|
import { IBoardCardComment } from './board-card-comment.model';
|
|
5
5
|
import { IDraw } from './draw.model';
|
|
6
|
-
import {
|
|
6
|
+
import { IBillingAccount } from './billing-account.model';
|
|
7
7
|
import { IUserNotification } from './user-notification.model';
|
|
8
8
|
export interface IUserSetting {
|
|
9
9
|
language?: UserLanguage;
|
|
10
|
-
currency?:
|
|
10
|
+
currency?: string | null;
|
|
11
11
|
onboardingStatus?: UserOnboardingStatus | null;
|
|
12
12
|
userType?: UserType;
|
|
13
13
|
enableSoundNotification?: boolean;
|
|
14
14
|
annualReportEmailEnabled?: boolean;
|
|
15
|
+
newsletterDismissedAt?: Date | null;
|
|
15
16
|
abyssConsoleFirstVisitDate?: Date | null;
|
|
16
17
|
units?: {
|
|
17
18
|
length?: MeasurementSystem;
|
|
@@ -28,8 +29,6 @@ export interface IUser {
|
|
|
28
29
|
name: string | null;
|
|
29
30
|
familyName: string | null;
|
|
30
31
|
sponsorId: string | null;
|
|
31
|
-
enabledService: AbyssService[];
|
|
32
|
-
balance: number;
|
|
33
32
|
emailVerifiedAt: Date | null;
|
|
34
33
|
settings: IUserSetting;
|
|
35
34
|
profilePictureId: string | null;
|
|
@@ -40,19 +39,18 @@ export interface IUser {
|
|
|
40
39
|
updatedAt?: Date;
|
|
41
40
|
createdAt?: Date;
|
|
42
41
|
sponsor?: IUser | null;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
userTransaction?: IUserTransaction[];
|
|
42
|
+
oauthAccounts?: IOAuthAccount[];
|
|
43
|
+
userNotifications?: IUserNotification[];
|
|
46
44
|
giftCodeActivation?: IGiftCodeActivation[];
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
billingAccount?: IBillingAccount;
|
|
46
|
+
projects?: IProject[];
|
|
47
|
+
boardCardComments?: IBoardCardComment[];
|
|
48
|
+
boards?: IBoard[];
|
|
49
|
+
draws?: IDraw[];
|
|
50
|
+
retrospectives?: IRetrospective[];
|
|
51
|
+
atlases?: IAtlas[];
|
|
52
|
+
memos?: IMemo[];
|
|
53
|
+
shortLinks?: IShortLink[];
|
|
56
54
|
}
|
|
57
55
|
export type UserOnboardingStatus = {
|
|
58
56
|
completedAt?: Date | null;
|
|
@@ -9,12 +9,6 @@ export type OnboardingData = {
|
|
|
9
9
|
name: string;
|
|
10
10
|
familyName: string;
|
|
11
11
|
email: string;
|
|
12
|
-
signupAsCompany: boolean;
|
|
13
|
-
companyName?: string;
|
|
14
|
-
companySiren?: string;
|
|
15
|
-
companyCreationDate?: string;
|
|
16
|
-
companyRole?: string;
|
|
17
|
-
companyWebsite?: string;
|
|
18
12
|
};
|
|
19
13
|
userType: {
|
|
20
14
|
type: UserType | null;
|
|
@@ -25,6 +19,7 @@ export type OnboardingData = {
|
|
|
25
19
|
memories: boolean;
|
|
26
20
|
form: boolean;
|
|
27
21
|
spotlight: boolean;
|
|
22
|
+
training: boolean;
|
|
28
23
|
};
|
|
29
24
|
};
|
|
30
25
|
export declare const getOnboardingProgression: (currentStep: OnboardingSteps, onboardingData: OnboardingData) => {
|
|
@@ -12,14 +12,15 @@ exports.COMMONS_STEPS = [
|
|
|
12
12
|
enum_1.OnboardingSteps.USER_TYPE,
|
|
13
13
|
];
|
|
14
14
|
const getOnboardingProgression = (currentStep, onboardingData) => {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16
16
|
const allSteps = [
|
|
17
17
|
...exports.COMMONS_STEPS,
|
|
18
|
-
...(((_a = onboardingData.userType) === null || _a === void 0 ? void 0 : _a.type) === enum_1.UserType.
|
|
18
|
+
...(((_a = onboardingData.userType) === null || _a === void 0 ? void 0 : _a.type) === enum_1.UserType.ORGANIZATION
|
|
19
19
|
? [
|
|
20
|
-
enum_1.OnboardingSteps.
|
|
21
|
-
enum_1.OnboardingSteps.
|
|
22
|
-
enum_1.OnboardingSteps.
|
|
20
|
+
enum_1.OnboardingSteps.ORG_CREATE,
|
|
21
|
+
enum_1.OnboardingSteps.ORG_INVITE_MEMBERS,
|
|
22
|
+
enum_1.OnboardingSteps.ORG_DISCOVER_TOOLS,
|
|
23
|
+
enum_1.OnboardingSteps.ORG_DISCOVER_PROJECT_TOOLS,
|
|
23
24
|
]
|
|
24
25
|
: []),
|
|
25
26
|
...(((_b = onboardingData.userType) === null || _b === void 0 ? void 0 : _b.type) === enum_1.UserType.USER
|
|
@@ -34,6 +35,9 @@ const getOnboardingProgression = (currentStep, onboardingData) => {
|
|
|
34
35
|
...(((_h = onboardingData.userFeatures) === null || _h === void 0 ? void 0 : _h.spotlight)
|
|
35
36
|
? [enum_1.OnboardingSteps.USER_CREATE_SPOTLIGHT]
|
|
36
37
|
: []),
|
|
38
|
+
...(((_j = onboardingData.userFeatures) === null || _j === void 0 ? void 0 : _j.training)
|
|
39
|
+
? [enum_1.OnboardingSteps.USER_DISCOVER_TRAINING]
|
|
40
|
+
: []),
|
|
37
41
|
]
|
|
38
42
|
: []),
|
|
39
43
|
enum_1.OnboardingSteps.END,
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from './byte.utils';
|
|
|
5
5
|
export * from './import.utils';
|
|
6
6
|
export * from './notification.utils';
|
|
7
7
|
export * from './sleep.utils';
|
|
8
|
-
export * from './subscription.utils';
|
|
9
8
|
export * from './array.utils';
|
|
10
9
|
export * from './abyss.utils';
|
|
11
10
|
export * from './color.utils';
|
package/dist/utils/index.js
CHANGED
|
@@ -21,7 +21,6 @@ __exportStar(require("./byte.utils"), exports);
|
|
|
21
21
|
__exportStar(require("./import.utils"), exports);
|
|
22
22
|
__exportStar(require("./notification.utils"), exports);
|
|
23
23
|
__exportStar(require("./sleep.utils"), exports);
|
|
24
|
-
__exportStar(require("./subscription.utils"), exports);
|
|
25
24
|
__exportStar(require("./array.utils"), exports);
|
|
26
25
|
__exportStar(require("./abyss.utils"), exports);
|
|
27
26
|
__exportStar(require("./color.utils"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/main",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.111",
|
|
4
4
|
"description": "Core package to interact with Abyss-Project",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://gitlab.com/abyss-group",
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"@casl/ability": "^6.8.0",
|
|
19
20
|
"axios": "^1.2.2",
|
|
20
21
|
"axios-retry": "^4.5.0",
|
|
21
22
|
"byte-size": "^8.1.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IPaginateUserCreditPurchaseAdminQuery, IPaginateUserCreditPurchaseAdminResponse, IGetUserCreditPurchaseAdminParams, IGetUserCreditPurchaseAdminResponse, ICreateUserCreditPurchaseAdminParams, ICreateUserCreditPurchaseAdminBody, ICreateUserCreditPurchaseAdminResponse, IUpdateUserCreditPurchaseAdminParams, IUpdateUserCreditPurchaseAdminBody, IUpdateUserCreditPurchaseAdminResponse, IDeleteUserCreditPurchaseAdminParams, IDeleteUserCreditPurchaseAdminResponse, IRefundUserCreditPurchaseAdminParams, IRefundUserCreditPurchaseAdminResponse } from '../types';
|
|
2
|
-
export declare const paginateUserCreditPurchaseAdmin: (query: IPaginateUserCreditPurchaseAdminQuery) => Promise<IPaginateUserCreditPurchaseAdminResponse>;
|
|
3
|
-
export declare const getUserCreditPurchaseAdmin: (params: IGetUserCreditPurchaseAdminParams) => Promise<IGetUserCreditPurchaseAdminResponse>;
|
|
4
|
-
export declare const createUserCreditPurchaseAdmin: (params: ICreateUserCreditPurchaseAdminParams, body: ICreateUserCreditPurchaseAdminBody) => Promise<ICreateUserCreditPurchaseAdminResponse>;
|
|
5
|
-
export declare const updateUserCreditPurchaseAdmin: (params: IUpdateUserCreditPurchaseAdminParams, body: IUpdateUserCreditPurchaseAdminBody) => Promise<IUpdateUserCreditPurchaseAdminResponse>;
|
|
6
|
-
export declare const deleteUserCreditPurchaseAdmin: (params: IDeleteUserCreditPurchaseAdminParams) => Promise<IDeleteUserCreditPurchaseAdminResponse>;
|
|
7
|
-
export declare const refundUserCreditPurchaseAdmin: (params: IRefundUserCreditPurchaseAdminParams) => Promise<IRefundUserCreditPurchaseAdminResponse>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.refundUserCreditPurchaseAdmin = exports.deleteUserCreditPurchaseAdmin = exports.updateUserCreditPurchaseAdmin = exports.createUserCreditPurchaseAdmin = exports.getUserCreditPurchaseAdmin = exports.paginateUserCreditPurchaseAdmin = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const paginateUserCreditPurchaseAdmin = async (query) => {
|
|
6
|
-
return (await __1.AbyssCore.axios.get(`credit-purchase/admin/paginate`, { params: query })).data;
|
|
7
|
-
};
|
|
8
|
-
exports.paginateUserCreditPurchaseAdmin = paginateUserCreditPurchaseAdmin;
|
|
9
|
-
const getUserCreditPurchaseAdmin = async (params) => {
|
|
10
|
-
return (await __1.AbyssCore.axios.get(`credit-purchase/admin/${params.userCreditPurchaseId}`)).data;
|
|
11
|
-
};
|
|
12
|
-
exports.getUserCreditPurchaseAdmin = getUserCreditPurchaseAdmin;
|
|
13
|
-
const createUserCreditPurchaseAdmin = async (params, body) => {
|
|
14
|
-
return (await __1.AbyssCore.axios.post(`credit-purchase/admin/${params.userId}`, body)).data;
|
|
15
|
-
};
|
|
16
|
-
exports.createUserCreditPurchaseAdmin = createUserCreditPurchaseAdmin;
|
|
17
|
-
const updateUserCreditPurchaseAdmin = async (params, body) => {
|
|
18
|
-
return (await __1.AbyssCore.axios.put(`credit-purchase/admin/${params.userCreditPurchaseId}`, body)).data;
|
|
19
|
-
};
|
|
20
|
-
exports.updateUserCreditPurchaseAdmin = updateUserCreditPurchaseAdmin;
|
|
21
|
-
const deleteUserCreditPurchaseAdmin = async (params) => {
|
|
22
|
-
return (await __1.AbyssCore.axios.delete(`credit-purchase/admin/${params.userCreditPurchaseId}`)).data;
|
|
23
|
-
};
|
|
24
|
-
exports.deleteUserCreditPurchaseAdmin = deleteUserCreditPurchaseAdmin;
|
|
25
|
-
const refundUserCreditPurchaseAdmin = async (params) => {
|
|
26
|
-
return (await __1.AbyssCore.axios.post(`credit-purchase/admin/${params.userCreditPurchaseId}/refund`)).data;
|
|
27
|
-
};
|
|
28
|
-
exports.refundUserCreditPurchaseAdmin = refundUserCreditPurchaseAdmin;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IPaginateUserCreditPurchaseQuery, IPaginateUserCreditPurchaseResponse, IGetUserCreditPurchaseParams, IGetUserCreditPurchaseResponse } from '../types';
|
|
2
|
-
export declare const paginateUserCreditPurchase: (query: IPaginateUserCreditPurchaseQuery) => Promise<IPaginateUserCreditPurchaseResponse>;
|
|
3
|
-
export declare const getUserCreditPurchase: (params: IGetUserCreditPurchaseParams) => Promise<IGetUserCreditPurchaseResponse>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserCreditPurchase = exports.paginateUserCreditPurchase = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const paginateUserCreditPurchase = async (query) => {
|
|
6
|
-
return (await __1.AbyssCore.axios.get(`user/me/credit-purchase/paginate`, {
|
|
7
|
-
params: query,
|
|
8
|
-
})).data;
|
|
9
|
-
};
|
|
10
|
-
exports.paginateUserCreditPurchase = paginateUserCreditPurchase;
|
|
11
|
-
const getUserCreditPurchase = async (params) => {
|
|
12
|
-
return (await __1.AbyssCore.axios.get(`user/me/credit-purchase/${params.creditPurchaseId}`)).data;
|
|
13
|
-
};
|
|
14
|
-
exports.getUserCreditPurchase = getUserCreditPurchase;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IPaginateUserTransactionAdminQuery, IPaginateUserTransactionAdminResponse, ICreateUserTransactionAdminParams, ICreateUserTransactionAdminBody, ICreateUserTransactionAdminResponse, IDeleteUserTransactionAdminParams, IDeleteUserTransactionAdminResponse, IUpdateUserTransactionAdminParams, IUpdateUserTransactionAdminBody, IUpdateUserTransactionAdminResponse } from '../types';
|
|
2
|
-
export declare const paginateUserTransactionAdmin: (query: IPaginateUserTransactionAdminQuery) => Promise<IPaginateUserTransactionAdminResponse>;
|
|
3
|
-
export declare const createUserTransactionAdmin: (params: ICreateUserTransactionAdminParams, body: ICreateUserTransactionAdminBody) => Promise<ICreateUserTransactionAdminResponse>;
|
|
4
|
-
export declare const deleteUserTransactionAdmin: (params: IDeleteUserTransactionAdminParams) => Promise<IDeleteUserTransactionAdminResponse>;
|
|
5
|
-
export declare const updateUserTransactionAdmin: (params: IUpdateUserTransactionAdminParams, body: IUpdateUserTransactionAdminBody) => Promise<IUpdateUserTransactionAdminResponse>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateUserTransactionAdmin = exports.deleteUserTransactionAdmin = exports.createUserTransactionAdmin = exports.paginateUserTransactionAdmin = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const paginateUserTransactionAdmin = async (query) => {
|
|
6
|
-
return (await __1.AbyssCore.axios.get('user-transactions/admin/paginate', { params: query })).data;
|
|
7
|
-
};
|
|
8
|
-
exports.paginateUserTransactionAdmin = paginateUserTransactionAdmin;
|
|
9
|
-
const createUserTransactionAdmin = async (params, body) => {
|
|
10
|
-
return (await __1.AbyssCore.axios.post(`user-transactions/admin/${params.userId}`, body)).data;
|
|
11
|
-
};
|
|
12
|
-
exports.createUserTransactionAdmin = createUserTransactionAdmin;
|
|
13
|
-
const deleteUserTransactionAdmin = async (params) => {
|
|
14
|
-
return (await __1.AbyssCore.axios.delete(`user-transactions/admin/${params.userTransactionId}`)).data;
|
|
15
|
-
};
|
|
16
|
-
exports.deleteUserTransactionAdmin = deleteUserTransactionAdmin;
|
|
17
|
-
const updateUserTransactionAdmin = async (params, body) => {
|
|
18
|
-
return (await __1.AbyssCore.axios.put(`user-transactions/admin/${params.userTransactionId}`, body)).data;
|
|
19
|
-
};
|
|
20
|
-
exports.updateUserTransactionAdmin = updateUserTransactionAdmin;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IGetAggregateUserTransactionResponse, IPaginateUserTransactionQuery, IPaginateUserTransactionResponse } from '../types';
|
|
2
|
-
export declare const paginateUserTransaction: (query: IPaginateUserTransactionQuery) => Promise<IPaginateUserTransactionResponse>;
|
|
3
|
-
export declare const getAggregateUserTransaction: () => Promise<IGetAggregateUserTransactionResponse>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAggregateUserTransaction = exports.paginateUserTransaction = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
const paginateUserTransaction = async (query) => {
|
|
6
|
-
return (await __1.AbyssCore.axios.get('user-transactions/paginate', {
|
|
7
|
-
params: query,
|
|
8
|
-
})).data;
|
|
9
|
-
};
|
|
10
|
-
exports.paginateUserTransaction = paginateUserTransaction;
|
|
11
|
-
const getAggregateUserTransaction = async () => {
|
|
12
|
-
return (await __1.AbyssCore.axios.get('user-transactions/aggregate')).data;
|
|
13
|
-
};
|
|
14
|
-
exports.getAggregateUserTransaction = getAggregateUserTransaction;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { ResourceMapping, ExpressionToken, ExpressionParserConfig, ParsedExpression, ExpressionMappingOptions, } from './types';
|
|
2
|
-
export { parseExpression, stringifyExpression, } from './parser';
|
|
3
|
-
export { convertToDisplayFormat, convertToSaveFormat, extractMappings, validateExpression, createResourceMapping, } from './mapper';
|
|
4
|
-
export type { ExpressionContext, ResolverOptions, } from './resolver';
|
|
5
|
-
export { resolveExpression, isDynamicExpression, extractPaths, } from './resolver';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractPaths = exports.isDynamicExpression = exports.resolveExpression = exports.createResourceMapping = exports.validateExpression = exports.extractMappings = exports.convertToSaveFormat = exports.convertToDisplayFormat = exports.stringifyExpression = exports.parseExpression = void 0;
|
|
4
|
-
var parser_1 = require("./parser");
|
|
5
|
-
Object.defineProperty(exports, "parseExpression", { enumerable: true, get: function () { return parser_1.parseExpression; } });
|
|
6
|
-
Object.defineProperty(exports, "stringifyExpression", { enumerable: true, get: function () { return parser_1.stringifyExpression; } });
|
|
7
|
-
var mapper_1 = require("./mapper");
|
|
8
|
-
Object.defineProperty(exports, "convertToDisplayFormat", { enumerable: true, get: function () { return mapper_1.convertToDisplayFormat; } });
|
|
9
|
-
Object.defineProperty(exports, "convertToSaveFormat", { enumerable: true, get: function () { return mapper_1.convertToSaveFormat; } });
|
|
10
|
-
Object.defineProperty(exports, "extractMappings", { enumerable: true, get: function () { return mapper_1.extractMappings; } });
|
|
11
|
-
Object.defineProperty(exports, "validateExpression", { enumerable: true, get: function () { return mapper_1.validateExpression; } });
|
|
12
|
-
Object.defineProperty(exports, "createResourceMapping", { enumerable: true, get: function () { return mapper_1.createResourceMapping; } });
|
|
13
|
-
var resolver_1 = require("./resolver");
|
|
14
|
-
Object.defineProperty(exports, "resolveExpression", { enumerable: true, get: function () { return resolver_1.resolveExpression; } });
|
|
15
|
-
Object.defineProperty(exports, "isDynamicExpression", { enumerable: true, get: function () { return resolver_1.isDynamicExpression; } });
|
|
16
|
-
Object.defineProperty(exports, "extractPaths", { enumerable: true, get: function () { return resolver_1.extractPaths; } });
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ResourceMapping, ExpressionMappingOptions } from './types';
|
|
2
|
-
export declare function convertToDisplayFormat<TSource = string>(expression: string, mappings: ResourceMapping<TSource>[], options?: ExpressionMappingOptions): string;
|
|
3
|
-
export declare function convertToSaveFormat<TSource = string>(expression: string, mappings: ResourceMapping<TSource>[], options?: ExpressionMappingOptions): string;
|
|
4
|
-
export declare function extractMappings<TSource = string>(expression: string, mappings: ResourceMapping<TSource>[]): ResourceMapping<TSource>[];
|
|
5
|
-
export declare function validateExpression<TSource = string>(expression: string, mappings: ResourceMapping<TSource>[]): {
|
|
6
|
-
valid: boolean;
|
|
7
|
-
missingReferences: string[];
|
|
8
|
-
};
|
|
9
|
-
export declare function createResourceMapping<TSource = string>(source: TSource, resourceId: string, resourceName: string, pathBuilder: (source: TSource, identifier: string) => string): ResourceMapping<TSource>;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createResourceMapping = exports.validateExpression = exports.extractMappings = exports.convertToSaveFormat = exports.convertToDisplayFormat = void 0;
|
|
4
|
-
const parser_1 = require("./parser");
|
|
5
|
-
function convertToDisplayFormat(expression, mappings, options = {}) {
|
|
6
|
-
const opts = {
|
|
7
|
-
strict: false,
|
|
8
|
-
preserveUnknown: true,
|
|
9
|
-
...options,
|
|
10
|
-
};
|
|
11
|
-
if (!expression) {
|
|
12
|
-
return expression;
|
|
13
|
-
}
|
|
14
|
-
let result = expression;
|
|
15
|
-
const sortedMappings = [...mappings].sort((a, b) => b.savePath.length - a.savePath.length);
|
|
16
|
-
for (const mapping of sortedMappings) {
|
|
17
|
-
const escapedSavePath = escapeRegExp(mapping.savePath);
|
|
18
|
-
const regex = new RegExp(escapedSavePath, 'g');
|
|
19
|
-
result = result.replace(regex, mapping.displayPath);
|
|
20
|
-
}
|
|
21
|
-
return result;
|
|
22
|
-
}
|
|
23
|
-
exports.convertToDisplayFormat = convertToDisplayFormat;
|
|
24
|
-
function convertToSaveFormat(expression, mappings, options = {}) {
|
|
25
|
-
const opts = {
|
|
26
|
-
strict: false,
|
|
27
|
-
preserveUnknown: true,
|
|
28
|
-
...options,
|
|
29
|
-
};
|
|
30
|
-
if (!expression) {
|
|
31
|
-
return expression;
|
|
32
|
-
}
|
|
33
|
-
let result = expression;
|
|
34
|
-
const sortedMappings = [...mappings].sort((a, b) => b.displayPath.length - a.displayPath.length);
|
|
35
|
-
for (const mapping of sortedMappings) {
|
|
36
|
-
const escapedDisplayPath = escapeRegExp(mapping.displayPath);
|
|
37
|
-
const regex = new RegExp(escapedDisplayPath, 'g');
|
|
38
|
-
result = result.replace(regex, mapping.savePath);
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
exports.convertToSaveFormat = convertToSaveFormat;
|
|
43
|
-
function extractMappings(expression, mappings) {
|
|
44
|
-
if (!expression) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
const parsed = (0, parser_1.parseExpression)(expression);
|
|
48
|
-
const usedMappings = [];
|
|
49
|
-
for (const reference of parsed.references) {
|
|
50
|
-
const mapping = mappings.find((m) => m.displayPath.includes(reference.source) ||
|
|
51
|
-
m.savePath.includes(reference.source));
|
|
52
|
-
if (mapping && !usedMappings.includes(mapping)) {
|
|
53
|
-
usedMappings.push(mapping);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return usedMappings;
|
|
57
|
-
}
|
|
58
|
-
exports.extractMappings = extractMappings;
|
|
59
|
-
function validateExpression(expression, mappings) {
|
|
60
|
-
if (!expression) {
|
|
61
|
-
return { valid: true, missingReferences: [] };
|
|
62
|
-
}
|
|
63
|
-
const parsed = (0, parser_1.parseExpression)(expression);
|
|
64
|
-
const missingReferences = [];
|
|
65
|
-
for (const reference of parsed.references) {
|
|
66
|
-
const hasMapping = mappings.some((m) => m.displayPath.includes(reference.source) ||
|
|
67
|
-
m.savePath.includes(reference.source));
|
|
68
|
-
if (!hasMapping) {
|
|
69
|
-
missingReferences.push(`${reference.source}.${reference.path}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
valid: missingReferences.length === 0,
|
|
74
|
-
missingReferences,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
exports.validateExpression = validateExpression;
|
|
78
|
-
function escapeRegExp(str) {
|
|
79
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
80
|
-
}
|
|
81
|
-
function createResourceMapping(source, resourceId, resourceName, pathBuilder) {
|
|
82
|
-
return {
|
|
83
|
-
source,
|
|
84
|
-
resourceId,
|
|
85
|
-
resourceName,
|
|
86
|
-
displayPath: pathBuilder(source, resourceName),
|
|
87
|
-
savePath: pathBuilder(source, resourceId),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
exports.createResourceMapping = createResourceMapping;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ExpressionToken, ExpressionParserConfig, ParsedExpression } from './types';
|
|
2
|
-
export declare function parseExpression(expression: string, config?: ExpressionParserConfig): ParsedExpression;
|
|
3
|
-
export declare function stringifyExpression(tokens: ExpressionToken[], config?: ExpressionParserConfig): string;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringifyExpression = exports.parseExpression = void 0;
|
|
4
|
-
const DEFAULT_CONFIG = {
|
|
5
|
-
openDelimiter: '{{',
|
|
6
|
-
closeDelimiter: '}}',
|
|
7
|
-
trimExpressions: true,
|
|
8
|
-
};
|
|
9
|
-
function parseExpression(expression, config = {}) {
|
|
10
|
-
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
11
|
-
const tokens = [];
|
|
12
|
-
const references = [];
|
|
13
|
-
let currentPosition = 0;
|
|
14
|
-
let isDynamic = false;
|
|
15
|
-
while (currentPosition < expression.length) {
|
|
16
|
-
const openIndex = expression.indexOf(cfg.openDelimiter, currentPosition);
|
|
17
|
-
if (openIndex === -1) {
|
|
18
|
-
const remaining = expression.slice(currentPosition);
|
|
19
|
-
if (remaining) {
|
|
20
|
-
tokens.push({ type: 'text', value: remaining });
|
|
21
|
-
}
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
if (openIndex > currentPosition) {
|
|
25
|
-
tokens.push({
|
|
26
|
-
type: 'text',
|
|
27
|
-
value: expression.slice(currentPosition, openIndex),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const closeIndex = expression.indexOf(cfg.closeDelimiter, openIndex + cfg.openDelimiter.length);
|
|
31
|
-
if (closeIndex === -1) {
|
|
32
|
-
tokens.push({
|
|
33
|
-
type: 'text',
|
|
34
|
-
value: expression.slice(openIndex),
|
|
35
|
-
});
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
const rawExpression = expression.slice(openIndex, closeIndex + cfg.closeDelimiter.length);
|
|
39
|
-
let expressionContent = expression.slice(openIndex + cfg.openDelimiter.length, closeIndex);
|
|
40
|
-
if (cfg.trimExpressions) {
|
|
41
|
-
expressionContent = expressionContent.trim();
|
|
42
|
-
}
|
|
43
|
-
const referenceMatch = parseReference(expressionContent);
|
|
44
|
-
if (referenceMatch) {
|
|
45
|
-
references.push(referenceMatch);
|
|
46
|
-
}
|
|
47
|
-
tokens.push({
|
|
48
|
-
type: 'expression',
|
|
49
|
-
value: expressionContent,
|
|
50
|
-
raw: rawExpression,
|
|
51
|
-
});
|
|
52
|
-
isDynamic = true;
|
|
53
|
-
currentPosition = closeIndex + cfg.closeDelimiter.length;
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
tokens,
|
|
57
|
-
isDynamic,
|
|
58
|
-
references,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
exports.parseExpression = parseExpression;
|
|
62
|
-
function parseReference(expression) {
|
|
63
|
-
expression = expression.trim();
|
|
64
|
-
const dotMatch = expression.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\.(.+)$/);
|
|
65
|
-
if (dotMatch) {
|
|
66
|
-
return {
|
|
67
|
-
source: dotMatch[1],
|
|
68
|
-
path: dotMatch[2],
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const bracketMatch = expression.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\[['"](.+?)['"]\]$/);
|
|
72
|
-
if (bracketMatch) {
|
|
73
|
-
return {
|
|
74
|
-
source: bracketMatch[1],
|
|
75
|
-
path: bracketMatch[2],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
function stringifyExpression(tokens, config = {}) {
|
|
81
|
-
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
82
|
-
return tokens
|
|
83
|
-
.map((token) => {
|
|
84
|
-
if (token.type === 'text') {
|
|
85
|
-
return token.value;
|
|
86
|
-
}
|
|
87
|
-
if (token.type === 'expression') {
|
|
88
|
-
return token.raw || `${cfg.openDelimiter}${token.value}${cfg.closeDelimiter}`;
|
|
89
|
-
}
|
|
90
|
-
if (token.type === 'reference') {
|
|
91
|
-
return `${cfg.openDelimiter}${token.source}.${token.path}${cfg.closeDelimiter}`;
|
|
92
|
-
}
|
|
93
|
-
return '';
|
|
94
|
-
})
|
|
95
|
-
.join('');
|
|
96
|
-
}
|
|
97
|
-
exports.stringifyExpression = stringifyExpression;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface ExpressionContext {
|
|
2
|
-
[key: string]: unknown;
|
|
3
|
-
}
|
|
4
|
-
export interface ResolverOptions {
|
|
5
|
-
strict?: boolean;
|
|
6
|
-
functions?: Record<string, (...args: unknown[]) => unknown>;
|
|
7
|
-
allowNested?: boolean;
|
|
8
|
-
maxDepth?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function resolveExpression(expression: string, context: ExpressionContext, options?: ResolverOptions): unknown;
|
|
11
|
-
export declare function isDynamicExpression(expression: string): boolean;
|
|
12
|
-
export declare function extractPaths(expression: string): string[];
|