@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,8 +0,0 @@
|
|
|
1
|
-
import { UserTransactionType } from '../../../enum';
|
|
2
|
-
import { QueryPaginate } from '../type-message/base-paginate';
|
|
3
|
-
export type IPaginateUserTransactionQuery = {
|
|
4
|
-
minAmount?: number;
|
|
5
|
-
maxAmount?: number;
|
|
6
|
-
type?: UserTransactionType[];
|
|
7
|
-
userTransactionId?: string[];
|
|
8
|
-
} & QueryPaginate;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IUserCreditPurchase } from '../../models/user-credit-purchase.model';
|
|
2
|
-
import { BasePaginate } from '../type-message/base-paginate';
|
|
3
|
-
import { IResponse } from '../type-message/response';
|
|
4
|
-
export interface IGetUserCreditPurchaseAdminData {
|
|
5
|
-
userCreditPurchase: IUserCreditPurchase;
|
|
6
|
-
}
|
|
7
|
-
export type IGetUserCreditPurchaseAdminResponse = IResponse<IGetUserCreditPurchaseAdminData>;
|
|
8
|
-
export type IPaginateUserCreditPurchaseAdminResponse = IResponse<BasePaginate<IUserCreditPurchase>>;
|
|
9
|
-
export interface ICreateUserCreditPurchaseAdminData {
|
|
10
|
-
userCreditPurchase: IUserCreditPurchase;
|
|
11
|
-
}
|
|
12
|
-
export type ICreateUserCreditPurchaseAdminResponse = IResponse<ICreateUserCreditPurchaseAdminData>;
|
|
13
|
-
export interface IUpdateUserCreditPurchaseAdminData {
|
|
14
|
-
userCreditPurchase: IUserCreditPurchase;
|
|
15
|
-
}
|
|
16
|
-
export type IUpdateUserCreditPurchaseAdminResponse = IResponse<IUpdateUserCreditPurchaseAdminData>;
|
|
17
|
-
export type IDeleteUserCreditPurchaseAdminData = Record<string, never>;
|
|
18
|
-
export type IDeleteUserCreditPurchaseAdminResponse = IResponse<IDeleteUserCreditPurchaseAdminData>;
|
|
19
|
-
export interface IRefundUserCreditPurchaseAdminData {
|
|
20
|
-
userCreditPurchase: IUserCreditPurchase;
|
|
21
|
-
}
|
|
22
|
-
export type IRefundUserCreditPurchaseAdminResponse = IResponse<IRefundUserCreditPurchaseAdminData>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IUserCreditPurchase } from '../../models/user-credit-purchase.model';
|
|
2
|
-
import { BasePaginate } from '../type-message/base-paginate';
|
|
3
|
-
import { IResponse } from '../type-message/response';
|
|
4
|
-
export interface IGetUserCreditPurchaseData {
|
|
5
|
-
userCreditPurchase: IUserCreditPurchase;
|
|
6
|
-
}
|
|
7
|
-
export type IGetUserCreditPurchaseResponse = IResponse<IGetUserCreditPurchaseData>;
|
|
8
|
-
export type IPaginateUserCreditPurchaseResponse = IResponse<BasePaginate<IUserCreditPurchase>>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BasePaginate, IResponse } from '..';
|
|
2
|
-
import { IUserTransaction } from '../..';
|
|
3
|
-
export type IPaginateUserTransactionAdminResponse = IResponse<BasePaginate<IUserTransaction>>;
|
|
4
|
-
export interface ICreateUserTransactionAdminData {
|
|
5
|
-
userTransaction: IUserTransaction;
|
|
6
|
-
}
|
|
7
|
-
export type ICreateUserTransactionAdminResponse = IResponse<ICreateUserTransactionAdminData>;
|
|
8
|
-
export interface IUpdateUserTransactionAdminData {
|
|
9
|
-
userTransaction: IUserTransaction;
|
|
10
|
-
}
|
|
11
|
-
export type IUpdateUserTransactionAdminResponse = IResponse<IUpdateUserTransactionAdminData>;
|
|
12
|
-
export type IDeleteUserTransactionAdminData = Record<string, never>;
|
|
13
|
-
export type IDeleteUserTransactionAdminResponse = IResponse<IDeleteUserTransactionAdminData>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BasePaginate, IResponse } from '..';
|
|
2
|
-
import { IUserTransaction } from '../..';
|
|
3
|
-
export type IPaginateUserTransactionResponse = IResponse<BasePaginate<IUserTransaction>>;
|
|
4
|
-
export interface IGetAggregateUserTransactionData {
|
|
5
|
-
dateWithAmounts: {
|
|
6
|
-
date: Date;
|
|
7
|
-
amount: number;
|
|
8
|
-
}[];
|
|
9
|
-
totalTransactions: number;
|
|
10
|
-
}
|
|
11
|
-
export type IGetAggregateUserTransactionResponse = IResponse<IGetAggregateUserTransactionData>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SubscriptionLevel } from '../../enum';
|
|
2
|
-
import { IProject } from './project.model';
|
|
3
|
-
import { IUser } from './user.model';
|
|
4
|
-
export interface ISubscription {
|
|
5
|
-
id?: string;
|
|
6
|
-
level: SubscriptionLevel;
|
|
7
|
-
userId: string | null;
|
|
8
|
-
projectId: string | null;
|
|
9
|
-
isAutoRenewEnabled: boolean;
|
|
10
|
-
lastRenewDate: Date | null;
|
|
11
|
-
endDate: Date;
|
|
12
|
-
updatedAt?: Date;
|
|
13
|
-
createdAt?: Date;
|
|
14
|
-
project?: IProject | null;
|
|
15
|
-
user?: IUser | null;
|
|
16
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { UserCreditPurchaseCurrency, UserCreditPurchasePaymentMethod, UserCreditPurchasePlatform } from '../../enum';
|
|
2
|
-
import { IUserTransaction } from './user-transaction.model';
|
|
3
|
-
import { IUser } from './user.model';
|
|
4
|
-
export interface IUserCreditPurchase {
|
|
5
|
-
id?: string;
|
|
6
|
-
commentary: string | null;
|
|
7
|
-
platform: UserCreditPurchasePlatform;
|
|
8
|
-
paymentMethod: UserCreditPurchasePaymentMethod;
|
|
9
|
-
currency: UserCreditPurchaseCurrency;
|
|
10
|
-
amount: number;
|
|
11
|
-
metadata: Record<string, unknown>;
|
|
12
|
-
adminId: string | null;
|
|
13
|
-
userId: string;
|
|
14
|
-
userTransactionId: string;
|
|
15
|
-
refundUserTransactionId: string;
|
|
16
|
-
updatedAt?: Date;
|
|
17
|
-
createdAt?: Date;
|
|
18
|
-
user?: IUser;
|
|
19
|
-
admin?: IUser;
|
|
20
|
-
userTransaction?: IUserTransaction;
|
|
21
|
-
refundUserTransaction?: IUserTransaction;
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { UserTransactionType } from '../../enum';
|
|
2
|
-
import { IProject } from './project.model';
|
|
3
|
-
import { IUserCreditPurchase } from './user-credit-purchase.model';
|
|
4
|
-
import { IUser } from './user.model';
|
|
5
|
-
export interface IUserTransaction {
|
|
6
|
-
id?: string;
|
|
7
|
-
userId: string;
|
|
8
|
-
amount: number;
|
|
9
|
-
type: UserTransactionType;
|
|
10
|
-
description: string;
|
|
11
|
-
adminId: string | null;
|
|
12
|
-
projectId: string | null;
|
|
13
|
-
updatedAt?: Date;
|
|
14
|
-
createdAt?: Date;
|
|
15
|
-
user?: IUser;
|
|
16
|
-
admin?: IUser | null;
|
|
17
|
-
project?: IProject | null;
|
|
18
|
-
userCreditPurchase?: IUserCreditPurchase[];
|
|
19
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { OrganizationPermission, OrganizationRole } from '../types/enum';
|
|
2
|
-
export declare const ORGANIZATION_ROLE_PERMISSIONS: Record<OrganizationRole, OrganizationPermission[]>;
|
|
3
|
-
export declare function getEffectiveOrgPermissions(role: OrganizationRole, customPermissions: OrganizationPermission[] | null): OrganizationPermission[];
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEffectiveOrgPermissions = exports.ORGANIZATION_ROLE_PERMISSIONS = void 0;
|
|
4
|
-
const enum_1 = require("../types/enum");
|
|
5
|
-
exports.ORGANIZATION_ROLE_PERMISSIONS = {
|
|
6
|
-
[enum_1.OrganizationRole.OWNER]: Object.values(enum_1.OrganizationPermission),
|
|
7
|
-
[enum_1.OrganizationRole.ADMIN]: [
|
|
8
|
-
enum_1.OrganizationPermission.ORG_UPDATE,
|
|
9
|
-
enum_1.OrganizationPermission.ORG_BILLING_READ,
|
|
10
|
-
enum_1.OrganizationPermission.ORG_BILLING_MANAGE,
|
|
11
|
-
enum_1.OrganizationPermission.MEMBER_INVITE,
|
|
12
|
-
enum_1.OrganizationPermission.MEMBER_REMOVE,
|
|
13
|
-
enum_1.OrganizationPermission.MEMBER_UPDATE_ROLE,
|
|
14
|
-
enum_1.OrganizationPermission.TEAM_CREATE,
|
|
15
|
-
enum_1.OrganizationPermission.TEAM_UPDATE,
|
|
16
|
-
enum_1.OrganizationPermission.TEAM_DELETE,
|
|
17
|
-
enum_1.OrganizationPermission.PROJECT_CREATE,
|
|
18
|
-
enum_1.OrganizationPermission.PROJECT_DELETE,
|
|
19
|
-
enum_1.OrganizationPermission.TICKET_READ,
|
|
20
|
-
enum_1.OrganizationPermission.TICKET_CREATE,
|
|
21
|
-
enum_1.OrganizationPermission.TICKET_MANAGE,
|
|
22
|
-
],
|
|
23
|
-
[enum_1.OrganizationRole.MEMBER]: [
|
|
24
|
-
enum_1.OrganizationPermission.PROJECT_CREATE,
|
|
25
|
-
enum_1.OrganizationPermission.TICKET_READ,
|
|
26
|
-
enum_1.OrganizationPermission.TICKET_CREATE,
|
|
27
|
-
],
|
|
28
|
-
[enum_1.OrganizationRole.VIEWER]: [enum_1.OrganizationPermission.TICKET_READ],
|
|
29
|
-
};
|
|
30
|
-
function getEffectiveOrgPermissions(role, customPermissions) {
|
|
31
|
-
if (customPermissions !== null) {
|
|
32
|
-
return customPermissions;
|
|
33
|
-
}
|
|
34
|
-
return exports.ORGANIZATION_ROLE_PERMISSIONS[role];
|
|
35
|
-
}
|
|
36
|
-
exports.getEffectiveOrgPermissions = getEffectiveOrgPermissions;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ISubscription, ProjectSubscriptionConfig, SubscriptionLevel, UserSubscriptionConfig } from '../types';
|
|
2
|
-
export declare const isSubscriptionExpired: (endDate: Date) => boolean;
|
|
3
|
-
export declare const getUserSubscriptionConfig: (subscription?: ISubscription | null) => UserSubscriptionConfig['BASE'];
|
|
4
|
-
export declare const getProjectSubscriptionConfig: (subscription?: ISubscription | null) => ProjectSubscriptionConfig['BASE'];
|
|
5
|
-
export declare const subscriptionLevelToExplicit: (level: SubscriptionLevel) => string;
|
|
6
|
-
export declare const storagePrice: (level: SubscriptionLevel, amountFile: number) => number;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.storagePrice = exports.subscriptionLevelToExplicit = exports.getProjectSubscriptionConfig = exports.getUserSubscriptionConfig = exports.isSubscriptionExpired = void 0;
|
|
4
|
-
const date_fns_1 = require("date-fns");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
const isSubscriptionExpired = (endDate) => {
|
|
7
|
-
return (0, date_fns_1.isAfter)(new Date(), new Date(endDate));
|
|
8
|
-
};
|
|
9
|
-
exports.isSubscriptionExpired = isSubscriptionExpired;
|
|
10
|
-
const getUserSubscriptionConfig = (subscription) => {
|
|
11
|
-
if (subscription && !(0, exports.isSubscriptionExpired)(subscription.endDate)) {
|
|
12
|
-
return types_1.USER_SUBSCRIPTION_CONFIG[subscription.level];
|
|
13
|
-
}
|
|
14
|
-
return types_1.USER_SUBSCRIPTION_CONFIG[types_1.SubscriptionLevel.BASE];
|
|
15
|
-
};
|
|
16
|
-
exports.getUserSubscriptionConfig = getUserSubscriptionConfig;
|
|
17
|
-
const getProjectSubscriptionConfig = (subscription) => {
|
|
18
|
-
if (subscription && !(0, exports.isSubscriptionExpired)(subscription.endDate)) {
|
|
19
|
-
return types_1.PROJECT_SUBSCRIPTION_CONFIG[subscription.level];
|
|
20
|
-
}
|
|
21
|
-
return types_1.PROJECT_SUBSCRIPTION_CONFIG[types_1.SubscriptionLevel.BASE];
|
|
22
|
-
};
|
|
23
|
-
exports.getProjectSubscriptionConfig = getProjectSubscriptionConfig;
|
|
24
|
-
const subscriptionLevelToExplicit = (level) => {
|
|
25
|
-
switch (level) {
|
|
26
|
-
case types_1.SubscriptionLevel.BASE:
|
|
27
|
-
return types_1.SubscriptionLevel.BASE;
|
|
28
|
-
case types_1.SubscriptionLevel.ADVANCED:
|
|
29
|
-
return types_1.SubscriptionLevel.ADVANCED;
|
|
30
|
-
case types_1.SubscriptionLevel.PREMIUM:
|
|
31
|
-
return types_1.SubscriptionLevel.PREMIUM;
|
|
32
|
-
default:
|
|
33
|
-
return types_1.SubscriptionLevel.BASE;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.subscriptionLevelToExplicit = subscriptionLevelToExplicit;
|
|
37
|
-
const storagePrice = (level, amountFile) => {
|
|
38
|
-
return Math.floor(Math.max(0, amountFile - types_1.PROJECT_SUBSCRIPTION_CONFIG[level].ABYSS_STORAGE.freeFilePerDay) *
|
|
39
|
-
types_1.PROJECT_SUBSCRIPTION_CONFIG[level].ABYSS_STORAGE.creditPerFilePerDay);
|
|
40
|
-
};
|
|
41
|
-
exports.storagePrice = storagePrice;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function uuid(): string;
|
|
2
|
-
export declare function random(min: number, max: number): number;
|
|
3
|
-
export declare function now(): number;
|
|
4
|
-
export declare function isoDate(): string;
|
|
5
|
-
export declare const PIPE_OPERATIONS: Record<string, (value: unknown, ...args: unknown[]) => unknown>;
|
|
6
|
-
export declare const BUILT_IN_FUNCTIONS: Record<string, (...args: unknown[]) => unknown>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BUILT_IN_FUNCTIONS = exports.PIPE_OPERATIONS = exports.isoDate = exports.now = exports.random = exports.uuid = void 0;
|
|
4
|
-
function uuid() {
|
|
5
|
-
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
6
|
-
return crypto.randomUUID();
|
|
7
|
-
}
|
|
8
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
|
|
9
|
-
const r = (Math.random() * 16) | 0;
|
|
10
|
-
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
11
|
-
return v.toString(16);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
exports.uuid = uuid;
|
|
15
|
-
function random(min, max) {
|
|
16
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
17
|
-
}
|
|
18
|
-
exports.random = random;
|
|
19
|
-
function now() {
|
|
20
|
-
return Date.now();
|
|
21
|
-
}
|
|
22
|
-
exports.now = now;
|
|
23
|
-
function isoDate() {
|
|
24
|
-
return new Date().toISOString();
|
|
25
|
-
}
|
|
26
|
-
exports.isoDate = isoDate;
|
|
27
|
-
exports.PIPE_OPERATIONS = {
|
|
28
|
-
lower: (value) => String(value).toLowerCase(),
|
|
29
|
-
upper: (value) => String(value).toUpperCase(),
|
|
30
|
-
trim: (value) => String(value).trim(),
|
|
31
|
-
length: (value) => (Array.isArray(value) ? value.length : String(value).length),
|
|
32
|
-
abs: (value) => Math.abs(Number(value)),
|
|
33
|
-
round: (value) => Math.round(Number(value)),
|
|
34
|
-
floor: (value) => Math.floor(Number(value)),
|
|
35
|
-
ceil: (value) => Math.ceil(Number(value)),
|
|
36
|
-
json: (value) => JSON.stringify(value),
|
|
37
|
-
parse: (value) => {
|
|
38
|
-
try {
|
|
39
|
-
return JSON.parse(String(value));
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
isNumber: (value) => typeof value === 'number' && !isNaN(value),
|
|
46
|
-
isString: (value) => typeof value === 'string',
|
|
47
|
-
isArray: (value) => Array.isArray(value),
|
|
48
|
-
isObject: (value) => typeof value === 'object' && value !== null,
|
|
49
|
-
};
|
|
50
|
-
exports.BUILT_IN_FUNCTIONS = {
|
|
51
|
-
uuid,
|
|
52
|
-
random: (...args) => random(Number(args[0]), Number(args[1])),
|
|
53
|
-
now,
|
|
54
|
-
isoDate,
|
|
55
|
-
min: (...args) => Math.min(...args.map(Number)),
|
|
56
|
-
max: (...args) => Math.max(...args.map(Number)),
|
|
57
|
-
abs: (...args) => Math.abs(Number(args[0])),
|
|
58
|
-
round: (...args) => Math.round(Number(args[0])),
|
|
59
|
-
floor: (...args) => Math.floor(Number(args[0])),
|
|
60
|
-
ceil: (...args) => Math.ceil(Number(args[0])),
|
|
61
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type ExpressionMappingOptions } from '../../expressions';
|
|
2
|
-
import type { WorkflowResourceMapping, DataSourceType } from './expression.types';
|
|
3
|
-
export declare function convertToDisplayFormat(expression: string, mappings: WorkflowResourceMapping[], options?: ExpressionMappingOptions): string;
|
|
4
|
-
export declare function convertToSaveFormat(expression: string, mappings: WorkflowResourceMapping[], options?: ExpressionMappingOptions): string;
|
|
5
|
-
export declare function extractMappings(expression: string, mappings: WorkflowResourceMapping[]): WorkflowResourceMapping[];
|
|
6
|
-
export declare function validateExpression(expression: string, mappings: WorkflowResourceMapping[]): {
|
|
7
|
-
valid: boolean;
|
|
8
|
-
missingReferences: string[];
|
|
9
|
-
};
|
|
10
|
-
export declare function createWorkflowResourceMapping(source: DataSourceType, resourceId: string, resourceName: string): WorkflowResourceMapping;
|
|
11
|
-
export declare function buildPathSegment(source: DataSourceType, identifier: string): string;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildPathSegment = exports.createWorkflowResourceMapping = exports.validateExpression = exports.extractMappings = exports.convertToSaveFormat = exports.convertToDisplayFormat = void 0;
|
|
4
|
-
const expressions_1 = require("../../expressions");
|
|
5
|
-
function convertToDisplayFormat(expression, mappings, options) {
|
|
6
|
-
return (0, expressions_1.convertToDisplayFormat)(expression, mappings, options);
|
|
7
|
-
}
|
|
8
|
-
exports.convertToDisplayFormat = convertToDisplayFormat;
|
|
9
|
-
function convertToSaveFormat(expression, mappings, options) {
|
|
10
|
-
return (0, expressions_1.convertToSaveFormat)(expression, mappings, options);
|
|
11
|
-
}
|
|
12
|
-
exports.convertToSaveFormat = convertToSaveFormat;
|
|
13
|
-
function extractMappings(expression, mappings) {
|
|
14
|
-
return (0, expressions_1.extractMappings)(expression, mappings);
|
|
15
|
-
}
|
|
16
|
-
exports.extractMappings = extractMappings;
|
|
17
|
-
function validateExpression(expression, mappings) {
|
|
18
|
-
return (0, expressions_1.validateExpression)(expression, mappings);
|
|
19
|
-
}
|
|
20
|
-
exports.validateExpression = validateExpression;
|
|
21
|
-
function createWorkflowResourceMapping(source, resourceId, resourceName) {
|
|
22
|
-
return (0, expressions_1.createResourceMapping)(source, resourceId, resourceName, buildPathSegment);
|
|
23
|
-
}
|
|
24
|
-
exports.createWorkflowResourceMapping = createWorkflowResourceMapping;
|
|
25
|
-
function buildPathSegment(source, identifier) {
|
|
26
|
-
const escapedId = identifier.replace(/[.\[\]]/g, '\\$&');
|
|
27
|
-
if (/[\s."']/.test(identifier)) {
|
|
28
|
-
return `${source}["${identifier}"]`;
|
|
29
|
-
}
|
|
30
|
-
return `${source}.${escapedId}`;
|
|
31
|
-
}
|
|
32
|
-
exports.buildPathSegment = buildPathSegment;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ResourceMapping } from './expression.types';
|
|
2
|
-
export declare function convertExpressionToSaveFormat(expression: string, mappings: ResourceMapping[]): string;
|
|
3
|
-
export declare function convertExpressionToDisplayFormat(expression: string, mappings: ResourceMapping[]): string;
|
|
4
|
-
export declare function extractExpressionTokens(text: string): string[];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractExpressionTokens = exports.convertExpressionToDisplayFormat = exports.convertExpressionToSaveFormat = void 0;
|
|
4
|
-
const expression_tokenizer_utils_1 = require("./expression-tokenizer.utils");
|
|
5
|
-
function convertExpressionToSaveFormat(expression, mappings) {
|
|
6
|
-
if (!expression || mappings.length === 0) {
|
|
7
|
-
return expression;
|
|
8
|
-
}
|
|
9
|
-
let result = expression;
|
|
10
|
-
const sortedMappings = [...mappings].sort((a, b) => b.displayPath.length - a.displayPath.length);
|
|
11
|
-
for (const mapping of sortedMappings) {
|
|
12
|
-
const displayPattern = escapeRegExp(mapping.displayPath);
|
|
13
|
-
const regex = new RegExp(displayPattern, 'g');
|
|
14
|
-
result = result.replace(regex, mapping.savePath);
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
exports.convertExpressionToSaveFormat = convertExpressionToSaveFormat;
|
|
19
|
-
function convertExpressionToDisplayFormat(expression, mappings) {
|
|
20
|
-
if (!expression || mappings.length === 0) {
|
|
21
|
-
return expression;
|
|
22
|
-
}
|
|
23
|
-
let result = expression;
|
|
24
|
-
const sortedMappings = [...mappings].sort((a, b) => b.savePath.length - a.savePath.length);
|
|
25
|
-
for (const mapping of sortedMappings) {
|
|
26
|
-
const savePattern = escapeRegExp(mapping.savePath);
|
|
27
|
-
const regex = new RegExp(savePattern, 'g');
|
|
28
|
-
result = result.replace(regex, mapping.displayPath);
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
exports.convertExpressionToDisplayFormat = convertExpressionToDisplayFormat;
|
|
33
|
-
function escapeRegExp(str) {
|
|
34
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
35
|
-
}
|
|
36
|
-
function extractExpressionTokens(text) {
|
|
37
|
-
const tokens = (0, expression_tokenizer_utils_1.tokenize)(text);
|
|
38
|
-
const expressions = tokens
|
|
39
|
-
.filter((token) => token.type === 'expression')
|
|
40
|
-
.map((token) => token.value);
|
|
41
|
-
return Array.from(new Set(expressions));
|
|
42
|
-
}
|
|
43
|
-
exports.extractExpressionTokens = extractExpressionTokens;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTruthy = exports.resolveExpressions = exports.resolvePathValue = void 0;
|
|
4
|
-
const expression_tokenizer_utils_1 = require("./expression-tokenizer.utils");
|
|
5
|
-
function resolvePathValue(path, context) {
|
|
6
|
-
const segments = (0, expression_tokenizer_utils_1.parsePathSegments)(path);
|
|
7
|
-
let current = context;
|
|
8
|
-
for (const segment of segments) {
|
|
9
|
-
if (current === null || current === undefined) {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
if (/^\d+$/.test(segment) && Array.isArray(current)) {
|
|
13
|
-
current = current[Number(segment)];
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
current = current[segment];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return current;
|
|
20
|
-
}
|
|
21
|
-
exports.resolvePathValue = resolvePathValue;
|
|
22
|
-
function resolveExpressions(text, context) {
|
|
23
|
-
return text.replace(/\{\{(.+?)\}\}/g, (match, path) => {
|
|
24
|
-
const trimmedPath = path.trim();
|
|
25
|
-
const value = resolvePathValue(trimmedPath, context);
|
|
26
|
-
if (value === undefined || value === null) {
|
|
27
|
-
return match;
|
|
28
|
-
}
|
|
29
|
-
if (typeof value === 'object') {
|
|
30
|
-
return JSON.stringify(value);
|
|
31
|
-
}
|
|
32
|
-
return String(value);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.resolveExpressions = resolveExpressions;
|
|
36
|
-
function isTruthy(value) {
|
|
37
|
-
if (value === null || value === undefined) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (typeof value === 'boolean') {
|
|
41
|
-
return value;
|
|
42
|
-
}
|
|
43
|
-
if (typeof value === 'number') {
|
|
44
|
-
return value !== 0;
|
|
45
|
-
}
|
|
46
|
-
if (typeof value === 'string') {
|
|
47
|
-
return value.length > 0;
|
|
48
|
-
}
|
|
49
|
-
if (Array.isArray(value)) {
|
|
50
|
-
return value.length > 0;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
exports.isTruthy = isTruthy;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ExpressionToken, DataSourceType } from './expression.types';
|
|
2
|
-
export declare function detectDataSource(path: string): DataSourceType | null;
|
|
3
|
-
export declare function tokenize(text: string): ExpressionToken[];
|
|
4
|
-
export declare function parsePathSegments(path: string): string[];
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parsePathSegments = exports.tokenize = exports.detectDataSource = void 0;
|
|
4
|
-
const expression_types_1 = require("./expression.types");
|
|
5
|
-
const EXPRESSION_PATTERN = /\{\{(.+?)\}\}/g;
|
|
6
|
-
const REFERENCE_PATTERN = /@(\w+):([a-zA-Z0-9-_]+)/g;
|
|
7
|
-
const DATA_SOURCE_PREFIXES = {
|
|
8
|
-
trigger: expression_types_1.DataSourceType.WORKFLOW_TRIGGER,
|
|
9
|
-
triggerData: expression_types_1.DataSourceType.WORKFLOW_TRIGGER,
|
|
10
|
-
steps: expression_types_1.DataSourceType.WORKFLOW_STEPS,
|
|
11
|
-
variables: expression_types_1.DataSourceType.WORKFLOW_VARIABLES,
|
|
12
|
-
secret: expression_types_1.DataSourceType.SECRETS,
|
|
13
|
-
ipAddress: expression_types_1.DataSourceType.IP_ADDRESSES,
|
|
14
|
-
domain: expression_types_1.DataSourceType.DOMAINS,
|
|
15
|
-
abyss: expression_types_1.DataSourceType.ABYSS_CONFIG,
|
|
16
|
-
app: expression_types_1.DataSourceType.APPLICATIONS,
|
|
17
|
-
project: expression_types_1.DataSourceType.PROJECT,
|
|
18
|
-
env: expression_types_1.DataSourceType.ENV,
|
|
19
|
-
fn: expression_types_1.DataSourceType.FUNCTIONS,
|
|
20
|
-
};
|
|
21
|
-
function detectDataSource(path) {
|
|
22
|
-
const firstDot = path.indexOf('.');
|
|
23
|
-
const firstBracket = path.indexOf('[');
|
|
24
|
-
let prefix;
|
|
25
|
-
if (firstDot === -1 && firstBracket === -1) {
|
|
26
|
-
prefix = path;
|
|
27
|
-
}
|
|
28
|
-
else if (firstDot === -1) {
|
|
29
|
-
prefix = path.substring(0, firstBracket);
|
|
30
|
-
}
|
|
31
|
-
else if (firstBracket === -1) {
|
|
32
|
-
prefix = path.substring(0, firstDot);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
prefix = path.substring(0, Math.min(firstDot, firstBracket));
|
|
36
|
-
}
|
|
37
|
-
return DATA_SOURCE_PREFIXES[prefix] || null;
|
|
38
|
-
}
|
|
39
|
-
exports.detectDataSource = detectDataSource;
|
|
40
|
-
function tokenize(text) {
|
|
41
|
-
const tokens = [];
|
|
42
|
-
let lastIndex = 0;
|
|
43
|
-
const expressionMatches = Array.from(text.matchAll(EXPRESSION_PATTERN));
|
|
44
|
-
for (const match of expressionMatches) {
|
|
45
|
-
const matchIndex = match.index;
|
|
46
|
-
if (matchIndex > lastIndex) {
|
|
47
|
-
tokens.push({
|
|
48
|
-
type: 'text',
|
|
49
|
-
value: text.substring(lastIndex, matchIndex),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
tokens.push({
|
|
53
|
-
type: 'expression',
|
|
54
|
-
value: match[1].trim(),
|
|
55
|
-
raw: match[0],
|
|
56
|
-
});
|
|
57
|
-
lastIndex = matchIndex + match[0].length;
|
|
58
|
-
}
|
|
59
|
-
if (lastIndex < text.length) {
|
|
60
|
-
tokens.push({
|
|
61
|
-
type: 'text',
|
|
62
|
-
value: text.substring(lastIndex),
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
const referenceMatches = Array.from(text.matchAll(REFERENCE_PATTERN));
|
|
66
|
-
for (const match of referenceMatches) {
|
|
67
|
-
tokens.push({
|
|
68
|
-
type: 'reference',
|
|
69
|
-
entityType: match[1],
|
|
70
|
-
entityId: match[2],
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
return tokens;
|
|
74
|
-
}
|
|
75
|
-
exports.tokenize = tokenize;
|
|
76
|
-
function parsePathSegments(path) {
|
|
77
|
-
const segments = [];
|
|
78
|
-
let current = '';
|
|
79
|
-
let inBrackets = false;
|
|
80
|
-
let quoteChar = null;
|
|
81
|
-
for (let i = 0; i < path.length; i++) {
|
|
82
|
-
const char = path[i];
|
|
83
|
-
if (quoteChar) {
|
|
84
|
-
if (char === quoteChar && path[i - 1] !== '\\') {
|
|
85
|
-
quoteChar = null;
|
|
86
|
-
}
|
|
87
|
-
else if (char !== quoteChar) {
|
|
88
|
-
current += char;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else if (char === '"' || char === "'") {
|
|
92
|
-
quoteChar = char;
|
|
93
|
-
}
|
|
94
|
-
else if (char === '[') {
|
|
95
|
-
if (current) {
|
|
96
|
-
segments.push(current);
|
|
97
|
-
current = '';
|
|
98
|
-
}
|
|
99
|
-
inBrackets = true;
|
|
100
|
-
}
|
|
101
|
-
else if (char === ']') {
|
|
102
|
-
if (current) {
|
|
103
|
-
segments.push(current);
|
|
104
|
-
current = '';
|
|
105
|
-
}
|
|
106
|
-
inBrackets = false;
|
|
107
|
-
}
|
|
108
|
-
else if (char === '.' && !inBrackets) {
|
|
109
|
-
if (current) {
|
|
110
|
-
segments.push(current);
|
|
111
|
-
current = '';
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
current += char;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (current) {
|
|
119
|
-
segments.push(current);
|
|
120
|
-
}
|
|
121
|
-
return segments;
|
|
122
|
-
}
|
|
123
|
-
exports.parsePathSegments = parsePathSegments;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ResourceMapping as GenericResourceMapping } from '../../expressions';
|
|
2
|
-
export declare enum DataSourceType {
|
|
3
|
-
WORKFLOW_TRIGGER = "trigger",
|
|
4
|
-
WORKFLOW_STEPS = "steps",
|
|
5
|
-
WORKFLOW_VARIABLES = "variables",
|
|
6
|
-
SECRETS = "secret",
|
|
7
|
-
IP_ADDRESSES = "ipAddress",
|
|
8
|
-
DOMAINS = "domain",
|
|
9
|
-
APPLICATIONS = "app",
|
|
10
|
-
ABYSS_CONFIG = "abyss",
|
|
11
|
-
PROJECT = "project",
|
|
12
|
-
ENV = "env",
|
|
13
|
-
FUNCTIONS = "fn"
|
|
14
|
-
}
|
|
15
|
-
export type WorkflowResourceMapping = GenericResourceMapping<DataSourceType>;
|
|
16
|
-
export interface WorkflowExpressionContext {
|
|
17
|
-
trigger?: Record<string, unknown>;
|
|
18
|
-
steps?: Record<string, unknown>;
|
|
19
|
-
variables?: Record<string, unknown>;
|
|
20
|
-
secret?: Record<string, unknown>;
|
|
21
|
-
ipAddress?: Record<string, unknown>;
|
|
22
|
-
domain?: Record<string, unknown>;
|
|
23
|
-
app?: Record<string, unknown>;
|
|
24
|
-
abyss?: Record<string, unknown>;
|
|
25
|
-
project?: Record<string, unknown>;
|
|
26
|
-
env?: Record<string, unknown>;
|
|
27
|
-
}
|
|
28
|
-
export interface WorkflowExpressionResult {
|
|
29
|
-
value: unknown;
|
|
30
|
-
success: boolean;
|
|
31
|
-
error?: string;
|
|
32
|
-
accessedSources: DataSourceType[];
|
|
33
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataSourceType = void 0;
|
|
4
|
-
var DataSourceType;
|
|
5
|
-
(function (DataSourceType) {
|
|
6
|
-
DataSourceType["WORKFLOW_TRIGGER"] = "trigger";
|
|
7
|
-
DataSourceType["WORKFLOW_STEPS"] = "steps";
|
|
8
|
-
DataSourceType["WORKFLOW_VARIABLES"] = "variables";
|
|
9
|
-
DataSourceType["SECRETS"] = "secret";
|
|
10
|
-
DataSourceType["IP_ADDRESSES"] = "ipAddress";
|
|
11
|
-
DataSourceType["DOMAINS"] = "domain";
|
|
12
|
-
DataSourceType["APPLICATIONS"] = "app";
|
|
13
|
-
DataSourceType["ABYSS_CONFIG"] = "abyss";
|
|
14
|
-
DataSourceType["PROJECT"] = "project";
|
|
15
|
-
DataSourceType["ENV"] = "env";
|
|
16
|
-
DataSourceType["FUNCTIONS"] = "fn";
|
|
17
|
-
})(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type { WorkflowResourceMapping, WorkflowExpressionContext, WorkflowExpressionResult, } from './expression.types';
|
|
2
|
-
export { DataSourceType } from './expression.types';
|
|
3
|
-
export { convertToDisplayFormat, convertToSaveFormat, extractMappings, validateExpression, createWorkflowResourceMapping, buildPathSegment, } from './expression-mapper';
|
|
4
|
-
export { resolveWorkflowExpression, isWorkflowExpressionDynamic, extractDataSources, validateWorkflowExpression, } from './workflow-resolver';
|
|
5
|
-
export type { ExpressionMappingOptions, ExpressionParserConfig, ResolverOptions, } from '../../expressions';
|
|
6
|
-
export { parseExpression, stringifyExpression, isDynamicExpression, extractPaths, } from '../../expressions';
|
|
7
|
-
export * from './expression-resolver.utils';
|
|
8
|
-
export * from './expression-tokenizer.utils';
|
|
9
|
-
export * from './expression-functions.utils';
|
|
10
|
-
export * from './expression-mapping.utils';
|