@kontur.candy/tools 2.249.0 → 2.250.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/distr/Common/CandyApiClient/CandyApiClient.js +50 -16
- package/distr/Common/CandyApiClient/CandyApiClient.js.map +1 -1
- package/distr/Common/CandyApiClient/ICandyApiClient.js.map +1 -1
- package/distr/Common/CandyApiClient/Types/CreateDraft/CreateDraftParams.js +6 -0
- package/distr/Common/CandyApiClient/Types/CreateDraft/CreateDraftParams.js.map +1 -0
- package/distr/Common/CandyApiClient/Types/FeatureFlags/FeatureFlagsResponse.js.map +1 -1
- package/distr/Common/DriveIntegration/DriveApiClientExtension.js +53 -0
- package/distr/Common/DriveIntegration/DriveApiClientExtension.js.map +1 -0
- package/distr/Common/DriveIntegration/DriveHelpers.js +24 -0
- package/distr/Common/DriveIntegration/DriveHelpers.js.map +1 -0
- package/distr/Common/DriveIntegration/ensureCandyFrontSrvDriveUri.js +23 -0
- package/distr/Common/DriveIntegration/ensureCandyFrontSrvDriveUri.js.map +1 -0
- package/distr/Common/FSPrinterClient/FSPrinterClient.js +18 -4
- package/distr/Common/FSPrinterClient/FSPrinterClient.js.map +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js +1 -1
- package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js +3 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js +36 -53
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/BuildFormDevServer.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/ClientJsDevServer.js +6 -7
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/ClientJsDevServer.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/EngineDevServer.js +6 -7
- package/distr/Tools/src/CLICommands/BuildServer/ResourcesControllers/DevServers/EngineDevServer.js.map +1 -1
- package/distr/Tools/src/CLICommands/BuildServer/RunBuildServer.js +13 -26
- package/distr/Tools/src/CLICommands/BuildServer/RunBuildServer.js.map +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/index.js +1 -1
- package/distr/Tools/src/LocalServerFrontEndDist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ICandyApiClient.js","names":[],"sources":["../../../../Common/CandyApiClient/ICandyApiClient.ts"],"sourcesContent":["import { HttpStatusCode } from \"../HttpClient/IHttpClient\";\nimport { ICombineByTransfers } from \"../../Engine/src/Engine/Core/ModalManager/Modals/UploadSection/Types\";\nimport { AbsoluteModelPath } from \"../ModelPath/ModelPath\";\nimport { AbsoluteModelFieldPath } from \"../ModelPath/AbsoluteModelFieldPath\";\nimport { FormSettings } from \"../../Engine/src/Forms/Types/FormSettings\";\nimport { AUOOptions } from \"../../Engine/src/Forms/Types/AUOOptions\";\nimport { WorkspaceResourceType } from \"../../Engine/src/ContractorsServiceIntegration/Types/WorkspaceTypes\";\n\nimport { ServerErrorLog } from \"./Types/ErrorLog/ServerErrorLog\";\nimport { ServerInnerResponse, ServerJsonResponse } from \"./Types/GetInner/ServerInnerResponse\";\nimport {\n ExcelsToPartialFufsResponse,\n FileProperties,\n ServerErrorResponse,\n UploadFilePropertiesResponse,\n} from \"./Types/DraftActions/FileProperties\";\nimport { CreateDraftResponse } from \"./Types/CreateDraft/CreateDraftResponse\";\nimport { CreateExplanatoryNoteResponse } from \"./Types/ExplanatoryNote/CreateExplanatoryNoteResponse\";\nimport { DraftFullId } from \"./Types/DraftFullId\";\nimport { ServerChangeSet } from \"./Types/ChangeSet/ServerChangeSet\";\nimport { ServerTask, VerifyAndFixFnsRequirementsTaskInfo } from \"./Types/Tasks/Tasks\";\nimport { GetByInnResponse } from \"./Types/Focus/FocusTypes\";\nimport { AttachInfo } from \"./Types/Attachments/Attacments\";\nimport { DraftPresentationType } from \"./Types/Presentations/DraftPresentationType\";\nimport { PresentationContent } from \"./Types/Presentations/PresentationContent\";\nimport { ConvertDraftRequest } from \"./Types/DraftActions/ConvertDraftRequest\";\nimport { ServerRequisitesResponse } from \"./Types/GetInner/ServerRequisitesResponse\";\nimport { CombinatorType, CombineFufResult, FufCombineMethod } from \"./Types/DraftActions/CombineFufResult\";\nimport { FeatureFlagsResponse } from \"./Types/FeatureFlags/FeatureFlagsResponse\";\nimport { ImportEmployeesRequest } from \"./Types/Staff/ImportEmployeesRequest\";\nimport { MassActionParameters } from \"./Types/MassActions/MassActionParameters\";\nimport { PrintType } from \"./Types/Print/PrintType\";\nimport { PrintResponse } from \"./Types/Print/PrintResponse\";\nimport { ServerRawResponse } from \"./Types/GetInner/ServerRawResponse\";\nimport { CandyPopdProtocol } from \"./Types/ErrorLog/CandyPopdProtocol\";\nimport { InstancesDeletingRule } from \"./Types/InstancesDeleting/InstancesDeletingRule\";\nimport { ValueForInstancesSettingRule } from \"./Types/MassActions/ValueForInstancesSettingRule\";\nimport { GetAttachmentsResponse } from \"./Types/Attachments/GetAttachmentsResponse\";\nimport { InnerQueryRequest } from \"./Types/QueryCollecton/InnerQueryRequest\";\nimport { InnerQueryResponse } from \"./Types/QueryCollecton/InnerQueryResponse\";\nimport { ResolveInnerPathRequest } from \"./Types/ErrorLog/ResolveInnerPathRequest\";\nimport { ResolvePathResponse } from \"./Types/ErrorLog/ResolvePathResponse\";\nimport { InnerHistoryResponse, InnerHistoryUndoResponseWithStatus } from \"./Types/HistoryEditing/InnerHistoryResponse\";\nimport { PollingTaskWithResult } from \"./Types/PollingTasks/PollingTasks\";\n\nexport interface ICandyApiClient {\n forDraft(draftFullId: DraftFullId): ICandyApiDraftClient;\n\n // region Create draft\n createDraft(ns: string, gfv: string): Promise<CreateDraftResponse>;\n createDraft(ns: string, gfv: undefined, body: Buffer): Promise<CreateDraftResponse>;\n createDraftFromDrive(ns: string, fufDriveUri: string, abortSignal?: AbortSignal): Promise<CreateDraftResponse>;\n createEmptyDraft(ns: string, gfv: string, abortSignal?: AbortSignal): Promise<CreateDraftResponse>;\n // endregion\n\n //region Focus\n getInfoByInns(draftFullId: DraftFullId, inns: readonly string[]): Promise<GetByInnResponse>;\n //endregion\n\n // region Diagnostics\n getAllGfvs(abortSignal?: AbortSignal): Promise<string[]>;\n forceGetAllGfvs(): Promise<string[]>;\n // endregion\n\n checkAlive(): Promise<void>;\n\n getFeatureFlags(abonId?: string, orgId?: string, userId?: string): Promise<FeatureFlagsResponse>;\n\n getWorkspaceDirectoryId(\n orgId: string,\n inn: string,\n resourceType: WorkspaceResourceType,\n kpp?: string\n ): Promise<string>;\n\n convertToPdfAndGetMeta(driveUri: string): Promise<ConvertedPDFMetaResponse>;\n convertToPdf(driveUri: string): Promise<ConvertedPdfResponse>;\n}\n\nexport interface ICandyApiDraftTasksClient {\n getAllTasks(): Promise<ServerTask[]>;\n getTaskById(taskId: string): Promise<ServerTask | undefined>;\n enqueueTask(taskId: string, taskInfo: VerifyAndFixFnsRequirementsTaskInfo): Promise<void>;\n cancelTask(taskId: string): Promise<void>;\n}\n\nexport interface ICandyApiDraftAttachmentsClient {\n getAttachmentById(attachmentId: string): Promise<AttachInfo>;\n getAllAttachments(): Promise<AttachInfo[]>;\n createOrUpdateAttachments(attachments: readonly AttachInfo[]): Promise<void>;\n createDraftAttachment(gfv: string, path: string): Promise<AttachInfo>;\n openLoadedAttachmentAsDraft(id: string): Promise<AttachInfo>;\n removeAttachments(attachmentIds: readonly string[]): Promise<void>;\n}\n\nexport interface PathLoadSpecification {\n pathOrPathPrefix: AbsoluteModelPath | AbsoluteModelFieldPath | \"*\";\n skip: boolean;\n}\n\nexport type CheckScenarioType = \"readonly\";\nexport interface IInnerChangeSuccessResult {\n dataVersion: number;\n changedPaths?: string[];\n}\nexport type IInnerChangeResult = IInnerChangeSuccessResult | HttpStatusCode;\n\nexport interface DraftSettings {\n isReadOnly?: FormSettings[\"isReadOnly\"];\n isIndividual?: FormSettings[\"isIndividual\"];\n isForeign?: FormSettings[\"isForeign\"];\n employerId?: FormSettings[\"employerId\"];\n}\n\nexport type NormalizerNames = \"formulas\" | \"formulasWithInitializers\";\n\nexport interface NormalizationProgressTask {\n id: string;\n status: \"InProgress\" | \"Success\" | \"Error\";\n progress: number;\n}\n\nexport interface RequestNdsFileOptions {\n driveUri: string;\n ignoreSizeCheck?: boolean;\n declarationGfv: string;\n requestedGfv?: string;\n}\n\nexport interface ICandyApiDraftClient extends ICandyApiDraftTasksClient, ICandyApiDraftAttachmentsClient {\n // region Explanatory note\n getExplanatoryNote(): Promise<CreateExplanatoryNoteResponse>;\n // endregion\n\n // region Error log\n getErrorLog(): Promise<ServerErrorLog>;\n checkByPopd(): Promise<CandyPopdProtocol>;\n getErrorLogWithCheckScenarios(checkScenarios: CheckScenarioType[]): Promise<ServerErrorLog>;\n getExpertErrorLog(auo: Partial<AUOOptions>): Promise<ServerErrorLog>;\n getHrefToErrorLogPdf(errorLogName: string, propsName: string): string;\n // endregion\n\n // region Get draft requisites\n getRequisites(requisiteList: readonly string[]): Promise<ServerRequisitesResponse>;\n // endregion\n\n //region Get draft inner\n getInner(paths: undefined | readonly string[]): Promise<ServerInnerResponse>;\n getPartialInner(rules: readonly PathLoadSpecification[], maxInstanceCount?: number): Promise<ServerInnerResponse>;\n getPartialInnerAsJsonTree(\n rules: readonly PathLoadSpecification[],\n maxInstanceCount?: number,\n skipNormalization?: boolean\n ): Promise<ServerJsonResponse>;\n getRawPartialInnerAsJsonTree(\n rules: readonly PathLoadSpecification[],\n maxInstanceCount?: number,\n skipNormalization?: boolean\n ): Promise<ServerRawResponse>;\n getDataVersion(): Promise<number>;\n startNormalizationTask(): Promise<NormalizationProgressTask>;\n getNormalizationTask(): Promise<NormalizationProgressTask>;\n //endregion\n\n // region Update draft inner\n sendChangeSet(\n data: ServerChangeSet,\n currentDataVersion: number,\n operationName?: string\n ): Promise<IInnerChangeResult>;\n sendChangeSetSync(data: ServerChangeSet, currentDataVersion: number): IInnerChangeResult;\n sendChangeWithNormalizationSet(\n data: ServerChangeSet,\n currentDataVersion: number,\n normalizerId?: NormalizerNames,\n operationName?: string\n ): Promise<IInnerChangeResult>;\n startPatchWithNormalizationTask(\n data: ServerChangeSet,\n currentDataVersion: number,\n normalizerId?: string,\n operationName?: string\n ): Promise<PollingTaskWithResult<IInnerChangeSuccessResult> | number>;\n getPatchWithNormalizationTask(): Promise<PollingTaskWithResult<IInnerChangeSuccessResult>>;\n // endregion\n\n // region Draft presentations\n setPresentation(type: DraftPresentationType, content: string | unknown): Promise<void>;\n patchPresentation(type: DraftPresentationType, content: PresentationContent): Promise<void>;\n // endregion\n\n // region Draft inner print\n print(type: PrintType, body?: string[]): Promise<PrintResponse>;\n // endregion\n\n // region Draft actions\n clearDraft(): Promise<void>;\n restoreToSourceFuf(): Promise<void>;\n convertDraftFromPrevGfv(request: ConvertDraftRequest): Promise<void>;\n getFileProperties(driveUri: string, ignoreSizeCheck?: boolean): Promise<FileProperties | undefined>;\n getFileNdsProperties(params: RequestNdsFileOptions): Promise<FileProperties[] | undefined>;\n prepareAndGetFileProperties(\n driveUri: string,\n gfv: string,\n ignoreSizeCheck?: boolean\n ): Promise<FileProperties | undefined>;\n uploadAndGetFileProperties(\n driveUri: string[],\n gfv: string,\n abortSignal?: AbortSignal\n ): Promise<UploadFilePropertiesResponse>;\n setFufByDriveUri(driveUri: string): Promise<void>;\n acceptMultipleTransferType(\n files: ICombineByTransfers[],\n abortSignal?: AbortSignal\n ): Promise<ServerErrorResponse | undefined>;\n excelsToPartialFufs(\n gfv: string,\n pathToTable: string,\n driveUris: string[]\n ): Promise<ExcelsToPartialFufsResponse | undefined>;\n importXmls(\n driveUris: string[],\n combineMethod: FufCombineMethod,\n combinatorType: CombinatorType,\n isImportByFuf: boolean,\n args?: string[]\n ): Promise<CombineFufResult | undefined>;\n setDraftSettings(settings: DraftSettings): Promise<void>;\n getDraftSettings(): Promise<DraftSettings>;\n // endregion\n\n normalizeByRules(rules: string): Promise<void>;\n\n getHrefToConvertationLog(): string;\n getHrefToDownloadInnerFuf(): string;\n getHrefToDownloadClientInfo(): string;\n getHrefToDownloadFormsClientInfo(): string;\n getHrefToInnerEditor(): string;\n\n getFufWithAttachments(): Promise<FufWithAttachmentsResponse | undefined>;\n startGetFufWithAttachmentsTask(): Promise<PollingTaskWithResult<FufWithAttachmentsTaskResult>>;\n getFufWithAttachmentsTask(\n format: \"Json\" | \"DriveUri\"\n ): Promise<PollingTaskWithResult<FufWithAttachmentsTaskResult>>;\n getPartialFuf(rules: string[]): Promise<GetPartialFufResponse | undefined>;\n getInnerFuf(): Promise<string | undefined>;\n startGetInnerFufTask(): Promise<PollingTaskWithResult<string>>;\n getInnerFufTask(): Promise<PollingTaskWithResult<string>>;\n\n downloadFuf(): Promise<void>;\n downloadInner(): Promise<void>;\n makeDownloadDriveLink(uri: string, fileName?: string): void;\n\n setMultipleWithNormalization(rules: ValueForInstancesSettingRule[]): Promise<IInnerChangeResult>;\n\n normalizeDirtyMasks(): Promise<IInnerChangeResult>;\n\n searchInstancesByText(\n text: string,\n pathPrefix: string,\n pathsToSearch: string[],\n maxInstanceCount?: number\n ): Promise<string[]>;\n\n queryCollection(request: InnerQueryRequest, abortSignal?: AbortSignal): Promise<InnerQueryResponse>;\n\n customNormalize(\n normalizerId: string | null,\n pathPrefixes: AbsoluteModelPath[],\n abortSignal?: AbortSignal\n ): Promise<IInnerChangeResult>;\n startCustomNormalizationTask(\n pathPrefixes: AbsoluteModelPath[],\n normalizerId?: string,\n operationName?: string\n ): Promise<PollingTaskWithResult<IInnerChangeResult>>;\n getCustomNormalizationTask(): Promise<PollingTaskWithResult<IInnerChangeResult>>;\n importEmployees(request: ImportEmployeesRequest): Promise<void>;\n runMassAction(actionId: string, parameters?: MassActionParameters): Promise<void>;\n deleteInstances(deletingRules: InstancesDeletingRule[]): Promise<void>;\n printExcel(pathToTable: string): Promise<PrintResponse | undefined>;\n\n resolveInnerPath(request: ResolveInnerPathRequest, abortSignal?: AbortSignal): Promise<ResolvePathResponse>;\n getHistory(): Promise<InnerHistoryResponse | number>;\n undoToChange(changeGUID: string): Promise<InnerHistoryUndoResponseWithStatus>;\n getGFV(): Promise<string>;\n getUser(): Promise<GetUserResponse>;\n}\n\nexport interface GetUserResponse {\n Id: string | null;\n Ip: string | null;\n FirstName: string | null;\n MiddleName: string | null;\n LastName: string | null;\n}\n\nexport interface GetPartialFufResponse {\n ContentUri: string;\n Name: string;\n}\n\nexport interface BaseGetFufResponse {\n contentUri: string;\n name: string;\n}\n\nexport interface FufWithAttachmentsResponse {\n fuf: BaseGetFufResponse;\n attachments: GetAttachmentsResponse[];\n}\n\nexport type FufWithAttachmentsTaskResult = FufWithAttachmentsResponse | { resultUri: string };\n\nexport interface CandyApiErrorResponse {\n message: string;\n errorCode: \"InvalidEditSession\" | string;\n}\n\nexport interface ConvertedPDFMetaResponse {\n contentUri: string;\n isModified: boolean;\n pageCount: number;\n lastPageHeight: number;\n contentSizeBytes: number;\n}\n\nexport interface ConvertedPdfResponse {\n contentUri: string;\n isModified: boolean;\n contentSizeBytes: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ICandyApiClient.js","names":[],"sources":["../../../../Common/CandyApiClient/ICandyApiClient.ts"],"sourcesContent":["import { HttpStatusCode } from \"../HttpClient/IHttpClient\";\nimport { ICombineByTransfers } from \"../../Engine/src/Engine/Core/ModalManager/Modals/UploadSection/Types\";\nimport { AbsoluteModelPath } from \"../ModelPath/ModelPath\";\nimport { AbsoluteModelFieldPath } from \"../ModelPath/AbsoluteModelFieldPath\";\nimport { FormSettings } from \"../../Engine/src/Forms/Types/FormSettings\";\nimport { AUOOptions } from \"../../Engine/src/Forms/Types/AUOOptions\";\nimport { WorkspaceResourceType } from \"../../Engine/src/ContractorsServiceIntegration/Types/WorkspaceTypes\";\n\nimport { ServerErrorLog } from \"./Types/ErrorLog/ServerErrorLog\";\nimport { ServerInnerResponse, ServerJsonResponse } from \"./Types/GetInner/ServerInnerResponse\";\nimport {\n ExcelsToPartialFufsResponse,\n FileProperties,\n ServerErrorResponse,\n UploadFilePropertiesResponse,\n} from \"./Types/DraftActions/FileProperties\";\nimport { CreateDraftResponse } from \"./Types/CreateDraft/CreateDraftResponse\";\nimport { CreateDraftFromDriveParams, CreateEmptyDraftParams } from \"./Types/CreateDraft/CreateDraftParams\";\nimport { CreateExplanatoryNoteResponse } from \"./Types/ExplanatoryNote/CreateExplanatoryNoteResponse\";\nimport { DraftFullId } from \"./Types/DraftFullId\";\nimport { ServerChangeSet } from \"./Types/ChangeSet/ServerChangeSet\";\nimport { ServerTask, VerifyAndFixFnsRequirementsTaskInfo } from \"./Types/Tasks/Tasks\";\nimport { GetByInnResponse } from \"./Types/Focus/FocusTypes\";\nimport { AttachInfo } from \"./Types/Attachments/Attacments\";\nimport { DraftPresentationType } from \"./Types/Presentations/DraftPresentationType\";\nimport { PresentationContent } from \"./Types/Presentations/PresentationContent\";\nimport { ConvertDraftRequest } from \"./Types/DraftActions/ConvertDraftRequest\";\nimport { ServerRequisitesResponse } from \"./Types/GetInner/ServerRequisitesResponse\";\nimport { CombinatorType, CombineFufResult, FufCombineMethod } from \"./Types/DraftActions/CombineFufResult\";\nimport { FeatureFlagsResponse } from \"./Types/FeatureFlags/FeatureFlagsResponse\";\nimport { ImportEmployeesRequest } from \"./Types/Staff/ImportEmployeesRequest\";\nimport { MassActionParameters } from \"./Types/MassActions/MassActionParameters\";\nimport { PrintType } from \"./Types/Print/PrintType\";\nimport { PrintResponse } from \"./Types/Print/PrintResponse\";\nimport { ServerRawResponse } from \"./Types/GetInner/ServerRawResponse\";\nimport { CandyPopdProtocol } from \"./Types/ErrorLog/CandyPopdProtocol\";\nimport { InstancesDeletingRule } from \"./Types/InstancesDeleting/InstancesDeletingRule\";\nimport { ValueForInstancesSettingRule } from \"./Types/MassActions/ValueForInstancesSettingRule\";\nimport { GetAttachmentsResponse } from \"./Types/Attachments/GetAttachmentsResponse\";\nimport { InnerQueryRequest } from \"./Types/QueryCollecton/InnerQueryRequest\";\nimport { InnerQueryResponse } from \"./Types/QueryCollecton/InnerQueryResponse\";\nimport { ResolveInnerPathRequest } from \"./Types/ErrorLog/ResolveInnerPathRequest\";\nimport { ResolvePathResponse } from \"./Types/ErrorLog/ResolvePathResponse\";\nimport { InnerHistoryResponse, InnerHistoryUndoResponseWithStatus } from \"./Types/HistoryEditing/InnerHistoryResponse\";\nimport { PollingTaskWithResult } from \"./Types/PollingTasks/PollingTasks\";\n\nexport interface ICandyApiClient {\n forDraft(draftFullId: DraftFullId): ICandyApiDraftClient;\n\n // region Create draft\n createDraft(ns: string, gfv: string): Promise<CreateDraftResponse>;\n createDraft(ns: string, gfv: undefined, body: Buffer): Promise<CreateDraftResponse>;\n createDraftFromDrive(params: CreateDraftFromDriveParams): Promise<CreateDraftResponse>;\n createEmptyDraft(params: CreateEmptyDraftParams): Promise<CreateDraftResponse>;\n // endregion\n\n //region Focus\n getInfoByInns(draftFullId: DraftFullId, inns: readonly string[]): Promise<GetByInnResponse>;\n //endregion\n\n // region Diagnostics\n getAllGfvs(abortSignal?: AbortSignal): Promise<string[]>;\n forceGetAllGfvs(): Promise<string[]>;\n // endregion\n\n checkAlive(): Promise<void>;\n\n getFeatureFlags(abonId?: string, orgId?: string, userId?: string): Promise<FeatureFlagsResponse>;\n\n getWorkspaceDirectoryId(\n orgId: string,\n inn: string,\n resourceType: WorkspaceResourceType,\n kpp?: string\n ): Promise<string>;\n\n convertToPdfAndGetMeta(driveUri: string): Promise<ConvertedPDFMetaResponse>;\n convertToPdf(driveUri: string): Promise<ConvertedPdfResponse>;\n}\n\nexport interface ICandyApiDraftTasksClient {\n getAllTasks(): Promise<ServerTask[]>;\n getTaskById(taskId: string): Promise<ServerTask | undefined>;\n enqueueTask(taskId: string, taskInfo: VerifyAndFixFnsRequirementsTaskInfo): Promise<void>;\n cancelTask(taskId: string): Promise<void>;\n}\n\nexport interface ICandyApiDraftAttachmentsClient {\n getAttachmentById(attachmentId: string): Promise<AttachInfo>;\n getAllAttachments(): Promise<AttachInfo[]>;\n createOrUpdateAttachments(attachments: readonly AttachInfo[]): Promise<void>;\n createDraftAttachment(gfv: string, path: string): Promise<AttachInfo>;\n openLoadedAttachmentAsDraft(id: string): Promise<AttachInfo>;\n removeAttachments(attachmentIds: readonly string[]): Promise<void>;\n}\n\nexport interface PathLoadSpecification {\n pathOrPathPrefix: AbsoluteModelPath | AbsoluteModelFieldPath | \"*\";\n skip: boolean;\n}\n\nexport type CheckScenarioType = \"readonly\";\nexport interface IInnerChangeSuccessResult {\n dataVersion: number;\n changedPaths?: string[];\n}\nexport type IInnerChangeResult = IInnerChangeSuccessResult | HttpStatusCode;\n\nexport interface DraftSettings {\n isReadOnly?: FormSettings[\"isReadOnly\"];\n isIndividual?: FormSettings[\"isIndividual\"];\n isForeign?: FormSettings[\"isForeign\"];\n employerId?: FormSettings[\"employerId\"];\n}\n\nexport type NormalizerNames = \"formulas\" | \"formulasWithInitializers\";\n\nexport interface NormalizationProgressTask {\n id: string;\n status: \"InProgress\" | \"Success\" | \"Error\";\n progress: number;\n}\n\nexport interface RequestNdsFileOptions {\n driveUri: string;\n ignoreSizeCheck?: boolean;\n declarationGfv: string;\n requestedGfv?: string;\n}\n\nexport interface ICandyApiDraftClient extends ICandyApiDraftTasksClient, ICandyApiDraftAttachmentsClient {\n // region Explanatory note\n getExplanatoryNote(): Promise<CreateExplanatoryNoteResponse>;\n // endregion\n\n // region Error log\n getErrorLog(): Promise<ServerErrorLog>;\n checkByPopd(): Promise<CandyPopdProtocol>;\n getErrorLogWithCheckScenarios(checkScenarios: CheckScenarioType[]): Promise<ServerErrorLog>;\n getExpertErrorLog(auo: Partial<AUOOptions>): Promise<ServerErrorLog>;\n getHrefToErrorLogPdf(errorLogName: string, propsName: string): string;\n // endregion\n\n // region Get draft requisites\n getRequisites(requisiteList: readonly string[]): Promise<ServerRequisitesResponse>;\n // endregion\n\n //region Get draft inner\n getInner(paths: undefined | readonly string[]): Promise<ServerInnerResponse>;\n getPartialInner(rules: readonly PathLoadSpecification[], maxInstanceCount?: number): Promise<ServerInnerResponse>;\n getPartialInnerAsJsonTree(\n rules: readonly PathLoadSpecification[],\n maxInstanceCount?: number,\n skipNormalization?: boolean\n ): Promise<ServerJsonResponse>;\n getRawPartialInnerAsJsonTree(\n rules: readonly PathLoadSpecification[],\n maxInstanceCount?: number,\n skipNormalization?: boolean\n ): Promise<ServerRawResponse>;\n getDataVersion(): Promise<number>;\n startNormalizationTask(): Promise<NormalizationProgressTask>;\n getNormalizationTask(): Promise<NormalizationProgressTask>;\n //endregion\n\n // region Update draft inner\n sendChangeSet(\n data: ServerChangeSet,\n currentDataVersion: number,\n operationName?: string\n ): Promise<IInnerChangeResult>;\n sendChangeSetSync(data: ServerChangeSet, currentDataVersion: number): IInnerChangeResult;\n sendChangeWithNormalizationSet(\n data: ServerChangeSet,\n currentDataVersion: number,\n normalizerId?: NormalizerNames,\n operationName?: string\n ): Promise<IInnerChangeResult>;\n startPatchWithNormalizationTask(\n data: ServerChangeSet,\n currentDataVersion: number,\n normalizerId?: string,\n operationName?: string\n ): Promise<PollingTaskWithResult<IInnerChangeSuccessResult> | number>;\n getPatchWithNormalizationTask(): Promise<PollingTaskWithResult<IInnerChangeSuccessResult>>;\n // endregion\n\n // region Draft presentations\n setPresentation(type: DraftPresentationType, content: string | unknown): Promise<void>;\n patchPresentation(type: DraftPresentationType, content: PresentationContent): Promise<void>;\n // endregion\n\n // region Draft inner print\n print(type: PrintType, body?: string[]): Promise<PrintResponse>;\n // endregion\n\n // region Draft actions\n clearDraft(): Promise<void>;\n restoreToSourceFuf(): Promise<void>;\n convertDraftFromPrevGfv(request: ConvertDraftRequest): Promise<void>;\n getFileProperties(driveUri: string, ignoreSizeCheck?: boolean): Promise<FileProperties | undefined>;\n getFileNdsProperties(params: RequestNdsFileOptions): Promise<FileProperties[] | undefined>;\n prepareAndGetFileProperties(\n driveUri: string,\n gfv: string,\n ignoreSizeCheck?: boolean\n ): Promise<FileProperties | undefined>;\n uploadAndGetFileProperties(\n driveUri: string[],\n gfv: string,\n abortSignal?: AbortSignal\n ): Promise<UploadFilePropertiesResponse>;\n setFufByDriveUri(driveUri: string): Promise<void>;\n acceptMultipleTransferType(\n files: ICombineByTransfers[],\n abortSignal?: AbortSignal\n ): Promise<ServerErrorResponse | undefined>;\n excelsToPartialFufs(\n gfv: string,\n pathToTable: string,\n driveUris: string[]\n ): Promise<ExcelsToPartialFufsResponse | undefined>;\n importXmls(\n driveUris: string[],\n combineMethod: FufCombineMethod,\n combinatorType: CombinatorType,\n isImportByFuf: boolean,\n args?: string[]\n ): Promise<CombineFufResult | undefined>;\n setDraftSettings(settings: DraftSettings): Promise<void>;\n getDraftSettings(): Promise<DraftSettings>;\n // endregion\n\n normalizeByRules(rules: string): Promise<void>;\n\n getHrefToConvertationLog(): string;\n getHrefToDownloadInnerFuf(): string;\n getHrefToDownloadClientInfo(): string;\n getHrefToDownloadFormsClientInfo(): string;\n getHrefToInnerEditor(): string;\n\n getFufWithAttachments(): Promise<FufWithAttachmentsResponse | undefined>;\n startGetFufWithAttachmentsTask(): Promise<PollingTaskWithResult<FufWithAttachmentsTaskResult>>;\n getFufWithAttachmentsTask(\n format: \"Json\" | \"DriveUri\"\n ): Promise<PollingTaskWithResult<FufWithAttachmentsTaskResult>>;\n getPartialFuf(rules: string[]): Promise<GetPartialFufResponse | undefined>;\n getInnerFuf(): Promise<string | undefined>;\n startGetInnerFufTask(): Promise<PollingTaskWithResult<string>>;\n getInnerFufTask(): Promise<PollingTaskWithResult<string>>;\n\n downloadFuf(): Promise<void>;\n downloadInner(): Promise<void>;\n makeDownloadDriveLink(uri: string, fileName?: string): void;\n\n setMultipleWithNormalization(rules: ValueForInstancesSettingRule[]): Promise<IInnerChangeResult>;\n\n normalizeDirtyMasks(): Promise<IInnerChangeResult>;\n\n searchInstancesByText(\n text: string,\n pathPrefix: string,\n pathsToSearch: string[],\n maxInstanceCount?: number\n ): Promise<string[]>;\n\n queryCollection(request: InnerQueryRequest, abortSignal?: AbortSignal): Promise<InnerQueryResponse>;\n\n customNormalize(\n normalizerId: string | null,\n pathPrefixes: AbsoluteModelPath[],\n abortSignal?: AbortSignal\n ): Promise<IInnerChangeResult>;\n startCustomNormalizationTask(\n pathPrefixes: AbsoluteModelPath[],\n normalizerId?: string,\n operationName?: string\n ): Promise<PollingTaskWithResult<IInnerChangeResult>>;\n getCustomNormalizationTask(): Promise<PollingTaskWithResult<IInnerChangeResult>>;\n importEmployees(request: ImportEmployeesRequest): Promise<void>;\n runMassAction(actionId: string, parameters?: MassActionParameters): Promise<void>;\n deleteInstances(deletingRules: InstancesDeletingRule[]): Promise<void>;\n printExcel(pathToTable: string): Promise<PrintResponse | undefined>;\n\n resolveInnerPath(request: ResolveInnerPathRequest, abortSignal?: AbortSignal): Promise<ResolvePathResponse>;\n getHistory(): Promise<InnerHistoryResponse | number>;\n undoToChange(changeGUID: string): Promise<InnerHistoryUndoResponseWithStatus>;\n getGFV(): Promise<string>;\n getUser(): Promise<GetUserResponse>;\n}\n\nexport interface GetUserResponse {\n Id: string | null;\n Ip: string | null;\n FirstName: string | null;\n MiddleName: string | null;\n LastName: string | null;\n}\n\nexport interface GetPartialFufResponse {\n ContentUri: string;\n Name: string;\n}\n\nexport interface BaseGetFufResponse {\n contentUri: string;\n name: string;\n}\n\nexport interface FufWithAttachmentsResponse {\n fuf: BaseGetFufResponse;\n attachments: GetAttachmentsResponse[];\n}\n\nexport type FufWithAttachmentsTaskResult = FufWithAttachmentsResponse | { resultUri: string };\n\nexport interface CandyApiErrorResponse {\n message: string;\n errorCode: \"InvalidEditSession\" | string;\n}\n\nexport interface ConvertedPDFMetaResponse {\n contentUri: string;\n isModified: boolean;\n pageCount: number;\n lastPageHeight: number;\n contentSizeBytes: number;\n}\n\nexport interface ConvertedPdfResponse {\n contentUri: string;\n isModified: boolean;\n contentSizeBytes: number;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateDraftParams.js","names":[],"sources":["../../../../../../Common/CandyApiClient/Types/CreateDraft/CreateDraftParams.ts"],"sourcesContent":["export interface CreateEmptyDraftParams {\n ns: string;\n gfv: string;\n abortSignal?: AbortSignal;\n scenario?: string;\n}\n\nexport interface CreateDraftFromDriveParams {\n ns: string;\n fufDriveUri: string;\n abortSignal?: AbortSignal;\n scenario?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureFlagsResponse.js","names":[],"sources":["../../../../../../Common/CandyApiClient/Types/FeatureFlags/FeatureFlagsResponse.ts"],"sourcesContent":["export type FeatureFlagsResponse =\n | {\n candyTestFeature?: string;\n useExtendedErrorLog?: boolean;\n showDraftHistoryInEditor?: boolean;\n }\n | {\n [data: string]: unknown;\n };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FeatureFlagsResponse.js","names":[],"sources":["../../../../../../Common/CandyApiClient/Types/FeatureFlags/FeatureFlagsResponse.ts"],"sourcesContent":["export type FeatureFlagsResponse =\n | {\n candyTestFeature?: string;\n useExtendedErrorLog?: boolean;\n showDraftHistoryInEditor?: boolean;\n newOrgAdPromoCode?: string;\n }\n | {\n [data: string]: unknown;\n };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DriveApiClientExtension = void 0;
|
|
7
|
+
var _InitializeSentry = require("../../Engine/src/Forms/Sentry/InitializeSentry");
|
|
8
|
+
class DriveApiClientExtension {
|
|
9
|
+
constructor(fetchImpl, baseUrl) {
|
|
10
|
+
this.fetchImpl = void 0;
|
|
11
|
+
this.baseUrl = void 0;
|
|
12
|
+
this.fetchImpl = fetchImpl;
|
|
13
|
+
this.baseUrl = baseUrl;
|
|
14
|
+
}
|
|
15
|
+
async copyContents(name, copyName) {
|
|
16
|
+
const response = await this.fetchImpl(`${this.baseUrl}/v1/contents/copy`, {
|
|
17
|
+
method: "POST",
|
|
18
|
+
credentials: "include",
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "application/json",
|
|
21
|
+
Accept: "application/json"
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({
|
|
24
|
+
name: decodeURI(name),
|
|
25
|
+
copyName: decodeURI(copyName),
|
|
26
|
+
expiryTimeChange: {
|
|
27
|
+
makePermanent: false,
|
|
28
|
+
newDaysToLive: 1
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
if (response.status === 403) {
|
|
33
|
+
(0, _InitializeSentry.getCandyHub)().captureException(new Error(`Drive contents copy forbidden: ${name}`));
|
|
34
|
+
return {
|
|
35
|
+
Name: name
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (response.status === 409) {
|
|
39
|
+
return {
|
|
40
|
+
Name: copyName
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (response.status >= 400 && response.status <= 500) {
|
|
44
|
+
return {
|
|
45
|
+
Name: name
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const result = await response.json();
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.DriveApiClientExtension = DriveApiClientExtension;
|
|
53
|
+
//# sourceMappingURL=DriveApiClientExtension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriveApiClientExtension.js","names":["_InitializeSentry","require","DriveApiClientExtension","constructor","fetchImpl","baseUrl","copyContents","name","copyName","response","method","credentials","headers","Accept","body","JSON","stringify","decodeURI","expiryTimeChange","makePermanent","newDaysToLive","status","getCandyHub","captureException","Error","Name","result","json","exports"],"sources":["../../../../Common/DriveIntegration/DriveApiClientExtension.ts"],"sourcesContent":["import { Fetch } from \"../HttpClient/FetchImplementation/Fetch\";\nimport { getCandyHub } from \"../../Engine/src/Forms/Sentry/InitializeSentry\";\n\nexport interface IDriveContentsCopyResult {\n Name: string;\n}\n\nexport interface IDriveApiClientExtension {\n copyContents(name: string, copyName: string): Promise<IDriveContentsCopyResult>;\n}\n\nexport class DriveApiClientExtension implements IDriveApiClientExtension {\n private readonly fetchImpl: Fetch;\n private readonly baseUrl: string;\n\n public constructor(fetchImpl: Fetch, baseUrl: string) {\n this.fetchImpl = fetchImpl;\n this.baseUrl = baseUrl;\n }\n\n public async copyContents(name: string, copyName: string): Promise<IDriveContentsCopyResult> {\n const response = await this.fetchImpl(`${this.baseUrl}/v1/contents/copy`, {\n method: \"POST\",\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify({\n name: decodeURI(name),\n copyName: decodeURI(copyName),\n expiryTimeChange: {\n makePermanent: false,\n newDaysToLive: 1,\n },\n }),\n });\n\n if (response.status === 403) {\n getCandyHub().captureException(new Error(`Drive contents copy forbidden: ${name}`));\n return {\n Name: name,\n };\n }\n\n if (response.status === 409) {\n return {\n Name: copyName,\n };\n }\n\n if (response.status >= 400 && response.status <= 500) {\n return {\n Name: name,\n };\n }\n\n const result = await response.json();\n\n return result as IDriveContentsCopyResult;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAUO,MAAMC,uBAAuB,CAAqC;EAI9DC,WAAWA,CAACC,SAAgB,EAAEC,OAAe,EAAE;IAAA,KAHrCD,SAAS;IAAA,KACTC,OAAO;IAGpB,IAAI,CAACD,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,OAAO,GAAGA,OAAO;EAC1B;EA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6
|
+
exports.DriveHelpers = void 0;
|
|
7
|
+
class DriveHelpers {
|
|
8
|
+
constructor(driveApiClientExtension) {
|
|
9
|
+
this.driveApiClientExtension = void 0;
|
|
10
|
+
this.driveApiClientExtension = driveApiClientExtension;
|
|
11
|
+
}
|
|
12
|
+
async ensureCandyFrontSrv(driveUri) {
|
|
13
|
+
if (driveUri.toLowerCase().includes("srv/candyfront") || driveUri.toLowerCase().includes("srv/keforms")) {
|
|
14
|
+
return driveUri;
|
|
15
|
+
}
|
|
16
|
+
const index = driveUri.indexOf("srv/");
|
|
17
|
+
const prefix = driveUri.substring(0, index);
|
|
18
|
+
const uri = driveUri.substring(index);
|
|
19
|
+
const result = await this.driveApiClientExtension.copyContents(uri, uri.replace(/srv\/[A-Za-z]+/g, "srv/candyFront"));
|
|
20
|
+
return prefix + result.Name;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.DriveHelpers = DriveHelpers;
|
|
24
|
+
//# sourceMappingURL=DriveHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriveHelpers.js","names":["DriveHelpers","constructor","driveApiClientExtension","ensureCandyFrontSrv","driveUri","toLowerCase","includes","index","indexOf","prefix","substring","uri","result","copyContents","replace","Name","exports"],"sources":["../../../../Common/DriveIntegration/DriveHelpers.ts"],"sourcesContent":["import { IDriveApiClientExtension } from \"./DriveApiClientExtension\";\n\nexport class DriveHelpers {\n private readonly driveApiClientExtension: IDriveApiClientExtension;\n\n public constructor(driveApiClientExtension: IDriveApiClientExtension) {\n this.driveApiClientExtension = driveApiClientExtension;\n }\n\n public async ensureCandyFrontSrv(driveUri: string): Promise<string> {\n if (driveUri.toLowerCase().includes(\"srv/candyfront\") || driveUri.toLowerCase().includes(\"srv/keforms\")) {\n return driveUri;\n }\n\n const index = driveUri.indexOf(\"srv/\");\n const prefix = driveUri.substring(0, index);\n const uri = driveUri.substring(index);\n\n const result = await this.driveApiClientExtension.copyContents(\n uri,\n uri.replace(/srv\\/[A-Za-z]+/g, \"srv/candyFront\")\n );\n\n return prefix + result.Name;\n }\n}\n"],"mappings":";;;;;;AAEO,MAAMA,YAAY,CAAC;EAGfC,WAAWA,CAACC,uBAAiD,EAAE;IAAA,KAFrDA,uBAAuB;IAGpC,IAAI,CAACA,uBAAuB,GAAGA,uBAAuB;EAC1D;EAEA,MAAaC,mBAAmBA,CAACC,QAAgB,EAAmB;IAChE,IAAIA,QAAQ,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,gBAAgB,CAAC,IAAIF,QAAQ,CAACC,WAAW,CAAC,CAAC,CAACC,QAAQ,CAAC,aAAa,CAAC,EAAE;MACrG,OAAOF,QAAQ;IACnB;IAEA,MAAMG,KAAK,GAAGH,QAAQ,CAACI,OAAO,CAAC,MAAM,CAAC;IACtC,MAAMC,MAAM,GAAGL,QAAQ,CAACM,SAAS,CAAC,CAAC,EAAEH,KAAK,CAAC;IAC3C,MAAMI,GAAG,GAAGP,QAAQ,CAACM,SAAS,CAACH,KAAK,CAAC;IAErC,MAAMK,MAAM,GAAG,MAAM,IAAI,CAACV,uBAAuB,CAACW,YAAY,CAC1DF,GAAG,EACHA,GAAG,CAACG,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CACnD,CAAC;IAED,OAAOL,MAAM,GAAGG,MAAM,CAACG,IAAI;EAC/B;AACJ;AAACC,OAAA,CAAAhB,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ensureCandyFrontSrvDriveUris = exports.ensureCandyFrontSrvDriveUri = void 0;
|
|
7
|
+
const ensureCandyFrontSrvDriveUri = async (driveUri, driveHelpers) => {
|
|
8
|
+
let driveUriChecked = driveUri;
|
|
9
|
+
if (driveHelpers) {
|
|
10
|
+
driveUriChecked = await driveHelpers.ensureCandyFrontSrv(driveUri);
|
|
11
|
+
}
|
|
12
|
+
return driveUriChecked;
|
|
13
|
+
};
|
|
14
|
+
exports.ensureCandyFrontSrvDriveUri = ensureCandyFrontSrvDriveUri;
|
|
15
|
+
const ensureCandyFrontSrvDriveUris = async (driveUris, driveHelpers) => {
|
|
16
|
+
let driveUrisChecked = driveUris;
|
|
17
|
+
if (driveHelpers) {
|
|
18
|
+
driveUrisChecked = await Promise.all(driveUris.map(driveUri => driveHelpers === null || driveHelpers === void 0 ? void 0 : driveHelpers.ensureCandyFrontSrv(driveUri)));
|
|
19
|
+
}
|
|
20
|
+
return driveUrisChecked;
|
|
21
|
+
};
|
|
22
|
+
exports.ensureCandyFrontSrvDriveUris = ensureCandyFrontSrvDriveUris;
|
|
23
|
+
//# sourceMappingURL=ensureCandyFrontSrvDriveUri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensureCandyFrontSrvDriveUri.js","names":["ensureCandyFrontSrvDriveUri","driveUri","driveHelpers","driveUriChecked","ensureCandyFrontSrv","exports","ensureCandyFrontSrvDriveUris","driveUris","driveUrisChecked","Promise","all","map"],"sources":["../../../../Common/DriveIntegration/ensureCandyFrontSrvDriveUri.ts"],"sourcesContent":["import { DriveHelpers } from \"./DriveHelpers\";\n\nexport const ensureCandyFrontSrvDriveUri = async (driveUri: string, driveHelpers?: DriveHelpers): Promise<string> => {\n let driveUriChecked = driveUri;\n if (driveHelpers) {\n driveUriChecked = await driveHelpers.ensureCandyFrontSrv(driveUri);\n }\n return driveUriChecked;\n};\n\nexport const ensureCandyFrontSrvDriveUris = async (\n driveUris: string[],\n driveHelpers?: DriveHelpers\n): Promise<string[]> => {\n let driveUrisChecked = driveUris;\n if (driveHelpers) {\n driveUrisChecked = await Promise.all(driveUris.map(driveUri => driveHelpers?.ensureCandyFrontSrv(driveUri)));\n }\n return driveUrisChecked;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,2BAA2B,GAAG,MAAAA,CAAOC,QAAgB,EAAEC,YAA2B,KAAsB;EACjH,IAAIC,eAAe,GAAGF,QAAQ;EAC9B,IAAIC,YAAY,EAAE;IACdC,eAAe,GAAG,MAAMD,YAAY,CAACE,mBAAmB,CAACH,QAAQ,CAAC;EACtE;EACA,OAAOE,eAAe;AAC1B,CAAC;AAACE,OAAA,CAAAL,2BAAA,GAAAA,2BAAA;AAEK,MAAMM,4BAA4B,GAAG,MAAAA,CACxCC,SAAmB,EACnBL,YAA2B,KACP;EACpB,IAAIM,gBAAgB,GAAGD,SAAS;EAChC,IAAIL,YAAY,EAAE;IACdM,gBAAgB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAACH,SAAS,CAACI,GAAG,CAACV,QAAQ,IAAIC,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEE,mBAAmB,CAACH,QAAQ,CAAC,CAAC,CAAC;EAChH;EACA,OAAOO,gBAAgB;AAC3B,CAAC;AAACH,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ var _DraftPresentationType = require("../CandyApiClient/Types/Presentations/Draf
|
|
|
12
12
|
var _PollingTaskWaiter = require("../CandyApiClient/Types/PollingTasks/PollingTaskWaiter");
|
|
13
13
|
var _IFSPrinterClient = require("./IFSPrinterClient");
|
|
14
14
|
class FSPrinterClient {
|
|
15
|
-
constructor(fetchImpl, baseUrl, resourceZone, authentication, candyApiDraftClient, exceptionLogger) {
|
|
15
|
+
constructor(fetchImpl, baseUrl, resourceZone, authentication, candyApiDraftClient, exceptionLogger, driveHelpers) {
|
|
16
16
|
this.httpClient = void 0;
|
|
17
17
|
this.candyApiDraftClient = void 0;
|
|
18
18
|
this.pullingDelay = 0;
|
|
@@ -22,10 +22,12 @@ class FSPrinterClient {
|
|
|
22
22
|
this.defaultFactor = 2;
|
|
23
23
|
this.defaultTimeout = 1000 * 60 * 10;
|
|
24
24
|
this.taskResult = void 0;
|
|
25
|
+
this.driveHelpers = void 0;
|
|
25
26
|
this.httpClient = new _HttpClient.HttpClient(fetchImpl, baseUrl, (0, _AuthenticationMode.createAuthenticationProvider)(authentication), {
|
|
26
27
|
resourceZone: resourceZone
|
|
27
28
|
}, exceptionLogger);
|
|
28
29
|
this.candyApiDraftClient = candyApiDraftClient;
|
|
30
|
+
this.driveHelpers = driveHelpers;
|
|
29
31
|
}
|
|
30
32
|
async printRSV({
|
|
31
33
|
type,
|
|
@@ -41,17 +43,25 @@ class FSPrinterClient {
|
|
|
41
43
|
presentation: presentation
|
|
42
44
|
};
|
|
43
45
|
if (innerFuf !== null && innerFuf !== void 0 && innerFuf.driveUri) {
|
|
46
|
+
let driveUriChecked = innerFuf.driveUri;
|
|
47
|
+
if (this.driveHelpers) {
|
|
48
|
+
driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(innerFuf.driveUri);
|
|
49
|
+
}
|
|
44
50
|
options.fuf = {
|
|
45
|
-
driveUri:
|
|
51
|
+
driveUri: driveUriChecked
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
54
|
await this.print(options, requestOptions);
|
|
49
55
|
}
|
|
50
56
|
async printByRules(options) {
|
|
51
57
|
const partialFufUri = await this.getPartialFufDriveUrl(options.rules);
|
|
58
|
+
let driveUriChecked = partialFufUri;
|
|
59
|
+
if (this.driveHelpers) {
|
|
60
|
+
driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(partialFufUri);
|
|
61
|
+
}
|
|
52
62
|
await this.print({
|
|
53
63
|
fuf: {
|
|
54
|
-
driveUri:
|
|
64
|
+
driveUri: driveUriChecked
|
|
55
65
|
},
|
|
56
66
|
resultType: _IFSPrinterClient.PrinterResultTypes.Pdf,
|
|
57
67
|
...options.options
|
|
@@ -124,7 +134,11 @@ class FSPrinterClient {
|
|
|
124
134
|
if (options.presentation === _DraftPresentationType.DraftPresentationType.innerFuf) {
|
|
125
135
|
var _options$fuf;
|
|
126
136
|
if ((_options$fuf = options.fuf) !== null && _options$fuf !== void 0 && _options$fuf.driveUri) {
|
|
127
|
-
|
|
137
|
+
let driveUriChecked = options.fuf.driveUri;
|
|
138
|
+
if (this.driveHelpers) {
|
|
139
|
+
driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(options.fuf.driveUri);
|
|
140
|
+
}
|
|
141
|
+
return driveUriChecked;
|
|
128
142
|
}
|
|
129
143
|
return await this.getInnerFufDriveUrl();
|
|
130
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FSPrinterClient.js","names":["_HttpClient","require","_AuthenticationMode","_utils","_TypingUtils","_DraftPresentationType","_PollingTaskWaiter","_IFSPrinterClient","FSPrinterClient","constructor","fetchImpl","baseUrl","resourceZone","authentication","candyApiDraftClient","exceptionLogger","httpClient","pullingDelay","factor","timeout","defaultPullingDelay","defaultFactor","defaultTimeout","taskResult","HttpClient","createAuthenticationProvider","printRSV","type","resultType","PrinterResultTypes","Excel","presentation","DraftPresentationType","fuf","innerFuf","requestOptions","options","rsvInfo","driveUri","print","printByRules","partialFufUri","getPartialFufDriveUrl","rules","Pdf","_this$taskResult","applyRequestOptions","task","createTask","runMonitoringTask","taskId","resultUrl","resultUri","resetPrintResult","downloadDocument","downloadFufHref","getPartialFuf","ContentUri","Error","getInnerFufDriveUrl","startGetInnerFufTask","downloadHref","waitPollingTask","getInnerFufTask","getFufDriveUrl","startGetFufWithAttachmentsTask","getFufWithAttachmentsTask","contentUri","_this$taskResult2","_this$taskResult3","checkTask","delay","taskStatus","get","json","errorInfo","userMessage","presentationUri","getPresentationUri","optionsWithFuf","appendFufUrlToOptions","optionsWithSender","appendSenderAppToOptions","taskInfo","post","withJsonBody","_options$fuf$driveUri","_options$fuf2","_options$fuf","driveUrl","isNullOrEmpty","_this$taskResult4","reject","window","location","href","fufUrl","senderApp","_requestOptions$pulli","_requestOptions$facto","_requestOptions$timeo","undefined","exports"],"sources":["../../../../Common/FSPrinterClient/FSPrinterClient.ts"],"sourcesContent":["import { Fetch } from \"../HttpClient/FetchImplementation/Fetch\";\nimport { ExceptionLogger, HttpClient } from \"../HttpClient/HttpClient\";\nimport { IHttpClient } from \"../HttpClient/IHttpClient\";\nimport { AuthenticationMode, createAuthenticationProvider } from \"../HttpClient/AuthenticationMode\";\nimport { ICandyApiDraftClient } from \"../CandyApiClient/ICandyApiClient\";\nimport { delay } from \"../../Engine/src/Engine/utils\";\nimport { isNullOrEmpty, reject } from \"../TypingUtils\";\nimport { DraftPresentationType } from \"../CandyApiClient/Types/Presentations/DraftPresentationType\";\nimport { waitPollingTask } from \"../CandyApiClient/Types/PollingTasks/PollingTaskWaiter\";\n\nimport {\n FSPrinterTaskResult,\n FSPrinterTaskStatus,\n IFSPrinterClient,\n PrintByRulesOptions,\n PrinterOptions,\n PrinterRequestOptions,\n PrinterResultTypes,\n RSVPrinterOptions,\n} from \"./IFSPrinterClient\";\n\nexport class FSPrinterClient implements IFSPrinterClient {\n private readonly httpClient: IHttpClient;\n private readonly candyApiDraftClient: ICandyApiDraftClient;\n\n private pullingDelay: number = 0;\n private factor: number = 0;\n private timeout: number = 0;\n\n private readonly defaultPullingDelay: number = 1200;\n private readonly defaultFactor: number = 2;\n private readonly defaultTimeout: number = 1000 * 60 * 10;\n\n private taskResult: FSPrinterTaskResult | undefined;\n\n public constructor(\n fetchImpl: Fetch,\n baseUrl: string,\n resourceZone: undefined | string,\n authentication: undefined | AuthenticationMode,\n candyApiDraftClient: ICandyApiDraftClient,\n exceptionLogger?: ExceptionLogger\n ) {\n this.httpClient = new HttpClient(\n fetchImpl,\n baseUrl,\n createAuthenticationProvider(authentication),\n {\n resourceZone: resourceZone,\n },\n exceptionLogger\n );\n this.candyApiDraftClient = candyApiDraftClient;\n }\n\n public async printRSV(\n {\n type,\n resultType = PrinterResultTypes.Excel,\n presentation = DraftPresentationType.fuf,\n innerFuf,\n }: RSVPrinterOptions,\n requestOptions?: PrinterRequestOptions\n ): Promise<void> {\n const options: PrinterOptions = {\n resultType: resultType,\n rsvInfo: { type: type },\n presentation: presentation,\n };\n if (innerFuf?.driveUri) {\n options.fuf = { driveUri: innerFuf?.driveUri };\n }\n await this.print(options, requestOptions);\n }\n\n public async printByRules(options: PrintByRulesOptions): Promise<void> {\n const partialFufUri = await this.getPartialFufDriveUrl(options.rules);\n await this.print({\n fuf: {\n driveUri: partialFufUri,\n },\n resultType: PrinterResultTypes.Pdf,\n ...options.options,\n });\n }\n\n public async print(options: PrinterOptions, requestOptions?: PrinterRequestOptions): Promise<void> {\n this.applyRequestOptions(requestOptions);\n const task = await this.createTask(options);\n await this.runMonitoringTask(task.taskId);\n const resultUrl = this.taskResult?.resultUri;\n this.resetPrintResult();\n this.downloadDocument(resultUrl);\n }\n\n private async getPartialFufDriveUrl(rules: string[]): Promise<string> {\n const downloadFufHref = await this.candyApiDraftClient.getPartialFuf(rules);\n if (downloadFufHref && downloadFufHref?.ContentUri) {\n return downloadFufHref?.ContentUri;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async getInnerFufDriveUrl(): Promise<string> {\n await this.candyApiDraftClient.startGetInnerFufTask();\n const downloadHref = await waitPollingTask(() => this.candyApiDraftClient.getInnerFufTask());\n if (downloadHref) {\n return downloadHref;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async getFufDriveUrl(): Promise<string> {\n await this.candyApiDraftClient.startGetFufWithAttachmentsTask();\n const downloadFufHref = await waitPollingTask(() => this.candyApiDraftClient.getFufWithAttachmentsTask(\"Json\"));\n if (downloadFufHref && \"fuf\" in downloadFufHref && downloadFufHref?.fuf.contentUri) {\n return downloadFufHref?.fuf.contentUri;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async runMonitoringTask(taskId: string): Promise<void> {\n while (!this.taskResult?.resultUri) {\n await this.checkTask(taskId);\n if (!this.taskResult?.resultUri) {\n await delay(this.pullingDelay);\n this.pullingDelay *= this.factor;\n }\n }\n }\n\n private async checkTask(taskId: string): Promise<void> {\n const taskStatus = await this.httpClient.get(`v3/tasks/${taskId}`).json<FSPrinterTaskResult>();\n if (taskStatus.errorInfo) {\n throw new Error(taskStatus.errorInfo.userMessage);\n }\n if (taskStatus.resultUri) {\n this.taskResult = taskStatus;\n return;\n }\n if (this.timeout <= this.pullingDelay) {\n throw new Error(`Timeout ${this.timeout / 60 / 1000} min for print file has expired`);\n }\n }\n\n private async createTask(options: PrinterOptions): Promise<FSPrinterTaskStatus> {\n const presentationUri = await this.getPresentationUri(options);\n\n const optionsWithFuf = this.appendFufUrlToOptions(options, presentationUri);\n const optionsWithSender = this.appendSenderAppToOptions(optionsWithFuf);\n const taskInfo = await this.httpClient\n .post(\"v3/tasks\")\n .withJsonBody(optionsWithSender)\n .json<FSPrinterTaskStatus>();\n return taskInfo;\n }\n\n private async getPresentationUri(options: PrinterOptions) {\n if (options.presentation === DraftPresentationType.innerFuf) {\n if (options.fuf?.driveUri) {\n return options.fuf.driveUri;\n }\n return await this.getInnerFufDriveUrl();\n }\n return options.fuf?.driveUri ?? (await this.getFufDriveUrl());\n }\n\n private downloadDocument(driveUrl: string | undefined) {\n if (isNullOrEmpty(driveUrl)) {\n reject(`Ссылка на печать документа пустая или undefined. Трейс печати: ${this.taskResult?.taskId}`);\n }\n window.location.href = driveUrl;\n }\n\n private appendFufUrlToOptions(options: PrinterOptions, fufUrl: string): PrinterOptions {\n return { ...options, fuf: { driveUri: fufUrl } };\n }\n\n private appendSenderAppToOptions(options: PrinterOptions): PrinterOptions {\n return { ...options, senderApp: \"candy-front\" };\n }\n\n private applyRequestOptions(requestOptions?: PrinterRequestOptions) {\n this.pullingDelay = requestOptions?.pullingDelay ?? this.defaultPullingDelay;\n this.factor = requestOptions?.factor ?? this.defaultFactor;\n this.timeout = requestOptions?.timeout ?? this.defaultTimeout;\n }\n\n private resetPrintResult() {\n this.taskResult = undefined;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,G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AAdA,cAAc,CAAEhB,OAAO,cAAAiF,qBAAA,cAAAA,qBAAA,GAAI,IAAI,CAAC9E,cAAc;EACjE;EAEQ+B,gBAAgBA,CAAA,EAAG;IACvB,IAAI,CAAC9B,UAAU,GAAG8E,SAAS;EAC/B;AACJ;AAACC,OAAA,CAAA9F,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FSPrinterClient.js","names":["_HttpClient","require","_AuthenticationMode","_utils","_TypingUtils","_DraftPresentationType","_PollingTaskWaiter","_IFSPrinterClient","FSPrinterClient","constructor","fetchImpl","baseUrl","resourceZone","authentication","candyApiDraftClient","exceptionLogger","driveHelpers","httpClient","pullingDelay","factor","timeout","defaultPullingDelay","defaultFactor","defaultTimeout","taskResult","HttpClient","createAuthenticationProvider","printRSV","type","resultType","PrinterResultTypes","Excel","presentation","DraftPresentationType","fuf","innerFuf","requestOptions","options","rsvInfo","driveUri","driveUriChecked","ensureCandyFrontSrv","print","printByRules","partialFufUri","getPartialFufDriveUrl","rules","Pdf","_this$taskResult","applyRequestOptions","task","createTask","runMonitoringTask","taskId","resultUrl","resultUri","resetPrintResult","downloadDocument","downloadFufHref","getPartialFuf","ContentUri","Error","getInnerFufDriveUrl","startGetInnerFufTask","downloadHref","waitPollingTask","getInnerFufTask","getFufDriveUrl","startGetFufWithAttachmentsTask","getFufWithAttachmentsTask","contentUri","_this$taskResult2","_this$taskResult3","checkTask","delay","taskStatus","get","json","errorInfo","userMessage","presentationUri","getPresentationUri","optionsWithFuf","appendFufUrlToOptions","optionsWithSender","appendSenderAppToOptions","taskInfo","post","withJsonBody","_options$fuf$driveUri","_options$fuf2","_options$fuf","driveUrl","isNullOrEmpty","_this$taskResult4","reject","window","location","href","fufUrl","senderApp","_requestOptions$pulli","_requestOptions$facto","_requestOptions$timeo","undefined","exports"],"sources":["../../../../Common/FSPrinterClient/FSPrinterClient.ts"],"sourcesContent":["import { Fetch } from \"../HttpClient/FetchImplementation/Fetch\";\nimport { ExceptionLogger, HttpClient } from \"../HttpClient/HttpClient\";\nimport { IHttpClient } from \"../HttpClient/IHttpClient\";\nimport { AuthenticationMode, createAuthenticationProvider } from \"../HttpClient/AuthenticationMode\";\nimport { ICandyApiDraftClient } from \"../CandyApiClient/ICandyApiClient\";\nimport { delay } from \"../../Engine/src/Engine/utils\";\nimport { isNullOrEmpty, reject } from \"../TypingUtils\";\nimport { DraftPresentationType } from \"../CandyApiClient/Types/Presentations/DraftPresentationType\";\nimport { waitPollingTask } from \"../CandyApiClient/Types/PollingTasks/PollingTaskWaiter\";\nimport { DriveHelpers } from \"../DriveIntegration/DriveHelpers\";\n\nimport {\n FSPrinterTaskResult,\n FSPrinterTaskStatus,\n IFSPrinterClient,\n PrintByRulesOptions,\n PrinterOptions,\n PrinterRequestOptions,\n PrinterResultTypes,\n RSVPrinterOptions,\n} from \"./IFSPrinterClient\";\n\nexport class FSPrinterClient implements IFSPrinterClient {\n private readonly httpClient: IHttpClient;\n private readonly candyApiDraftClient: ICandyApiDraftClient;\n\n private pullingDelay: number = 0;\n private factor: number = 0;\n private timeout: number = 0;\n\n private readonly defaultPullingDelay: number = 1200;\n private readonly defaultFactor: number = 2;\n private readonly defaultTimeout: number = 1000 * 60 * 10;\n\n private taskResult: FSPrinterTaskResult | undefined;\n\n private readonly driveHelpers?: DriveHelpers;\n\n public constructor(\n fetchImpl: Fetch,\n baseUrl: string,\n resourceZone: undefined | string,\n authentication: undefined | AuthenticationMode,\n candyApiDraftClient: ICandyApiDraftClient,\n exceptionLogger?: ExceptionLogger,\n driveHelpers?: DriveHelpers\n ) {\n this.httpClient = new HttpClient(\n fetchImpl,\n baseUrl,\n createAuthenticationProvider(authentication),\n {\n resourceZone: resourceZone,\n },\n exceptionLogger\n );\n this.candyApiDraftClient = candyApiDraftClient;\n this.driveHelpers = driveHelpers;\n }\n\n public async printRSV(\n {\n type,\n resultType = PrinterResultTypes.Excel,\n presentation = DraftPresentationType.fuf,\n innerFuf,\n }: RSVPrinterOptions,\n requestOptions?: PrinterRequestOptions\n ): Promise<void> {\n const options: PrinterOptions = {\n resultType: resultType,\n rsvInfo: { type: type },\n presentation: presentation,\n };\n if (innerFuf?.driveUri) {\n let driveUriChecked = innerFuf.driveUri;\n if (this.driveHelpers) {\n driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(innerFuf.driveUri);\n }\n\n options.fuf = { driveUri: driveUriChecked };\n }\n await this.print(options, requestOptions);\n }\n\n public async printByRules(options: PrintByRulesOptions): Promise<void> {\n const partialFufUri = await this.getPartialFufDriveUrl(options.rules);\n let driveUriChecked = partialFufUri;\n if (this.driveHelpers) {\n driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(partialFufUri);\n }\n\n await this.print({\n fuf: {\n driveUri: driveUriChecked,\n },\n resultType: PrinterResultTypes.Pdf,\n ...options.options,\n });\n }\n\n public async print(options: PrinterOptions, requestOptions?: PrinterRequestOptions): Promise<void> {\n this.applyRequestOptions(requestOptions);\n const task = await this.createTask(options);\n await this.runMonitoringTask(task.taskId);\n const resultUrl = this.taskResult?.resultUri;\n this.resetPrintResult();\n this.downloadDocument(resultUrl);\n }\n\n private async getPartialFufDriveUrl(rules: string[]): Promise<string> {\n const downloadFufHref = await this.candyApiDraftClient.getPartialFuf(rules);\n if (downloadFufHref && downloadFufHref?.ContentUri) {\n return downloadFufHref?.ContentUri;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async getInnerFufDriveUrl(): Promise<string> {\n await this.candyApiDraftClient.startGetInnerFufTask();\n const downloadHref = await waitPollingTask(() => this.candyApiDraftClient.getInnerFufTask());\n if (downloadHref) {\n return downloadHref;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async getFufDriveUrl(): Promise<string> {\n await this.candyApiDraftClient.startGetFufWithAttachmentsTask();\n const downloadFufHref = await waitPollingTask(() => this.candyApiDraftClient.getFufWithAttachmentsTask(\"Json\"));\n if (downloadFufHref && \"fuf\" in downloadFufHref && downloadFufHref?.fuf.contentUri) {\n return downloadFufHref?.fuf.contentUri;\n }\n throw new Error(\"downloadFufHref is not defined\");\n }\n\n private async runMonitoringTask(taskId: string): Promise<void> {\n while (!this.taskResult?.resultUri) {\n await this.checkTask(taskId);\n if (!this.taskResult?.resultUri) {\n await delay(this.pullingDelay);\n this.pullingDelay *= this.factor;\n }\n }\n }\n\n private async checkTask(taskId: string): Promise<void> {\n const taskStatus = await this.httpClient.get(`v3/tasks/${taskId}`).json<FSPrinterTaskResult>();\n if (taskStatus.errorInfo) {\n throw new Error(taskStatus.errorInfo.userMessage);\n }\n if (taskStatus.resultUri) {\n this.taskResult = taskStatus;\n return;\n }\n if (this.timeout <= this.pullingDelay) {\n throw new Error(`Timeout ${this.timeout / 60 / 1000} min for print file has expired`);\n }\n }\n\n private async createTask(options: PrinterOptions): Promise<FSPrinterTaskStatus> {\n const presentationUri = await this.getPresentationUri(options);\n\n const optionsWithFuf = this.appendFufUrlToOptions(options, presentationUri);\n const optionsWithSender = this.appendSenderAppToOptions(optionsWithFuf);\n const taskInfo = await this.httpClient\n .post(\"v3/tasks\")\n .withJsonBody(optionsWithSender)\n .json<FSPrinterTaskStatus>();\n return taskInfo;\n }\n\n private async getPresentationUri(options: PrinterOptions) {\n if (options.presentation === DraftPresentationType.innerFuf) {\n if (options.fuf?.driveUri) {\n let driveUriChecked = options.fuf.driveUri;\n if (this.driveHelpers) {\n driveUriChecked = await this.driveHelpers.ensureCandyFrontSrv(options.fuf.driveUri);\n }\n\n return driveUriChecked;\n }\n return await this.getInnerFufDriveUrl();\n }\n return options.fuf?.driveUri ?? (await this.getFufDriveUrl());\n }\n\n private downloadDocument(driveUrl: string | undefined) {\n if (isNullOrEmpty(driveUrl)) {\n reject(`Ссылка на печать документа пустая или undefined. Трейс печати: ${this.taskResult?.taskId}`);\n }\n window.location.href = driveUrl;\n }\n\n private appendFufUrlToOptions(options: PrinterOptions, fufUrl: string): PrinterOptions {\n return { ...options, fuf: { driveUri: fufUrl } };\n }\n\n private appendSenderAppToOptions(options: PrinterOptions): PrinterOptions {\n return { ...options, senderApp: \"candy-front\" };\n }\n\n private applyRequestOptions(requestOptions?: PrinterRequestOptions) {\n this.pullingDelay = requestOptions?.pullingDelay ?? this.defaultPullingDelay;\n this.factor = requestOptions?.factor ?? this.defaultFactor;\n this.timeout = requestOptions?.timeout ?? this.defaultTimeout;\n }\n\n private resetPrintResult() {\n this.taskResult = undefined;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAGA,IAAAM,iBAAA,GAAAN,OAAA;AAWO,MAAMO,eAAe,CAA6B;EAgB9CC,WAAWA,CACdC,SAAgB,EAChBC,OAAe,EACfC,YAAgC,EAChCC,cAA8C,EAC9CC,mBAAyC,EACzCC,eAAiC,EACjCC,YAA2B,EAC7B;IAAA,KAvBeC,UAAU;IAAA,KACVH,mBAAmB;IAAA,KAE5BI,YAAY,GAAW,CAAC;IAAA,KACxBC,MAAM,GAAW,CAAC;IAAA,KAClBC,OAAO,GAAW,CAAC;IAAA,KAEVC,mBAAmB,GAAW,IAAI;IAAA,KAClCC,aAAa,GAAW,CAAC;IAAA,KACzBC,cAAc,GAAW,IAAI,GAAG,EAAE,GAAG,EAAE;IAAA,KAEhDC,UAAU;IAAA,KAEDR,YAAY;IAWzB,IAAI,CAACC,UAAU,GAAG,IAAIQ,sBAAU,CAC5Bf,SAAS,EACTC,OAAO,EACP,IAAAe,gDAA4B,EAACb,cAAc,CAAC,EAC5C;MACID,YAAY,EAAEA;IAClB,CAAC,EACDG,eACJ,CAAC;IACD,IAAI,CAACD,mBAAmB,GAAGA,mBAAmB;IAC9C,IAAI,CAACE,YAAY,GAAGA,YAAY;EACpC;EAEA,MAAaW,QAAQA,CACj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CHANGED
|
@@ -13,7 +13,7 @@ _TypedProcessWorker.TypedProcessWorker.start(async ([pathToGeneratorProcessSugar
|
|
|
13
13
|
const formContent = await processSugar(formSource.sugarContent, formSource.resources, generationOptions);
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line no-warning-comments
|
|
16
|
-
// TODO(2026-
|
|
16
|
+
// TODO(2026-06-30): временно отключаем валидацию компиляции Flang на бэкенде (исправить в задаче https://yt.skbkontur.ru/issue/FS-9242)
|
|
17
17
|
// const validator = new GeneratorSourcesValidator(generationOptions);
|
|
18
18
|
// await validator.validate(formContent);
|
|
19
19
|
|
package/distr/Tools/src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadSourcesAndProcessSugarWorker.js","names":["_IterableUtils","require","_GeneratorRequireUtils","_TypedProcessWorker","TypedProcessWorker","start","pathToGeneratorProcessSugar","formSourcesPath","farmDirectory","hlFarmDirectoryPath","generationOptions","purgeCache","requestNumber","send","formSource","importer","GeneratorSourcesImporter","readSources","importReadSources","processSugar","importProcessSugar","formContent","sugarContent","resources","result","key","formContentItem","iterateEntries","Buffer","payload","toString","encoding","type","gfv","generatedForm","error","Error","_formSource","errorText","stack","_formSource2"],"sources":["../../../../../../src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.ts"],"sourcesContent":["import { GeneratedForm, GenerationOptions } from \"../../Form/GenerateForm\";\nimport { FormSource } from \"../../ReadFormSource\";\nimport { iterateEntries } from \"../../../../../Common/IterableUtils\";\n\nimport { GeneratorSourcesImporter } from \"./GeneratorRequireUtils\";\nimport { TypedProcessWorker } from \"./TypedProcessWorker\";\n\nexport interface GeneratedFormInterProcessMessage {\n [relativeFileName: string]: string | { payload: string; encoding: string };\n}\n\nexport type CallMessage = [string, string, string, string, undefined | GenerationOptions, boolean, number];\nexport type CallResponse =\n | { type: \"Result\"; gfv: string; generatedForm: GeneratedFormInterProcessMessage; requestNumber: number }\n | { type: \"Error\"; gfv?: string; errorText: string; requestNumber: number };\n\nTypedProcessWorker.start<CallMessage, CallResponse>(\n async (\n [\n pathToGeneratorProcessSugar,\n formSourcesPath,\n farmDirectory,\n hlFarmDirectoryPath,\n generationOptions,\n purgeCache,\n requestNumber,\n ],\n send\n ): Promise<void> => {\n let formSource: FormSource | undefined;\n try {\n const importer = new GeneratorSourcesImporter(purgeCache);\n const readSources = await importer.importReadSources(pathToGeneratorProcessSugar);\n formSource = await readSources(formSourcesPath, farmDirectory, hlFarmDirectoryPath);\n\n const processSugar = await importer.importProcessSugar(pathToGeneratorProcessSugar);\n\n const formContent: GeneratedForm = await processSugar(\n formSource.sugarContent,\n formSource.resources,\n generationOptions\n );\n\n // eslint-disable-next-line no-warning-comments\n // TODO(2026-
|
|
1
|
+
{"version":3,"file":"ReadSourcesAndProcessSugarWorker.js","names":["_IterableUtils","require","_GeneratorRequireUtils","_TypedProcessWorker","TypedProcessWorker","start","pathToGeneratorProcessSugar","formSourcesPath","farmDirectory","hlFarmDirectoryPath","generationOptions","purgeCache","requestNumber","send","formSource","importer","GeneratorSourcesImporter","readSources","importReadSources","processSugar","importProcessSugar","formContent","sugarContent","resources","result","key","formContentItem","iterateEntries","Buffer","payload","toString","encoding","type","gfv","generatedForm","error","Error","_formSource","errorText","stack","_formSource2"],"sources":["../../../../../../src/BuildTasks/Generator/GeneratorWorker/ReadSourcesAndProcessSugarWorker.ts"],"sourcesContent":["import { GeneratedForm, GenerationOptions } from \"../../Form/GenerateForm\";\nimport { FormSource } from \"../../ReadFormSource\";\nimport { iterateEntries } from \"../../../../../Common/IterableUtils\";\n\nimport { GeneratorSourcesImporter } from \"./GeneratorRequireUtils\";\nimport { TypedProcessWorker } from \"./TypedProcessWorker\";\n\nexport interface GeneratedFormInterProcessMessage {\n [relativeFileName: string]: string | { payload: string; encoding: string };\n}\n\nexport type CallMessage = [string, string, string, string, undefined | GenerationOptions, boolean, number];\nexport type CallResponse =\n | { type: \"Result\"; gfv: string; generatedForm: GeneratedFormInterProcessMessage; requestNumber: number }\n | { type: \"Error\"; gfv?: string; errorText: string; requestNumber: number };\n\nTypedProcessWorker.start<CallMessage, CallResponse>(\n async (\n [\n pathToGeneratorProcessSugar,\n formSourcesPath,\n farmDirectory,\n hlFarmDirectoryPath,\n generationOptions,\n purgeCache,\n requestNumber,\n ],\n send\n ): Promise<void> => {\n let formSource: FormSource | undefined;\n try {\n const importer = new GeneratorSourcesImporter(purgeCache);\n const readSources = await importer.importReadSources(pathToGeneratorProcessSugar);\n formSource = await readSources(formSourcesPath, farmDirectory, hlFarmDirectoryPath);\n\n const processSugar = await importer.importProcessSugar(pathToGeneratorProcessSugar);\n\n const formContent: GeneratedForm = await processSugar(\n formSource.sugarContent,\n formSource.resources,\n generationOptions\n );\n\n // eslint-disable-next-line no-warning-comments\n // TODO(2026-06-30): временно отключаем валидацию компиляции Flang на бэкенде (исправить в задаче https://yt.skbkontur.ru/issue/FS-9242)\n // const validator = new GeneratorSourcesValidator(generationOptions);\n // await validator.validate(formContent);\n\n const result: GeneratedFormInterProcessMessage = {};\n\n // NOTE Because only JSON are allowed for IPC we need to convert Buffer -> Base64\n // Another solution is use a stream, but formContent still need to convert or send by chunks\n for (const [key, formContentItem] of iterateEntries(formContent)) {\n // @ts-ignore\n result[key] =\n formContentItem instanceof Buffer\n ? { payload: formContentItem.toString(\"base64\"), encoding: \"base64\" }\n : formContentItem;\n }\n\n send({\n type: \"Result\",\n gfv: formSource.resources.gfv,\n generatedForm: result,\n requestNumber: requestNumber,\n });\n } catch (error) {\n if (error instanceof Error) {\n send({\n type: \"Error\",\n gfv: formSource?.resources.gfv,\n errorText: `${error.toString()}\\n${error.stack}`,\n requestNumber: requestNumber,\n });\n } else {\n send({\n type: \"Error\",\n gfv: formSource?.resources.gfv,\n errorText: `${error}`,\n requestNumber: requestNumber,\n });\n }\n }\n }\n);\n"],"mappings":";;AAEA,IAAAA,cAAA,GAAAC,OA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,YAAYC,KAAK,EAAE;MAAA,IAAAC,WAAA;MACxBxB,IAAI,CAAC;QACDmB,IAAI,EAAE,OAAO;QACbC,GAAG,GAAAI,WAAA,GAAEvB,UAAU,cAAAuB,WAAA,uBAAVA,WAAA,CAAYd,SAAS,CAACU,GAAG;QAC9BK,SAAS,EAAE,GAAGH,KAAK,CAACL,QAAQ,CAAC,CAAC,KAAKK,KAAK,CAACI,KAAK,EAAE;QAChD3B,aAAa,EAAEA;MACnB,CAAC,CAAC;IACN,CAAC,MAAM;MAAA,IAAA4B,YAAA;MACH3B,IAAI,CAAC;QACDmB,IAAI,EAAE,OAAO;QACbC,GAAG,GAAAO,YAAA,GAAE1B,UAAU,cAAA0B,YAAA,uBAAVA,YAAA,CAAYjB,SAAS,CAACU,GAAG;QAC9BK,SAAS,EAAE,GAAGH,KAAK,EAAE;QACrBvB,aAAa,EAAEA;MACnB,CAAC,CAAC;IACN;EACJ;AACJ,CACJ,CAAC","ignoreList":[]}
|
|
@@ -147,7 +147,9 @@ let BuildServerBuildFormsController = exports.BuildServerBuildFormsController =
|
|
|
147
147
|
async getOrCreateBuildFormDevServer(gfv) {
|
|
148
148
|
let devServer = this.devServers[gfv];
|
|
149
149
|
if (devServer == undefined) {
|
|
150
|
-
devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.allFarmConfig, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly, false,
|
|
150
|
+
devServer = new _BuildFormDevServer.BuildFormDevServer(this.nextFreePort++, this.allFarmDirectoryPath, gfv, this.candyModulesDirectory, this.allFarmConfig, this.useGeneratorFromLocalSources, this.engineDirectory, this.buildDebugOnly, false,
|
|
151
|
+
// skipCodeReformatting
|
|
152
|
+
this.nightly);
|
|
151
153
|
this.devServers[gfv] = devServer;
|
|
152
154
|
await devServer.start();
|
|
153
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuildServerBuildFormsController.js","names":["path","_interopRequireWildcard","require","_mimeTypes","_interopRequireDefault","_ResolveFormInfo","_Methods","_NotFoundWebError","_Params","_Results","_StreamResultHandler","_SingletonController","_WellKnownDirectories","_BuildFormDevServer","_FarmDirectory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerBuildFormsController","exports","httpGet","httpReturn","StreamWithMime","httpUrlParam","httpType","String","Stream","SingletonController","constructor","allFarmConfig","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","nightly","allFarmDirectory","allFarmDirectoryPath","nextFreePort","devServers","map","farm","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getDevServerUpdateJson","updateName","getFirstExistsFileAsStreamFromDevServer","getDevServerUpdateJs","getDevServerUpdateJsMap","getFormScript","fileName","_fileNameWithoutExt","gfv","buildFormDevServer","getOrCreateBuildFormDevServer","StreamResult","getFileAsStream","getFormStyle","theme","replace","getFormImages","mime","lookup","getAllKclangFile","stream","getGeneratedFileAsStream","getExtendedSchemaFile","getCustomFLangNormalizeFile","normalizerId","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\"/schemas/:gfv.extendedSchema.json\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getExtendedSchemaFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);\n return new StreamResult(stream);\n }\n\n @httpGet(\n \"/normalize/:gfv.:normalizerId.flang\",\n httpReturn.Stream,\n httpUrlParam(\"gfv\", httpType.String),\n httpUrlParam(\"normalizerId\", httpType.String)\n )\n public async getCustomFLangNormalizeFile(gfv: string, normalizerId: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.allFarmConfig,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false,\n this.nightly\n );\n this.devServers[gfv] = devServer;\n await devServer.start();\n }\n return devServer;\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAV,OAAA;AAEA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAA4D,IAAAa,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,MAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAzB,wBAAAyB,CAAA,EAAAE,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H,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,oBAAA1H,KAAA,GAAAmB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,oBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,mBAAAzH,KAAA,GAAAkB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,mBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,oBAAAxH,KAAA,GAAAiB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,oBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,uBAAAvH,KAAA,GAAAgB,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,uBAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,4BAAAtH,KAAA,GAAAe,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,4BAAApH,MAAA,CAAAoH,SAAA,OAAAD,0BAAA,CAAA5G,OAAA,EAAAP,MAAA,CAAAoH,SAAA,kCAAArH,KAAA,GAAAc,MAAA,CAAAE,wBAAA,CAAAf,MAAA,CAAAoH,SAAA,kCAAApH,MAAA,CAAAoH,SAAA,IAAApH,MAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BuildServerBuildFormsController.js","names":["path","_interopRequireWildcard","require","_mimeTypes","_interopRequireDefault","_ResolveFormInfo","_Methods","_NotFoundWebError","_Params","_Results","_StreamResultHandler","_SingletonController","_WellKnownDirectories","_BuildFormDevServer","_FarmDirectory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_class","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","BuildServerBuildFormsController","exports","httpGet","httpReturn","StreamWithMime","httpUrlParam","httpType","String","Stream","SingletonController","constructor","allFarmConfig","candyModulesDirectory","useGeneratorFromLocalSources","engineDirectory","buildDebugOnly","nightly","allFarmDirectory","allFarmDirectoryPath","nextFreePort","devServers","map","farm","FarmDirectory","farmDirectory","setupMiddleware","expressApplication","use","_","__","next","resetAllFarmDirectories","getDevServerUpdateJson","updateName","getFirstExistsFileAsStreamFromDevServer","getDevServerUpdateJs","getDevServerUpdateJsMap","getFormScript","fileName","_fileNameWithoutExt","gfv","buildFormDevServer","getOrCreateBuildFormDevServer","StreamResult","getFileAsStream","getFormStyle","theme","replace","getFormImages","mime","lookup","getAllKclangFile","stream","getGeneratedFileAsStream","getExtendedSchemaFile","getCustomFLangNormalizeFile","normalizerId","filename","mimeType","devServer","values","undefined","NotFoundWebError","getAllAttachmentPathFileNames","Promise","all","getAllGfvs","flat","getAttachmentPathsFileContent","resultStream","getAttachmentPathsWithGfvsFileContent","getAllNormalizationFileNames","result","gfvInfos","getAllGfvWithLocations","formPath","_formConfig$settings$","_formConfig$settings","formConfig","readFormConfig","join","WellKnownDirectories","FormJsonFileName","useServerSideFLangNormalization","settings","push","getNormalizationFileContent","_formConfig$settings$2","_formConfig$settings2","gfvInfo","find","x","BuildFormDevServer","start","_applyDecoratedDescriptor2","prototype"],"sources":["../../../../../../src/CLICommands/BuildServer/ResourcesControllers/BuildServerBuildFormsController.ts"],"sourcesContent":["import * as path from \"path\";\n\nimport { Express } from \"express\";\nimport mime from \"mime-types\";\nimport { FarmConfig } from \"Tools/src/CandyCLI\";\n\nimport { readFormConfig } from \"../../../BuildTasks/ResolveFormInfo\";\nimport { httpGet } from \"../../../Commons/HttpServer/AttributeRouting/Methods\";\nimport { NotFoundWebError } from \"../../../Commons/HttpServer/AttributeRouting/NotFoundWebError\";\nimport { httpType, httpUrlParam } from \"../../../Commons/HttpServer/AttributeRouting/Params\";\nimport { httpReturn } from \"../../../Commons/HttpServer/AttributeRouting/Results\";\nimport { StreamResult } from \"../../../Commons/HttpServer/AttributeRouting/Results/StreamResultHandler\";\nimport { SingletonController } from \"../../../Commons/HttpServer/ExpressWrapper/SingletonController\";\nimport { WellKnownDirectories } from \"../../../../../Common/WellKnownDirectories\";\n\nimport { BuildFormDevServer } from \"./DevServers/BuildFormDevServer\";\nimport { FarmDirectory } from \"./Directories/FarmDirectory\";\nimport { IGeneratedServerSideSourcesProvider } from \"./IGeneratedServerSideSourcesProvider\";\n\nexport class BuildServerBuildFormsController\n extends SingletonController\n implements IGeneratedServerSideSourcesProvider\n{\n private allFarmDirectory: FarmDirectory[];\n private readonly allFarmDirectoryPath: string[];\n private nextFreePort = 12001;\n private readonly devServers: { [gfv: string]: undefined | BuildFormDevServer } = {};\n private readonly candyModulesDirectory: string;\n private readonly allFarmConfig: FarmConfig[];\n private readonly useGeneratorFromLocalSources: boolean;\n private readonly engineDirectory: string;\n private readonly nightly: boolean;\n private readonly buildDebugOnly: boolean;\n\n public constructor(\n allFarmConfig: FarmConfig[],\n candyModulesDirectory: string,\n useGeneratorFromLocalSources: boolean,\n engineDirectory: string,\n buildDebugOnly: boolean,\n nightly: boolean = false\n ) {\n super();\n this.nightly = nightly;\n this.allFarmDirectory = allFarmConfig.map(farm => new FarmDirectory(farm.farmDirectory));\n this.allFarmDirectoryPath = allFarmConfig.map(farm => farm.farmDirectory);\n this.candyModulesDirectory = candyModulesDirectory;\n this.allFarmConfig = allFarmConfig;\n this.useGeneratorFromLocalSources = useGeneratorFromLocalSources;\n this.engineDirectory = engineDirectory;\n this.buildDebugOnly = buildDebugOnly;\n }\n\n public async setupMiddleware(expressApplication: Express) {\n expressApplication.use(\"/force-gfvs\", (_, __, next) => {\n this.resetAllFarmDirectories();\n next();\n });\n }\n\n private resetAllFarmDirectories() {\n this.allFarmDirectory = this.allFarmConfig.map(i => new FarmDirectory(i.farmDirectory));\n }\n\n @httpGet(\n \"/:update.hot-update.json\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJson(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.json`);\n }\n\n @httpGet(\n \"/:update.hot-update.js\",\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJs(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js`);\n }\n\n @httpGet(\n \"/:update.hot-update.js.map\",\n httpReturn.StreamWithMime(\"application/json\"),\n httpUrlParam(\"update\", httpType.String)\n )\n public async getDevServerUpdateJsMap(updateName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(`static/${updateName}.hot-update.js.map`);\n }\n\n @httpGet(\n /^\\/public\\/scripts\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).js)$/i,\n httpReturn.StreamWithMime(\"application/javascript\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String)\n )\n public async getFormScript(fileName: string, _fileNameWithoutExt: string, gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(await buildFormDevServer.getFileAsStream(`static/public/scripts/${fileName}`));\n }\n\n @httpGet(\n /^\\/public\\/styles\\/(((\\d{6,})(.[\\w\\-]*)?(.min)?).css)$/i,\n httpReturn.StreamWithMime(\"text/css\"),\n httpUrlParam(\"0\", httpType.String),\n httpUrlParam(\"1\", httpType.String),\n httpUrlParam(\"2\", httpType.String),\n httpUrlParam(\"3\", httpType.String)\n )\n public async getFormStyle(\n fileName: string,\n _fileNameWithoutExt: string,\n gfv: string,\n theme: undefined | string\n ): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n return new StreamResult(\n await buildFormDevServer.getFileAsStream(`static/public/styles/${fileName.replace(theme ?? \"\", \"\")}`)\n );\n }\n\n @httpGet(\"/public/images/:filename\", httpReturn.Stream, httpUrlParam(\"filename\", httpType.String))\n public async getFormImages(fileName: string): Promise<StreamResult> {\n return await this.getFirstExistsFileAsStreamFromDevServer(\n `static/public/images/${fileName}`,\n mime.lookup(fileName)\n );\n }\n\n @httpGet(\"/normalize/:gfv.All.kclang\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getAllKclangFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`All.kclang`);\n return new StreamResult(stream);\n }\n\n @httpGet(\"/schemas/:gfv.extendedSchema.json\", httpReturn.Stream, httpUrlParam(\"gfv\", httpType.String))\n public async getExtendedSchemaFile(gfv: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`extendedSchema.json`);\n return new StreamResult(stream);\n }\n\n @httpGet(\n \"/normalize/:gfv.:normalizerId.flang\",\n httpReturn.Stream,\n httpUrlParam(\"gfv\", httpType.String),\n httpUrlParam(\"normalizerId\", httpType.String)\n )\n public async getCustomFLangNormalizeFile(gfv: string, normalizerId: string): Promise<StreamResult> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const stream = await buildFormDevServer.getGeneratedFileAsStream(`${normalizerId}.flang`);\n return new StreamResult(stream);\n }\n\n private async getFirstExistsFileAsStreamFromDevServer(filename: string, mimeType?: string | false) {\n for (const devServer of Object.values(this.devServers)) {\n if (devServer != undefined) {\n try {\n return new StreamResult(await devServer.getFileAsStream(filename), mimeType);\n } catch {\n // try next server\n }\n }\n }\n throw new NotFoundWebError(\"File not found\", true);\n }\n\n public async getAllAttachmentPathFileNames(): Promise<string[]> {\n return (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvs()))).flat().map(gfv => `${gfv}.json`);\n }\n\n public async getAttachmentPathsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPaths.json`);\n return resultStream;\n }\n\n public async getAttachmentPathsWithGfvsFileContent(gfv: string): Promise<NodeJS.ReadableStream> {\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`AttachmentPathsWithGfvs.json`);\n return resultStream;\n }\n\n public async getAllNormalizationFileNames(): Promise<string[]> {\n const result: string[] = [];\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n for (const { gfv, formPath } of gfvInfos) {\n const formConfig = await readFormConfig(path.join(formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (useServerSideFLangNormalization) {\n result.push(`${gfv}.normalize`);\n }\n }\n return result;\n }\n\n public async getNormalizationFileContent(gfv: string): Promise<NodeJS.ReadableStream | null> {\n const gfvInfos = (await Promise.all(this.allFarmDirectory.map(i => i.getAllGfvWithLocations()))).flat();\n const gfvInfo = gfvInfos.find(x => x.gfv === gfv);\n if (gfvInfo == null) {\n return null;\n }\n const formConfig = await readFormConfig(path.join(gfvInfo.formPath, WellKnownDirectories.FormJsonFileName));\n const useServerSideFLangNormalization = formConfig.settings?.useServerSideFLangNormalization ?? false;\n if (!useServerSideFLangNormalization) {\n return null;\n }\n const buildFormDevServer = await this.getOrCreateBuildFormDevServer(gfv);\n const resultStream = await buildFormDevServer.getGeneratedFileAsStream(`ServerSide.normalize`);\n return resultStream;\n }\n\n private async getOrCreateBuildFormDevServer(gfv: string): Promise<BuildFormDevServer> {\n let devServer = this.devServers[gfv];\n if (devServer == undefined) {\n devServer = new BuildFormDevServer(\n this.nextFreePort++,\n this.allFarmDirectoryPath,\n gfv,\n this.candyModulesDirectory,\n this.allFarmConfig,\n this.useGeneratorFromLocalSources,\n this.engineDirectory,\n this.buildDebugOnly,\n false, // skipCodeReformatting\n this.nightly\n );\n this.devServers[gfv] = devServer;\n await devServer.start();\n }\n return devServer;\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAV,OAAA;AAEA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AAA4D,IAAAa,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,MAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAzB,wBAAAyB,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAA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