UNPKG

@wildboar/copp

Version:

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

197 lines 12.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._encode_Result_list_Item = exports._decode_Result_list_Item = exports._extension_additions_list_spec_for_Result_list_Item = exports._root_component_type_list_2_spec_for_Result_list_Item = exports._root_component_type_list_1_spec_for_Result_list_Item = exports.Result_list_Item = exports._encode_Result_list_Item_provider_reason = exports._decode_Result_list_Item_provider_reason = exports.local_limit_on_DCS_exceeded = exports.Result_list_Item_provider_reason_local_limit_on_DCS_exceeded = exports.proposed_transfer_syntaxes_not_supported = exports.Result_list_Item_provider_reason_proposed_transfer_syntaxes_not_supported = exports.abstract_syntax_not_supported = exports.Result_list_Item_provider_reason_abstract_syntax_not_supported = exports.reason_not_specified = exports.Result_list_Item_provider_reason_reason_not_specified = exports._encode_Transfer_syntax_name = exports._decode_Transfer_syntax_name = exports._encode_Result = exports._decode_Result = exports.provider_rejection = exports.Result_provider_rejection = exports.user_rejection = exports.Result_user_rejection = exports.acceptance = exports.Result_acceptance = void 0; /* eslint-disable */ const asn1_ts_1 = require("asn1-ts"); const $ = require("asn1-ts/dist/node/functional"); const Result_ta_1 = require("../ISO8823-PRESENTATION/Result.ta"); var Result_ta_2 = require("../ISO8823-PRESENTATION/Result.ta"); Object.defineProperty(exports, "Result_acceptance", { enumerable: true, get: function () { return Result_ta_2.Result_acceptance; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "acceptance", { enumerable: true, get: function () { return Result_ta_2.acceptance; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "Result_user_rejection", { enumerable: true, get: function () { return Result_ta_2.Result_user_rejection; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "user_rejection", { enumerable: true, get: function () { return Result_ta_2.user_rejection; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "Result_provider_rejection", { enumerable: true, get: function () { return Result_ta_2.Result_provider_rejection; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "provider_rejection", { enumerable: true, get: function () { return Result_ta_2.provider_rejection; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "_decode_Result", { enumerable: true, get: function () { return Result_ta_2._decode_Result; } }); Object.defineProperty(exports, "_encode_Result", { enumerable: true, get: function () { return Result_ta_2._encode_Result; } }); const Transfer_syntax_name_ta_1 = require("../ISO8823-PRESENTATION/Transfer-syntax-name.ta"); var Transfer_syntax_name_ta_2 = require("../ISO8823-PRESENTATION/Transfer-syntax-name.ta"); Object.defineProperty(exports, "_decode_Transfer_syntax_name", { enumerable: true, get: function () { return Transfer_syntax_name_ta_2._decode_Transfer_syntax_name; } }); Object.defineProperty(exports, "_encode_Transfer_syntax_name", { enumerable: true, get: function () { return Transfer_syntax_name_ta_2._encode_Transfer_syntax_name; } }); const Result_list_Item_provider_reason_ta_1 = require("../ISO8823-PRESENTATION/Result-list-Item-provider-reason.ta"); var Result_list_Item_provider_reason_ta_2 = require("../ISO8823-PRESENTATION/Result-list-Item-provider-reason.ta"); Object.defineProperty(exports, "Result_list_Item_provider_reason_reason_not_specified", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.Result_list_Item_provider_reason_reason_not_specified; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "reason_not_specified", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.reason_not_specified; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "Result_list_Item_provider_reason_abstract_syntax_not_supported", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.Result_list_Item_provider_reason_abstract_syntax_not_supported; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "abstract_syntax_not_supported", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.abstract_syntax_not_supported; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "Result_list_Item_provider_reason_proposed_transfer_syntaxes_not_supported", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.Result_list_Item_provider_reason_proposed_transfer_syntaxes_not_supported; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "proposed_transfer_syntaxes_not_supported", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.proposed_transfer_syntaxes_not_supported; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "Result_list_Item_provider_reason_local_limit_on_DCS_exceeded", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.Result_list_Item_provider_reason_local_limit_on_DCS_exceeded; } }); /* IMPORTED_LONG_NAMED_INTEGER */ Object.defineProperty(exports, "local_limit_on_DCS_exceeded", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2.local_limit_on_DCS_exceeded; } }); /* IMPORTED_SHORT_NAMED_INTEGER */ Object.defineProperty(exports, "_decode_Result_list_Item_provider_reason", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2._decode_Result_list_Item_provider_reason; } }); Object.defineProperty(exports, "_encode_Result_list_Item_provider_reason", { enumerable: true, get: function () { return Result_list_Item_provider_reason_ta_2._encode_Result_list_Item_provider_reason; } }); /* START_OF_SYMBOL_DEFINITION Result_list_Item */ /** * @summary Result_list_Item * @description * * ### ASN.1 Definition: * * ```asn1 * Result-list-Item ::= SEQUENCE { -- REMOVED_FROM_UNNESTING -- } * ``` * * @class */ class Result_list_Item { constructor( /** * @summary `result`. * @public * @readonly */ result, /** * @summary `transfer_syntax_name`. * @public * @readonly */ transfer_syntax_name, /** * @summary `provider_reason`. * @public * @readonly */ provider_reason) { this.result = result; this.transfer_syntax_name = transfer_syntax_name; this.provider_reason = provider_reason; } /** * @summary Restructures an object into a Result_list_Item * @description * * This takes an `object` and converts it to a `Result_list_Item`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `Result_list_Item`. * @returns {Result_list_Item} */ static _from_object(_o) { return new Result_list_Item(_o.result, _o.transfer_syntax_name, _o.provider_reason); } } exports.Result_list_Item = Result_list_Item; /* END_OF_SYMBOL_DEFINITION Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_Result_list_Item */ /** * @summary The Leading Root Component Types of Result_list_Item * @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_Result_list_Item = [ new $.ComponentSpec('result', false, $.hasTag(asn1_ts_1.ASN1TagClass.context, 0), undefined, undefined), new $.ComponentSpec('transfer-syntax-name', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 1), undefined, undefined), new $.ComponentSpec('provider-reason', true, $.hasTag(asn1_ts_1.ASN1TagClass.context, 2), undefined, undefined), ]; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_1_spec_for_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_Result_list_Item */ /** * @summary The Trailing Root Component Types of Result_list_Item * @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_Result_list_Item = []; /* END_OF_SYMBOL_DEFINITION _root_component_type_list_2_spec_for_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_Result_list_Item */ /** * @summary The Extension Addition Component Types of Result_list_Item * @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_Result_list_Item = []; /* END_OF_SYMBOL_DEFINITION _extension_additions_list_spec_for_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _cached_decoder_for_Result_list_Item */ let _cached_decoder_for_Result_list_Item = null; /* END_OF_SYMBOL_DEFINITION _cached_decoder_for_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _decode_Result_list_Item */ /** * @summary Decodes an ASN.1 element into a(n) Result_list_Item * @function * @param {_Element} el The element being decoded. * @returns {Result_list_Item} The decoded data structure. */ function _decode_Result_list_Item(el) { if (!_cached_decoder_for_Result_list_Item) { _cached_decoder_for_Result_list_Item = function (el) { /* START_OF_SEQUENCE_COMPONENT_DECLARATIONS */ let result; let transfer_syntax_name; let provider_reason; /* END_OF_SEQUENCE_COMPONENT_DECLARATIONS */ /* START_OF_CALLBACKS_MAP */ const callbacks = { result: (_el) => { result = $._decode_implicit(() => Result_ta_1._decode_Result)(_el); }, 'transfer-syntax-name': (_el) => { transfer_syntax_name = $._decode_implicit(() => Transfer_syntax_name_ta_1._decode_Transfer_syntax_name)(_el); }, 'provider-reason': (_el) => { provider_reason = $._decode_implicit(() => Result_list_Item_provider_reason_ta_1._decode_Result_list_Item_provider_reason)(_el); }, }; /* END_OF_CALLBACKS_MAP */ $._parse_sequence(el, callbacks, exports._root_component_type_list_1_spec_for_Result_list_Item, exports._extension_additions_list_spec_for_Result_list_Item, exports._root_component_type_list_2_spec_for_Result_list_Item, undefined); return new Result_list_Item /* SEQUENCE_CONSTRUCTOR_CALL */(result, transfer_syntax_name, provider_reason); }; } return _cached_decoder_for_Result_list_Item(el); } exports._decode_Result_list_Item = _decode_Result_list_Item; /* END_OF_SYMBOL_DEFINITION _decode_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _cached_encoder_for_Result_list_Item */ let _cached_encoder_for_Result_list_Item = null; /* END_OF_SYMBOL_DEFINITION _cached_encoder_for_Result_list_Item */ /* START_OF_SYMBOL_DEFINITION _encode_Result_list_Item */ /** * @summary Encodes a(n) Result_list_Item 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 Result_list_Item, encoded as an ASN.1 Element. */ function _encode_Result_list_Item(value, elGetter) { if (!_cached_encoder_for_Result_list_Item) { _cached_encoder_for_Result_list_Item = function (value, elGetter) { return $._encodeSequence([] .concat([ /* REQUIRED */ $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 0, () => Result_ta_1._encode_Result, $.BER)(value.result, $.BER), /* IF_ABSENT */ value.transfer_syntax_name === undefined ? undefined : $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 1, () => Transfer_syntax_name_ta_1._encode_Transfer_syntax_name, $.BER)(value.transfer_syntax_name, $.BER), /* IF_ABSENT */ value.provider_reason === undefined ? undefined : $._encode_implicit(asn1_ts_1.ASN1TagClass.context, 2, () => Result_list_Item_provider_reason_ta_1._encode_Result_list_Item_provider_reason, $.BER)(value.provider_reason, $.BER), ]) .filter((c) => !!c), $.BER); }; } return _cached_encoder_for_Result_list_Item(value, elGetter); } exports._encode_Result_list_Item = _encode_Result_list_Item; /* END_OF_SYMBOL_DEFINITION _encode_Result_list_Item */ /* eslint-enable */ //# sourceMappingURL=Result-list-Item.ta.js.map