@microsoft/power-apps 1.0.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/LICENSE +153 -0
- package/README.md +43 -0
- package/lib/__tests__/connectorDataOperation.spec.d.ts +5 -0
- package/lib/__tests__/connectorDataOperation.spec.d.ts.map +1 -0
- package/lib/__tests__/connectorDataOperation.spec.js +509 -0
- package/lib/__tests__/connectorDataOperation.spec.js.map +1 -0
- package/lib/__tests__/dataverseDataOperation.spec.d.ts +5 -0
- package/lib/__tests__/dataverseDataOperation.spec.d.ts.map +1 -0
- package/lib/__tests__/dataverseDataOperation.spec.js +349 -0
- package/lib/__tests__/dataverseDataOperation.spec.js.map +1 -0
- package/lib/__tests__/helpers/testHelpers.d.ts +27 -0
- package/lib/__tests__/helpers/testHelpers.d.ts.map +1 -0
- package/lib/__tests__/helpers/testHelpers.js +67 -0
- package/lib/__tests__/helpers/testHelpers.js.map +1 -0
- package/lib/__tests__/index.spec.d.ts +5 -0
- package/lib/__tests__/index.spec.d.ts.map +1 -0
- package/lib/__tests__/index.spec.js +10 -0
- package/lib/__tests__/index.spec.js.map +1 -0
- package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.d.ts +17 -0
- package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.d.ts.map +1 -0
- package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.js +35 -0
- package/lib/__tests__/mocks/mockDataverseRetrieveMultipleResponse.js.map +1 -0
- package/lib/__tests__/mocks/mockLog.d.ts +31 -0
- package/lib/__tests__/mocks/mockLog.d.ts.map +1 -0
- package/lib/__tests__/mocks/mockLog.js +53 -0
- package/lib/__tests__/mocks/mockLog.js.map +1 -0
- package/lib/__tests__/mocks/mockTeamsConnectorResponse.d.ts +76 -0
- package/lib/__tests__/mocks/mockTeamsConnectorResponse.d.ts.map +1 -0
- package/lib/__tests__/mocks/mockTeamsConnectorResponse.js +81 -0
- package/lib/__tests__/mocks/mockTeamsConnectorResponse.js.map +1 -0
- package/lib/__tests__/mocks/silenceConsole.d.ts +37 -0
- package/lib/__tests__/mocks/silenceConsole.d.ts.map +1 -0
- package/lib/__tests__/mocks/silenceConsole.js +58 -0
- package/lib/__tests__/mocks/silenceConsole.js.map +1 -0
- package/lib/__tests__/powerDataRuntimeInstance.test.d.ts +5 -0
- package/lib/__tests__/powerDataRuntimeInstance.test.d.ts.map +1 -0
- package/lib/__tests__/powerDataRuntimeInstance.test.js +179 -0
- package/lib/__tests__/powerDataRuntimeInstance.test.js.map +1 -0
- package/lib/__tests__/powerDataSourcesInfoProvider.test.d.ts +5 -0
- package/lib/__tests__/powerDataSourcesInfoProvider.test.d.ts.map +1 -0
- package/lib/__tests__/powerDataSourcesInfoProvider.test.js +153 -0
- package/lib/__tests__/powerDataSourcesInfoProvider.test.js.map +1 -0
- package/lib/__tests__/runtimeClientProvider.test.d.ts +5 -0
- package/lib/__tests__/runtimeClientProvider.test.d.ts.map +1 -0
- package/lib/__tests__/runtimeClientProvider.test.js +248 -0
- package/lib/__tests__/runtimeClientProvider.test.js.map +1 -0
- package/lib/__tests__/runtimeDataClient.spec.d.ts +2 -0
- package/lib/__tests__/runtimeDataClient.spec.d.ts.map +1 -0
- package/lib/__tests__/runtimeDataClient.spec.js +351 -0
- package/lib/__tests__/runtimeDataClient.spec.js.map +1 -0
- package/lib/__tests__/runtimeDataClient.test.d.ts +2 -0
- package/lib/__tests__/runtimeDataClient.test.d.ts.map +1 -0
- package/lib/__tests__/runtimeDataClient.test.js +351 -0
- package/lib/__tests__/runtimeDataClient.test.js.map +1 -0
- package/lib/__tests__/runtimeDataOperation.test.d.ts +5 -0
- package/lib/__tests__/runtimeDataOperation.test.d.ts.map +1 -0
- package/lib/__tests__/runtimeDataOperation.test.js +234 -0
- package/lib/__tests__/runtimeDataOperation.test.js.map +1 -0
- package/lib/__tests__/runtimeMetadataClient.test.d.ts +5 -0
- package/lib/__tests__/runtimeMetadataClient.test.d.ts.map +1 -0
- package/lib/__tests__/runtimeMetadataClient.test.js +271 -0
- package/lib/__tests__/runtimeMetadataClient.test.js.map +1 -0
- package/lib/__tests__/runtimeMetadataOperations.test.d.ts +5 -0
- package/lib/__tests__/runtimeMetadataOperations.test.d.ts.map +1 -0
- package/lib/__tests__/runtimeMetadataOperations.test.js +286 -0
- package/lib/__tests__/runtimeMetadataOperations.test.js.map +1 -0
- package/lib/__tests__/serviceSchemaModelSnapshot.test.d.ts +2 -0
- package/lib/__tests__/serviceSchemaModelSnapshot.test.d.ts.map +1 -0
- package/lib/__tests__/serviceSchemaModelSnapshot.test.js +98 -0
- package/lib/__tests__/serviceSchemaModelSnapshot.test.js.map +1 -0
- package/lib/__tests__/types.spec.d.ts +5 -0
- package/lib/__tests__/types.spec.d.ts.map +1 -0
- package/lib/__tests__/types.spec.js +104 -0
- package/lib/__tests__/types.spec.js.map +1 -0
- package/lib/__tests__/utils.test.d.ts +5 -0
- package/lib/__tests__/utils.test.d.ts.map +1 -0
- package/lib/__tests__/utils.test.js +33 -0
- package/lib/__tests__/utils.test.js.map +1 -0
- package/lib/app/Lifecycle.d.ts +9 -0
- package/lib/app/Lifecycle.d.ts.map +1 -0
- package/lib/app/Lifecycle.js +36 -0
- package/lib/app/Lifecycle.js.map +1 -0
- package/lib/app/index.d.ts +5 -0
- package/lib/app/index.d.ts.map +1 -0
- package/lib/app/index.js +5 -0
- package/lib/app/index.js.map +1 -0
- package/lib/data/Data.types.d.ts +20 -0
- package/lib/data/Data.types.d.ts.map +1 -0
- package/lib/data/Data.types.js +5 -0
- package/lib/data/Data.types.js.map +1 -0
- package/lib/data/index.d.ts +7 -0
- package/lib/data/index.d.ts.map +1 -0
- package/lib/data/index.js +5 -0
- package/lib/data/index.js.map +1 -0
- package/lib/data/powerAppsData.d.ts +8 -0
- package/lib/data/powerAppsData.d.ts.map +1 -0
- package/lib/data/powerAppsData.js +38 -0
- package/lib/data/powerAppsData.js.map +1 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/communication/CompatibleMessageReceiver.d.ts +12 -0
- package/lib/internal/communication/CompatibleMessageReceiver.d.ts.map +1 -0
- package/lib/internal/communication/CompatibleMessageReceiver.js +92 -0
- package/lib/internal/communication/CompatibleMessageReceiver.js.map +1 -0
- package/lib/internal/communication/IncompatibleMessageReceiver.d.ts +10 -0
- package/lib/internal/communication/IncompatibleMessageReceiver.d.ts.map +1 -0
- package/lib/internal/communication/IncompatibleMessageReceiver.js +13 -0
- package/lib/internal/communication/IncompatibleMessageReceiver.js.map +1 -0
- package/lib/internal/communication/MessageReceiver.Types.d.ts +18 -0
- package/lib/internal/communication/MessageReceiver.Types.d.ts.map +1 -0
- package/lib/internal/communication/MessageReceiver.Types.js +5 -0
- package/lib/internal/communication/MessageReceiver.Types.js.map +1 -0
- package/lib/internal/communication/SendMessage.d.ts +11 -0
- package/lib/internal/communication/SendMessage.d.ts.map +1 -0
- package/lib/internal/communication/SendMessage.js +32 -0
- package/lib/internal/communication/SendMessage.js.map +1 -0
- package/lib/internal/communication/SendMessageOperation.d.ts +15 -0
- package/lib/internal/communication/SendMessageOperation.d.ts.map +1 -0
- package/lib/internal/communication/SendMessageOperation.js +18 -0
- package/lib/internal/communication/SendMessageOperation.js.map +1 -0
- package/lib/internal/data/ConnectionUtils.d.ts +5 -0
- package/lib/internal/data/ConnectionUtils.d.ts.map +1 -0
- package/lib/internal/data/ConnectionUtils.js +20 -0
- package/lib/internal/data/ConnectionUtils.js.map +1 -0
- package/lib/internal/data/OperationExecutor.d.ts +18 -0
- package/lib/internal/data/OperationExecutor.d.ts.map +1 -0
- package/lib/internal/data/OperationExecutor.js +35 -0
- package/lib/internal/data/OperationExecutor.js.map +1 -0
- package/lib/internal/data/core/api/createRecord.d.ts +13 -0
- package/lib/internal/data/core/api/createRecord.d.ts.map +1 -0
- package/lib/internal/data/core/api/createRecord.js +15 -0
- package/lib/internal/data/core/api/createRecord.js.map +1 -0
- package/lib/internal/data/core/api/deleteRecord.d.ts +13 -0
- package/lib/internal/data/core/api/deleteRecord.d.ts.map +1 -0
- package/lib/internal/data/core/api/deleteRecord.js +15 -0
- package/lib/internal/data/core/api/deleteRecord.js.map +1 -0
- package/lib/internal/data/core/api/execute.d.ts +11 -0
- package/lib/internal/data/core/api/execute.d.ts.map +1 -0
- package/lib/internal/data/core/api/execute.js +13 -0
- package/lib/internal/data/core/api/execute.js.map +1 -0
- package/lib/internal/data/core/api/retrieveMultipleRecords.d.ts +13 -0
- package/lib/internal/data/core/api/retrieveMultipleRecords.d.ts.map +1 -0
- package/lib/internal/data/core/api/retrieveMultipleRecords.js +15 -0
- package/lib/internal/data/core/api/retrieveMultipleRecords.js.map +1 -0
- package/lib/internal/data/core/api/retrieveRecord.d.ts +13 -0
- package/lib/internal/data/core/api/retrieveRecord.d.ts.map +1 -0
- package/lib/internal/data/core/api/retrieveRecord.js +15 -0
- package/lib/internal/data/core/api/retrieveRecord.js.map +1 -0
- package/lib/internal/data/core/api/updateRecord.d.ts +14 -0
- package/lib/internal/data/core/api/updateRecord.d.ts.map +1 -0
- package/lib/internal/data/core/api/updateRecord.js +16 -0
- package/lib/internal/data/core/api/updateRecord.js.map +1 -0
- package/lib/internal/data/core/common/types.d.ts +230 -0
- package/lib/internal/data/core/common/types.d.ts.map +1 -0
- package/lib/internal/data/core/common/types.js +25 -0
- package/lib/internal/data/core/common/types.js.map +1 -0
- package/lib/internal/data/core/common/utils.d.ts +19 -0
- package/lib/internal/data/core/common/utils.d.ts.map +1 -0
- package/lib/internal/data/core/common/utils.js +47 -0
- package/lib/internal/data/core/common/utils.js.map +1 -0
- package/lib/internal/data/core/data/connectorDataOperation.d.ts +160 -0
- package/lib/internal/data/core/data/connectorDataOperation.d.ts.map +1 -0
- package/lib/internal/data/core/data/connectorDataOperation.js +500 -0
- package/lib/internal/data/core/data/connectorDataOperation.js.map +1 -0
- package/lib/internal/data/core/data/dataverseDataOperation.d.ts +164 -0
- package/lib/internal/data/core/data/dataverseDataOperation.d.ts.map +1 -0
- package/lib/internal/data/core/data/dataverseDataOperation.js +508 -0
- package/lib/internal/data/core/data/dataverseDataOperation.js.map +1 -0
- package/lib/internal/data/core/data/runtimeDataOperations.d.ts +93 -0
- package/lib/internal/data/core/data/runtimeDataOperations.d.ts.map +1 -0
- package/lib/internal/data/core/data/runtimeDataOperations.js +244 -0
- package/lib/internal/data/core/data/runtimeDataOperations.js.map +1 -0
- package/lib/internal/data/core/error/codes.d.ts +31 -0
- package/lib/internal/data/core/error/codes.d.ts.map +1 -0
- package/lib/internal/data/core/error/codes.js +39 -0
- package/lib/internal/data/core/error/codes.js.map +1 -0
- package/lib/internal/data/core/error/constants.d.ts +30 -0
- package/lib/internal/data/core/error/constants.d.ts.map +1 -0
- package/lib/internal/data/core/error/constants.js +33 -0
- package/lib/internal/data/core/error/constants.js.map +1 -0
- package/lib/internal/data/core/error/error.d.ts +8 -0
- package/lib/internal/data/core/error/error.d.ts.map +1 -0
- package/lib/internal/data/core/error/error.js +8 -0
- package/lib/internal/data/core/error/error.js.map +1 -0
- package/lib/internal/data/core/error/messages.d.ts +24 -0
- package/lib/internal/data/core/error/messages.d.ts.map +1 -0
- package/lib/internal/data/core/error/messages.js +55 -0
- package/lib/internal/data/core/error/messages.js.map +1 -0
- package/lib/internal/data/core/error/types.d.ts +30 -0
- package/lib/internal/data/core/error/types.d.ts.map +1 -0
- package/lib/internal/data/core/error/types.js +28 -0
- package/lib/internal/data/core/error/types.js.map +1 -0
- package/lib/internal/data/core/error/util.d.ts +24 -0
- package/lib/internal/data/core/error/util.d.ts.map +1 -0
- package/lib/internal/data/core/error/util.js +71 -0
- package/lib/internal/data/core/error/util.js.map +1 -0
- package/lib/internal/data/core/metadata/runtimeDataSourceService.d.ts +65 -0
- package/lib/internal/data/core/metadata/runtimeDataSourceService.d.ts.map +1 -0
- package/lib/internal/data/core/metadata/runtimeDataSourceService.js +101 -0
- package/lib/internal/data/core/metadata/runtimeDataSourceService.js.map +1 -0
- package/lib/internal/data/core/metadata/runtimeMetadataOperations.d.ts +17 -0
- package/lib/internal/data/core/metadata/runtimeMetadataOperations.d.ts.map +1 -0
- package/lib/internal/data/core/metadata/runtimeMetadataOperations.js +34 -0
- package/lib/internal/data/core/metadata/runtimeMetadataOperations.js.map +1 -0
- package/lib/internal/data/core/runtime/getRuntimeContext.d.ts +11 -0
- package/lib/internal/data/core/runtime/getRuntimeContext.d.ts.map +1 -0
- package/lib/internal/data/core/runtime/getRuntimeContext.js +16 -0
- package/lib/internal/data/core/runtime/getRuntimeContext.js.map +1 -0
- package/lib/internal/data/core/runtime/initializeRuntime.d.ts +13 -0
- package/lib/internal/data/core/runtime/initializeRuntime.d.ts.map +1 -0
- package/lib/internal/data/core/runtime/initializeRuntime.js +38 -0
- package/lib/internal/data/core/runtime/initializeRuntime.js.map +1 -0
- package/lib/internal/data/core/runtime/powerDataRuntime.d.ts +68 -0
- package/lib/internal/data/core/runtime/powerDataRuntime.d.ts.map +1 -0
- package/lib/internal/data/core/runtime/powerDataRuntime.js +116 -0
- package/lib/internal/data/core/runtime/powerDataRuntime.js.map +1 -0
- package/lib/internal/data/core/runtime/powerDataRuntimeInstance.d.ts +20 -0
- package/lib/internal/data/core/runtime/powerDataRuntimeInstance.d.ts.map +1 -0
- package/lib/internal/data/core/runtime/powerDataRuntimeInstance.js +36 -0
- package/lib/internal/data/core/runtime/powerDataRuntimeInstance.js.map +1 -0
- package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.d.ts +34 -0
- package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.d.ts.map +1 -0
- package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.js +45 -0
- package/lib/internal/data/core/runtime/powerDataSourcesInfoProvider.js.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeClientProvider.d.ts +43 -0
- package/lib/internal/data/core/runtimeClient/runtimeClientProvider.d.ts.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeClientProvider.js +87 -0
- package/lib/internal/data/core/runtimeClient/runtimeClientProvider.js.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeDataClient.d.ts +112 -0
- package/lib/internal/data/core/runtimeClient/runtimeDataClient.d.ts.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeDataClient.js +457 -0
- package/lib/internal/data/core/runtimeClient/runtimeDataClient.js.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.d.ts +40 -0
- package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.d.ts.map +1 -0
- package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.js +94 -0
- package/lib/internal/data/core/runtimeClient/runtimeMetadataClient.js.map +1 -0
- package/lib/internal/data/core/telemetry/log.d.ts +20 -0
- package/lib/internal/data/core/telemetry/log.d.ts.map +1 -0
- package/lib/internal/data/core/telemetry/log.js +85 -0
- package/lib/internal/data/core/telemetry/log.js.map +1 -0
- package/lib/internal/data/core/types/index.d.ts +138 -0
- package/lib/internal/data/core/types/index.d.ts.map +1 -0
- package/lib/internal/data/core/types/index.js +7 -0
- package/lib/internal/data/core/types/index.js.map +1 -0
- package/lib/internal/plugin/PluginCommon.d.ts +16 -0
- package/lib/internal/plugin/PluginCommon.d.ts.map +1 -0
- package/lib/internal/plugin/PluginCommon.js +114 -0
- package/lib/internal/plugin/PluginCommon.js.map +1 -0
- package/lib/internal/plugin/PluginMobile.d.ts +13 -0
- package/lib/internal/plugin/PluginMobile.d.ts.map +1 -0
- package/lib/internal/plugin/PluginMobile.js +109 -0
- package/lib/internal/plugin/PluginMobile.js.map +1 -0
- package/lib/telemetry/Logger.types.d.ts +8 -0
- package/lib/telemetry/Logger.types.d.ts.map +1 -0
- package/lib/telemetry/Logger.types.js +5 -0
- package/lib/telemetry/Logger.types.js.map +1 -0
- package/lib/telemetry/LoggerManager.d.ts +6 -0
- package/lib/telemetry/LoggerManager.d.ts.map +1 -0
- package/lib/telemetry/LoggerManager.js +28 -0
- package/lib/telemetry/LoggerManager.js.map +1 -0
- package/lib/telemetry/Metrics.types.d.ts +53 -0
- package/lib/telemetry/Metrics.types.d.ts.map +1 -0
- package/lib/telemetry/Metrics.types.js +5 -0
- package/lib/telemetry/Metrics.types.js.map +1 -0
- package/lib/telemetry/Performance.d.ts +5 -0
- package/lib/telemetry/Performance.d.ts.map +1 -0
- package/lib/telemetry/Performance.js +47 -0
- package/lib/telemetry/Performance.js.map +1 -0
- package/lib/telemetry/index.d.ts +5 -0
- package/lib/telemetry/index.d.ts.map +1 -0
- package/lib/telemetry/index.js +5 -0
- package/lib/telemetry/index.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { DataSourcesInfo, IOperationResult } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* Base interface for operation context
|
|
7
|
+
*/
|
|
8
|
+
export interface IOperationContext {
|
|
9
|
+
isExecuteAsync?: boolean;
|
|
10
|
+
clientConfig?: IClientConfig;
|
|
11
|
+
operationName?: string;
|
|
12
|
+
correlationId?: string;
|
|
13
|
+
timestamp?: Date;
|
|
14
|
+
responseInfo?: Record<string, IApiResponseInfo>;
|
|
15
|
+
batchId?: string;
|
|
16
|
+
datasetName?: string;
|
|
17
|
+
isDataVerseOperation?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface IApiResponseInfo {
|
|
20
|
+
type?: string | null;
|
|
21
|
+
format?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Base interface for client configuration
|
|
25
|
+
*/
|
|
26
|
+
export interface IClientConfig {
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
retryAttempts?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface for HTTP request configuration
|
|
33
|
+
*/
|
|
34
|
+
export interface IHttpRequestConfig {
|
|
35
|
+
url: string;
|
|
36
|
+
method: HttpMethod;
|
|
37
|
+
apiId: string;
|
|
38
|
+
tableName: string;
|
|
39
|
+
headers?: {
|
|
40
|
+
[key: string]: string;
|
|
41
|
+
};
|
|
42
|
+
body?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Interface for HTTP request headers
|
|
46
|
+
*/
|
|
47
|
+
export interface IHttpHeaders {
|
|
48
|
+
Accept: string;
|
|
49
|
+
'x-ms-protocol-semantics': string;
|
|
50
|
+
ServiceNamespace: string;
|
|
51
|
+
Authorization: string;
|
|
52
|
+
'x-ms-pa-client-custom-headers-options': string;
|
|
53
|
+
'x-ms-enable-selects': string;
|
|
54
|
+
'x-ms-pa-client-telemetry-options': string;
|
|
55
|
+
'x-ms-pa-client-telemetry-additional-data': string;
|
|
56
|
+
BatchInfo?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* HTTP methods supported by the client
|
|
60
|
+
*/
|
|
61
|
+
export declare enum HttpMethod {
|
|
62
|
+
GET = "GET",
|
|
63
|
+
POST = "POST",
|
|
64
|
+
PUT = "PUT",
|
|
65
|
+
DELETE = "DELETE",
|
|
66
|
+
PATCH = "PATCH"
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Interface for OData response format
|
|
70
|
+
* @template T The type of data in the response
|
|
71
|
+
*/
|
|
72
|
+
export interface ODataResponse<T> {
|
|
73
|
+
'@odata.context'?: string;
|
|
74
|
+
value: T;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Interface for metadata operation configuration
|
|
78
|
+
*/
|
|
79
|
+
export interface IMetadataOperationConfig {
|
|
80
|
+
service: string;
|
|
81
|
+
action: string;
|
|
82
|
+
params?: unknown[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Interface for operation execution result
|
|
86
|
+
*/
|
|
87
|
+
export type OperationExecutionResponse = [Record<string, object>, ArrayBuffer];
|
|
88
|
+
/**
|
|
89
|
+
* Type alias for possible response data formats
|
|
90
|
+
*/
|
|
91
|
+
export type ResponseData = Record<string, unknown> | ArrayBuffer;
|
|
92
|
+
/**
|
|
93
|
+
* Type alias for request body in data operations
|
|
94
|
+
*/
|
|
95
|
+
export type RequestBody = Record<string, unknown>;
|
|
96
|
+
/**
|
|
97
|
+
* Interface for API definition details
|
|
98
|
+
*/
|
|
99
|
+
export interface IApiDefinition {
|
|
100
|
+
path: string;
|
|
101
|
+
method: string;
|
|
102
|
+
parameters: Array<{
|
|
103
|
+
name: string;
|
|
104
|
+
in: string;
|
|
105
|
+
required: boolean;
|
|
106
|
+
type: string;
|
|
107
|
+
}>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Interface for connection API details
|
|
111
|
+
*/
|
|
112
|
+
export interface IConnectionApi {
|
|
113
|
+
path: string;
|
|
114
|
+
method?: string;
|
|
115
|
+
parameters?: string[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Interface for connection reference details
|
|
119
|
+
*/
|
|
120
|
+
export interface IConnectionReference {
|
|
121
|
+
apiId?: string;
|
|
122
|
+
connectionName?: string;
|
|
123
|
+
datasetName?: string;
|
|
124
|
+
datasetNameOverride?: string;
|
|
125
|
+
isShareableConnection?: string;
|
|
126
|
+
runtimePolicyName?: string;
|
|
127
|
+
runtimeUrl?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Interface for table schema information
|
|
131
|
+
*/
|
|
132
|
+
export interface ITableSchema {
|
|
133
|
+
name: string;
|
|
134
|
+
displayName?: string;
|
|
135
|
+
fields: Record<string, IFieldSchema>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Interface for field schema information
|
|
139
|
+
*/
|
|
140
|
+
export interface IFieldSchema {
|
|
141
|
+
name: string;
|
|
142
|
+
type: string;
|
|
143
|
+
required?: boolean;
|
|
144
|
+
maxLength?: number;
|
|
145
|
+
defaultValue?: unknown;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Interface for Dataverse-specific requests
|
|
149
|
+
*/
|
|
150
|
+
export interface IDataverseRequest {
|
|
151
|
+
/** HTTP method for the request */
|
|
152
|
+
method: string;
|
|
153
|
+
/** Request path */
|
|
154
|
+
path: string;
|
|
155
|
+
/** Optional request headers */
|
|
156
|
+
headers?: Record<string, string>;
|
|
157
|
+
/** Optional request body */
|
|
158
|
+
body?: unknown;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Supported data source types in the PowerDataRuntime
|
|
162
|
+
*/
|
|
163
|
+
export declare enum DataSources {
|
|
164
|
+
/** Dataverse data source */
|
|
165
|
+
Dataverse = "Dataverse",
|
|
166
|
+
/** Generic connector data source */
|
|
167
|
+
Connector = "Connector"
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Interface for metadata operations
|
|
171
|
+
*/
|
|
172
|
+
export interface IMetadataOperations {
|
|
173
|
+
/**
|
|
174
|
+
* Gets available connections
|
|
175
|
+
*/
|
|
176
|
+
getConnections(context?: IOperationContext): Promise<IOperationResult<IConnectionReference[]>>;
|
|
177
|
+
/**
|
|
178
|
+
* Gets APIs available for a connection
|
|
179
|
+
*/
|
|
180
|
+
getConnectionApis(connectionId: string, context?: IOperationContext): Promise<IOperationResult<IConnectionApi[]>>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Interface for runtime client provider
|
|
184
|
+
*/
|
|
185
|
+
export interface IRuntimeClientProvider {
|
|
186
|
+
getDataClientAsync(config?: IClientConfig): Promise<IRuntimeDataClient>;
|
|
187
|
+
getMetadataClientAsync(config?: IClientConfig): Promise<IRuntimeMetadataClient>;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Interface for runtime data client
|
|
191
|
+
*/
|
|
192
|
+
export interface IRuntimeDataClient {
|
|
193
|
+
createDataAsync<TRequest, TResponse>(url: string, connectionApi: string, serviceNamespace: string, body: TRequest, context?: IOperationContext): Promise<IOperationResult<TResponse>>;
|
|
194
|
+
updateDataAsync<TRequest, TResponse>(url: string, connectionApi: string, serviceNamespace: string, body: TRequest, context?: IOperationContext): Promise<IOperationResult<TResponse>>;
|
|
195
|
+
deleteDataAsync(url: string, connectionApi: string, serviceNamespace: string, context?: IOperationContext): Promise<IOperationResult<void>>;
|
|
196
|
+
retrieveDataAsync<TResponse>(url: string, connectionApi: string, serviceNamespace: string, method: HttpMethod, headers?: {
|
|
197
|
+
[key: string]: string;
|
|
198
|
+
}, body?: unknown, context?: IOperationContext): Promise<IOperationResult<TResponse>>;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Interface for runtime metadata client
|
|
202
|
+
*/
|
|
203
|
+
export interface IRuntimeMetadataClient {
|
|
204
|
+
getAppConnectionConfigsAsync(context?: IOperationContext): Promise<IOperationResult<IConnectionReference>>;
|
|
205
|
+
getAppDataSourceConfigsAsync(context?: IOperationContext): Promise<IOperationResult<IConnectionApi>>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Interface for PowerDataSourcesInfoProvider
|
|
209
|
+
*/
|
|
210
|
+
export interface IPowerDataSourcesInfoProvider {
|
|
211
|
+
getDataSourcesInfo(): Promise<DataSourcesInfo>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Interface defining the XRM context shape
|
|
215
|
+
*/
|
|
216
|
+
export interface IXrmContext {
|
|
217
|
+
context: {
|
|
218
|
+
getClientUrl(): string;
|
|
219
|
+
getVersion(): string;
|
|
220
|
+
};
|
|
221
|
+
WebApi: {
|
|
222
|
+
createRecord<TRequest, TResponse>(entityLogicalName: string, data: TRequest): Promise<TResponse>;
|
|
223
|
+
updateRecord<TRequest, TResponse>(entityLogicalName: string, id: string, data: Partial<TRequest>): Promise<TResponse>;
|
|
224
|
+
deleteRecord(entityLogicalName: string, id: string): Promise<void>;
|
|
225
|
+
retrieveRecord<TResponse>(entityLogicalName: string, id: string, options?: string): Promise<TResponse>;
|
|
226
|
+
retrieveMultipleRecords<TResponse>(entityLogicalName: string, options?: string, maxPageSize?: number): Promise<TResponse>;
|
|
227
|
+
execute<TRequest, TResponse>(request: TRequest): Promise<TResponse>;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/common/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAM7D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAKD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAMD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE;QAAE,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,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACnE,cAAc,CAAC,SAAS,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACvG,uBAAuB,CAAC,SAAS,EAC/B,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC;QACtB,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;KACrE,CAAC;CACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* HTTP methods supported by the client
|
|
6
|
+
*/
|
|
7
|
+
export var HttpMethod;
|
|
8
|
+
(function (HttpMethod) {
|
|
9
|
+
HttpMethod["GET"] = "GET";
|
|
10
|
+
HttpMethod["POST"] = "POST";
|
|
11
|
+
HttpMethod["PUT"] = "PUT";
|
|
12
|
+
HttpMethod["DELETE"] = "DELETE";
|
|
13
|
+
HttpMethod["PATCH"] = "PATCH";
|
|
14
|
+
})(HttpMethod || (HttpMethod = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Supported data source types in the PowerDataRuntime
|
|
17
|
+
*/
|
|
18
|
+
export var DataSources;
|
|
19
|
+
(function (DataSources) {
|
|
20
|
+
/** Dataverse data source */
|
|
21
|
+
DataSources["Dataverse"] = "Dataverse";
|
|
22
|
+
/** Generic connector data source */
|
|
23
|
+
DataSources["Connector"] = "Connector";
|
|
24
|
+
})(DataSources || (DataSources = {}));
|
|
25
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/common/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2EH;;GAEG;AACH,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,6BAAe,CAAA;AACjB,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAqHD;;GAEG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,4BAA4B;IAC5B,sCAAuB,CAAA;IACvB,oCAAoC;IACpC,sCAAuB,CAAA;AACzB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
export declare function arrayBufferToBase64(buffer: ArrayBuffer): string;
|
|
5
|
+
export declare function convertArrayBufferToString(buf: ArrayBuffer): string;
|
|
6
|
+
/**
|
|
7
|
+
* Strict encode: encodeURIComponent, but also encode ( and )
|
|
8
|
+
*/
|
|
9
|
+
export declare function strictEncode(str: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the Dataverse base URL and encoded path from a full Dataverse API URL.
|
|
12
|
+
* @param url - The full Dataverse API URL (should contain /api/data/v9.0/)
|
|
13
|
+
* @returns An object with baseUrl (up to /api/data/v9.0) and encodedPath (strict encoded path after /api/data/v9.0/)
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractDataverseUrlParts(url: string): {
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
encodedPath: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/common/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAE/D;AAOD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAWnE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAO9F"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
/*
|
|
5
|
+
* Converts an ArrayBuffer to a Base64 string
|
|
6
|
+
* @param buffer - The ArrayBuffer to convert
|
|
7
|
+
* @return The Base64 encoded string
|
|
8
|
+
*/
|
|
9
|
+
export function arrayBufferToBase64(buffer) {
|
|
10
|
+
return window.btoa(convertArrayBufferToString(buffer));
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Converts an ArrayBuffer to a string
|
|
14
|
+
* @param buf - The ArrayBuffer to convert
|
|
15
|
+
* @return The converted string
|
|
16
|
+
*/
|
|
17
|
+
export function convertArrayBufferToString(buf) {
|
|
18
|
+
// String.fromCharCode range max is 65535
|
|
19
|
+
if (buf.byteLength <= 65535) {
|
|
20
|
+
return String.fromCharCode(...new Uint8Array(buf));
|
|
21
|
+
}
|
|
22
|
+
let binary = '';
|
|
23
|
+
for (let i = 0, bytes = new Uint8Array(buf); i < bytes.byteLength; i++) {
|
|
24
|
+
binary += String.fromCharCode(bytes[i]);
|
|
25
|
+
}
|
|
26
|
+
return binary;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Strict encode: encodeURIComponent, but also encode ( and )
|
|
30
|
+
*/
|
|
31
|
+
export function strictEncode(str) {
|
|
32
|
+
return encodeURIComponent(str).replace(/\(/g, '%28').replace(/\)/g, '%29');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Extracts the Dataverse base URL and encoded path from a full Dataverse API URL.
|
|
36
|
+
* @param url - The full Dataverse API URL (should contain /api/data/v9.0/)
|
|
37
|
+
* @returns An object with baseUrl (up to /api/data/v9.0) and encodedPath (strict encoded path after /api/data/v9.0/)
|
|
38
|
+
*/
|
|
39
|
+
export function extractDataverseUrlParts(url) {
|
|
40
|
+
const baseUrlMatch = url.match(/^(https?:\/\/[^/]+\/api\/data\/v9\.0)/);
|
|
41
|
+
const baseUrl = baseUrlMatch ? baseUrlMatch[1] : '';
|
|
42
|
+
// Extract and encode the path after /api/data/v9.0/
|
|
43
|
+
const pathMatch = url.match(/\/api\/data\/v9\.0\/(.+)$/);
|
|
44
|
+
const encodedPath = pathMatch ? strictEncode(pathMatch[1]) : '';
|
|
45
|
+
return { baseUrl, encodedPath };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/internal/data/core/common/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,OAAO,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAgB;IACzD,yCAAyC;IACzC,IAAI,GAAG,CAAC,UAAU,IAAI,KAAK,EAAE;QAC3B,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;KACpD;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;QACtE,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACxE,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,oDAAoD;IACpD,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { IConnectionReference, IRuntimeClientProvider } from '../common/types';
|
|
5
|
+
import { RuntimeDataSourceService } from '../metadata/runtimeDataSourceService';
|
|
6
|
+
import { IDataOperation, IOperationResult } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Type for connection references mapping
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectionReferences = Record<string, IConnectionReference>;
|
|
11
|
+
/**
|
|
12
|
+
* Interface for connector operation configuration
|
|
13
|
+
*/
|
|
14
|
+
export interface IConnectorOperationConfig {
|
|
15
|
+
tableName: string;
|
|
16
|
+
apiId: string;
|
|
17
|
+
runtimeUrl: string;
|
|
18
|
+
connectionName: string;
|
|
19
|
+
datasetName?: string;
|
|
20
|
+
tableId: string;
|
|
21
|
+
version?: string;
|
|
22
|
+
datasetNameOverride?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ConnectorDataOperation provides functionality for performing CRUD operations
|
|
26
|
+
* against connector data sources using the Runtime Data Client.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ConnectorDataOperation {
|
|
29
|
+
private readonly _clientProvider;
|
|
30
|
+
private readonly _connectionsService;
|
|
31
|
+
private _databaseReferences;
|
|
32
|
+
private _connectionReferences;
|
|
33
|
+
constructor(clientProvider: IRuntimeClientProvider, connectionsService: RuntimeDataSourceService);
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new record in the specified table
|
|
36
|
+
*/
|
|
37
|
+
createRecordAsync<TRequest, TResponse>(tableName: string, data: TRequest): Promise<IOperationResult<TResponse>>;
|
|
38
|
+
/**
|
|
39
|
+
* Updates an existing record in the specified table
|
|
40
|
+
*/
|
|
41
|
+
updateRecordAsync<TRequest, TResponse>(tableName: string, id: string, data: TRequest): Promise<IOperationResult<TResponse>>;
|
|
42
|
+
/**
|
|
43
|
+
* Deletes a record from the specified table
|
|
44
|
+
*/
|
|
45
|
+
deleteRecordAsync(tableName: string, id: string): Promise<IOperationResult<void>>;
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves a single record from the specified table
|
|
48
|
+
*/
|
|
49
|
+
retrieveRecordAsync<TResponse>(tableName: string, id: string, options: string): Promise<IOperationResult<TResponse>>;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieves multiple records from the specified table
|
|
52
|
+
*/
|
|
53
|
+
retrieveMultipleRecordsAsync<TResponse>(tableName: string, options: string): Promise<IOperationResult<TResponse[]>>;
|
|
54
|
+
/**
|
|
55
|
+
* Executes a custom operation on the data source
|
|
56
|
+
*/
|
|
57
|
+
executeAsync<TRequest, TResponse>(operation: IDataOperation<TRequest>): Promise<IOperationResult<TResponse>>;
|
|
58
|
+
/**
|
|
59
|
+
* Determines the appropriate HTTP method for a request
|
|
60
|
+
* @param requestUrl - The URL for the request
|
|
61
|
+
* @param dataSourceInfo - The data source information
|
|
62
|
+
* @param operation - The operation name
|
|
63
|
+
* @returns The HTTP method to use
|
|
64
|
+
*/
|
|
65
|
+
private _getHttpMethod;
|
|
66
|
+
/**
|
|
67
|
+
* Builds the operation body parameters
|
|
68
|
+
*/
|
|
69
|
+
private _buildOperationBody;
|
|
70
|
+
/**
|
|
71
|
+
* Builds operation body parameters from the operation and data source info
|
|
72
|
+
*/
|
|
73
|
+
private _buildOperationBodyParam;
|
|
74
|
+
/**
|
|
75
|
+
* Builds the operation header for a given data operation if required.
|
|
76
|
+
*
|
|
77
|
+
* @template TRequest - The type of the request payload for the data operation.
|
|
78
|
+
* @param dataOperationRequest - The data operation containing details about the connector operation.
|
|
79
|
+
* @param tableName - The name of the table associated with the data operation.
|
|
80
|
+
* @returns A promise that resolves to the operation header as a string if a header parameter is required,
|
|
81
|
+
* or `undefined` if no header parameter is needed.
|
|
82
|
+
*/
|
|
83
|
+
private _buildOperationHeader;
|
|
84
|
+
/**
|
|
85
|
+
* Builds the operation header parameters as a JSON string for a given data operation.
|
|
86
|
+
*
|
|
87
|
+
* @template TRequest - The type of the request object for the data operation.
|
|
88
|
+
* @param dataOperationRequest - The data operation containing connector operation details and parameters.
|
|
89
|
+
* @param tableName - The name of the table associated with the data operation.
|
|
90
|
+
* @returns A promise that resolves to a JSON string representing the header parameters,
|
|
91
|
+
* or `undefined` if no `header` parameters are available.
|
|
92
|
+
*/
|
|
93
|
+
private _buildOperationHeaderParam;
|
|
94
|
+
/**
|
|
95
|
+
* Constructs the request URL for table operations
|
|
96
|
+
* @param tableName - The name of the table
|
|
97
|
+
* @param connectionReference - The connection reference
|
|
98
|
+
* @param options - Optional URL parameters
|
|
99
|
+
* @param encodeOptions - Whether to encode the options
|
|
100
|
+
* @returns The constructed URL
|
|
101
|
+
*/
|
|
102
|
+
private _buildTableUrl;
|
|
103
|
+
/**
|
|
104
|
+
* Builds the operation URL
|
|
105
|
+
*/
|
|
106
|
+
private _buildOperationUrl;
|
|
107
|
+
/**
|
|
108
|
+
* Gets the connection references
|
|
109
|
+
*/
|
|
110
|
+
private _getConnectionReferencesAsync;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the database references
|
|
113
|
+
*/
|
|
114
|
+
private _getDatabaseReferencesAsync;
|
|
115
|
+
/**
|
|
116
|
+
* Gets the metadata client instance
|
|
117
|
+
*/
|
|
118
|
+
private _getMetadataClient;
|
|
119
|
+
/**
|
|
120
|
+
* Gets the connection reference for a table
|
|
121
|
+
*/
|
|
122
|
+
private _getConnectionReference;
|
|
123
|
+
/**
|
|
124
|
+
* Gets both the data client and connection reference
|
|
125
|
+
*/
|
|
126
|
+
private _getClientsAndConnection;
|
|
127
|
+
/**
|
|
128
|
+
* Builds the URL for shared SQL operations
|
|
129
|
+
*/
|
|
130
|
+
private _buildSharedSqlOperationUrl;
|
|
131
|
+
/**
|
|
132
|
+
* Builds the URL for standard operations
|
|
133
|
+
*/
|
|
134
|
+
private _buildStandardOperationUrl;
|
|
135
|
+
/**
|
|
136
|
+
* Normalizes the parameter name by replacing hyphens with underscores and performs case-insensitive matching
|
|
137
|
+
*/
|
|
138
|
+
private _getNormalizedParamValue;
|
|
139
|
+
/**
|
|
140
|
+
* Processes operation parameters into path and query parameters
|
|
141
|
+
*/
|
|
142
|
+
private _processParameters;
|
|
143
|
+
/**
|
|
144
|
+
* Gets the operation configuration
|
|
145
|
+
*/
|
|
146
|
+
private _getOperationConfig;
|
|
147
|
+
/**
|
|
148
|
+
* Initializes the clients
|
|
149
|
+
*/
|
|
150
|
+
private _getReferences;
|
|
151
|
+
/**
|
|
152
|
+
* Validates constructor parameters
|
|
153
|
+
*/
|
|
154
|
+
private _validateConstructorParams;
|
|
155
|
+
/**
|
|
156
|
+
* Constructs the final URL
|
|
157
|
+
*/
|
|
158
|
+
private _constructUrl;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=connectorDataOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectorDataOperation.d.ts","sourceRoot":"","sources":["../../../../../src/internal/data/core/data/connectorDataOperation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,oBAAoB,EACpB,sBAAsB,EAEvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAmB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAa7E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAkBD;;;GAGG;AACH,qBAAa,sBAAsB;IAKjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IACzD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA2B;IAC/D,OAAO,CAAC,mBAAmB,CAAmC;IAC9D,OAAO,CAAC,qBAAqB,CAAmC;gBAMpD,cAAc,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,wBAAwB;IAUhG;;OAEG;IACU,iBAAiB,CAAC,QAAQ,EAAE,SAAS,EAChD,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,gBAAgB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