@activepieces/shared
Advanced tools
Comparing version 0.10.134 to 0.10.135
{ | ||
"name": "@activepieces/shared", | ||
"version": "0.10.134", | ||
"version": "0.10.135", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -76,3 +76,4 @@ export * from './lib/flows/actions/action'; | ||
export * from './lib/flow-run/log-serializer'; | ||
export * from './lib/flows/operations/paste-operations'; | ||
export * from './lib/license-keys'; | ||
export * from './lib/flow-run/execution/flow-execution'; |
@@ -79,2 +79,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./lib/flow-run/log-serializer"), exports); | ||
tslib_1.__exportStar(require("./lib/flows/operations/paste-operations"), exports); | ||
// Look at https://github.com/sinclairzx81/typebox/issues/350 | ||
@@ -81,0 +82,0 @@ const system_1 = require("@sinclair/typebox/system"); |
@@ -16,5 +16,5 @@ import { Static } from '@sinclair/typebox'; | ||
id: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
created: import("@sinclair/typebox").TString; | ||
updated: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
baseUrl: import("@sinclair/typebox").TString; | ||
@@ -21,0 +21,0 @@ provider: import("@sinclair/typebox").TString; |
import { ApId } from '../../common/id-generator'; | ||
import { PlatformId } from '../../platform'; | ||
import { ProjectId } from '../../project/project'; | ||
import { WorkerMachineType } from '../../workers'; | ||
import { PrincipalType } from './principal-type'; | ||
@@ -18,8 +17,2 @@ export type Principal = { | ||
type: PrincipalType.WORKER; | ||
platform: { | ||
id: ApId; | ||
} | null; | ||
worker: { | ||
type: WorkerMachineType; | ||
}; | ||
}; | ||
@@ -26,0 +19,0 @@ export type EnginePrincipal = { |
@@ -14,3 +14,3 @@ import { FileId } from '../file'; | ||
} | ||
export type ApErrorParams = 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 | EmailAlreadyHasActivationKey | ProviderProxyConfigNotFoundParams | AITokenLimitExceededParams | SessionExpiredParams | InvalidLicenseKeyParams | NoChatResponseParams | InvalidSmtpCredentialsErrorParams | InvalidGitCredentialsParams; | ||
export type ApErrorParams = 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 | EmailAlreadyHasActivationKey | ProviderProxyConfigNotFoundParams | AITokenLimitExceededParams | SessionExpiredParams | InvalidLicenseKeyParams | NoChatResponseParams | InvalidSmtpCredentialsErrorParams | InvalidGitCredentialsParams | ProjectExternalIdAlreadyExistsParams; | ||
export type BaseErrorParams<T, V> = { | ||
@@ -186,2 +186,5 @@ code: T; | ||
}>; | ||
export type ProjectExternalIdAlreadyExistsParams = BaseErrorParams<ErrorCode.PROJECT_EXTERNAL_ID_ALREADY_EXISTS, { | ||
externalId: string; | ||
}>; | ||
export declare enum ErrorCode { | ||
@@ -201,2 +204,3 @@ NO_CHAT_RESPONSE = "NO_CHAT_RESPONSE", | ||
EXISTING_ALERT_CHANNEL = "EXISTING_ALERT_CHANNEL", | ||
PROJECT_EXTERNAL_ID_ALREADY_EXISTS = "PROJECT_EXTERNAL_ID_ALREADY_EXISTS", | ||
FLOW_FORM_NOT_FOUND = "FLOW_FORM_NOT_FOUND", | ||
@@ -203,0 +207,0 @@ FILE_NOT_FOUND = "FILE_NOT_FOUND", |
@@ -26,2 +26,3 @@ "use strict"; | ||
ErrorCode["EXISTING_ALERT_CHANNEL"] = "EXISTING_ALERT_CHANNEL"; | ||
ErrorCode["PROJECT_EXTERNAL_ID_ALREADY_EXISTS"] = "PROJECT_EXTERNAL_ID_ALREADY_EXISTS"; | ||
ErrorCode["FLOW_FORM_NOT_FOUND"] = "FLOW_FORM_NOT_FOUND"; | ||
@@ -28,0 +29,0 @@ ErrorCode["FILE_NOT_FOUND"] = "FILE_NOT_FOUND"; |
@@ -7,32 +7,36 @@ "use strict"; | ||
function _deleteAction(flowVersion, request) { | ||
return flow_structure_util_1.flowStructureUtil.transferFlow(flowVersion, (parentStep) => { | ||
if (parentStep.nextAction && parentStep.nextAction.name === request.name) { | ||
const stepToUpdate = parentStep.nextAction; | ||
parentStep.nextAction = stepToUpdate.nextAction; | ||
} | ||
switch (parentStep.type) { | ||
case action_1.ActionType.LOOP_ON_ITEMS: { | ||
if (parentStep.firstLoopAction && | ||
parentStep.firstLoopAction.name === request.name) { | ||
const stepToUpdate = parentStep.firstLoopAction; | ||
parentStep.firstLoopAction = stepToUpdate.nextAction; | ||
} | ||
break; | ||
let clonedVersion = flowVersion; | ||
for (const name of request.names) { | ||
clonedVersion = flow_structure_util_1.flowStructureUtil.transferFlow(clonedVersion, (parentStep) => { | ||
if (parentStep.nextAction && parentStep.nextAction.name === name) { | ||
const stepToUpdate = parentStep.nextAction; | ||
parentStep.nextAction = stepToUpdate.nextAction; | ||
} | ||
case action_1.ActionType.ROUTER: { | ||
parentStep.children = parentStep.children.map((child) => { | ||
var _a; | ||
if (child && child.name === request.name) { | ||
return (_a = child.nextAction) !== null && _a !== void 0 ? _a : null; | ||
switch (parentStep.type) { | ||
case action_1.ActionType.LOOP_ON_ITEMS: { | ||
if (parentStep.firstLoopAction && | ||
parentStep.firstLoopAction.name === name) { | ||
const stepToUpdate = parentStep.firstLoopAction; | ||
parentStep.firstLoopAction = stepToUpdate.nextAction; | ||
} | ||
return child; | ||
}); | ||
break; | ||
break; | ||
} | ||
case action_1.ActionType.ROUTER: { | ||
parentStep.children = parentStep.children.map((child) => { | ||
var _a; | ||
if (child && child.name === name) { | ||
return (_a = child.nextAction) !== null && _a !== void 0 ? _a : null; | ||
} | ||
return child; | ||
}); | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
return parentStep; | ||
}); | ||
return parentStep; | ||
}); | ||
} | ||
return clonedVersion; | ||
} | ||
//# sourceMappingURL=delete-action.js.map |
@@ -8,64 +8,11 @@ "use strict"; | ||
const flow_structure_util_1 = require("../util/flow-structure-util"); | ||
const add_action_util_1 = require("./add-action-util"); | ||
const import_flow_1 = require("./import-flow"); | ||
const _1 = require("."); | ||
function findUnusedName(existingNames, prefix) { | ||
let index = 1; | ||
let name = `${prefix}_${index}`; | ||
while (existingNames.includes(name)) { | ||
index++; | ||
name = `${prefix}_${index}`; | ||
} | ||
return name; | ||
} | ||
function mapToNewNames(flowVersion, clonedAction) { | ||
const existingNames = flow_structure_util_1.flowStructureUtil.getAllSteps(flowVersion.trigger) | ||
.map(step => step.name); | ||
const oldStepNames = flow_structure_util_1.flowStructureUtil.getAllSteps(clonedAction) | ||
.map(step => step.name); | ||
return oldStepNames.reduce((nameMap, oldName) => { | ||
const newName = findUnusedName(existingNames, 'step'); | ||
existingNames.push(newName); | ||
return Object.assign(Object.assign({}, nameMap), { [oldName]: newName }); | ||
}, {}); | ||
} | ||
function replaceOldStepNameWithNewOne({ input, oldStepName, newStepName, }) { | ||
const regex = /{{(.*?)}}/g; // Regular expression to match strings inside {{ }} | ||
return input.replace(regex, (match, content) => { | ||
// Replace the content inside {{ }} using the provided function | ||
const replacedContent = content.replaceAll(new RegExp(`\\b${oldStepName}\\b`, 'g'), `${newStepName}`); | ||
// Reconstruct the {{ }} with the replaced content | ||
return `{{${replacedContent}}}`; | ||
}); | ||
} | ||
function clone(step, oldNameToNewName) { | ||
step.displayName = `${step.displayName} Copy`; | ||
step.name = oldNameToNewName[step.name]; | ||
if ('input' in step.settings) { | ||
Object.keys(oldNameToNewName).forEach((oldName) => { | ||
const settings = step.settings; | ||
settings.input = (0, common_1.applyFunctionToValuesSync)(settings.input, (value) => { | ||
if ((0, common_1.isString)(value)) { | ||
return replaceOldStepNameWithNewOne({ | ||
input: value, | ||
oldStepName: oldName, | ||
newStepName: oldNameToNewName[oldName], | ||
}); | ||
} | ||
return value; | ||
}); | ||
}); | ||
} | ||
if (step.settings.inputUiInfo) { | ||
step.settings.inputUiInfo.currentSelectedData = undefined; | ||
step.settings.inputUiInfo.sampleDataFileId = undefined; | ||
step.settings.inputUiInfo.lastTestDate = undefined; | ||
} | ||
return step; | ||
} | ||
function _duplicateStep(stepName, flowVersion) { | ||
const clonedAction = JSON.parse(JSON.stringify(flow_structure_util_1.flowStructureUtil.getActionOrThrow(stepName, flowVersion.trigger))); | ||
const clonedActionWithoutNextAction = Object.assign(Object.assign({}, clonedAction), { nextAction: undefined }); | ||
const oldNameToNewName = mapToNewNames(flowVersion, clonedActionWithoutNextAction); | ||
const oldNameToNewName = add_action_util_1.addActionUtls.mapToNewNames(flowVersion, [clonedActionWithoutNextAction]); | ||
const clonedSubflow = flow_structure_util_1.flowStructureUtil.transferStep(clonedActionWithoutNextAction, (step) => { | ||
return clone(step, oldNameToNewName); | ||
return add_action_util_1.addActionUtls.clone(step, oldNameToNewName); | ||
}); | ||
@@ -99,5 +46,5 @@ const importOperations = (0, import_flow_1._getImportOperations)(clonedSubflow); | ||
if (!(0, common_1.isNil)(childRouter)) { | ||
const oldNameToNewName = mapToNewNames(flowVersion, childRouter); | ||
const oldNameToNewName = add_action_util_1.addActionUtls.mapToNewNames(flowVersion, [childRouter]); | ||
const clonedSubflow = flow_structure_util_1.flowStructureUtil.transferStep(childRouter, (step) => { | ||
return clone(step, oldNameToNewName); | ||
return add_action_util_1.addActionUtls.clone(step, oldNameToNewName); | ||
}); | ||
@@ -104,0 +51,0 @@ const importOperations = (0, import_flow_1._getImportOperations)(clonedSubflow); |
@@ -8,16 +8,8 @@ "use strict"; | ||
const trigger_1 = require("../triggers/trigger"); | ||
const flow_structure_util_1 = require("../util/flow-structure-util"); | ||
const index_1 = require("./index"); | ||
function getAllActionsThatDoesNotHaveParent(trigger) { | ||
const actions = []; | ||
let currentAction = trigger.nextAction; | ||
while (!(0, common_1.isNil)(currentAction)) { | ||
actions.push(currentAction); | ||
currentAction = currentAction.nextAction; | ||
} | ||
return actions; | ||
} | ||
function createDeleteActionOperation(actionName) { | ||
return { | ||
type: index_1.FlowOperationType.DELETE_ACTION, | ||
request: { name: actionName }, | ||
request: { names: [actionName] }, | ||
}; | ||
@@ -120,3 +112,3 @@ } | ||
function _importFlow(flowVersion, request) { | ||
const existingActions = getAllActionsThatDoesNotHaveParent(flowVersion.trigger); | ||
const existingActions = flow_structure_util_1.flowStructureUtil.getAllNextActionsWithoutChildren(flowVersion.trigger); | ||
const deleteOperations = existingActions.map(action => createDeleteActionOperation(action.name)); | ||
@@ -123,0 +115,0 @@ const importOperations = _getImportOperations(request.trigger); |
@@ -14,2 +14,3 @@ "use strict"; | ||
const add_branch_1 = require("./add-branch"); | ||
const copy_action_operations_1 = require("./copy-action-operations"); | ||
const delete_action_1 = require("./delete-action"); | ||
@@ -21,2 +22,3 @@ const delete_branch_1 = require("./delete-branch"); | ||
const move_action_1 = require("./move-action"); | ||
const paste_operations_1 = require("./paste-operations"); | ||
const skip_action_1 = require("./skip-action"); | ||
@@ -56,3 +58,3 @@ const update_action_1 = require("./update-action"); | ||
exports.SkipActionRequest = typebox_1.Type.Object({ | ||
name: typebox_1.Type.String(), | ||
names: typebox_1.Type.Array(typebox_1.Type.String()), | ||
skip: typebox_1.Type.Boolean(), | ||
@@ -86,3 +88,3 @@ }); | ||
exports.DeleteActionRequest = typebox_1.Type.Object({ | ||
name: typebox_1.Type.String(), | ||
names: typebox_1.Type.Array(typebox_1.Type.String()), | ||
}); | ||
@@ -220,2 +222,4 @@ exports.UpdateActionRequest = typebox_1.Type.Union([ | ||
exports.flowOperations = { | ||
getActionsForCopy: copy_action_operations_1._getActionsForCopy, | ||
getOperationsForPaste: paste_operations_1._getOperationsForPaste, | ||
apply(flowVersion, operation) { | ||
@@ -222,0 +226,0 @@ let clonedVersion = JSON.parse(JSON.stringify(flowVersion)); |
@@ -15,3 +15,3 @@ "use strict"; | ||
request: { | ||
name: request.name, | ||
names: [request.name], | ||
}, | ||
@@ -18,0 +18,0 @@ }, |
@@ -7,3 +7,3 @@ "use strict"; | ||
return flow_structure_util_1.flowStructureUtil.transferFlow(flowVersion, (stepToUpdate) => { | ||
if (stepToUpdate.name !== request.name) { | ||
if (!request.names.includes(stepToUpdate.name)) { | ||
return stepToUpdate; | ||
@@ -10,0 +10,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { Action, ActionType, BranchCondition, BranchExecutionType } from '../actions/action'; | ||
import { Action, ActionType, BranchCondition, BranchExecutionType, LoopOnItemsAction, RouterAction } from '../actions/action'; | ||
import { FlowVersion } from '../flow-version'; | ||
@@ -8,4 +8,4 @@ import { Trigger, TriggerType } from '../triggers/trigger'; | ||
}; | ||
declare function isAction(type: ActionType | TriggerType | undefined): boolean; | ||
declare function isTrigger(type: ActionType | TriggerType | undefined): boolean; | ||
declare function isAction(type: ActionType | TriggerType | undefined): type is ActionType; | ||
declare function isTrigger(type: ActionType | TriggerType | undefined): type is TriggerType; | ||
declare function getActionOrThrow(name: string, flowRoot: Step): Action; | ||
@@ -19,3 +19,5 @@ declare function getTriggerOrThrow(name: string, flowRoot: Step): Trigger; | ||
declare function findPathToStep(trigger: Trigger, targetStepName: string): StepWithIndex[]; | ||
declare function getAllChildSteps(action: LoopOnItemsAction | RouterAction): Step[]; | ||
declare function isChildOf(parent: Step, childStepName: string): boolean; | ||
declare function getAllNextActionsWithoutChildren(start: Step): Step[]; | ||
export declare const flowStructureUtil: { | ||
@@ -54,4 +56,6 @@ isTrigger: typeof isTrigger; | ||
isChildOf: typeof isChildOf; | ||
findUnusedName: (trigger: Trigger) => string; | ||
findUnusedName: (source: Trigger | string[]) => string; | ||
getAllNextActionsWithoutChildren: typeof getAllNextActionsWithoutChildren; | ||
getAllChildSteps: typeof getAllChildSteps; | ||
}; | ||
export {}; |
@@ -122,4 +122,4 @@ "use strict"; | ||
} | ||
const findUnusedName = (trigger) => { | ||
const names = exports.flowStructureUtil.getAllSteps(trigger).map((f) => f.name); | ||
const findUnusedName = (source) => { | ||
const names = Array.isArray(source) ? source : exports.flowStructureUtil.getAllSteps(source).map((f) => f.name); | ||
let index = 1; | ||
@@ -133,2 +133,11 @@ let name = 'step_1'; | ||
}; | ||
function getAllNextActionsWithoutChildren(start) { | ||
const actions = []; | ||
let currentAction = start.nextAction; | ||
while (!(0, common_1.isNil)(currentAction)) { | ||
actions.push(currentAction); | ||
currentAction = currentAction.nextAction; | ||
} | ||
return actions; | ||
} | ||
exports.flowStructureUtil = { | ||
@@ -148,3 +157,5 @@ isTrigger, | ||
findUnusedName, | ||
getAllNextActionsWithoutChildren, | ||
getAllChildSteps, | ||
}; | ||
//# sourceMappingURL=flow-structure-util.js.map |
@@ -37,5 +37,5 @@ import { Static } from '@sinclair/typebox'; | ||
id: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
created: import("@sinclair/typebox").TString; | ||
updated: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
projectId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string | null>>; | ||
@@ -42,0 +42,0 @@ status: import("@sinclair/typebox").TEnum<typeof InvitationStatus>; |
@@ -96,6 +96,3 @@ import { Static } from '@sinclair/typebox'; | ||
}>; | ||
id: import("@sinclair/typebox").TString; | ||
name: import("@sinclair/typebox").TString; | ||
created: import("@sinclair/typebox").TString; | ||
updated: import("@sinclair/typebox").TString; | ||
ownerId: import("@sinclair/typebox").TString; | ||
@@ -129,5 +126,4 @@ primaryColor: import("@sinclair/typebox").TString; | ||
emailAuthEnabled: import("@sinclair/typebox").TBoolean; | ||
licenseKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
pinnedPieces: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>; | ||
}>; | ||
export type PlatformWithoutSensitiveData = Static<typeof PlatformWithoutSensitiveData>; |
@@ -35,3 +35,34 @@ "use strict"; | ||
smtp: typebox_1.Type.Optional(typebox_1.Type.Object({})), | ||
}), typebox_1.Type.Omit(exports.Platform, ['smtp', 'federatedAuthProviders', 'defaultLocale'])]); | ||
}), typebox_1.Type.Pick(exports.Platform, [ | ||
'ownerId', | ||
'name', | ||
'primaryColor', | ||
'logoIconUrl', | ||
'fullLogoUrl', | ||
'favIconUrl', | ||
'filteredPieceNames', | ||
'filteredPieceBehavior', | ||
'cloudAuthEnabled', | ||
'gitSyncEnabled', | ||
'analyticsEnabled', | ||
'showPoweredBy', | ||
'auditLogEnabled', | ||
'embeddingEnabled', | ||
'managePiecesEnabled', | ||
'manageTemplatesEnabled', | ||
'customAppearanceEnabled', | ||
'manageProjectsEnabled', | ||
'projectRolesEnabled', | ||
'customDomainsEnabled', | ||
'globalConnectionsEnabled', | ||
'customRolesEnabled', | ||
'apiKeysEnabled', | ||
'flowIssuesEnabled', | ||
'alertsEnabled', | ||
'ssoEnabled', | ||
'enforceAllowedAuthDomains', | ||
'allowedAuthDomains', | ||
'emailAuthEnabled', | ||
'pinnedPieces', | ||
])]); | ||
//# sourceMappingURL=platform.model.js.map |
@@ -60,7 +60,7 @@ import { Static } from '@sinclair/typebox'; | ||
externalId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
ownerId: import("@sinclair/typebox").TString; | ||
id: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
created: import("@sinclair/typebox").TString; | ||
updated: import("@sinclair/typebox").TString; | ||
ownerId: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
notifyStatus: import("@sinclair/typebox").TEnum<typeof NotificationStatus>; | ||
@@ -67,0 +67,0 @@ usage: import("@sinclair/typebox").TObject<{ |
@@ -6,6 +6,2 @@ import { Static } from '@sinclair/typebox'; | ||
} | ||
export declare enum WorkerMachineType { | ||
DEDICATED = "DEDICATED", | ||
SHARED = "SHARED" | ||
} | ||
export declare const MachineInformation: import("@sinclair/typebox").TObject<{ | ||
@@ -26,4 +22,2 @@ cpuUsagePercentage: import("@sinclair/typebox").TNumber; | ||
export declare const WorkerMachine: import("@sinclair/typebox").TObject<{ | ||
platformId: import("@sinclair/typebox").TString; | ||
type: import("@sinclair/typebox").TEnum<typeof WorkerMachineType>; | ||
information: import("@sinclair/typebox").TObject<{ | ||
@@ -48,7 +42,5 @@ cpuUsagePercentage: import("@sinclair/typebox").TNumber; | ||
export declare const WorkerMachineWithStatus: import("@sinclair/typebox").TObject<{ | ||
type: import("@sinclair/typebox").TEnum<typeof WorkerMachineType>; | ||
id: import("@sinclair/typebox").TString; | ||
created: import("@sinclair/typebox").TString; | ||
updated: import("@sinclair/typebox").TString; | ||
platformId: import("@sinclair/typebox").TString; | ||
information: import("@sinclair/typebox").TObject<{ | ||
@@ -84,1 +76,25 @@ cpuUsagePercentage: import("@sinclair/typebox").TNumber; | ||
export type WorkerMachineHealthcheckRequest = Static<typeof WorkerMachineHealthcheckRequest>; | ||
export declare const WorkerMachineHealthcheckResponse: import("@sinclair/typebox").TObject<{ | ||
TRIGGER_TIMEOUT_SECONDS: import("@sinclair/typebox").TNumber; | ||
PAUSED_FLOW_TIMEOUT_DAYS: import("@sinclair/typebox").TNumber; | ||
EXECUTION_MODE: import("@sinclair/typebox").TString; | ||
FLOW_TIMEOUT_SECONDS: import("@sinclair/typebox").TNumber; | ||
FLOW_WORKER_CONCURRENCY: import("@sinclair/typebox").TNumber; | ||
SCHEDULED_WORKER_CONCURRENCY: import("@sinclair/typebox").TNumber; | ||
LOG_LEVEL: import("@sinclair/typebox").TString; | ||
LOG_PRETTY: import("@sinclair/typebox").TString; | ||
ENVIRONMENT: import("@sinclair/typebox").TString; | ||
APP_WEBHOOK_SECRETS: import("@sinclair/typebox").TString; | ||
MAX_FILE_SIZE_MB: import("@sinclair/typebox").TNumber; | ||
SANDBOX_MEMORY_LIMIT: import("@sinclair/typebox").TString; | ||
SANDBOX_PROPAGATED_ENV_VARS: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>; | ||
PIECES_SOURCE: import("@sinclair/typebox").TString; | ||
DEV_PIECES: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>; | ||
SENTRY_DSN: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
LOKI_PASSWORD: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
LOKI_URL: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
LOKI_USERNAME: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>; | ||
FILE_STORAGE_LOCATION: import("@sinclair/typebox").TString; | ||
S3_USE_SIGNED_URLS: import("@sinclair/typebox").TString; | ||
}>; | ||
export type WorkerMachineHealthcheckResponse = Static<typeof WorkerMachineHealthcheckResponse>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WorkerMachineHealthcheckRequest = exports.WorkerMachineWithStatus = exports.WorkerMachine = exports.MachineInformation = exports.WorkerMachineType = exports.WorkerMachineStatus = void 0; | ||
exports.WorkerMachineHealthcheckResponse = exports.WorkerMachineHealthcheckRequest = exports.WorkerMachineWithStatus = exports.WorkerMachine = exports.MachineInformation = exports.WorkerMachineStatus = void 0; | ||
const typebox_1 = require("@sinclair/typebox"); | ||
const common_1 = require("../common"); | ||
const id_generator_1 = require("../common/id-generator"); | ||
var WorkerMachineStatus; | ||
@@ -12,7 +11,2 @@ (function (WorkerMachineStatus) { | ||
})(WorkerMachineStatus || (exports.WorkerMachineStatus = WorkerMachineStatus = {})); | ||
var WorkerMachineType; | ||
(function (WorkerMachineType) { | ||
WorkerMachineType["DEDICATED"] = "DEDICATED"; | ||
WorkerMachineType["SHARED"] = "SHARED"; | ||
})(WorkerMachineType || (exports.WorkerMachineType = WorkerMachineType = {})); | ||
exports.MachineInformation = typebox_1.Type.Object({ | ||
@@ -31,3 +25,3 @@ cpuUsagePercentage: typebox_1.Type.Number(), | ||
}); | ||
exports.WorkerMachine = typebox_1.Type.Object(Object.assign(Object.assign({}, common_1.BaseModelSchema), { platformId: id_generator_1.ApId, type: typebox_1.Type.Enum(WorkerMachineType), information: exports.MachineInformation })); | ||
exports.WorkerMachine = typebox_1.Type.Object(Object.assign(Object.assign({}, common_1.BaseModelSchema), { information: exports.MachineInformation })); | ||
exports.WorkerMachineWithStatus = typebox_1.Type.Composite([exports.WorkerMachine, typebox_1.Type.Object({ | ||
@@ -37,2 +31,25 @@ status: typebox_1.Type.Enum(WorkerMachineStatus), | ||
exports.WorkerMachineHealthcheckRequest = exports.MachineInformation; | ||
exports.WorkerMachineHealthcheckResponse = typebox_1.Type.Object({ | ||
TRIGGER_TIMEOUT_SECONDS: typebox_1.Type.Number(), | ||
PAUSED_FLOW_TIMEOUT_DAYS: typebox_1.Type.Number(), | ||
EXECUTION_MODE: typebox_1.Type.String(), | ||
FLOW_TIMEOUT_SECONDS: typebox_1.Type.Number(), | ||
FLOW_WORKER_CONCURRENCY: typebox_1.Type.Number(), | ||
SCHEDULED_WORKER_CONCURRENCY: typebox_1.Type.Number(), | ||
LOG_LEVEL: typebox_1.Type.String(), | ||
LOG_PRETTY: typebox_1.Type.String(), | ||
ENVIRONMENT: typebox_1.Type.String(), | ||
APP_WEBHOOK_SECRETS: typebox_1.Type.String(), | ||
MAX_FILE_SIZE_MB: typebox_1.Type.Number(), | ||
SANDBOX_MEMORY_LIMIT: typebox_1.Type.String(), | ||
SANDBOX_PROPAGATED_ENV_VARS: typebox_1.Type.Array(typebox_1.Type.String()), | ||
PIECES_SOURCE: typebox_1.Type.String(), | ||
DEV_PIECES: typebox_1.Type.Array(typebox_1.Type.String()), | ||
SENTRY_DSN: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
LOKI_PASSWORD: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
LOKI_URL: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
LOKI_USERNAME: typebox_1.Type.Optional(typebox_1.Type.String()), | ||
FILE_STORAGE_LOCATION: typebox_1.Type.String(), | ||
S3_USE_SIGNED_URLS: typebox_1.Type.String(), | ||
}); | ||
//# sourceMappingURL=index.js.map |
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 too big to display
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
689111
323
9894