From c3d1246263bb0b0860cd31287cb61e3350b23d43 Mon Sep 17 00:00:00 2001 From: Priti Sambandam Date: Mon, 31 Mar 2025 19:49:24 -0700 Subject: [PATCH 1/2] feat(designer): Removing some hard coded built in operations in consumption and moving to backend api --- Localize/lang/strings.json | 6 +- .../Utilities/resourceUtilities.ts | 1 + .../lib/base/connection.ts | 9 +- .../lib/base/operationmanifest.ts | 7 +- .../lib/base/operations/dataoperations.ts | 69 ---------- .../lib/consumption/manifests/chunktext.ts | 120 ----------------- .../consumption/manifests/parsedocument.ts | 61 --------- .../manifests/parsedocumentwithmetadata.ts | 121 ------------------ .../lib/consumption/operationmanifest.ts | 49 +++++-- .../lib/consumption/search.ts | 19 ++- 10 files changed, 69 insertions(+), 393 deletions(-) delete mode 100644 libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/chunktext.ts delete mode 100644 libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocument.ts delete mode 100644 libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocumentwithmetadata.ts diff --git a/Localize/lang/strings.json b/Localize/lang/strings.json index 0c38996e66b..8ec9cfcb2b1 100644 --- a/Localize/lang/strings.json +++ b/Localize/lang/strings.json @@ -309,6 +309,7 @@ "7ZR1xr": "Add an action", "7aJqIH": "Optional. The locale to be used when formatting (defaults to 'en-us').", "7adnmH": "Back to template library", + "7col/w": "Fetching chat history...", "7fZkLA": "Disable static result", "7gUE8h": "This will revert your workflow to the state it was in before Copilot's edit. If you made additional edits to the workflow after Copilot's, you will lose them. This action cannot be undone. Do you want to continue?", "7jcTNd": "Enter a valid email.", @@ -845,6 +846,7 @@ "PRnqYA": "Required. The number of seconds to add. Can be negative to subtract seconds.", "PSrCNL": "Function", "PTBl5s": "Method", + "PVT2SW": "Agent chat", "PXa0D4": "False", "PYku3O": "Shared", "Pa+UkC": "Returns the UTF-8 byte length of an input string", @@ -1494,6 +1496,7 @@ "_7ZR1xr.comment": "Text on example action node", "_7aJqIH.comment": "Optional locale parameter to apply formatNumber function with", "_7adnmH.comment": "Button to navigate back to the template library", + "_7col/w.comment": "Fetching chat history progress card text", "_7fZkLA.comment": "Label for toggle to disable static result", "_7gUE8h.comment": "Warning description of what undoing operation will do to the workflow", "_7jcTNd.comment": "Error validation message for emails", @@ -2030,6 +2033,7 @@ "_PRnqYA.comment": "Required integer parameter to subtract seconds from time", "_PSrCNL.comment": "Function", "_PTBl5s.comment": "Method", + "_PVT2SW.comment": "Agent chat header text", "_PXa0D4.comment": "False", "_PYku3O.comment": "The label for shared connector kind", "_Pa+UkC.comment": "Label for description of custom utf8Length Function", @@ -2960,7 +2964,6 @@ "_sYQDN+.comment": "Label for Font family dropdown", "_sZ0G/Z.comment": "Required string parameter to represent the unit of time", "_sZHTQV.comment": "Time zone value ", - "_sav1Y4.comment": "Fetching chat history progress card text", "_sbPZ9S.comment": "Required collection parameter to check empty function on", "_sfJTHV.comment": "Required number parameter to be minused in sub function", "_sfTqHY.comment": "Aria label for the close button in the node search panel", @@ -3816,7 +3819,6 @@ "sYQDN+": "Formatting options for font family", "sZ0G/Z": "Required. A string containing the unit of time specified in the interval to add.", "sZHTQV": "(UTC+09:00) Chita", - "sav1Y4": "Fetching chat history...", "sbPZ9S": "Required. The collection to check if it is empty.", "sfJTHV": "Required. The number to remove from the Minuend.", "sfTqHY": "Close panel", diff --git a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts index 4a8d28c5cd9..b86a2eadab8 100644 --- a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts +++ b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts @@ -24,6 +24,7 @@ export const fetchAppsByQuery = async (query: string): Promise => { $skipToken: currentSkipToken, resultFormat: 'table', }, + subscriptions: ['f34b22a3-2202-4fb1-b040-1332bd928c84'], }, { headers: { diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/base/connection.ts b/libs/logic-apps-shared/src/designer-client-services/lib/base/connection.ts index 534a049e833..a0334694410 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/base/connection.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/base/connection.ts @@ -11,6 +11,7 @@ import { UserErrorCode, isCustomConnectorId, getUniqueName, + getResourceNameFromId, } from '../../../utils/src'; import type { HttpResponse } from '../common/exceptions/service'; import type { ConnectionCreationInfo, ConnectionParametersMetadata, CreateConnectionResult, IConnectionService } from '../connection'; @@ -141,7 +142,13 @@ export abstract class BaseConnectionService implements IConnectionService { protected async _getAzureConnector(connectorId: string): Promise { const { apiVersion, httpClient, locale } = this.options; const headers = locale ? { 'Accept-Language': locale } : undefined; - const response = await httpClient.get({ uri: connectorId, queryParameters: { 'api-version': apiVersion }, headers }); + const queryParameters: Record = { 'api-version': apiVersion }; + + if (!isArmResourceId(connectorId)) { + connectorId = `/subscriptions/${this.options.subscriptionId}/providers/microsoft.web/locations/${this.options.location}/managedapis/${getResourceNameFromId(connectorId)}`; + // queryParameters['isBuiltIn'] = 'true'; @Bryan: I have kept it commented here so in case you cannot have this deployed before build in backend you can uncomment this. + } + const response = await httpClient.get({ uri: connectorId, queryParameters, headers }); return { ...response, diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/base/operationmanifest.ts b/libs/logic-apps-shared/src/designer-client-services/lib/base/operationmanifest.ts index 2f8808b853c..09b3430f17b 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/base/operationmanifest.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/base/operationmanifest.ts @@ -145,6 +145,7 @@ const x12ConnectorId = 'connectionProviders/x12Operations'; const xmlOperationsConnectionId = 'connectionProviders/xmlOperations'; const edifactConnectorId = 'connectionProviders/edifactOperations'; export const inlineCodeConnectorId = 'connectionProviders/inlineCode'; +const aiOperationsConnectorId = 'connectionProviders/aiOperations'; const azurefunction = 'azurefunction'; const appservice = 'appservice'; @@ -730,15 +731,15 @@ const builtInOperationsMetadata: Record = { operationId: edifactbatchencode, }, [chunktext]: { - connectorId: dataOperationConnectorId, + connectorId: aiOperationsConnectorId, operationId: chunktext, }, [parsedocument]: { - connectorId: dataOperationConnectorId, + connectorId: aiOperationsConnectorId, operationId: parsedocument, }, [parsedocumentwithmetadata]: { - connectorId: dataOperationConnectorId, + connectorId: aiOperationsConnectorId, operationId: parsedocumentwithmetadata, }, }; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/base/operations/dataoperations.ts b/libs/logic-apps-shared/src/designer-client-services/lib/base/operations/dataoperations.ts index c781fb47725..63b753e10ed 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/base/operations/dataoperations.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/base/operations/dataoperations.ts @@ -42,75 +42,6 @@ export const parseJsonOperation = { }, }; -export const chunktext = { - name: 'chunktext', - id: 'chunktext', - type: 'ChunkText', - properties: { - api: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - brandColor: '#8c6cff', - description: 'Data operations', - displayName: 'Data operations', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - }, - summary: 'Chunk text', - description: 'Chunk text to a fixed length.', - visibility: 'Important', - operationType: 'ChunkText', - brandColor: '#8c6cff', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - annotation: { status: 'Preview' }, - }, -}; - -export const parsedocument = { - name: 'parsedocument', - id: 'parsedocument', - type: 'ParseDocument', - properties: { - api: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - brandColor: '#8c6cff', - description: 'Data operations', - displayName: 'Data operations', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - }, - summary: 'Parse a document', - description: 'Parse a document to extract text from the document.', - visibility: 'Important', - operationType: 'ParseDocument', - brandColor: '#8c6cff', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - annotation: { status: 'Preview' }, - }, -}; - -export const parsedocumentwithmetadata = { - name: 'parsedocumentwithmetadata', - id: 'parsedocumentwithmetadata', - type: 'ParseDocumentWithMetadata', - properties: { - api: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - brandColor: '#8c6cff', - description: 'Data operations', - displayName: 'Data operations', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - }, - summary: 'Parse a document returning text array and metadata', - description: 'Parses a document to extract text and metadata from the document.', - visibility: 'Important', - operationType: 'ParseDocumentWithMetadata', - brandColor: '#8c6cff', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/compose.svg', - annotation: { status: 'Preview' }, - }, -}; - export const queryOperation = { name: 'query', id: 'query', diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/chunktext.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/chunktext.ts deleted file mode 100644 index 30681491220..00000000000 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/chunktext.ts +++ /dev/null @@ -1,120 +0,0 @@ -import type { OperationManifest } from '../../../../utils/src'; -import { SettingScope } from '../../../../utils/src'; - -export const chunkTextManifest = { - properties: { - iconUri: - 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxwYXRoIGZpbGw9IiM4QzZDRkYiIGQ9Im0wIDBoMzJ2MzJoLTMyeiIvPgogPGcgZmlsbD0iI2ZmZiI+CiAgPHBhdGggdHJhbnNmb3JtPSJtYXRyaXgoLjggMCAwIC44IDMuMTk4IDIuNjczKSIgZD0iTTYgMTYuMDdhMi4yNCAyLjI0IDAgMCAwIC45LS4xOSAyLjM2IDIuMzYgMCAwIDAgMS4yNC0xLjI0IDIuMjIgMi4yMiAwIDAgMCAuMTktLjl2LTEuMjlhOC4yMiA4LjIyIDAgMCAxIDAtMS4yNiA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S4yNyAxLjI3IDAgMCAxIC42Ny42NyAxLjIyIDEuMjIgMCAwIDEgLjA2LjV6bS03LjA3IDUuOGwxLjI0LS4zMWExLjIyIDEuMjIgMCAwIDAtLjkzLS45M3ptLjU3LTEuNjhhMS43MiAxLjcyIDAgMCAxIDEuMTEgMS4xMWw0LjA4LTQuMDgtMS4xMS0xLjExem01LjUzLTMuMzJsLjE4LS4xOGExLjM3IDEuMzcgMCAwIDAgLjE2LS4xOC43OC43OCAwIDAgMCAuMTEtLjIuNzIuNzIgMCAwIDAgMC0uMjUuNzYuNzYgMCAwIDAtLjA2LS4zLjc4Ljc4IDAgMCAwLS4xNy0uMjUuODMuODMgMCAwIDAtLjI1LS4xNy43Ni43NiAwIDAgMC0uMy0uMDYuNzIuNzIgMCAwIDAtLjI1IDAgLjgyLjgyIDAgMCAwLS4yLjExbC0uMTguMTYtLjE5LjI1eiIgc3Ryb2tlPSIjZmZmIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iLjI1Ii8+CiA8L2c+Cjwvc3ZnPgo=', - brandColor: '#8C6CFF', - description: 'Chunk text to a fixed length.', - summary: 'Chunk text', - - inputs: { - type: 'object', - properties: { - chunkingStrategy: { - title: 'Chunking strategy', - type: 'string', - description: 'Chunking strategy to be used.', - default: 'TokenSize', - enum: ['TokenSize'], - }, - text: { - title: 'Text', - description: 'Text to be chunked.', - type: 'string', - }, - encodingModel: { - title: 'Encoding model', - type: 'string', - description: 'The encoding model to use for chunking.', - default: 'cl100k_base', - 'x-ms-editor': 'dropdown', - 'x-ms-editor-options': { - multiSelect: false, - titleSeperator: ',', - options: [ - { - value: 'r50k_base', - displayName: 'r50k_base (gpt-3)', - }, - { - value: 'p50k_base', - displayName: 'p50k_base (gpt-3)', - }, - { - value: 'p50k_edit', - displayName: 'p50k_edit (gpt-3)', - }, - { - value: 'cl100k_base', - displayName: 'cl100k_base (gpt-4, gpt-3.5-turbo, gpt-35-turbo)', - }, - { - value: 'cl200k_base', - displayName: 'cl200k_base (gpt-4o)', - }, - ], - }, - }, - tokenSize: { - title: 'Token size', - type: 'integer', - description: 'The maximum number of tokens per chunk. 100 tokens equals about 75 words.', - minimum: 1, - default: 5000, - maximum: 8000, - }, - pageOverlapLength: { - title: 'Page overlap length', - type: 'integer', - description: 'The number of characters to overlap between pages.', - minumum: 0, - default: 0, - }, - }, - required: ['chunkingStrategy', 'text', 'encodingModel', 'tokenSize', 'pageOverlapLength'], - }, - - isInputsOptional: false, - isOutputOptional: false, - includeRootOutputs: false, - - outputs: { - type: 'object', - properties: { - body: { - type: 'object', - title: 'Chunked result', - description: 'An object containing chunked text.', - properties: { - value: { - type: 'array', - items: { - type: 'string', - }, - title: 'Text items', - description: 'Array of chunked text.', - }, - }, - }, - }, - }, - - connector: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - properties: { - description: 'Operations to work with data in workflow.', - displayName: 'Data Operations', - }, - } as any, - - settings: { - secureData: {}, - trackedProperties: { - scopes: [SettingScope.Action], - }, - }, - }, -} as OperationManifest; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocument.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocument.ts deleted file mode 100644 index 227765643a8..00000000000 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocument.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { OperationManifest } from '../../../../utils/src'; -import { SettingScope } from '../../../../utils/src'; - -export const parseDocumentManifest = { - properties: { - iconUri: - 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxwYXRoIGZpbGw9IiM4QzZDRkYiIGQ9Im0wIDBoMzJ2MzJoLTMyeiIvPgogPGcgZmlsbD0iI2ZmZiI+CiAgPHBhdGggdHJhbnNmb3JtPSJtYXR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I5IDEuMjkgMCAwIDEtLjA5LjQ4IDEuMjEgMS4yMSAwIDAgMS0uMjguNDJsLTUgNS0yLjM5LjYuNjQtMi40IDUtNWExLjI1IDEuMjUgMCAwIDEgLjQyLS4yOCAxLjI5IDEuMjkgMCAwIDEgLjQ4LS4wOSAxLjIyIDEuMjIgMCAwIDEgLjQ5LjEgMS4yNyAxLjI3IDAgMCAxIC42Ny42NyAxLjIyIDEuMjIgMCAwIDEgLjA2LjV6bS03LjA3IDUuOGwxLjI0LS4zMWExLjIyIDEuMjIgMCAwIDAtLjkzLS45M3ptLjU3LTEuNjhhMS43MiAxLjcyIDAgMCAxIDEuMTEgMS4xMWw0LjA4LTQuMDgtMS4xMS0xLjExem01LjUzLTMuMzJsLjE4LS4xOGExLjM3IDEuMzcgMCAwIDAgLjE2LS4xOC43OC43OCAwIDAgMCAuMTEtLjIuNzIuNzIgMCAwIDAgMC0uMjUuNzYuNzYgMCAwIDAtLjA2LS4zLjc4Ljc4IDAgMCAwLS4xNy0uMjUuODMuODMgMCAwIDAtLjI1LS4xNy43Ni43NiAwIDAgMC0uMy0uMDYuNzIuNzIgMCAwIDAtLjI1IDAgLjgyLjgyIDAgMCAwLS4yLjExbC0uMTguMTYtLjE5LjI1eiIgc3Ryb2tlPSIjZmZmIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iLjI1Ii8+CiA8L2c+Cjwvc3ZnPgo=', - brandColor: '#8C6CFF', - description: 'Parse a document to extract text from the document.', - summary: 'Parse a document', - - inputs: { - type: 'object', - properties: { - content: { - title: 'Document content', - description: 'Content of the document to be parsed.', - }, - }, - required: ['content'], - }, - - isInputsOptional: false, - isOutputOptional: false, - includeRootOutputs: false, - - outputs: { - type: 'object', - properties: { - body: { - type: 'object', - title: 'Parsed result', - description: 'An object containing parsed text.', - properties: { - text: { - type: 'string', - title: 'text', - description: 'Parsed document content in text form.', - }, - }, - }, - }, - }, - - connector: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - properties: { - description: 'Operations to work with data in workflow.', - displayName: 'Data Operations', - }, - } as any, - - settings: { - secureData: {}, - trackedProperties: { - scopes: [SettingScope.Action], - }, - }, - }, -} as OperationManifest; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocumentwithmetadata.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocumentwithmetadata.ts deleted file mode 100644 index c6e7df2a1b3..00000000000 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/manifests/parsedocumentwithmetadata.ts +++ /dev/null @@ -1,121 +0,0 @@ -import type { OperationManifest } from '../../../../utils/src'; -import { SettingScope } from '../../../../utils/src'; - -export const parseDocumentWithMetadataManifest = { - properties: { - iconUri: - 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMiAzMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxwYXRoIGZpbGw9IiM4QzZDRkYiIGQ9Im0wIDBoMzJ2MzJoLTMyeiIvPgogPGcgZmlsbD0iI2ZmZiI+CiAgPHBhdGggdHJhbnNmb3JtPSJtYXRyaXgoLjggMCAwIC44IDMuMTk4IDIuNjczKSIgZD0iTTYgMTYuMDdhMi4yNCAyLjI0IDAgMCAwIC45LS4xOSAyLjM2IDIuMzYgMCAwIDAgMS4yNC0xLjI0IDIuMjIgMi4yMiAwIDAgMCAuMTktLjl2LTEuMjlhOC4yMiA4LjIyIDAgMCAxIDAtMS4yNiA0LjY4IDQuNjggMCAwIDEgLjMtMS4xOSAzLjA5IDMuMDkgMCAwIDEgLjcxLTEgMy40MiAzLjQyIDAgMCAxIDEuMTQtLjc1IDMuNTEgMy41MSAwIDAgMSAxLjM0LS4yNnYxLjExYTIuMjEgMi4yMSAwIDAgMC0uOS4xOSAyLjM2IDIuMzYgMCAwIDAtMS4yNCAxLjI0IDIuMjMgMi4yMyAwIDAgMC0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EuMzcgMCAwIDAgLjE2LS4xOC43OC43OCAwIDAgMCAuMTEtLjIuNzIuNzIgMCAwIDAgMC0uMjUuNzYuNzYgMCAwIDAtLjA2LS4zLjc4Ljc4IDAgMCAwLS4xNy0uMjUuODMuODMgMCAwIDAtLjI1LS4xNy43Ni43NiAwIDAgMC0uMy0uMDYuNzIuNzIgMCAwIDAtLjI1IDAgLjgyLjgyIDAgMCAwLS4yLjExbC0uMTguMTYtLjE5LjI1eiIgc3Ryb2tlPSIjZmZmIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS13aWR0aD0iLjI1Ii8+CiA8L2c+Cjwvc3ZnPgo=', - brandColor: '#8C6CFF', - summary: 'Parse a document returning text array and metadata', - description: 'Parses a document to extract text and metadata from the document.', - - inputs: { - type: 'object', - properties: { - content: { - title: 'Document content', - description: 'Content of the document to be parsed.', - }, - fileType: { - title: 'Document type', - description: 'The documents file type.', - default: 'PDF', - enum: ['PDF', 'DOC', 'DOCX', 'XLS', 'XLSX', 'PPT', 'PPTX', 'TXT', 'MD', 'HTML'], - }, - }, - required: ['content', 'fileType'], - }, - - isInputsOptional: false, - isOutputOptional: false, - includeRootOutputs: false, - - outputs: { - type: 'object', - properties: { - body: { - type: 'object', - title: 'Parsed result', - description: 'An object containing an array of parsed text and metadata', - properties: { - value: { - type: 'array', - title: 'Text items', - description: 'The array of chunked text and metadata.', - items: { - type: 'object', - }, - properties: { - text: { - type: 'string', - title: 'Text', - description: 'The parsed documents content in text form.', - }, - metadata: { - type: 'object', - title: 'metadata', - description: 'The parsed documents metadata.', - properties: { - pageNumber: { - type: 'integer', - title: 'Page number', - description: 'The page number of the document which contains this text.', - }, - totalPages: { - type: 'integer', - title: 'Total pages', - description: 'The total number of pages in the document.', - }, - sentencesAreComplete: { - type: 'boolean', - title: 'Sentences are complete', - description: 'Indicator to whether the corresponding text is spit between pages.', - }, - excelMetadata: { - type: 'object', - title: 'Excel document metadata', - description: 'Metadata specific to Excel documents.', - properties: { - sheetName: { - type: 'string', - title: 'Sentences are complete', - description: 'The name of the sheet in the Excel document.', - }, - sheetNumber: { - type: 'integer', - title: 'Sheet number', - description: 'The sheet number.', - }, - totalSheets: { - type: 'integer', - title: 'Total sheets', - description: 'The total number of parsed sheets.', - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - - connector: { - id: 'connectionProviders/dataOperationNew', - name: 'dataOperationNew', - properties: { - description: 'Operations to work with data in workflow.', - displayName: 'Data Operations', - }, - } as any, - - settings: { - secureData: {}, - trackedProperties: { - scopes: [SettingScope.Action], - }, - }, - }, -} as OperationManifest; diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts index ce7d1f46393..f4b15bc02bf 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/operationmanifest.ts @@ -1,5 +1,5 @@ import type { Connector, OperationInfo, OperationManifest } from '../../../utils/src'; -import { ArgumentException, startsWith, UnsupportedException } from '../../../utils/src'; +import { ArgumentException, getResourceNameFromId, isArmResourceId, startsWith, UnsupportedException } from '../../../utils/src'; import { BaseOperationManifestService } from '../base'; import type { BaseOperationManifestServiceOptions } from '../base/operationmanifest'; import { @@ -13,9 +13,6 @@ import { appServiceActionManifest, appServiceTriggerManifest } from './manifests import { as2EncodeManifest, as2DecodeManifest } from './manifests/as2'; import { batchTriggerManifest, sendToBatchManifest } from './manifests/batchWorkflow'; import { composeManifest } from './manifests/compose'; -import { chunkTextManifest } from './manifests/chunktext'; -import { parseDocumentManifest } from './manifests/parsedocument'; -import { parseDocumentWithMetadataManifest } from './manifests/parsedocumentwithmetadata'; import { flatFileDecodingManifest, flatFileEncodingManifest } from './manifests/flatfile'; import { selectFunctionManifest } from './manifests/functions'; import { inlineCodeManifest } from './manifests/inlinecode'; @@ -101,11 +98,16 @@ export class ConsumptionOperationManifestService extends BaseOperationManifestSe const { apiVersion, baseUrl, httpClient } = this.options; const operationName = operationId.split('/').slice(-1)[0]; - const queryParameters = { + const queryParameters: Record = { 'api-version': apiVersion, $expand: 'properties/manifest', }; + if (!isArmResourceId(connectorId)) { + connectorId = `/subscriptions/${this.options.subscriptionId}/providers/microsoft.web/locations/${this.options.location}/managedapis/${getResourceNameFromId(connectorId)}`; + queryParameters['isBuiltIn'] = 'true'; + } + try { const response = await httpClient.get({ uri: `${baseUrl}${connectorId}/apiOperations/${operationName}`, @@ -132,7 +134,7 @@ export class ConsumptionOperationManifestService extends BaseOperationManifestSe } } - override async getOperation(_connectorId: string, operationId: string, _useCachedData = false): Promise { + override async getOperation(connectorId: string, operationId: string, _useCachedData = false): Promise { const supportedManifest = supportedConsumptionManifestObjects.get(operationId); if (supportedManifest) { @@ -145,6 +147,35 @@ export class ConsumptionOperationManifestService extends BaseOperationManifestSe }, }; } + + const { apiVersion, baseUrl, httpClient } = this.options; + const operationName = getResourceNameFromId(operationId); + const queryParameters: Record = { + 'api-version': apiVersion, + }; + + if (!isArmResourceId(connectorId)) { + connectorId = `/subscriptions/${this.options.subscriptionId}/providers/microsoft.web/locations/${this.options.location}/managedapis/${getResourceNameFromId(connectorId)}`; + queryParameters['isBuiltIn'] = 'true'; + } + + const response = await httpClient.get({ + uri: `${baseUrl}${connectorId}/apiOperations/${operationName}`, + queryParameters, + }); + + const { + properties: { brandColor, description, iconUri, api }, + } = response; + + return { + properties: { + connector: { properties: { displayName: api.properties.displayName } }, + brandColor: brandColor ?? api?.brandColor, + description, + iconUri: iconUri ?? api?.iconUri, + }, + }; } override isBuiltInConnector(connectorId: string): boolean { @@ -175,9 +206,6 @@ const as2decode = 'as2decode'; const rosettanetencode = 'rosettanetencode'; const rosettanetdecode = 'rosettanetdecode'; const rosettanetwaitforresponse = 'rosettanetwaitforresponse'; -const chunktext = 'chunktext'; -const parsedocument = 'parsedocument'; -const parsedocumentwithmetadata = 'parsedocumentwithmetadata'; // Azure Resource Connectors const apimanagement = 'apimanagement'; @@ -223,7 +251,4 @@ const supportedConsumptionManifestObjects = new Map([ [rosettanetencode, rosettaNetEncodeManifest], [rosettanetdecode, rosettaNetDecodeManifest], [rosettanetwaitforresponse, rosettaNetWaitForResponseManifest], - [chunktext, chunkTextManifest], - [parsedocument, parseDocumentManifest], - [parsedocumentwithmetadata, parseDocumentWithMetadataManifest], ]); diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts index 48b52f7f577..e8465e52cea 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts @@ -74,9 +74,6 @@ export class ConsumptionSearchService extends BaseSearchService { const consumptionBuiltIn: any[] = [ ClientOperationsData.slidingWindowOperation, ClientOperationsData.composeOperation, - ClientOperationsData.chunktext, - ClientOperationsData.parsedocument, - ClientOperationsData.parsedocumentwithmetadata, OperationsData.inlineCodeOperation, OperationsData.flatFileDecodingOperations, OperationsData.flatFileEncodingOperations, @@ -137,7 +134,21 @@ export class ConsumptionSearchService extends BaseSearchService { } public getBuiltInConnectors(): Promise { - return Promise.resolve(getBuiltInConnectorsInConsumption()); + return Promise.resolve([ + ...getBuiltInConnectorsInConsumption(), + ...[ + { + name: 'aiOperations', + id: 'connectionProviders/aiOperations', + properties: { + brandColor: '0x8C6CFF', + description: 'AI Operations', + displayName: 'AI Operations', + iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/aiOperations.svg', + }, + } as any, + ], + ]); } public async getCustomConnectorsByNextlink(prevNextlink?: string): Promise { From ad4bdc6a3662a243a111f909c473c0ea9e2e9c42 Mon Sep 17 00:00:00 2001 From: Priti Sambandam Date: Mon, 31 Mar 2025 20:01:20 -0700 Subject: [PATCH 2/2] Removing mock test changes --- .../Utilities/resourceUtilities.ts | 1 - .../lib/consumption/search.ts | 16 +--------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts index b86a2eadab8..4a8d28c5cd9 100644 --- a/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts +++ b/apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Utilities/resourceUtilities.ts @@ -24,7 +24,6 @@ export const fetchAppsByQuery = async (query: string): Promise => { $skipToken: currentSkipToken, resultFormat: 'table', }, - subscriptions: ['f34b22a3-2202-4fb1-b040-1332bd928c84'], }, { headers: { diff --git a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts index e8465e52cea..d02bf869b9d 100644 --- a/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts +++ b/libs/logic-apps-shared/src/designer-client-services/lib/consumption/search.ts @@ -134,21 +134,7 @@ export class ConsumptionSearchService extends BaseSearchService { } public getBuiltInConnectors(): Promise { - return Promise.resolve([ - ...getBuiltInConnectorsInConsumption(), - ...[ - { - name: 'aiOperations', - id: 'connectionProviders/aiOperations', - properties: { - brandColor: '0x8C6CFF', - description: 'AI Operations', - displayName: 'AI Operations', - iconUri: 'https://logicappsv2resources.blob.core.windows.net/icons/aiOperations.svg', - }, - } as any, - ], - ]); + return Promise.resolve(getBuiltInConnectorsInConsumption()); } public async getCustomConnectorsByNextlink(prevNextlink?: string): Promise {