@activepieces/shared
Advanced tools
Comparing version 0.10.106 to 0.10.107
{ | ||
"name": "@activepieces/shared", | ||
"version": "0.10.106", | ||
"version": "0.10.107", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -65,3 +65,4 @@ export * from './lib/flows/actions/action'; | ||
export * from './lib/support-url'; | ||
export * from './lib/license-keys'; | ||
export * from './lib/invitations'; | ||
export * from './lib/flow-run/execution/flow-execution'; |
@@ -103,2 +103,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./lib/support-url"), exports); | ||
tslib_1.__exportStar(require("./lib/license-keys"), exports); | ||
tslib_1.__exportStar(require("./lib/invitations"), exports); | ||
@@ -105,0 +106,0 @@ // Look at https://github.com/sinclairzx81/typebox/issues/350 |
@@ -13,3 +13,3 @@ import { FileId } from '../file/file'; | ||
} | ||
type ErrorParams = AuthenticationParams | AuthorizationErrorParams | ConfigNotFoundErrorParams | EmailIsNotVerifiedErrorParams | EngineOperationFailureParams | EntityNotFoundErrorParams | ExecutionTimeoutErrorParams | ExistingUserErrorParams | FileNotFoundErrorParams | FlowFormNotFoundError | FlowNotFoundErrorParams | FlowIsLockedErrorParams | FlowOperationErrorParams | FlowRunNotFoundErrorParams | InvalidApiKeyParams | InvalidAppConnectionParams | InvalidBearerTokenParams | InvalidClaimParams | InvalidCloudClaimParams | InvalidCredentialsErrorParams | InvalidJwtTokenErrorParams | InvalidOtpParams | InvalidSAMLResponseParams | InvitationOnlySignUpParams | JobRemovalFailureErrorParams | OpenAiFailedErrorParams | PauseMetadataMissingErrorParams | PermissionDeniedErrorParams | PieceNotFoundErrorParams | PieceTriggerNotFoundErrorParams | QuotaExceededParams | FeatureDisabledErrorParams | SignUpDisabledParams | StepNotFoundErrorParams | SystemInvalidErrorParams | SystemPropNotDefinedErrorParams | TestTriggerFailedErrorParams | TriggerDisableErrorParams | TriggerEnableErrorParams | TriggerFailedErrorParams | ValidationErrorParams | InvitationOnlySignUpParams | UserIsInActiveErrorParams | DomainIsNotAllowedErrorParams | EmailAuthIsDisabledParams | ExistingAlertChannelErrorParams; | ||
type ErrorParams = AuthenticationParams | AuthorizationErrorParams | ConfigNotFoundErrorParams | EmailIsNotVerifiedErrorParams | EngineOperationFailureParams | EntityNotFoundErrorParams | ExecutionTimeoutErrorParams | ExistingUserErrorParams | FileNotFoundErrorParams | FlowFormNotFoundError | FlowNotFoundErrorParams | FlowIsLockedErrorParams | FlowOperationErrorParams | FlowRunNotFoundErrorParams | InvalidApiKeyParams | InvalidAppConnectionParams | InvalidBearerTokenParams | InvalidClaimParams | InvalidCloudClaimParams | InvalidCredentialsErrorParams | InvalidJwtTokenErrorParams | InvalidOtpParams | InvalidSAMLResponseParams | InvitationOnlySignUpParams | JobRemovalFailureErrorParams | OpenAiFailedErrorParams | PauseMetadataMissingErrorParams | PermissionDeniedErrorParams | PieceNotFoundErrorParams | PieceTriggerNotFoundErrorParams | QuotaExceededParams | FeatureDisabledErrorParams | SignUpDisabledParams | StepNotFoundErrorParams | SystemInvalidErrorParams | SystemPropNotDefinedErrorParams | TestTriggerFailedErrorParams | TriggerDisableErrorParams | TriggerEnableErrorParams | TriggerFailedErrorParams | ValidationErrorParams | InvitationOnlySignUpParams | UserIsInActiveErrorParams | DomainIsNotAllowedErrorParams | EmailAuthIsDisabledParams | ExistingAlertChannelErrorParams | ActivationKeyNotFoundParams | ActivationKeyNotAlreadyActivated | EmailAlreadyHasActivationKey; | ||
export type BaseErrorParams<T, V> = { | ||
@@ -143,4 +143,4 @@ code: T; | ||
export type QuotaExceededParams = BaseErrorParams<ErrorCode.QUOTA_EXCEEDED, { | ||
metric: 'connections' | 'tasks' | 'bots' | 'datasource' | 'team-members'; | ||
quota: number; | ||
metric: 'tasks' | 'team-members'; | ||
quota?: number; | ||
}>; | ||
@@ -161,2 +161,11 @@ export type FeatureDisabledErrorParams = BaseErrorParams<ErrorCode.FEATURE_DISABLED, { | ||
export type InvalidOtpParams = BaseErrorParams<ErrorCode.INVALID_OTP, Record<string, never>>; | ||
export type ActivationKeyNotFoundParams = BaseErrorParams<ErrorCode.ACTIVATION_KEY_NOT_FOUND, { | ||
key: string; | ||
}>; | ||
export type ActivationKeyNotAlreadyActivated = BaseErrorParams<ErrorCode.ACTIVATION_KEY_ALREADY_ACTIVATED, { | ||
key: string; | ||
}>; | ||
export type EmailAlreadyHasActivationKey = BaseErrorParams<ErrorCode.EMAIL_ALREADY_HAS_ACTIVATION_KEY, { | ||
email: string; | ||
}>; | ||
export declare enum ErrorCode { | ||
@@ -208,4 +217,7 @@ AUTHENTICATION = "AUTHENTICATION", | ||
USER_IS_INACTIVE = "USER_IS_INACTIVE", | ||
VALIDATION = "VALIDATION" | ||
VALIDATION = "VALIDATION", | ||
ACTIVATION_KEY_NOT_FOUND = "ACTIVATION_KEY_NOT_FOUND", | ||
ACTIVATION_KEY_ALREADY_ACTIVATED = "ACTIVATION_KEY_ALREADY_ACTIVATED", | ||
EMAIL_ALREADY_HAS_ACTIVATION_KEY = "EMAIL_ALREADY_HAS_ACTIVATION_KEY" | ||
} | ||
export {}; |
@@ -59,3 +59,6 @@ "use strict"; | ||
ErrorCode["VALIDATION"] = "VALIDATION"; | ||
ErrorCode["ACTIVATION_KEY_NOT_FOUND"] = "ACTIVATION_KEY_NOT_FOUND"; | ||
ErrorCode["ACTIVATION_KEY_ALREADY_ACTIVATED"] = "ACTIVATION_KEY_ALREADY_ACTIVATED"; | ||
ErrorCode["EMAIL_ALREADY_HAS_ACTIVATION_KEY"] = "EMAIL_ALREADY_HAS_ACTIVATION_KEY"; | ||
})(ErrorCode || (exports.ErrorCode = ErrorCode = {})); | ||
//# sourceMappingURL=activepieces-error.js.map |
@@ -50,12 +50,21 @@ import { RunEnvironment } from '../flow-run/flow-run'; | ||
}; | ||
type RequestTrialSubmitted = { | ||
fullName: string; | ||
email: string; | ||
numberOfEmployees: string; | ||
companyName: string; | ||
goal: string; | ||
}; | ||
type RequestTrialClicked = { | ||
feature: string | null; | ||
location: string; | ||
}; | ||
type KeyActiviated = { | ||
date: string; | ||
key: string; | ||
}; | ||
type UpgradeClicked = { | ||
limitType?: 'team' | 'connections'; | ||
limit: number; | ||
limitType?: 'team'; | ||
}; | ||
type UpgradePopup = { | ||
limitType?: 'team' | 'connections'; | ||
limit: number; | ||
limitType?: 'team'; | ||
}; | ||
@@ -100,2 +109,3 @@ type ReferralLinkCopied = { | ||
REQUEST_TRIAL_SUBMITTED = "request.trial.submitted", | ||
KEY_ACTIVIATED = "key.activated", | ||
FLOW_ISSUE_CLICKED = "flow.issue.clicked", | ||
@@ -130,3 +140,3 @@ FLOW_ISSUE_RESOLVED = "flow.issue.resolved", | ||
}; | ||
export type TelemetryEvent = BaseTelemetryEvent<TelemetryEventName.SIGNED_UP, SignedUp> | BaseTelemetryEvent<TelemetryEventName.REFERRAL, Referral> | BaseTelemetryEvent<TelemetryEventName.REQUEST_TRIAL_CLICKED, RequestTrialClicked> | BaseTelemetryEvent<TelemetryEventName.REQUEST_TRIAL_SUBMITTED, Record<string, never>> | BaseTelemetryEvent<TelemetryEventName.FLOW_ISSUE_CLICKED, FlowIssueClicked> | BaseTelemetryEvent<TelemetryEventName.FLOW_ISSUE_RESOLVED, FlowIssueResolved> | BaseTelemetryEvent<TelemetryEventName.UPGRADE_CLICKED, UpgradeClicked> | BaseTelemetryEvent<TelemetryEventName.UPGRADE_POPUP, UpgradePopup> | BaseTelemetryEvent<TelemetryEventName.FLOW_RUN_CREATED, RunCreated> | BaseTelemetryEvent<TelemetryEventName.FLOW_PUBLISHED, FlowPublished> | BaseTelemetryEvent<TelemetryEventName.QUOTA_ALERT, QuotaAlert> | BaseTelemetryEvent<TelemetryEventName.CREATED_FLOW, FlowCreated> | BaseTelemetryEvent<TelemetryEventName.TEMPLATE_SEARCH, TemplateSearch> | BaseTelemetryEvent<TelemetryEventName.PIECES_SEARCH, PiecesSearch> | BaseTelemetryEvent<TelemetryEventName.FLOW_IMPORTED, FlowImported> | BaseTelemetryEvent<TelemetryEventName.FLOW_IMPORTED_USING_FILE, FlowImportedUsingFile> | BaseTelemetryEvent<TelemetryEventName.REFERRAL_LINK_COPIED, ReferralLinkCopied> | BaseTelemetryEvent<TelemetryEventName.FLOW_SHARED, FlowShared> | BaseTelemetryEvent<TelemetryEventName.DEMO_IMPORTED, Record<string, never>> | BaseTelemetryEvent<TelemetryEventName.OPENED_PRICING_FROM_DASHBOARD, OpenedFromDasahboard> | BaseTelemetryEvent<TelemetryEventName.COPILOT_GENERATED_CODE, CopilotGeneratedCode> | BaseTelemetryEvent<TelemetryEventName.FORMS_VIEWED, FormsViewed> | BaseTelemetryEvent<TelemetryEventName.USER_INVITED, UserInvited> | BaseTelemetryEvent<TelemetryEventName.FORMS_SUBMITTED, FormsViewed> | BaseTelemetryEvent<TelemetryEventName.REWARDS_OPENED, RewardButtonClicked> | BaseTelemetryEvent<TelemetryEventName.REWARDS_INSTRUCTION_CLICKED, RewardInstructionsClicked>; | ||
export type TelemetryEvent = BaseTelemetryEvent<TelemetryEventName.SIGNED_UP, SignedUp> | BaseTelemetryEvent<TelemetryEventName.REFERRAL, Referral> | BaseTelemetryEvent<TelemetryEventName.REQUEST_TRIAL_CLICKED, RequestTrialClicked> | BaseTelemetryEvent<TelemetryEventName.KEY_ACTIVIATED, KeyActiviated> | BaseTelemetryEvent<TelemetryEventName.REQUEST_TRIAL_SUBMITTED, RequestTrialSubmitted> | BaseTelemetryEvent<TelemetryEventName.FLOW_ISSUE_CLICKED, FlowIssueClicked> | BaseTelemetryEvent<TelemetryEventName.FLOW_ISSUE_RESOLVED, FlowIssueResolved> | BaseTelemetryEvent<TelemetryEventName.UPGRADE_CLICKED, UpgradeClicked> | BaseTelemetryEvent<TelemetryEventName.UPGRADE_POPUP, UpgradePopup> | BaseTelemetryEvent<TelemetryEventName.FLOW_RUN_CREATED, RunCreated> | BaseTelemetryEvent<TelemetryEventName.FLOW_PUBLISHED, FlowPublished> | BaseTelemetryEvent<TelemetryEventName.QUOTA_ALERT, QuotaAlert> | BaseTelemetryEvent<TelemetryEventName.CREATED_FLOW, FlowCreated> | BaseTelemetryEvent<TelemetryEventName.TEMPLATE_SEARCH, TemplateSearch> | BaseTelemetryEvent<TelemetryEventName.PIECES_SEARCH, PiecesSearch> | BaseTelemetryEvent<TelemetryEventName.FLOW_IMPORTED, FlowImported> | BaseTelemetryEvent<TelemetryEventName.FLOW_IMPORTED_USING_FILE, FlowImportedUsingFile> | BaseTelemetryEvent<TelemetryEventName.REFERRAL_LINK_COPIED, ReferralLinkCopied> | BaseTelemetryEvent<TelemetryEventName.FLOW_SHARED, FlowShared> | BaseTelemetryEvent<TelemetryEventName.DEMO_IMPORTED, Record<string, never>> | BaseTelemetryEvent<TelemetryEventName.OPENED_PRICING_FROM_DASHBOARD, OpenedFromDasahboard> | BaseTelemetryEvent<TelemetryEventName.COPILOT_GENERATED_CODE, CopilotGeneratedCode> | BaseTelemetryEvent<TelemetryEventName.FORMS_VIEWED, FormsViewed> | BaseTelemetryEvent<TelemetryEventName.USER_INVITED, UserInvited> | BaseTelemetryEvent<TelemetryEventName.FORMS_SUBMITTED, FormsViewed> | BaseTelemetryEvent<TelemetryEventName.REWARDS_OPENED, RewardButtonClicked> | BaseTelemetryEvent<TelemetryEventName.REWARDS_INSTRUCTION_CLICKED, RewardInstructionsClicked>; | ||
export {}; |
@@ -10,2 +10,3 @@ "use strict"; | ||
TelemetryEventName["REQUEST_TRIAL_SUBMITTED"] = "request.trial.submitted"; | ||
TelemetryEventName["KEY_ACTIVIATED"] = "key.activated"; | ||
TelemetryEventName["FLOW_ISSUE_CLICKED"] = "flow.issue.clicked"; | ||
@@ -12,0 +13,0 @@ TelemetryEventName["FLOW_ISSUE_RESOLVED"] = "flow.issue.resolved"; |
export declare function deleteProperties(obj: Record<string, unknown>, props: string[]): { | ||
[x: string]: unknown; | ||
}; | ||
export declare const spreadIfDefined: <T>(key: string, value: T | null | undefined) => Record<string, T>; | ||
export declare const spreadIfDefined: <T>(key: string, value: T | undefined | null) => Record<string, T>; | ||
export declare function deleteProps<T extends Record<string, unknown>, K extends keyof T>(obj: T, prop: K[]): Omit<T, K>; | ||
@@ -6,0 +6,0 @@ export declare function applyFunctionToValuesSync<T>(obj: unknown, apply: (str: unknown) => unknown): T; |
export declare function isString(str: unknown): str is string; | ||
export declare function isNil<T>(value: T | null | undefined): value is null | undefined; | ||
export declare function kebabCase(str: string): string; | ||
export declare function isEmpty<T>(value: T | null | undefined): boolean; | ||
export declare function startCase(str: string): string; | ||
export declare function camelCase(str: string): string; | ||
export declare function pickBy<T extends Record<string, unknown>>(object: T, predicate: (value: T[keyof T], key: keyof T) => boolean): Partial<T>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.pickBy = exports.isEmpty = exports.isNil = exports.isString = void 0; | ||
exports.pickBy = exports.camelCase = exports.startCase = exports.isEmpty = exports.kebabCase = exports.isNil = exports.isString = void 0; | ||
function isString(str) { | ||
@@ -12,2 +12,11 @@ return str != null && typeof str === 'string'; | ||
exports.isNil = isNil; | ||
function kebabCase(str) { | ||
return str | ||
.replace(/([a-z])([A-Z])/g, '$1-$2') // Handle camelCase by adding hyphen between lowercase and uppercase letters | ||
.replace(/\s+/g, '-') // Replace spaces with hyphens | ||
.replace(/_/g, '-') // Replace underscores with hyphens | ||
.toLowerCase() // Convert to lowercase | ||
.replace(/^-+|-+$/g, ''); // Remove leading and trailing hyphens | ||
} | ||
exports.kebabCase = kebabCase; | ||
function isEmpty(value) { | ||
@@ -26,2 +35,18 @@ if (value == null) { | ||
exports.isEmpty = isEmpty; | ||
function startCase(str) { | ||
return str | ||
.replace(/([a-z])([A-Z])/g, '$1 $2') | ||
.replace(/[_-]+/g, ' ') | ||
.replace(/\s+/g, ' ') | ||
.replace(/^[a-z]/, match => match.toUpperCase()) | ||
.replace(/\b[a-z]/g, match => match.toUpperCase()); | ||
} | ||
exports.startCase = startCase; | ||
function camelCase(str) { | ||
return str | ||
.replace(/([-_][a-z])/g, group => group.toUpperCase() | ||
.replace('-', '') | ||
.replace('_', '')); | ||
} | ||
exports.camelCase = camelCase; | ||
function pickBy(object, predicate) { | ||
@@ -28,0 +53,0 @@ return Object.keys(object).reduce((result, key) => { |
@@ -24,2 +24,3 @@ import { BaseModel } from '../common/base-model'; | ||
EDITION = "EDITION", | ||
IS_CLOUD_PLATFORM = "IS_CLOUD_PLATFORM", | ||
EMAIL_AUTH_ENABLED = "EMAIL_AUTH_ENABLED", | ||
@@ -26,0 +27,0 @@ ENVIRONMENT = "ENVIRONMENT", |
@@ -24,2 +24,3 @@ "use strict"; | ||
ApFlagId["EDITION"] = "EDITION"; | ||
ApFlagId["IS_CLOUD_PLATFORM"] = "IS_CLOUD_PLATFORM"; | ||
ApFlagId["EMAIL_AUTH_ENABLED"] = "EMAIL_AUTH_ENABLED"; | ||
@@ -26,0 +27,0 @@ ApFlagId["ENVIRONMENT"] = "ENVIRONMENT"; |
@@ -7,3 +7,3 @@ import { Static } from '@sinclair/typebox'; | ||
tags: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>>; | ||
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof FlowRunStatus>>; | ||
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<typeof FlowRunStatus>>>; | ||
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>; | ||
@@ -10,0 +10,0 @@ cursor: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; |
@@ -10,3 +10,3 @@ "use strict"; | ||
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String({}))), | ||
status: typebox_1.Type.Optional(typebox_1.Type.Enum(flow_execution_1.FlowRunStatus)), | ||
status: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Enum(flow_execution_1.FlowRunStatus))), | ||
limit: typebox_1.Type.Optional(typebox_1.Type.Number({})), | ||
@@ -13,0 +13,0 @@ cursor: typebox_1.Type.Optional(typebox_1.Type.String({})), |
@@ -25,2 +25,17 @@ import { Static } from '@sinclair/typebox'; | ||
export type UserInvitation = Static<typeof UserInvitation>; | ||
export declare const UserInvitationWithLink: import("@sinclair/typebox").TComposite<[import("@sinclair/typebox").TObject<{ | ||
email: import("@sinclair/typebox").TString<string>; | ||
status: import("@sinclair/typebox").TEnum<typeof InvitationStatus>; | ||
type: import("@sinclair/typebox").TEnum<typeof InvitationType>; | ||
platformId: import("@sinclair/typebox").TString<string>; | ||
platformRole: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TEnum<typeof PlatformRole>, import("@sinclair/typebox").TNull]>>; | ||
projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
projectRole: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TEnum<typeof ProjectMemberRole>, import("@sinclair/typebox").TNull]>>; | ||
id: import("@sinclair/typebox").TString<string>; | ||
created: import("@sinclair/typebox").TString<string>; | ||
updated: import("@sinclair/typebox").TString<string>; | ||
}>, import("@sinclair/typebox").TObject<{ | ||
link: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>; | ||
}>]>; | ||
export type UserInvitationWithLink = Static<typeof UserInvitationWithLink>; | ||
export declare const SendUserInvitationRequest: import("@sinclair/typebox").TObject<{ | ||
@@ -27,0 +42,0 @@ email: import("@sinclair/typebox").TString<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ListUserInvitationsRequest = exports.AcceptUserInvitationRequest = exports.SendUserInvitationRequest = exports.UserInvitation = exports.InvitationStatus = exports.InvitationType = void 0; | ||
exports.ListUserInvitationsRequest = exports.AcceptUserInvitationRequest = exports.SendUserInvitationRequest = exports.UserInvitationWithLink = exports.UserInvitation = exports.InvitationStatus = exports.InvitationType = void 0; | ||
const typebox_1 = require("@sinclair/typebox"); | ||
@@ -19,2 +19,5 @@ const common_1 = require("../common"); | ||
exports.UserInvitation = typebox_1.Type.Object(Object.assign(Object.assign({}, common_1.BaseModelSchema), { email: typebox_1.Type.String(), status: typebox_1.Type.Enum(InvitationStatus), type: typebox_1.Type.Enum(InvitationType), platformId: typebox_1.Type.String(), platformRole: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Enum(index_1.PlatformRole), typebox_1.Type.Null()])), projectId: typebox_1.Type.Optional(typebox_1.Type.String()), projectRole: typebox_1.Type.Optional(typebox_1.Type.Union([typebox_1.Type.Enum(project_1.ProjectMemberRole), typebox_1.Type.Null()])) })); | ||
exports.UserInvitationWithLink = typebox_1.Type.Composite([exports.UserInvitation, typebox_1.Type.Object({ | ||
link: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
})]); | ||
exports.SendUserInvitationRequest = typebox_1.Type.Object({ | ||
@@ -21,0 +24,0 @@ email: typebox_1.Type.String(), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
533177
263
7261