UNPKG

@wildboar/copp

Version:

Connection-oriented presentation protocol (COPP) data structures and business logic in TypeScript

196 lines 12.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_ARU_PPDU_x400_mode_parameters = exports._decode_ARU_PPDU_x400_mode_parameters = exports._extension_additions_list_spec_for_ARU_PPDU_x400_mode_parameters = exports._root_component_type_list_2_spec_for_ARU_PPDU_x400_mode_parameters = exports._root_component_type_list_1_spec_for_ARU_PPDU_x400_mode_parameters = exports.ARU_PPDU_x400_mode_parameters = exports._encode_AbortReason = exports._decode_AbortReason = exports.transferCompleted = exports.AbortReason_transferCompleted = exports.userError = exports.AbortReason_userError = exports.permanentProblem = exports.AbortReason_permanentProblem = exports.protocolError = exports.AbortReason_protocolError = exports.temporaryProblem = exports.AbortReason_temporaryProblem = exports.unrecognizedActivity = exports.AbortReason_unrecognizedActivity = exports.invalidParameter = exports.AbortReason_invalidParameter = exports.localSystemProblem = exports.AbortReason_localSystemProblem = exports._encode_RTABapdu = exports._decode_RTABapdu = exports.RTABapdu = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); var RTABapdu_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/RTABapdu.ta"); Object.defineProperty(exports, "RTABapdu", { enumerable: true, get: function () { return RTABapdu_ta_1.RTABapdu; } }); Object.defineProperty(exports, "_decode_RTABapdu", { enumerable: true, get: function () { return RTABapdu_ta_1._decode_RTABapdu; } }); Object.defineProperty(exports, "_encode_RTABapdu", { enumerable: true, get: function () { return RTABapdu_ta_1._encode_RTABapdu; } }); const AbortReason_ta_1 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/AbortReason.ta"); var AbortReason_ta_2 = require("@wildboar/rtse/src/lib/modules/Reliable-Transfer-APDU/AbortReason.ta"); Object.defineProperty(exports, "AbortReason_localSystemProblem", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_localSystemProblem; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "localSystemProblem", { enumerable: true, get: function () { return AbortReason_ta_2.localSystemProblem; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_invalidParameter", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_invalidParameter; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "invalidParameter", { enumerable: true, get: function () { return AbortReason_ta_2.invalidParameter; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_unrecognizedActivity", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_unrecognizedActivity; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "unrecognizedActivity", { enumerable: true, get: function () { return AbortReason_ta_2.unrecognizedActivity; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_temporaryProblem", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_temporaryProblem; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "temporaryProblem", { enumerable: true, get: function () { return AbortReason_ta_2.temporaryProblem; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_protocolError", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_protocolError; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "protocolError", { enumerable: true, get: function () { return AbortReason_ta_2.protocolError; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_permanentProblem", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_permanentProblem; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "permanentProblem", { enumerable: true, get: function () { return AbortReason_ta_2.permanentProblem; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_userError", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_userError; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "userError", { enumerable: true, get: function () { return AbortReason_ta_2.userError; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "AbortReason_transferCompleted", { enumerable: true, get: function () { return AbortReason_ta_2.AbortReason_transferCompleted; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "transferCompleted", { enumerable: true, get: function () { return AbortReason_ta_2.transferCompleted; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "_decode_AbortReason", { enumerable: true, get: function () { return AbortReason_ta_2._decode_AbortReason; } }); Object.defineProperty(exports, "_encode_AbortReason", { enumerable: true, get: function () { return AbortReason_ta_2._encode_AbortReason; } }); /* START_OF_SYMBOL_DEFINITION ARU_PPDU_x400_mode_parameters */ /** * @summary ARU_PPDU_x400_mode_parameters * @description * * ### ASN.1 Definition: * * ```asn1 * ARU-PPDU-x400-mode-parameters ::= SEQUENCE { -- REMOVED_FROM_UNNESTING -- } * ``` * * @class */ class ARU_PPDU_x400_mode_parameters { constructor( /** * @summary `abortReason`. * @public * @readonly */ abortReason /* REPLICATED_COMPONENT */, /** * @summary `reflectedParameter`. * @public * @readonly */ reflectedParameter /* REPLICATED_COMPONENT */, /** * @summary `userdataAB`. * @public * @readonly */ userdataAB /* REPLICATED_COMPONENT */) { this.abortReason = abortReason; this.reflectedParameter = reflectedParameter; this.userdataAB = userdataAB; } /** * @summary Restructures an object into a ARU_PPDU_x400_mode_parameters * @description * * This takes an `object` and converts it to a `ARU_PPDU_x400_mode_parameters`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `ARU_PPDU_x400_mode_parameters`. * @returns {ARU_PPDU_x400_mode_parameters} */ static _from_object(_o) { return new ARU_PPDU_x400_mode_parameters(_o.abortReason, _o.reflectedParameter, _o.userdataAB); } } exports.ARU_PPDU_x400_mode_parameters = ARU_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_ARU_PPDU_x400_mode_parameters */ /** * @summary The Leading Root Component Types of ARU_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_1_spec_for_ARU_PPDU_x400_mode_parameters = [ new $.ComponentSpec('abortReason', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 0), undefined, undefined), new $.ComponentSpec('reflectedParameter', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 1), undefined, undefined), new $.ComponentSpec('userdataAB', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 2), undefined, undefined), ]; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_ARU_PPDU_x400_mode_parameters */ /** * @summary The Trailing Root Component Types of ARU_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE. * * @constant */ exports._root_component_type_list_2_spec_for_ARU_PPDU_x400_mode_parameters = []; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_ARU_PPDU_x400_mode_parameters */ /** * @summary The Extension Addition Component Types of ARU_PPDU_x400_mode_parameters * @description * * This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE. * * @constant */ exports._extension_additions_list_spec_for_ARU_PPDU_x400_mode_parameters = []; /* END_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_ARU_PPDU_x400_mode_parameters */ let _cached_decoder_for_ARU_PPDU_x400_mode_parameters = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _decode_ARU_PPDU_x400_mode_parameters */ /** * @summary Decodes an ASN.1 element into a(n) ARU_PPDU_x400_mode_parameters * @function * @param {_Element} el The element being decoded. * @returns {ARU_PPDU_x400_mode_parameters} The decoded data structure. */ function _decode_ARU_PPDU_x400_mode_parameters(el) { if (!_cached_decoder_for_ARU_PPDU_x400_mode_parameters) { _cached_decoder_for_ARU_PPDU_x400_mode_parameters = function (el) { /* START_OF_SET_COMPONENT_DECLARATIONS */ let abortReason; let reflectedParameter; let userdataAB; /* END_OF_SET_COMPONENT_DECLARATIONS */ /* START_OF_CALLBACKS_MAP */ const callbacks = { abortReason: (_el) => { abortReason = $._decode_implicit(() => AbortReason_ta_1._decode_AbortReason)(_el); }, reflectedParameter: (_el) => { reflectedParameter = $._decode_implicit(() => $._decodeBitString)(_el); }, userdataAB: (_el) => { userdataAB = $._decode_explicit(() => $._decodeAny)(_el); }, }; /* END_OF_CALLBACKS_MAP */ $._parse_set(el, callbacks, exports._root_component_type_list_1_spec_for_ARU_PPDU_x400_mode_parameters, exports._extension_additions_list_spec_for_ARU_PPDU_x400_mode_parameters, exports._root_component_type_list_2_spec_for_ARU_PPDU_x400_mode_parameters, undefined); return new ARU_PPDU_x400_mode_parameters /* SET_CONSTRUCTOR_CALL */(abortReason, reflectedParameter, userdataAB); }; } return _cached_decoder_for_ARU_PPDU_x400_mode_parameters(el); } exports._decode_ARU_PPDU_x400_mode_parameters = _decode_ARU_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION _decode_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_ARU_PPDU_x400_mode_parameters */ let _cached_encoder_for_ARU_PPDU_x400_mode_parameters = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_ARU_PPDU_x400_mode_parameters */ /* START_OF_SYMBOL_DEFINITION _encode_ARU_PPDU_x400_mode_parameters */ /** * @summary Encodes a(n) ARU_PPDU_x400_mode_parameters into an ASN.1 Element. * @function * @param {value} el The element being decoded. * @param elGetter A function that can be used to get new ASN.1 elements. * @returns {_Element} The ARU_PPDU_x400_mode_parameters, encoded as an ASN.1 Element. */ function _encode_ARU_PPDU_x400_mode_parameters(value, elGetter) { if (!_cached_encoder_for_ARU_PPDU_x400_mode_parameters) { _cached_encoder_for_ARU_PPDU_x400_mode_parameters = function (value, elGetter) { return $._encodeSet([] .concat([ /* IF_ABSENT */ value.abortReason === undefined ? undefined : $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => AbortReason_ta_1._encode_AbortReason, $.BER)(value.abortReason, $.BER), /* IF_ABSENT */ value.reflectedParameter === undefined ? undefined : $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => $._encodeBitString, $.BER)(value.reflectedParameter, $.BER), /* IF_ABSENT */ value.userdataAB === undefined ? undefined : $._encode_explicit(asn1_ts_1.ASN1TagClass.context, 2, () => $._encodeAny, $.BER)(value.userdataAB, $.BER), ]) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_ARU_PPDU_x400_mode_parameters(value, elGetter); } exports._encode_ARU_PPDU_x400_mode_parameters = _encode_ARU_PPDU_x400_mode_parameters; /* END_OF_SYMBOL_DEFINITION _encode_ARU_PPDU_x400_mode_parameters */ /* eslint-enable */ //# sourceMappingURL=ARU-PPDU-x400-mode-parameters.ta.js.map