@azure/digital-twins-core 1.1.1-alpha.20221017.1 → 2.0.0-alpha.20230111.2
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/README.md +7 -7
- package/dist/index.js +575 -610
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/digitalTwinsClient.js +69 -364
- package/dist-esm/src/digitalTwinsClient.js.map +1 -1
- package/dist-esm/src/generated/azureDigitalTwinsAPI.js +52 -13
- package/dist-esm/src/generated/azureDigitalTwinsAPI.js.map +1 -1
- package/dist-esm/src/generated/index.js +13 -0
- package/dist-esm/src/generated/index.js.map +1 -0
- package/dist-esm/src/generated/models/index.js.map +1 -1
- package/dist-esm/src/generated/models/mappers.js +35 -7
- package/dist-esm/src/generated/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/models/parameters.js +45 -30
- package/dist-esm/src/generated/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/operations/digitalTwinModels.js +87 -47
- package/dist-esm/src/generated/operations/digitalTwinModels.js.map +1 -1
- package/dist-esm/src/generated/operations/digitalTwins.js +190 -80
- package/dist-esm/src/generated/operations/digitalTwins.js.map +1 -1
- package/dist-esm/src/generated/operations/eventRoutes.js +79 -35
- package/dist-esm/src/generated/operations/eventRoutes.js.map +1 -1
- package/dist-esm/src/generated/operations/query.js +10 -12
- package/dist-esm/src/generated/operations/query.js.map +1 -1
- package/dist-esm/src/generated/operationsInterfaces/digitalTwinModels.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/digitalTwinModels.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/digitalTwins.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/digitalTwins.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/eventRoutes.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/eventRoutes.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/index.js +12 -0
- package/dist-esm/src/generated/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/generated/operationsInterfaces/query.js +9 -0
- package/dist-esm/src/generated/operationsInterfaces/query.js.map +1 -0
- package/dist-esm/src/generated/pagingHelper.js +32 -0
- package/dist-esm/src/generated/pagingHelper.js.map +1 -0
- package/dist-esm/src/index.js +1 -1
- package/dist-esm/src/index.js.map +1 -1
- package/package.json +13 -11
- package/types/digital-twins-core.d.ts +196 -693
- package/dist-esm/src/generated/azureDigitalTwinsAPIContext.js +0 -35
- package/dist-esm/src/generated/azureDigitalTwinsAPIContext.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"digitalTwinsClient.js","sourceRoot":"","sources":["../../src/digitalTwinsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,4CAA4C;AAE5C,OAAO,EAKL,+BAA+B,EAC/B,yBAAyB,EACzB,YAAY,GAEb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAsC3F,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAW,OAAO,CAAC;AAS3C,MAAM,0BAA0B,GAAG,yCAAyC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAM7B;;;;;;;;;;;;;;;OAeG;IACH,YACE,WAAmB,EACnB,UAA2B,EAC3B,UAAqC,EAAE;QAEvC,MAAM,UAAU,GAAG,+BAA+B,CAAC,UAAU,EAAE,0BAA0B,CAAC,CAAC;QAC3F,MAAM,OAAO,GAAG,+BAA+B,WAAW,EAAE,CAAC;QAE7D,MAAM,EAAE,UAAU,KAAyB,OAAO,EAA3B,eAAe,UAAK,OAAO,EAA5C,cAAkC,CAAU,CAAC;QACnD,IAAI,CAAC,eA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E,CAAC,CAAC,CAAA,IAAA;oBAApD,MAAM,IAAI,WAAA,CAAA;oBACnB,IAAI,IAAI,CAAC,KAAK,EAAE;wBACd,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;4BAC7B,oBAAM,IAAI,CAAA,CAAC;yBACZ;qBACF;iBACF;;;;;;;;;QACH,CAAC;KAAA;IAED;;;;;;OAMG;IACI,UAAU,CACf,KAAa,EACb,cAAuB,EACvB,UAA2C,EAAE;QAE7C,IAAI,6BAA6B,GAAkC,OAAO,CAAC;QAC3E,6BAA6B,GAAG;YAC9B,eAAe,EAAE,cAAc;SAChC,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;QAEtE,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,WAAyB,EAAE,EAAE,EAAE,CACtC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,6BAA6B,EAAE,QAAQ,CAAC;SACtE,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport {\n TokenCredential,\n RestResponse,\n OperationOptions,\n InternalPipelineOptions,\n bearerTokenAuthenticationPolicy,\n createPipelineFromOptions,\n generateUuid,\n PipelineOptions,\n} from \"@azure/core-http\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { AzureDigitalTwinsAPI as GeneratedClient } from \"./generated/azureDigitalTwinsAPI\";\nimport {\n DigitalTwinsGetByIdResponse,\n DigitalTwinsAddOptionalParams,\n DigitalTwinsAddResponse,\n DigitalTwinsUpdateOptionalParams,\n DigitalTwinsUpdateResponse,\n DigitalTwinsDeleteOptionalParams,\n DigitalTwinsGetComponentResponse,\n DigitalTwinsUpdateComponentResponse,\n DigitalTwinsUpdateComponentOptionalParams,\n DigitalTwinsAddRelationshipResponse,\n DigitalTwinsAddRelationshipOptionalParams,\n DigitalTwinsUpdateRelationshipOptionalParams,\n DigitalTwinsUpdateRelationshipResponse,\n DigitalTwinsDeleteRelationshipOptionalParams,\n DigitalTwinsSendTelemetryOptionalParams,\n DigitalTwinsSendComponentTelemetryOptionalParams,\n DigitalTwinsListRelationshipsResponse,\n IncomingRelationship,\n DigitalTwinsListIncomingRelationshipsResponse,\n DigitalTwinsGetRelationshipByIdResponse,\n DigitalTwinsModelData,\n DigitalTwinModelsGetByIdResponse,\n DigitalTwinModelsGetByIdOptionalParams,\n DigitalTwinModelsAddResponse,\n DigitalTwinModelsAddOptionalParams,\n DigitalTwinModelsListResponse,\n DigitalTwinModelsListOptionalParams,\n EventRoutesGetByIdResponse,\n EventRoute,\n EventRoutesAddOptionalParams,\n EventRoutesListNextResponse,\n EventRoutesListOptionalParams,\n QueryQueryTwinsOptionalParams,\n QueryQueryTwinsResponse,\n QuerySpecification,\n} from \"./generated/models\";\nimport { tracingClient } from \"./tracing\";\nimport { logger } from \"./logger\";\n\nexport const SDK_VERSION: string = \"1.1.0\";\n\nexport interface DigitalTwinsClientOptions extends PipelineOptions {\n /**\n * Api Version\n */\n apiVersion?: string;\n}\n\nconst DEFAULT_DIGITALTWINS_SCOPE = \"https://digitaltwins.azure.net/.default\";\n\n/**\n * Client for Azure IoT DigitalTwins API.\n */\nexport class DigitalTwinsClient {\n /**\n * A reference to the auto-generated AzureDigitalTwinsAPI\n */\n private readonly client: GeneratedClient;\n\n /**\n * Creates an instance of AzureDigitalTwinsAPI.\n *\n * Example usage:\n * ```ts\n * const { DigitalTwinsClient, ServiceClientCredentials } = require(\"@azure/digital-twins-core\");\n *\n * const client = new DigitalTwinsClient(\n * \"<endpoint>\",\n * new DefaultAzureCredential();\n * );\n * ```\n * @param endpointUrl - The endpoint URL of the service.\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the service client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential,\n options: DigitalTwinsClientOptions = {}\n ) {\n const authPolicy = bearerTokenAuthenticationPolicy(credential, DEFAULT_DIGITALTWINS_SCOPE);\n const libInfo = `azsdk-js-digital-twins-core/${SDK_VERSION}`;\n\n const { apiVersion, ...pipelineOptions } = options;\n if (!pipelineOptions.userAgentOptions) {\n pipelineOptions.userAgentOptions = {};\n }\n if (pipelineOptions.userAgentOptions.userAgentPrefix) {\n pipelineOptions.userAgentOptions.userAgentPrefix = `${pipelineOptions.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n pipelineOptions.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...pipelineOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n allowedHeaderNames: [\"x-ms-request-id\"],\n },\n },\n };\n\n const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy);\n\n this.client = new GeneratedClient({\n endpoint: endpointUrl,\n apiVersion,\n ...pipeline,\n });\n }\n\n /**\n * Get a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param options - The operation options\n * @returns The application/json digital twin and the http response.\n */\n public getDigitalTwin(\n digitalTwinId: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getById(digitalTwinId, updatedOptions);\n }\n );\n }\n\n /**\n * Create or update a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin to create or update.\n * @param digitalTwinJson - The application/json digital twin to create.\n * @param options - Extended operation options including\n * ifNoneMatch: Only perform the operation if the entity does not already exist.\n * @returns The created application/json digital twin and the http response.\n */\n public upsertDigitalTwin(\n digitalTwinId: string,\n digitalTwinJson: string,\n options: DigitalTwinsAddOptionalParams = {}\n ): Promise<DigitalTwinsAddResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertDigitalTwin\",\n options,\n async (updatedOptions) => {\n const payload = JSON.parse(digitalTwinJson);\n return this.client.digitalTwins.add(digitalTwinId, payload, updatedOptions);\n }\n );\n }\n\n /**\n * Update a digital twin using a json patch.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param jsonPatch - An update specification described by JSON Patch. Updates to property values\n * and $model elements may happen in the same request. Operations are limited to add, replace and\n * remove.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n * @returns The http response.\n */\n public updateDigitalTwin(\n digitalTwinId: string,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change\n jsonPatch: any,\n options: DigitalTwinsUpdateOptionalParams = {}\n ): Promise<DigitalTwinsUpdateResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.update(digitalTwinId, jsonPatch, updatedOptions);\n }\n );\n }\n\n /**\n * Delete a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n * @returns The http response.\n */\n public deleteDigitalTwin(\n digitalTwinId: string,\n options: DigitalTwinsDeleteOptionalParams = {}\n ): Promise<RestResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.delete(digitalTwinId, updatedOptions);\n }\n );\n }\n\n /**\n * Get a component on a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param componentName - The component being retrieved.\n * @param options - The operation options\n * @returns Json string representation of the component corresponding to the provided componentName and the HTTP response.\n */\n public getComponent(\n digitalTwinId: string,\n componentName: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetComponentResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getComponent\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getComponent(digitalTwinId, componentName, updatedOptions);\n }\n );\n }\n\n /**\n * Update properties of a component on a digital twin using a JSON patch.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param componentName - The component being updated.\n * @param jsonPatch - The application/json-patch+json operations to be performed on the specified digital twin's component.\n * @param enableUpdate - If true then update of an existing digital twin is enabled.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n * @returns The http response.\n */\n public updateComponent(\n digitalTwinId: string,\n componentName: string,\n jsonPatch: any[],\n options: DigitalTwinsUpdateComponentOptionalParams = {}\n ): Promise<DigitalTwinsUpdateComponentResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateComponent\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.updateComponent(\n digitalTwinId,\n componentName,\n jsonPatch,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Get a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to retrieve.\n * @param options - The operation options\n * @returns The pageable list of application/json relationships belonging to the specified digital twin and the http response.\n */\n public getRelationship(\n digitalTwinId: string,\n relationshipId: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetRelationshipByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getRelationshipById(\n digitalTwinId,\n relationshipId,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Create or update a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to create.\n * @param relationship - The application/json relationship to be created.\n * @param options - Extended operation options including\n * ifNoneMatch: Only perform the operation if the entity does not already exist.\n */\n public upsertRelationship(\n digitalTwinId: string,\n relationshipId: string,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change\n relationship: any,\n options: DigitalTwinsAddRelationshipOptionalParams = {}\n ): Promise<DigitalTwinsAddRelationshipResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.addRelationship(\n digitalTwinId,\n relationshipId,\n relationship,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Updates the properties of a relationship on a digital twin using a JSON patch.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param relationshipId - The Id of the relationship to be updated.\n * @param jsonPatch - The application/json-patch+json operations to be performed on the specified digital twin's relationship.\n * @param options - Extended operation options\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n public updateRelationship(\n digitalTwinId: string,\n relationshipId: string,\n jsonPatch: any[],\n options: DigitalTwinsUpdateRelationshipOptionalParams = {}\n ): Promise<DigitalTwinsUpdateRelationshipResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.updateRelationship(\n digitalTwinId,\n relationshipId,\n jsonPatch,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Delete a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to delete.\n * @param options - The operation options\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is\n * @returns The http response.\n */\n public deleteRelationship(\n digitalTwinId: string,\n relationshipId: string,\n options: DigitalTwinsDeleteRelationshipOptionalParams = {}\n ): Promise<RestResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.deleteRelationship(\n digitalTwinId,\n relationshipId,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link listRelationships}.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *listRelationshipsPage(\n digitalTwinId: string,\n options: OperationOptions,\n continuationState: PageSettings\n ): AsyncIterableIterator<DigitalTwinsListRelationshipsResponse> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: OperationOptions = {\n ...options,\n };\n const listRelationshipResponse = await this.client.digitalTwins.listRelationships(\n digitalTwinId,\n optionsComplete\n );\n continuationState.continuationToken = listRelationshipResponse.nextLink;\n yield listRelationshipResponse;\n }\n while (continuationState.continuationToken) {\n const listRelationshipResponse = await this.client.digitalTwins.listRelationshipsNext(\n \"\",\n continuationState.continuationToken,\n options\n );\n\n continuationState.continuationToken = listRelationshipResponse.nextLink;\n yield listRelationshipResponse;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listRelationships}.\n * @param options - Common options for the iterative endpoints.\n */\n private async *listRelationshipsAll(\n digitalTwinId: string,\n options: OperationOptions\n ): AsyncIterableIterator<any> {\n for await (const page of this.listRelationshipsPage(digitalTwinId, options, {})) {\n const value = page.value || [];\n for (const item of value) {\n yield item;\n }\n }\n }\n\n /**\n * Retrieve relationships for a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n */\n public listRelationships(\n digitalTwinId: string,\n options: OperationOptions & PageSettings = {}\n ): PagedAsyncIterableIterator<any, DigitalTwinsListRelationshipsResponse> {\n const iter = this.listRelationshipsAll(digitalTwinId, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.listRelationshipsPage(digitalTwinId, options, settings),\n };\n }\n\n /**\n * Deals with the pagination of {@link listIncomingRelationships}.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *listIncomingRelationshipsPage(\n digitalTwinId: string,\n options: OperationOptions,\n continuationState: PageSettings\n ): AsyncIterableIterator<DigitalTwinsListIncomingRelationshipsResponse> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: OperationOptions = {\n ...options,\n };\n const listIncomingRelationshipsResponse =\n await this.client.digitalTwins.listIncomingRelationships(digitalTwinId, optionsComplete);\n continuationState.continuationToken = listIncomingRelationshipsResponse.nextLink;\n yield listIncomingRelationshipsResponse;\n }\n while (continuationState.continuationToken) {\n const listIncomingRelationshipsResponse =\n await this.client.digitalTwins.listIncomingRelationshipsNext(\n \"\",\n continuationState.continuationToken,\n options\n );\n\n continuationState.continuationToken = listIncomingRelationshipsResponse.nextLink;\n yield listIncomingRelationshipsResponse;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link listIncomingRelationships}.\n * @param digitalTwinId - The Id of the digital twin.\n * @param options - Common options for the iterative endpoints.\n */\n private async *listIncomingRelationshipsAll(\n digitalTwinId: string,\n options: OperationOptions\n ): AsyncIterableIterator<IncomingRelationship> {\n for await (const page of this.listIncomingRelationshipsPage(digitalTwinId, options, {})) {\n const value = page.value || [];\n yield* value;\n }\n }\n\n /**\n * Retrieve all incoming relationships for a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n */\n public listIncomingRelationships(\n digitalTwinId: string,\n options: OperationOptions & PageSettings = {}\n ): PagedAsyncIterableIterator<\n IncomingRelationship,\n DigitalTwinsListIncomingRelationshipsResponse\n > {\n const iter = this.listIncomingRelationshipsAll(digitalTwinId, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.listIncomingRelationshipsPage(digitalTwinId, options, settings),\n };\n }\n\n /**\n * Publish telemetry from a digital twin, which is then consumed by one or many destination endpoints (subscribers) defined under.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param payload - The application/json telemetry payload to be sent.\n * @param messageId - The message Id.\n * @param options - The operation options\n * @returns The http response.\n */\n public publishTelemetry(\n digitalTwinId: string,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change\n payload: any,\n messageId: string,\n options: OperationOptions = {}\n ): Promise<RestResponse> {\n const digitalTwinsSendTelemetryOptionalParams: DigitalTwinsSendTelemetryOptionalParams =\n options;\n digitalTwinsSendTelemetryOptionalParams.telemetrySourceTime = new Date().toISOString();\n if (!messageId) {\n messageId = generateUuid();\n }\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.publishTelemetry\",\n digitalTwinsSendTelemetryOptionalParams,\n async (updatedOptions) => {\n return this.client.digitalTwins.sendTelemetry(\n digitalTwinId,\n messageId,\n payload,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Publish telemetry from a digital twin's component, which is then consumed by one or many destination endpoints (subscribers) defined under.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param componentName - The name of the DTDL component.\n * @param payload - The application/json telemetry payload to be sent.\n * @param messageId - The message Id.\n * @param options - The operation options\n * @returns The http response.\n */\n public publishComponentTelemetry(\n digitalTwinId: string,\n componentName: string,\n payload: string,\n messageId: string,\n options: OperationOptions = {}\n ): Promise<RestResponse> {\n const digitalTwinsSendComponentTelemetryOptionalParams: DigitalTwinsSendComponentTelemetryOptionalParams =\n options;\n digitalTwinsSendComponentTelemetryOptionalParams.telemetrySourceTime = new Date().toISOString();\n if (!messageId) {\n messageId = generateUuid();\n }\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.publishComponentTelemetry\",\n digitalTwinsSendComponentTelemetryOptionalParams,\n async (updatedOptions) => {\n return this.client.digitalTwins.sendComponentTelemetry(\n digitalTwinId,\n componentName,\n payload,\n messageId,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Get a model, including the model metadata and the model definition.\n *\n * @param modelId - The Id of the model.\n * @param options - Extended operation options including\n * includeModelDefinition: When true the model definition will be returned as part of the result. Default value: false.\n * @returns The application/json model and the http response.\n */\n public getModel(\n modelId: string,\n includeModelDefinition: boolean = false,\n options: OperationOptions = {}\n ): Promise<DigitalTwinModelsGetByIdResponse> {\n const digitalTwinModelsGetByIdOptionalParams: DigitalTwinModelsGetByIdOptionalParams = options;\n digitalTwinModelsGetByIdOptionalParams.includeModelDefinition = includeModelDefinition;\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getModel\",\n digitalTwinModelsGetByIdOptionalParams,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.getById(modelId, updatedOptions);\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link list}.\n *\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *getModelsPage(\n options: DigitalTwinModelsListOptionalParams,\n continuationState: PageSettings\n ): AsyncIterableIterator<DigitalTwinModelsListResponse> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: DigitalTwinModelsListOptionalParams = options;\n optionsComplete.maxItemsPerPage = continuationState.maxPageSize;\n\n const listResponse = await this.client.digitalTwinModels.list(optionsComplete);\n continuationState.continuationToken = listResponse.nextLink;\n yield listResponse;\n }\n while (continuationState.continuationToken) {\n const listResponse = await this.client.digitalTwinModels.listNext(\n continuationState.continuationToken,\n options\n );\n\n continuationState.continuationToken = listResponse.nextLink;\n yield listResponse;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link list}.\n * @param options - Common options for the iterative endpoints.\n */\n private async *getModelsAll(\n options: DigitalTwinModelsListOptionalParams\n ): AsyncIterableIterator<DigitalTwinsModelData> {\n const f = {};\n\n for await (const page of this.getModelsPage(options, f)) {\n const value = page.value || [];\n for (const item of value) {\n yield item;\n }\n }\n }\n\n /**\n * Get the list of models\n *\n * @param dependeciesFor - The model Ids to have dependencies retrieved. If omitted, all models are retrieved.\n * @param includeModelDefinition - Whether to include the model definition in the result. If false, only the model metadata will be returned.\n * @param resultsPerPage - The maximum number of items to retrieve per request. The server may choose to return less than the requested max.\n * @returns A pageable set of application/json models and the http response.\n */\n public listModels(\n dependeciesFor?: string[],\n includeModelDefinition: boolean = false,\n resultsPerPage?: number,\n options: OperationOptions & PageSettings = {}\n ): PagedAsyncIterableIterator<DigitalTwinsModelData, DigitalTwinModelsListResponse> {\n let digitalTwinModelsListOptionalParams: DigitalTwinModelsListOptionalParams = options;\n digitalTwinModelsListOptionalParams = {\n maxItemsPerPage: resultsPerPage,\n dependenciesFor: dependeciesFor,\n includeModelDefinition: includeModelDefinition,\n };\n\n const iter = this.getModelsAll(digitalTwinModelsListOptionalParams);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.getModelsPage(digitalTwinModelsListOptionalParams, settings),\n };\n }\n\n /**\n * Create one or many\n *\n * @param models - The set of models to create. Each string corresponds to exactly one model.\n * @param options - The operation options\n * @returns The created application/json models and the http response.\n */\n public createModels(\n dtdlModels: any[],\n options: OperationOptions = {}\n ): Promise<DigitalTwinModelsAddResponse> {\n const digitalTwinModelsAddOptionalParams: DigitalTwinModelsAddOptionalParams = options;\n digitalTwinModelsAddOptionalParams.models = dtdlModels;\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.createModels\",\n digitalTwinModelsAddOptionalParams,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.add(updatedOptions);\n }\n );\n }\n\n /**\n * Decommission a model using a json patch.\n * When a model is decommissioned, new digital twins will no longer be able to be\n * defined by this model. However, existing digital twins may continue to use this model.\n * Once a model is decommissioned, it may not be recommissioned.\n *\n * @param modelId - The Id of the model to decommission.\n * property can be replaced.\n * @param options - The operation options\n * @returns The http response.\n *\n */\n public decomissionModel(modelId: string, options: OperationOptions = {}): Promise<RestResponse> {\n const jsonPatch = [{ op: \"replace\", path: \"/decommissioned\", value: true }];\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.decomissionModel\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.update(modelId, jsonPatch, updatedOptions);\n }\n );\n }\n\n /**\n * Delete a model.\n *\n * @param modelId - The Id of the model to delete.\n * @param options - The operation options\n * @returns The http response.\n */\n public deleteModel(modelId: string, options: OperationOptions = {}): Promise<RestResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteModel\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.delete(modelId, updatedOptions);\n }\n );\n }\n\n /**\n * Get an event route.\n *\n * @param modelId - The Id of the event route.\n * @param options - The operation options\n * @returns The application/json event route and the http response.\n */\n public getEventRoute(\n eventRouteId: string,\n options: OperationOptions = {}\n ): Promise<EventRoutesGetByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getEventRoute\",\n options,\n async (updatedOptions) => {\n return this.client.eventRoutes.getById(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link list}.\n *\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *getEventRoutesPage(\n options: EventRoutesListOptionalParams,\n continuationState: PageSettings\n ): AsyncIterableIterator<EventRoutesListNextResponse> {\n if (continuationState.continuationToken == null) {\n const optionsComplete: EventRoutesListOptionalParams = options;\n optionsComplete.maxItemsPerPage = continuationState.maxPageSize;\n\n const listResponse = await this.client.eventRoutes.list(optionsComplete);\n continuationState.continuationToken = listResponse.nextLink;\n yield listResponse;\n }\n while (continuationState.continuationToken) {\n const listResponse = await this.client.eventRoutes.listNext(\n continuationState.continuationToken,\n options\n );\n\n continuationState.continuationToken = listResponse.nextLink;\n yield listResponse;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link list}.\n * @param options - Common options for the iterative endpoints.\n */\n private async *getEventRoutesAll(\n options: EventRoutesListOptionalParams\n ): AsyncIterableIterator<EventRoute> {\n const f = {};\n for await (const page of this.getEventRoutesPage(options, f)) {\n const value = page.value || [];\n for (const item of value) {\n yield item;\n }\n }\n }\n\n /**\n * List the event routes in a digital twins instance.\n *\n * @param resultsPerPage - The maximum number of items to retrieve per request. The server may choose to return less than\n * the requested max.\n * @returns The application/json event route and the http response.\n */\n public listEventRoutes(\n resultsPerPage?: number,\n options: OperationOptions & PageSettings = {}\n ): PagedAsyncIterableIterator<EventRoute, EventRoutesListNextResponse> {\n let eventRoutesListOptionalParams: EventRoutesListOptionalParams = options;\n eventRoutesListOptionalParams = {\n maxItemsPerPage: resultsPerPage,\n };\n\n const iter = this.getEventRoutesAll(eventRoutesListOptionalParams);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.getEventRoutesPage(eventRoutesListOptionalParams, settings),\n };\n }\n\n /**\n * Create or update an event route.\n *\n * @param eventRouteId - The Id of the event route to create or update.\n * @param endpointId - The id of the endpoint this event route is bound to.\n * @param filter - An expression which describes the events which are routed to the endpoint.\n * @param options - The operation options\n * @returns The http response.\n */\n public upsertEventRoute(\n eventRouteId: string,\n endpointId: string,\n filter: string,\n options: OperationOptions = {}\n ): Promise<RestResponse> {\n const eventRoutesAddOptionalParams: EventRoutesAddOptionalParams = options;\n const eventRoute: EventRoute = {\n endpointName: endpointId,\n filter: filter,\n };\n eventRoutesAddOptionalParams.eventRoute = eventRoute;\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertEventRoute\",\n eventRoutesAddOptionalParams,\n async (updatedOptions) => {\n return this.client.eventRoutes.add(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * Delete an event route.\n *\n * @param eventRouteId - The Id of the eventRoute to delete.\n * @param options - The operation options\n * @returns The http response.\n */\n public deleteEventRoute(\n eventRouteId: string,\n options: OperationOptions = {}\n ): Promise<RestResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteEventRoute\",\n options,\n async (updatedOptions) => {\n return this.client.eventRoutes.delete(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link query}.\n *\n * @param query - The query string, in SQL-like syntax.\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *queryTwinsPage(\n query: string,\n options: QueryQueryTwinsOptionalParams,\n continuationState: PageSettings\n ): AsyncIterableIterator<QueryQueryTwinsResponse> {\n if (continuationState.continuationToken == null) {\n const querySpecification: QuerySpecification = {\n query: query,\n continuationToken: continuationState.continuationToken,\n };\n const queryResult = await this.client.query.queryTwins(querySpecification, options);\n continuationState.continuationToken = queryResult.continuationToken;\n yield queryResult;\n }\n while (continuationState.continuationToken) {\n const querySpecification: QuerySpecification = {\n query: query,\n continuationToken: continuationState.continuationToken,\n };\n const queryResult = await this.client.query.queryTwins(querySpecification, options);\n\n continuationState.continuationToken = queryResult.continuationToken;\n yield queryResult;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link query}.\n * @param query - The query string, in SQL-like syntax.\n * @param options - Common options for the iterative endpoints.\n */\n private async *queryTwinsAll(\n query: string,\n options: QueryQueryTwinsOptionalParams\n ): AsyncIterableIterator<any> {\n const f = {};\n\n for await (const page of this.queryTwinsPage(query, options, f)) {\n if (page.value) {\n for (const item of page.value) {\n yield item;\n }\n }\n }\n }\n\n /**\n * Query for digital twins.\n *\n * @param query - The query string, in SQL-like syntax.\n * @param resultsPerPage - The maximum number of items to retrieve per request. The server may choose to return less than the requested max.\n * @returns The pageable list of query results.\n */\n public queryTwins(\n query: string,\n resultsPerPage?: number,\n options: OperationOptions & PageSettings = {}\n ): PagedAsyncIterableIterator<any, QueryQueryTwinsResponse> {\n let queryQueryTwinsOptionalParams: QueryQueryTwinsOptionalParams = options;\n queryQueryTwinsOptionalParams = {\n maxItemsPerPage: resultsPerPage,\n };\n\n const iter = this.queryTwinsAll(query, queryQueryTwinsOptionalParams);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) =>\n this.queryTwinsPage(query, queryQueryTwinsOptionalParams, settings),\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"digitalTwinsClient.js","sourceRoot":"","sources":["../../src/digitalTwinsClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AASlC,OAAO,EAAE,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE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;;;;;;;;;QACH,CAAC;KAAA;IAED;;;;;;OAMG;IACI,UAAU,CACf,KAAa,EACb,UAA6B,EAAE;QAE/B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAEhD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,WAAyB,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;SACvF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n OperationOptions,\n InternalClientPipelineOptions,\n CommonClientOptions,\n} from \"@azure/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { v4 as generateUuid } from \"uuid\";\nimport { AzureDigitalTwinsAPI as GeneratedClient } from \"./generated/azureDigitalTwinsAPI\";\nimport {\n DigitalTwinsGetByIdResponse,\n DigitalTwinsAddOptionalParams,\n DigitalTwinsAddResponse,\n DigitalTwinsUpdateOptionalParams,\n DigitalTwinsUpdateResponse,\n DigitalTwinsDeleteOptionalParams,\n DigitalTwinsGetComponentResponse,\n DigitalTwinsUpdateComponentResponse,\n DigitalTwinsUpdateComponentOptionalParams,\n DigitalTwinsAddRelationshipResponse,\n DigitalTwinsAddRelationshipOptionalParams,\n DigitalTwinsUpdateRelationshipOptionalParams,\n DigitalTwinsUpdateRelationshipResponse,\n DigitalTwinsDeleteRelationshipOptionalParams,\n IncomingRelationship,\n DigitalTwinsGetRelationshipByIdResponse,\n DigitalTwinsModelData,\n DigitalTwinModelsGetByIdResponse,\n DigitalTwinModelsAddResponse,\n EventRoutesGetByIdResponse,\n EventRoute,\n QueryQueryTwinsResponse,\n DigitalTwinModelsGetByIdOptionalParams as GetModelOptions,\n DigitalTwinModelsListOptionalParams as ListModelsOptions,\n QueryQueryTwinsOptionalParams as QueryTwinsOptions,\n EventRoutesListOptionalParams as ListEventRoutesOptions,\n DigitalTwinsListRelationshipsOptionalParams as ListRelationshipsOptions,\n DigitalTwinsListIncomingRelationshipsOptionalParams as ListIncomingRelationshipsOptions,\n} from \"./generated/models\";\nimport { tracingClient } from \"./tracing\";\nimport { logger } from \"./logger\";\nexport {\n GetModelOptions,\n ListModelsOptions,\n QueryTwinsOptions,\n ListEventRoutesOptions,\n ListIncomingRelationshipsOptions,\n ListRelationshipsOptions,\n};\n\n/**\n * Options for the DigitalTwinsClient class\n */\nexport interface DigitalTwinsClientOptions extends CommonClientOptions {}\n\nconst DEFAULT_DIGITALTWINS_SCOPE = \"https://digitaltwins.azure.net/.default\";\n\n/**\n * Client for Azure IoT DigitalTwins API.\n */\nexport class DigitalTwinsClient {\n /**\n * A reference to the auto-generated AzureDigitalTwinsAPI\n */\n private readonly client: GeneratedClient;\n\n /**\n * Creates an instance of AzureDigitalTwinsAPI.\n *\n * Example usage:\n * ```ts\n * const { DigitalTwinsClient, ServiceClientCredentials } = require(\"@azure/digital-twins-core\");\n *\n * const client = new DigitalTwinsClient(\n * \"<endpoint>\",\n * new DefaultAzureCredential();\n * );\n * ```\n * @param endpointUrl - The endpoint URL of the service.\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the service client.\n */\n constructor(\n endpointUrl: string,\n credential: TokenCredential,\n options: DigitalTwinsClientOptions = {}\n ) {\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\"x-ms-request-id\"],\n },\n };\n\n this.client = new GeneratedClient({\n endpoint: endpointUrl,\n credential,\n credentialScopes: DEFAULT_DIGITALTWINS_SCOPE,\n ...internalPipelineOptions,\n });\n }\n\n /**\n * Get a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param options - The operation options\n * @returns The application/json digital twin.\n */\n public getDigitalTwin(\n digitalTwinId: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getById(digitalTwinId, updatedOptions);\n }\n );\n }\n\n /**\n * Create or update a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin to create or update.\n * @param digitalTwinJson - The application/json digital twin to create.\n * @param options - Extended operation options including\n * ifNoneMatch: Only perform the operation if the entity does not already exist.\n * @returns The created application/json digital twin.\n */\n public upsertDigitalTwin(\n digitalTwinId: string,\n digitalTwinJson: string,\n options: DigitalTwinsAddOptionalParams = {}\n ): Promise<DigitalTwinsAddResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertDigitalTwin\",\n options,\n async (updatedOptions) => {\n const payload = JSON.parse(digitalTwinJson);\n return this.client.digitalTwins.add(digitalTwinId, payload, updatedOptions);\n }\n );\n }\n\n /**\n * Update a digital twin using a json patch.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param jsonPatch - An update specification described by JSON Patch. Updates to property values\n * and $model elements may happen in the same request. Operations are limited to add, replace and\n * remove.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n\n */\n public updateDigitalTwin(\n digitalTwinId: string,\n jsonPatch: Array<Record<string, unknown>>,\n options: DigitalTwinsUpdateOptionalParams = {}\n ): Promise<DigitalTwinsUpdateResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.update(digitalTwinId, jsonPatch, updatedOptions);\n }\n );\n }\n\n /**\n * Delete a digital twin\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n\n */\n public deleteDigitalTwin(\n digitalTwinId: string,\n options: DigitalTwinsDeleteOptionalParams = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteDigitalTwin\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.delete(digitalTwinId, updatedOptions);\n }\n );\n }\n\n /**\n * Get a component on a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param componentName - The component being retrieved.\n * @param options - The operation options\n * @returns Json string representation of the component corresponding to the provided componentName.\n */\n public getComponent(\n digitalTwinId: string,\n componentName: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetComponentResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getComponent\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getComponent(digitalTwinId, componentName, updatedOptions);\n }\n );\n }\n\n /**\n * Update properties of a component on a digital twin using a JSON patch.\n *\n * @param digitalTwinId - The Id of the digital twin.\n * @param componentName - The component being updated.\n * @param jsonPatch - The application/json-patch+json operations to be performed on the specified digital twin's component.\n * @param enableUpdate - If true then update of an existing digital twin is enabled.\n * @param options - Extended operation options including\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n\n */\n public updateComponent(\n digitalTwinId: string,\n componentName: string,\n jsonPatch: Array<Record<string, unknown>>,\n options: DigitalTwinsUpdateComponentOptionalParams = {}\n ): Promise<DigitalTwinsUpdateComponentResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateComponent\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.updateComponent(\n digitalTwinId,\n componentName,\n jsonPatch,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Get a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to retrieve.\n * @param options - The operation options\n * @returns The pageable list of application/json relationships belonging to the specified digital twin.\n */\n public getRelationship(\n digitalTwinId: string,\n relationshipId: string,\n options: OperationOptions = {}\n ): Promise<DigitalTwinsGetRelationshipByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.getRelationshipById(\n digitalTwinId,\n relationshipId,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Create or update a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to create.\n * @param relationship - The application/json relationship to be created.\n * @param options - Extended operation options including\n * ifNoneMatch: Only perform the operation if the entity does not already exist.\n */\n public upsertRelationship(\n digitalTwinId: string,\n relationshipId: string,\n relationship: Record<string, unknown>,\n options: DigitalTwinsAddRelationshipOptionalParams = {}\n ): Promise<DigitalTwinsAddRelationshipResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.addRelationship(\n digitalTwinId,\n relationshipId,\n relationship,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Updates the properties of a relationship on a digital twin using a JSON patch.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param relationshipId - The Id of the relationship to be updated.\n * @param jsonPatch - The application/json-patch+json operations to be performed on the specified digital twin's relationship.\n * @param options - Extended operation options\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n public updateRelationship(\n digitalTwinId: string,\n relationshipId: string,\n jsonPatch: Array<Record<string, unknown>>,\n options: DigitalTwinsUpdateRelationshipOptionalParams = {}\n ): Promise<DigitalTwinsUpdateRelationshipResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.updateRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.updateRelationship(\n digitalTwinId,\n relationshipId,\n jsonPatch,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Delete a relationship on a digital twin.\n *\n * @param digitalTwinId - The Id of the source digital twin.\n * @param relationshipId - The Id of the relationship to delete.\n * @param options - The operation options\n * ifMatch: Only perform the operation if the entity's etag matches one of the etags provided or * is\n\n */\n public deleteRelationship(\n digitalTwinId: string,\n relationshipId: string,\n options: DigitalTwinsDeleteRelationshipOptionalParams = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteRelationship\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.deleteRelationship(\n digitalTwinId,\n relationshipId,\n updatedOptions\n );\n }\n );\n }\n\n /**\n * Retrieve relationships for a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n */\n public listRelationships(\n digitalTwinId: string,\n options?: ListRelationshipsOptions\n ): PagedAsyncIterableIterator<Record<string, unknown>> {\n return this.client.digitalTwins.listRelationships(digitalTwinId, options);\n }\n\n /**\n * Retrieve all incoming relationships for a digital twin.\n *\n * @param digitalTwinId - The Id of the digital twin.\n */\n public listIncomingRelationships(\n digitalTwinId: string,\n options?: ListIncomingRelationshipsOptions\n ): PagedAsyncIterableIterator<IncomingRelationship> {\n return this.client.digitalTwins.listIncomingRelationships(digitalTwinId, options);\n }\n\n /**\n * Publish telemetry from a digital twin, which is then consumed by one or many destination endpoints (subscribers) defined under.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param payload - The application/json telemetry payload to be sent.\n * @param messageId - The message Id.\n * @param options - The operation options\n\n */\n public publishTelemetry(\n digitalTwinId: string,\n payload: Record<string, unknown>,\n messageId: string,\n options: OperationOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.publishTelemetry\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.sendTelemetry(\n digitalTwinId,\n messageId || generateUuid(),\n payload,\n {\n ...updatedOptions,\n telemetrySourceTime: new Date().toISOString(),\n }\n );\n }\n );\n }\n\n /**\n * Publish telemetry from a digital twin's component, which is then consumed by one or many destination endpoints (subscribers) defined under.\n *\n * @param digitalTwinId - The Id of the digital twin to delete.\n * @param componentName - The name of the DTDL component.\n * @param payload - The application/json telemetry payload to be sent.\n * @param messageId - The message Id.\n * @param options - The operation options\n\n */\n public publishComponentTelemetry(\n digitalTwinId: string,\n componentName: string,\n payload: Record<string, unknown>,\n messageId: string,\n options: OperationOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.publishComponentTelemetry\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwins.sendComponentTelemetry(\n digitalTwinId,\n componentName,\n messageId || generateUuid(),\n payload,\n { ...updatedOptions, telemetrySourceTime: new Date().toISOString() }\n );\n }\n );\n }\n\n /**\n * Get a model, including the model metadata and the model definition.\n *\n * @param modelId - The Id of the model.\n * @param options - Options for this operation\n * @returns The application/json model.\n */\n public getModel(\n modelId: string,\n options: GetModelOptions = {}\n ): Promise<DigitalTwinModelsGetByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getModel\",\n {\n ...options,\n includeModelDefinition: options?.includeModelDefinition ?? false,\n },\n async (updatedOptions) => {\n return this.client.digitalTwinModels.getById(modelId, updatedOptions);\n }\n );\n }\n\n /**\n * Get the list of models\n *\n * @param options - Options for listing models.\n * @returns A pageable set of application/json models.\n */\n public listModels(\n options: ListModelsOptions = {}\n ): PagedAsyncIterableIterator<DigitalTwinsModelData> {\n return this.client.digitalTwinModels.list({\n ...options,\n includeModelDefinition: options?.includeModelDefinition ?? false,\n });\n }\n\n /**\n * Create one or many\n *\n * @param dtdlModels - The set of models to create. Each string corresponds to exactly one model.\n * @param options - The operation options\n * @returns The created application/json models.\n */\n public createModels(\n dtdlModels: Array<Record<string, unknown>>,\n options: OperationOptions = {}\n ): Promise<DigitalTwinModelsAddResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.createModels\",\n {\n ...options,\n models: dtdlModels,\n },\n async (updatedOptions) => {\n return this.client.digitalTwinModels.add(updatedOptions);\n }\n );\n }\n\n /**\n * Decommission a model using a json patch.\n * When a model is decommissioned, new digital twins will no longer be able to be\n * defined by this model. However, existing digital twins may continue to use this model.\n * Once a model is decommissioned, it may not be recommissioned.\n *\n * @param modelId - The Id of the model to decommission.\n * property can be replaced.\n * @param options - The operation options\n\n *\n */\n public decomissionModel(modelId: string, options: OperationOptions = {}): Promise<void> {\n const jsonPatch = [{ op: \"replace\", path: \"/decommissioned\", value: true }];\n\n return tracingClient.withSpan(\n \"DigitalTwinsClient.decomissionModel\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.update(modelId, jsonPatch, updatedOptions);\n }\n );\n }\n\n /**\n * Delete a model.\n *\n * @param modelId - The Id of the model to delete.\n * @param options - The operation options\n\n */\n public deleteModel(modelId: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteModel\",\n options,\n async (updatedOptions) => {\n return this.client.digitalTwinModels.delete(modelId, updatedOptions);\n }\n );\n }\n\n /**\n * Get an event route.\n *\n * @param modelId - The Id of the event route.\n * @param options - The operation options\n * @returns The application/json event route.\n */\n public getEventRoute(\n eventRouteId: string,\n options: OperationOptions = {}\n ): Promise<EventRoutesGetByIdResponse> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.getEventRoute\",\n options,\n async (updatedOptions) => {\n return this.client.eventRoutes.getById(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * List the event routes in a digital twins instance.\n *\n * @param options - Options for listEventRoutes.\n * @returns The application/json event route.\n */\n public listEventRoutes(options?: ListEventRoutesOptions): PagedAsyncIterableIterator<EventRoute> {\n return this.client.eventRoutes.list(options);\n }\n\n /**\n * Create or update an event route.\n *\n * @param eventRouteId - The Id of the event route to create or update.\n * @param endpointId - The id of the endpoint this event route is bound to.\n * @param filter - An expression which describes the events which are routed to the endpoint.\n * @param options - The operation options\n\n */\n public upsertEventRoute(\n eventRouteId: string,\n endpointId: string,\n filter: string,\n options: OperationOptions = {}\n ): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.upsertEventRoute\",\n {\n eventRoute: {\n endpointName: endpointId,\n filter,\n },\n ...options,\n },\n async (updatedOptions) => {\n return this.client.eventRoutes.add(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * Delete an event route.\n *\n * @param eventRouteId - The Id of the eventRoute to delete.\n * @param options - The operation options\n\n */\n public deleteEventRoute(eventRouteId: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"DigitalTwinsClient.deleteEventRoute\",\n options,\n async (updatedOptions) => {\n return this.client.eventRoutes.delete(eventRouteId, updatedOptions);\n }\n );\n }\n\n /**\n * Deals with the pagination of {@link query}.\n *\n * @param query - The query string, in SQL-like syntax.\n * @param options - Common options for the iterative endpoints.\n * @param continuationState - An object that indicates the position of the paginated request.\n *\n */\n private async *queryTwinsPage(\n query: string,\n options: QueryTwinsOptions,\n continuationState?: PageSettings\n ): AsyncIterableIterator<QueryQueryTwinsResponse> {\n let { continuationToken } = continuationState ?? {};\n if (!continuationToken) {\n const queryResult = await this.client.query.queryTwins({ query }, options);\n continuationToken = queryResult.continuationToken;\n yield queryResult;\n }\n while (continuationToken) {\n const queryResult = await this.client.query.queryTwins({ query, continuationToken }, options);\n continuationToken = queryResult.continuationToken;\n yield queryResult;\n }\n }\n\n /**\n * Deals with the iteration of all the available results of {@link query}.\n * @param query - The query string, in SQL-like syntax.\n * @param options - Common options for the iterative endpoints.\n */\n private async *queryTwinsAll(\n query: string,\n options: QueryTwinsOptions\n ): AsyncIterableIterator<Record<string, unknown>> {\n for await (const page of this.queryTwinsPage(query, options)) {\n if (page.value) {\n yield* page.value;\n }\n }\n }\n\n /**\n * Query for digital twins.\n *\n * @param query - The query string, in SQL-like syntax.\n * @param options - Options for the query operation.\n * @returns The pageable list of query results.\n */\n public queryTwins(\n query: string,\n options: QueryTwinsOptions = {}\n ): PagedAsyncIterableIterator<Record<string, unknown>, QueryQueryTwinsResponse> {\n const iter = this.queryTwinsAll(query, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.queryTwinsPage(query, options, settings),\n };\n }\n}\n"]}
|
|
@@ -5,24 +5,63 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import { AzureDigitalTwinsAPIContext } from "./azureDigitalTwinsAPIContext";
|
|
12
|
-
class AzureDigitalTwinsAPI extends AzureDigitalTwinsAPIContext {
|
|
8
|
+
import * as coreClient from "@azure/core-client";
|
|
9
|
+
import { DigitalTwinModelsImpl, QueryImpl, DigitalTwinsImpl, EventRoutesImpl } from "./operations";
|
|
10
|
+
export class AzureDigitalTwinsAPI extends coreClient.ServiceClient {
|
|
13
11
|
/**
|
|
14
12
|
* Initializes a new instance of the AzureDigitalTwinsAPI class.
|
|
15
13
|
* @param options The parameter options
|
|
16
14
|
*/
|
|
17
15
|
constructor(options) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
var _a, _b;
|
|
17
|
+
// Initializing default values for options
|
|
18
|
+
if (!options) {
|
|
19
|
+
options = {};
|
|
20
|
+
}
|
|
21
|
+
const defaults = {
|
|
22
|
+
requestContentType: "application/json; charset=utf-8"
|
|
23
|
+
};
|
|
24
|
+
const packageDetails = `azsdk-js-digital-twins-core/2.0.0`;
|
|
25
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
26
|
+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
27
|
+
: `${packageDetails}`;
|
|
28
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
29
|
+
userAgentPrefix
|
|
30
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://digitaltwins-hostname" });
|
|
31
|
+
super(optionsWithDefaults);
|
|
32
|
+
// Assigning values to Constant parameters
|
|
33
|
+
this.$host = options.$host || "https://digitaltwins-hostname";
|
|
34
|
+
this.apiVersion = options.apiVersion || "2020-10-31";
|
|
35
|
+
this.digitalTwinModels = new DigitalTwinModelsImpl(this);
|
|
36
|
+
this.query = new QueryImpl(this);
|
|
37
|
+
this.digitalTwins = new DigitalTwinsImpl(this);
|
|
38
|
+
this.eventRoutes = new EventRoutesImpl(this);
|
|
39
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
40
|
+
}
|
|
41
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
42
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
43
|
+
if (!apiVersion) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const apiVersionPolicy = {
|
|
47
|
+
name: "CustomApiVersionPolicy",
|
|
48
|
+
async sendRequest(request, next) {
|
|
49
|
+
const param = request.url.split("?");
|
|
50
|
+
if (param.length > 1) {
|
|
51
|
+
const newParams = param[1].split("&").map((item) => {
|
|
52
|
+
if (item.indexOf("api-version") > -1) {
|
|
53
|
+
return "api-version=" + apiVersion;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return item;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
60
|
+
}
|
|
61
|
+
return next(request);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
23
65
|
}
|
|
24
66
|
}
|
|
25
|
-
// Operation Specifications
|
|
26
|
-
export { AzureDigitalTwinsAPI, AzureDigitalTwinsAPIContext, Models as AzureDigitalTwinsAPIModels, Mappers as AzureDigitalTwinsAPIMappers };
|
|
27
|
-
export * from "./operations";
|
|
28
67
|
//# sourceMappingURL=azureDigitalTwinsAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azureDigitalTwinsAPI.js","sourceRoot":"","sources":["../../../src/generated/azureDigitalTwinsAPI.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"azureDigitalTwinsAPI.js","sourceRoot":"","sources":["../../../src/generated/azureDigitalTwinsAPI.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,cAAc,CAAC;AAStB,MAAM,OAAO,oBAAqB,SAAQ,UAAU,CAAC,aAAa;IAIhE;;;OAGG;IACH,YAAY,OAA4C;;QACtD,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAuC;YACnD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,mCAAmC,CAAC;QAC3D,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EACN,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,+BAA+B,GACzE,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAE3B,0CAA0C;QAC1C,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,+BAA+B,CAAC;QAC9D,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,IAAI,qBAAqB,C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ed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport {\n DigitalTwinModelsImpl,\n QueryImpl,\n DigitalTwinsImpl,\n EventRoutesImpl\n} from \"./operations\";\nimport {\n DigitalTwinModels,\n Query,\n DigitalTwins,\n EventRoutes\n} from \"./operationsInterfaces\";\nimport { AzureDigitalTwinsAPIOptionalParams } from \"./models\";\n\nexport class AzureDigitalTwinsAPI extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the AzureDigitalTwinsAPI class.\n * @param options The parameter options\n */\n constructor(options?: AzureDigitalTwinsAPIOptionalParams) {\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: AzureDigitalTwinsAPIOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-digital-twins-core/2.0.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://digitaltwins-hostname\"\n };\n super(optionsWithDefaults);\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://digitaltwins-hostname\";\n this.apiVersion = options.apiVersion || \"2020-10-31\";\n this.digitalTwinModels = new DigitalTwinModelsImpl(this);\n this.query = new QueryImpl(this);\n this.digitalTwins = new DigitalTwinsImpl(this);\n this.eventRoutes = new EventRoutesImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n digitalTwinModels: DigitalTwinModels;\n query: Query;\n digitalTwins: DigitalTwins;\n eventRoutes: EventRoutes;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference lib="esnext.asynciterable" />
|
|
9
|
+
export { getContinuationToken } from "./pagingHelper";
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export { AzureDigitalTwinsAPI } from "./azureDigitalTwinsAPI";
|
|
12
|
+
export * from "./operationsInterfaces";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4CAA4C;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,cAAc,wBAAwB,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\n/// <reference lib=\"esnext.asynciterable\" />\nexport { getContinuationToken } from \"./pagingHelper\";\nexport * from \"./models\";\nexport { AzureDigitalTwinsAPI } from \"./azureDigitalTwinsAPI\";\nexport * from \"./operationsInterfaces\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreHttp from \"@azure/core-http\";\n\n/**\n * A model definition and metadata for that model.\n */\nexport interface DigitalTwinsModelData {\n /**\n * A language map that contains the localized display names as specified in the model definition.\n */\n displayName?: { [propertyName: string]: string };\n /**\n * A language map that contains the localized descriptions as specified in the model definition.\n */\n description?: { [propertyName: string]: string };\n /**\n * The id of the model as specified in the model definition.\n */\n id: string;\n /**\n * The time the model was uploaded to the service.\n */\n uploadTime?: Date;\n /**\n * Indicates if the model is decommissioned. Decommissioned models cannot be referenced by newly created digital twins.\n */\n decommissioned?: boolean;\n /**\n * The model definition.\n */\n model?: any;\n}\n\n/**\n * Error response.\n */\nexport interface ErrorResponse {\n /**\n * The error details.\n */\n error?: ErrorModel;\n}\n\n/**\n * Error definition.\n */\nexport interface ErrorModel {\n /**\n * Service specific error code which serves as the substatus for the HTTP error code.\n */\n readonly code?: string;\n /**\n * A human-readable representation of the error.\n */\n readonly message?: string;\n /**\n * Internal error details.\n */\n readonly details?: ErrorModel[];\n /**\n * An object containing more specific information than the current object about the error.\n */\n innererror?: InnerError;\n}\n\n/**\n * A more specific error description than was provided by the containing error.\n */\nexport interface InnerError {\n /**\n * A more specific error code than was provided by the containing error.\n */\n code?: string;\n /**\n * An object containing more specific information than the current object about the error.\n */\n innererror?: InnerError;\n}\n\n/**\n * A collection of DigitalTwinsModelData objects.\n */\nexport interface PagedDigitalTwinsModelDataCollection {\n /**\n * The DigitalTwinsModelData objects.\n */\n value?: DigitalTwinsModelData[];\n /**\n * A URI to retrieve the next page of objects.\n */\n nextLink?: string;\n}\n\n/**\n * A query specification containing either a query statement or a continuation token from a previous query result.\n */\nexport interface QuerySpecification {\n /**\n * The query to execute. This value is ignored if a continuation token is provided.\n */\n query?: string;\n /**\n * A token which is used to retrieve the next set of results from a previous query.\n */\n continuationToken?: string;\n}\n\n/**\n * The results of a query operation and an optional continuation token.\n */\nexport interface QueryResult {\n /**\n * The query results.\n */\n value?: any[];\n /**\n * A token which can be used to construct a new QuerySpecification to retrieve the next set of results.\n */\n continuationToken?: string;\n}\n\n/**\n * A collection of relationships which relate digital twins together.\n */\nexport interface RelationshipCollection {\n /**\n * The relationship objects.\n */\n value?: any[];\n /**\n * A URI to retrieve the next page of objects.\n */\n nextLink?: string;\n}\n\n/**\n * A collection of incoming relationships which relate digital twins together.\n */\nexport interface IncomingRelationshipCollection {\n value?: IncomingRelationship[];\n /**\n * A URI to retrieve the next page of objects.\n */\n nextLink?: string;\n}\n\n/**\n * An incoming relationship.\n */\nexport interface IncomingRelationship {\n /**\n * A user-provided string representing the id of this relationship, unique in the context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service.\n */\n relationshipId?: string;\n /**\n * The id of the source digital twin.\n */\n sourceId?: string;\n /**\n * The name of the relationship.\n */\n relationshipName?: string;\n /**\n * Link to the relationship, to be used for deletion.\n */\n relationshipLink?: string;\n}\n\n/**\n * A collection of EventRoute objects.\n */\nexport interface EventRouteCollection {\n /**\n * The EventRoute objects.\n */\n value?: EventRoute[];\n /**\n * A URI to retrieve the next page of results.\n */\n nextLink?: string;\n}\n\n/**\n * A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.\n */\nexport interface EventRoute {\n /**\n * The id of the event route.\n */\n readonly id?: string;\n /**\n * The name of the endpoint this event route is bound to.\n */\n endpointName: string;\n /**\n * An expression which describes the events which are routed to the endpoint.\n */\n filter: string;\n}\n\n/**\n * Defines headers for Query_queryTwins operation.\n */\nexport interface QueryQueryTwinsHeaders {\n /**\n * The query charge.\n */\n queryCharge?: number;\n}\n\n/**\n * Defines headers for DigitalTwins_getById operation.\n */\nexport interface DigitalTwinsGetByIdHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_add operation.\n */\nexport interface DigitalTwinsAddHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_update operation.\n */\nexport interface DigitalTwinsUpdateHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_getRelationshipById operation.\n */\nexport interface DigitalTwinsGetRelationshipByIdHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_addRelationship operation.\n */\nexport interface DigitalTwinsAddRelationshipHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_updateRelationship operation.\n */\nexport interface DigitalTwinsUpdateRelationshipHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_getComponent operation.\n */\nexport interface DigitalTwinsGetComponentHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Defines headers for DigitalTwins_updateComponent operation.\n */\nexport interface DigitalTwinsUpdateComponentHeaders {\n /**\n * Weak Etag.\n */\n etag?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsAddOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * An array of models to add.\n */\n models?: any[];\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the add operation.\n */\nexport type DigitalTwinModelsAddResponse = DigitalTwinsModelData[] & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: DigitalTwinsModelData[];\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsListOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved.\n */\n dependenciesFor?: string[];\n /**\n * When true the model definition will be returned as part of the result.\n */\n includeModelDefinition?: boolean;\n /**\n * The maximum number of items to retrieve per request. The server may choose to return less than the requested number.\n */\n maxItemsPerPage?: number;\n}\n\n/**\n * Contains response data for the list operation.\n */\nexport type DigitalTwinModelsListResponse = PagedDigitalTwinsModelDataCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: PagedDigitalTwinsModelDataCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsGetByIdOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * When true the model definition will be returned as part of the result.\n */\n includeModelDefinition?: boolean;\n}\n\n/**\n * Contains response data for the getById operation.\n */\nexport type DigitalTwinModelsGetByIdResponse = DigitalTwinsModelData & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: DigitalTwinsModelData;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsUpdateOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsDeleteOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinModelsListNextOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved.\n */\n dependenciesFor?: string[];\n /**\n * When true the model definition will be returned as part of the result.\n */\n includeModelDefinition?: boolean;\n /**\n * The maximum number of items to retrieve per request. The server may choose to return less than the requested number.\n */\n maxItemsPerPage?: number;\n}\n\n/**\n * Contains response data for the listNext operation.\n */\nexport type DigitalTwinModelsListNextResponse = PagedDigitalTwinsModelDataCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: PagedDigitalTwinsModelDataCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface QueryQueryTwinsOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The maximum number of items to retrieve per request. The server may choose to return less than the requested number.\n */\n maxItemsPerPage?: number;\n}\n\n/**\n * Contains response data for the queryTwins operation.\n */\nexport type QueryQueryTwinsResponse = QueryQueryTwinsHeaders &\n QueryResult & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: QueryResult;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: QueryQueryTwinsHeaders;\n };\n };\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsGetByIdOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the getById operation.\n */\nexport type DigitalTwinsGetByIdResponse = DigitalTwinsGetByIdHeaders & {\n /**\n * The parsed response body.\n */\n body: any;\n\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: any;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsGetByIdHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsAddOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity does not already exist.\n */\n ifNoneMatch?: string;\n}\n\n/**\n * Contains response data for the add operation.\n */\nexport type DigitalTwinsAddResponse = DigitalTwinsAddHeaders & {\n /**\n * The parsed response body.\n */\n body: any;\n\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: any;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsAddHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsDeleteOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n ifMatch?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsUpdateOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n ifMatch?: string;\n}\n\n/**\n * Contains response data for the update operation.\n */\nexport type DigitalTwinsUpdateResponse = DigitalTwinsUpdateHeaders & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsUpdateHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsGetRelationshipByIdOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the getRelationshipById operation.\n */\nexport type DigitalTwinsGetRelationshipByIdResponse = DigitalTwinsGetRelationshipByIdHeaders & {\n /**\n * The parsed response body.\n */\n body: any;\n\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: any;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsGetRelationshipByIdHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsAddRelationshipOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity does not already exist.\n */\n ifNoneMatch?: string;\n}\n\n/**\n * Contains response data for the addRelationship operation.\n */\nexport type DigitalTwinsAddRelationshipResponse = DigitalTwinsAddRelationshipHeaders & {\n /**\n * The parsed response body.\n */\n body: any;\n\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: any;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsAddRelationshipHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsDeleteRelationshipOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n ifMatch?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsUpdateRelationshipOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n ifMatch?: string;\n}\n\n/**\n * Contains response data for the updateRelationship operation.\n */\nexport type DigitalTwinsUpdateRelationshipResponse = DigitalTwinsUpdateRelationshipHeaders & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsUpdateRelationshipHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsListRelationshipsOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The name of the relationship.\n */\n relationshipName?: string;\n}\n\n/**\n * Contains response data for the listRelationships operation.\n */\nexport type DigitalTwinsListRelationshipsResponse = RelationshipCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: RelationshipCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsListIncomingRelationshipsOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the listIncomingRelationships operation.\n */\nexport type DigitalTwinsListIncomingRelationshipsResponse = IncomingRelationshipCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: IncomingRelationshipCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsSendTelemetryOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * An RFC 3339 timestamp that identifies the time the telemetry was measured.\n */\n telemetrySourceTime?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsSendComponentTelemetryOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * An RFC 3339 timestamp that identifies the time the telemetry was measured.\n */\n telemetrySourceTime?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsGetComponentOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the getComponent operation.\n */\nexport type DigitalTwinsGetComponentResponse = DigitalTwinsGetComponentHeaders & {\n /**\n * The parsed response body.\n */\n body: any;\n\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: any;\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsGetComponentHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsUpdateComponentOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * Only perform the operation if the entity's etag matches one of the etags provided or * is provided.\n */\n ifMatch?: string;\n}\n\n/**\n * Contains response data for the updateComponent operation.\n */\nexport type DigitalTwinsUpdateComponentResponse = DigitalTwinsUpdateComponentHeaders & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The parsed HTTP response headers.\n */\n parsedHeaders: DigitalTwinsUpdateComponentHeaders;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsListRelationshipsNextOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The name of the relationship.\n */\n relationshipName?: string;\n}\n\n/**\n * Contains response data for the listRelationshipsNext operation.\n */\nexport type DigitalTwinsListRelationshipsNextResponse = RelationshipCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: RelationshipCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface DigitalTwinsListIncomingRelationshipsNextOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the listIncomingRelationshipsNext operation.\n */\nexport type DigitalTwinsListIncomingRelationshipsNextResponse = IncomingRelationshipCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: IncomingRelationshipCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface EventRoutesListOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The maximum number of items to retrieve per request. The server may choose to return less than the requested number.\n */\n maxItemsPerPage?: number;\n}\n\n/**\n * Contains response data for the list operation.\n */\nexport type EventRoutesListResponse = EventRouteCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: EventRouteCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface EventRoutesGetByIdOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Contains response data for the getById operation.\n */\nexport type EventRoutesGetByIdResponse = EventRoute & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: EventRoute;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface EventRoutesAddOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The event route data\n */\n eventRoute?: EventRoute;\n}\n\n/**\n * Optional parameters.\n */\nexport interface EventRoutesDeleteOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n}\n\n/**\n * Optional parameters.\n */\nexport interface EventRoutesListNextOptionalParams\n extends coreHttp.OperationOptions {\n /**\n * Identifies the request in a distributed tracing system.\n */\n traceparent?: string;\n /**\n * Provides vendor-specific trace identification information and is a companion to traceparent.\n */\n tracestate?: string;\n /**\n * The maximum number of items to retrieve per request. The server may choose to return less than the requested number.\n */\n maxItemsPerPage?: number;\n}\n\n/**\n * Contains response data for the listNext operation.\n */\nexport type EventRoutesListNextResponse = EventRouteCollection & {\n /**\n * The underlying HTTP response.\n */\n _response: coreHttp.HttpResponse & {\n /**\n * The response body as text (string format)\n */\n bodyAsText: string;\n\n /**\n * The response body as parsed JSON or XML\n */\n parsedBody: EventRouteCollection;\n };\n};\n\n/**\n * Optional parameters.\n */\nexport interface AzureDigitalTwinsAPIOptionalParams\n extends coreHttp.ServiceClientOptions {\n /**\n * server parameter\n */\n $host?: string;\n /**\n * Api Version\n */\n apiVersion?: string;\n /**\n * Overrides client endpoint.\n */\n endpoint?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\n\n/** A model definition and metadata for that model. */\nexport interface DigitalTwinsModelData {\n /** A language map that contains the localized display names as specified in the model definition. */\n displayName?: { [propertyName: string]: string };\n /** A language map that contains the localized descriptions as specified in the model definition. */\n description?: { [propertyName: string]: string };\n /** The id of the model as specified in the model definition. */\n id: string;\n /** The time the model was uploaded to the service. */\n uploadTime?: Date;\n /** Indicates if the model is decommissioned. Decommissioned models cannot be referenced by newly created digital twins. */\n decommissioned?: boolean;\n /** The model definition. */\n model?: Record<string, unknown>;\n}\n\n/** Error response. */\nexport interface ErrorResponse {\n /** The error details. */\n error?: ErrorModel;\n}\n\n/** Error definition. */\nexport interface ErrorModel {\n /**\n * Service specific error code which serves as the substatus for the HTTP error code.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly code?: string;\n /**\n * A human-readable representation of the error.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly message?: string;\n /**\n * Internal error details.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly details?: ErrorModel[];\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** A more specific error description than was provided by the containing error. */\nexport interface InnerError {\n /** A more specific error code than was provided by the containing error. */\n code?: string;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** A collection of DigitalTwinsModelData objects. */\nexport interface PagedDigitalTwinsModelDataCollection {\n /** The DigitalTwinsModelData objects. */\n value?: DigitalTwinsModelData[];\n /** A URI to retrieve the next page of objects. */\n nextLink?: string;\n}\n\n/** A query specification containing either a query statement or a continuation token from a previous query result. */\nexport interface QuerySpecification {\n /** The query to execute. This value is ignored if a continuation token is provided. */\n query?: string;\n /** A token which is used to retrieve the next set of results from a previous query. */\n continuationToken?: string;\n}\n\n/** The results of a query operation and an optional continuation token. */\nexport interface QueryResult {\n /** The query results. */\n value?: Record<string, unknown>[];\n /** A token which can be used to construct a new QuerySpecification to retrieve the next set of results. */\n continuationToken?: string;\n}\n\n/** A collection of relationships which relate digital twins together. */\nexport interface RelationshipCollection {\n /** The relationship objects. */\n value?: Record<string, unknown>[];\n /** A URI to retrieve the next page of objects. */\n nextLink?: string;\n}\n\n/** A collection of incoming relationships which relate digital twins together. */\nexport interface IncomingRelationshipCollection {\n value?: IncomingRelationship[];\n /** A URI to retrieve the next page of objects. */\n nextLink?: string;\n}\n\n/** An incoming relationship. */\nexport interface IncomingRelationship {\n /** A user-provided string representing the id of this relationship, unique in the context of the source digital twin, i.e. sourceId + relationshipId is unique in the context of the service. */\n relationshipId?: string;\n /** The id of the source digital twin. */\n sourceId?: string;\n /** The name of the relationship. */\n relationshipName?: string;\n /** Link to the relationship, to be used for deletion. */\n relationshipLink?: string;\n}\n\n/** A collection of EventRoute objects. */\nexport interface EventRouteCollection {\n /** The EventRoute objects. */\n value?: EventRoute[];\n /** A URI to retrieve the next page of results. */\n nextLink?: string;\n}\n\n/** A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub. */\nexport interface EventRoute {\n /**\n * The id of the event route.\n * NOTE: This property will not be serialized. It can only be populated by the server.\n */\n readonly id?: string;\n /** The name of the endpoint this event route is bound to. */\n endpointName: string;\n /** An expression which describes the events which are routed to the endpoint. */\n filter: string;\n}\n\n/** Defines headers for Query_queryTwins operation. */\nexport interface QueryQueryTwinsHeaders {\n /** The query charge. */\n queryCharge?: number;\n}\n\n/** Defines headers for DigitalTwins_getById operation. */\nexport interface DigitalTwinsGetByIdHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_add operation. */\nexport interface DigitalTwinsAddHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_update operation. */\nexport interface DigitalTwinsUpdateHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_getRelationshipById operation. */\nexport interface DigitalTwinsGetRelationshipByIdHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_addRelationship operation. */\nexport interface DigitalTwinsAddRelationshipHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_updateRelationship operation. */\nexport interface DigitalTwinsUpdateRelationshipHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_getComponent operation. */\nexport interface DigitalTwinsGetComponentHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Defines headers for DigitalTwins_updateComponent operation. */\nexport interface DigitalTwinsUpdateComponentHeaders {\n /** Weak Etag. */\n etag?: string;\n}\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsAddOptionalParams\n extends coreClient.OperationOptions {\n /** An array of models to add. */\n models?: Record<string, unknown>[];\n}\n\n/** Contains response data for the add operation. */\nexport type DigitalTwinModelsAddResponse = DigitalTwinsModelData[];\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsListOptionalParams\n extends coreClient.OperationOptions {\n /** The set of the models which will have their dependencies retrieved. If omitted, all models are retrieved. */\n dependenciesFor?: string[];\n /** When true the model definition will be returned as part of the result. */\n includeModelDefinition?: boolean;\n /** The maximum number of items to retrieve per request. The server may choose to return less than the requested number. */\n resultsPerPage?: number;\n}\n\n/** Contains response data for the list operation. */\nexport type DigitalTwinModelsListResponse = PagedDigitalTwinsModelDataCollection;\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsGetByIdOptionalParams\n extends coreClient.OperationOptions {\n /** When true the model definition will be returned as part of the result. */\n includeModelDefinition?: boolean;\n}\n\n/** Contains response data for the getById operation. */\nexport type DigitalTwinModelsGetByIdResponse = DigitalTwinsModelData;\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsUpdateOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsDeleteOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface DigitalTwinModelsListNextOptionalParams\n extends coreClient.OperationOptions {\n /** The maximum number of items to retrieve per request. The server may choose to return less than the requested number. */\n resultsPerPage?: number;\n}\n\n/** Contains response data for the listNext operation. */\nexport type DigitalTwinModelsListNextResponse = PagedDigitalTwinsModelDataCollection;\n\n/** Optional parameters. */\nexport interface QueryQueryTwinsOptionalParams\n extends coreClient.OperationOptions {\n /** The maximum number of items to retrieve per request. The server may choose to return less than the requested number. */\n resultsPerPage?: number;\n}\n\n/** Contains response data for the queryTwins operation. */\nexport type QueryQueryTwinsResponse = QueryQueryTwinsHeaders & QueryResult;\n\n/** Optional parameters. */\nexport interface DigitalTwinsGetByIdOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getById operation. */\nexport type DigitalTwinsGetByIdResponse = DigitalTwinsGetByIdHeaders &\n Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface DigitalTwinsAddOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity does not already exist. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the add operation. */\nexport type DigitalTwinsAddResponse = DigitalTwinsAddHeaders &\n Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface DigitalTwinsDeleteOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity's etag matches one of the etags provided or * is provided. */\n ifMatch?: string;\n}\n\n/** Optional parameters. */\nexport interface DigitalTwinsUpdateOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity's etag matches one of the etags provided or * is provided. */\n ifMatch?: string;\n}\n\n/** Contains response data for the update operation. */\nexport type DigitalTwinsUpdateResponse = DigitalTwinsUpdateHeaders;\n\n/** Optional parameters. */\nexport interface DigitalTwinsGetRelationshipByIdOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getRelationshipById operation. */\nexport type DigitalTwinsGetRelationshipByIdResponse = DigitalTwinsGetRelationshipByIdHeaders &\n Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface DigitalTwinsAddRelationshipOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity does not already exist. */\n ifNoneMatch?: string;\n}\n\n/** Contains response data for the addRelationship operation. */\nexport type DigitalTwinsAddRelationshipResponse = DigitalTwinsAddRelationshipHeaders &\n Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface DigitalTwinsDeleteRelationshipOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity's etag matches one of the etags provided or * is provided. */\n ifMatch?: string;\n}\n\n/** Optional parameters. */\nexport interface DigitalTwinsUpdateRelationshipOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity's etag matches one of the etags provided or * is provided. */\n ifMatch?: string;\n}\n\n/** Contains response data for the updateRelationship operation. */\nexport type DigitalTwinsUpdateRelationshipResponse = DigitalTwinsUpdateRelationshipHeaders;\n\n/** Optional parameters. */\nexport interface DigitalTwinsListRelationshipsOptionalParams\n extends coreClient.OperationOptions {\n /** The name of the relationship. */\n relationshipName?: string;\n}\n\n/** Contains response data for the listRelationships operation. */\nexport type DigitalTwinsListRelationshipsResponse = RelationshipCollection;\n\n/** Optional parameters. */\nexport interface DigitalTwinsListIncomingRelationshipsOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the listIncomingRelationships operation. */\nexport type DigitalTwinsListIncomingRelationshipsResponse = IncomingRelationshipCollection;\n\n/** Optional parameters. */\nexport interface DigitalTwinsSendTelemetryOptionalParams\n extends coreClient.OperationOptions {\n /** An RFC 3339 timestamp that identifies the time the telemetry was measured. */\n telemetrySourceTime?: string;\n}\n\n/** Optional parameters. */\nexport interface DigitalTwinsSendComponentTelemetryOptionalParams\n extends coreClient.OperationOptions {\n /** An RFC 3339 timestamp that identifies the time the telemetry was measured. */\n telemetrySourceTime?: string;\n}\n\n/** Optional parameters. */\nexport interface DigitalTwinsGetComponentOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getComponent operation. */\nexport type DigitalTwinsGetComponentResponse = DigitalTwinsGetComponentHeaders &\n Record<string, unknown>;\n\n/** Optional parameters. */\nexport interface DigitalTwinsUpdateComponentOptionalParams\n extends coreClient.OperationOptions {\n /** Only perform the operation if the entity's etag matches one of the etags provided or * is provided. */\n ifMatch?: string;\n}\n\n/** Contains response data for the updateComponent operation. */\nexport type DigitalTwinsUpdateComponentResponse = DigitalTwinsUpdateComponentHeaders;\n\n/** Optional parameters. */\nexport interface DigitalTwinsListRelationshipsNextOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the listRelationshipsNext operation. */\nexport type DigitalTwinsListRelationshipsNextResponse = RelationshipCollection;\n\n/** Optional parameters. */\nexport interface DigitalTwinsListIncomingRelationshipsNextOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the listIncomingRelationshipsNext operation. */\nexport type DigitalTwinsListIncomingRelationshipsNextResponse = IncomingRelationshipCollection;\n\n/** Optional parameters. */\nexport interface EventRoutesListOptionalParams\n extends coreClient.OperationOptions {\n /** The maximum number of items to retrieve per request. The server may choose to return less than the requested number. */\n resultsPerPage?: number;\n}\n\n/** Contains response data for the list operation. */\nexport type EventRoutesListResponse = EventRouteCollection;\n\n/** Optional parameters. */\nexport interface EventRoutesGetByIdOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Contains response data for the getById operation. */\nexport type EventRoutesGetByIdResponse = EventRoute;\n\n/** Optional parameters. */\nexport interface EventRoutesAddOptionalParams\n extends coreClient.OperationOptions {\n /** The event route data */\n eventRoute?: EventRoute;\n}\n\n/** Optional parameters. */\nexport interface EventRoutesDeleteOptionalParams\n extends coreClient.OperationOptions {}\n\n/** Optional parameters. */\nexport interface EventRoutesListNextOptionalParams\n extends coreClient.OperationOptions {\n /** The maximum number of items to retrieve per request. The server may choose to return less than the requested number. */\n resultsPerPage?: number;\n}\n\n/** Contains response data for the listNext operation. */\nexport type EventRoutesListNextResponse = EventRouteCollection;\n\n/** Optional parameters. */\nexport interface AzureDigitalTwinsAPIOptionalParams\n extends coreClient.ServiceClientOptions {\n /** server parameter */\n $host?: string;\n /** Api Version */\n apiVersion?: string;\n /** Overrides client endpoint. */\n endpoint?: string;\n}\n"]}
|
|
@@ -38,6 +38,7 @@ export const DigitalTwinsModelData = {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
decommissioned: {
|
|
41
|
+
defaultValue: false,
|
|
41
42
|
serializedName: "decommissioned",
|
|
42
43
|
type: {
|
|
43
44
|
name: "Boolean"
|
|
@@ -46,7 +47,8 @@ export const DigitalTwinsModelData = {
|
|
|
46
47
|
model: {
|
|
47
48
|
serializedName: "model",
|
|
48
49
|
type: {
|
|
49
|
-
name: "
|
|
50
|
+
name: "Dictionary",
|
|
51
|
+
value: { type: { name: "any" } }
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -91,7 +93,12 @@ export const ErrorModel = {
|
|
|
91
93
|
readOnly: true,
|
|
92
94
|
type: {
|
|
93
95
|
name: "Sequence",
|
|
94
|
-
element: {
|
|
96
|
+
element: {
|
|
97
|
+
type: {
|
|
98
|
+
name: "Composite",
|
|
99
|
+
className: "ErrorModel"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
95
102
|
}
|
|
96
103
|
},
|
|
97
104
|
innererror: {
|
|
@@ -135,7 +142,10 @@ export const PagedDigitalTwinsModelDataCollection = {
|
|
|
135
142
|
type: {
|
|
136
143
|
name: "Sequence",
|
|
137
144
|
element: {
|
|
138
|
-
type: {
|
|
145
|
+
type: {
|
|
146
|
+
name: "Composite",
|
|
147
|
+
className: "DigitalTwinsModelData"
|
|
148
|
+
}
|
|
139
149
|
}
|
|
140
150
|
}
|
|
141
151
|
},
|
|
@@ -177,7 +187,12 @@ export const QueryResult = {
|
|
|
177
187
|
serializedName: "value",
|
|
178
188
|
type: {
|
|
179
189
|
name: "Sequence",
|
|
180
|
-
element: {
|
|
190
|
+
element: {
|
|
191
|
+
type: {
|
|
192
|
+
name: "Dictionary",
|
|
193
|
+
value: { type: { name: "any" } }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
181
196
|
}
|
|
182
197
|
},
|
|
183
198
|
continuationToken: {
|
|
@@ -198,7 +213,12 @@ export const RelationshipCollection = {
|
|
|
198
213
|
serializedName: "value",
|
|
199
214
|
type: {
|
|
200
215
|
name: "Sequence",
|
|
201
|
-
element: {
|
|
216
|
+
element: {
|
|
217
|
+
type: {
|
|
218
|
+
name: "Dictionary",
|
|
219
|
+
value: { type: { name: "any" } }
|
|
220
|
+
}
|
|
221
|
+
}
|
|
202
222
|
}
|
|
203
223
|
},
|
|
204
224
|
nextLink: {
|
|
@@ -220,7 +240,10 @@ export const IncomingRelationshipCollection = {
|
|
|
220
240
|
type: {
|
|
221
241
|
name: "Sequence",
|
|
222
242
|
element: {
|
|
223
|
-
type: {
|
|
243
|
+
type: {
|
|
244
|
+
name: "Composite",
|
|
245
|
+
className: "IncomingRelationship"
|
|
246
|
+
}
|
|
224
247
|
}
|
|
225
248
|
}
|
|
226
249
|
},
|
|
@@ -274,7 +297,12 @@ export const EventRouteCollection = {
|
|
|
274
297
|
serializedName: "value",
|
|
275
298
|
type: {
|
|
276
299
|
name: "Sequence",
|
|
277
|
-
element: {
|
|
300
|
+
element: {
|
|
301
|
+
type: {
|
|
302
|
+
name: "Composite",
|
|
303
|
+
className: "EventRoute"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
278
306
|
}
|
|
279
307
|
},
|
|
280
308
|
nextLink: {
|