зеркало из
1
0
Форкнуть 0

chore: rename digital-twin-model-id to model-id in mqtt (#829)

This commit is contained in:
Jelani Brandon 2020-07-02 11:32:42 -07:00 коммит произвёл GitHub
Родитель c220a5999c
Коммит 857921ee6b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -229,7 +229,7 @@ The `reject` method is there for compatibility purposes with other transports bu
**SRS_NODE_DEVICE_MQTT_06_002: [** The authentication providers `setTokenRenewalValues` method shall be invoked with the values provided in the tokenRenewal option.
**]**
**SRS_NODE_DEVICE_MQTT_41_014: [** For a Plug and Play Device the modelId should be included as `&digital-twin-model-id=<DEVICEs MODEL ID>` after the api-version **]**
**SRS_NODE_DEVICE_MQTT_41_014: [** For a Plug and Play Device the modelId should be included as `&model-id=<DEVICEs MODEL ID>` after the api-version **]**
### onDeviceMethod(methodName, methodCallback)

Просмотреть файл

@ -535,9 +535,9 @@ export class Mqtt extends EventEmitter implements DeviceTransport {
/*Codes_SRS_NODE_DEVICE_MQTT_16_015: [The `setOptions` method shall throw an `ArgumentError` if the `cert` property is populated but the device uses symmetric key authentication.]*/
if (this._authenticationProvider.type === AuthenticationType.Token && options.cert) throw new errors.ArgumentError('Cannot set x509 options on a device that uses token authentication.');
/*Codes_SRS_NODE_DEVICE_MQTT_41_XXX: [The MQTT transport should ] */
/*Codes_SRS_NODE_DEVICE_MQTT_41_014: [For a Plug and Play Device the model id should be included as `&model-id=<DEVICEs MODEL ID>` after the api-version ] */
if (options.modelId) {
this._mid = '&digital-twin-model-id=' + options.modelId;
this._mid = '&model-id=' + options.modelId;
}
/*Codes_SRS_NODE_DEVICE_MQTT_41_001: [The MQTT transport should use the productInfo string in the `options` object if present]*/
if (options.productInfo) {
@ -741,7 +741,7 @@ export class Mqtt extends EventEmitter implements DeviceTransport {
/*Codes_SRS_NODE_DEVICE_MQTT_18_054: [If a `gatewayHostName` is specified in the connection string, the Mqtt constructor shall initialize the `uri` property of the `config` object to `mqtts://<gatewayhostname>`. ]*/
/*Codes_SRS_NODE_DEVICE_MQTT_18_055: [The Mqtt constructor shall initialize the `username` property of the `config` object to '<host>/<clientId>/api-version=<version>&DeviceClientType=<agentString>'. ]*/
/*Codes_SRS_NODE_DEVICE_MQTT_41_002: [The MQTT constructor shall append the productInfo to the `username` property of the `config` object.]*/
/*Codes_SRS_NODE_DEVICE_MQTT_41_014: [For a Plug and Play Device the modelId should be included as `&digital-twin-model-id=<DEVICEs MODEL ID>` after the api-version]*/
/*Codes_SRS_NODE_DEVICE_MQTT_41_014: [For a Plug and Play Device the modelId should be included as `&modelId=<DEVICEs MODEL ID>` after the api-version]*/
let baseConfig: MqttBaseTransportConfig = {
uri: 'mqtts://' + (credentials.gatewayHostName || credentials.host),
username: credentials.host + '/' + clientId +

Просмотреть файл

@ -634,10 +634,10 @@ describe('Mqtt', function () {
});
});
/* Tests_SRS_NODE_DEVICE_MQTT_41_014: [For a Plug and Play Device the modelId should be included as `&digital-twin-model-id=<DEVICEs MODEL ID>` after the api-version]*/
/* Tests_SRS_NODE_DEVICE_MQTT_41_015: [If a modelId is provided, the device should use the PnP API String] */
/* Tests_SRS_NODE_DEVICE_MQTT_41_014: [For a Plug and Play Device the modelId should be included as `&model-id=<DEVICEs MODEL ID>` after the api-version]*/
/* Tests_SRS_NODE_DEVICE_MQTT_41_015: [If a model id is provided, the device should use the PnP API String] */
it('sets options for modelId', function (testCallback) {
const fakeModelId = '&digital-twin-model-id=fakeModelId';
const fakeModelId = '&model-id=fakeModelId';
const fakeModel = { modelId: 'fakeModelId' };
let connectCallback;
fakeMqttBase.connect = sinon.stub().callsFake(function (config, callback) {